diff options
Diffstat (limited to 'node_modules/babel-register/node_modules/core-js/modules/_string-pad.js')
-rw-r--r-- | node_modules/babel-register/node_modules/core-js/modules/_string-pad.js | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/node_modules/babel-register/node_modules/core-js/modules/_string-pad.js b/node_modules/babel-register/node_modules/core-js/modules/_string-pad.js deleted file mode 100644 index ceb6077f0..000000000 --- a/node_modules/babel-register/node_modules/core-js/modules/_string-pad.js +++ /dev/null @@ -1,16 +0,0 @@ -// https://github.com/tc39/proposal-string-pad-start-end -var toLength = require('./_to-length'); -var repeat = require('./_string-repeat'); -var defined = require('./_defined'); - -module.exports = function (that, maxLength, fillString, left) { - var S = String(defined(that)); - var stringLength = S.length; - var fillStr = fillString === undefined ? ' ' : String(fillString); - var intMaxLength = toLength(maxLength); - if (intMaxLength <= stringLength || fillStr == '') return S; - var fillLen = intMaxLength - stringLength; - var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); - if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); - return left ? stringFiller + S : S + stringFiller; -}; |