Configring node js.
This commit is contained in:
16
node_modules/core-js/modules/_string-pad.js
generated
vendored
Normal file
16
node_modules/core-js/modules/_string-pad.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// https://github.com/tc39/proposal-string-pad-start-end
|
||||
var toLength = require('./_to-length')
|
||||
, repeat = require('./_string-repeat')
|
||||
, defined = require('./_defined');
|
||||
|
||||
module.exports = function(that, maxLength, fillString, left){
|
||||
var S = String(defined(that))
|
||||
, stringLength = S.length
|
||||
, fillStr = fillString === undefined ? ' ' : String(fillString)
|
||||
, intMaxLength = toLength(maxLength);
|
||||
if(intMaxLength <= stringLength || fillStr == '')return S;
|
||||
var fillLen = intMaxLength - stringLength
|
||||
, stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
|
||||
if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen);
|
||||
return left ? stringFiller + S : S + stringFiller;
|
||||
};
|
||||
Reference in New Issue
Block a user