record<Key extends PropertyKey, Value, Input = unknown>( key: Schema<Key>, value: Schema<Value>,): RecordSchema<Key, Value, Input>
key: Schema<Key>
value: Schema<Value>
import { x } from 'unhoax'const schema = x.record(x.string, x.number)type MyRecord = x.TypeOf<typeof schema>schema.parse({ hello: 42 }) // { success: true, value: { hello: 42 } } Copy
import { x } from 'unhoax'const schema = x.record(x.string, x.number)type MyRecord = x.TypeOf<typeof schema>schema.parse({ hello: 42 }) // { success: true, value: { hello: 42 } }
See
Example