core-functions
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -216,3 +216,3 @@ "use strict"; | ||
// Determine which HTTP status codes are allowed to pass through | ||
let allowedStatusCodes = allowedHttpStatusCodes instanceof Array ? allowedHttpStatusCodes.map(toHttpStatus) : undefined; | ||
let allowedStatusCodes = Array.isArray(allowedHttpStatusCodes) ? allowedHttpStatusCodes.map(toHttpStatus) : undefined; | ||
@@ -219,0 +219,0 @@ // Force inclusion of mandatory 400 and 500 |
@@ -51,3 +51,3 @@ /** | ||
const typeOfType = typeof type; | ||
if (value instanceof Array && (typeOfType === 'function' || typeOfType === 'string')) { | ||
if (Array.isArray(value) && (typeOfType === 'function' || typeOfType === 'string')) { | ||
if (!strict) { | ||
@@ -54,0 +54,0 @@ // Use non-strict matching |
@@ -106,3 +106,3 @@ 'use strict'; | ||
function isEncodableDecodable(value) { | ||
return isString(value) || value instanceof Buffer || value instanceof Array; | ||
return isString(value) || value instanceof Buffer || Array.isArray(value); | ||
} | ||
@@ -109,0 +109,0 @@ |
{ | ||
"name": "core-functions", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"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.0 | ||
# core-functions v2.0.1 | ||
@@ -127,2 +127,5 @@ Core functions, utilities and classes for working with Node/JavaScript primitives and built-in objects, including | ||
- Removed unnecessary functions.js module | ||
- Patches to testing.js `checkMethodEqual` and `checkMethodOkNotOk` functions to show method prefixes properly | ||
- Patches to testing.js `checkMethodEqual` and `checkMethodOkNotOk` functions to show method prefixes properly | ||
### 2.0.1 | ||
- Replaced all `x instanceof Array` checks with safer `Array.isArray(x)` |
@@ -91,4 +91,4 @@ 'use strict'; | ||
typeof value === 'function' ? isNotBlank(value.name) ? `[Function: ${value.name}]` : '[Function: anonymous]' : | ||
value instanceof Array ? `[${value.map(stringify).join(", ")}]` : | ||
JSON.stringify(value); | ||
Array.isArray(value) ? `[${value.map(stringify).join(", ")}]` : | ||
JSON.stringify(value); | ||
} |
@@ -279,3 +279,3 @@ 'use strict'; | ||
//console.log(`supportedHttpStatusCodes = ${supportedHttpStatusCodes}`); | ||
const allowedCodes = allowedHttpStatusCodes instanceof Array ? allowedHttpStatusCodes.concat(400, 500) : supportedHttpStatusCodes; | ||
const allowedCodes = Array.isArray(allowedHttpStatusCodes) ? allowedHttpStatusCodes.concat(400, 500) : supportedHttpStatusCodes; | ||
@@ -282,0 +282,0 @@ const originalAppError = error instanceof AppError && (!message || error.message === message) && |
{ | ||
"name": "core-functions-tests", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": "Byron du Preez", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
145446
130