File tree 3 files changed +4
-1
lines changed
3 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ Options include:
63
63
buffer: false , // set to true if you are parsing from buffers instead of strings
64
64
required: false , // set to true if all properties are required
65
65
ordered: false , // set to true if your properties have the same order always
66
+ validate: true , // set to false to disable extra type validation
66
67
validateStrings: true , // set to false to disable extra type validation
67
68
fullMatch: true , // set to false to do fastest match based on the schema (unsafe!)
68
69
unescapeStrings: true , // set to false if you don't need to unescape \ chars
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ function defaults (opts) {
11
11
12
12
const allowEmptyObjects = opts . allowEmptyObjects !== false
13
13
const required = ! ! opts . allRequired
14
+ const validate = opts . validate !== false
14
15
const ordered = ! ! opts . ordered
15
16
const fullMatch = opts . fullMatch !== false
16
17
const defaults = opts . defaults !== false
@@ -22,7 +23,7 @@ function defaults (opts) {
22
23
class Required {
23
24
constructor ( gen , o , fields ) {
24
25
this . name = o + 'Required'
25
- this . fields = fields . filter ( isRequired )
26
+ this . fields = validate ? fields . filter ( isRequired ) : [ ]
26
27
this . count = this . fields . length
27
28
this . gen = gen
28
29
this . vars = [ ]
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ interface ITurboJsonConfig {
2
2
buffer : boolean ;
3
3
required :boolean ;
4
4
ordered : boolean ;
5
+ validate : boolean ;
5
6
validateStrings : boolean ;
6
7
fullMatch : boolean ;
7
8
unescapeStrings : boolean ;
You can’t perform that action at this time.
0 commit comments