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

error

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

error - npm Package Compare versions

Comparing version 10.1.2 to 10.2.0

45

index.js

@@ -5,7 +5,7 @@ 'use strict'

const stringTemplate = require('./string-template')
const nargs = /\{([0-9a-zA-Z_]+)\}/g
const lowerCaseKebabRegex = /([a-z])([0-9A-Z])/g
const upperCaseKebabRegex = /([A-Z])([A-Z])(?=[a-z])/g
const hasOwnProperty = Object.prototype.hasOwnProperty
const PLAIN_ERROR_FIELDS = [

@@ -55,3 +55,3 @@ 'code',

static get type () {
if (Object.prototype.hasOwnProperty.call(this, '__type')) {
if (hasOwnProperty.call(this, '__type')) {
return this.__type

@@ -134,3 +134,3 @@ }

static get type () {
if (Object.prototype.hasOwnProperty.call(this, '__type')) {
if (hasOwnProperty.call(this, '__type')) {
return this.__type

@@ -317,1 +317,38 @@ }

}
/**
* Taken from https://www.npmjs.com/package/string-template.
* source: https://github.com/Matt-Esch/string-template
*/
function stringTemplate (string) {
var args
if (arguments.length === 2 && typeof arguments[1] === 'object') {
args = arguments[1]
} else {
args = new Array(arguments.length - 1)
for (var i = 1; i < arguments.length; ++i) {
args[i - 1] = arguments[i]
}
}
if (!args || !args.hasOwnProperty) {
args = {}
}
return string.replace(nargs, function replaceArg (match, i, index) {
var result
if (string[index - 1] === '{' &&
string[index + match.length] === '}') {
return i
} else {
result = hasOwnProperty.call(args, i) ? args[i] : null
if (result === null || result === undefined) {
return ''
}
return result
}
})
}

2

package.json
{
"name": "error",
"version": "10.1.2",
"version": "10.2.0",
"description": "Custom errors",

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

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