Test case
3 generated files · +3 −3test/inputs/graphql/github1.graphql
Mgraphql-flowdefault / TopLevel.js+1 −1
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 150 | 150 | if (typeof typ === "object") { |
| 151 | 151 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 152 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | 153 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-typescriptdefault / TopLevel.ts+1 −1
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 150 | 150 | if (typeof typ === "object") { |
| 151 | 151 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 152 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | 153 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/graphql/github2.graphql
Mgraphql-flowdefault / TopLevel.js+1 −1
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 159 | 159 | if (typeof typ === "object") { |
| 160 | 160 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 161 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 161 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 162 | 162 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 163 | 163 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 164 | 164 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-typescriptdefault / TopLevel.ts+1 −1
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 159 | 159 | if (typeof typ === "object") { |
| 160 | 160 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 161 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 161 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 162 | 162 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 163 | 163 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 164 | 164 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/graphql/github3.graphql
Mgraphql-flowdefault / TopLevel.js+1 −1
| @@ -166,7 +166,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 166 | 166 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 167 | 167 | if (typeof typ === "object") { |
| 168 | 168 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 169 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 169 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 170 | 170 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 171 | 171 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 172 | 172 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-typescriptdefault / TopLevel.ts+1 −1
| @@ -163,7 +163,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 163 | 163 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 164 | 164 | if (typeof typ === "object") { |
| 165 | 165 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 166 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | 167 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/graphql/github4.graphql
Mgraphql-flowdefault / TopLevel.js+1 −1
| @@ -167,7 +167,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 167 | 167 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 168 | 168 | if (typeof typ === "object") { |
| 169 | 169 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 170 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 170 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | 171 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 172 | 172 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-typescriptdefault / TopLevel.ts+1 −1
| @@ -164,7 +164,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 164 | 164 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 165 | 165 | if (typeof typ === "object") { |
| 166 | 166 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 167 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 168 | 168 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 170 | 170 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/graphql/github5.graphql
Mgraphql-flowdefault / TopLevel.js+1 −1
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 150 | 150 | if (typeof typ === "object") { |
| 151 | 151 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 152 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | 153 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-typescriptdefault / TopLevel.ts+1 −1
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 150 | 150 | if (typeof typ === "object") { |
| 151 | 151 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 152 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | 153 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/graphql/github6.graphql
Mgraphql-flowdefault / TopLevel.js+1 −1
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 150 | 150 | if (typeof typ === "object") { |
| 151 | 151 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 152 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | 153 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-typescriptdefault / TopLevel.ts+1 −1
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 150 | 150 | if (typeof typ === "object") { |
| 151 | 151 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 152 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | 153 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/graphql/github7.graphql
Mgraphql-flowdefault / TopLevel.js+1 −1
| @@ -170,7 +170,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 170 | 170 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 171 | 171 | if (typeof typ === "object") { |
| 172 | 172 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 173 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 173 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 174 | 174 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 175 | 175 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 176 | 176 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-typescriptdefault / TopLevel.ts+1 −1
| @@ -170,7 +170,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 170 | 170 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 171 | 171 | if (typeof typ === "object") { |
| 172 | 172 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 173 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 173 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 174 | 174 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 175 | 175 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 176 | 176 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/graphql/github8.graphql
Mgraphql-flowdefault / TopLevel.js+1 −1
| @@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 160 | 160 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 161 | 161 | if (typeof typ === "object") { |
| 162 | 162 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 163 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 164 | 164 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 166 | 166 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-typescriptdefault / TopLevel.ts+1 −1
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 159 | 159 | if (typeof typ === "object") { |
| 160 | 160 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 161 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 161 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 162 | 162 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 163 | 163 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 164 | 164 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/graphql/github9.graphql
Mgraphql-flowdefault / TopLevel.js+1 −1
| @@ -167,7 +167,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 167 | 167 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 168 | 168 | if (typeof typ === "object") { |
| 169 | 169 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 170 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 170 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | 171 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 172 | 172 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mgraphql-typescriptdefault / TopLevel.ts+1 −1
| @@ -161,7 +161,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 161 | 161 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 162 | 162 | if (typeof typ === "object") { |
| 163 | 163 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 164 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 164 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 165 | 165 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 166 | 166 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 167 | 167 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/00c36.json
Mflowdefault / TopLevel.js+1 −1
| @@ -163,7 +163,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 163 | 163 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 164 | 164 | if (typeof typ === "object") { |
| 165 | 165 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 166 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | 167 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 159 | 159 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 160 | 160 | if (typeof typ === "object") { |
| 161 | 161 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 162 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 162 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | 163 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 164 | 164 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/00ec5.json
Mflowdefault / TopLevel.js+1 −1
| @@ -202,7 +202,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 202 | 202 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 203 | 203 | if (typeof typ === "object") { |
| 204 | 204 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 205 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 205 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 206 | 206 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 207 | 207 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 208 | 208 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -201,7 +201,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 201 | 201 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 202 | 202 | if (typeof typ === "object") { |
| 203 | 203 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 204 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 204 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 205 | 205 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 206 | 206 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 207 | 207 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/010b1.json
Mflowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/016af.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/033b1.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/050b0.json
Mflowdefault / TopLevel.js+1 −1
| @@ -191,7 +191,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 191 | 191 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 192 | 192 | if (typeof typ === "object") { |
| 193 | 193 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 194 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 194 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 195 | 195 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 196 | 196 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 197 | 197 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 175 | 175 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 176 | 176 | if (typeof typ === "object") { |
| 177 | 177 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 178 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 178 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 179 | 179 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 180 | 180 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 181 | 181 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/06bee.json
Mflowdefault / TopLevel.js+1 −1
| @@ -179,7 +179,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 179 | 179 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 180 | 180 | if (typeof typ === "object") { |
| 181 | 181 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 182 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 182 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 183 | 183 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 184 | 184 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 185 | 185 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -170,7 +170,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 170 | 170 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 171 | 171 | if (typeof typ === "object") { |
| 172 | 172 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 173 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 173 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 174 | 174 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 175 | 175 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 176 | 176 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/07540.json
Mflowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 136 | 136 | if (typeof typ === "object") { |
| 137 | 137 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 138 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | 139 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 140 | 140 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/0779f.json
Mflowdefault / TopLevel.js+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/07c75.json
Mflowdefault / TopLevel.js+1 −1
| @@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 160 | 160 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 161 | 161 | if (typeof typ === "object") { |
| 162 | 162 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 163 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 164 | 164 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 166 | 166 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 160 | 160 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 161 | 161 | if (typeof typ === "object") { |
| 162 | 162 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 163 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 164 | 164 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 166 | 166 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/09f54.json
Mflowdefault / TopLevel.js+1 −1
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 149 | 149 | if (typeof typ === "object") { |
| 150 | 150 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 151 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | 152 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 149 | 149 | if (typeof typ === "object") { |
| 150 | 150 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 151 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | 152 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/0a358.json
Mflowdefault / TopLevel.js+1 −1
| @@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 153 | 153 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 154 | 154 | if (typeof typ === "object") { |
| 155 | 155 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 156 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 156 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 157 | 157 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 158 | 158 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 159 | 159 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 150 | 150 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 151 | 151 | if (typeof typ === "object") { |
| 152 | 152 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 153 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 154 | 154 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 156 | 156 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/0a91a.json
Mflowdefault / TopLevel.js+1 −1
| @@ -355,7 +355,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 355 | 355 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 356 | 356 | if (typeof typ === "object") { |
| 357 | 357 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 358 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 358 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 359 | 359 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 360 | 360 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 361 | 361 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -350,7 +350,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 350 | 350 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 351 | 351 | if (typeof typ === "object") { |
| 352 | 352 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 353 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 353 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 354 | 354 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 355 | 355 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 356 | 356 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/0b91a.json
Mflowdefault / TopLevel.js+1 −1
| @@ -176,7 +176,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 176 | 176 | if (typeof typ === "object") { |
| 177 | 177 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 178 | 178 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 179 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 179 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 180 | 180 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 181 | 181 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 182 | 182 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -130,7 +130,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | 132 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 133 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 134 | 134 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 136 | 136 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -176,7 +176,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 176 | 176 | if (typeof typ === "object") { |
| 177 | 177 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 178 | 178 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 179 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 179 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 180 | 180 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 181 | 181 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 182 | 182 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/0cffa.json
Mflowdefault / TopLevel.js+1 −1
| @@ -250,7 +250,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 250 | 250 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 251 | 251 | if (typeof typ === "object") { |
| 252 | 252 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 253 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 253 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 254 | 254 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 255 | 255 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 256 | 256 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -243,7 +243,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 243 | 243 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 244 | 244 | if (typeof typ === "object") { |
| 245 | 245 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 246 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 246 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 247 | 247 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 248 | 248 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 249 | 249 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/0e0c2.json
Mflowdefault / TopLevel.js+1 −1
| @@ -212,7 +212,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 212 | 212 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 213 | 213 | if (typeof typ === "object") { |
| 214 | 214 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 215 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 215 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 216 | 216 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 217 | 217 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 218 | 218 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -206,7 +206,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 206 | 206 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 207 | 207 | if (typeof typ === "object") { |
| 208 | 208 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 209 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 209 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 210 | 210 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 211 | 211 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 212 | 212 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/0fecf.json
Mflowdefault / TopLevel.js+1 −1
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 136 | 136 | if (typeof typ === "object") { |
| 137 | 137 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 138 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | 139 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 140 | 140 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 136 | 136 | if (typeof typ === "object") { |
| 137 | 137 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 138 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | 139 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 140 | 140 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/10be4.json
Mflowdefault / TopLevel.js+1 −1
| @@ -202,7 +202,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 202 | 202 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 203 | 203 | if (typeof typ === "object") { |
| 204 | 204 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 205 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 205 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 206 | 206 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 207 | 207 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 208 | 208 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 175 | 175 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 176 | 176 | if (typeof typ === "object") { |
| 177 | 177 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 178 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 178 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 179 | 179 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 180 | 180 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 181 | 181 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/112b5.json
Mflowdefault / TopLevel.js+1 −1
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 149 | 149 | if (typeof typ === "object") { |
| 150 | 150 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 151 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | 152 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/127a1.json
Mflowdefault / TopLevel.js+1 −1
| @@ -249,7 +249,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 249 | 249 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 250 | 250 | if (typeof typ === "object") { |
| 251 | 251 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 252 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 252 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 253 | 253 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 254 | 254 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 255 | 255 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -243,7 +243,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 243 | 243 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 244 | 244 | if (typeof typ === "object") { |
| 245 | 245 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 246 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 246 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 247 | 247 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 248 | 248 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 249 | 249 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/13d8d.json
Mflowdefault / TopLevel.js+1 −1
| @@ -161,7 +161,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 161 | 161 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 162 | 162 | if (typeof typ === "object") { |
| 163 | 163 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 164 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 164 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 165 | 165 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 166 | 166 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 167 | 167 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -161,7 +161,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 161 | 161 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 162 | 162 | if (typeof typ === "object") { |
| 163 | 163 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 164 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 164 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 165 | 165 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 166 | 166 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 167 | 167 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/14d38.json
Mflowdefault / TopLevel.js+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/167d6.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/16bc5.json
Mflowdefault / TopLevel.js+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/176f1.json
Mflowdefault / TopLevel.js+1 −1
| @@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 160 | 160 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 161 | 161 | if (typeof typ === "object") { |
| 162 | 162 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 163 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 164 | 164 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 166 | 166 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 160 | 160 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 161 | 161 | if (typeof typ === "object") { |
| 162 | 162 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 163 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 164 | 164 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 166 | 166 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/1a7f5.json
Mflowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/1b28c.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/1b409.json
Mflowdefault / TopLevel.js+1 −1
| @@ -226,7 +226,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 226 | 226 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 227 | 227 | if (typeof typ === "object") { |
| 228 | 228 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 229 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 229 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 230 | 230 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 231 | 231 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 232 | 232 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -209,7 +209,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 209 | 209 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 210 | 210 | if (typeof typ === "object") { |
| 211 | 211 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 212 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 212 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 213 | 213 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 214 | 214 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 215 | 215 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/2465e.json
Mflowdefault / TopLevel.js+1 −1
| @@ -208,7 +208,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 208 | 208 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 209 | 209 | if (typeof typ === "object") { |
| 210 | 210 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 211 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 211 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 212 | 212 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 213 | 213 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 214 | 214 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -208,7 +208,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 208 | 208 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 209 | 209 | if (typeof typ === "object") { |
| 210 | 210 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 211 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 211 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 212 | 212 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 213 | 213 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 214 | 214 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/24f52.json
Mflowdefault / TopLevel.js+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/262f0.json
Mflowdefault / TopLevel.js+1 −1
| @@ -238,7 +238,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 238 | 238 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 239 | 239 | if (typeof typ === "object") { |
| 240 | 240 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 241 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 241 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 242 | 242 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 243 | 243 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 244 | 244 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -235,7 +235,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 235 | 235 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 236 | 236 | if (typeof typ === "object") { |
| 237 | 237 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 238 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 238 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 239 | 239 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 240 | 240 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 241 | 241 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/26b49.json
Mflowdefault / TopLevel.js+1 −1
| @@ -247,7 +247,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 247 | 247 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 248 | 248 | if (typeof typ === "object") { |
| 249 | 249 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 250 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 250 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 251 | 251 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 252 | 252 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 253 | 253 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -242,7 +242,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 242 | 242 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 243 | 243 | if (typeof typ === "object") { |
| 244 | 244 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 245 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 245 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 246 | 246 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 247 | 247 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 248 | 248 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/26c9c.json
Mflowdefault / TopLevel.js+1 −1
| @@ -322,7 +322,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 322 | 322 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 323 | 323 | if (typeof typ === "object") { |
| 324 | 324 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 325 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 325 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 326 | 326 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 327 | 327 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 328 | 328 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -322,7 +322,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 322 | 322 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 323 | 323 | if (typeof typ === "object") { |
| 324 | 324 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 325 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 325 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 326 | 326 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 327 | 327 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 328 | 328 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/27332.json
Mflowdefault / TopLevel.js+1 −1
| @@ -288,7 +288,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 288 | 288 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 289 | 289 | if (typeof typ === "object") { |
| 290 | 290 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 291 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 291 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 292 | 292 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 293 | 293 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 294 | 294 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -274,7 +274,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 274 | 274 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 275 | 275 | if (typeof typ === "object") { |
| 276 | 276 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 277 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 277 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 278 | 278 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 279 | 279 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 280 | 280 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/29f47.json
Mflowdefault / TopLevel.js+1 −1
| @@ -274,7 +274,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 274 | 274 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 275 | 275 | if (typeof typ === "object") { |
| 276 | 276 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 277 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 277 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 278 | 278 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 279 | 279 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 280 | 280 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -261,7 +261,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 261 | 261 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 262 | 262 | if (typeof typ === "object") { |
| 263 | 263 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 264 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 264 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 265 | 265 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 266 | 266 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 267 | 267 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/2d4e2.json
Mflowdefault / TopLevel.js+1 −1
| @@ -242,7 +242,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 242 | 242 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 243 | 243 | if (typeof typ === "object") { |
| 244 | 244 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 245 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 245 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 246 | 246 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 247 | 247 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 248 | 248 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -219,7 +219,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 219 | 219 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 220 | 220 | if (typeof typ === "object") { |
| 221 | 221 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 222 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 222 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 223 | 223 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 224 | 224 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 225 | 225 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/2df80.json
Mflowdefault / TopLevel.js+1 −1
| @@ -208,7 +208,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 208 | 208 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 209 | 209 | if (typeof typ === "object") { |
| 210 | 210 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 211 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 211 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 212 | 212 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 213 | 213 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 214 | 214 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -164,7 +164,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 164 | 164 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 165 | 165 | if (typeof typ === "object") { |
| 166 | 166 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 167 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 168 | 168 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 170 | 170 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/31189.json
Mflowdefault / TopLevel.js+1 −1
| @@ -163,7 +163,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 163 | 163 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 164 | 164 | if (typeof typ === "object") { |
| 165 | 165 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 166 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | 167 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 162 | 162 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 163 | 163 | if (typeof typ === "object") { |
| 164 | 164 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 165 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 165 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | 166 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 167 | 167 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/32431.json
Mflowdefault / TopLevel.js+1 −1
| @@ -206,7 +206,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 206 | 206 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 207 | 207 | if (typeof typ === "object") { |
| 208 | 208 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 209 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 209 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 210 | 210 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 211 | 211 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 212 | 212 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -198,7 +198,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 198 | 198 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 199 | 199 | if (typeof typ === "object") { |
| 200 | 200 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 201 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 201 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 202 | 202 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 203 | 203 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 204 | 204 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/32d5c.json
Mflowdefault / TopLevel.js+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/337ed.json
Mflowdefault / TopLevel.js+1 −1
| @@ -203,7 +203,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 203 | 203 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 204 | 204 | if (typeof typ === "object") { |
| 205 | 205 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 206 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 206 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 207 | 207 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 208 | 208 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 209 | 209 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -193,7 +193,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 193 | 193 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 194 | 194 | if (typeof typ === "object") { |
| 195 | 195 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 196 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 196 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 197 | 197 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 198 | 198 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 199 | 199 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/33d2e.json
Mflowdefault / TopLevel.js+1 −1
| @@ -188,7 +188,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 188 | 188 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 189 | 189 | if (typeof typ === "object") { |
| 190 | 190 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 191 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 191 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 192 | 192 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 193 | 193 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 194 | 194 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -176,7 +176,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 176 | 176 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 177 | 177 | if (typeof typ === "object") { |
| 178 | 178 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 179 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 179 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 180 | 180 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 181 | 181 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 182 | 182 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/34702.json
Mflowdefault / TopLevel.js+1 −1
| @@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 223 | 223 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 224 | 224 | if (typeof typ === "object") { |
| 225 | 225 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 226 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 226 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 227 | 227 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 228 | 228 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 229 | 229 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -190,7 +190,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 190 | 190 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 191 | 191 | if (typeof typ === "object") { |
| 192 | 192 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 193 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 193 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 194 | 194 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 195 | 195 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 196 | 196 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/3536b.json
Mflowdefault / TopLevel.js+1 −1
| @@ -170,7 +170,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 170 | 170 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 171 | 171 | if (typeof typ === "object") { |
| 172 | 172 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 173 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 173 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 174 | 174 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 175 | 175 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 176 | 176 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -164,7 +164,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 164 | 164 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 165 | 165 | if (typeof typ === "object") { |
| 166 | 166 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 167 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 168 | 168 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 170 | 170 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/3659d.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/36d5d.json
Mflowdefault / TopLevel.js+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/3a6b3.json
Mflowdefault / TopLevel.js+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/3e9a3.json
Mflowdefault / TopLevel.js+1 −1
| @@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 160 | 160 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 161 | 161 | if (typeof typ === "object") { |
| 162 | 162 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 163 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 164 | 164 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 166 | 166 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -160,7 +160,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 160 | 160 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 161 | 161 | if (typeof typ === "object") { |
| 162 | 162 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 163 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 164 | 164 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 166 | 166 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/3f1ce.json
Mflowdefault / TopLevel.js+1 −1
| @@ -236,7 +236,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 236 | 236 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 237 | 237 | if (typeof typ === "object") { |
| 238 | 238 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 239 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 239 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 240 | 240 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 241 | 241 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 242 | 242 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -235,7 +235,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 235 | 235 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 236 | 236 | if (typeof typ === "object") { |
| 237 | 237 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 238 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 238 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 239 | 239 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 240 | 240 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 241 | 241 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/421d4.json
Mflowdefault / TopLevel.js+1 −1
| @@ -249,7 +249,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 249 | 249 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 250 | 250 | if (typeof typ === "object") { |
| 251 | 251 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 252 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 252 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 253 | 253 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 254 | 254 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 255 | 255 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -246,7 +246,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 246 | 246 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 247 | 247 | if (typeof typ === "object") { |
| 248 | 248 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 249 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 249 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 250 | 250 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 251 | 251 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 252 | 252 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/437e7.json
Mflowdefault / TopLevel.js+1 −1
| @@ -244,7 +244,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 244 | 244 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 245 | 245 | if (typeof typ === "object") { |
| 246 | 246 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 247 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 247 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 248 | 248 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 249 | 249 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 250 | 250 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -239,7 +239,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 239 | 239 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 240 | 240 | if (typeof typ === "object") { |
| 241 | 241 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 242 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 242 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 243 | 243 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 244 | 244 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 245 | 245 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/43970.json
Mflowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/43eaf.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/458db.json
Mflowdefault / TopLevel.js+1 −1
| @@ -178,7 +178,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 178 | 178 | if (typeof typ === "object") { |
| 179 | 179 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 180 | 180 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 181 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 181 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 182 | 182 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 183 | 183 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 184 | 184 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -130,7 +130,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | 132 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 133 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 134 | 134 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 136 | 136 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -177,7 +177,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 177 | 177 | if (typeof typ === "object") { |
| 178 | 178 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 179 | 179 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 180 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 180 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 181 | 181 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 182 | 182 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 183 | 183 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/4961a.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/4a0d7.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/4a455.json
Mflowdefault / TopLevel.js+1 −1
| @@ -178,7 +178,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 178 | 178 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 179 | 179 | if (typeof typ === "object") { |
| 180 | 180 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 181 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 181 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 182 | 182 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 183 | 183 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 184 | 184 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 175 | 175 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 176 | 176 | if (typeof typ === "object") { |
| 177 | 177 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 178 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 178 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 179 | 179 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 180 | 180 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 181 | 181 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/4c547.json
Mflowdefault / TopLevel.js+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/4d6fb.json
Mflowdefault / TopLevel.js+1 −1
| @@ -283,7 +283,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 283 | 283 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 284 | 284 | if (typeof typ === "object") { |
| 285 | 285 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 286 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 286 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 287 | 287 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 288 | 288 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 289 | 289 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -273,7 +273,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 273 | 273 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 274 | 274 | if (typeof typ === "object") { |
| 275 | 275 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 276 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 276 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 277 | 277 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 278 | 278 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 279 | 279 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/4e336.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/54147.json
Mflowdefault / TopLevel.js+1 −1
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 152 | 152 | if (typeof typ === "object") { |
| 153 | 153 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 154 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 154 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 155 | 155 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 156 | 156 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 157 | 157 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 149 | 149 | if (typeof typ === "object") { |
| 150 | 150 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 151 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | 152 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/54d32.json
Mflowdefault / TopLevel.js+1 −1
| @@ -157,7 +157,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 157 | 157 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 158 | 158 | if (typeof typ === "object") { |
| 159 | 159 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 160 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 160 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 161 | 161 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 162 | 162 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 163 | 163 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -152,7 +152,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 152 | 152 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 153 | 153 | if (typeof typ === "object") { |
| 154 | 154 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 155 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 155 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 156 | 156 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 157 | 157 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 158 | 158 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/570ec.json
Mflowdefault / TopLevel.js+1 −1
| @@ -170,7 +170,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 170 | 170 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 171 | 171 | if (typeof typ === "object") { |
| 172 | 172 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 173 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 173 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 174 | 174 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 175 | 175 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 176 | 176 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -167,7 +167,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 167 | 167 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 168 | 168 | if (typeof typ === "object") { |
| 169 | 169 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 170 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 170 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | 171 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 172 | 172 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/5dd0d.json
Mflowdefault / TopLevel.js+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/5eae5.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/5eb20.json
Mflowdefault / TopLevel.js+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/5f3a1.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/5f7fe.json
Mflowdefault / TopLevel.js+1 −1
| @@ -323,7 +323,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 323 | 323 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 324 | 324 | if (typeof typ === "object") { |
| 325 | 325 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 326 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 326 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 327 | 327 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 328 | 328 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 329 | 329 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -320,7 +320,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 320 | 320 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 321 | 321 | if (typeof typ === "object") { |
| 322 | 322 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 323 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 323 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 324 | 324 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 325 | 325 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 326 | 326 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/617e8.json
Mflowdefault / TopLevel.js+1 −1
| @@ -322,7 +322,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 322 | 322 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 323 | 323 | if (typeof typ === "object") { |
| 324 | 324 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 325 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 325 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 326 | 326 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 327 | 327 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 328 | 328 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -319,7 +319,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 319 | 319 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 320 | 320 | if (typeof typ === "object") { |
| 321 | 321 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 322 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 322 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 323 | 323 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 324 | 324 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 325 | 325 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/61b66.json
Mflowdefault / TopLevel.js+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/6260a.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/65dec.json
Mflowdefault / TopLevel.js+1 −1
| @@ -222,7 +222,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 222 | 222 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 223 | 223 | if (typeof typ === "object") { |
| 224 | 224 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 225 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 225 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 226 | 226 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 227 | 227 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 228 | 228 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -198,7 +198,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 198 | 198 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 199 | 199 | if (typeof typ === "object") { |
| 200 | 200 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 201 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 201 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 202 | 202 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 203 | 203 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 204 | 204 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/66121.json
Mflowdefault / TopLevel.js+1 −1
| @@ -179,7 +179,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 179 | 179 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 180 | 180 | if (typeof typ === "object") { |
| 181 | 181 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 182 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 182 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 183 | 183 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 184 | 184 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 185 | 185 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -170,7 +170,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 170 | 170 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 171 | 171 | if (typeof typ === "object") { |
| 172 | 172 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 173 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 173 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 174 | 174 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 175 | 175 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 176 | 176 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/6617c.json
Mflowdefault / TopLevel.js+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/67c03.json
Mflowdefault / TopLevel.js+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/68c30.json
Mflowdefault / TopLevel.js+1 −1
| @@ -166,7 +166,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 166 | 166 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 167 | 167 | if (typeof typ === "object") { |
| 168 | 168 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 169 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 169 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 170 | 170 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 171 | 171 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 172 | 172 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -166,7 +166,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 166 | 166 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 167 | 167 | if (typeof typ === "object") { |
| 168 | 168 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 169 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 169 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 170 | 170 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 171 | 171 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 172 | 172 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/6c155.json
Mflowdefault / TopLevel.js+1 −1
| @@ -189,7 +189,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 189 | 189 | if (typeof typ === "object") { |
| 190 | 190 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 191 | 191 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 192 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 192 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 193 | 193 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 194 | 194 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 195 | 195 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -130,7 +130,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | 132 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 133 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 134 | 134 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 136 | 136 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -189,7 +189,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 189 | 189 | if (typeof typ === "object") { |
| 190 | 190 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 191 | 191 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 192 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 192 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 193 | 193 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 194 | 194 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 195 | 195 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/6de06.json
Mflowdefault / TopLevel.js+1 −1
| @@ -283,7 +283,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 283 | 283 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 284 | 284 | if (typeof typ === "object") { |
| 285 | 285 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 286 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 286 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 287 | 287 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 288 | 288 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 289 | 289 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -278,7 +278,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 278 | 278 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 279 | 279 | if (typeof typ === "object") { |
| 280 | 280 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 281 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 281 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 282 | 282 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 283 | 283 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 284 | 284 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/6dec6.json
Mflowdefault / TopLevel.js+1 −1
| @@ -238,7 +238,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 238 | 238 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 239 | 239 | if (typeof typ === "object") { |
| 240 | 240 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 241 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 241 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 242 | 242 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 243 | 243 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 244 | 244 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -235,7 +235,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 235 | 235 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 236 | 236 | if (typeof typ === "object") { |
| 237 | 237 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 238 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 238 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 239 | 239 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 240 | 240 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 241 | 241 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/6eb00.json
Mflowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/70c77.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/734ad.json
Mflowdefault / TopLevel.js+1 −1
| @@ -209,7 +209,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 209 | 209 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 210 | 210 | if (typeof typ === "object") { |
| 211 | 211 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 212 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 212 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 213 | 213 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 214 | 214 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 215 | 215 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -204,7 +204,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 204 | 204 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 205 | 205 | if (typeof typ === "object") { |
| 206 | 206 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 207 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 207 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 208 | 208 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 209 | 209 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 210 | 210 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/75912.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/7681c.json
Mflowdefault / TopLevel.js+1 −1
| @@ -251,7 +251,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 251 | 251 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 252 | 252 | if (typeof typ === "object") { |
| 253 | 253 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 254 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 254 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 255 | 255 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 256 | 256 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 257 | 257 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -243,7 +243,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 243 | 243 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 244 | 244 | if (typeof typ === "object") { |
| 245 | 245 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 246 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 246 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 247 | 247 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 248 | 248 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 249 | 249 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/76ae1.json
Mflowdefault / TopLevel.js+1 −1
| @@ -319,7 +319,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 319 | 319 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 320 | 320 | if (typeof typ === "object") { |
| 321 | 321 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 322 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 322 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 323 | 323 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 324 | 324 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 325 | 325 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -316,7 +316,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 316 | 316 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 317 | 317 | if (typeof typ === "object") { |
| 318 | 318 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 319 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 319 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 320 | 320 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 321 | 321 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 322 | 322 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/77392.json
Mflowdefault / TopLevel.js+1 −1
| @@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 162 | 162 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 163 | 163 | if (typeof typ === "object") { |
| 164 | 164 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 165 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 165 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | 166 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 167 | 167 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 150 | 150 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 151 | 151 | if (typeof typ === "object") { |
| 152 | 152 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 153 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 154 | 154 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 156 | 156 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/7d397.json
Mflowdefault / TopLevel.js+1 −1
| @@ -210,7 +210,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 210 | 210 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 211 | 211 | if (typeof typ === "object") { |
| 212 | 212 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 213 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 213 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 214 | 214 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 215 | 215 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 216 | 216 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -208,7 +208,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 208 | 208 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 209 | 209 | if (typeof typ === "object") { |
| 210 | 210 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 211 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 211 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 212 | 212 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 213 | 213 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 214 | 214 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/7d722.json
Mflowdefault / TopLevel.js+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/7df41.json
Mflowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/7dfa6.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/7eb30.json
Mflowdefault / TopLevel.js+1 −1
| @@ -179,7 +179,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 179 | 179 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 180 | 180 | if (typeof typ === "object") { |
| 181 | 181 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 182 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 182 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 183 | 183 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 184 | 184 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 185 | 185 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -172,7 +172,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 172 | 172 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 173 | 173 | if (typeof typ === "object") { |
| 174 | 174 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 175 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 175 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 176 | 176 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 177 | 177 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 178 | 178 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/7f568.json
Mflowdefault / TopLevel.js+1 −1
| @@ -166,7 +166,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 166 | 166 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 167 | 167 | if (typeof typ === "object") { |
| 168 | 168 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 169 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 169 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 170 | 170 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 171 | 171 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 172 | 172 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -164,7 +164,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 164 | 164 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 165 | 165 | if (typeof typ === "object") { |
| 166 | 166 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 167 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 168 | 168 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 170 | 170 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/7fbfb.json
Mflowdefault / TopLevel.js+1 −1
| @@ -163,7 +163,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 163 | 163 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 164 | 164 | if (typeof typ === "object") { |
| 165 | 165 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 166 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | 167 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 159 | 159 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 160 | 160 | if (typeof typ === "object") { |
| 161 | 161 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 162 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 162 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | 163 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 164 | 164 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/80aff.json
Mflowdefault / TopLevel.js+1 −1
| @@ -154,7 +154,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 154 | 154 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 155 | 155 | if (typeof typ === "object") { |
| 156 | 156 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 157 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 157 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 158 | 158 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 159 | 159 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 160 | 160 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 152 | 152 | if (typeof typ === "object") { |
| 153 | 153 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 154 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 154 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 155 | 155 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 156 | 156 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 157 | 157 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/82509.json
Mflowdefault / TopLevel.js+1 −1
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 136 | 136 | if (typeof typ === "object") { |
| 137 | 137 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 138 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | 139 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 140 | 140 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 136 | 136 | if (typeof typ === "object") { |
| 137 | 137 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 138 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | 139 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 140 | 140 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/8592b.json
Mflowdefault / TopLevel.js+1 −1
| @@ -258,7 +258,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 258 | 258 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 259 | 259 | if (typeof typ === "object") { |
| 260 | 260 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 261 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 261 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 262 | 262 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 263 | 263 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 264 | 264 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -247,7 +247,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 247 | 247 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 248 | 248 | if (typeof typ === "object") { |
| 249 | 249 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 250 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 250 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 251 | 251 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 252 | 252 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 253 | 253 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/88130.json
Mflowdefault / TopLevel.js+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/8a62c.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/908db.json
Mflowdefault / TopLevel.js+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/9617f.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/96f7c.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/9847b.json
Mflowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/9929c.json
Mflowdefault / TopLevel.js+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/996bd.json
Mflowdefault / TopLevel.js+1 −1
| @@ -179,7 +179,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 179 | 179 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 180 | 180 | if (typeof typ === "object") { |
| 181 | 181 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 182 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 182 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 183 | 183 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 184 | 184 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 185 | 185 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/9a503.json
Mflowdefault / TopLevel.js+1 −1
| @@ -165,7 +165,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 165 | 165 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 166 | 166 | if (typeof typ === "object") { |
| 167 | 167 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 168 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 168 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 169 | 169 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 170 | 170 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 171 | 171 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 162 | 162 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 163 | 163 | if (typeof typ === "object") { |
| 164 | 164 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 165 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 165 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | 166 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 167 | 167 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/9ac3b.json
Mflowdefault / TopLevel.js+1 −1
| @@ -166,7 +166,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 166 | 166 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 167 | 167 | if (typeof typ === "object") { |
| 168 | 168 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 169 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 169 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 170 | 170 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 171 | 171 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 172 | 172 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 159 | 159 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 160 | 160 | if (typeof typ === "object") { |
| 161 | 161 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 162 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 162 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | 163 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 164 | 164 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/9eed5.json
Mflowdefault / TopLevel.js+1 −1
| @@ -164,7 +164,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 164 | 164 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 165 | 165 | if (typeof typ === "object") { |
| 166 | 166 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 167 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 168 | 168 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 170 | 170 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -162,7 +162,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 162 | 162 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 163 | 163 | if (typeof typ === "object") { |
| 164 | 164 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 165 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 165 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | 166 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 167 | 167 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/a0496.json
Mflowdefault / TopLevel.js+1 −1
| @@ -156,7 +156,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 156 | 156 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 157 | 157 | if (typeof typ === "object") { |
| 158 | 158 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 159 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 159 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 160 | 160 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 161 | 161 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 162 | 162 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 153 | 153 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 154 | 154 | if (typeof typ === "object") { |
| 155 | 155 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 156 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 156 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 157 | 157 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 158 | 158 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 159 | 159 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/a1eca.json
Mflowdefault / TopLevel.js+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/a3d8c.json
Mflowdefault / TopLevel.js+1 −1
| @@ -251,7 +251,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 251 | 251 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 252 | 252 | if (typeof typ === "object") { |
| 253 | 253 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 254 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 254 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 255 | 255 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 256 | 256 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 257 | 257 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -245,7 +245,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 245 | 245 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 246 | 246 | if (typeof typ === "object") { |
| 247 | 247 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 248 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 248 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 249 | 249 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 250 | 250 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 251 | 251 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/a45b0.json
Mflowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/a71df.json
Mflowdefault / TopLevel.js+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/a9691.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/ab0d1.json
Mflowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/abb4b.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/ac944.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/ad8be.json
Mflowdefault / TopLevel.js+1 −1
| @@ -202,7 +202,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 202 | 202 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 203 | 203 | if (typeof typ === "object") { |
| 204 | 204 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 205 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 205 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 206 | 206 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 207 | 207 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 208 | 208 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 175 | 175 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 176 | 176 | if (typeof typ === "object") { |
| 177 | 177 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 178 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 178 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 179 | 179 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 180 | 180 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 181 | 181 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/ae7f0.json
Mflowdefault / TopLevel.js+1 −1
| @@ -232,7 +232,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 232 | 232 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 233 | 233 | if (typeof typ === "object") { |
| 234 | 234 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 235 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 235 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | 236 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 237 | 237 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 223 | 223 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 224 | 224 | if (typeof typ === "object") { |
| 225 | 225 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 226 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 226 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 227 | 227 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 228 | 228 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 229 | 229 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/ae9ca.json
Mflowdefault / TopLevel.js+1 −1
| @@ -181,7 +181,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 181 | 181 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 182 | 182 | if (typeof typ === "object") { |
| 183 | 183 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 184 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 184 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 185 | 185 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 186 | 186 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 187 | 187 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -171,7 +171,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 171 | 171 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 172 | 172 | if (typeof typ === "object") { |
| 173 | 173 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 174 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 174 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 175 | 175 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 176 | 176 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 177 | 177 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/af2d1.json
Mflowdefault / TopLevel.js+1 −1
| @@ -243,7 +243,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 243 | 243 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 244 | 244 | if (typeof typ === "object") { |
| 245 | 245 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 246 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 246 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 247 | 247 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 248 | 248 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 249 | 249 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 221 | 221 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 222 | 222 | if (typeof typ === "object") { |
| 223 | 223 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 224 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 224 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 225 | 225 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 226 | 226 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 227 | 227 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/b4865.json
Mflowdefault / TopLevel.js+1 −1
| @@ -163,7 +163,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 163 | 163 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 164 | 164 | if (typeof typ === "object") { |
| 165 | 165 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 166 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | 167 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 159 | 159 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 160 | 160 | if (typeof typ === "object") { |
| 161 | 161 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 162 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 162 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | 163 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 164 | 164 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/b6f2c.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/b6fe5.json
Mflowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/b9f64.json
Mflowdefault / TopLevel.js+1 −1
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 136 | 136 | if (typeof typ === "object") { |
| 137 | 137 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 138 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | 139 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 140 | 140 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 136 | 136 | if (typeof typ === "object") { |
| 137 | 137 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 138 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | 139 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 140 | 140 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/bb1ec.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/be234.json
Mflowdefault / TopLevel.js+1 −1
| @@ -297,7 +297,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 297 | 297 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 298 | 298 | if (typeof typ === "object") { |
| 299 | 299 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 300 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 300 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 301 | 301 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 302 | 302 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 303 | 303 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -284,7 +284,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 284 | 284 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 285 | 285 | if (typeof typ === "object") { |
| 286 | 286 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 287 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 287 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 288 | 288 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 289 | 289 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 290 | 290 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/c0356.json
Mflowdefault / TopLevel.js+1 −1
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 148 | 148 | if (typeof typ === "object") { |
| 149 | 149 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 150 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | 151 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 148 | 148 | if (typeof typ === "object") { |
| 149 | 149 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 150 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | 151 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/c0a3a.json
Mflowdefault / TopLevel.js+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/c3303.json
Mflowdefault / TopLevel.js+1 −1
| @@ -248,7 +248,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 248 | 248 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 249 | 249 | if (typeof typ === "object") { |
| 250 | 250 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 251 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 251 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 252 | 252 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 253 | 253 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 254 | 254 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -242,7 +242,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 242 | 242 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 243 | 243 | if (typeof typ === "object") { |
| 244 | 244 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 245 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 245 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 246 | 246 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 247 | 247 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 248 | 248 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/c6cfd.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/c8c7e.json
Mflowdefault / TopLevel.js+1 −1
| @@ -163,7 +163,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 163 | 163 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 164 | 164 | if (typeof typ === "object") { |
| 165 | 165 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 166 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | 167 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 159 | 159 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 160 | 160 | if (typeof typ === "object") { |
| 161 | 161 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 162 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 162 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | 163 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 164 | 164 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/cb0cc.json
Mflowdefault / TopLevel.js+1 −1
| @@ -158,7 +158,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 158 | 158 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 159 | 159 | if (typeof typ === "object") { |
| 160 | 160 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 161 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 161 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 162 | 162 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 163 | 163 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 164 | 164 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -152,7 +152,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 152 | 152 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 153 | 153 | if (typeof typ === "object") { |
| 154 | 154 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 155 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 155 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 156 | 156 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 157 | 157 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 158 | 158 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/cb81e.json
Mflowdefault / TopLevel.js+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/ccd18.json
Mflowdefault / TopLevel.js+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/cd238.json
Mflowdefault / TopLevel.js+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -168,7 +168,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 168 | 168 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 169 | 169 | if (typeof typ === "object") { |
| 170 | 170 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 171 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 172 | 172 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 174 | 174 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/cd463.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/cda6c.json
Mflowdefault / TopLevel.js+1 −1
| @@ -163,7 +163,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 163 | 163 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 164 | 164 | if (typeof typ === "object") { |
| 165 | 165 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 166 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | 167 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 159 | 159 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 160 | 160 | if (typeof typ === "object") { |
| 161 | 161 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 162 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 162 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | 163 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 164 | 164 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/cf0d8.json
Mflowdefault / TopLevel.js+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/cfbce.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/d0908.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/d23d5.json
Mflowdefault / TopLevel.js+1 −1
| @@ -153,7 +153,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 153 | 153 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 154 | 154 | if (typeof typ === "object") { |
| 155 | 155 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 156 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 156 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 157 | 157 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 158 | 158 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 159 | 159 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 150 | 150 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 151 | 151 | if (typeof typ === "object") { |
| 152 | 152 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 153 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 154 | 154 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 156 | 156 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/dbfb3.json
Mflowdefault / TopLevel.js+1 −1
| @@ -237,7 +237,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 237 | 237 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 238 | 238 | if (typeof typ === "object") { |
| 239 | 239 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 240 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 240 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 241 | 241 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 242 | 242 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 243 | 243 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -235,7 +235,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 235 | 235 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 236 | 236 | if (typeof typ === "object") { |
| 237 | 237 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 238 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 238 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 239 | 239 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 240 | 240 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 241 | 241 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/dc44f.json
Mflowdefault / TopLevel.js+1 −1
| @@ -261,7 +261,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 261 | 261 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 262 | 262 | if (typeof typ === "object") { |
| 263 | 263 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 264 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 264 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 265 | 265 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 266 | 266 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 267 | 267 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -203,7 +203,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 203 | 203 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 204 | 204 | if (typeof typ === "object") { |
| 205 | 205 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 206 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 206 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 207 | 207 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 208 | 208 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 209 | 209 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/dd1ce.json
Mflowdefault / TopLevel.js+1 −1
| @@ -261,7 +261,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 261 | 261 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 262 | 262 | if (typeof typ === "object") { |
| 263 | 263 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 264 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 264 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 265 | 265 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 266 | 266 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 267 | 267 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -203,7 +203,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 203 | 203 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 204 | 204 | if (typeof typ === "object") { |
| 205 | 205 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 206 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 206 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 207 | 207 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 208 | 208 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 209 | 209 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/dec3a.json
Mflowdefault / TopLevel.js+1 −1
| @@ -197,7 +197,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 197 | 197 | if (typeof typ === "object") { |
| 198 | 198 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 199 | 199 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 200 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 200 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 201 | 201 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 202 | 202 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 203 | 203 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -130,7 +130,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | 132 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 133 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 134 | 134 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 136 | 136 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -197,7 +197,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 197 | 197 | if (typeof typ === "object") { |
| 198 | 198 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 199 | 199 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 200 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 200 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 201 | 201 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 202 | 202 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 203 | 203 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/df957.json
Mflowdefault / TopLevel.js+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -233,7 +233,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 233 | 233 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 234 | 234 | if (typeof typ === "object") { |
| 235 | 235 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 236 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 236 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 237 | 237 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 238 | 238 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 239 | 239 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/e0ac7.json
Mflowdefault / TopLevel.js+1 −1
| @@ -245,7 +245,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 245 | 245 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 246 | 246 | if (typeof typ === "object") { |
| 247 | 247 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 248 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 248 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 249 | 249 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 250 | 250 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 251 | 251 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -241,7 +241,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 241 | 241 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 242 | 242 | if (typeof typ === "object") { |
| 243 | 243 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 244 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 244 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 245 | 245 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 246 | 246 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 247 | 247 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/e2915.json
Mflowdefault / TopLevel.js+1 −1
| @@ -236,7 +236,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 236 | 236 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 237 | 237 | if (typeof typ === "object") { |
| 238 | 238 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 239 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 239 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 240 | 240 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 241 | 241 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 242 | 242 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -235,7 +235,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 235 | 235 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 236 | 236 | if (typeof typ === "object") { |
| 237 | 237 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 238 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 238 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 239 | 239 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 240 | 240 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 241 | 241 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/e2a58.json
Mflowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/e324e.json
Mflowdefault / TopLevel.js+1 −1
| @@ -207,7 +207,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 207 | 207 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 208 | 208 | if (typeof typ === "object") { |
| 209 | 209 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 210 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 210 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 211 | 211 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 212 | 212 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 213 | 213 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -206,7 +206,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 206 | 206 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 207 | 207 | if (typeof typ === "object") { |
| 208 | 208 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 209 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 209 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 210 | 210 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 211 | 211 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 212 | 212 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/e53b5.json
Mflowdefault / TopLevel.js+1 −1
| @@ -163,7 +163,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 163 | 163 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 164 | 164 | if (typeof typ === "object") { |
| 165 | 165 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 166 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | 167 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -159,7 +159,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 159 | 159 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 160 | 160 | if (typeof typ === "object") { |
| 161 | 161 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 162 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 162 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 163 | 163 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 164 | 164 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 165 | 165 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/e64a0.json
Mflowdefault / TopLevel.js+1 −1
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 149 | 149 | if (typeof typ === "object") { |
| 150 | 150 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 151 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | 152 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/e8a0b.json
Mflowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/e8b04.json
Mflowdefault / TopLevel.js+1 −1
| @@ -405,7 +405,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 405 | 405 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 406 | 406 | if (typeof typ === "object") { |
| 407 | 407 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 408 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 408 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 409 | 409 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 410 | 410 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 411 | 411 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -366,7 +366,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 366 | 366 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 367 | 367 | if (typeof typ === "object") { |
| 368 | 368 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 369 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 369 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 370 | 370 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 371 | 371 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 372 | 372 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/ed095.json
Mflowdefault / TopLevel.js+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/f22f5.json
Mflowdefault / TopLevel.js+1 −1
| @@ -229,7 +229,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 229 | 229 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 230 | 230 | if (typeof typ === "object") { |
| 231 | 231 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 232 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 232 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 233 | 233 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 234 | 234 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 235 | 235 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 221 | 221 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 222 | 222 | if (typeof typ === "object") { |
| 223 | 223 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 224 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 224 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 225 | 225 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 226 | 226 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 227 | 227 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/f3139.json
Mflowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/f3edf.json
Mflowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/f466a.json
Mflowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/f6a65.json
Mflowdefault / TopLevel.js+1 −1
| @@ -252,7 +252,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 252 | 252 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 253 | 253 | if (typeof typ === "object") { |
| 254 | 254 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 255 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 255 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 256 | 256 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 257 | 257 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 258 | 258 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -243,7 +243,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 243 | 243 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 244 | 244 | if (typeof typ === "object") { |
| 245 | 245 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 246 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 246 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 247 | 247 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 248 | 248 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 249 | 249 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/f74d5.json
Mflowdefault / TopLevel.js+1 −1
| @@ -251,7 +251,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 251 | 251 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 252 | 252 | if (typeof typ === "object") { |
| 253 | 253 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 254 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 254 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 255 | 255 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 256 | 256 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 257 | 257 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -245,7 +245,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 245 | 245 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 246 | 246 | if (typeof typ === "object") { |
| 247 | 247 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 248 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 248 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 249 | 249 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 250 | 250 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 251 | 251 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/f82d9.json
Mflowdefault / TopLevel.js+1 −1
| @@ -220,7 +220,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 220 | 220 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 221 | 221 | if (typeof typ === "object") { |
| 222 | 222 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 223 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 223 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 224 | 224 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 225 | 225 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 226 | 226 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -219,7 +219,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 219 | 219 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 220 | 220 | if (typeof typ === "object") { |
| 221 | 221 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 222 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 222 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 223 | 223 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 224 | 224 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 225 | 225 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/f974d.json
Mflowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/faff5.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/fcca3.json
Mflowdefault / TopLevel.js+1 −1
| @@ -348,7 +348,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 348 | 348 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 349 | 349 | if (typeof typ === "object") { |
| 350 | 350 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 351 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 351 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 352 | 352 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 353 | 353 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 354 | 354 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -345,7 +345,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 345 | 345 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 346 | 346 | if (typeof typ === "object") { |
| 347 | 347 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 348 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 348 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 349 | 349 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 350 | 350 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 351 | 351 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/misc/fd329.json
Mflowdefault / TopLevel.js+1 −1
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 149 | 149 | if (typeof typ === "object") { |
| 150 | 150 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 151 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | 152 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 149 | 149 | if (typeof typ === "object") { |
| 150 | 150 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 151 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | 152 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/blns-object.json
Mflowdefault / TopLevel.js+1 −1
| @@ -730,7 +730,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 730 | 730 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 731 | 731 | if (typeof typ === "object") { |
| 732 | 732 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 733 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 733 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 734 | 734 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 735 | 735 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 736 | 736 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -730,7 +730,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 730 | 730 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 731 | 731 | if (typeof typ === "object") { |
| 732 | 732 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 733 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 733 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 734 | 734 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 735 | 735 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 736 | 736 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/bug2037.json
Mflowdefault / TopLevel.js+1 −1
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 147 | 147 | if (typeof typ === "object") { |
| 148 | 148 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 149 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | 150 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/bug2521.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/bug2590.json
Mflowdefault / TopLevel.js+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/bug2663.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/bug2793.json
Mflowdefault / TopLevel.js+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/bug427.json
Mflowdefault / TopLevel.js+1 −1
| @@ -746,7 +746,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 746 | 746 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 747 | 747 | if (typeof typ === "object") { |
| 748 | 748 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 749 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 749 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 750 | 750 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 751 | 751 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 752 | 752 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -692,7 +692,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 692 | 692 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 693 | 693 | if (typeof typ === "object") { |
| 694 | 694 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 695 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 695 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 696 | 696 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 697 | 697 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 698 | 698 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/bug790.json
Mflowdefault / TopLevel.js+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/bug855-short.json
Mflowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/bug863.json
Mflowdefault / TopLevel.js+1 −1
| @@ -221,7 +221,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 221 | 221 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 222 | 222 | if (typeof typ === "object") { |
| 223 | 223 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 224 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 224 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 225 | 225 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 226 | 226 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 227 | 227 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 206 | 206 | if (typeof typ === "object") { |
| 207 | 207 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 208 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 208 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 209 | 209 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 210 | 210 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 211 | 211 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/coin-pairs.json
Mflowdefault / TopLevel.js+1 −1
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 148 | 148 | if (typeof typ === "object") { |
| 149 | 149 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 150 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | 151 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 148 | 148 | if (typeof typ === "object") { |
| 149 | 149 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 150 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | 151 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
18 generated files · +18 −18test/inputs/json/priority/combinations1.json
Mflowdefault / TopLevel.js+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflownice-property-names-true--f4d7920ee2ce / TopLevel.js+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflowprefer-unions-false--a5053c0a486d / TopLevel.js+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflowprefer-unknown-false--f1ab9e45d823 / TopLevel.js+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflowruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptconverters-all-objects--3a443babd1cb / TopLevel.ts+1 −1
| @@ -631,7 +631,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 631 | 631 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 632 | 632 | if (typeof typ === "object") { |
| 633 | 633 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 634 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 634 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 635 | 635 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 636 | 636 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 637 | 637 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptnice-property-names-true--f4d7920ee2ce / TopLevel.ts+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-const-values-true--6b26e4d1265c / TopLevel.ts+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-unions-false--a5053c0a486d / TopLevel.ts+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-unknown-false--f1ab9e45d823 / TopLevel.ts+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.ts+1 −1
| @@ -527,7 +527,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 527 | 527 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 528 | 528 | if (typeof typ === "object") { |
| 529 | 529 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 530 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 530 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 531 | 531 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 532 | 532 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 533 | 533 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
18 generated files · +18 −18test/inputs/json/priority/combinations2.json
Mflowdefault / TopLevel.js+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflownice-property-names-true--f4d7920ee2ce / TopLevel.js+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflowprefer-unions-false--a5053c0a486d / TopLevel.js+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflowprefer-unknown-false--f1ab9e45d823 / TopLevel.js+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflowruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptconverters-all-objects--3a443babd1cb / TopLevel.ts+1 −1
| @@ -559,7 +559,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 559 | 559 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 560 | 560 | if (typeof typ === "object") { |
| 561 | 561 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 562 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 562 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 563 | 563 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 564 | 564 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 565 | 565 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptnice-property-names-true--f4d7920ee2ce / TopLevel.ts+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-const-values-true--6b26e4d1265c / TopLevel.ts+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-unions-false--a5053c0a486d / TopLevel.ts+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-unknown-false--f1ab9e45d823 / TopLevel.ts+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.ts+1 −1
| @@ -479,7 +479,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 479 | 479 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 480 | 480 | if (typeof typ === "object") { |
| 481 | 481 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 482 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 482 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 483 | 483 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 484 | 484 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 485 | 485 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
18 generated files · +18 −18test/inputs/json/priority/combinations3.json
Mflowdefault / TopLevel.js+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflownice-property-names-true--f4d7920ee2ce / TopLevel.js+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflowprefer-unions-false--a5053c0a486d / TopLevel.js+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflowprefer-unknown-false--f1ab9e45d823 / TopLevel.js+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflowruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptconverters-all-objects--3a443babd1cb / TopLevel.ts+1 −1
| @@ -695,7 +695,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 695 | 695 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 696 | 696 | if (typeof typ === "object") { |
| 697 | 697 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 698 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 698 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 699 | 699 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 700 | 700 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 701 | 701 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptnice-property-names-true--f4d7920ee2ce / TopLevel.ts+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-const-values-true--6b26e4d1265c / TopLevel.ts+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-unions-false--a5053c0a486d / TopLevel.ts+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-unknown-false--f1ab9e45d823 / TopLevel.ts+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.ts+1 −1
| @@ -583,7 +583,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 583 | 583 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 584 | 584 | if (typeof typ === "object") { |
| 585 | 585 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 586 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 586 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 587 | 587 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 588 | 588 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 589 | 589 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
18 generated files · +18 −18test/inputs/json/priority/combinations4.json
Mflowdefault / TopLevel.js+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflownice-property-names-true--f4d7920ee2ce / TopLevel.js+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflowprefer-unions-false--a5053c0a486d / TopLevel.js+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflowprefer-unknown-false--f1ab9e45d823 / TopLevel.js+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mflowruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptconverters-top-level--67aa452ed509 / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptacronym-style-pascal--d9e0c1bd777a / TopLevel.ts+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptconverters-all-objects--3a443babd1cb / TopLevel.ts+1 −1
| @@ -781,7 +781,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 781 | 781 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 782 | 782 | if (typeof typ === "object") { |
| 783 | 783 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 784 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 784 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 785 | 785 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 786 | 786 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 787 | 787 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptnice-property-names-true--f4d7920ee2ce / TopLevel.ts+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-const-values-true--6b26e4d1265c / TopLevel.ts+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-unions-false--a5053c0a486d / TopLevel.ts+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-unknown-false--f1ab9e45d823 / TopLevel.ts+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptreadonly-true--24da4fc107df / TopLevel.ts+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptruntime-typecheck-ignore-unknown-properties-true--d792c40f022e / TopLevel.ts+1 −1
| @@ -653,7 +653,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 653 | 653 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 654 | 654 | if (typeof typ === "object") { |
| 655 | 655 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 656 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 656 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 657 | 657 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 658 | 658 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 659 | 659 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/combined-enum.json
Mflowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/direct-recursive.json
Mflowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/empty-enum.json
Mflowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/identifiers.json
Mflowdefault / TopLevel.js+1 −1
| @@ -166,7 +166,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 166 | 166 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 167 | 167 | if (typeof typ === "object") { |
| 168 | 168 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 169 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 169 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 170 | 170 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 171 | 171 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 172 | 172 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -163,7 +163,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 163 | 163 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 164 | 164 | if (typeof typ === "object") { |
| 165 | 165 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 166 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 166 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | 167 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 168 | 168 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/issue2680-object-array.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/issue2680-scalar-array.json
Mflowdefault / TopLevel.js+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/keywords.json
Mflowdefault / TopLevel.js+1 −1
| @@ -1555,7 +1555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 1555 | 1555 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 1556 | 1556 | if (typeof typ === "object") { |
| 1557 | 1557 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 1558 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 1558 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 1559 | 1559 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 1560 | 1560 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 1561 | 1561 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -1555,7 +1555,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 1555 | 1555 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 1556 | 1556 | if (typeof typ === "object") { |
| 1557 | 1557 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 1558 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 1558 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 1559 | 1559 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 1560 | 1560 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 1561 | 1561 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/kotlin-enum-class-case-collision.json
Mflowdefault / TopLevel.js+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/list.json
Mflowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/name-style.json
Mflowdefault / TopLevel.js+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/nbl-stats.json
Mflowdefault / TopLevel.js+1 −1
| @@ -467,7 +467,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 467 | 467 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 468 | 468 | if (typeof typ === "object") { |
| 469 | 469 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 470 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 470 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 471 | 471 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 472 | 472 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 473 | 473 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -412,7 +412,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 412 | 412 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 413 | 413 | if (typeof typ === "object") { |
| 414 | 414 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 415 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 415 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 416 | 416 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 417 | 417 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 418 | 418 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
4 generated files · +4 −4test/inputs/json/priority/nested-objects.json
Mflowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptconverters-all-objects--3a443babd1cb / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/no-classes.json
Mflowdefault / TopLevel.js+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/nst-test-suite.json
Mflowdefault / TopLevel.js+1 −1
| @@ -275,7 +275,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 275 | 275 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 276 | 276 | if (typeof typ === "object") { |
| 277 | 277 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 278 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 278 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 279 | 279 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 280 | 280 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 281 | 281 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -272,7 +272,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 272 | 272 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 273 | 273 | if (typeof typ === "object") { |
| 274 | 274 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 275 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 275 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 276 | 276 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 277 | 277 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 278 | 278 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/number-map.json
Mflowdefault / TopLevel.js+1 −1
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 136 | 136 | if (typeof typ === "object") { |
| 137 | 137 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 138 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | 139 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 140 | 140 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 136 | 136 | if (typeof typ === "object") { |
| 137 | 137 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 138 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | 139 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 140 | 140 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/omit-empty.json
Mflowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/optional-union.json
Mflowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/php-mixed-union.json
Mflowdefault / TopLevel.js+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/php-validation.json
Mflowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/recursive.json
Mflowdefault / TopLevel.js+1 −1
| @@ -254,7 +254,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 254 | 254 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 255 | 255 | if (typeof typ === "object") { |
| 256 | 256 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 257 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 257 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 258 | 258 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 259 | 259 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 260 | 260 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -254,7 +254,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 254 | 254 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 255 | 255 | if (typeof typ === "object") { |
| 256 | 256 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 257 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 257 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 258 | 258 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 259 | 259 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 260 | 260 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/simple-identifiers.json
Mflowdefault / TopLevel.js+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/union-constructor-clash.json
Mflowdefault / TopLevel.js+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/unions.json
Mflowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/url.json
Mflowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/priority/uuids.json
Mflowdefault / TopLevel.js+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -130,7 +130,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | 132 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 133 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 134 | 134 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 136 | 136 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/samples/bitcoin-block.json
Mflowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/samples/getting-started.json
Mflowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/samples/github-events.json
Mflowdefault / TopLevel.js+1 −1
| @@ -423,7 +423,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 423 | 423 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 424 | 424 | if (typeof typ === "object") { |
| 425 | 425 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 426 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 426 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 427 | 427 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 428 | 428 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 429 | 429 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -421,7 +421,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 421 | 421 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 422 | 422 | if (typeof typ === "object") { |
| 423 | 423 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 424 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 424 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 425 | 425 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 426 | 426 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 427 | 427 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/samples/kitchen-sink.json
Mflowdefault / TopLevel.js+1 −1
| @@ -167,7 +167,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 167 | 167 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 168 | 168 | if (typeof typ === "object") { |
| 169 | 169 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 170 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 170 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | 171 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 172 | 172 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -167,7 +167,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 167 | 167 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 168 | 168 | if (typeof typ === "object") { |
| 169 | 169 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 170 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 170 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 171 | 171 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 172 | 172 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 173 | 173 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/samples/null-safe.json
Mflowdefault / TopLevel.js+1 −1
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 149 | 149 | if (typeof typ === "object") { |
| 150 | 150 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 151 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | 152 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 149 | 149 | if (typeof typ === "object") { |
| 150 | 150 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 151 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | 152 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
4 generated files · +4 −4test/inputs/json/samples/pokedex.json
Mflowdefault / TopLevel.js+1 −1
| @@ -187,7 +187,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 187 | 187 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 188 | 188 | if (typeof typ === "object") { |
| 189 | 189 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 190 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 190 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 191 | 191 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 192 | 192 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 193 | 193 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -164,7 +164,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 164 | 164 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 165 | 165 | if (typeof typ === "object") { |
| 166 | 166 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 167 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 168 | 168 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 170 | 170 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptprefer-types-true--df33e18681f9 / TopLevel.ts+1 −1
| @@ -164,7 +164,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 164 | 164 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 165 | 165 | if (typeof typ === "object") { |
| 166 | 166 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 167 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 168 | 168 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 170 | 170 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/samples/reddit.json
Mflowdefault / TopLevel.js+1 −1
| @@ -276,7 +276,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 276 | 276 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 277 | 277 | if (typeof typ === "object") { |
| 278 | 278 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 279 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 279 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 280 | 280 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 281 | 281 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 282 | 282 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -261,7 +261,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 261 | 261 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 262 | 262 | if (typeof typ === "object") { |
| 263 | 263 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 264 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 264 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 265 | 265 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 266 | 266 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 267 | 267 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/samples/simple-object.json
Mflowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/samples/spotify-album.json
Mflowdefault / TopLevel.js+1 −1
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 206 | 206 | if (typeof typ === "object") { |
| 207 | 207 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 208 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 208 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 209 | 209 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 210 | 210 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 211 | 211 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -205,7 +205,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 205 | 205 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 206 | 206 | if (typeof typ === "object") { |
| 207 | 207 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 208 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 208 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 209 | 209 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 210 | 210 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 211 | 211 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/samples/us-avg-temperatures.json
Mflowdefault / TopLevel.js+1 −1
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 149 | 149 | if (typeof typ === "object") { |
| 150 | 150 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 151 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | 152 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 149 | 149 | if (typeof typ === "object") { |
| 150 | 150 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 151 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | 152 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/json/samples/us-senators.json
Mflowdefault / TopLevel.js+1 −1
| @@ -240,7 +240,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 240 | 240 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 241 | 241 | if (typeof typ === "object") { |
| 242 | 242 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 243 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 243 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 244 | 244 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 245 | 245 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 246 | 246 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mjavascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mtypescriptdefault / TopLevel.ts+1 −1
| @@ -217,7 +217,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 217 | 217 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 218 | 218 | if (typeof typ === "object") { |
| 219 | 219 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 220 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 220 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 221 | 221 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 222 | 222 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 223 | 223 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
2 generated files · +414 −0test/inputs/regressions/unicode-codepoint-length.schema
Aschema-javascriptdefault / TopLevel.js+205 −0
| @@ -0,0 +1,205 @@ | ||
| 1 | +// To parse this data: | |
| 2 | +// | |
| 3 | +// const Convert = require("./TopLevel"); | |
| 4 | +// | |
| 5 | +// const topLevel = Convert.toTopLevel(json); | |
| 6 | +// | |
| 7 | +// These functions will throw an error if the JSON doesn't | |
| 8 | +// match the expected interface, even if the JSON is valid. | |
| 9 | + | |
| 10 | +// Converts JSON strings to/from your types | |
| 11 | +// and asserts the results of JSON.parse at runtime | |
| 12 | +function toTopLevel(json) { | |
| 13 | + return cast(JSON.parse(json), r("TopLevel")); | |
| 14 | +} | |
| 15 | + | |
| 16 | +function topLevelToJson(value) { | |
| 17 | + return JSON.stringify(uncast(value, r("TopLevel")), null, 2); | |
| 18 | +} | |
| 19 | + | |
| 20 | +function invalidValue(typ, val, key, parent = '') { | |
| 21 | + const prettyTyp = prettyTypeName(typ); | |
| 22 | + const parentText = parent ? ` on ${parent}` : ''; | |
| 23 | + const keyText = key ? ` for key "${key}"` : ''; | |
| 24 | + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); | |
| 25 | +} | |
| 26 | + | |
| 27 | +function prettyTypeName(typ) { | |
| 28 | + if (Array.isArray(typ)) { | |
| 29 | + if (typ.length === 2 && typ[0] === undefined) { | |
| 30 | + return `an optional ${prettyTypeName(typ[1])}`; | |
| 31 | + } else { | |
| 32 | + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; | |
| 33 | + } | |
| 34 | + } else if (typeof typ === "object" && typ.literal !== undefined) { | |
| 35 | + return typ.literal; | |
| 36 | + } else { | |
| 37 | + return typeof typ; | |
| 38 | + } | |
| 39 | +} | |
| 40 | + | |
| 41 | +function jsonToJSProps(typ) { | |
| 42 | + if (typ.jsonToJS === undefined) { | |
| 43 | + const map = {}; | |
| 44 | + typ.props.forEach((p) => map[p.json] = { key: p.js, typ: p.typ }); | |
| 45 | + typ.jsonToJS = map; | |
| 46 | + } | |
| 47 | + return typ.jsonToJS; | |
| 48 | +} | |
| 49 | + | |
| 50 | +function jsToJSONProps(typ) { | |
| 51 | + if (typ.jsToJSON === undefined) { | |
| 52 | + const map = {}; | |
| 53 | + typ.props.forEach((p) => map[p.js] = { key: p.json, typ: p.typ }); | |
| 54 | + typ.jsToJSON = map; | |
| 55 | + } | |
| 56 | + return typ.jsToJSON; | |
| 57 | +} | |
| 58 | + | |
| 59 | +function transform(val, typ, getProps, key = '', parent = '') { | |
| 60 | + function transformPrimitive(typ, val) { | |
| 61 | + if (typeof typ === typeof val) return val; | |
| 62 | + return invalidValue(typ, val, key, parent); | |
| 63 | + } | |
| 64 | + | |
| 65 | + function transformUnion(typs, val) { | |
| 66 | + // val must validate against one typ in typs | |
| 67 | + const l = typs.length; | |
| 68 | + for (let i = 0; i < l; i++) { | |
| 69 | + const typ = typs[i]; | |
| 70 | + try { | |
| 71 | + return transform(val, typ, getProps); | |
| 72 | + } catch (_) {} | |
| 73 | + } | |
| 74 | + return invalidValue(typs, val, key, parent); | |
| 75 | + } | |
| 76 | + | |
| 77 | + function transformEnum(cases, val) { | |
| 78 | + if (cases.indexOf(val) !== -1) return val; | |
| 79 | + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); | |
| 80 | + } | |
| 81 | + | |
| 82 | + function transformArray(typ, val) { | |
| 83 | + // val must be an array with no invalid elements | |
| 84 | + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); | |
| 85 | + | |
| 86 | + return val.map(el => transform(el, typ, getProps)); | |
| 87 | + } | |
| 88 | + | |
| 89 | + function transformDate(val) { | |
| 90 | + if (val === null) { | |
| 91 | + return null; | |
| 92 | + } | |
| 93 | + const d = new Date(val); | |
| 94 | + if (isNaN(d.valueOf())) { | |
| 95 | + return invalidValue(l("Date"), val, key, parent); | |
| 96 | + } | |
| 97 | + return d; | |
| 98 | + } | |
| 99 | + | |
| 100 | + function transformObject(props, additional, val) { | |
| 101 | + if (val === null || typeof val !== "object" || Array.isArray(val)) { | |
| 102 | + return invalidValue(l(ref || "object"), val, key, parent); | |
| 103 | + } | |
| 104 | + const result = {}; | |
| 105 | + Object.getOwnPropertyNames(props).forEach(key => { | |
| 106 | + const prop = props[key]; | |
| 107 | + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; | |
| 108 | + result[prop.key] = transform(v, prop.typ, getProps, key, ref); | |
| 109 | + }); | |
| 110 | + Object.getOwnPropertyNames(val).forEach(key => { | |
| 111 | + if (!Object.prototype.hasOwnProperty.call(props, key)) { | |
| 112 | + result[key] = transform(val[key], additional, getProps, key, ref); | |
| 113 | + } | |
| 114 | + }); | |
| 115 | + return result; | |
| 116 | + } | |
| 117 | + | |
| 118 | + if (typ === "any") return val; | |
| 119 | + if (typ === null) { | |
| 120 | + if (val === null) return val; | |
| 121 | + return invalidValue(typ, val, key, parent); | |
| 122 | + } | |
| 123 | + if (typ === false) return invalidValue(typ, val, key, parent); | |
| 124 | + let ref = undefined; | |
| 125 | + while (typeof typ === "object" && typ.ref !== undefined) { | |
| 126 | + ref = typ.ref; | |
| 127 | + typ = typeMap[typ.ref]; | |
| 128 | + } | |
| 129 | + if (Array.isArray(typ)) return transformEnum(typ, val); | |
| 130 | + if (typeof typ === "object") { | |
| 131 | + return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | + : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 134 | + : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) | |
| 135 | + : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) | |
| 136 | + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) | |
| 137 | + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) | |
| 138 | + : invalidValue(typ, val, key, parent); | |
| 139 | + } | |
| 140 | + // Numbers can be parsed by Date but shouldn't be. | |
| 141 | + if (typ === Date && typeof val !== "number") return transformDate(val); | |
| 142 | + return transformPrimitive(typ, val); | |
| 143 | +} | |
| 144 | + | |
| 145 | +function cast(val, typ) { | |
| 146 | + return transform(val, typ, jsonToJSProps); | |
| 147 | +} | |
| 148 | + | |
| 149 | +function uncast(val, typ) { | |
| 150 | + return transform(val, typ, jsToJSONProps); | |
| 151 | +} | |
| 152 | + | |
| 153 | +function l(typ) { | |
| 154 | + return { literal: typ }; | |
| 155 | +} | |
| 156 | + | |
| 157 | +function a(typ) { | |
| 158 | + return { arrayItems: typ }; | |
| 159 | +} | |
| 160 | + | |
| 161 | +function i(typ) { | |
| 162 | + return { integer: typ }; | |
| 163 | +} | |
| 164 | + | |
| 165 | +function p(pattern) { | |
| 166 | + return { pattern }; | |
| 167 | +} | |
| 168 | + | |
| 169 | +function s(typ, min, max) { | |
| 170 | + return { string: typ, min, max }; | |
| 171 | +} | |
| 172 | + | |
| 173 | +function n(typ, min, max) { | |
| 174 | + return { number: typ, min, max }; | |
| 175 | +} | |
| 176 | + | |
| 177 | +function u(...typs) { | |
| 178 | + return { unionMembers: typs }; | |
| 179 | +} | |
| 180 | + | |
| 181 | +function o(props, additional) { | |
| 182 | + return { props, additional }; | |
| 183 | +} | |
| 184 | + | |
| 185 | +function m(additional) { | |
| 186 | + const props = []; | |
| 187 | + return { props, additional }; | |
| 188 | +} | |
| 189 | + | |
| 190 | +function r(name) { | |
| 191 | + return { ref: name }; | |
| 192 | +} | |
| 193 | + | |
| 194 | +const typeMap = { | |
| 195 | + "TopLevel": o([ | |
| 196 | + { json: "exact", js: "exact", typ: s(p("^[^!]+$"), 2, 2) }, | |
| 197 | + { json: "maximum", js: "maximum", typ: s("", undefined, 1) }, | |
| 198 | + { json: "minimum", js: "minimum", typ: s("", 2, undefined) }, | |
| 199 | + ], "any"), | |
| 200 | +}; | |
| 201 | + | |
| 202 | +module.exports = { | |
| 203 | + "topLevelToJson": topLevelToJson, | |
| 204 | + "toTopLevel": toTopLevel, | |
| 205 | +}; |
Aschema-typescriptdefault / TopLevel.ts+209 −0
| @@ -0,0 +1,209 @@ | ||
| 1 | +// To parse this data: | |
| 2 | +// | |
| 3 | +// import { Convert, TopLevel } from "./TopLevel"; | |
| 4 | +// | |
| 5 | +// const topLevel = Convert.toTopLevel(json); | |
| 6 | +// | |
| 7 | +// These functions will throw an error if the JSON doesn't | |
| 8 | +// match the expected interface, even if the JSON is valid. | |
| 9 | + | |
| 10 | +export interface TopLevel { | |
| 11 | + exact: string; | |
| 12 | + maximum: string; | |
| 13 | + minimum: string; | |
| 14 | + [property: string]: unknown | string | string | string; | |
| 15 | +} | |
| 16 | + | |
| 17 | +// Converts JSON strings to/from your types | |
| 18 | +// and asserts the results of JSON.parse at runtime | |
| 19 | +export class Convert { | |
| 20 | + public static toTopLevel(json: string): TopLevel { | |
| 21 | + return cast(JSON.parse(json), r("TopLevel")); | |
| 22 | + } | |
| 23 | + | |
| 24 | + public static topLevelToJson(value: TopLevel): string { | |
| 25 | + return JSON.stringify(uncast(value, r("TopLevel")), null, 2); | |
| 26 | + } | |
| 27 | +} | |
| 28 | + | |
| 29 | +function invalidValue(typ: any, val: any, key: any, parent: any = ''): never { | |
| 30 | + const prettyTyp = prettyTypeName(typ); | |
| 31 | + const parentText = parent ? ` on ${parent}` : ''; | |
| 32 | + const keyText = key ? ` for key "${key}"` : ''; | |
| 33 | + throw Error(`Invalid value${keyText}${parentText}. Expected ${prettyTyp} but got ${JSON.stringify(val)}`); | |
| 34 | +} | |
| 35 | + | |
| 36 | +function prettyTypeName(typ: any): string { | |
| 37 | + if (Array.isArray(typ)) { | |
| 38 | + if (typ.length === 2 && typ[0] === undefined) { | |
| 39 | + return `an optional ${prettyTypeName(typ[1])}`; | |
| 40 | + } else { | |
| 41 | + return `one of [${typ.map(a => { return prettyTypeName(a); }).join(", ")}]`; | |
| 42 | + } | |
| 43 | + } else if (typeof typ === "object" && typ.literal !== undefined) { | |
| 44 | + return typ.literal; | |
| 45 | + } else { | |
| 46 | + return typeof typ; | |
| 47 | + } | |
| 48 | +} | |
| 49 | + | |
| 50 | +function jsonToJSProps(typ: any): any { | |
| 51 | + if (typ.jsonToJS === undefined) { | |
| 52 | + const map: any = {}; | |
| 53 | + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); | |
| 54 | + typ.jsonToJS = map; | |
| 55 | + } | |
| 56 | + return typ.jsonToJS; | |
| 57 | +} | |
| 58 | + | |
| 59 | +function jsToJSONProps(typ: any): any { | |
| 60 | + if (typ.jsToJSON === undefined) { | |
| 61 | + const map: any = {}; | |
| 62 | + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); | |
| 63 | + typ.jsToJSON = map; | |
| 64 | + } | |
| 65 | + return typ.jsToJSON; | |
| 66 | +} | |
| 67 | + | |
| 68 | +function transform(val: any, typ: any, getProps: any, key: any = '', parent: any = ''): any { | |
| 69 | + function transformPrimitive(typ: string, val: any): any { | |
| 70 | + if (typeof typ === typeof val) return val; | |
| 71 | + return invalidValue(typ, val, key, parent); | |
| 72 | + } | |
| 73 | + | |
| 74 | + function transformUnion(typs: any[], val: any): any { | |
| 75 | + // val must validate against one typ in typs | |
| 76 | + const l = typs.length; | |
| 77 | + for (let i = 0; i < l; i++) { | |
| 78 | + const typ = typs[i]; | |
| 79 | + try { | |
| 80 | + return transform(val, typ, getProps); | |
| 81 | + } catch (_) {} | |
| 82 | + } | |
| 83 | + return invalidValue(typs, val, key, parent); | |
| 84 | + } | |
| 85 | + | |
| 86 | + function transformEnum(cases: string[], val: any): any { | |
| 87 | + if (cases.indexOf(val) !== -1) return val; | |
| 88 | + return invalidValue(cases.map(a => { return l(a); }), val, key, parent); | |
| 89 | + } | |
| 90 | + | |
| 91 | + function transformArray(typ: any, val: any): any { | |
| 92 | + // val must be an array with no invalid elements | |
| 93 | + if (!Array.isArray(val)) return invalidValue(l("array"), val, key, parent); | |
| 94 | + | |
| 95 | + return val.map(el => transform(el, typ, getProps)); | |
| 96 | + } | |
| 97 | + | |
| 98 | + function transformDate(val: any): any { | |
| 99 | + if (val === null) { | |
| 100 | + return null; | |
| 101 | + } | |
| 102 | + const d = new Date(val); | |
| 103 | + if (isNaN(d.valueOf())) { | |
| 104 | + return invalidValue(l("Date"), val, key, parent); | |
| 105 | + } | |
| 106 | + return d; | |
| 107 | + } | |
| 108 | + | |
| 109 | + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { | |
| 110 | + if (val === null || typeof val !== "object" || Array.isArray(val)) { | |
| 111 | + return invalidValue(l(ref || "object"), val, key, parent); | |
| 112 | + } | |
| 113 | + const result: any = {}; | |
| 114 | + Object.getOwnPropertyNames(props).forEach(key => { | |
| 115 | + const prop = props[key]; | |
| 116 | + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; | |
| 117 | + result[prop.key] = transform(v, prop.typ, getProps, key, ref); | |
| 118 | + }); | |
| 119 | + Object.getOwnPropertyNames(val).forEach(key => { | |
| 120 | + if (!Object.prototype.hasOwnProperty.call(props, key)) { | |
| 121 | + result[key] = transform(val[key], additional, getProps, key, ref); | |
| 122 | + } | |
| 123 | + }); | |
| 124 | + return result; | |
| 125 | + } | |
| 126 | + | |
| 127 | + if (typ === "any") return val; | |
| 128 | + if (typ === null) { | |
| 129 | + if (val === null) return val; | |
| 130 | + return invalidValue(typ, val, key, parent); | |
| 131 | + } | |
| 132 | + if (typ === false) return invalidValue(typ, val, key, parent); | |
| 133 | + let ref: any = undefined; | |
| 134 | + while (typeof typ === "object" && typ.ref !== undefined) { | |
| 135 | + ref = typ.ref; | |
| 136 | + typ = typeMap[typ.ref]; | |
| 137 | + } | |
| 138 | + if (Array.isArray(typ)) return transformEnum(typ, val); | |
| 139 | + if (typeof typ === "object") { | |
| 140 | + return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) | |
| 144 | + : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) | |
| 145 | + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) | |
| 146 | + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) | |
| 147 | + : invalidValue(typ, val, key, parent); | |
| 148 | + } | |
| 149 | + // Numbers can be parsed by Date but shouldn't be. | |
| 150 | + if (typ === Date && typeof val !== "number") return transformDate(val); | |
| 151 | + return transformPrimitive(typ, val); | |
| 152 | +} | |
| 153 | + | |
| 154 | +function cast<T>(val: any, typ: any): T { | |
| 155 | + return transform(val, typ, jsonToJSProps); | |
| 156 | +} | |
| 157 | + | |
| 158 | +function uncast<T>(val: T, typ: any): any { | |
| 159 | + return transform(val, typ, jsToJSONProps); | |
| 160 | +} | |
| 161 | + | |
| 162 | +function l(typ: any) { | |
| 163 | + return { literal: typ }; | |
| 164 | +} | |
| 165 | + | |
| 166 | +function a(typ: any) { | |
| 167 | + return { arrayItems: typ }; | |
| 168 | +} | |
| 169 | + | |
| 170 | +function i(typ: any) { | |
| 171 | + return { integer: typ }; | |
| 172 | +} | |
| 173 | + | |
| 174 | +function p(pattern: any) { | |
| 175 | + return { pattern }; | |
| 176 | +} | |
| 177 | + | |
| 178 | +function s(typ: any, min: any, max: any) { | |
| 179 | + return { string: typ, min, max }; | |
| 180 | +} | |
| 181 | + | |
| 182 | +function n(typ: any, min: any, max: any) { | |
| 183 | + return { number: typ, min, max }; | |
| 184 | +} | |
| 185 | + | |
| 186 | +function u(...typs: any[]) { | |
| 187 | + return { unionMembers: typs }; | |
| 188 | +} | |
| 189 | + | |
| 190 | +function o(props: any[], additional: any) { | |
| 191 | + return { props, additional }; | |
| 192 | +} | |
| 193 | + | |
| 194 | +function m(additional: any) { | |
| 195 | + const props: any[] = []; | |
| 196 | + return { props, additional }; | |
| 197 | +} | |
| 198 | + | |
| 199 | +function r(name: string) { | |
| 200 | + return { ref: name }; | |
| 201 | +} | |
| 202 | + | |
| 203 | +const typeMap: any = { | |
| 204 | + "TopLevel": o([ | |
| 205 | + { json: "exact", js: "exact", typ: s(p("^[^!]+$"), 2, 2) }, | |
| 206 | + { json: "maximum", js: "maximum", typ: s("", undefined, 1) }, | |
| 207 | + { json: "minimum", js: "minimum", typ: s("", 2, undefined) }, | |
| 208 | + ], "any"), | |
| 209 | +}; |
Test case
3 generated files · +3 −3test/inputs/schema/accessors.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/all-of-additional-properties-false.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 148 | 148 | if (typeof typ === "object") { |
| 149 | 149 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 150 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | 151 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/any.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/bool-string.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/boolean-subschema.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/camelCase.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/class-map-union.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -152,7 +152,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 152 | 152 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 153 | 153 | if (typeof typ === "object") { |
| 154 | 154 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 155 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 155 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 156 | 156 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 157 | 157 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 158 | 158 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -152,7 +152,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 152 | 152 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 153 | 153 | if (typeof typ === "object") { |
| 154 | 154 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 155 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 155 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 156 | 156 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 157 | 157 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 158 | 158 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/class-with-additional.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
4 generated files · +4 −4test/inputs/schema/comment-injection-enum-nested-comment.schema
Mcomment-injection-typescriptdefault / TopLevel.ts+1 −1
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 150 | 150 | if (typeof typ === "object") { |
| 151 | 151 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 152 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | 153 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -150,7 +150,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 150 | 150 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 151 | 151 | if (typeof typ === "object") { |
| 152 | 152 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 153 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 154 | 154 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 156 | 156 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 150 | 150 | if (typeof typ === "object") { |
| 151 | 151 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 152 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | 153 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
4 generated files · +4 −4test/inputs/schema/comment-injection-enum.schema
Mcomment-injection-typescriptdefault / TopLevel.ts+1 −1
| @@ -155,7 +155,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 155 | 155 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 156 | 156 | if (typeof typ === "object") { |
| 157 | 157 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 158 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 158 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 159 | 159 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 160 | 160 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 161 | 161 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -156,7 +156,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 156 | 156 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 157 | 157 | if (typeof typ === "object") { |
| 158 | 158 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 159 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 159 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 160 | 160 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 161 | 161 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 162 | 162 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -155,7 +155,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 155 | 155 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 156 | 156 | if (typeof typ === "object") { |
| 157 | 157 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 158 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 158 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 159 | 159 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 160 | 160 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 161 | 161 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
4 generated files · +4 −4test/inputs/schema/comment-injection-nested-comment.schema
Mcomment-injection-typescriptdefault / TopLevel.ts+1 −1
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 148 | 148 | if (typeof typ === "object") { |
| 149 | 149 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 150 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | 151 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 148 | 148 | if (typeof typ === "object") { |
| 149 | 149 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 150 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | 151 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 148 | 148 | if (typeof typ === "object") { |
| 149 | 149 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 150 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | 151 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
4 generated files · +4 −4test/inputs/schema/comment-injection.schema
Mcomment-injection-typescriptdefault / TopLevel.ts+1 −1
| @@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 175 | 175 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 176 | 176 | if (typeof typ === "object") { |
| 177 | 177 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 178 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 178 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 179 | 179 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 180 | 180 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 181 | 181 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 175 | 175 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 176 | 176 | if (typeof typ === "object") { |
| 177 | 177 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 178 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 178 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 179 | 179 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 180 | 180 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 181 | 181 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -175,7 +175,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 175 | 175 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 176 | 176 | if (typeof typ === "object") { |
| 177 | 177 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 178 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 178 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 179 | 179 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 180 | 180 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 181 | 181 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/const-non-string.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/constructor.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/cut-enum.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/date-time-or-string.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/date-time.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/default-value.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/description-with-double-quotes.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/description.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -174,7 +174,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 174 | 174 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 175 | 175 | if (typeof typ === "object") { |
| 176 | 176 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 177 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 177 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 178 | 178 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 179 | 179 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 180 | 180 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -172,7 +172,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 172 | 172 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 173 | 173 | if (typeof typ === "object") { |
| 174 | 174 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 175 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 175 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 176 | 176 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 177 | 177 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 178 | 178 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/direct-union.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/empty-object.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/enum-large.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -164,7 +164,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 164 | 164 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 165 | 165 | if (typeof typ === "object") { |
| 166 | 166 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 167 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 167 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 168 | 168 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 169 | 169 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 170 | 170 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/enum-with-null.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/enum-with-values.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/enum.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -157,7 +157,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 157 | 157 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 158 | 158 | if (typeof typ === "object") { |
| 159 | 159 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 160 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 160 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 161 | 161 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 162 | 162 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 163 | 163 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -148,7 +148,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 148 | 148 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 149 | 149 | if (typeof typ === "object") { |
| 150 | 150 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 151 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | 152 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/go-schema-pattern-properties.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/haskell-enum-forbidden.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/id-no-address.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/id-root.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/ie-suffix-singularization.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/implicit-all-of.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/implicit-class-array-union.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/implicit-one-of.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/integer-before-number.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/integer-float-union.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/integer-string.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/integer-type.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -144,7 +144,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 144 | 144 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 145 | 145 | if (typeof typ === "object") { |
| 146 | 146 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 147 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | 148 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/intersection-nested.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 136 | 136 | if (typeof typ === "object") { |
| 137 | 137 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 138 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | 139 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 140 | 140 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -135,7 +135,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 135 | 135 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 136 | 136 | if (typeof typ === "object") { |
| 137 | 137 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 138 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 138 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | 139 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 140 | 140 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/intersection.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/issue2680-top-level-array.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/keyword-enum.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -415,7 +415,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 415 | 415 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 416 | 416 | if (typeof typ === "object") { |
| 417 | 417 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 418 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 418 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 419 | 419 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 420 | 420 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 421 | 421 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/keyword-unions.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -1792,7 +1792,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 1792 | 1792 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 1793 | 1793 | if (typeof typ === "object") { |
| 1794 | 1794 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 1795 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 1795 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 1796 | 1796 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 1797 | 1797 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 1798 | 1798 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -964,7 +964,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 964 | 964 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 965 | 965 | if (typeof typ === "object") { |
| 966 | 966 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 967 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 967 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 968 | 968 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 969 | 969 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 970 | 970 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/light.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/list.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/min-max-items.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -142,7 +142,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 142 | 142 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 143 | 143 | if (typeof typ === "object") { |
| 144 | 144 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 145 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | 146 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/minmax-integer.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/minmax.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/minmaxlength.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/multi-type-enum.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/mutually-recursive.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/nested-intersection-union.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -143,7 +143,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 143 | 143 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 144 | 144 | if (typeof typ === "object") { |
| 145 | 145 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 146 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 146 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 147 | 147 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/non-standard-ref.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/nullable-optional-one-of.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/object-type-required.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/optional-any.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/optional-const-ref.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 147 | 147 | if (typeof typ === "object") { |
| 148 | 148 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 149 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | 150 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 147 | 147 | if (typeof typ === "object") { |
| 148 | 148 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 149 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | 150 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/optional-constraints.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/optional-date-time.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/optional-enum.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/pattern.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/postman-collection.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 147 | 147 | if (typeof typ === "object") { |
| 148 | 148 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 149 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | 150 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 147 | 147 | if (typeof typ === "object") { |
| 148 | 148 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 149 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | 150 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/prefix-items.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/recursive-union-flattening.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 150 | 150 | if (typeof typ === "object") { |
| 151 | 151 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 152 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | 153 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -149,7 +149,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 149 | 149 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 150 | 150 | if (typeof typ === "object") { |
| 151 | 151 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 152 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 152 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 153 | 153 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 154 | 154 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 155 | 155 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/ref-id-files.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/ref-remote.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/renaming-bug.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -238,7 +238,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 238 | 238 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 239 | 239 | if (typeof typ === "object") { |
| 240 | 240 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 241 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 241 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 242 | 242 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 243 | 243 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 244 | 244 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -223,7 +223,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 223 | 223 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 224 | 224 | if (typeof typ === "object") { |
| 225 | 225 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 226 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 226 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 227 | 227 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 228 | 228 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 229 | 229 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/required-draft3.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/required-non-properties.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/required.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/rust-cycle-breaker-union.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -145,7 +145,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 145 | 145 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 148 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | 149 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 150 | 150 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/schema-constraints.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -137,7 +137,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 137 | 137 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 138 | 138 | if (typeof typ === "object") { |
| 139 | 139 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 140 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | 141 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/simple-ref.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/strict-optional.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/top-level-array.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -139,7 +139,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 139 | 139 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 140 | 140 | if (typeof typ === "object") { |
| 141 | 141 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 142 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | 143 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/top-level-enum.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/top-level-primitive-array.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -133,7 +133,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 133 | 133 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 134 | 134 | if (typeof typ === "object") { |
| 135 | 135 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 136 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 136 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 137 | 137 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 138 | 138 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 139 | 139 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/top-level-primitive.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -136,7 +136,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 136 | 136 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 137 | 137 | if (typeof typ === "object") { |
| 138 | 138 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 139 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 139 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 140 | 140 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 141 | 141 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 142 | 142 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/tuple.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/unevaluated-properties.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -154,7 +154,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 154 | 154 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 155 | 155 | if (typeof typ === "object") { |
| 156 | 156 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 157 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 157 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 158 | 158 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 159 | 159 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 160 | 160 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -151,7 +151,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 151 | 151 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 152 | 152 | if (typeof typ === "object") { |
| 153 | 153 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 154 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 154 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 155 | 155 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 156 | 156 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 157 | 157 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/union-int-double.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -138,7 +138,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 138 | 138 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 139 | 139 | if (typeof typ === "object") { |
| 140 | 140 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 141 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 141 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 142 | 142 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 143 | 143 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 144 | 144 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/union-list.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -141,7 +141,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 141 | 141 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 142 | 142 | if (typeof typ === "object") { |
| 143 | 143 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 144 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 145 | 145 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 147 | 147 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/union.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -140,7 +140,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 140 | 140 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 141 | 141 | if (typeof typ === "object") { |
| 142 | 142 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 143 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 143 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 144 | 144 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 145 | 145 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 146 | 146 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/uuid.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -147,7 +147,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 147 | 147 | if (typeof typ === "object") { |
| 148 | 148 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 149 | 149 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 150 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 151 | 151 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 153 | 153 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -130,7 +130,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | 132 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 133 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 134 | 134 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 136 | 136 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -146,7 +146,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 146 | 146 | if (typeof typ === "object") { |
| 147 | 147 | return typ.hasOwnProperty("uuid") ? typeof val === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(val) ? val : invalidValue(typ, val, key, parent) |
| 148 | 148 | : typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 149 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 149 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 150 | 150 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 151 | 151 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 152 | 152 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Test case
3 generated files · +3 −3test/inputs/schema/vega-lite.schema
Mschema-flowdefault / TopLevel.js+1 −1
| @@ -6227,7 +6227,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 6227 | 6227 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 6228 | 6228 | if (typeof typ === "object") { |
| 6229 | 6229 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 6230 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 6230 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 6231 | 6231 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 6232 | 6232 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 6233 | 6233 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-javascriptdefault / TopLevel.js+1 −1
| @@ -129,7 +129,7 @@ function transform(val, typ, getProps, key = '', parent = '') { | ||
| 129 | 129 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 130 | 130 | if (typeof typ === "object") { |
| 131 | 131 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 132 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 132 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 133 | 133 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 134 | 134 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 135 | 135 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
Mschema-typescriptdefault / TopLevel.ts+1 −1
| @@ -5984,7 +5984,7 @@ function transform(val: any, typ: any, getProps: any, key: any = '', parent: any | ||
| 5984 | 5984 | if (Array.isArray(typ)) return transformEnum(typ, val); |
| 5985 | 5985 | if (typeof typ === "object") { |
| 5986 | 5986 | return typ.hasOwnProperty("pattern") ? typeof val === "string" && new RegExp(typ.pattern).test(val) ? val : invalidValue(typ, val, key, parent) |
| 5987 | - : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || val.length >= typ.min) && (typ.max === undefined || val.length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 5987 | + : typ.hasOwnProperty("string") ? typeof val === "string" && (typ.min === undefined || Array.from(val).length >= typ.min) && (typ.max === undefined || Array.from(val).length <= typ.max) ? transform(val, typ.string, getProps, key, parent) : invalidValue(typ, val, key, parent) | |
| 5988 | 5988 | : typ.hasOwnProperty("number") ? typeof val === "number" && (typ.min === undefined || val >= typ.min) && (typ.max === undefined || val <= typ.max) ? transform(val, typ.number, getProps, key, parent) : invalidValue(typ, val, key, parent) |
| 5989 | 5989 | : typ.hasOwnProperty("integer") ? typeof val === "number" && val % 1 === 0 ? val : invalidValue(l("integer"), val, key, parent) |
| 5990 | 5990 | : typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) |
No generated files match these filters.