Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

error-type

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

error-type - npm Package Compare versions

Comparing version 1.1.9 to 1.1.10

1

build/src/main.js

@@ -12,2 +12,3 @@ import{defaultOnCreate,getOnCreateParams}from"./create.js";

export default function errorType(name,onCreate=defaultOnCreate){

@@ -14,0 +15,0 @@ const ErrorType=class extends Error{

41

build/src/name.js

@@ -19,2 +19,4 @@ import{setNonEnumProp}from"./set.js";

validateNativeErrors(name);
if(!name.endsWith(ERROR_NAME_END)||name===ERROR_NAME_END){

@@ -27,2 +29,27 @@ throw new Error(`Error name "${name}" must end with "${ERROR_NAME_END}"`);

const validateNativeErrors=function(errorName){
if(NATIVE_ERRORS.has(errorName)){
throw new Error(`Error name "${errorName}" must not be a native type.`);
}
};
const NATIVE_ERRORS=new Set([
"Error",
"ReferenceError",
"TypeError",
"SyntaxError",
"RangeError",
"URIError",
"EvalError",
"AggregateError",
"SystemError",
"AssertionError",
"DOMException"]);
const validateErrorNamePattern=function(errorName){

@@ -38,6 +65,2 @@ if(errorName[0]!==errorName.toUpperCase()[0]){

}
if(NATIVE_ERRORS.has(errorName)){
throw new Error(`Error name "${errorName}" must not be a native type.`);
}
};

@@ -47,12 +70,2 @@

const ERROR_NAME_REGEXP=/[A-Z][a-zA-Z]*Error$/u;
const NATIVE_ERRORS=new Set([
"Error",
"ReferenceError",
"TypeError",
"SyntaxError",
"RangeError",
"URIError",
"EvalError",
"AggregateError"]);
//# sourceMappingURL=name.js.map
{
"name": "error-type",
"version": "1.1.9",
"version": "1.1.10",
"type": "module",

@@ -49,4 +49,5 @@ "exports": "./build/src/main.js",

"devDependencies": {
"@ehmicky/dev-tasks": "^1.0.76",
"@ehmicky/dev-tasks": "^1.0.77",
"error-cause": "^1.0.4",
"error-cause-polyfill": "^1.0.3",
"test-each": "^5.0.0",

@@ -53,0 +54,0 @@ "tsd": "^0.20.0"

Sorry, the diff of this file is not supported yet

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