mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-24 17:10:29 +00: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
@ -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…
Reference in New Issue
Block a user