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

Function fromInput

packages/effect/src/SemVer.ts:410–414  ·  view source on GitHub ↗
(input: Input)

Source from the content-addressed store, hash-verified

408 * @since 4.0.6
409 */
410export const fromInput = (input: Input): Result.Result<SemVer, SemVerError> => {
411 if (isSemVer(input)) return Result.succeed(input)
412 if (typeof input === "string") return parse(input)
413 return attempt(() => make(input))
414}
415
416/**
417 * Converts a version, version string, or version components into a `SemVer`

Callers 1

fromInputUnsafeFunction · 0.70

Calls 5

isSemVerFunction · 0.85
parseFunction · 0.70
attemptFunction · 0.70
makeFunction · 0.70
succeedMethod · 0.45

Tested by

no test coverage detected