Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/inventory.picotech.app/public_html/node_modules/es-abstract/2020/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var callBound = require('call-bind/callBound');
var ToLength = require('./ToLength');
var ToString = require('./ToString');
var $strSlice = callBound('String.prototype.slice');
// https://262.ecma-international.org/11.0/#sec-stringpad
module.exports = function StringPad(O, maxLength, fillString, placement) {
if (placement !== 'start' && placement !== 'end') {
throw new $TypeError('Assertion failed: `placement` must be "start" or "end"');
}
var S = ToString(O);
var intMaxLength = ToLength(maxLength);
var stringLength = S.length;
if (intMaxLength <= stringLength) {
return S;
}
var filler = typeof fillString === 'undefined' ? ' ' : ToString(fillString);
if (filler === '') {
return S;
}
var fillLen = intMaxLength - stringLength;
// the String value consisting of repeated concatenations of filler truncated to length fillLen.
var truncatedStringFiller = '';
while (truncatedStringFiller.length < fillLen) {
truncatedStringFiller += filler;
}
truncatedStringFiller = $strSlice(truncatedStringFiller, 0, fillLen);
if (placement === 'start') {
return truncatedStringFiller + S;
}
return S + truncatedStringFiller;
};
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0042 ]-- |