Comparing version 2.0.1 to 2.1.0
const Same = require('./same.js') | ||
const Format = require('./format.js') | ||
class Has extends Same { | ||
@@ -29,2 +30,11 @@ arrayBody () { | ||
isArray () { | ||
const sup = super.isArray() | ||
if (!sup) | ||
return sup | ||
if (this.expect && !new Format(this.expect).isArray()) | ||
return false | ||
return true | ||
} | ||
mapIsEmpty () { | ||
@@ -31,0 +41,0 @@ return this.expect.size === 0 |
@@ -33,3 +33,3 @@ const Format = require('./format.js') | ||
: pattern === Object ? obj && typeof obj === 'object' | ||
: pattern === Array ? this.isArray() | ||
: pattern === Array ? new Format(obj).isArray() | ||
: !this.isError() && (pattern instanceof Error) ? false | ||
@@ -44,3 +44,2 @@ : this.isError() && ( | ||
: this.isMap() && !(pattern instanceof Map) ? false | ||
: this.isArray() && !(new Format(pattern).isArray()) ? false | ||
: typeof pattern === 'function' && typeof obj === 'object' | ||
@@ -47,0 +46,0 @@ ? obj instanceof pattern |
{ | ||
"name": "tcompare", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "A comprehensive comparison library, for use in test frameworks", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
37858
1096