fix-readme-encode-usage: Fix README encodeIco output saving and document isIco usage #3

Open
std-bot wants to merge 1 commit from task/fix-readme-encode-usage into main
First-time contributor

Assigned idea

The README currently shows importing decodeIco, encodeIco, and isIco, but it doesn’t demonstrate isIco and the Node.js encoding example ends with an incomplete “// save as” comment. Update README.md so the encoding example shows exactly how to write the generated ICO to disk and add a short isIco snippet to clarify how to validate a buffer before decoding.

Approach: 1) Edit README.md “Encoding” (Node.js) example to finish the last step: convert the returned ICO data to a Node Buffer (as needed) and await writeFile('favicon.ico', ...) so the snippet is copy/paste complete.
2) Add a small “Checking” or “Validating” subsection that demonstrates isIco(buffer) before calling decodeIco, using the same import style already shown.
3) Ensure the browser/UMD examples stay consistent with the documented global (ICO.*) and clarify the expected input type for isIco (ArrayBuffer/Uint8Array) based on the library’s actual API.

Verification: Open README.md and confirm: (a) the Encoding (Node.js) code block ends with a concrete writeFile('favicon.ico', ...) line (no dangling “// save as”), and (b) there is an isIco usage example that conditionally calls decodeIco only when isIco(buffer) returns true.

Risk: If the library’s actual return type from encodeIco (or accepted input type for isIco) differs from what the README implies, the new snippets could mislead users. Mitigate by checking the implementation/export types before finalizing the README examples.

Agent context

Task slug: fix-readme-encode-usage
Branch: task/fix-readme-encode-usage

## Assigned idea The README currently shows importing `decodeIco`, `encodeIco`, and `isIco`, but it doesn’t demonstrate `isIco` and the Node.js encoding example ends with an incomplete “// save as” comment. Update README.md so the encoding example shows exactly how to write the generated ICO to disk and add a short `isIco` snippet to clarify how to validate a buffer before decoding. Approach: 1) Edit README.md “Encoding” (Node.js) example to finish the last step: convert the returned ICO data to a Node Buffer (as needed) and `await writeFile('favicon.ico', ...)` so the snippet is copy/paste complete. 2) Add a small “Checking” or “Validating” subsection that demonstrates `isIco(buffer)` before calling `decodeIco`, using the same import style already shown. 3) Ensure the browser/UMD examples stay consistent with the documented global (`ICO.*`) and clarify the expected input type for `isIco` (ArrayBuffer/Uint8Array) based on the library’s actual API. Verification: Open README.md and confirm: (a) the Encoding (Node.js) code block ends with a concrete `writeFile('favicon.ico', ...)` line (no dangling “// save as”), and (b) there is an `isIco` usage example that conditionally calls `decodeIco` only when `isIco(buffer)` returns true. Risk: If the library’s actual return type from `encodeIco` (or accepted input type for `isIco`) differs from what the README implies, the new snippets could mislead users. Mitigate by checking the implementation/export types before finalizing the README examples. ## Agent context Task slug: fix-readme-encode-usage Branch: task/fix-readme-encode-usage <!-- std-ts:idea-pr-body -->
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin task/fix-readme-encode-usage:task/fix-readme-encode-usage
git switch task/fix-readme-encode-usage

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff task/fix-readme-encode-usage
git switch task/fix-readme-encode-usage
git rebase main
git switch main
git merge --ff-only task/fix-readme-encode-usage
git switch task/fix-readme-encode-usage
git rebase main
git switch main
git merge --no-ff task/fix-readme-encode-usage
git switch main
git merge --squash task/fix-readme-encode-usage
git switch main
git merge --ff-only task/fix-readme-encode-usage
git switch main
git merge task/fix-readme-encode-usage
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
snorkel/root-repository-maintenance-8ac8ec1620d541!3
No description provided.