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

Method fromMap

packages/graph/src/TemporalTypes.ts:72–80  ·  view source on GitHub ↗

* Create a DateValue from a map of components.

(map: Record<string, unknown>)

Source from the content-addressed store, hash-verified

70 * Create a DateValue from a map of components.
71 */
72 public static fromMap(map: Record<string, unknown>): DateValue | null {
73 const year = map.year;
74 const month = map.month;
75 const day = map.day;
76 if (typeof year !== "number" || typeof month !== "number" || typeof day !== "number") {
77 return null;
78 }
79 return new DateValue(year, month, day);
80 }
81
82 public get year(): number {
83 return this.#year;

Calls

no outgoing calls

Tested by

no test coverage detected