MCPcopy
hub / github.com/ianstormtaylor/superstruct / define

Function define

src/structs/utilities.ts:71–73  ·  view source on GitHub ↗
(name: string, validator: Validator)

Source from the content-addressed store, hash-verified

69 */
70
71export function define<T>(name: string, validator: Validator): Struct<T, null> {
72 return new Struct({ type: name, schema: null, validator })
73}
74
75/**
76 * Create a new struct based on an existing struct, but the value is allowed to

Callers 15

validate.test.tsFile · 0.90
struct.tsFile · 0.90
structFunction · 0.85
anyFunction · 0.85
bigintFunction · 0.85
booleanFunction · 0.85
dateFunction · 0.85
funcFunction · 0.85
instanceFunction · 0.85
integerFunction · 0.85
neverFunction · 0.85
numberFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected