Fix endsWith bug
This commit is contained in:
parent
919e31a264
commit
df59058812
|
@ -3120,6 +3120,6 @@ namespace ts {
|
|||
|
||||
export function endsWith(str: string, suffix: string): boolean {
|
||||
const expectedPos = str.length - suffix.length;
|
||||
return str.indexOf(suffix, expectedPos) === expectedPos;
|
||||
return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue