Socket
Socket
Sign inDemoInstall

tcompare

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tcompare - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

10

lib/has.js
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

3

lib/match.js

@@ -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",

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