Skip to content

Commit

Permalink
Remove unnecessary optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
ryota-ka committed May 8, 2022
1 parent 9d9ab5a commit e3b5abf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/VariableDecoder/bigInt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ const bigInt = (options: Options = {}): VariableDecoder<BigInt> =>
pipe(
asks((x) => O.tryCatch(() => BigInt(x))),
RE.chain(unwrap('must be a valid BigInt')),
withOpt(options?.max)((max) =>
withOpt(options.max)((max) =>
RE.chain(validate((n) => n <= max, `must be smaller than or equal to ${String(max)}`)),
),
withOpt(options?.min)((min) =>
withOpt(options.min)((min) =>
RE.chain(validate((n) => n >= min, `must be greater than or equal to ${String(min)}`)),
),
);
Expand Down

0 comments on commit e3b5abf

Please sign in to comment.