MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / enumerate

Function enumerate

packages/common-helpers/src/enumerable.ts:9–17  ·  view source on GitHub ↗
(x: Enumerable<T>)

Source from the content-addressed store, hash-verified

7 * Uniformly enumerates an array or scalar.
8 */
9export function enumerate<T>(x: Enumerable<T>) {
10 if (x === null || x === undefined) {
11 return [];
12 } else if (Array.isArray(x)) {
13 return x;
14 } else {
15 return [x];
16 }
17}

Callers 15

enumerable.test.tsFile · 0.90
processNestedCreateMethod · 0.90
processCreateMethod · 0.90
processUpsertMethod · 0.90
processUpdateMethod · 0.90
injectCompoundIdMethod · 0.90
makeNormalizedUrlMethod · 0.90
buildFilterMethod · 0.90
buildSortMethod · 0.90
buildRelationSelectMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected