(self: Duration)
| 621 | * @since 4.0.0 |
| 622 | */ |
| 623 | export const abs = (self: Duration): Duration => { |
| 624 | switch (self.value._tag) { |
| 625 | case "Infinity": |
| 626 | case "NegativeInfinity": |
| 627 | return infinity |
| 628 | case "Millis": |
| 629 | return self.value.millis < 0 ? make(-self.value.millis) : self |
| 630 | case "Nanos": |
| 631 | return self.value.nanos < bigint0 ? make(-self.value.nanos) : self |
| 632 | } |
| 633 | } |
| 634 | |
| 635 | /** |
| 636 | * Returns the negated duration. |