From 567b450a2f2223e4d7c747886cb6403e124c8b0a Mon Sep 17 00:00:00 2001 From: junghyeonsu Date: Wed, 6 Dec 2023 18:09:17 +0900 Subject: [PATCH] fix: add png object in IconaIconData --- figma-plugin/plugin-src/service.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/figma-plugin/plugin-src/service.ts b/figma-plugin/plugin-src/service.ts index 81c503d..1f3c135 100644 --- a/figma-plugin/plugin-src/service.ts +++ b/figma-plugin/plugin-src/service.ts @@ -137,7 +137,7 @@ export async function exportFromIconaIconData( if (!value) { return { - scale: `x${scale}`, + scale: key, data: "", }; } @@ -153,7 +153,7 @@ export async function exportFromIconaIconData( const base64String = Base64.fromUint8Array(exportData); return { - scale: `x${scale}`, + scale: key, data: base64String, }; }), @@ -163,19 +163,21 @@ export async function exportFromIconaIconData( if (cur.status === "rejected") console.error(cur.reason); if (cur.status === "fulfilled") { const { scale, data } = cur.value as { - scale: string; + scale: keyof IconaIconData["png"]; data: string; }; acc[scale] = data; } return acc; - }, {} as Record); + }, {} as Record); // name = "icon_name" result[component.name] = { ...result[component.name], - ...pngDatas, + png: { + ...pngDatas, + }, }; });