MCPcopy Create free account
hub / github.com/authzed/authzed-node / createStructFromObject

Function createStructFromObject

src/v1.ts:368–380  ·  view source on GitHub ↗
(data: JsonObject)

Source from the content-addressed store, hash-verified

366 * @returns A google.protobuf.Struct object.
367 */
368export function createStructFromObject(data: JsonObject): ImportedPbStruct {
369 try {
370 return ImportedPbStruct.fromJson(data);
371 } catch (error) {
372 if (
373 error instanceof Error &&
374 error.message.includes("Unable to parse message google.protobuf.Struct from JSON")
375 ) {
376 throw new Error("Input data for createStructFromObject must be a non-null object.");
377 }
378 throw error;
379 }
380}
381
382export * from "./authzedapi/authzed/api/v1/core.js";
383export * from "./authzedapi/authzed/api/v1/experimental_service.js";

Callers 1

v1.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected