Skip to content

Commit 2df3d33

Browse files
committed
bump node types and use ??=
1 parent 2b08856 commit 2df3d33

File tree

3 files changed

+33
-16
lines changed

3 files changed

+33
-16
lines changed

package-lock.json

Lines changed: 29 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"devDependencies": {
5656
"@types/json-schema": "^7.0.15",
5757
"@types/mocha": "^10.0.1",
58-
"@types/node": "^18.11.18",
58+
"@types/node": "^22.10.7",
5959
"@types/reservoir": "^0.1.0",
6060
"@types/sinon": "^17.0.3",
6161
"@typescript-eslint/eslint-plugin": "^5.47.1",

src/schema-accessor.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,14 @@ export class InternalSchemaBasedAccessor implements SchemaAccessor {
3434
}
3535

3636
async getStandardJsonSchema(options: Options = {}): Promise<StandardJSONSchema> {
37-
if (this.standardJSONSchema) return this.standardJSONSchema;
38-
return this.standardJSONSchema = await convertors.internalSchemaToStandard(this.internalSchema, options);
37+
return this.standardJSONSchema ??= await convertors.internalSchemaToStandard(this.internalSchema, options);
3938
}
4039

4140
async getMongoDBJsonSchema(options: Options = {}): Promise<MongoDBJSONSchema> {
42-
if (this.mongodbJSONSchema) return this.mongodbJSONSchema;
43-
return this.mongodbJSONSchema = await convertors.internalSchemaToMongoDB(this.internalSchema, options);
41+
return this.mongodbJSONSchema ??= await convertors.internalSchemaToMongoDB(this.internalSchema, options);
4442
}
4543

4644
async getExtendedJsonSchema(options: Options = {}): Promise<ExtendedJSONSchema> {
47-
if (this.extendedJSONSchema) return this.extendedJSONSchema;
48-
return this.extendedJSONSchema = await convertors.internalSchemaToExtended(this.internalSchema, options);
45+
return this.extendedJSONSchema ??= await convertors.internalSchemaToExtended(this.internalSchema, options);
4946
}
5047
}

0 commit comments

Comments
 (0)