123456789101112131415161718192021222324252627282930313233343536373839 |
- import createPadding from './_createPadding.js';
- import stringSize from './_stringSize.js';
- import toInteger from './toInteger.js';
- import toString from './toString.js';
- function padStart(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- return (length && strLength < length)
- ? (createPadding(length - strLength, chars) + string)
- : string;
- }
- export default padStart;
|