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

Function createOrUpdateFile

ark/attest/cache/utils.ts:167–175  ·  view source on GitHub ↗
(
	env: tsvfs.VirtualTypeScriptEnvironment,
	fileName: string,
	fileText: string
)

Source from the content-addressed store, hash-verified

165}
166
167export const createOrUpdateFile = (
168 env: tsvfs.VirtualTypeScriptEnvironment,
169 fileName: string,
170 fileText: string
171): ts.SourceFile | undefined => {
172 if (env.sys.fileExists(fileName)) env.updateFile(fileName, fileText)
173 else env.createFile(fileName, fileText)
174 return env.getSourceFile(fileName)
175}
176
177declare module "typescript" {
178 interface SourceFile {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected