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

Function isFinite

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

Source from the content-addressed store, hash-verified

3237
3238/** @internal */
3239export function isFinite(annotations?: Schema.Annotations.Filter) {
3240 return makeFilter(
3241 (n: number) => globalThis.Number.isFinite(n),
3242 {
3243 expected: "a finite number",
3244 representation: {
3245 id: "effect/schema/isFinite",
3246 payload: null
3247 },
3248 toJsonSchema: () => ({ type: "number" }),
3249 toCode: () => ({ runtime: "Schema.isFinite()" }),
3250 arbitrary: {
3251 constraint: {
3252 noInfinity: true,
3253 noNaN: true
3254 }
3255 },
3256 ...annotations
3257 }
3258 )
3259}
3260
3261/** @internal */
3262export const finite = appendChecks(number, [isFinite()])

Callers 1

SchemaAST.tsFile · 0.70

Calls 1

makeFilterFunction · 0.85

Tested by

no test coverage detected