cdk-common 2.0.367 → 2.0.369
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +3 -3
- package/lib/main.js +1 -1
- package/node_modules/@aws-cdk/assert/LICENSE +1 -1
- package/node_modules/@aws-cdk/assert/NOTICE +1 -1
- package/node_modules/@aws-cdk/assert/package.json +8 -8
- package/node_modules/@aws-cdk/cfnspec/build-tools/template/LICENSE +1 -1
- package/node_modules/@aws-cdk/cfnspec/build-tools/template/NOTICE +1 -1
- package/node_modules/@aws-cdk/cfnspec/package.json +3 -3
- package/node_modules/@aws-cdk/cloudformation-diff/LICENSE +1 -1
- package/node_modules/@aws-cdk/cloudformation-diff/NOTICE +1 -1
- package/node_modules/@aws-cdk/cloudformation-diff/package.json +4 -4
- package/node_modules/table/node_modules/ajv/README.md +5 -4
- package/node_modules/table/node_modules/ajv/dist/compile/codegen/code.d.ts +5 -5
- package/node_modules/table/node_modules/ajv/dist/compile/codegen/index.d.ts +2 -2
- package/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.d.ts +5 -5
- package/node_modules/table/node_modules/ajv/dist/compile/index.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js +18 -7
- package/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -1
- package/node_modules/table/node_modules/ajv/dist/compile/jtd/types.d.ts +2 -2
- package/node_modules/table/node_modules/ajv/dist/compile/resolve.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/compile/rules.d.ts +2 -2
- package/node_modules/table/node_modules/ajv/dist/compile/util.d.ts +2 -2
- package/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/compile/validate/index.js +11 -1
- package/node_modules/table/node_modules/ajv/dist/compile/validate/index.js.map +1 -1
- package/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/core.d.ts +3 -3
- package/node_modules/table/node_modules/ajv/dist/jtd.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/runtime/equal.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/runtime/re2.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/runtime/uri.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/types/index.d.ts +19 -19
- package/node_modules/table/node_modules/ajv/dist/types/json-schema.d.ts +14 -14
- package/node_modules/table/node_modules/ajv/dist/types/jtd-schema.d.ts +30 -25
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +2 -2
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/errors.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +3 -3
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js +8 -5
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +3 -3
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js +10 -7
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.d.ts +2 -2
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +3 -3
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/lib/compile/jtd/serialize.ts +20 -14
- package/node_modules/table/node_modules/ajv/lib/compile/validate/index.ts +10 -1
- package/node_modules/table/node_modules/ajv/lib/types/jtd-schema.ts +21 -11
- package/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/properties.ts +13 -6
- package/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/values.ts +10 -7
- package/node_modules/table/node_modules/ajv/package.json +5 -5
- package/package.json +3 -3
package/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
|
|
2
|
-
export
|
|
2
|
+
export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {
|
|
3
3
|
limit: number;
|
|
4
4
|
}, AnySchema>;
|
|
5
5
|
declare const def: CodeKeywordDefinition;
|
package/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
|
|
2
|
-
export
|
|
2
|
+
export type UnevaluatedPropertiesError = ErrorObject<"unevaluatedProperties", {
|
|
3
3
|
unevaluatedProperty: string;
|
|
4
4
|
}, AnySchema>;
|
|
5
5
|
declare const def: CodeKeywordDefinition;
|
package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, ErrorObject } from "../../types";
|
|
2
2
|
import { DependenciesErrorParams, PropertyDependencies } from "../applicator/dependencies";
|
|
3
|
-
export
|
|
3
|
+
export type DependentRequiredError = ErrorObject<"dependentRequired", DependenciesErrorParams, PropertyDependencies>;
|
|
4
4
|
declare const def: CodeKeywordDefinition;
|
|
5
5
|
export default def;
|
|
@@ -8,9 +8,9 @@ import { ConstError } from "./const";
|
|
|
8
8
|
import { EnumError } from "./enum";
|
|
9
9
|
declare const validation: Vocabulary;
|
|
10
10
|
export default validation;
|
|
11
|
-
|
|
11
|
+
type LimitError = ErrorObject<"maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", {
|
|
12
12
|
limit: number;
|
|
13
13
|
}, number | {
|
|
14
14
|
$data: string;
|
|
15
15
|
}>;
|
|
16
|
-
export
|
|
16
|
+
export type ValidationKeywordError = LimitError | LimitNumberError | MultipleOfError | PatternError | RequiredError | UniqueItemsError | ConstError | EnumError;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, ErrorObject } from "../../types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
2
|
+
type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum";
|
|
3
|
+
type Comparison = "<=" | ">=" | "<" | ">";
|
|
4
|
+
export type LimitNumberError = ErrorObject<Kwd, {
|
|
5
5
|
limit: number;
|
|
6
6
|
comparison: Comparison;
|
|
7
7
|
}, number | {
|
|
@@ -117,7 +117,7 @@ function serializeValues(cxt: SerializeCxt): void {
|
|
|
117
117
|
gen.add(N.json, str`}`)
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
function serializeKeyValue(cxt: SerializeCxt, key: Name, schema: SchemaObject, first
|
|
120
|
+
function serializeKeyValue(cxt: SerializeCxt, key: Name, schema: SchemaObject, first?: Name): void {
|
|
121
121
|
const {gen, data} = cxt
|
|
122
122
|
addComma(cxt, first)
|
|
123
123
|
serializeString({...cxt, data: key})
|
|
@@ -156,20 +156,24 @@ function serializeSchemaProperties(cxt: SerializeCxt, discriminator?: string): v
|
|
|
156
156
|
const optProps = keys(optionalProperties)
|
|
157
157
|
const allProps = allProperties(props.concat(optProps))
|
|
158
158
|
let first = !discriminator
|
|
159
|
+
let firstProp: Name | undefined
|
|
160
|
+
|
|
159
161
|
for (const key of props) {
|
|
162
|
+
if (first) first = false
|
|
163
|
+
else gen.add(N.json, str`,`)
|
|
160
164
|
serializeProperty(key, properties[key], keyValue(key))
|
|
161
165
|
}
|
|
166
|
+
if (first) firstProp = gen.let("first", true)
|
|
162
167
|
for (const key of optProps) {
|
|
163
168
|
const value = keyValue(key)
|
|
164
|
-
gen.if(and(_`${value} !== undefined`, isOwnProperty(gen, data, key)), () =>
|
|
169
|
+
gen.if(and(_`${value} !== undefined`, isOwnProperty(gen, data, key)), () => {
|
|
170
|
+
addComma(cxt, firstProp)
|
|
165
171
|
serializeProperty(key, optionalProperties[key], value)
|
|
166
|
-
)
|
|
172
|
+
})
|
|
167
173
|
}
|
|
168
174
|
if (schema.additionalProperties) {
|
|
169
175
|
gen.forIn("key", data, (key) =>
|
|
170
|
-
gen.if(isAdditional(key, allProps), () =>
|
|
171
|
-
serializeKeyValue(cxt, key, {}, gen.let("first", first))
|
|
172
|
-
)
|
|
176
|
+
gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp))
|
|
173
177
|
)
|
|
174
178
|
}
|
|
175
179
|
|
|
@@ -190,8 +194,6 @@ function serializeSchemaProperties(cxt: SerializeCxt, discriminator?: string): v
|
|
|
190
194
|
}
|
|
191
195
|
|
|
192
196
|
function serializeProperty(key: string, propSchema: SchemaObject, value: Name): void {
|
|
193
|
-
if (first) first = false
|
|
194
|
-
else gen.add(N.json, str`,`)
|
|
195
197
|
gen.add(N.json, str`${JSON.stringify(key)}:`)
|
|
196
198
|
serializeCode({...cxt, schema: propSchema, data: value})
|
|
197
199
|
}
|
|
@@ -251,10 +253,14 @@ function serializeEmpty({gen, data}: SerializeCxt): void {
|
|
|
251
253
|
gen.add(N.json, _`JSON.stringify(${data})`)
|
|
252
254
|
}
|
|
253
255
|
|
|
254
|
-
function addComma({gen}: SerializeCxt, first
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
function addComma({gen}: SerializeCxt, first?: Name): void {
|
|
257
|
+
if (first) {
|
|
258
|
+
gen.if(
|
|
259
|
+
first,
|
|
260
|
+
() => gen.assign(first, false),
|
|
261
|
+
() => gen.add(N.json, str`,`)
|
|
262
|
+
)
|
|
263
|
+
} else {
|
|
264
|
+
gen.add(N.json, str`,`)
|
|
265
|
+
}
|
|
260
266
|
}
|
|
@@ -286,7 +286,7 @@ function checkContextTypes(it: SchemaObjCxt, types: JSONType[]): void {
|
|
|
286
286
|
strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`)
|
|
287
287
|
}
|
|
288
288
|
})
|
|
289
|
-
it
|
|
289
|
+
narrowSchemaTypes(it, types)
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
function checkMultipleTypes(it: SchemaObjCxt, ts: JSONType[]): void {
|
|
@@ -316,6 +316,15 @@ function includesType(ts: JSONType[], t: JSONType): boolean {
|
|
|
316
316
|
return ts.includes(t) || (t === "integer" && ts.includes("number"))
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
+
function narrowSchemaTypes(it: SchemaObjCxt, withTypes: JSONType[]): void {
|
|
320
|
+
const ts: JSONType[] = []
|
|
321
|
+
for (const t of it.dataTypes) {
|
|
322
|
+
if (includesType(withTypes, t)) ts.push(t)
|
|
323
|
+
else if (withTypes.includes("integer") && t === "number") ts.push("integer")
|
|
324
|
+
}
|
|
325
|
+
it.dataTypes = ts
|
|
326
|
+
}
|
|
327
|
+
|
|
319
328
|
function strictTypesError(it: SchemaObjCxt, msg: string): void {
|
|
320
329
|
const schemaPath = it.schemaEnv.baseId + it.errSchemaPath
|
|
321
330
|
msg += ` at "${schemaPath}" (strictTypes)`
|
|
@@ -74,7 +74,7 @@ type EnumString<T> = [T] extends [never]
|
|
|
74
74
|
: null
|
|
75
75
|
|
|
76
76
|
/** true if type is a union of string literals */
|
|
77
|
-
type IsEnum<T> = null extends EnumString<
|
|
77
|
+
type IsEnum<T> = null extends EnumString<T> ? false : true
|
|
78
78
|
|
|
79
79
|
/** true only if all types are array types (not tuples) */
|
|
80
80
|
// NOTE relies on the fact that tuples don't have an index at 0.5, but arrays
|
|
@@ -88,13 +88,18 @@ type IsElements<T> = false extends IsUnion<T>
|
|
|
88
88
|
: false
|
|
89
89
|
|
|
90
90
|
/** true if the the type is a values type */
|
|
91
|
-
type IsValues<T> = false extends IsUnion<
|
|
92
|
-
|
|
91
|
+
type IsValues<T> = false extends IsUnion<T> ? TypeEquality<keyof T, string> : false
|
|
92
|
+
|
|
93
|
+
/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */
|
|
94
|
+
type IsRecord<T, Union extends boolean> = Union extends IsUnion<T>
|
|
95
|
+
? null extends EnumString<keyof T>
|
|
96
|
+
? false
|
|
97
|
+
: true
|
|
93
98
|
: false
|
|
94
99
|
|
|
95
|
-
/** true if type
|
|
96
|
-
type
|
|
97
|
-
?
|
|
100
|
+
/** true if type represents an empty record */
|
|
101
|
+
type IsEmptyRecord<T> = [T] extends [Record<string, never>]
|
|
102
|
+
? [T] extends [never]
|
|
98
103
|
? false
|
|
99
104
|
: true
|
|
100
105
|
: false
|
|
@@ -131,7 +136,7 @@ export type JTDSchemaType<T, D extends Record<string, unknown> = Record<string,
|
|
|
131
136
|
? {type: "timestamp"}
|
|
132
137
|
: // enums - only accepts union of string literals
|
|
133
138
|
// TODO we can't actually check that everything in the union was specified
|
|
134
|
-
true extends IsEnum<T
|
|
139
|
+
true extends IsEnum<Exclude<T, null>>
|
|
135
140
|
? {enum: EnumString<Exclude<T, null>>[]}
|
|
136
141
|
: // arrays - only accepts arrays, could be array of unions to be resolved later
|
|
137
142
|
true extends IsElements<Exclude<T, null>>
|
|
@@ -140,15 +145,20 @@ export type JTDSchemaType<T, D extends Record<string, unknown> = Record<string,
|
|
|
140
145
|
elements: JTDSchemaType<E, D>
|
|
141
146
|
}
|
|
142
147
|
: never
|
|
148
|
+
: // empty properties
|
|
149
|
+
true extends IsEmptyRecord<Exclude<T, null>>
|
|
150
|
+
?
|
|
151
|
+
| {properties: Record<string, never>; optionalProperties?: Record<string, never>}
|
|
152
|
+
| {optionalProperties: Record<string, never>}
|
|
143
153
|
: // values
|
|
144
|
-
true extends IsValues<T
|
|
154
|
+
true extends IsValues<Exclude<T, null>>
|
|
145
155
|
? T extends Record<string, infer V>
|
|
146
156
|
? {
|
|
147
157
|
values: JTDSchemaType<V, D>
|
|
148
158
|
}
|
|
149
159
|
: never
|
|
150
160
|
: // properties
|
|
151
|
-
true extends IsRecord<T, false>
|
|
161
|
+
true extends IsRecord<Exclude<T, null>, false>
|
|
152
162
|
? ([RequiredKeys<Exclude<T, null>>] extends [never]
|
|
153
163
|
? {
|
|
154
164
|
properties?: Record<string, never>
|
|
@@ -168,7 +178,7 @@ export type JTDSchemaType<T, D extends Record<string, unknown> = Record<string,
|
|
|
168
178
|
additionalProperties?: boolean
|
|
169
179
|
}
|
|
170
180
|
: // discriminator
|
|
171
|
-
true extends IsRecord<T, true>
|
|
181
|
+
true extends IsRecord<Exclude<T, null>, true>
|
|
172
182
|
? {
|
|
173
183
|
[K in keyof Exclude<T, null>]-?: Exclude<T, null>[K] extends string
|
|
174
184
|
? {
|
|
@@ -176,7 +186,7 @@ export type JTDSchemaType<T, D extends Record<string, unknown> = Record<string,
|
|
|
176
186
|
mapping: {
|
|
177
187
|
// TODO currently allows descriminator to be present in schema
|
|
178
188
|
[M in Exclude<T, null>[K]]: JTDSchemaType<
|
|
179
|
-
Omit<T extends
|
|
189
|
+
Omit<T extends Record<K, M> ? T : never, K>,
|
|
180
190
|
D
|
|
181
191
|
>
|
|
182
192
|
}
|
|
@@ -138,9 +138,7 @@ export function validateProperties(cxt: KeywordCxt): void {
|
|
|
138
138
|
|
|
139
139
|
function validateAdditional(): void {
|
|
140
140
|
gen.forIn("key", data, (key: Name) => {
|
|
141
|
-
const
|
|
142
|
-
it.jtdDiscriminator === undefined ? allProps : [it.jtdDiscriminator].concat(allProps)
|
|
143
|
-
const addProp = isAdditional(key, _allProps, "properties")
|
|
141
|
+
const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator)
|
|
144
142
|
const addOptProp = isAdditional(key, allOptProps, "optionalProperties")
|
|
145
143
|
const extra =
|
|
146
144
|
addProp === true ? addOptProp : addOptProp === true ? addProp : and(addProp, addOptProp)
|
|
@@ -159,14 +157,23 @@ export function validateProperties(cxt: KeywordCxt): void {
|
|
|
159
157
|
})
|
|
160
158
|
}
|
|
161
159
|
|
|
162
|
-
function isAdditional(
|
|
160
|
+
function isAdditional(
|
|
161
|
+
key: Name,
|
|
162
|
+
props: string[],
|
|
163
|
+
keyword: string,
|
|
164
|
+
jtdDiscriminator?: string
|
|
165
|
+
): Code | true {
|
|
163
166
|
let additional: Code | boolean
|
|
164
167
|
if (props.length > 8) {
|
|
165
168
|
// TODO maybe an option instead of hard-coded 8?
|
|
166
169
|
const propsSchema = schemaRefOrVal(it, parentSchema[keyword], keyword)
|
|
167
170
|
additional = not(isOwnProperty(gen, propsSchema as Code, key))
|
|
168
|
-
|
|
169
|
-
|
|
171
|
+
if (jtdDiscriminator !== undefined) {
|
|
172
|
+
additional = and(additional, _`${key} !== ${jtdDiscriminator}`)
|
|
173
|
+
}
|
|
174
|
+
} else if (props.length || jtdDiscriminator !== undefined) {
|
|
175
|
+
const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props)
|
|
176
|
+
additional = and(...ps.map((p) => _`${key} !== ${p}`))
|
|
170
177
|
} else {
|
|
171
178
|
additional = true
|
|
172
179
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {CodeKeywordDefinition, SchemaObject} from "../../types"
|
|
2
2
|
import type {KeywordCxt} from "../../compile/validate"
|
|
3
3
|
import {alwaysValidSchema, Type} from "../../compile/util"
|
|
4
|
-
import {not, Name} from "../../compile/codegen"
|
|
4
|
+
import {not, or, Name} from "../../compile/codegen"
|
|
5
5
|
import {checkMetadata} from "./metadata"
|
|
6
6
|
import {checkNullableObject} from "./nullable"
|
|
7
7
|
import {typeError, _JTDTypeError} from "./error"
|
|
@@ -15,13 +15,16 @@ const def: CodeKeywordDefinition = {
|
|
|
15
15
|
code(cxt: KeywordCxt) {
|
|
16
16
|
checkMetadata(cxt)
|
|
17
17
|
const {gen, data, schema, it} = cxt
|
|
18
|
-
if (alwaysValidSchema(it, schema)) return
|
|
19
18
|
const [valid, cond] = checkNullableObject(cxt, data)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
if (alwaysValidSchema(it, schema)) {
|
|
20
|
+
gen.if(not(or(cond, valid)), () => cxt.error())
|
|
21
|
+
} else {
|
|
22
|
+
gen.if(cond)
|
|
23
|
+
gen.assign(valid, validateMap())
|
|
24
|
+
gen.elseIf(not(valid))
|
|
25
|
+
cxt.error()
|
|
26
|
+
gen.endIf()
|
|
27
|
+
}
|
|
25
28
|
cxt.ok(valid)
|
|
26
29
|
|
|
27
30
|
function validateMap(): Name | boolean {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ajv",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.12.0",
|
|
4
4
|
"description": "Another JSON Schema Validator",
|
|
5
5
|
"main": "dist/ajv.js",
|
|
6
6
|
"types": "dist/ajv.d.ts",
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@ajv-validator/config": "^0.3.0",
|
|
68
|
-
"@rollup/plugin-commonjs": "^
|
|
69
|
-
"@rollup/plugin-json": "^
|
|
68
|
+
"@rollup/plugin-commonjs": "^24.0.0",
|
|
69
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
70
70
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
71
|
-
"@rollup/plugin-typescript": "^
|
|
71
|
+
"@rollup/plugin-typescript": "^10.0.1",
|
|
72
72
|
"@types/chai": "^4.2.12",
|
|
73
|
-
"@types/mocha": "^
|
|
73
|
+
"@types/mocha": "^10.0.0",
|
|
74
74
|
"@types/node": "^18.11.9",
|
|
75
75
|
"@types/require-from-string": "^1.2.0",
|
|
76
76
|
"@typescript-eslint/eslint-plugin": "^3.8.0",
|
package/package.json
CHANGED
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"jsii-pacmak": "^1.72.0",
|
|
56
56
|
"json-schema": "^0.4.0",
|
|
57
57
|
"npm-check-updates": "^16",
|
|
58
|
-
"projen": "0.65.
|
|
58
|
+
"projen": "0.65.80",
|
|
59
59
|
"standard-version": "^9",
|
|
60
60
|
"ts-jest": "^27",
|
|
61
61
|
"typescript": "3.9.10"
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"constructs": "^10.0.5"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@aws-cdk/assert": "^2.
|
|
68
|
+
"@aws-cdk/assert": "^2.59.0",
|
|
69
69
|
"case": "^1.6.3",
|
|
70
70
|
"sync-request": "^6.1.0"
|
|
71
71
|
},
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
],
|
|
84
84
|
"main": "lib/index.js",
|
|
85
85
|
"license": "Apache-2.0",
|
|
86
|
-
"version": "2.0.
|
|
86
|
+
"version": "2.0.369",
|
|
87
87
|
"jest": {
|
|
88
88
|
"testMatch": [
|
|
89
89
|
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
|