MCPcopy Create free account
hub / github.com/adobe/react-spectrum / toArray

Function toArray

packages/@react-spectrum/ai/src/ListLayout.ts:1100–1111  ·  view source on GitHub ↗
(
  collection: Collection<Node<T>>,
  predicate: (node: Node<T>) => boolean
)

Source from the content-addressed store, hash-verified

1098}
1099
1100function toArray<T>(
1101 collection: Collection<Node<T>>,
1102 predicate: (node: Node<T>) => boolean
1103): Node<T>[] {
1104 const result: Node<T>[] = [];
1105 for (const node of collection) {
1106 if (predicate(node)) {
1107 result.push(node);
1108 }
1109 }
1110 return result;
1111}

Callers 2

buildCollectionMethod · 0.70

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected