MCPcopy Create free account
hub / github.com/eclipsesource/jsonforms / resolveData

Function resolveData

packages/core/src/util/resolvers.ts:45–61  ·  view source on GitHub ↗
(instance: any, dataPath: string)

Source from the content-addressed store, hash-verified

43};
44
45export const resolveData = (instance: any, dataPath: string): any => {
46 if (isEmpty(dataPath)) {
47 return instance;
48 }
49 const dataPathSegments = dataPath.split('.');
50
51 return dataPathSegments.reduce((curInstance, decodedSegment) => {
52 if (
53 !curInstance ||
54 !Object.prototype.hasOwnProperty.call(curInstance, decodedSegment)
55 ) {
56 return undefined;
57 }
58
59 return curInstance[decodedSegment];
60 }, instance);
61};
62
63/**
64 * Finds all references inside the given schema.

Callers 2

resolvers.test.tsFile · 0.90
evaluateConditionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…