Skip to content

Commit

Permalink
use ?? operator when constructing index descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Mar 20, 2024
1 parent 79084c8 commit 50081c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/operations/indexes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class CreateIndexesOperation extends CommandOperation<string[]> {
// Ensure the key is a Map to preserve index key ordering
const key =
userIndex.key instanceof Map ? userIndex.key : new Map(Object.entries(userIndex.key));
const name = userIndex.name != null ? userIndex.name : Array.from(key).flat().join('_');
const name = userIndex.name ?? Array.from(key).flat().join('_');
const validIndexOptions = resolveIndexDescription(userIndex);
return {
...validIndexOptions,
Expand Down

0 comments on commit 50081c6

Please sign in to comment.