Skip to content

fix(wasm): pass method code to JS by appending it as last byte#49

Open
12lockedin wants to merge 1 commit intoYM162:mainfrom
12lockedin:fix/wasm-method-code
Open

fix(wasm): pass method code to JS by appending it as last byte#49
12lockedin wants to merge 1 commit intoYM162:mainfrom
12lockedin:fix/wasm-method-code

Conversation

@12lockedin
Copy link
Copy Markdown

Previously the method_code from clean_pdf was discarded. A Serde-based approach was attempted but corrupted binary data (Vec serializes as a JS Array of numbers, not Uint8Array).

Instead, append method_code as the last byte of the returned Vec. JS consumers slice it off: result.slice(0,-1) for PDF, result[result.length-1] for method.

Also removes unused serde and serde-wasm-bindgen dependencies.

Previously the method_code from clean_pdf was discarded. A Serde-based
approach was attempted but corrupted binary data (Vec<u8> serializes as
a JS Array of numbers, not Uint8Array).

Instead, append method_code as the last byte of the returned Vec<u8>.
JS consumers slice it off: result.slice(0,-1) for PDF, result[result.length-1] for method.

Also removes unused serde and serde-wasm-bindgen dependencies.
@YM162 YM162 self-assigned this Feb 13, 2026
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.

2 participants