@aidc/utils
Advanced tools
Comparing version 0.5.22 to 0.5.23
@@ -17,10 +17,10 @@ /* | ||
img.onload = function () { | ||
var _window, _window$localStorage; | ||
var _window; | ||
supportWebp = img.width > 0 && img.height > 0; | ||
(_window = window) === null || _window === void 0 ? void 0 : (_window$localStorage = _window.localStorage) === null || _window$localStorage === void 0 ? void 0 : _window$localStorage.setItem('aidc_fe_webp_supported', '1'); | ||
(_window = window) === null || _window === void 0 || (_window = _window.localStorage) === null || _window === void 0 || _window.setItem('aidc_fe_webp_supported', '1'); | ||
}; | ||
img.onerror = function () { | ||
var _window2, _window2$localStorage; | ||
var _window2; | ||
supportWebp = false; | ||
(_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$localStorage = _window2.localStorage) === null || _window2$localStorage === void 0 ? void 0 : _window2$localStorage.removeItem('aidc_fe_webp_supported'); | ||
(_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.localStorage) === null || _window2 === void 0 || _window2.removeItem('aidc_fe_webp_supported'); | ||
}; | ||
@@ -33,4 +33,4 @@ img.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA'; | ||
try { | ||
var _window3, _window3$localStorage; | ||
supportWebp = document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') === 0 || ((_window3 = window) === null || _window3 === void 0 ? void 0 : (_window3$localStorage = _window3.localStorage) === null || _window3$localStorage === void 0 ? void 0 : _window3$localStorage.getItem('aidc_fe_webp_supported')) === '1'; | ||
var _window3; | ||
supportWebp = document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') === 0 || ((_window3 = window) === null || _window3 === void 0 || (_window3 = _window3.localStorage) === null || _window3 === void 0 ? void 0 : _window3.getItem('aidc_fe_webp_supported')) === '1'; | ||
} catch (err) { | ||
@@ -37,0 +37,0 @@ supportWebp = false; |
@@ -12,4 +12,4 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
@@ -16,0 +16,0 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } |
{ | ||
"name": "@aidc/utils", | ||
"version": "0.5.22", | ||
"version": "0.5.23", | ||
"module": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
31786
718