(input: Input)
| 408 | * @since 4.0.6 |
| 409 | */ |
| 410 | export 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` |