src/index.js
function getJSON (response) {
  return response.json().then((body) => {
    if (body.status !== 'ok') {
      throw error(response, body.status, body.data[0])
    }
    return body
  })
}
function getJSON (response) {
  return response.json().then((body) => {
    if (body.status !== 'ok') {
      throw error(response, body.status, body.data[0])
    }
    return body
  })
}
function getJSON ( response ) { return response . json ( ) . then ( ( body ) => { if ( body . status !== 'ok' ) { throw error ( response , body . status , body . data [ 0 ] ) } return body } ) }
Get the JSON response from the plug.dj API, throwing if it is an error response.
Get the JSON response from the plug . dj API throwing if it is an error response .