MCPcopy Index your code
hub / github.com/deployd/deployd / cleanCollection

Function cleanCollection

test-app/public/util.js:35–48  ·  view source on GitHub ↗
(collection, done)

Source from the content-addressed store, hash-verified

33};
34
35var cleanCollection = function(collection, done) {
36 collection.get({clean: true}, function (items) {
37 var total = items.length;
38 if(total === 0) return done();
39 items.forEach(function(item) {
40 collection.del({id: item.id}, function () {
41 total--;
42 if(!total) {
43 done();
44 }
45 });
46 });
47 });
48};

Callers 2

collection.test.jsFile · 0.85

Calls 1

doneFunction · 0.70

Tested by

no test coverage detected