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

Function parseComponent

packages/effect/src/SemVer.ts:126–131  ·  view source on GitHub ↗
(value: string, label: string)

Source from the content-addressed store, hash-verified

124
125/** @internal */
126export const parseComponent = (value: string, label: string): number => {
127 if (!numericPattern.test(value)) {
128 return invalid(`${label} must be a non-negative integer without leading zeros, received ${JSON.stringify(value)}`)
129 }
130 return checkComponent(Number(value), label)
131}
132
133/** @internal */
134export const prereleaseIdentifier = (identifier: string | number): string | number => {

Callers 3

parsePartialFunction · 0.90
prereleaseIdentifierFunction · 0.85
parseOrThrowFunction · 0.85

Calls 3

checkComponentFunction · 0.85
invalidFunction · 0.70
NumberFunction · 0.70

Tested by

no test coverage detected