Socket
Socket
Sign inDemoInstall

nock

Package Overview
Dependencies
Maintainers
4
Versions
424
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 13.0.2 to 13.0.3

28

lib/common.js

@@ -551,4 +551,11 @@ 'use strict'

*/
const dataEqual = (expected, actual) =>
deepEqual(expand(expected), expand(actual))
const dataEqual = (expected, actual) => {
if (isPlainObject(expected)) {
expected = expand(expected)
}
if (isPlainObject(actual)) {
actual = expand(actual)
}
return deepEqual(expected, actual)
}

@@ -577,13 +584,16 @@ /**

if (Array.isArray(expected) || isPlainObject(expected)) {
if (actual === undefined) {
if (Array.isArray(expected) && Array.isArray(actual)) {
if (expected.length !== actual.length) {
return false
}
const expKeys = Object.keys(expected)
if (expKeys.length !== Object.keys(actual).length) {
return false
}
return expected.every((expVal, idx) => deepEqual(expVal, actual[idx]))
}
return expKeys.every(key => deepEqual(expected[key], actual[key]))
if (isPlainObject(expected) && isPlainObject(actual)) {
const allKeys = Array.from(
new Set(Object.keys(expected).concat(Object.keys(actual)))
)
return allKeys.every(key => deepEqual(expected[key], actual[key]))
}

@@ -590,0 +600,0 @@

@@ -10,3 +10,3 @@ {

],
"version": "13.0.2",
"version": "13.0.3",
"author": "Pedro Teixeira <pedro.teixeira@gmail.com>",

@@ -13,0 +13,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc