update-diff
Advanced tools
Comparing version 1.0.2 to 1.0.3
12
index.js
@@ -7,8 +7,14 @@ /** | ||
var cache = new WeakMap; | ||
var cache = global.WeakMap ? new WeakMap : null; | ||
module.exports = function updateDiff (obj, diff, mappers) { | ||
var raw = cache.get(obj) || {} | ||
var raw | ||
cache.set(obj, diff) | ||
if (cache) { | ||
raw = cache.get(obj) || {} | ||
cache.set(obj, diff) | ||
} | ||
else { | ||
raw = {} | ||
} | ||
@@ -15,0 +21,0 @@ if (!Array.isArray(mappers)) mappers = [].slice.call(arguments, 2) |
{ | ||
"name": "update-diff", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Update object by mapping diff properties", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
4377
99