openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
21 lines (20 loc) • 1.33 kB
JavaScript
import { r as asNullableRecord } from "./record-coerce-CVPuDqcc.mjs";
import { createAsyncLock as createAsyncLock$1 } from "@openclaw/fs-safe/advanced";
import { JsonFileReadError, readJson, readJsonIfExists, readJsonIfExists as readDurableJsonFile, readJsonSync, readRootJsonObjectSync as readRootJsonObjectSync$1, tryReadJson, tryReadJson as readJsonFile, tryReadJsonSync, tryReadJsonSync as tryReadJsonSync$1, writeJson, writeJson as writeJsonAtomic, writeJsonSync as writeJsonSync$1 } from "@openclaw/fs-safe/json";
import { writeTextAtomic } from "@openclaw/fs-safe/atomic";
//#region src/infra/json-files.ts
function tryReadJsonObjectSync(e) {
return asNullableRecord(tryReadJsonSync(e));
}
const writeTextAtomic$1 = async (e, t, n) => {
await writeTextAtomic(e, t, {
mode: n?.mode,
dirMode: n?.dirMode,
trailingNewline: n?.trailingNewline,
durable: n?.durable,
beforeRename: n?.beforeRename || void 0,
tempPrefix: n?.tempPrefix || void 0
});
};
//#endregion
export { readJsonFile as a, readRootJsonObjectSync$1 as c, tryReadJsonSync$1 as d, writeJson as f, writeTextAtomic$1 as h, readJson as i, tryReadJson as l, writeJsonSync$1 as m, createAsyncLock$1 as n, readJsonIfExists as o, writeJsonAtomic as p, readDurableJsonFile as r, readJsonSync as s, JsonFileReadError as t, tryReadJsonObjectSync as u };