Skip to content

Commit e79f6d6

Browse files
committed
fix code quality
1 parent efb5fde commit e79f6d6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rollup/polyfills/es5.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if (!('startsWith' in String.prototype)) {
3434
}
3535
if (!('endsWith' in String.prototype)) {
3636
String.prototype.endsWith = function (searchElement) {
37-
return this.indexOf(searchElement) === this.length - searchElement.length;
37+
var i = this.indexOf(searchElement);
38+
return i > -1 && i === this.length - searchElement.length;
3839
};
3940
}

0 commit comments

Comments
 (0)