import curry from 'lodash/curry' ; import { formatStructure } from '@flamelink/sdk-utils' ; export const structureItems = curry ( ( options , nav ) => { if ( nav && nav . hasOwnProperty ( 'items' ) ) { return Object . assign ( { } , nav , { items : formatStructure ( options . structure , { idProperty : 'uuid' , parentProperty : 'parentIndex' , } , nav . items ) , } ) ; } return nav ; } ) ; export const getNavigationRefPath = ( navKey , env , locale ) => { if ( Array . isArray ( navKey ) && navKey [ 0 ] && navKey [ 1 ] ) { return `/flamelink/environments/${ env }/navigation/${ navKey [ 0 ] }/${ locale }/${ navKey [ 1 ] }` ; } return `/flamelink/environments/${ env }/navigation/${ navKey ? `${ navKey }/${ locale }` : '' }` ; } ;