diff --git a/lib/sealed-join.ts b/lib/sealed-join.ts index 24e8afeba..3c048ddf4 100644 --- a/lib/sealed-join.ts +++ b/lib/sealed-join.ts @@ -136,7 +136,7 @@ export function fileRecords(file: string, text: string): Field[][] | null { /** Joined-record fingerprints of one file's text; null when it cannot be checked. */ export function fileJoins(file: string, text: string, p: JoinPolicy): Joins | null { - const folded = normalizeKey(text); + const folded = normalizeKey(text.replace(/"/g, '')); if (!text.includes('\\u') && !p.label_keys.some(k => folded.includes(normalizeKey(k)))) return new Map(); const records = fileRecords(file, text); if (!records) return null; diff --git a/test/sealed-join.test.ts b/test/sealed-join.test.ts index f53ad620f..3b92ce1a8 100644 --- a/test/sealed-join.test.ts +++ b/test/sealed-join.test.ts @@ -88,6 +88,7 @@ describe('formats and matching', () => { 'k.jsonl': `{"${HEAD_B}":{"stratum":"seeded"}}\n`, 'l.json': '{"units":{"unit-one":{"stratum":"decoy"}}}\n', 'm.tsv': '"Stratum"\t"head"\n"decoy"\t"5b7db3a"\n', + 'n.csv': '"Strat"um,head\ndecoy,5b7db3a\n', 'tsconfig.json': '{\n // a comment, so not strict JSON\n "compilerOptions": { "strict": true }\n}\n', }); expect(found(s).sort((a, b) => a.file.localeCompare(b.file))).toEqual([ @@ -99,6 +100,7 @@ describe('formats and matching', () => { { rule: 'sealed.label_join', file: 'j.json', commit: sha, keys: ['stratum', 'tags', '(key)'] }, { rule: 'sealed.label_join', file: 'k.jsonl', commit: sha, keys: ['stratum', '(key)'] }, { rule: 'sealed.label_join', file: 'm.tsv', commit: sha, keys: ['stratum', 'head'] }, + { rule: 'sealed.label_join', file: 'n.csv', commit: sha, keys: ['stratum', 'head'] }, ]); });