refactor(schema): use Schema.Int and consolidate PositiveInt/NonNegativeInt (#24029)
This commit is contained in:
parent
93940a1859
commit
0590452456
6 changed files with 24 additions and 22 deletions
|
|
@ -1,5 +1,15 @@
|
|||
import { Schema } from "effect"
|
||||
|
||||
/**
|
||||
* Integer greater than zero.
|
||||
*/
|
||||
export const PositiveInt = Schema.Int.check(Schema.isGreaterThan(0))
|
||||
|
||||
/**
|
||||
* Integer greater than or equal to zero.
|
||||
*/
|
||||
export const NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))
|
||||
|
||||
/**
|
||||
* Attach static methods to a schema object. Designed to be used with `.pipe()`:
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue