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

Function set

lib/db.js:201–210  ·  view source on GitHub ↗
(object)

Source from the content-addressed store, hash-verified

199 if(typeof object != 'object') throw new Error('identify requires an object');
200 var store = this;
201 function set(object) {
202 if(object._id) {
203 object.id = object._id;
204 delete object._id;
205 } else {
206 var u = object.id || store.createUniqueIdentifier();
207 object._id = u;
208 delete object.id;
209 }
210 }
211 if(Array.isArray(object)) {
212 object.forEach(set);
213 } else {

Callers 1

db.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected