function getQueryIdFromPath(path, event) {
  if (!isString(path)) {
    throw new Error('Query path must be a string')
  }
  const origPath = path
  const pathSplitted = path.split('#')
  path = pathSplitted[0]

  const isQuery = pathSplitted.length > 1
  const queryParams = isQuery ? pathSplitted[1].split('&') : []
  const queryId = isQuery
    ? queryParams
        .map((param) => {
          const splittedParam = param.split('=')
          // Handle query id in path
          if (splittedParam[0] === 'queryId') {
            return splittedParam[1]
          }
        })
        .filter((q) => q)
    : undefined
  return queryId && queryId.length > 0
    ? event
      ? `${event}:/${queryId}`
      : queryId[0]
    : isQuery
    ? origPath
    : undefined
}
@private
@param {string} path - Path from which to get query id
@param {string} event - Type of query event
@returns {string} Query id