Zero-dependency TypeScript library providing professional body registries, data protection law details, and jurisdiction intelligence for 28 countries. Published as jurisdiction-kit on npm via forgesworn/anvil.
Single-source-file library:
src/jurisdictions.ts— all types, data, and query functions in one file. TheJURISDICTIONSconstant is a frozenRecord<string, Jurisdiction>containing 28 country entries, each with professional bodies, data protection laws, child protection rules, mutual recognition partners, and metadata.src/index.ts— re-exports everything fromjurisdictions.ts.tests/jurisdictions.test.ts— 54 tests (vitest) covering all query functions and data integrity.
Each jurisdiction entry contains:
- Core metadata: ISO 3166-1 alpha-2 code, English name, local name, legal system type, languages (ISO 639-1), currency (ISO 4217).
- Professional bodies: Array of
ProfessionalBodyobjects — id, name, abbreviation, profession type, website, public register availability, digital credential issuance. - Data protection law:
DataProtectionLawobject — law name, year, consent requirements, breach notification hours, erasure/portability rights, cross-border restrictions, supervisory authority. - Child protection:
ChildProtectionLawobject — digital consent age, age of majority, parental consent requirements, enhanced protections, profiling restrictions. - Mutual recognition: Array of ISO codes for jurisdictions with formal credential recognition agreements.
- E-signature recognition: Boolean flag.
Professional body definitions are declared as typed arrays (e.g. UK_BODIES, US_BODIES) above the JURISDICTIONS constant, then referenced in jurisdiction entries.
npm install
npm run build # tsc → dist/
npm run typecheck # tsc --noEmit
npm test # vitest run (54 tests)- British English — colour, normalise, licence, recognise, authorise.
- Commit messages —
type: descriptionformat (e.g.feat:,fix:,docs:,refactor:,chore:). - No Co-Authored-By lines in commits.
- Branching — work on feature/fix branches, merge to main only when complete.
forgesworn/anvil@v0auto-publishes on push to main. - Zero runtime dependencies — the library must stay dependency-free.
- Single source file — all jurisdiction data and query functions live in
src/jurisdictions.ts. Do not split into multiple files unless there is a strong reason. - JURISDICTIONS is frozen —
Object.freeze(JURISDICTIONS)is called at module scope. Do not remove this.
- Define the professional bodies array (e.g.
const XX_BODIES: ProfessionalBody[] = [...]). - Define data protection and child protection objects.
- Add the entry to the
JURISDICTIONSrecord. - Add test coverage in
tests/jurisdictions.test.ts— at minimum, verify the jurisdiction loads and has required fields (the data integrity test covers this automatically).
All query functions accept ISO 3166-1 alpha-2 codes and are case-insensitive. Unknown jurisdiction codes return undefined, empty arrays, or safe defaults (never throw).
- Org: forgesworn
- Repo:
https://github.com/forgesworn/jurisdiction-kit - CI: GitHub Actions (
.github/workflows/ci.yml) — build, typecheck, test on Node 24. - Publishing:
forgesworn/anvil@v0(auto-release.ymlbumps version and creates a GitHub Release;release.ymlruns pre-publish gates and publishes to npm via OIDC trusted publishing).