MCPcopy
hub / github.com/Effect-TS/effect / encodeExamples

Function encodeExamples

packages/effect/src/JSONSchema.ts:420–424  ·  view source on GitHub ↗
(ast: AST.AST, examples: ReadonlyArray<unknown>)

Source from the content-addressed store, hash-verified

418}
419
420function encodeExamples(ast: AST.AST, examples: ReadonlyArray<unknown>): Array<JsonValue> | undefined {
421 const getOption = ParseResult.getOption(ast, false)
422 const out = Arr.filterMap(examples, (e) => getOption(e).pipe(Option.filter(isJsonValue)))
423 return out.length > 0 ? out : undefined
424}
425
426function filterBuiltIn(ast: AST.AST, annotation: string | undefined, key: symbol): string | undefined {
427 if (annotation !== undefined) {

Callers 1

Calls 3

getOptionFunction · 0.85
getOptionMethod · 0.65
pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…