-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrectly passing validation for arrays in object(), type(), an…
…d record() (#1252) * Add isNonArrayObject util * Fix incorrectly passing validation when arrays are passed to object() * Fix incorrectly passing validation when arrays are passed to record() * Fix incorrectly passing validation when arrays are passed to type()
- Loading branch information
1 parent
8232269
commit fdf3e62
Showing
5 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { object } from '../../../src' | ||
|
||
export const Struct = object() | ||
|
||
export const data = [] | ||
|
||
export const failures = [ | ||
{ | ||
value: [], | ||
type: 'object', | ||
refinement: undefined, | ||
path: [], | ||
branch: [data], | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { record, string, number } from '../../../src' | ||
|
||
export const Struct = record(string(), number()) | ||
|
||
export const data = [] | ||
|
||
export const failures = [ | ||
{ | ||
value: [], | ||
type: 'record', | ||
refinement: undefined, | ||
path: [], | ||
branch: [data], | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { type } from '../../../src' | ||
|
||
export const Struct = type({}) | ||
|
||
export const data = [] | ||
|
||
export const failures = [ | ||
{ | ||
value: [], | ||
type: 'type', | ||
refinement: undefined, | ||
path: [], | ||
branch: [data], | ||
}, | ||
] |