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
parent 93940a1859
commit 0590452456
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()`:
*