Add Schema Result decode and encode helpers#1633
Conversation
🦋 Changeset detectedLatest commit: 6f4f653 The changes in this PR will be included in the next version bump. This PR includes changesets to release 26 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 JSDoc Documentation Analysis📈 Current Analysis ResultsThis comment is automatically updated on each push. View the analysis script for details. |
Bundle Size Analysis
|
|
@IMax153 looks good to me, but it's still marked as draft, not sure whether it's just an oversight |
Ah, sorry for not getting back to this. Yes, I kept it as a draft because I was somewhat dissatisfied with my own implementation. If I had not happened to implement this myself, I don't think I would have expected I don't know if there's any other sensible implementation (returning an... |
|
@kitlangton yes, it was missing because
however it already behaves this way in v3, so it makes sense to reintroduce it |
Summary
SchemaParser.decodeUnknownResult/decodeResultandencodeUnknownResult/encodeResultfor synchronousResult-based parsingSchemaasResultmaps typed parse errors toResult.fail(issue)and throws for defect-only causeseffectTesting
pnpm lint-fixpnpm test packages/effect/test/schema/Schema.test.tspnpm check:tsgopnpm docgen