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.js
T

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;