refactor: remove startsWith/endsWith

v1.18.x
Barış Soner Uşaklı 4 years ago
parent b5a6a3149d
commit 48bc23c065

@ -769,27 +769,5 @@
},
};
/* eslint "no-extend-native": "off" */
if (typeof String.prototype.startsWith !== 'function') {
String.prototype.startsWith = function (prefix) {
if (this.length < prefix.length) {
return false;
}
return this.slice(0, prefix.length) === prefix;
};
}
if (typeof String.prototype.endsWith !== 'function') {
String.prototype.endsWith = function (suffix) {
if (this.length < suffix.length) {
return false;
}
if (suffix.length === 0) {
return true;
}
return this.slice(-suffix.length) === suffix;
};
}
return utils;
}));

Loading…
Cancel
Save