Files
2025-11-28 19:45:44 -07:00

27 lines
654 B
JavaScript

'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function trimStart(str, chars) {
if (chars === undefined) {
return str.trimStart();
}
let startIndex = 0;
switch (typeof chars) {
case 'string': {
while (startIndex < str.length && str[startIndex] === chars) {
startIndex++;
}
break;
}
case 'object': {
while (startIndex < str.length && chars.includes(str[startIndex])) {
startIndex++;
}
}
}
return str.substring(startIndex);
}
exports.trimStart = trimStart;