Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
replaced fail ast
Browse files Browse the repository at this point in the history
  • Loading branch information
jessekelly881 committed Nov 23, 2023
1 parent b20a404 commit 6f64153
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3589,9 +3589,9 @@ export const bigDecimalFromString = <I, A extends string>(
transformOrFail(
self,
BigDecimalFromSelf,
(num) =>
(num, _, ast) =>
BigDecimal.fromString(num).pipe(Option.match({
onNone: () => ParseResult.failure(ParseResult.type(BigDecimalFromSelf.ast, num)),
onNone: () => ParseResult.failure(ParseResult.type(ast, num)),
onSome: (val) => ParseResult.success(BigDecimal.normalize(val))
})),
(val) => ParseResult.success(BigDecimal.toString(BigDecimal.normalize(val))),
Expand Down
2 changes: 1 addition & 1 deletion test/BigDecimal/BigDecimal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("BigDecimal/BigDecimal", () => {
await Util.expectParseFailure(
schema,
"abc",
"Expected BigDecimal, actual \"abc\""
"Expected string <-> BigDecimal, actual \"abc\""
)
})

Expand Down

0 comments on commit 6f64153

Please sign in to comment.