src/resource/Resource.js
/**
   * Convert an Entity instance into plain JSON payload for API requests.
   *
   * @param {Entity} entity - Instace of entity object
   * @returns {Object}
   */
Convert an Entity instance into plain JSON payload for API requests.
@param {Entity} entity - Instace of entity object
@returns {Object}
Convert an Entity instance into plain JSON payload for API requests . @param { Entity } entity - Instace of entity object @returns { Object }
serialize (entity = {}) {
    if (!(this.type && entity instanceof this.type)) {
      return entity
    }
    return entity.json()
  }
serialize ( entity = { } ) { if ( ! ( this . type && entity instanceof this . type ) ) { return entity } return entity . json ( ) }
Convert an Entity instance into plain JSON payload for API requests.
Convert an Entity instance into plain JSON payload for API requests .