MCPcopy
hub / github.com/immutable-js/immutable-js / makeList

Function makeList

src/List.js:441–453  ·  view source on GitHub ↗

* @param {number} origin * @param {number} capacity * @param {number} level * @param {VNode | undefined} [root] The trie root, or `undefined` when every * in-range value lives in the tail (or is a virtual `undefined`). * @param {VNode | undefined} [tail] * @param {OwnerID} [ownerID] * @para

(origin, capacity, level, root, tail, ownerID, hash)

Source from the content-addressed store, hash-verified

439 * @param {number} [hash]
440 */
441function makeList(origin, capacity, level, root, tail, ownerID, hash) {
442 const list = Object.create(ListPrototype);
443 list.size = capacity - origin;
444 list._origin = origin;
445 list._capacity = capacity;
446 list._level = level;
447 list._root = root;
448 list._tail = tail;
449 list.__ownerID = ownerID;
450 list.__hash = hash;
451 list.__altered = false;
452 return list;
453}
454
455export function emptyList() {
456 return makeList(0, 0, SHIFT);

Callers 5

constructorMethod · 0.85
__ensureOwnerMethod · 0.85
emptyListFunction · 0.85
updateListFunction · 0.85
setListBoundsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected