MCPcopy Create free account
hub / github.com/Effect-TS/effect / isInt

Function isInt

packages/effect/src/Schema.ts:8223–8242  ·  view source on GitHub ↗
(annotations?: Annotations.Filter)

Source from the content-addressed store, hash-verified

8221 * @since 4.0.0
8222 */
8223export 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.

Callers 3

Schema.tsFile · 0.85
isInt32Function · 0.85
isUint32Function · 0.85

Calls 1

makeFilterFunction · 0.85

Tested by

no test coverage detected