Skip to content

Commit

Permalink
use Object.fromEntries
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Oct 29, 2023
1 parent 4c0b95b commit cf3aab0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/helpers/functions/textureComparison.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default async function textureComparison(
).data;

const displayed = parseDisplay(display);
const defaultURL = result.urls.find((url) => url[0] == "default")?.[1];
const defaultURL = Object.fromEntries(result.urls).default;

const dimension = await loadImage(defaultURL);
if (dimension.width * dimension.height * displayed.flat().length > 262144) return null;
Expand All @@ -62,7 +62,7 @@ export default async function textureComparison(
// had problems with nested async mapping so this is easier for everyone
loadedImages.push([]);
for (const pack of packSet) {
const image = result.urls.find((url) => url[0] == pack)?.[1];
const image = Object.fromEntries(result.urls)[pack];
if (!image) continue;
try {
loadedImages.at(-1).push(await loadImage(image));
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/firestorm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ export interface Texture extends BaseTexture {
export interface GalleryTexture extends Omit<Texture, keyof BaseTexture> {
// texture properties are moved into their own object
texture: BaseTexture;
urls: [string, string];
urls: [string, string][];
}

0 comments on commit cf3aab0

Please sign in to comment.