JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 826
  • Score
    100M100P100Q98483F
  • License MIT

Type-safe nothing-handling and error-handling library

Package Exports

  • @patina/core
  • @patina/core/package.json

Readme

Similar libraries

Other useful libraries

Testing

Adding an iterator to the Result class has introduced behavior that affects how testing libraries handle deep comparisons of instances of this class. This is interfering with how deep equality checks are performed, as the tests rely on iterating over object properties or their prototypes to determine equality.

This means asserting equality between any two instances of the Result class will always pass, even if the instances are not equal:

expect(Ok()).toEqual(Ok(1));
expect(Err()).toEqual(Err(1));
expect(Ok()).toEqual(Err());

To properly test equality between instances of the Result class, you can unwrap the value and compare it directly:

expect(Ok().unwrap()).toEqual(Ok(1).unwrap()); // Now fails as expected