(self: Duration)
| 582 | * @since 4.0.0 |
| 583 | */ |
| 584 | export const negate = (self: Duration): Duration => { |
| 585 | switch (self.value._tag) { |
| 586 | case "Infinity": |
| 587 | return negativeInfinity |
| 588 | case "NegativeInfinity": |
| 589 | return infinity |
| 590 | case "Millis": |
| 591 | return self.value.millis === 0 ? self : make(-self.value.millis) |
| 592 | case "Nanos": |
| 593 | return self.value.nanos === bigint0 ? self : make(-self.value.nanos) |
| 594 | } |
| 595 | } |
| 596 | |
| 597 | /** |
| 598 | * A Duration representing zero time. |