Skip to content

Commit

Permalink
Update src/schema-convertors/internalToMongoDB.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Anna Henningsen <[email protected]>
  • Loading branch information
paula-stacho and addaleax authored Jan 23, 2025
1 parent 6d4879b commit 01e65bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/schema-convertors/internalToMongoDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function parseType(type: SchemaType, signal?: AbortSignal): MongoDBJSONSchema {
}

function parseTypes(types: SchemaType[], signal?: AbortSignal): MongoDBJSONSchema {
if (signal?.aborted) throw new Error('Operation aborted');
if (signal?.aborted) throw signal.reason ?? new Error('Operation aborted');
const definedTypes = types.filter(type => type.bsonType.toLowerCase() !== 'undefined');
const isSingleType = definedTypes.length === 1;
if (isSingleType) {
Expand Down

0 comments on commit 01e65bd

Please sign in to comment.