first commit

This commit is contained in:
2025-10-26 23:10:15 +08:00
commit 8f0345b7be
14961 changed files with 2356381 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=string_utils.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"string_utils.d.ts","sourceRoot":"","sources":["../../src/utils/string_utils.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1,26 @@
/** @internal */
export function escapeForWithinString(str, quoteKind) {
let result = "";
// todo: reduce appends (don't go char by char)
for (let i = 0; i < str.length; i++) {
if (str[i] === quoteKind) {
result += "\\";
}
else if (str[i] === "\r" && str[i + 1] === "\n") {
result += "\\r\\n\\";
i++; // skip the \r
}
else if (str[i] === "\n") {
result += "\\n\\";
}
else if (str[i] === "\\") {
result += "\\";
}
result += str[i];
}
return result;
}
/** @internal */
export function getStringFromStrOrFunc(strOrFunc) {
return strOrFunc instanceof Function ? strOrFunc() : strOrFunc;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"string_utils.test.d.ts","sourceRoot":"","sources":["../../src/utils/string_utils.test.ts"],"names":[],"mappings":""}