From 954583f3d56fbfb60321725f13ad092e536e3737 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 7 Nov 2018 22:10:16 +0100 Subject: Removed node_modules --- node_modules/locutus/php/strings/str_pad.js | 49 ----------------------------- 1 file changed, 49 deletions(-) delete mode 100644 node_modules/locutus/php/strings/str_pad.js (limited to 'node_modules/locutus/php/strings/str_pad.js') diff --git a/node_modules/locutus/php/strings/str_pad.js b/node_modules/locutus/php/strings/str_pad.js deleted file mode 100644 index a3afa23..0000000 --- a/node_modules/locutus/php/strings/str_pad.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -module.exports = function str_pad(input, padLength, padString, padType) { - // eslint-disable-line camelcase - // discuss at: http://locutus.io/php/str_pad/ - // original by: Kevin van Zonneveld (http://kvz.io) - // improved by: Michael White (http://getsprink.com) - // input by: Marco van Oort - // bugfixed by: Brett Zamir (http://brett-zamir.me) - // example 1: str_pad('Kevin van Zonneveld', 30, '-=', 'STR_PAD_LEFT') - // returns 1: '-=-=-=-=-=-Kevin van Zonneveld' - // example 2: str_pad('Kevin van Zonneveld', 30, '-', 'STR_PAD_BOTH') - // returns 2: '------Kevin van Zonneveld-----' - - var half = ''; - var padToGo; - - var _strPadRepeater = function _strPadRepeater(s, len) { - var collect = ''; - - while (collect.length < len) { - collect += s; - } - collect = collect.substr(0, len); - - return collect; - }; - - input += ''; - padString = padString !== undefined ? padString : ' '; - - if (padType !== 'STR_PAD_LEFT' && padType !== 'STR_PAD_RIGHT' && padType !== 'STR_PAD_BOTH') { - padType = 'STR_PAD_RIGHT'; - } - if ((padToGo = padLength - input.length) > 0) { - if (padType === 'STR_PAD_LEFT') { - input = _strPadRepeater(padString, padToGo) + input; - } else if (padType === 'STR_PAD_RIGHT') { - input = input + _strPadRepeater(padString, padToGo); - } else if (padType === 'STR_PAD_BOTH') { - half = _strPadRepeater(padString, Math.ceil(padToGo / 2)); - input = half + input + half; - input = input.substr(0, padLength); - } - } - - return input; -}; -//# sourceMappingURL=str_pad.js.map \ No newline at end of file -- cgit v1.2.3