UNPKG

integreat

Version:
8 lines 411 B
import { pathGetter } from 'map-transform'; import mapAny from 'map-any'; import { isReference } from './is.js'; const extractIdFromRef = (data) => (isReference(data) ? data.id : data); export default (item, path, def = undefined) => typeof path === 'string' && path !== '' ? mapAny(extractIdFromRef, pathGetter(path)(item, { context: [], value: undefined })) : def; //# sourceMappingURL=getField.js.map