mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-20 21:31:37 +00:00
36 lines
826 B
TypeScript
36 lines
826 B
TypeScript
// Focused low-level text/runtime helpers used by bundled plugins.
|
|
|
|
/** Escapes text for safe insertion into HTML text and quoted attribute values. */
|
|
export function escapeHtml(value: string): string {
|
|
return value
|
|
.replaceAll("&", "&")
|
|
.replaceAll("<", "<")
|
|
.replaceAll(">", ">")
|
|
.replaceAll('"', """)
|
|
.replaceAll("'", "'");
|
|
}
|
|
|
|
export {
|
|
CONFIG_DIR,
|
|
clamp,
|
|
clampInt,
|
|
clampNumber,
|
|
displayPath,
|
|
displayString,
|
|
ensureDir,
|
|
escapeRegExp,
|
|
normalizeE164,
|
|
pathExists,
|
|
resolveConfigDir,
|
|
resolveHomeDir,
|
|
resolveUserPath,
|
|
safeParseJson,
|
|
shortenHomeInString,
|
|
shortenHomePath,
|
|
sleep,
|
|
sliceUtf16Safe,
|
|
truncateUtf16Safe,
|
|
} from "../utils.js";
|
|
export { fetchWithTimeout } from "../utils/fetch-timeout.js";
|
|
export { withTimeout } from "../utils/with-timeout.js";
|