MCPcopy Create free account
hub / github.com/backnotprop/plannotator / sourceFileSnapshotFromText

Function sourceFileSnapshotFromText

packages/shared/source-save-node.ts:72–81  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

70}
71
72export function sourceFileSnapshotFromText(text: string): SourceFileSnapshot {
73 const bytes = Buffer.from(text, "utf8");
74 return {
75 text,
76 hash: hashSourceBytes(bytes),
77 mtimeMs: 0,
78 size: bytes.byteLength,
79 eol: detectSourceEol(text),
80 };
81}
82
83export function resolveFolderSourceFile(filePath: string, folderPath: string): string | null {
84 if (!isSourceSaveFilePath(filePath)) return null;

Callers 1

Calls 2

hashSourceBytesFunction · 0.85
detectSourceEolFunction · 0.85

Tested by

no test coverage detected