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

Function normalizeCardinality

packages/effect/src/Schema.ts:8789–8794  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

8787}
8788
8789function normalizeCardinality(value: number): number {
8790 if (!globalThis.Number.isFinite(value)) {
8791 throw new globalThis.RangeError(`Expected a finite number, got ${value}`)
8792 }
8793 return Math.max(0, Math.floor(value))
8794}
8795
8796/**
8797 * Validates that a value has at least the specified size. Works with values

Callers 12

isMinLengthFunction · 0.85
isMaxLengthFunction · 0.85
isBetweenLengthFunction · 0.85
isMinCodePointsFunction · 0.85
isMaxCodePointsFunction · 0.85
isBetweenCodePointsFunction · 0.85
isMinSizeFunction · 0.85
isMaxSizeFunction · 0.85
isBetweenSizeFunction · 0.85
isMinPropertiesFunction · 0.85
isMaxPropertiesFunction · 0.85
isBetweenPropertiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected