MCPcopy Create free account
hub / github.com/codemix/graph / fromMap

Method fromMap

packages/graph/src/TemporalTypes.ts:379–387  ·  view source on GitHub ↗

* Create a TimeValue from a map of components.

(map: Record<string, unknown>)

Source from the content-addressed store, hash-verified

377 * Create a TimeValue from a map of components.
378 */
379 public static fromMap(map: Record<string, unknown>): TimeValue | null {
380 const hour = typeof map.hour === "number" ? map.hour : 0;
381 const minute = typeof map.minute === "number" ? map.minute : 0;
382 const second = typeof map.second === "number" ? map.second : 0;
383 const nanosecond = typeof map.nanosecond === "number" ? map.nanosecond : 0;
384 const offsetSeconds = typeof map.offset === "number" ? map.offset : 0;
385
386 return new TimeValue(hour, minute, second, nanosecond, offsetSeconds);
387 }
388
389 public get hour(): number {
390 return this.#hour;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected