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

Function toArray

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

Source from the content-addressed store, hash-verified

1122}
1123
1124function toArray<T>(
1125 collection: Collection<Node<T>>,
1126 predicate: (node: Node<T>) => boolean
1127): Node<T>[] {
1128 const result: Node<T>[] = [];
1129 for (const node of collection) {
1130 if (predicate(node)) {
1131 result.push(node);
1132 }
1133 }
1134 return result;
1135}

Callers 2

buildCollectionMethod · 0.70

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected