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

Function toJSON

packages/effect/src/Duration.ts:382–393  ·  view source on GitHub ↗
(this: Duration)

Source from the content-addressed store, hash-verified

380 }
381 },
382 toJSON(this: Duration) {
383 switch (this.value._tag) {
384 case "Millis":
385 return { _id: "Duration", _tag: "Millis", millis: this.value.millis }
386 case "Nanos":
387 return { _id: "Duration", _tag: "Nanos", nanos: String(this.value.nanos) }
388 case "Infinity":
389 return { _id: "Duration", _tag: "Infinity" }
390 case "NegativeInfinity":
391 return { _id: "Duration", _tag: "NegativeInfinity" }
392 }
393 },
394 [NodeInspectSymbol]() {
395 return this.toJSON()
396 },

Callers

nothing calls this directly

Calls 1

StringInterface · 0.70

Tested by

no test coverage detected