UNPKG

393 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.isImageValid = isImageValid;
7function isImageValid(src) {
8 return new Promise(function (resolve) {
9 var img = document.createElement('img');
10 img.onerror = function () {
11 return resolve(false);
12 };
13 img.onload = function () {
14 return resolve(true);
15 };
16 img.src = src;
17 });
18}
\No newline at end of file