Skip to content

feat(result): add safe() and tryCall() for code that throws - #511

Merged
bjoerge merged 1 commit into
mainfrom
feat/result-safe-trycall
Nov 14, 2026
Merged

bjoerge merged 1 commit into
mainfrom
feat/result-safe-trycall

Conversation

@bjoerge

@bjoerge bjoerge commented Nov 14, 2026

Copy link
Copy Markdown
Member

No description provided.

Builtins like JSON.parse and decodeURIComponent throw on bad input. safe() returns their outcome as a Result, tryCall() does the same for any callback or promise, and the new no-unsafe-builtins lint rule flags direct calls to the throwing builtins.
@bjoerge
bjoerge enabled auto-merge (squash) November 14, 2026 00:03
@bjoerge
bjoerge merged commit 8f18fbe into main Nov 14, 2026
12 checks passed
@bjoerge
bjoerge deleted the feat/result-safe-trycall branch November 14, 2026 00:07
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