# Duplicate-row checker v1

Find exact duplicate rows in a literal tab-separated table. This dependency-free
ES module runs locally in Node 18+ or modern JavaScript. Save
`duplicate-row-checker.mjs` beside `duplicate-row-example.mjs`:

```js
import assert from 'node:assert/strict';
import { checkDuplicateRows } from './duplicate-row-checker.mjs';

const result = checkDuplicateRows('001\tAda\n002\tBo\n001\tAda\n');
assert.deepEqual(result, {
  lines: ['Duplicate rows 1, 3.'],
  checked: 3,
  issues: 1,
});
console.log(result.lines.join('\n'));
```

Run `node duplicate-row-example.mjs`. Every row is data, including a header if
provided. Matching is exact, including case, spaces, leading zeros, and blank
cells. Row numbers are one-based. Each duplicate group reports all its row
positions in order; groups appear in first-occurrence order. `checked` counts
rows, and `issues` counts repeated rows beyond the first in each group.

CRLF and bare CR line endings normalize to LF. One final newline is a terminator
rather than a data row; additional blank rows remain data. A tab separates
literal cells and a newline separates rows. Quoting, escaped tabs, and embedded
newlines are not parsed: CSV or quoted TSV requires conversion before use.
All rows must have the same number of columns, including trailing empty cells.
Empty input and ragged tables throw. Limits: 100,000 JavaScript string characters
(UTF-16 code units), 500 rows, and 500 columns per row.

The module only reports exact duplicates. It does not remove rows, normalize
values, choose key columns, detect approximate matches, import files, or certify
that a spreadsheet is safe. It makes no network calls, reads no files, and sends
no telemetry. There are no runtime dependencies; the browser core's TypeScript
result-type import is erased during generation.

Generate from `site/lib/duplicate-rows.ts` with
`node scripts/build-duplicate-row-checker.mjs`; verify byte parity with
`node scripts/build-duplicate-row-checker.mjs --check`. A source download is not
evidence that somebody ran it locally.

## License

MIT License

Copyright (c) 2026 QuasiLife

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
