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

core-functions

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-functions - npm Package Compare versions

Comparing version 2.0.11 to 2.0.12

9

app-errors.js

@@ -221,3 +221,3 @@ "use strict";

// Determine which HTTP status codes are allowed to pass through
let allowedStatusCodes = Array.isArray(allowedHttpStatusCodes) ? allowedHttpStatusCodes.map(toHttpStatus) : undefined;
const allowedStatusCodes = Array.isArray(allowedHttpStatusCodes) ? allowedHttpStatusCodes.map(toHttpStatus) : undefined;

@@ -227,6 +227,6 @@ // Force inclusion of mandatory 400 and 500

if (allowedStatusCodes.indexOf(400) === -1) {
allowedStatusCodes = allowedStatusCodes.concat(400);
allowedStatusCodes.push(400);
}
if (allowedStatusCodes.indexOf(500) === -1) {
allowedStatusCodes = allowedStatusCodes.concat(500);
allowedStatusCodes.push(500);
}

@@ -399,3 +399,4 @@ }

toAppError: toAppError,
toAppErrorForApiGateway: toAppErrorForApiGateway
toAppErrorForApiGateway: toAppErrorForApiGateway,
getHttpStatus: getHttpStatus
};
{
"name": "core-functions",
"version": "2.0.11",
"version": "2.0.12",
"description": "Core functions, utilities and classes for working with Node/JavaScript primitives and built-in objects, including strings, booleans, Promises, base 64, Arrays, Objects, standard AppErrors, etc.",

@@ -5,0 +5,0 @@ "author": "Byron du Preez",

@@ -1,2 +0,2 @@

# core-functions v2.0.11
# core-functions v2.0.12

@@ -106,2 +106,4 @@ Core functions, utilities and classes for working with Node/JavaScript primitives and built-in objects, including

### 2.0.12
- Changed `app-errors.js` module to export `getHttpStatus` function

@@ -108,0 +110,0 @@ ### 2.0.11

@@ -407,1 +407,24 @@ 'use strict';

});
test('toAppError attempt to recreate NOT instanceof BadRequest bug', t => {
const cause = new TypeError('TE1');
const br1 = new BadRequest('BR1', undefined, cause);
t.ok(br1 instanceof BadRequest, `br1 must be instanceof BadRequest`);
t.ok(br1 instanceof Error, `br1 must be instanceof Error`);
t.equals(br1.cause, cause.toString(), `br1.cause must be ${cause.toString()}`);
const br2 = toAppError(br1);
t.equals(br2, br1, `br2 must be same instance as br1`);
t.ok(br2 instanceof BadRequest, `br2 must be instanceof BadRequest`);
const br3 = toAppError(br1, 'BR1');
t.equals(br3, br1, `br3 must be same instance as br1`);
t.ok(br3 instanceof BadRequest, `br3 must be instanceof BadRequest`);
const br4 = toAppError(br1, 'BR4');
t.notEquals(br4, br1, `br4 must NOT be same instance as br1`);
t.ok(br4 instanceof BadRequest, `br4 must be instanceof BadRequest`);
t.equals(br4.cause, cause.toString(), `br4.cause must be ${cause.toString()}`);
t.end();
});
{
"name": "core-functions-tests",
"version": "2.0.11",
"version": "2.0.12",
"author": "Byron du Preez",

@@ -5,0 +5,0 @@ "license": "Apache-2.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