Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
sort resources json keys (#10412)
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField authored Jun 19, 2024
1 parent 84adaf4 commit 10e726f
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,13 @@ export const patchSingleProjectResourcesJson = async (app: Application, id: stri
}
}

const body = Buffer.from(JSON.stringify(resourcesJson, null, 2))
const sortedResourcesJson = Object.fromEntries(
Object.entries(resourcesJson).sort(([a], [b]) => {
return a.localeCompare(b)
})
)

const body = Buffer.from(JSON.stringify(sortedResourcesJson, null, 2))

await storageProvider.putObject(
{
Expand Down Expand Up @@ -309,7 +315,13 @@ export const patchSingleProjectResourcesJson = async (app: Application, id: stri
thumbnailMode: resource.thumbnailMode ?? undefined
}

const body = Buffer.from(JSON.stringify(resourcesJson, null, 2))
const sortedResourcesJson = Object.fromEntries(
Object.entries(resourcesJson).sort(([a], [b]) => {
return a.localeCompare(b)
})
)

const body = Buffer.from(JSON.stringify(sortedResourcesJson, null, 2))

await storageProvider.putObject(
{
Expand Down

0 comments on commit 10e726f

Please sign in to comment.