Comparing version 5.0.6 to 5.0.7
@@ -0,1 +1,8 @@ | ||
const arrayFrom = obj => { | ||
try { | ||
return Array.from(obj) | ||
} catch (e) { | ||
return null | ||
} | ||
} | ||
class Format { | ||
@@ -54,5 +61,8 @@ constructor (obj, options = {}) { | ||
const value = Array.isArray(this.object) ? this.object | ||
: this.isArray() ? Array.from(this.object) | ||
: this.isArray() ? arrayFrom(this.object) | ||
: null | ||
if (value === null) | ||
this.isArray = () => false | ||
Object.defineProperty(this, 'objectAsArray', { value }) | ||
@@ -211,3 +221,3 @@ return value | ||
: this.isBuffer() ? this.buffer() | ||
: this.isArray() ? this.array() | ||
: this.isArray() && this.objectAsArray ? this.array() | ||
// TODO streams, JSX | ||
@@ -446,3 +456,3 @@ : this.pojo() | ||
} | ||
return Array.from(own) | ||
return arrayFrom(own) | ||
} else | ||
@@ -449,0 +459,0 @@ return Object.keys(obj || this.object) |
{ | ||
"name": "tcompare", | ||
"version": "5.0.6", | ||
"version": "5.0.7", | ||
"description": "A comprehensive comparison library, for use in test frameworks", | ||
@@ -20,3 +20,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"tap": "^15.0.6" | ||
"tap": "^15.0.8" | ||
}, | ||
@@ -23,0 +23,0 @@ "scripts": { |
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
47616
1341