import get from 'lodash/get' ; import zip from 'lodash/zip' ; export const fieldPathToSchemaPath = ( fieldPath ) => { return zip ( fieldPath . split ( '.' ) . fill ( 'properties' ) , fieldPath . split ( '.' ) ) . flat ( ) . join ( '.' ) ; } ; export const schemaPointerToFieldPath = ( jsonPointer ) => { return jsonPointer . split ( '/' ) . slice ( 2 ) . filter ( e => e !== 'properties' ) . join ( '.' ) ; } ; export const fieldPathToSchema = ( schema , fieldPath ) => { return get ( schema , fieldPathToSchemaPath ( fieldPath ) ) ; } ;