(self: Duration)
| 649 | * @since 4.0.0 |
| 650 | */ |
| 651 | export const negate = (self: Duration): Duration => { |
| 652 | switch (self.value._tag) { |
| 653 | case "Infinity": |
| 654 | return negativeInfinity |
| 655 | case "NegativeInfinity": |
| 656 | return infinity |
| 657 | case "Millis": |
| 658 | return self.value.millis === 0 ? self : make(-self.value.millis) |
| 659 | case "Nanos": |
| 660 | return self.value.nanos === bigint0 ? self : make(-self.value.nanos) |
| 661 | } |
| 662 | } |
| 663 | |
| 664 | /** |
| 665 | * A Duration representing zero time. |