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

Function filterBuiltIn

packages/effect/src/JSONSchema.ts:426–438  ·  view source on GitHub ↗
(ast: AST.AST, annotation: string | undefined, key: symbol)

Source from the content-addressed store, hash-verified

424}
425
426function filterBuiltIn(ast: AST.AST, annotation: string | undefined, key: symbol): string | undefined {
427 if (annotation !== undefined) {
428 switch (ast._tag) {
429 case "StringKeyword":
430 return annotation !== AST.stringKeyword.annotations[key] ? annotation : undefined
431 case "NumberKeyword":
432 return annotation !== AST.numberKeyword.annotations[key] ? annotation : undefined
433 case "BooleanKeyword":
434 return annotation !== AST.booleanKeyword.annotations[key] ? annotation : undefined
435 }
436 }
437 return annotation
438}
439
440function isJsonValue(value: unknown, visited: Set<unknown> = new Set()): value is JsonValue {
441 if (value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {

Callers 1

getJsonSchemaAnnotationsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected