MCPcopy Index your code
hub / github.com/Effect-TS/effect / int

Function int

packages/effect/src/Schema.ts:5106–5116  ·  view source on GitHub ↗
(annotations?: Annotations.Filter<Schema.Type<S>>)

Source from the content-addressed store, hash-verified

5104 */
5105export const int =
5106 <S extends Schema.Any>(annotations?: Annotations.Filter<Schema.Type<S>>) =>
5107 <A extends number>(self: S & Schema<A, Schema.Encoded<S>, Schema.Context<S>>): filter<S> =>
5108 self.pipe(
5109 filter((a) => Number.isSafeInteger(a), {
5110 schemaId: IntSchemaId,
5111 title: "int",
5112 description: "an integer",
5113 jsonSchema: { type: "integer" },
5114 ...annotations
5115 })
5116 )
5117
5118/**
5119 * @category schema id

Callers 2

IntClass · 0.70
Schema.tsFile · 0.70

Calls 2

filterFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected