Comparing version 0.1.0 to 0.1.1
33
index.js
@@ -139,2 +139,7 @@ 'use strict' | ||
var abort = false | ||
var nomap = function () { | ||
abort = true | ||
} | ||
var destRefList = pathMapFn( sourceRefList ) | ||
@@ -146,8 +151,14 @@ | ||
node = valueMapFn( node ) | ||
node = valueMapFn( node, nomap ) | ||
return !abort | ||
}) | ||
destTraverse.set( destRefList, node ) | ||
if ( !abort ) { | ||
destTraverse.set( destRefList, node ) | ||
} | ||
} | ||
@@ -243,2 +254,20 @@ | ||
jsonmap.nomap = function ( nomapValue ) { | ||
return function ( value, abort ) { | ||
if ( _.isEqual( value, nomapValue ) ) { | ||
abort() | ||
} else { | ||
return value | ||
} | ||
} | ||
} | ||
module.exports = jsonmap |
{ | ||
"name": "json-map", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Utility to map one JavaScript object to another", | ||
@@ -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
9556
248