Socket
Socket
Sign inDemoInstall

iridium

Package Overview
Dependencies
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iridium - npm Package Compare versions

Comparing version 2.12.1 to 2.12.2

6

lib/utils/diff.js

@@ -1,2 +0,3 @@

var _ = require('lodash');
var _ = require('lodash'),
ObjectID = require('mongodb').ObjectID;

@@ -32,2 +33,5 @@ module.exports = diff;

if(original instanceof ObjectID && modified instanceof ObjectID)
return !original.equals(modified) && this.set(changePath, modified);
if(!_.isPlainObject(original) || !_.isPlainObject(modified))

@@ -34,0 +38,0 @@ return !_.isEqual(original, modified) && this.set(changePath, modified);

2

package.json
{
"name": "iridium",
"version": "2.12.1",
"version": "2.12.2",
"author": "Benjamin Pannell <admin@sierrasoftworks.com>",

@@ -5,0 +5,0 @@ "description": "A custom lightweight ORM for MongoDB designed for power-users",

@@ -1,2 +0,3 @@

var diff = require('../lib/utils/diff');
var diff = require('../lib/utils/diff'),
ObjectID = require('mongodb').ObjectID;

@@ -54,2 +55,25 @@ describe('diff', function() {

it('should correctly diff ObjectIDs', function() {
var o1 = new ObjectID();
var o2 = ObjectID.createFromHexString(o1.toHexString());
var a1 = { _id: o1 };
var a2 = { _id: o2 };
var expected = {
};
diff(a1, a2).should.eql(expected);
o2 = new ObjectID();
var a1 = { _id: o1 };
var a2 = { _id: o2 };
var expected = {
$set: { _id: o2 }
};
diff(a1, a2).should.eql(expected);
});
describe('arrays', function() {

@@ -56,0 +80,0 @@ it('should correctly handle arrays which can be pulled', function() {

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