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

error-custom-class

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

error-custom-class - npm Package Compare versions

Comparing version 6.0.0 to 7.0.0

3

build/src/main.d.ts

@@ -27,7 +27,6 @@ import type { ErrorName, ErrorParams } from 'error-class-utils'

* try {
* throw new UserError('message', { props: { userId: 56 } })
* throw new UserError('message')
* } catch (error) {
* console.log(error.name) // 'UserError'
* console.log(error instanceof UserError) // true
* console.log(error.userId) // 56
* }

@@ -34,0 +33,0 @@ * ```

import{
ponyfillCause,
ensureCorrectClass,
setErrorName,
sanitizeProperties}from
setErrorName}from
"error-class-utils";

@@ -22,5 +21,2 @@

ponyfillCause(this,parameters);
const props=sanitizeProperties(parameters===null||parameters===void 0?void 0:parameters.props);
Object.assign(this,props);
}};

@@ -27,0 +23,0 @@

{
"name": "error-custom-class",
"version": "6.0.0",
"version": "7.0.0",
"type": "module",

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

"dependencies": {
"error-class-utils": "^1.0.0"
"error-class-utils": "^2.0.0",
"set-error-props": "^3.0.0"
},

@@ -52,0 +53,0 @@ "devDependencies": {

@@ -12,3 +12,2 @@ [![Codecov](https://img.shields.io/codecov/c/github/ehmicky/error-custom-class.svg?label=tested&logo=codecov)](https://codecov.io/gh/ehmicky/error-custom-class)

- [Very simple API](#api)
- Error properties are [set on initialization](#example)
- Ponyfill

@@ -18,5 +17,2 @@ [`error.cause`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause)

[older Node.js and browsers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause#browser_compatibility)
- Prevent
[prototype pollution](https://github.com/ehmicky/error-class-utils#sanitizepropertiesproperties)
when setting error properties
- Properly

@@ -37,7 +33,6 @@ [set `error.name`](https://github.com/ehmicky/error-class-utils#seterrornameerrorclass-name)

try {
throw new UserError('message', { props: { userId: 56 } })
throw new UserError('message')
} catch (error) {
console.log(error.name) // 'UserError'
console.log(error instanceof UserError) // true
console.log(error.userId) // 56
}

@@ -44,0 +39,0 @@ ```

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