Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
Update Image object
Browse files Browse the repository at this point in the history
Remove outdated suffixes from previous APIs.
  • Loading branch information
rodrigobdz committed Jul 11, 2018
1 parent 4d1461f commit 5615a76
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/utils/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,31 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

/**
* Custom Image object.
*
* @param {object} data
* @param {string} id
* @param {string} rendition_type
*
* @returns {object} Object containing API Image object, id from GIF
* object and rendition type.
*/
var Image = function(data, id, rendition_type) {
return ({
media_id: id ? id : null,
rendition_type: rendition_type ? rendition_type : null,
gif_url: data.url ? data.url : null,
url: data.url ? data.url : null,
width: data.width ? data.width : null,
height: data.height ? data.height : null,
gif_size: data.size ? data.size : null,
size: data.size ? data.size : null,
frames: data.frames ? data.frames : null,
mp4_url: data.mp4 ? data.mp4 : null,
mp4: data.mp4 ? data.mp4 : null,
mp4_size: data.mp4_size ? data.mp4_size : null,
webp_url: data.webp ? data.webp : null,
webp_size: data.webp_size ? data.webp_size : null
webp: data.webp ? data.webp : null,
webp_size: data.webp_size ? data.webp_size : null,
})
}


module.exports = Image
module.exports = Image

0 comments on commit 5615a76

Please sign in to comment.