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

Function toJSON

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

toHrTimeFunction · 0.85

Tested by

no test coverage detected