index.js
function responseHandle(error, response, body, reject, resolve) {

    if (error) {
      return reject(error);
    }

    try {
      body = JSON.parse(body);
    } catch (e) {
      return reject(new Error('Wrong JSON Format'));
    }

    resolve(body);
    
  }
function responseHandle(error, response, body, reject, resolve) {

    if (error) {
      return reject(error);
    }

    try {
      body = JSON.parse(body);
    } catch (e) {
      return reject(new Error('Wrong JSON Format'));
    }

    resolve(body);
    
  }
function responseHandle ( error , response , body , reject , resolve ) { if ( error ) { return reject ( error ) ; } try { body = JSON . parse ( body ) ; } catch ( e ) { return reject ( new Error ( 'Wrong JSON Format' ) ) ; } resolve ( body ) ; }
Handle resolving or rejecting One Signal response

@param  {Object}   error
@param  {Object}   response
@param  {String}   body
@param  {Function} reject
@param  {Function} resolve
Handle resolving or rejecting One Signal response