MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / writeJsonFile

Function writeJsonFile

scripts/studio-host-provider.mjs:675–681  ·  view source on GitHub ↗
(file, value, mode)

Source from the content-addressed store, hash-verified

673}
674
675async function writeJsonFile(file, value, mode) {
676 await fs.promises.mkdir(path.dirname(file), { recursive: true, mode: 0o700 });
677 await fs.promises.writeFile(file, `${JSON.stringify(value, null, 2)}\n`, {
678 mode,
679 });
680 await fs.promises.chmod(file, mode);
681}
682
683function clampCapacity(value) {
684 if (!Number.isFinite(value)) {

Callers 1

connectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected