lib/vehicle.js
function Vehicle(id, token, unitSystem) {
  if (!(this instanceof Vehicle)) {
    // eslint-disable-next-line max-len
    throw new TypeError("Class constructor Vehicle cannot be invoked without 'new'");
  }

  this.id = id;
  this.token = token;
  this.request = util.request.defaults({
    baseUrl: util.getUrl(this.id),
    auth: {
      bearer: this.token,
    },
  });
  this.setUnitSystem(unitSystem || 'metric');
}
function Vehicle(id, token, unitSystem) {
  if (!(this instanceof Vehicle)) {
    // eslint-disable-next-line max-len
    throw new TypeError("Class constructor Vehicle cannot be invoked without 'new'");
  }

  this.id = id;
  this.token = token;
  this.request = util.request.defaults({
    baseUrl: util.getUrl(this.id),
    auth: {
      bearer: this.token,
    },
  });
  this.setUnitSystem(unitSystem || 'metric');
}
function Vehicle ( id , token , unitSystem ) { if ( ! ( this instanceof Vehicle ) ) { // eslint-disable-next-line max-len throw new TypeError ( "Class constructor Vehicle cannot be invoked without 'new'" ) ; } this . id = id ; this . token = token ; this . request = util . request . defaults ( { baseUrl : util . getUrl ( this . id ) , auth : { bearer : this . token , } , } ) ; this . setUnitSystem ( unitSystem || 'metric' ) ; }
Initializes a new Vehicle to use for making requests to the Smartcar API.

@constructor
@param {String} id - The vehicle's unique identifier. Retrieve a user's
vehicle id using {@link module:smartcar.getVehicleIds}.
@param {String} token - A valid access token
@param {String} [unitSystem=metric] - The unit system to use for vehicle data
, must be either `metric` or `imperial`.
Initializes a new Vehicle to use for making requests to the Smartcar API .