MCPcopy Index your code
hub / github.com/tinyplex/tinybase / getSimpleType

Function getSimpleType

src/schematizers/schematizer-effect/index.ts:52–73  ·  view source on GitHub ↗
(ast: TypeNode)

Source from the content-addressed store, hash-verified

50};
51
52const getSimpleType = (ast: TypeNode): string => {
53 const tag = ast?._tag;
54 const literalType = typeof ast?.literal;
55
56 return tag === LITERAL
57 ? literalType === STRING ||
58 literalType === NUMBER ||
59 literalType === BOOLEAN
60 ? literalType
61 : EMPTY_STRING
62 : tag === STRING_KEYWORD
63 ? STRING
64 : tag === NUMBER_KEYWORD
65 ? NUMBER
66 : tag === BOOLEAN_KEYWORD
67 ? BOOLEAN
68 : tag === TUPLE_TYPE
69 ? ARRAY
70 : tag === TYPE_LITERAL
71 ? OBJECT
72 : EMPTY_STRING;
73};
74
75const getProperties = (schema: any) => {
76 const ast = schema.ast;

Callers 1

unwrapSchemaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…