Comparing version 0.17.0 to 0.17.1
/*! | ||
* icojs v0.17.0 | ||
* icojs v0.17.1 | ||
* (c) egy186 | ||
* https://github.com/egy186/icojs/blob/master/LICENSE | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self,function(){var r=t.ICO,n=t.ICO=e();n.noConflict=function(){return t.ICO=r,n}}())}(this,(function(){"use strict";var t="image/png",e=t,r=function(t){for(var e=atob(t.replace(/(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+,/,"")),r=new Uint8Array(e.length),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r.buffer},n={decode:function(t){return new Promise((function(e){var r=URL.createObjectURL(new Blob([t])),n=document.createElement("img");n.src=r,n.onload=function(){var t=n.naturalHeight,r=n.naturalWidth,i=document.createElement("canvas");i.width=r,i.height=t;var o=i.getContext("2d");o.drawImage(n,0,0);var a=o.getImageData(0,0,r,t).data;e({data:a,height:t,width:r})}}))},encode:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return new Promise((function(e){var i=t.data,o=t.height,a=t.width,f=document.createElement("canvas");f.width=a,f.height=o;for(var u=f.getContext("2d"),h=u.createImageData(a,o),c=h.data,s=0;s<c.length;s++)c[s]=i[s];u.putImageData(h,0,0),e(r(f.toDataURL(n)))}))}},i=n,o=function(t){if(t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray)return new DataView(t.buffer,t.byteOffset,t.byteLength);if(t instanceof ArrayBuffer)return new DataView(t);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")},a=o,f=function(t){var e=a(t);return 0===e.getUint16(0,!0)&&1===e.getUint16(2,!0)};function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e,r){return e&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var p=new WeakMap,w=new WeakMap,y=d((function t(e,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];if(s(this,t),arguments.length<2)throw new TypeError("Failed to construct 'ImageData': 2 arguments required, but only ".concat(arguments.length," present."));if("object"===c(e)){if(!(e instanceof Uint8ClampedArray))throw new TypeError("Failed to construct 'ImageData': parameter 1 is not of type 'Uint8ClampedArray'.");if("number"!=typeof r||0===r)throw new Error("Failed to construct 'ImageData': The source width is zero or not a number.");if(4*(r>>>=0)>e.length)throw new Error("Failed to construct 'ImageData': The requested image size exceeds the supported range.");if(e.length%4!=0)throw new Error("Failed to construct 'ImageData': The input data length is not a multiple of 4.");if(e.length%(4*r)!=0)throw new Error("Failed to construct 'ImageData': The input data length is not a multiple of (4 * width).");if(void 0!==i[0]){if("number"!=typeof i[0]||0===i[0])throw new Error("Failed to construct 'ImageData': The source height is zero or not a number.");if(i[0]=i[0]>>>0,e.length%(4*r*i[0])!=0)throw new Error("Failed to construct 'ImageData': The input data length is not equal to (4 * width * height).")}p.set(this,r),w.set(this,void 0!==i[0]?i[0]:e.byteLength/r/4),Object.defineProperty(this,"data",{configurable:!0,enumerable:!0,value:e,writable:!1})}else{if("number"!=typeof e||0===e)throw new Error("Failed to construct 'ImageData': The source width is zero or not a number.");if(e>>>=0,"number"!=typeof r||0===r)throw new Error("Failed to construct 'ImageData': The source height is zero or not a number.");if(e*(r>>>=0)>=1<<30)throw new Error("Failed to construct 'ImageData': The requested image size exceeds the supported range.");p.set(this,e),w.set(this,r),Object.defineProperty(this,"data",{configurable:!0,enumerable:!0,value:new Uint8ClampedArray(e*r*4),writable:!1})}}));Object.defineProperty(y.prototype,"width",{enumerable:!0,configurable:!0,get:function(){return p.get(this)}}),Object.defineProperty(y.prototype,"height",{enumerable:!0,configurable:!0,get:function(){return w.get(this)}});var b=y,m=o,v=b;var D=function(){function t(e,r,n){var i,o,a=n.width,f=n.height,u=n.colorDepth,h=n.format;if(s(this,t),this.format=h,this.offset=r,this.depth=u,this.stride=(i=a*this.depth/8,(o=i%4)?i+4-o:i),this.size=this.stride*f,this.data=e.slice(this.offset,this.offset+this.size),this.size!==this.data.byteLength)throw new Error("Truncated bitmap data")}return d(t,[{key:"get",value:function(t,e,r){var n=this.format.indexOf(r);return 1===this.depth?(this.data[e*this.stride+(t/8|0)]&1<<7-t%8*1)>>7-t%8*1:2===this.depth?(this.data[e*this.stride+(t/4|0)]&3<<6-t%4*2)>>>6-t%4*2:4===this.depth?(this.data[e*this.stride+(t/2|0)]&15<<4-t%2*4)>>>4-t%2*4:this.data[e*this.stride+t*(this.depth/8)+n]}}]),t}();function U(t,e){var r=e.width,n=e.height,i=e.colorDepth,o=e.icon;if(32!==i&&24!==i)throw new Error("A color depth of ".concat(i," is not supported"));for(var a=new D(t,0,{width:r,height:n,colorDepth:i,format:"BGRA"}),f=24===i&&o?new D(t,a.offset+a.size,{width:r,height:n,colorDepth:1,format:"A"}):null,u=new Uint8Array(r*n*4),h=0,c=0;c<n;c++)for(var s=0;s<r;s++)u[h++]=a.get(s,n-c-1,"R"),u[h++]=a.get(s,n-c-1,"G"),u[h++]=a.get(s,n-c-1,"B"),u[h++]=32===i?a.get(s,n-c-1,"A"):f&&f.get(s,n-c-1,"A")?0:255;return new Uint8ClampedArray(u.buffer,u.byteOffset,u.byteLength)}function O(t,e){var r=e.width,n=e.height,i=e.colorDepth,o=e.colorCount,a=e.icon;if(8!==i&&4!==i&&2!==i&&1!==i)throw new Error("A color depth of ".concat(i," is not supported"));for(var f=new D(t,0,{width:o,height:1,colorDepth:32,format:"BGRA"}),u=new D(t,f.offset+f.size,{width:r,height:n,colorDepth:i,format:"C"}),h=a?new D(t,u.offset+u.size,{width:r,height:n,colorDepth:1,format:"A"}):null,c=new Uint8Array(r*n*4),s=0,g=0;g<n;g++)for(var d=0;d<r;d++){var l=u.get(d,n-g-1,"C");c[s++]=f.get(l,0,"R"),c[s++]=f.get(l,0,"G"),c[s++]=f.get(l,0,"B"),c[s++]=h&&h.get(d,n-g-1,"A")?0:255}return new Uint8ClampedArray(c.buffer,c.byteOffset,c.byteLength)}function A(t){if(19778!==t)throw new Error("Invalid magic byte 0x".concat(t.toString(16)))}var F=o,E=function(t){var e,r,n,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=a.width,u=void 0===f?0:f,h=a.height,c=void 0===h?0:h,s=a.icon,g=void 0!==s&&s,d=m(t);g?(e=d.getUint32(0,!0),r=d.getUint32(4,!0)/1|0,n=d.getUint32(8,!0)/2|0,i=d.getUint16(14,!0),o=d.getUint32(32,!0)):(A(d.getUint16(0,!0)),e=14+d.getUint32(14,!0),r=d.getUint32(18,!0),n=d.getUint32(22,!0),i=d.getUint16(28,!0),o=d.getUint32(46,!0)),0===o&&i<=8&&(o=1<<i);var l=0===r?u:r,p=0===n?c:n,w=new Uint8Array(d.buffer,d.byteOffset+e,d.byteLength-e),y=o?O(w,{width:l,height:p,colorDepth:i,colorCount:o,icon:g}):U(w,{width:l,height:p,colorDepth:i,icon:g});return Object.assign(new v(y,l,p),{colorDepth:i})},j=b;function I(t,e){var r=t.getUint8(e+24),n=t.getUint8(e+25);if(0===n)return 1*r;if(2===n)return 3*r;if(3===n)return 1*r;if(4===n)return 2*r;if(6===n)return 4*r;throw new Error("Invalid PNG colorType")}function C(t,e){return t.getUint32(e+16,!1)}function P(t,e){return t.getUint32(e+20,!1)}function T(t,e,r){return r?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}function x(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];try{return Promise.resolve(t.apply(this,e))}catch(t){return Promise.reject(t)}}}var z=function(t){var e=F(t);if(e.byteLength<6)throw new Error("Truncated header");if(0!==e.getUint16(0,!0))throw new Error("Invalid magic bytes");var r=e.getUint16(2,!0);if(1!==r&&2!==r)throw new Error("Invalid image type");var n=e.getUint16(4,!0);if(e.byteLength<6+16*n)throw new Error("Truncated image list");return Array.from({length:n},(function(t,n){var i=e.getUint8(6+16*n+0),o=e.getUint8(6+16*n+1),a=e.getUint32(6+16*n+8,!0),f=e.getUint32(6+16*n+12,!0),u=2!==r?null:{x:e.getUint16(6+16*n+4,!0),y:e.getUint16(6+16*n+6,!0)};if(function(t,e){return 2303741511===t.getUint32(e+0)&&218765834===t.getUint32(e+4)}(e,f))return{bpp:I(e,f),data:new Uint8Array(e.buffer,e.byteOffset+f,a),height:P(e,f),hotspot:u,type:"png",width:C(e,f)};var h=new Uint8Array(e.buffer,e.byteOffset+f,a),c=E(h,{width:i,height:o,icon:!0}),s={bpp:c.colorDepth,hotspot:u,type:"bmp"};return Object.assign(new j(c.data,c.width,c.height),s)}))},B=t,L=x((function(t,e,r){var n=z(t),i=x((function(t){return e===B&&"png"===t.type?h(h({},t),{},{buffer:t.data.buffer.slice(t.data.byteOffset,t.data.byteOffset+t.data.byteLength)}):(n=function(){return T(r.encode(t,e),(function(r){return Object.assign(t,{buffer:r,type:e.replace("image/","")})}))},(i=function(){if("png"===t.type)return T(r.decode(t.data),(function(e){Object.assign(t,{data:e.data,type:"bmp"})}))}())&&i.then?i.then(n):n(i));var n,i}));return Promise.all(n.map(i))})),S=i,R=L,k=t,G={isICO:f,parse:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k;return R(t,e,S)}};return G})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self,function(){var r=t.ICO,n=t.ICO=e();n.noConflict=function(){return t.ICO=r,n}}())}(this,(function(){"use strict";var t="image/png",e=t,r=function(t){for(var e=atob(t.replace(/(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+,/,"")),r=new Uint8Array(e.length),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r.buffer},n={decode:function(t){return new Promise((function(e){var r=URL.createObjectURL(new Blob([t])),n=document.createElement("img");n.src=r,n.onload=function(){var t=n.naturalHeight,r=n.naturalWidth,i=document.createElement("canvas");i.width=r,i.height=t;var o=i.getContext("2d");o.drawImage(n,0,0);var a=o.getImageData(0,0,r,t).data;e({data:a,height:t,width:r})}}))},encode:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return new Promise((function(e){var i=t.data,o=t.height,a=t.width,f=document.createElement("canvas");f.width=a,f.height=o;for(var u=f.getContext("2d"),h=u.createImageData(a,o),c=h.data,s=0;s<c.length;s++)c[s]=i[s];u.putImageData(h,0,0),e(r(f.toDataURL(n)))}))}},i=n,o=function(t){if(t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray)return new DataView(t.buffer,t.byteOffset,t.byteLength);if(t instanceof ArrayBuffer)return new DataView(t);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")},a=o,f=function(t){var e=a(t);return 0===e.getUint16(0,!0)&&1===e.getUint16(2,!0)};function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e,r){return e&&g(t.prototype,e),r&&g(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var p=new WeakMap,w=new WeakMap,y=d((function t(e,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];if(s(this,t),arguments.length<2)throw new TypeError("Failed to construct 'ImageData': 2 arguments required, but only ".concat(arguments.length," present."));if("object"===c(e)){if(!(e instanceof Uint8ClampedArray))throw new TypeError("Failed to construct 'ImageData': parameter 1 is not of type 'Uint8ClampedArray'.");if("number"!=typeof r||0===r)throw new Error("Failed to construct 'ImageData': The source width is zero or not a number.");if(4*(r>>>=0)>e.length)throw new Error("Failed to construct 'ImageData': The requested image size exceeds the supported range.");if(e.length%4!=0)throw new Error("Failed to construct 'ImageData': The input data length is not a multiple of 4.");if(e.length%(4*r)!=0)throw new Error("Failed to construct 'ImageData': The input data length is not a multiple of (4 * width).");if(void 0!==i[0]){if("number"!=typeof i[0]||0===i[0])throw new Error("Failed to construct 'ImageData': The source height is zero or not a number.");if(i[0]=i[0]>>>0,e.length%(4*r*i[0])!=0)throw new Error("Failed to construct 'ImageData': The input data length is not equal to (4 * width * height).")}p.set(this,r),w.set(this,void 0!==i[0]?i[0]:e.byteLength/r/4),Object.defineProperty(this,"data",{configurable:!0,enumerable:!0,value:e,writable:!1})}else{if("number"!=typeof e||0===e)throw new Error("Failed to construct 'ImageData': The source width is zero or not a number.");if(e>>>=0,"number"!=typeof r||0===r)throw new Error("Failed to construct 'ImageData': The source height is zero or not a number.");if(e*(r>>>=0)>=1<<30)throw new Error("Failed to construct 'ImageData': The requested image size exceeds the supported range.");p.set(this,e),w.set(this,r),Object.defineProperty(this,"data",{configurable:!0,enumerable:!0,value:new Uint8ClampedArray(e*r*4),writable:!1})}}));Object.defineProperty(y.prototype,"width",{enumerable:!0,configurable:!0,get:function(){return p.get(this)}}),Object.defineProperty(y.prototype,"height",{enumerable:!0,configurable:!0,get:function(){return w.get(this)}});var b=y,m=o,v=b;var U=function(){function t(e,r,n){var i,o,a=n.width,f=n.height,u=n.colorDepth,h=n.format;if(s(this,t),this.format=h,this.offset=r,this.depth=u,this.stride=(i=a*this.depth/8,(o=i%4)?i+4-o:i),this.size=this.stride*f,this.data=e.slice(this.offset,this.offset+this.size),this.size!==this.data.byteLength)throw new Error("Truncated bitmap data")}return d(t,[{key:"get",value:function(t,e,r){var n=this.format.indexOf(r);return 1===this.depth?(this.data[e*this.stride+(t/8|0)]&1<<7-t%8*1)>>7-t%8*1:2===this.depth?(this.data[e*this.stride+(t/4|0)]&3<<6-t%4*2)>>>6-t%4*2:4===this.depth?(this.data[e*this.stride+(t/2|0)]&15<<4-t%2*4)>>>4-t%2*4:this.data[e*this.stride+t*(this.depth/8)+n]}}]),t}();function D(t,e){var r=e.width,n=e.height,i=e.colorDepth,o=e.icon;if(32!==i&&24!==i)throw new Error("A color depth of ".concat(i," is not supported"));for(var a=new U(t,0,{width:r,height:n,colorDepth:i,format:"BGRA"}),f=24===i&&o?new U(t,a.offset+a.size,{width:r,height:n,colorDepth:1,format:"A"}):null,u=new Uint8Array(r*n*4),h=0,c=0;c<n;c++)for(var s=0;s<r;s++)u[h++]=a.get(s,n-c-1,"R"),u[h++]=a.get(s,n-c-1,"G"),u[h++]=a.get(s,n-c-1,"B"),u[h++]=32===i?a.get(s,n-c-1,"A"):f&&f.get(s,n-c-1,"A")?0:255;return new Uint8ClampedArray(u.buffer,u.byteOffset,u.byteLength)}function O(t,e){var r=e.width,n=e.height,i=e.colorDepth,o=e.colorCount,a=e.icon;if(8!==i&&4!==i&&2!==i&&1!==i)throw new Error("A color depth of ".concat(i," is not supported"));for(var f=new U(t,0,{width:o,height:1,colorDepth:32,format:"BGRA"}),u=new U(t,f.offset+f.size,{width:r,height:n,colorDepth:i,format:"C"}),h=a?new U(t,u.offset+u.size,{width:r,height:n,colorDepth:1,format:"A"}):null,c=new Uint8Array(r*n*4),s=0,g=0;g<n;g++)for(var d=0;d<r;d++){var l=u.get(d,n-g-1,"C");c[s++]=f.get(l,0,"R"),c[s++]=f.get(l,0,"G"),c[s++]=f.get(l,0,"B"),c[s++]=h&&h.get(d,n-g-1,"A")?0:255}return new Uint8ClampedArray(c.buffer,c.byteOffset,c.byteLength)}function A(t){if(19778!==t)throw new Error("Invalid magic byte 0x".concat(t.toString(16)))}var F=o,E=function(t){var e,r,n,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=a.width,u=void 0===f?0:f,h=a.height,c=void 0===h?0:h,s=a.icon,g=void 0!==s&&s,d=m(t);g?(e=d.getUint32(0,!0),r=d.getUint32(4,!0)/1|0,n=d.getUint32(8,!0)/2|0,i=d.getUint16(14,!0),o=d.getUint32(32,!0)):(A(d.getUint16(0,!0)),e=14+d.getUint32(14,!0),r=d.getUint32(18,!0),n=d.getUint32(22,!0),i=d.getUint16(28,!0),o=d.getUint32(46,!0)),0===o&&i<=8&&(o=1<<i);var l=0===r?u:r,p=0===n?c:n,w=new Uint8Array(d.buffer,d.byteOffset+e,d.byteLength-e),y=o?O(w,{width:l,height:p,colorDepth:i,colorCount:o,icon:g}):D(w,{width:l,height:p,colorDepth:i,icon:g});return Object.assign(new v(y,l,p),{colorDepth:i})},j=b;function I(t,e){return 2303741511===t.getUint32(e+0)&&218765834===t.getUint32(e+4)}function C(t,e){var r=t.getUint8(e+24),n=t.getUint8(e+25);if(0===n)return 1*r;if(2===n)return 3*r;if(3===n)return 1*r;if(4===n)return 2*r;if(6===n)return 4*r;throw new Error("Invalid PNG colorType")}function P(t,e){return t.getUint32(e+16,!1)}function T(t,e){return t.getUint32(e+20,!1)}function L(t,e,r){return r?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}function x(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];try{return Promise.resolve(t.apply(this,e))}catch(t){return Promise.reject(t)}}}var z=function(t){var e=F(t);if(e.byteLength<6)throw new Error("Truncated header");if(I(e,0))return[{bpp:C(e,0),data:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),height:T(e,0),hotspot:null,type:"png",width:P(e,0)}];if(0!==e.getUint16(0,!0))throw new Error("Invalid magic bytes");var r=e.getUint16(2,!0);if(1!==r&&2!==r)throw new Error("Invalid image type");var n=e.getUint16(4,!0);if(e.byteLength<6+16*n)throw new Error("Truncated image list");return Array.from({length:n},(function(t,n){var i=e.getUint8(6+16*n+0),o=e.getUint8(6+16*n+1),a=e.getUint32(6+16*n+8,!0),f=e.getUint32(6+16*n+12,!0),u=2!==r?null:{x:e.getUint16(6+16*n+4,!0),y:e.getUint16(6+16*n+6,!0)};if(I(e,f))return{bpp:C(e,f),data:new Uint8Array(e.buffer,e.byteOffset+f,a),height:T(e,f),hotspot:u,type:"png",width:P(e,f)};var h=new Uint8Array(e.buffer,e.byteOffset+f,a),c=E(h,{width:i,height:o,icon:!0}),s={bpp:c.colorDepth,hotspot:u,type:"bmp"};return Object.assign(new j(c.data,c.width,c.height),s)}))},B=t,S=x((function(t,e,r){var n=z(t),i=x((function(t){return e===B&&"png"===t.type?h(h({},t),{},{buffer:t.data.buffer.slice(t.data.byteOffset,t.data.byteOffset+t.data.byteLength)}):(n=function(){return L(r.encode(t,e),(function(r){return Object.assign(t,{buffer:r,type:e.replace("image/","")})}))},(i=function(){if("png"===t.type)return L(r.decode(t.data),(function(e){Object.assign(t,{data:e.data,type:"bmp"})}))}())&&i.then?i.then(n):n(i));var n,i}));return Promise.all(n.map(i))})),R=i,k=S,G=t,q={isICO:f,parse:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G;return k(t,e,R)}};return q})); | ||
//# sourceMappingURL=ico.js.map |
{ | ||
"name": "icojs", | ||
"description": "parse ico file", | ||
"version": "0.17.0", | ||
"version": "0.17.1", | ||
"author": "egy186", | ||
@@ -12,5 +12,5 @@ "browser": "browser.js", | ||
"bmp-js": "0.1.0", | ||
"decode-ico": "^0.4.0", | ||
"file-type": "^16.2.0", | ||
"jpeg-js": "^0.4.3", | ||
"decode-ico": "^0.4.1", | ||
"file-type": "^16.5.4", | ||
"jpeg-js": "^0.4.4", | ||
"pngjs": "^6.0.0", | ||
@@ -20,9 +20,10 @@ "to-data-view": "^1.1.0" | ||
"devDependencies": { | ||
"@babel/core": "^7.17.9", | ||
"@babel/preset-env": "^7.16.11", | ||
"@egy186/eslint-config": "^0.72.0", | ||
"@playwright/test": "^1.21.0", | ||
"@rollup/plugin-babel": "^5.3.1", | ||
"@rollup/plugin-commonjs": "^21.1.0", | ||
"@rollup/plugin-node-resolve": "^13.2.1", | ||
"@babel/core": "^7.20.2", | ||
"@babel/preset-env": "^7.20.2", | ||
"@egy186/eslint-config": "^0.81.0", | ||
"@playwright/test": "^1.28.0", | ||
"@rollup/plugin-babel": "^6.0.2", | ||
"@rollup/plugin-commonjs": "^23.0.2", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@rollup/plugin-terser": "^0.1.0", | ||
"babel-plugin-transform-async-to-promises": "^0.8.18", | ||
@@ -33,4 +34,4 @@ "chai": "^4.3.4", | ||
"ejs": "^3.1.7", | ||
"eslint": "^8.13.0", | ||
"eslint-plugin-jsdoc": "^39.2.2", | ||
"eslint": "^8.28.0", | ||
"eslint-plugin-jsdoc": "^39.6.2", | ||
"eslint-plugin-node": "~11.1.0", | ||
@@ -40,10 +41,9 @@ "file-url": "^3.0.0", | ||
"jsonfile": "^6.1.0", | ||
"marked": "^4.0.12", | ||
"mocha": "^9.2.2", | ||
"marked": "^4.2.2", | ||
"mocha": "^10.1.0", | ||
"nyc": "^15.0.0", | ||
"pixelmatch": "^5.2.1", | ||
"playwright": "^1.21.0", | ||
"pixelmatch": "^5.3.0", | ||
"playwright": "^1.28.0", | ||
"rimraf": "^3.0.0", | ||
"rollup": "^2.70.2", | ||
"rollup-plugin-terser": "^7.0.2" | ||
"rollup": "^3.3.0" | ||
}, | ||
@@ -50,0 +50,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53483
Updateddecode-ico@^0.4.1
Updatedfile-type@^16.5.4
Updatedjpeg-js@^0.4.4