mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2026-01-30 04:11:32 -08:00
Fix str.length strEndsWith bug (#2572)
This was some how missed in dev testing I guess. @buggyj suggested this. Should fix #2571
This commit is contained in:
parent
b9299309cc
commit
f1090d749e
1 changed files with 1 additions and 1 deletions
|
|
@ -718,7 +718,7 @@ exports.strEndsWith = function(str,ending,position) {
|
|||
if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > str.length) {
|
||||
position = str.length;
|
||||
}
|
||||
position -= str.length;
|
||||
position -= ending.length;
|
||||
var lastIndex = str.indexOf(ending, position);
|
||||
return lastIndex !== -1 && lastIndex === position;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue