* mergeLocationSets * Accepts an Array of Objects containing `locationSet` properties: * [ * { id: 'preset1', locationSet: {…} }, * { id: 'preset2', locationSet: {…} }, * … * ] * After validating, the Objects will be decorated with a `locationSetID` property: * [ * { i
(objects)
| 295 | * @return Promise resolved true (this function used to be slow/async, now it's faster and sync) |
| 296 | */ |
| 297 | mergeLocationSets(objects) { |
| 298 | if (!Array.isArray(objects)) return Promise.reject('nothing to do'); |
| 299 | |
| 300 | objects.forEach(obj => this._validateLocationSet(obj)); |
| 301 | this._rebuildIndex(); |
| 302 | return Promise.resolve(objects); |
| 303 | } |
| 304 | |
| 305 | |
| 306 | /** |
no test coverage detected