toi icon indicating copy to clipboard operation
toi copied to clipboard

Validating `Record` Types?

Open RobertFischer opened this issue 4 years ago • 1 comments

Is there a way to validate to Record types in TOI? Specifically, how would I define validator such that:

const foo:Record<string,unknown> = validator(bar);

RobertFischer avatar Jun 14 '21 18:06 RobertFischer

@RobertFischer I'm not sure what kind of Record you're referring to here... but you can even fake a validator function by just casting things as any within it.

hf avatar Aug 15 '21 15:08 hf