UNPKG

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
/*eslint-disable no-extend-native*/ /*This is ok since its a polyfill.*/ 'use strict'; 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; }; } }();