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

Function groupAt

packages/sql/pg/src/PgTypes.ts:690–694  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

688 // trimming the leading and trailing zero groups is two moving indices
689 // instead of an array and a `shift` per leading zero.
690 const groupAt = (index: number): number => {
691 const at = index * 4
692 return (digits.charCodeAt(at) - 48) * 1000 + (digits.charCodeAt(at + 1) - 48) * 100 +
693 (digits.charCodeAt(at + 2) - 48) * 10 + (digits.charCodeAt(at + 3) - 48)
694 }
695 const groupCount = digits.length / 4
696 let first = 0
697 while (first < groupCount && groupAt(first) === 0) first++

Callers 1

encodeNumericFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected