src/rest_resource.js
function convert_json_to_objects(data) {
  if (Array.isArray(data)) {
    return data.map((item, index, arr) => {
      return new this(item, true)
    })
  } else {
    return new this(data, true)
  }
}
function convert_json_to_objects(data) {
  if (Array.isArray(data)) {
    return data.map((item, index, arr) => {
      return new this(item, true)
    })
  } else {
    return new this(data, true)
  }
}
function convert_json_to_objects ( data ) { if ( Array . isArray ( data ) ) { return data . map ( ( item , index , arr ) => { return new this ( item , true ) } ) } else { return new this ( data , true ) } }
Takes in JSON from requests and converts internal objects into objects representing the
resource class.

@param {Array/Object} data - JSON data, either a single object or an array of objects
@return {Array/Object} - Returns the data as objects of the resource class
@private
Takes in JSON from requests and converts internal objects into objects representing the resource class .