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

Function parseProperties

packages/graph/src/Graph.ts:92–106  ·  view source on GitHub ↗
(
  label: string,
  properties: T,
  schemaProperties: ElementSchema["properties"] | undefined,
)

Source from the content-addressed store, hash-verified

90 * @returns A new object with all transformed/validated values
91 */
92export function parseProperties<T extends Record<string, unknown>>(
93 label: string,
94 properties: T,
95 schemaProperties: ElementSchema["properties"] | undefined,
96): T {
97 if (!schemaProperties) {
98 return properties;
99 }
100
101 const result: Record<string, unknown> = {};
102 for (const key of Object.keys(properties)) {
103 result[key] = parsePropertyValue(key, label, properties[key], schemaProperties);
104 }
105 return result as T;
106}
107
108const customInspectSymbol = Symbol.for("nodejs.util.inspect.custom");
109

Callers 3

addVertexMethod · 0.85
addEdgeMethod · 0.85

Calls 1

parsePropertyValueFunction · 0.85

Tested by

no test coverage detected