INNER CODE UNIT · TypeScript
ensureNotDirectory
totec448-spec/chat-on-steroids · src/main/codex/apply-patch/index.ts:397
async function ensureNotDirectory(path: string): Promise<void> {
const metadata = await getMetadata(path);
if (metadata.isDirectory) throw invalidInput('path is a directory');
}
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> {