diff options
Diffstat (limited to 'node_modules/locutus/php/strings/strrpos.js')
-rw-r--r-- | node_modules/locutus/php/strings/strrpos.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/node_modules/locutus/php/strings/strrpos.js b/node_modules/locutus/php/strings/strrpos.js deleted file mode 100644 index ccabd92..0000000 --- a/node_modules/locutus/php/strings/strrpos.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -module.exports = function strrpos(haystack, needle, offset) { - // discuss at: http://locutus.io/php/strrpos/ - // original by: Kevin van Zonneveld (http://kvz.io) - // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman) - // bugfixed by: Brett Zamir (http://brett-zamir.me) - // input by: saulius - // example 1: strrpos('Kevin van Zonneveld', 'e') - // returns 1: 16 - // example 2: strrpos('somepage.com', '.', false) - // returns 2: 8 - // example 3: strrpos('baa', 'a', 3) - // returns 3: false - // example 4: strrpos('baa', 'a', 2) - // returns 4: 2 - - var i = -1; - if (offset) { - i = (haystack + '').slice(offset).lastIndexOf(needle); // strrpos' offset indicates starting point of range till end, - // while lastIndexOf's optional 2nd argument indicates ending point of range from the beginning - if (i !== -1) { - i += offset; - } - } else { - i = (haystack + '').lastIndexOf(needle); - } - return i >= 0 ? i : false; -}; -//# sourceMappingURL=strrpos.js.map
\ No newline at end of file |