Full TypeScript modernization of eid.js.
New
- TypeScript with full type declarations (.d.ts)
- ESM + CommonJS + IIFE browser bundle
- ES2022
Error.causesupport in all exceptions tryToExecutepreserves original error as.cause- Vitest test suite (59 tests, 100% coverage)
- Biome lint/format
- GitHub Actions CI (Node 20 + 22)
typecheckscript (tsc --noEmit)
Fixed
- Off-by-one in
checkElementIndex(index equal to size now correctly rejected) - Format string injection in
Eidmessage formatting
Breaking
- Minimum Node.js version: 20
- Bower support removed
- Gulp build removed
- Travis CI removed
Migration
require('eid.js')still works (CJS supported)Eid.preconditionsandEid.exceptionsstill work for backward compatibility- New recommended import:
import { Eid, EidPreconditions } from "eid.js"