(object)
| 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 { |