# JSON record checker v1

A dependency-free JavaScript module for inspecting a pasted JSON array of
objects before choosing a column mapping. It works offline in a modern browser
or Node.js 18+. It makes no network requests, reads no files and has no
telemetry. This is the same implementation as the bulldo.gs browser checker.

Save `json-checker.mjs` beside your script. For example, save this as
`check.mjs` and run `node check.mjs`:

```js
import { checkJsonSchema } from './json-checker.mjs';

const result = checkJsonSchema('[{"id":1,"name":"Ada"},{"id":2,"name":null}]');
console.log(result);
// { lines: ['Row 2: key "name" has null; first observed value is string'], checked: 2, issues: 1 }
```

`checkJsonSchema(jsonText)` returns `{ lines, checked, issues }`. `checked` is
the number of records. `lines` lists empty objects, missing keys, value types
that differ from the first observed type for each key, and nested arrays or
objects that need explicit column mapping. `issues` is the number of lines.
Missing keys do not set the first observed type. A `null` value is present and
has type `null`. Errors are thrown for invalid input or exceeded limits.

Input must be a nonempty JSON array containing only object records. Limits are
100,000 input characters, 500 records, 10,000 record-field comparisons
(`records × distinct keys`), and 100,000 output characters across findings.
Input length and output length are JavaScript string lengths. The checker does
not apply a JSON Schema, detect duplicate JSON keys, preserve numeric precision
beyond `JSON.parse`, validate business rules, or convert records to a table.

Source build in the repository: `node scripts/build-json-checker.mjs`.
Check byte parity: `node scripts/build-json-checker.mjs --check`.
Local execution is not observable by bulldo.gs; a download is not evidence of use.

## 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.
