MCPcopy Create free account
hub / github.com/arktypeio/arktype / rewriteFile

Function rewriteFile

ark/fs/fs.ts:36–39  ·  view source on GitHub ↗
(
	path: string,
	transform: (contents: string) => string
)

Source from the content-addressed store, hash-verified

34}
35
36export const rewriteFile = (
37 path: string,
38 transform: (contents: string) => string
39): string => writeFile(path, transform(readFile(path)))
40
41export const readJson = (path: string): Record<string, unknown> =>
42 JSON.parse(readFileSync(path, { encoding: "utf8" }))

Callers 2

headChangelogFunction · 0.90
bump.tsFile · 0.90

Calls 3

writeFileFunction · 0.85
readFileFunction · 0.70
transformFunction · 0.50

Tested by

no test coverage detected