INNER CODE UNIT · TypeScript
removeFailureWasSideEffectFree
totec448-spec/chat-on-steroids · src/main/codex/apply-patch/index.ts:402
async function removeFailureWasSideEffectFree(
path: string,
expectedContent: string | null
): Promise<boolean> {
if (expectedContent === null) return false;
try {
return (await readFileText(path)) === expectedContent;
} catch {
return false;
}
}
async function readOptionalFileTextForDelta(path: string, delta: AppliedPatchDelta): Promise<string | null> {
await noteExistingPathDeltaSupport(path, delta);
try {
return await readFileText(path);
} catch (error) {
if (errorCode(error) === 'ENOENT') return null;