From 32fb40e11bc8cdd84341f47492ae1cb3709cb7b5 Mon Sep 17 00:00:00 2001 From: Jason Green Date: Mon, 1 Apr 2024 22:07:49 +0100 Subject: [PATCH 1/2] chore: update typescript to 5.4.3 --- package.json | 2 +- spec/types/async-validate.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d80c51a46..fb0314c06 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "rollup-plugin-terser": "^7.0.2", "ts-node": "^10.9.2", "tsify": "^5.0.4", - "typescript": "^4.9.5" + "typescript": "^5.4.3" }, "collective": { "type": "opencollective", diff --git a/spec/types/async-validate.spec.ts b/spec/types/async-validate.spec.ts index 8e3f0588c..508b237e5 100644 --- a/spec/types/async-validate.spec.ts +++ b/spec/types/async-validate.spec.ts @@ -110,7 +110,7 @@ describe("$async validation and type guards", () => { let result: boolean | Promise if ((result = validate(data))) { if (typeof result == "boolean") { - data.foo.should.equal(1) + ;(data as any).foo.should.equal(1) } else { await result.then((_data) => _data.foo.should.equal(1)) } From e21dd06bb400d72b5694e20b5c9a83c6703ad62a Mon Sep 17 00:00:00 2001 From: Jason Green Date: Wed, 3 Apr 2024 18:32:24 +0100 Subject: [PATCH 2/2] Nullable type should allow for undefined schema prop --- lib/types/json-schema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/types/json-schema.ts b/lib/types/json-schema.ts index 281a38bdb..4c442f75c 100644 --- a/lib/types/json-schema.ts +++ b/lib/types/json-schema.ts @@ -174,7 +174,7 @@ export type RequiredMembers = StrictNullChecksWrapper< type Nullable = undefined extends T ? { - nullable: true + nullable?: true const?: null // any non-null value would fail `const: null`, `null` would fail any other value in const enum?: Readonly<(T | null)[]> // `null` must be explicitly included in "enum" for `null` to pass default?: T | null