Skip to content

Commit

Permalink
bump node types and use ??=
Browse files Browse the repository at this point in the history
  • Loading branch information
paula-stacho committed Jan 21, 2025
1 parent 2b08856 commit 2df3d33
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
38 changes: 29 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"devDependencies": {
"@types/json-schema": "^7.0.15",
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.18",
"@types/node": "^22.10.7",
"@types/reservoir": "^0.1.0",
"@types/sinon": "^17.0.3",
"@typescript-eslint/eslint-plugin": "^5.47.1",
Expand Down
9 changes: 3 additions & 6 deletions src/schema-accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,14 @@ export class InternalSchemaBasedAccessor implements SchemaAccessor {
}

async getStandardJsonSchema(options: Options = {}): Promise<StandardJSONSchema> {
if (this.standardJSONSchema) return this.standardJSONSchema;
return this.standardJSONSchema = await convertors.internalSchemaToStandard(this.internalSchema, options);
return this.standardJSONSchema ??= await convertors.internalSchemaToStandard(this.internalSchema, options);
}

async getMongoDBJsonSchema(options: Options = {}): Promise<MongoDBJSONSchema> {
if (this.mongodbJSONSchema) return this.mongodbJSONSchema;
return this.mongodbJSONSchema = await convertors.internalSchemaToMongoDB(this.internalSchema, options);
return this.mongodbJSONSchema ??= await convertors.internalSchemaToMongoDB(this.internalSchema, options);
}

async getExtendedJsonSchema(options: Options = {}): Promise<ExtendedJSONSchema> {
if (this.extendedJSONSchema) return this.extendedJSONSchema;
return this.extendedJSONSchema = await convertors.internalSchemaToExtended(this.internalSchema, options);
return this.extendedJSONSchema ??= await convertors.internalSchemaToExtended(this.internalSchema, options);
}
}

0 comments on commit 2df3d33

Please sign in to comment.