MCPcopy Create free account
hub / github.com/Effect-TS/effect / negate

Function negate

packages/effect/src/Duration.ts:651–662  ·  view source on GitHub ↗
(self: Duration)

Source from the content-addressed store, hash-verified

649 * @since 4.0.0
650 */
651export 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.

Callers

nothing calls this directly

Calls 1

makeFunction · 0.70

Tested by

no test coverage detected