MCPcopy Index your code
hub / github.com/Effect-TS/effect / toJSON

Function toJSON

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

Source from the content-addressed store, hash-verified

164 return `Duration(${format(this)})`
165 },
166 toJSON(this: Duration) {
167 switch (this.value._tag) {
168 case "Millis":
169 return { _id: "Duration", _tag: "Millis", millis: this.value.millis }
170 case "Nanos":
171 return { _id: "Duration", _tag: "Nanos", hrtime: toHrTime(this) }
172 case "Infinity":
173 return { _id: "Duration", _tag: "Infinity" }
174 }
175 },
176 [NodeInspectSymbol]() {
177 return this.toJSON()
178 },

Callers

nothing calls this directly

Calls 1

toHrTimeFunction · 0.85

Tested by

no test coverage detected