/*
Maintains packages/fingerprint/src/normalizers/typescript.ts as an authored fingerprint authored module so agents can evolve it without rediscovering local boundaries.
- Do not hash raw bytes — that is the binary normalizer's job.
- RFC-0364: initial TypeScript AST normalizer.
*/
import { parse } from "@typescript-eslint/typescript-estree";
import { byteHash } from "@warpgogol/werkstatt-shared/fingerprint";
export function normalizeTypeScript(content: string): string {
const ast = parse(content, {
loc: false,
range: false,
comment: false,
tokens: false,
});
return byteHash(JSON.stringify(ast));
}