object-diff
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3150
101