import uuid from 'uuid' ; const defaultPrefStorageKey = 'globalSearch:defaultPref' ; /**
 * Returns the default  GlobalSearchFindOptions . preference value.
 *
 * The implementation is based on the sessionStorage, which ensure the default value for a session/tab will remain the same.
  export const getDefaultPreference = ( storage = window . sessionStorage ) : string => { let pref = storage . getItem ( defaultPrefStorageKey ) ; if ( pref ) { return pref ; } pref = uuid . v4 ( ) ; storage . setItem ( defaultPrefStorageKey , pref ) ; return pref ; } ;