Skip to content

Commit

Permalink
Schema: add missing description annotation to BooleanFromString (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti authored Feb 10, 2025
1 parent 2fe447c commit 42ddd5f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-spies-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": patch
---

Schema: add missing `description` annotation to `BooleanFromString`.
2 changes: 1 addition & 1 deletion packages/effect/src/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9771,7 +9771,7 @@ export class BooleanFromUnknown extends transform(
* @since 3.11.0
*/
export class BooleanFromString extends transform(
Literal("true", "false"),
Literal("true", "false").annotations({ description: "a string to be decoded into a boolean" }),
Boolean$,
{ strict: true, decode: (value) => value === "true", encode: (value) => value ? "true" : "false" }
).annotations({ identifier: "BooleanFromString" }) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("BooleanFromString", () => {
"a",
`BooleanFromString
└─ Encoded side transformation failure
└─ "true" | "false"
└─ a string to be decoded into a boolean
├─ Expected "true", actual "a"
└─ Expected "false", actual "a"`
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("EitherFromSelf", () => {
`Either<BooleanFromString, NumberFromString>
└─ BooleanFromString
└─ Encoded side transformation failure
└─ "true" | "false"
└─ a string to be decoded into a boolean
├─ Expected "true", actual ""
└─ Expected "false", actual ""`
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("ExitFromSelf", () => {
`Exit<BooleanFromString, NumberFromString>
└─ BooleanFromString
└─ Encoded side transformation failure
└─ "true" | "false"
└─ a string to be decoded into a boolean
├─ Expected "true", actual ""
└─ Expected "false", actual ""`
)
Expand Down

0 comments on commit 42ddd5f

Please sign in to comment.