refactor(schema): use Schema.Int and consolidate PositiveInt/NonNegativeInt (#24029)

This commit is contained in:
Kit Langton 2026-04-23 13:22:48 -04:00 committed by GitHub
commit 0590452456
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 24 additions and 22 deletions

View file

@ -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()`:
*