Skip to content

Commit a016fe4

Browse files
committed
add comment clarifying data resolvement
1 parent d524fe0 commit a016fe4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/core/src/util/resolvers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export const resolveData = (instance: any, dataPath: string): any => {
4646
if (isEmpty(dataPath)) {
4747
return instance;
4848
}
49+
50+
// Remove the first segment with slice because it is either the empty string
51+
// for paths starting with a '/' or '#' for paths starting with this.
52+
// Both need to be removed for resolving below.
4953
const dataPathSegments = dataPath.split('/').slice(1);
5054

5155
return dataPathSegments.reduce((curInstance, decodedSegment) => {

0 commit comments

Comments
 (0)