@giphy/js-util
Advanced tools
Comparing version 1.1.1 to 1.2.0
export declare let SUPPORTS_WEBP: null | boolean; | ||
export declare const checkIfWebP: () => Promise<{}>; | ||
export declare const checkIfWebP: Promise<{}>; |
@@ -5,22 +5,15 @@ "use strict"; | ||
/* istanbul ignore next */ | ||
exports.checkIfWebP = function () { | ||
return new Promise(function (resolve) { | ||
if (exports.SUPPORTS_WEBP !== null) { | ||
return resolve(); | ||
} | ||
var webp = new Image(); | ||
webp.onload = function () { | ||
exports.SUPPORTS_WEBP = true; | ||
resolve(); | ||
}; | ||
webp.onerror = function () { | ||
exports.SUPPORTS_WEBP = false; | ||
resolve(); | ||
}; | ||
webp.src = | ||
'data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA'; | ||
}); | ||
}; | ||
// run it immediately | ||
exports.checkIfWebP(); | ||
exports.checkIfWebP = new Promise(function (resolve) { | ||
var webp = new Image(); | ||
webp.onload = function () { | ||
exports.SUPPORTS_WEBP = true; | ||
resolve(exports.SUPPORTS_WEBP); | ||
}; | ||
webp.onerror = function () { | ||
exports.SUPPORTS_WEBP = false; | ||
resolve(exports.SUPPORTS_WEBP); | ||
}; | ||
webp.src = | ||
'data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA'; | ||
}); | ||
//# sourceMappingURL=webp-check.js.map |
@@ -11,3 +11,3 @@ { | ||
"name": "@giphy/js-util", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"main": "dist/index.js", | ||
@@ -29,3 +29,3 @@ "description": "Shared giphy js utils", | ||
}, | ||
"gitHead": "e76ef4a2f30003d950592715fc1e85f0fa20a033" | ||
"gitHead": "ec26e14ce2ae116ab25605a2c641761f0bd17dda" | ||
} |
Sorry, the diff of this file is not supported yet
22406
299