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

express-statuses

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-statuses - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "express-statuses",
"description": "Simple response statuses for Express 4.x",
"version": "1.0.1",
"version": "1.0.2",
"author": {

@@ -6,0 +6,0 @@ "name": "Pier Fumagalli",

@@ -10,14 +10,25 @@ 'use strict';

var status = { status: code, message: message };
if (! object) return status;
var string = '';
if (typeof(object) === 'string') {
status.message = object;
} else if (object instanceof Error) {
status.error = object;
} else {
if (object.message) status.message = object.message;
if (object.details) status.details = object.details;
if (object.error) status.error = object.error;
if (object) {
if (typeof(object) === 'string') {
status.message = object;
string = ': ' + object;
} else if (object instanceof Error) {
status.error = object;
} else {
if (object.message) {
status.message = object.message;
string = ': ' + object;
}
if (object.details) status.details = object.details;
if (object.error) status.error = object.error;
}
}
status.toString = function() {
return this.status + " " + message + string;
}
return status;

@@ -28,2 +39,5 @@ }

made.message = message;
made.toString = function() {
return this.status + " " + this.message;
}
return made;

@@ -40,3 +54,2 @@ };

.toUpperCase();
console.log('`' + name + '`: ' + code);

@@ -43,0 +56,0 @@ // Make our new status function

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