Socket
Socket
Sign inDemoInstall

erreur

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

erreur - npm Package Compare versions

Comparing version 2.0.0-4 to 2.0.0-5

2

dist/mod.d.ts

@@ -29,2 +29,3 @@ declare const INTERNAL: unique symbol;

static readonly isOneOf: typeof isOneOf;
static readonly isOneOfObj: typeof isOneOfObj;
static readonly match: typeof match;

@@ -53,2 +54,3 @@ static readonly matchObj: typeof matchObj;

declare function isOneOf(error: unknown, types: ErreurTypeAny[]): error is Erreur;
declare function isOneOfObj(error: unknown, types: TypesBase): error is Erreur;
declare function match<Data>(error: unknown, type: ErreurType<Data>): Data | null;

@@ -55,0 +57,0 @@ declare type TypesBase = Record<string, ErreurTypeAny>;

@@ -68,2 +68,3 @@ var __defProp = Object.defineProperty;

Erreur.isOneOf = isOneOf;
Erreur.isOneOfObj = isOneOfObj;
Erreur.match = match;

@@ -124,2 +125,8 @@ Erreur.matchObj = matchObj;

}
function isOneOfObj(error, types) {
if (error instanceof Erreur) {
return Object.values(types).some((type) => error[INTERNAL].type[INTERNAL] === type[INTERNAL]);
}
return false;
}
function match(error, type) {

@@ -126,0 +133,0 @@ if (error instanceof Erreur) {

2

package.json
{
"name": "erreur",
"version": "2.0.0-4",
"version": "2.0.0-5",
"description": "Type safe custom errors",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc