mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 22:05:01 +00:00
Validate basic plugin options structure and override criteria types
This commit is contained in:
parent
70e072e664
commit
ed757dcbe2
2 changed files with 56 additions and 20 deletions
|
@ -98,7 +98,7 @@ export function validate(schema: t.Type<any>, value: any): StrictValidationError
|
|||
* Decodes and validates the given value against the given schema while also disallowing extra properties
|
||||
* See: https://github.com/gcanti/io-ts/issues/322
|
||||
*/
|
||||
export function decodeAndValidateStrict(schema: t.HasProps, value: any): StrictValidationError | any {
|
||||
export function decodeAndValidateStrict<T extends t.HasProps>(schema: T, value: any): StrictValidationError | any {
|
||||
const validationResult = t.exact(schema).decode(value);
|
||||
return pipe(
|
||||
validationResult,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue