New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@patina/std

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@patina/std

Type-safe nothing-handling and error-handling library

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

Similar libraries

  • @badrap/result
  • effect
  • neverthrow
  • option-t
  • oxide.ts
  • true-myth
  • ts-results

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

Keywords

typescript

FAQs

Package last updated on 30 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts