theia
Version:
Finds all npm modules in your directory and detects packages that are missing from your package.json
21 lines (17 loc) • 596 B
JavaScript
/*eslint-disable no-extend-native*/
/*This is ok since its a polyfill.*/
;
module.exports = function () {
// Polyfill for endsWith
if (!String.prototype.endsWith) {
String.prototype.endsWith = function (searchString, position) {
var subjectString = this.toString();
if (position === undefined || position > subjectString.length) {
position = subjectString.length;
}
position -= searchString.length;
var lastIndex = subjectString.indexOf(searchString, position);
return lastIndex !== -1 && lastIndex === position;
};
}
}();