This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
StasisWarden-Legacy/node_modules/es-toolkit/dist/string/trimStart.mjs
T

23 lines
556 B
JavaScript

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);
}
export { trimStart };