Socket
Socket
Sign inDemoInstall

err-code

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

err-code - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

index.js
'use strict';
function createError(msg, code, props) {
var err = typeof msg === 'string' ? new Error(msg) : msg;
var err = msg instanceof Error ? msg : new Error(msg);
var key;

@@ -6,0 +6,0 @@

{
"name": "err-code",
"version": "0.1.1",
"version": "0.1.2",
"description": "Create an error with a code",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -40,2 +40,10 @@ 'use strict';

});
it('should create an error object with code and without message', function () {
var err = errcode(null, 'ESOME');
expect(err).to.be.an(Error);
expect(err.message).to.be('null');
expect(err.code).to.be('ESOME');
});
});
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