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

Function number

packages/effect/src/internal/config.ts:264–281  ·  view source on GitHub ↗
(name?: string)

Source from the content-addressed store, hash-verified

262
263/** @internal */
264export const number = (name?: string): Config.Config<number> => {
265 const config = primitive(
266 "a number property",
267 (text) => {
268 const result = Number(text)
269 if (Number.isNaN(result)) {
270 return Either.left(
271 configError.InvalidData(
272 [],
273 `Expected a number value but received ${formatUnknown(text)}`
274 )
275 )
276 }
277 return Either.right(result)
278 }
279 )
280 return name === undefined ? config : nested(config, name)
281}
282
283/** @internal */
284export const integer = (name?: string): Config.Config<number> => {

Callers 1

dateTime.tsFile · 0.70

Calls 3

primitiveFunction · 0.85
NumberInterface · 0.85
formatUnknownFunction · 0.85

Tested by

no test coverage detected