openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
21 lines (20 loc) • 1.06 kB
JavaScript
import path from "node:path";
import { readRegularFile as readRegularFile$1, statRegularFile } from "@openclaw/fs-safe/advanced";
import { isPathInside as isPathInside$1 } from "@openclaw/fs-safe/path";
import { root as root$1 } from "@openclaw/fs-safe/root";
import { walkDirectory as walkDirectory$1 } from "@openclaw/fs-safe/walk";
//#region packages/memory-host-sdk/src/host/fs-utils.ts
function normalizeComparablePath(e) {
const t = path.resolve(e);
return process.platform === "win32" ? t.toLowerCase() : t;
}
/**
* True for missing-file errors emitted by Node or fs-safe.
* The narrowed union stays stable; extra-path authorization handles `not-file` separately.
*/
function isFileMissingError(e) {
if (!e || typeof e !== "object" || !("code" in e)) return false;
return e.code === "ENOENT" || e.code === "ENOTDIR" || e.code === "not-file" || e.code === "not-found";
}
//#endregion
export { root$1 as a, readRegularFile$1 as i, isPathInside$1 as n, statRegularFile as o, normalizeComparablePath as r, walkDirectory$1 as s, isFileMissingError as t };