MCPcopy Create free account
hub / github.com/Effect-TS/effect / Enum

Function Enum

packages/effect/src/Schema.ts:3019–3028  ·  view source on GitHub ↗
(enums: A)

Source from the content-addressed store, hash-verified

3017 * @since 4.0.0
3018 */
3019export function Enum<A extends { [x: string]: string | number }>(enums: A): Enum<A> {
3020 return make(
3021 new SchemaAST.Enum(
3022 Object.keys(enums).filter(
3023 (key) => typeof enums[enums[key]] !== "number"
3024 ).map((key) => [key, enums[key]])
3025 ),
3026 { enums }
3027 )
3028}
3029
3030/**
3031 * Type-level representation of {@link Never}.

Callers

nothing calls this directly

Calls 3

filterMethod · 0.80
makeFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected