-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TS compilation perf: faster objectUtil.addQuestionMarks (#2845)
* TS compilation perf: faster objectUtil.addQuestionMarks --------- Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
- Loading branch information
1 parent
42c5dc7
commit 890556e
Showing
7 changed files
with
100 additions
and
50 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
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 |
---|---|---|
@@ -1,3 +1,29 @@ | ||
import { z } from "./src"; | ||
|
||
z; | ||
|
||
/* eslint-env mocha */ | ||
|
||
// const { z, ZodError } = require('zod') | ||
|
||
// describe('zod', function () { | ||
// it('cannot deal with circular data structures', function () { | ||
const AnObjectSchema = z.object({ someLiteralProperty: z.literal(1) }); | ||
|
||
const cicrularObject: any = { | ||
aProperty: "a property", | ||
anotherProperty: 137, | ||
anObjectProperty: { anObjectPropertyProperty: "an object property property" }, | ||
anArrayProperty: [ | ||
{ anArrayObjectPropertyProperty: "an object property property" }, | ||
], | ||
}; | ||
cicrularObject.anObjectProperty.cicrularObject = cicrularObject; | ||
cicrularObject.anArrayProperty.push(cicrularObject.anObjectProperty); | ||
const violatingObject = { someLiteralProperty: cicrularObject }; | ||
|
||
const { success, error } = AnObjectSchema.safeParse(violatingObject); | ||
|
||
console.log({ success, error }); | ||
// }) | ||
// }) |
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