/** * Duplicate-key detection for JSON text. * * `JSON.parse` resolves `{"a":1,"a":2}` to `{a: 2}` silently. For a manifest * that is unacceptable: two peers reading the same bytes could disagree about * which artifact digest a worker claimed, and a digest computed after parsing * would attest to only one of them. Duplicate keys are therefore rejected * while the text is still text. * * The scanner is a structural pass, not a full parser — it locates strings and * object boundaries well enough to collect key names per object, and leaves * every other validity question to `JSON.parse`, which runs afterwards. * * @module worker/manifest/json-scan */ /** * Report the first duplicate key in JSON text, or `undefined` when every * object has unique keys. * * Malformed text yields `undefined` rather than a diagnosis: this pass only * answers the duplicate-key question, and `JSON.parse` gives a better message * for everything else. Text nested deeper than * {@link MAX_JSON_SCAN_NESTING_DEPTH} is treated the same way — the scan * bails before the open-container stack can grow without bound. */ export declare function findDuplicateJsonKey(text: string): string | undefined;