MCPcopy Index your code
hub / github.com/mozilla/source-map / fromArray

Method fromArray

lib/array-set.js:23–29  ·  view source on GitHub ↗

* Static method for creating ArraySet instances from an existing array.

(aArray, aAllowDuplicates)

Source from the content-addressed store, hash-verified

21 * Static method for creating ArraySet instances from an existing array.
22 */
23 static fromArray(aArray, aAllowDuplicates) {
24 const set = new ArraySet();
25 for (let i = 0, len = aArray.length; i < len; i++) {
26 set.add(aArray[i], aAllowDuplicates);
27 }
28 return set;
29 }
30
31 /**
32 * Return how many unique items are in this ArraySet. If duplicates have been

Callers 2

constructorMethod · 0.80
test-array-set.jsFile · 0.80

Calls 1

addMethod · 0.95

Tested by

no test coverage detected