Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unexpected

Package Overview
Dependencies
Maintainers
2
Versions
330
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unexpected - npm Package Compare versions

Comparing version 3.1.4 to 3.1.5

3

lib/unexpected-assertions.js

@@ -166,3 +166,4 @@ /*global namespace*/

if (this.flags.only) {
expect(hasKeys && getKeys(subject).length === keys.length, '[not] to be truthy');
expect(hasKeys, 'to be truthy');
expect(getKeys(subject).length === keys.length, '[not] to be truthy');
} else {

@@ -169,0 +170,0 @@ expect(hasKeys, '[not] to be truthy');

@@ -17,2 +17,3 @@ /*global namespace*/

var isArguments = utils.isArguments;
var getKeyOfDefinedProperties = utils.getKeyOfDefinedProperties;
var extend = utils.extend;

@@ -110,9 +111,7 @@ var levenshteinDistance = utils.levenshteinDistance;

}
var actualKeys, expectedKeys, key, i;
try {
actualKeys = getKeys(actual);
expectedKeys = getKeys(expected);
} catch (e) {//happens when one is a string literal and the other isn't
return false;
}
var actualKeys = getKeyOfDefinedProperties(actual),
expectedKeys = getKeyOfDefinedProperties(expected),
key,
i;
// having the same number of owned properties (keys incorporates hasOwnProperty)

@@ -119,0 +118,0 @@ if (actualKeys.length !== expectedKeys.length) {

@@ -5,2 +5,3 @@ /*global namespace*/

var forEach = shim.forEach;
var filter = shim.filter;
var getKeys = shim.getKeys;

@@ -39,3 +40,2 @@

isArray: function (ar) {

@@ -82,10 +82,16 @@ return Object.prototype.toString.call(ar) === '[object Array]';

isUndefinedOrNull: function (value) {
isUndefinedOrNull: function (value) {
return value === null || value === undefined;
},
isArguments: function (object) {
isArguments: function (object) {
return Object.prototype.toString.call(object) === '[object Arguments]';
},
getKeyOfDefinedProperties: function (object) {
return filter(getKeys(object), function (key) {
return typeof object[key] !== 'undefined';
});
},
/**

@@ -92,0 +98,0 @@ * Levenshtein distance algorithm from wikipedia

{
"name": "unexpected",
"version": "3.1.4",
"version": "3.1.5",
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

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