Skip to content

finity-core v0.0.13

Choose a tag to compare

@github-actions github-actions released this 21 Nov 19:00
Immutable release. Only release title and notes can be modified.
2b2add2

New

  • FinityError is the abstract base of every error finity creates, and its subclasses live in its namespace: FinityError.InvalidTransitionError. instanceof FinityError matches any of them.
    import { FinityError } from "@ghostry/finity-core";
    
    if (error instanceof FinityError.InvalidTransitionError) {
      report(error.reason, error.state.to.kind);
    }
    • The top-level InvalidTransitionError export is deprecated. It's the same class as FinityError.InvalidTransitionError, so existing imports and instanceof checks keep working.

Behavior change

  • An InvalidTransitionError's .name is "@ghostry/finity-core:InvalidTransitionError", where it was "Error". The name identifies the error where instanceof can't: across two installed copies of finity-core, or after the error is serialized.

Compatibility

  • onInvalidTransition's parameter is typed FinityError.InvalidTransitionError, the same class as before.
  • package.json declares engines.node >=20.0.0 and sideEffects: false.

Internal

  • Each finity package has its own version and release, tagged finity-core/vX.Y.Z. Releases up to v0.0.12 covered all three packages under one version.

Docs: FinityError, FinityError.InvalidTransitionError, Public API