core-functions
Advanced tools
Comparing version 3.0.21 to 3.0.22
@@ -0,1 +1,5 @@ | ||
'use strict'; | ||
const isInstanceOf = require('./objects').isInstanceOf; | ||
/** | ||
@@ -55,3 +59,3 @@ * Utilities for working with arrays. | ||
const nonStrictType = type === String ? "string" : type === Number ? "number" : type === Boolean ? "boolean" : type; | ||
return typeof nonStrictType === 'function' ? value.every(elem => elem instanceof nonStrictType) : | ||
return typeof nonStrictType === 'function' ? value.every(elem => isInstanceOf(elem, nonStrictType)) : | ||
nonStrictType === 'string' ? value.every(elem => typeof elem === 'string' || elem instanceof String) : | ||
@@ -63,3 +67,3 @@ nonStrictType === 'number' ? value.every(elem => typeof elem === 'number' || elem instanceof Number) : | ||
// Use strict matching | ||
return typeOfType === 'function' ? value.every(elem => elem instanceof type) : | ||
return typeOfType === 'function' ? value.every(elem => isInstanceOf(elem, type)) : | ||
value.every(elem => typeof elem === type); | ||
@@ -66,0 +70,0 @@ } |
{ | ||
"name": "core-functions", | ||
"version": "3.0.21", | ||
"version": "3.0.22", | ||
"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 v3.0.21 | ||
# core-functions v3.0.22 | ||
@@ -3,0 +3,0 @@ Core functions, utilities and classes for working with Node/JavaScript primitives and built-in objects, including |
## Changes | ||
### 3.0.22 | ||
- Replaced two `instanceof` usages in `arrays` module with calls to `isInstanceOf` | ||
### 3.0.21 | ||
@@ -4,0 +7,0 @@ - Added `toType` function to `any` module |
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
979571
15666