(self: Duration)
| 555 | * @since 4.0.0 |
| 556 | */ |
| 557 | export const abs = (self: Duration): Duration => { |
| 558 | switch (self.value._tag) { |
| 559 | case "Infinity": |
| 560 | case "NegativeInfinity": |
| 561 | return infinity |
| 562 | case "Millis": |
| 563 | return self.value.millis < 0 ? make(-self.value.millis) : self |
| 564 | case "Nanos": |
| 565 | return self.value.nanos < bigint0 ? make(-self.value.nanos) : self |
| 566 | } |
| 567 | } |
| 568 | |
| 569 | /** |
| 570 | * Returns the negated duration. |