New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@santi100/assertion-lib

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@santi100/assertion-lib - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

4

CHANGELOG.md

@@ -26,1 +26,5 @@ # Changelog

- Added `assertMatch` and `assertDefined`.
## Version 2.0.2
- Fixed circular dependency bug with `assertTypeOf` and `assertOneOf`.

2

cjs/core.d.ts

@@ -1,2 +0,2 @@

export declare type Type = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function';
export type Type = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function';
export declare class AssertionError<E = unknown, A = unknown> extends Error implements AssertOptionalParams<E, A> {

@@ -3,0 +3,0 @@ /**

"use strict";
var assertTypeOf = require("./type-of");
/** Implementation */

@@ -16,7 +15,7 @@ function assertOneOf(arg, name, choices, comparator) {

else if (typeof comparator !== 'function')
assertTypeOf(comparator, 'function', 'comparator');
throw new TypeError("\"comparator\" must be of type \"function\". Got ".concat(comparator, " of type \"").concat(typeof comparator, "\"."));
if (__indexOf(choices, arg) === -1)
throw new TypeError("\"".concat(name, "\" must be one of \"").concat(choices.join(', '), "\". Got \"").concat(arg, "\" of type \"").concat(typeof arg, "\"."));
throw new TypeError("\"".concat(name, "\" must be one of ").concat(choices.join(', '), ". Got \"").concat(arg, "\" of type \"").concat(typeof arg, "\"."));
}
assertOneOf.assertOneOf = assertOneOf;
module.exports = assertOneOf;
{
"name": "@santi100/assertion-lib",
"version": "2.0.1",
"version": "2.0.2",
"main": "cjs/index.js",

@@ -30,8 +30,8 @@ "typings": "cjs/index.d.ts",

"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^5.59.7",
"eslint": "8.46.0",
"@typescript-eslint/parser": "^6.4.0",
"eslint": "8.47.0",
"eslint-plugin-jest": "^27.2.1",
"jest": "^29.5.0",
"prettier": "^3.0.0",
"typescript": "4.8.4"
"typescript": "4.9.5"
},

@@ -38,0 +38,0 @@ "scripts": {

@@ -1,3 +0,1 @@

import assertTypeOf = require('./type-of');
/**

@@ -57,8 +55,10 @@ * Asserts `arg` is one of `choices`. Throws a `TypeError` otherwise.

else if (typeof comparator !== 'function')
assertTypeOf(comparator, 'function', 'comparator');
throw new TypeError(`"comparator" must be of type "function". Got ${
comparator
} of type "${typeof comparator}".`);
if (__indexOf(choices, arg as T) === -1)
throw new TypeError(
`"${name}" must be one of "${choices.join(
`"${name}" must be one of ${choices.join(
', '
)}". Got "${arg}" of type "${typeof arg}".`
)}. Got "${arg}" of type "${typeof arg}".`
);

@@ -65,0 +65,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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