🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

object-diff

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-diff - npm Package Compare versions

Comparing version

to
0.0.4

2

index.js

@@ -19,3 +19,3 @@ 'use strict';

var diff = {};
var equal = opts && opts.equal || isStrictEqual;
var equal = opts && opts.equal || isStrictEqual;
var c;

@@ -22,0 +22,0 @@ var keys;

{
"name": "object-diff",
"description": "Get the diff from objectA to objectB",
"version": "0.0.3",
"version": "0.0.4",
"main": "index.js",

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

@@ -69,2 +69,26 @@ # object diff

*/
// using a custom equality function
var past = '2016-04-24T10:39:23.419Z';
diff.custom({
equal: dateAwareComparator,
}, {
then: new Date(past),
}, {
then: new Date(past),
});
/*
{}
*/
function dateAwareComparator( a, b ){
if (a instanceof Date && b instanceof Date)
return a.getTime() === b.getTime();
return a === b;
}
```

@@ -71,0 +95,0 @@