jsonfile-obj-db
Advanced tools
Comparing version 1.0.5 to 1.0.6
24
main.js
@@ -41,4 +41,26 @@ const jsonfile = require( "jsonfile" ); | ||
}, | ||
save: function() { jsonfile.writeFileSync( WC._DB_PATH , WC.self ); } | ||
save: function() { jsonfile.writeFileSync( WC._DB_PATH , WC.self ); }, | ||
edit: function( ...args ) { | ||
// https://stackoverflow.com/questions/16533384/javascript-assign-value-to-element-in-nested-object-without-knowing-level | ||
var x1 = args; | ||
var wNV = x1.pop(); | ||
function recReplace( o , i ) { | ||
var ii = i.shift(); | ||
if ( i.length == 0 ) { | ||
o[ ii ] = wNV; | ||
} | ||
else { | ||
o[ ii ] = recReplace( o[ ii ] , i ); | ||
} | ||
return o; | ||
} | ||
WC.self = recReplace( WC.self , x1 ); | ||
WC.save(); | ||
} | ||
}; | ||
module.exports = WC; |
{ | ||
"name": "jsonfile-obj-db", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "main.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
2389
58