Skip to content

Commit

Permalink
Fixing CI
Browse files Browse the repository at this point in the history
Signed-off-by: Charlie Fish <contact@charlie.fish>
  • Loading branch information
fishcharlie committed Dec 28, 2023
1 parent 96c0020 commit 2c01fba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/dynamoose/lib/utils/dynamoose/index_changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ const index_changes = async (table: Table, existingIndexes = []): Promise<(Model
}

const sanitizeIndex = (index: IndexItem) => {
if (Array.isArray(index.Projection.NonKeyAttributes)) {
if (Array.isArray(index.Projection.NonKeyAttributes)) {
index.Projection.NonKeyAttributes.sort();
}
return index;
}
};

const deleteIndexes: ModelIndexDeleteChange[] = existingIndexes.filter((index) => {
const cleanedIndex = deep_copy(index);
Expand All @@ -50,8 +50,8 @@ const index_changes = async (table: Table, existingIndexes = []): Promise<(Model
});

return !(expectedIndexes.GlobalSecondaryIndexes || []).find((searchIndex) => obj.equals(
sanitizeIndex(obj.pick(cleanedIndex, identicalProperties) as IndexItem),
sanitizeIndex(obj.pick(searchIndex as any, identicalProperties) as IndexItem)
sanitizeIndex(obj.pick(cleanedIndex, identicalProperties) as any),
sanitizeIndex(obj.pick(searchIndex as any, identicalProperties) as any)
));
}).map((index) => ({"name": index.IndexName as string, "type": TableIndexChangeType.delete}));
output.push(...deleteIndexes);
Expand Down

0 comments on commit 2c01fba

Please sign in to comment.