json-file-object
Advanced tools
Comparing version 2.0.1 to 2.0.3
24
index.js
@@ -1,9 +0,7 @@ | ||
// Generated by CoffeeScript 2.3.1 | ||
// Generated by CoffeeScript 2.5.0 | ||
(function() { | ||
var created_db, erase, find_file, fs, ld, onWrite, stop, stopped, writeFile; | ||
var created_db, erase, find_file, fs, onWrite, stop, stopped, writeFile; | ||
fs = require('fs'); | ||
ld = require('lodash'); | ||
onWrite = {}; | ||
@@ -90,5 +88,7 @@ | ||
for (file in created_db) { | ||
results.push(onWrite[file] = function() { | ||
return erase(file); | ||
}); | ||
results.push((function(file) { | ||
return onWrite[file] = function() { | ||
return erase(file); | ||
}; | ||
})(file)); | ||
} | ||
@@ -99,6 +99,8 @@ return results; | ||
stop = function(file) { | ||
var interval; | ||
({interval} = created_db[file]); | ||
clearInterval(interval); | ||
delete created_db[file]; | ||
var record; | ||
record = created_db[file]; | ||
if (record != null) { | ||
clearInterval(record.interval); | ||
delete created_db[file]; | ||
} | ||
return delete onWrite[file]; | ||
@@ -105,0 +107,0 @@ }; |
{ | ||
"name": "json-file-object", | ||
"version": "2.0.1", | ||
"version": "2.0.3", | ||
"description": "periodically persisting JSON-able objects into files (one per object)", | ||
@@ -17,7 +17,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"coffeescript": "^2.3.1" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.17.15" | ||
"coffeescript": "^2.4.1" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 2.3.1 | ||
// Generated by CoffeeScript 2.5.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var json_file_object, my_obj; |
11
test.js
@@ -1,7 +0,5 @@ | ||
// Generated by CoffeeScript 2.3.1 | ||
// Generated by CoffeeScript 2.5.0 | ||
(function() { | ||
var counter, json_file_object, ld, my_obj, test; | ||
var counter, json_file_object, my_obj, test; | ||
ld = require('lodash'); | ||
json_file_object = require("./"); | ||
@@ -13,3 +11,4 @@ | ||
value: { | ||
hey: "Start" | ||
hey: "Start", | ||
q: [] | ||
}, | ||
@@ -23,3 +22,3 @@ file: "test.json", | ||
console.log(counter, JSON.stringify(my_obj)); | ||
my_obj[counter] = ld.clone(my_obj); | ||
my_obj.q.push(counter); | ||
if (counter > 0) { | ||
@@ -26,0 +25,0 @@ counter--; |
{ | ||
"0": { | ||
"1": { | ||
"2": { | ||
"3": { | ||
"hey": "Start" | ||
}, | ||
"hey": "Start" | ||
}, | ||
"3": { | ||
"hey": "Start" | ||
}, | ||
"hey": "Start" | ||
}, | ||
"2": { | ||
"3": { | ||
"hey": "Start" | ||
}, | ||
"hey": "Start" | ||
}, | ||
"3": { | ||
"hey": "Start" | ||
}, | ||
"hey": "Start" | ||
}, | ||
"1": { | ||
"2": { | ||
"3": { | ||
"hey": "Start" | ||
}, | ||
"hey": "Start" | ||
}, | ||
"3": { | ||
"hey": "Start" | ||
}, | ||
"hey": "Start" | ||
}, | ||
"2": { | ||
"3": { | ||
"hey": "Start" | ||
}, | ||
"hey": "Start" | ||
}, | ||
"3": { | ||
"hey": "Start" | ||
}, | ||
"hey": "Start" | ||
"hey": "Start", | ||
"q": [ | ||
3, | ||
2, | ||
1, | ||
0 | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
0
9971
162
- Removedlodash@^4.17.15
- Removedlodash@4.17.21(transitive)