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

Function negate

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

Source from the content-addressed store, hash-verified

582 * @since 4.0.0
583 */
584export 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.

Callers

nothing calls this directly

Calls 1

makeFunction · 0.70

Tested by

no test coverage detected