Comparing version 0.1.3 to 0.1.4
/* | ||
* json-sharp - v0.1.3 | ||
* json-sharp - v0.1.4 | ||
* Process operations on pure JSON objects | ||
@@ -76,3 +76,3 @@ * | ||
// Browser globals (root is window) | ||
root.JSONSharp = factory(root.deepmerge, root.JSONPath).JSONSharp; | ||
root.JSONSharp = factory(root.deepmerge, root.jsonPath ).JSONSharp; | ||
} | ||
@@ -79,0 +79,0 @@ }(this, function (deepmerge, JSONPath) { /* jshint ignore:line */ |
/* | ||
* json-sharp - v0.1.3 | ||
* json-sharp - v0.1.4 | ||
* Process operations on pure JSON objects | ||
@@ -8,2 +8,3 @@ * | ||
*/ | ||
!function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.deepmerge=b()}(this,function(){return function a(b,c){var d=Array.isArray(c),e=d&&[]||{};return d?(b=b||[],e=e.concat(b),c.forEach(function(c,d){"undefined"==typeof e[d]?e[d]=c:"object"==typeof c?e[d]=a(b[d],c):-1===b.indexOf(c)&&e.push(c)})):(b&&"object"==typeof b&&Object.keys(b).forEach(function(a){e[a]=b[a]}),Object.keys(c).forEach(function(d){"object"==typeof c[d]&&c[d]&&b[d]?e[d]=a(b[d],c[d]):e[d]=c[d]})),e}}),function(a,b){"function"==typeof define&&define.amd?define(["deepmerge","JSONPath"],b):"object"==typeof module&&module.exports?module.exports=b(require("deepmerge"),require("JSONPath")):a.JSONSharp=b(a.deepmerge,a.JSONPath).JSONSharp}(this,function(a,b){var c={process:function(a,b){var c=this._clone(a);return this.processNode(c,b)},processNode:function(a,b){var c=Object.prototype.toString.call(a),d="[object Array]"===c,e="[object Object]"===c;return e?this.processObject(a,b):d?this.processArray(a,b):a},processObject:function(a,b){var c,d;if(d=this.getOperation(a),void 0!==d)return d.func(this.processNode(a[d.name],b),b);for(c in a)a.hasOwnProperty(c)&&(a[c]=this.processNode(a[c],b));return a},processArray:function(a,b){for(var c=0;c<a.length;c++)a[c]=this.processNode(a[c],b);return a},getOperation:function(a){for(var b in this.operations)if(this.operations.hasOwnProperty(b)&&a.hasOwnProperty(b))return{name:b,func:this.operations[b]}},resolveProperty:function(a,c){return 0!==a.indexOf("$.")?c[a]:b.eval(c,a)},operations:{"#merge":function(b){return a.apply(a,b)},"#switch":function(a,b){var d,e=c.resolveProperty(a["#property"],b),f=a["#case"];return d=f[e],void 0!==d?d:(d=f["#default"],void 0!==d?d:void 0)}},_clone:function(a){return JSON.parse(JSON.stringify(a))}};return{JSONSharp:c}}); | ||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():e.deepmerge=r()}(this,function(){return function e(r,t){var o=Array.isArray(t),n=o&&[]||{};return o?(r=r||[],n=n.concat(r),t.forEach(function(t,o){void 0===n[o]?n[o]=t:"object"==typeof t?n[o]=e(r[o],t):-1===r.indexOf(t)&&n.push(t)})):(r&&"object"==typeof r&&Object.keys(r).forEach(function(e){n[e]=r[e]}),Object.keys(t).forEach(function(o){"object"==typeof t[o]&&t[o]&&r[o]?n[o]=e(r[o],t[o]):n[o]=t[o]})),n}}),function(e,r){"function"==typeof define&&define.amd?define(["deepmerge","JSONPath"],r):"object"==typeof module&&module.exports?module.exports=r(require("deepmerge"),require("JSONPath")):e.JSONSharp=r(e.deepmerge,e.jsonPath).JSONSharp}(this,function(e,r){var t={process:function(e,r){var t=this._clone(e);return this.processNode(t,r)},processNode:function(e,r){var t=Object.prototype.toString.call(e),o="[object Array]"===t;return"[object Object]"===t?this.processObject(e,r):o?this.processArray(e,r):e},processObject:function(e,r){var t,o;if(void 0!==(o=this.getOperation(e)))return o.func(this.processNode(e[o.name],r),r);for(t in e)e.hasOwnProperty(t)&&(e[t]=this.processNode(e[t],r));return e},processArray:function(e,r){for(var t=0;t<e.length;t++)e[t]=this.processNode(e[t],r);return e},getOperation:function(e){for(var r in this.operations)if(this.operations.hasOwnProperty(r)&&e.hasOwnProperty(r))return{name:r,func:this.operations[r]}},resolveProperty:function(e,t){return 0!==e.indexOf("$.")?t[e]:r.eval(t,e)},operations:{"#merge":function(r){return e.apply(e,r)},"#switch":function(e,r){var o,n=t.resolveProperty(e["#property"],r),i=e["#case"];return void 0!==(o=i[n])?o:void 0!==(o=i["#default"])?o:void 0}},_clone:function(e){return JSON.parse(JSON.stringify(e))}};return{JSONSharp:t}}); |
{ | ||
"name": "json-sharp", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Process operations on pure JSON objects", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -16,3 +16,3 @@ /* global define */ | ||
// Browser globals (root is window) | ||
root.JSONSharp = factory(root.deepmerge, root.JSONPath).JSONSharp; | ||
root.JSONSharp = factory(root.deepmerge, root.jsonPath ).JSONSharp; | ||
} | ||
@@ -19,0 +19,0 @@ }(this, function (deepmerge, JSONPath) { /* jshint ignore:line */ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
24727
1