MCPcopy Create free account
hub / github.com/totaljs/framework / findItem

Function findItem

nosql.js:2374–2384  ·  view source on GitHub ↗
(items, field, value)

Source from the content-addressed store, hash-verified

2372};
2373
2374function findItem(items, field, value) {
2375 for (var i = 0, length = items.length; i < length; i++) {
2376 if (value instanceof Array) {
2377 for (var j = 0; j < value.length; j++) {
2378 if (items[i][field] === value[j])
2379 return items[i];
2380 }
2381 } else if (items[i][field] === value)
2382 return items[i];
2383 }
2384}
2385
2386function findScalar(items, value) {
2387 var sum = null;

Callers 1

nosql.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected