ts-extended-errors
Updates mentioning ts-extended-errors. See the repository ↗ for commits and releases.
ts-extended-errors 1.0.0
ts-extended-errors is 1.0. The API that shipped through 0.x is now stable:
ExtendedError,defineError, the cause-chain helpers,serializeError,deserializeError,toError,isErrorLike,describeValueand the exported types. From here, a breaking change to any of them, to the serialized shape, or to the defaults oftoJSONandserializeErrormeans a new major.The one breaking change is the runtime floor: Node.js 22.12 or newer. The library uses no Node.js APIs, so browsers and other runtimes are unaffected.
1.0 also types
codeas the literal a class declares, so aswitchover a taxonomy’s codes can be exhaustive; accepts aninterfaceas acontexttype; and keeps a numericcodethrough a JSON round trip.Jonatan Kruszewski
Leaner builds and stricter gates across the libraries
overlock and use-everywhere now build with tsdown instead of tsup (overlock 0.10.1, use-everywhere 1.0.1). The published output keeps its shape: same entry points, formats, filenames and types. overlock’s tarball is smaller, because code shared by its two entries is no longer duplicated.
Every library’s CI now gates on knip and sherif. knip fails on unused files, exports and dependencies. sherif fails when two packages in a workspace disagree on a dependency’s version. The first pass removed internal exports nothing imported (overlock 0.10.2,
@use-everywhere/core1.0.2), none of them part of the public API.Jonatan Kruszewski
ts-extended-errors is on npm and rxova.org
ts-extended-errors is public. It is a zero-dependency error model for TypeScript applications that throw native exceptions but need more from them:
- typed context:
defineError, with amessageoption that writes the message from the context; - cause-chain inspection;
- JSON round trips:
serializeErroranddeserializeErrorrebuild errors as their own classes, includingAggregateError.
Install it with
npm install ts-extended-errors. Every version is on npm under that name, so no.npmrcline is needed. Its docs are at/packages/ts-extended-errors/, and it appears on the rxova.org landing page.0.4.4 hardens the part that matters most in an error handler: a getter, proxy trap or prototype check that throws while inspecting an unknown value no longer replaces the original failure.
Jonatan Kruszewski
- typed context:
No entries match those filters.