MCPcopy Index your code
hub / github.com/Effect-TS/effect / flatten

Function flatten

packages/effect/src/SchemaAST.ts:1609–1610  ·  view source on GitHub ↗
(candidates: ReadonlyArray<AST>)

Source from the content-addressed store, hash-verified

1607
1608/** @internal */
1609export const flatten = (candidates: ReadonlyArray<AST>): Array<AST> =>
1610 Arr.flatMap(candidates, (ast) => isUnion(ast) ? flatten(ast.types) : [ast])
1611
1612/** @internal */
1613export const unify = (candidates: ReadonlyArray<AST>): Array<AST> => {

Callers 1

UnionClass · 0.70

Calls 1

isUnionFunction · 0.85

Tested by

no test coverage detected