Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import ResponsiveImageService from 'ember-responsive-image/services/responsive-image';
import { assert } from '@ember/debug';
/**
* Service class to provides images generated by the responsive images package
* with additional inline support
*
* @class ResponsiveImageService
* @namespace Services
* @module responsive-image
* @public
*/
export default ResponsiveImageService.extend({
/**
* returns the inline image data as base64 encoded string
*
* @method getInlineImage
* @param {String} imageName The origin name of the Image
* @returns {String} the base64 encoded string
* @public
*/
getInlineImage(imageName) {
assert(`There is no inline image data for image ${imageName}`, this.getLqip(imageName).hasOwnProperty('image'));
return this.getLqip(imageName).image;
},
/**
* returns whether there's an inline image for given image name