Skip to content

Improved Hash To Hex - #1

Open
iworkinpixels wants to merge 1 commit into
sunyui:mainfrom
iworkinpixels:hexfix
Open

Improved Hash To Hex#1
iworkinpixels wants to merge 1 commit into
sunyui:mainfrom
iworkinpixels:hexfix

Conversation

@iworkinpixels

Copy link
Copy Markdown

Fixes image hash extraction when decoded Figma/Kiwi hashes are represented as numeric-keyed objects instead of JavaScript arrays.

hashToHex() previously accepted arrays only. When a hash was provided as an object, the function returned null, causing valid image hashes to be omitted from the generated layout JSON.

The updated implementation supports both arrays and numeric-keyed objects while preserving the existing array behavior.

Ran extract_layout.cjs against a decoded Figma document and confirmed that image fills now contain their expected 40-character hexadecimal hashes.

Fixes image hash extraction when decoded Figma/Kiwi hashes are represented as numeric-keyed objects instead of JavaScript arrays.

`hashToHex()` previously accepted arrays only. When a hash was provided as an object, the function returned `null`, causing valid image hashes to be omitted from the generated layout JSON.

The updated implementation supports both arrays and numeric-keyed objects while preserving the existing array behavior.

Ran `extract_layout.cjs` against a decoded Figma document and confirmed that image fills now contain their expected 40-character hexadecimal hashes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant