(annotations?: Annotations.Filter)
| 8221 | * @since 4.0.0 |
| 8222 | */ |
| 8223 | export function isInt(annotations?: Annotations.Filter) { |
| 8224 | return makeFilter( |
| 8225 | (n: number) => globalThis.Number.isSafeInteger(n), |
| 8226 | { |
| 8227 | expected: "an integer", |
| 8228 | representation: { |
| 8229 | id: "effect/schema/isInt", |
| 8230 | payload: null |
| 8231 | }, |
| 8232 | toJsonSchema: () => ({ type: "integer" }), |
| 8233 | toCode: () => ({ runtime: "Schema.isInt()" }), |
| 8234 | arbitrary: { |
| 8235 | constraint: { |
| 8236 | integer: true |
| 8237 | } |
| 8238 | }, |
| 8239 | ...annotations |
| 8240 | } |
| 8241 | ) |
| 8242 | } |
| 8243 | |
| 8244 | /** |
| 8245 | * Reviver for persisted `isInt` checks. |
no test coverage detected