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

Function countCodePointsUpTo

packages/effect/src/Schema.ts:8780–8787  ·  view source on GitHub ↗
(input: string, limit: number)

Source from the content-addressed store, hash-verified

8778}
8779
8780function countCodePointsUpTo(input: string, limit: number): number {
8781 if (limit === 0) return 0
8782 let count = 0
8783 for (const _ of input) {
8784 if (++count >= limit) break
8785 }
8786 return count
8787}
8788
8789function normalizeCardinality(value: number): number {
8790 if (!globalThis.Number.isFinite(value)) {

Callers 3

isMinCodePointsFunction · 0.85
isMaxCodePointsFunction · 0.85
isBetweenCodePointsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected