function APIRequest(path = false, query = {}, defaultResult = {}) {
  if (!path) {
    return defaultResult;
  }

  return fetch(`${getEnvOrigin()}/api${path}?${stringify(query)}`)
    .then((response) => response.json())
    .then((data) => (data.error ? defaultResult : data));
}
/**
 * Make request to The Most Laps API
 *
 * @param {String} path Must have leading slash
 * @param {String|Object} query String or Object to stringify
 * @param {Any} defaultResult Default to return if error
 * @return {Promise}
 */
Make request to The Most Laps API
@param {String} path Must have leading slash
@param {String|Object} query String or Object to stringify
@param {Any} defaultResult Default to return if error
@return {Promise}
Make request to The Most Laps API @param { String } path Must have leading slash @param { String|Object } query String or Object to stringify @param { Any } defaultResult Default to return if error @return { Promise }
function APIRequest(path = false, query = {}, defaultResult = {}) {
  if (!path) {
    return defaultResult;
  }
  return fetch(`${getEnvOrigin()}/api${path}?${stringify(query)}`)
    .then((response) => response.json())
    .then((data) => (data.error ? defaultResult : data));
}
function APIRequest ( path = false , query = { } , defaultResult = { } ) { if ( ! path ) { return defaultResult ; } return fetch ( ` ${ getEnvOrigin ( ) } ${ path } ${ stringify ( query ) } ` ) . then ( ( response ) => response . json ( ) ) . then ( ( data ) => ( data . error ? defaultResult : data ) ) ; }
Make request to The Most Laps API
 @param {String} path Must have leading slash
 @param {String|Object} query String or Object to stringify
 @param {Any} defaultResult Default to return if error
 @return {Promise}
Make request to The Most Laps API @param { String } path Must have leading slash @param { String|Object } query String or Object to stringify @param { Any } defaultResult Default to return if error @return { Promise }