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

Function clampBigInt

packages/effect/src/Schema.ts:5678–5690  ·  view source on GitHub ↗
(minimum: bigint, maximum: bigint)

Source from the content-addressed store, hash-verified

5676 * @since 3.10.0
5677 */
5678export const clampBigInt = (minimum: bigint, maximum: bigint) =>
5679<S extends Schema.Any, A extends bigint>(
5680 self: S & Schema<A, Schema.Encoded<S>, Schema.Context<S>>
5681): transform<S, filter<SchemaClass<A>>> =>
5682 transform(
5683 self,
5684 self.pipe(typeSchema, betweenBigInt(minimum, maximum)),
5685 {
5686 strict: false,
5687 decode: (i) => bigInt_.clamp(i, { minimum, maximum }),
5688 encode: identity
5689 }
5690 )
5691
5692/** @ignore */
5693class BigInt$ extends transformOrFail(

Callers

nothing calls this directly

Calls 3

betweenBigIntFunction · 0.85
transformInterface · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected