Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix to throw out invalid date objects (#116)
- Loading branch information
1 parent
47b8543
commit a0f644d
Showing
8 changed files
with
80 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { struct } from '../../..' | ||
|
||
const invalid = new Date('invalid') | ||
|
||
export const Struct = struct('date') | ||
|
||
export const data = invalid | ||
|
||
export const error = { | ||
path: [], | ||
value: invalid, | ||
type: 'date', | ||
reason: null, | ||
} |
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,12 @@ | ||
import { struct } from '../../..' | ||
|
||
export const Struct = struct('date') | ||
|
||
export const data = 'invalid' | ||
|
||
export const error = { | ||
path: [], | ||
value: 'invalid', | ||
type: 'date', | ||
reason: null, | ||
} |
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,7 @@ | ||
import { struct } from '../../..' | ||
|
||
export const Struct = struct('date') | ||
|
||
export const data = new Date(0) | ||
|
||
export const output = new Date(0) |
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,12 @@ | ||
import { struct } from '../../..' | ||
|
||
export const Struct = struct('number') | ||
|
||
export const data = 'invalid' | ||
|
||
export const error = { | ||
path: [], | ||
value: 'invalid', | ||
type: 'number', | ||
reason: null, | ||
} |
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,7 @@ | ||
import { struct } from '../../..' | ||
|
||
export const Struct = struct('number') | ||
|
||
export const data = 42 | ||
|
||
export const output = 42 |
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,12 @@ | ||
import { struct } from '../../..' | ||
|
||
export const Struct = struct('string') | ||
|
||
export const data = 42 | ||
|
||
export const error = { | ||
path: [], | ||
value: 42, | ||
type: 'string', | ||
reason: null, | ||
} |
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,7 @@ | ||
import { struct } from '../../..' | ||
|
||
export const Struct = struct('string') | ||
|
||
export const data = 'valid' | ||
|
||
export const output = 'valid' |