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

unexpected-messy

Package Overview
Dependencies
Maintainers
2
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unexpected-messy - npm Package Compare versions

Comparing version 2.7.0 to 2.7.1

34

lib/unexpectedMessy.js

@@ -234,21 +234,9 @@ var messy = require('messy'),

expect(subject.parts, 'to satisfy', value.parts);
} else {
} else if (Array.isArray(value.parts)) {
this.errorMode = 'bubble';
expect(subject, 'to have number of parts', value.parts.length);
} else if (value.parts && typeof value.parts === 'object') {
expect(value.parts, 'to be an object whose keys satisfy', /^\d+/);
var highestPartNumber;
if (Array.isArray(value.parts)) {
highestPartNumber = value.parts.length;
} else if (value.parts && typeof value.parts === 'object') {
Object.keys(value.parts).forEach(function (key) {
var partNumber = parseInt(key, 10);
if (typeof partNumber === 'number' && (typeof highestPartNumber === 'undefined' || partNumber > highestPartNumber)) {
highestPartNumber = partNumber;
}
});
}
if (typeof highestPartNumber !== 'undefined') {
expect(subject, 'to have at least this number of parts', highestPartNumber);
}
this.errorMode = 'default';
}
this.errorMode = 'default';
}

@@ -273,5 +261,9 @@

if (typeof value.parts !== 'undefined' && typeof value.parts !== 'function') {
Object.keys(value.parts).forEach(function (key) {
expect(subject.parts[key], 'to satisfy', value.parts[key]);
});
if (Array.isArray(value.parts)) {
expect(subject.parts, 'to satisfy', value.parts);
} else {
Object.keys(value.parts).forEach(function (key) {
expect(subject.parts[key], 'to satisfy', value.parts[key]);
});
}
}

@@ -689,4 +681,4 @@ } catch (e) {

})
.addAssertion('messy.Message', '[not] to have at least this number of parts', function (expect, subject, value) {
expect(subject.parts.length, '[not] to be >=', value);
.addAssertion('messy.Message', '[not] to have number of parts', function (expect, subject, value) {
expect(subject.parts, '[not] to have length', value);
})

@@ -693,0 +685,0 @@ .addType({

{
"name": "unexpected-messy",
"version": "2.7.0",
"version": "2.7.1",
"description": "Unexpected plugin for the messy library",

@@ -44,3 +44,3 @@ "main": "lib/unexpectedMessy.js",

"mocha": "2.0.1",
"unexpected": "5.4.0"
"unexpected": "5.4.2"
},

@@ -47,0 +47,0 @@ "dependencies": {

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