(s: string)
| 348 | * @since 4.1.3 |
| 349 | */ |
| 350 | export const fromString = (s: string): Option.Option<Rational> => { |
| 351 | const match = FRACTION_REGEXP.exec(s) |
| 352 | if (match === null) { |
| 353 | return Option.none() |
| 354 | } |
| 355 | return make(BigInt(match[1]), match[2] === undefined ? bigint1 : BigInt(match[2])) |
| 356 | } |
| 357 | |
| 358 | /** |
| 359 | * Parses an integer or fraction string into a `Rational`. |
no test coverage detected