Skip to content

Commit 6f5d319

Browse files
committed
feat: add convertJSONPointerToJSONPath util func
1 parent 75c967a commit 6f5d319

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Common/Helper.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,9 @@ export const powerSetOfSubstringsFromStart = (strings: string[], regex: RegExp)
726726
return _keys
727727
})
728728

729+
export const convertJSONPointerToJSONPath = (pointer: string) =>
730+
pointer.replace(/\//g, '.').replace(/\./, '$.')
731+
729732
export const flatMapOfJSONPaths = (
730733
paths: string[],
731734
json: object,

0 commit comments

Comments
 (0)