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

Function go

packages/effect/src/SchemaAST.ts:2653–2669  ·  view source on GitHub ↗
(parameter: AST)

Source from the content-addressed store, hash-verified

2651 let symbolKeys: ReadonlyArray<symbol> | undefined
2652
2653 function go(parameter: AST): ReadonlyArray<PropertyKey> {
2654 switch (parameter._tag) {
2655 case "String":
2656 case "TemplateLiteral":
2657 return (stringKeys ??= Object.keys(input)).filter((k) => parameter.matchPart(k, options) !== undefined)
2658 case "Number":
2659 return (stringKeys ??= Object.keys(input)).filter((k) => parameter.matchKey(k, options) !== undefined)
2660 case "Symbol":
2661 return (symbolKeys ??= Object.getOwnPropertySymbols(input)).filter((k) =>
2662 Object.prototype.propertyIsEnumerable.call(input, k) && parameter.matchKey(k, options) !== undefined
2663 )
2664 case "Union":
2665 return [...new Set(parameter.types.flatMap(go))]
2666 default:
2667 return []
2668 }
2669 }
2670 return go(parameterFromPropertyKey(toEncoded(parameter)))
2671}
2672

Callers 3

getIndexSignatureKeysFunction · 0.70
parseParameterFunction · 0.70

Calls 12

addLiteralFunction · 0.85
canMatchFunction · 0.85
keysMethod · 0.80
sliceMethod · 0.80
matchPartMethod · 0.65
matchKeyMethod · 0.65
pushMethod · 0.65
hasMethod · 0.65
getPrefixEndMethod · 0.65
addMethod · 0.65
filterMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected