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

Function isInt

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

Source from the content-addressed store, hash-verified

7991 * @since 4.0.0
7992 */
7993export function isInt(annotations?: Annotations.Filter) {
7994 return makeFilter(
7995 (n: number) => globalThis.Number.isSafeInteger(n),
7996 {
7997 expected: "an integer",
7998 representation: {
7999 id: "effect/schema/isInt",
8000 payload: null
8001 },
8002 toJsonSchema: () => ({
8003 type: "integer",
8004 minimum: globalThis.Number.MIN_SAFE_INTEGER,
8005 maximum: globalThis.Number.MAX_SAFE_INTEGER
8006 }),
8007 arbitraryConstraint: {
8008 number: "integer"
8009 },
8010 ...annotations
8011 }
8012 )
8013}
8014/**
8015 * Type-level representation of {@link Int}.
8016 *

Callers 3

Schema.tsFile · 0.85
isInt32Function · 0.85
isUint32Function · 0.85

Calls 1

makeFilterFunction · 0.70

Tested by

no test coverage detected