Comparing version 0.12.3 to 0.13.0
/*! | ||
* icojs v0.12.3 | ||
* icojs v0.13.0 | ||
* (c) egy186 | ||
* https://github.com/egy186/icojs/blob/master/LICENSE | ||
*/ | ||
!function(t,e){var r,n;"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self,r=t.ICO,(n=t.ICO=e()).noConflict=function(){return t.ICO=r,n})}(this,function(){"use strict";function t(t,e){return t(e={exports:{}},e.exports),e.exports}var e={MIME_BMP:"image/bmp",MIME_JPEG:"image/jpeg",MIME_PNG:"image/png"},r=e.MIME_BMP,n=e.MIME_JPEG,i=e.MIME_PNG,o=Object.freeze({default:e,__moduleExports:e,MIME_BMP:r,MIME_JPEG:n,MIME_PNG:i}),a=o&&e||o,f=t(function(t){var e=a.MIME_PNG,r={decode:function(e){return new Promise(function(o){var t=URL.createObjectURL(new Blob([e])),a=document.createElement("img");a.src=t,a.onload=function(){var t=a.naturalHeight,e=a.naturalWidth,r=document.createElement("canvas");r.width=e,r.height=t;var n=r.getContext("2d");n.drawImage(a,0,0);var i=n.getImageData(0,0,e,t).data;o({data:i,height:t,width:e})}})},encode:function(u){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:e;return new Promise(function(t){var e=u.data,r=u.height,n=u.width,i=document.createElement("canvas");i.width=n,i.height=r;for(var o=i.getContext("2d"),a=o.createImageData(n,r),f=a.data,h=0;h<f.length;h++)f[h]=e[h];o.putImageData(a,0,0),t(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}(i.toDataURL(c)))})}};t.exports=r}),h=Object.freeze({default:f,__moduleExports:f}),u=function(t){if(t instanceof Uint8Array)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 or Uint8Array")},c=Object.freeze({default:u,__moduleExports:u}),v=c&&u||c,d=t(function(t){t.exports=function(t){var e=v(t);return 0===e.getUint16(0,!0)&&1===e.getUint16(2,!0)}}),s=Object.freeze({default:d,__moduleExports:d});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)}}var m=function(){function u(t,e,r){var n,i,o=r.width,a=r.height,f=r.colorDepth,h=r.format;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),this.format=h,this.offset=e,this.depth=f,this.stride=(n=o*this.depth/8,(i=n%4)?n+4-i:n),this.size=this.stride*a,this.data=t.slice(this.offset,this.offset+this.size),this.size!==this.data.byteLength)throw new Error("Truncated bitmap data")}var t,e,r;return t=u,(e=[{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*(this.depth/8)+n]:(this.data[e*this.stride+(t/2|0)]&15<<4-t%2*4)>>>4-t%2*4}}])&&g(t.prototype,e),r&&g(t,r),u}();var l=function(t){var e,r,n,i,o,a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},f=a.width,h=void 0===f?0:f,u=a.height,c=void 0===u?0:u,d=a.icon,s=void 0!==d&&d,g=v(t);0===(o=s?(e=g.getUint32(0,!0),r=g.getUint32(4,!0)/1|0,n=g.getUint32(8,!0)/2|0,i=g.getUint16(14,!0),g.getUint32(32,!0)):(function(t){if(19778!==t)throw new Error("Invalid magic byte 0x".concat(t.toString(16)))}(g.getUint16(0,!0)),e=14+g.getUint32(14,!0),r=g.getUint32(18,!0),n=g.getUint32(22,!0),i=g.getUint16(28,!0),g.getUint32(46,!0)))&&i<=8&&(o=1<<i);var l=0===r?h:r,p=0===n?c:n,w=new Uint8Array(g.buffer,g.byteOffset+e,g.byteLength-e);return{width:l,height:p,data:o?function(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 m(t,0,{width:o,height:1,colorDepth:32,format:"BGRA"}),h=new m(t,f.offset+f.size,{width:r,height:n,colorDepth:i,format:"C"}),u=a?new m(t,h.offset+h.size,{width:r,height:n,colorDepth:1,format:"A"}):null,c=new Uint8Array(r*n*4),d=0,s=0;s<n;s++)for(var g=0;g<r;g++){var l=h.get(g,n-s-1,"C");c[d++]=f.get(l,0,"R"),c[d++]=f.get(l,0,"G"),c[d++]=f.get(l,0,"B"),c[d++]=u&&u.get(g,n-s-1,"A")?0:255}return c}(w,{width:l,height:p,colorDepth:i,colorCount:o,icon:s}):function(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 m(t,0,{width:r,height:n,colorDepth:i,format:"BGRA"}),f=24===i&&o?new m(t,a.offset+a.size,{width:r,height:n,colorDepth:1,format:"A"}):null,h=new Uint8Array(r*n*4),u=0,c=0;c<n;c++)for(var d=0;d<r;d++)h[u++]=a.get(d,n-c-1,"R"),h[u++]=a.get(d,n-c-1,"G"),h[u++]=a.get(d,n-c-1,"B"),h[u++]=32===i?a.get(d,n-c-1,"A"):f&&f.get(d,n-c-1,"A")?0:255;return h}(w,{width:l,height:p,colorDepth:i,icon:s}),colorDepth:i}},p=Object.freeze({default:l,__moduleExports:l}),b=p&&l||p;var w=function(t){var p=v(t);if(p.byteLength<6)throw new Error("Truncated header");if(0!==p.getUint16(0,!0))throw new Error("Invalid magic bytes");var w=p.getUint16(2,!0);if(1!==w&&2!==w)throw new Error("Invalid image type");var e=p.getUint16(4,!0);if(p.byteLength<6+16*e)throw new Error("Truncated image list");return Array.from({length:e},function(t,e){var r,n,i,o,a,f,h=p.getUint8(6+16*e+0),u=p.getUint8(6+16*e+1),c=p.getUint32(6+16*e+8,!0),d=p.getUint32(6+16*e+12,!0),s=2!==w?null:{x:p.getUint16(6+16*e+4,!0),y:p.getUint16(6+16*e+6,!0)};if(f=d,2303741511===(a=p).getUint32(f+0)&&218765834===a.getUint32(f+4))return{bpp:function(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")}(p,d),data:new Uint8Array(p.buffer,p.byteOffset+d,c),height:(i=p,o=d,i.getUint32(o+20,!1)),hotspot:s,type:"png",width:(r=p,n=d,r.getUint32(n+16,!1))};var g=new Uint8Array(p.buffer,p.byteOffset+d,c),l=b(g,{width:h,height:u,icon:!0});return{bpp:l.colorDepth,data:l.data,height:l.height,hotspot:s,type:"bmp",width:l.width}})},y=Object.freeze({default:w,__moduleExports:w}),E=y&&w||y,U=t(function(t){var o=a.MIME_PNG;t.exports=function(t,r,n){var e=null;try{e=E(t)}catch(t){return Promise.reject(t)}var i=function(e){return n.encode(e,r).then(function(t){return Object.assign(e,{buffer:t,type:r.replace("image/","")})})};return Promise.all(e.map(function(t){return r===o&&"png"===t.type?Promise.resolve(Object.assign({buffer:t.data.buffer.slice(t.data.byteOffset,t.data.byteOffset+t.data.byteLength)},t)):(e=t,"png"!==e.type?Promise.resolve(e):n.decode(e.data).then(function(t){return Object.assign(e,{data:t.data,type:"bmp"})})).then(i);var e}))}}),D=Object.freeze({default:U,__moduleExports:U}),M=h&&f||h,_=s&&d||s,I=D&&U||D,x=a.MIME_PNG;return{isICO:_,parse:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:x;return I(t,e,M)}}}); | ||
!function(t,e){var r,n;"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self,r=t.ICO,(n=t.ICO=e()).noConflict=function(){return t.ICO=r,n})}(this,function(){"use strict";var t="image/png",e=t,r={decode:function(e){return new Promise(function(o){var t=URL.createObjectURL(new Blob([e])),a=document.createElement("img");a.src=t,a.onload=function(){var t=a.naturalHeight,e=a.naturalWidth,r=document.createElement("canvas");r.width=e,r.height=t;var n=r.getContext("2d");n.drawImage(a,0,0);var i=n.getImageData(0,0,e,t).data;o({data:i,height:t,width:e})}})},encode:function(u){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:e;return new Promise(function(t){var e=u.data,r=u.height,n=u.width,i=document.createElement("canvas");i.width=n,i.height=r;for(var o=i.getContext("2d"),a=o.createImageData(n,r),h=a.data,f=0;f<h.length;f++)h[f]=e[f];o.putImageData(a,0,0),t(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}(i.toDataURL(c)))})}},v=function(t){if(t instanceof Uint8Array)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 or Uint8Array")},n=function(t){var e=v(t);return 0===e.getUint16(0,!0)&&1===e.getUint16(2,!0)};function i(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)}}var y=function(){function u(t,e,r){var n,i,o=r.width,a=r.height,h=r.colorDepth,f=r.format;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),this.format=f,this.offset=e,this.depth=h,this.stride=(n=o*this.depth/8,(i=n%4)?n+4-i:n),this.size=this.stride*a,this.data=t.slice(this.offset,this.offset+this.size),this.size!==this.data.byteLength)throw new Error("Truncated bitmap data")}var t,e,r;return t=u,(e=[{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*(this.depth/8)+n]:(this.data[e*this.stride+(t/2|0)]&15<<4-t%2*4)>>>4-t%2*4}}])&&i(t.prototype,e),r&&i(t,r),u}();var m=function(t){var e,r,n,i,o,a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},h=a.width,f=void 0===h?0:h,u=a.height,c=void 0===u?0:u,d=a.icon,g=void 0!==d&&d,s=v(t);0===(o=g?(e=s.getUint32(0,!0),r=s.getUint32(4,!0)/1|0,n=s.getUint32(8,!0)/2|0,i=s.getUint16(14,!0),s.getUint32(32,!0)):(function(t){if(19778!==t)throw new Error("Invalid magic byte 0x".concat(t.toString(16)))}(s.getUint16(0,!0)),e=14+s.getUint32(14,!0),r=s.getUint32(18,!0),n=s.getUint32(22,!0),i=s.getUint16(28,!0),s.getUint32(46,!0)))&&i<=8&&(o=1<<i);var l=0===r?f:r,p=0===n?c:n,w=new Uint8Array(s.buffer,s.byteOffset+e,s.byteLength-e);return{width:l,height:p,data:o?function(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 h=new y(t,0,{width:o,height:1,colorDepth:32,format:"BGRA"}),f=new y(t,h.offset+h.size,{width:r,height:n,colorDepth:i,format:"C"}),u=a?new y(t,f.offset+f.size,{width:r,height:n,colorDepth:1,format:"A"}):null,c=new Uint8Array(r*n*4),d=0,g=0;g<n;g++)for(var s=0;s<r;s++){var l=f.get(s,n-g-1,"C");c[d++]=h.get(l,0,"R"),c[d++]=h.get(l,0,"G"),c[d++]=h.get(l,0,"B"),c[d++]=u&&u.get(s,n-g-1,"A")?0:255}return c}(w,{width:l,height:p,colorDepth:i,colorCount:o,icon:g}):function(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 y(t,0,{width:r,height:n,colorDepth:i,format:"BGRA"}),h=24===i&&o?new y(t,a.offset+a.size,{width:r,height:n,colorDepth:1,format:"A"}):null,f=new Uint8Array(r*n*4),u=0,c=0;c<n;c++)for(var d=0;d<r;d++)f[u++]=a.get(d,n-c-1,"R"),f[u++]=a.get(d,n-c-1,"G"),f[u++]=a.get(d,n-c-1,"B"),f[u++]=32===i?a.get(d,n-c-1,"A"):h&&h.get(d,n-c-1,"A")?0:255;return f}(w,{width:l,height:p,colorDepth:i,icon:g}),colorDepth:i}};var o=function(t){var p=v(t);if(p.byteLength<6)throw new Error("Truncated header");if(0!==p.getUint16(0,!0))throw new Error("Invalid magic bytes");var w=p.getUint16(2,!0);if(1!==w&&2!==w)throw new Error("Invalid image type");var e=p.getUint16(4,!0);if(p.byteLength<6+16*e)throw new Error("Truncated image list");return Array.from({length:e},function(t,e){var r,n,i,o,a,h,f=p.getUint8(6+16*e+0),u=p.getUint8(6+16*e+1),c=p.getUint32(6+16*e+8,!0),d=p.getUint32(6+16*e+12,!0),g=2!==w?null:{x:p.getUint16(6+16*e+4,!0),y:p.getUint16(6+16*e+6,!0)};if(h=d,2303741511===(a=p).getUint32(h+0)&&218765834===a.getUint32(h+4))return{bpp:function(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")}(p,d),data:new Uint8Array(p.buffer,p.byteOffset+d,c),height:(i=p,o=d,i.getUint32(o+20,!1)),hotspot:g,type:"png",width:(r=p,n=d,r.getUint32(n+16,!1))};var s=new Uint8Array(p.buffer,p.byteOffset+d,c),l=m(s,{width:f,height:u,icon:!0});return{bpp:l.colorDepth,data:l.data,height:l.height,hotspot:g,type:"bmp",width:l.width}})};function a(r){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(r.apply(this,t))}catch(t){return Promise.reject(t)}}}function h(t,e,r){return r?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}var f=t,u=a(function(t,n,i){var e=o(t),r=a(function(e){return n===f&&"png"===e.type?Object.assign({buffer:e.data.buffer.slice(e.data.byteOffset,e.data.byteOffset+e.data.byteLength)},e):(t=function(){return h(i.encode(e,n),function(t){return Object.assign(e,{buffer:t,type:n.replace("image/","")})})},(r=function(){if("png"===e.type)return h(i.decode(e.data),function(t){Object.assign(e,{data:t.data,type:"bmp"})})}())&&r.then?r.then(t):t(r));var t,r});return Promise.all(e.map(r))}),c=t;return{isICO:n,parse:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:c;return u(t,e,r)}}}); | ||
//# sourceMappingURL=ico.js.map |
{ | ||
"name": "icojs", | ||
"description": "parse ico file", | ||
"version": "0.12.3", | ||
"version": "0.13.0", | ||
"author": "egy186", | ||
@@ -13,3 +13,3 @@ "browser": "browser.js", | ||
"decode-ico": "^0.3.1", | ||
"file-type": "^10.7.0", | ||
"file-type": "^11.0.0", | ||
"jpeg-js": "^0.3.3", | ||
@@ -20,5 +20,6 @@ "pngjs": "^3.3.3", | ||
"devDependencies": { | ||
"@babel/core": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"@egy186/eslint-config": "~0.35.1", | ||
"@babel/core": "^7.3.4", | ||
"@babel/preset-env": "^7.3.4", | ||
"@egy186/eslint-config": "~0.37.0", | ||
"babel-plugin-transform-async-to-promises": "^0.8.10", | ||
"chai": "^4.0.1", | ||
@@ -28,22 +29,22 @@ "chai-as-promised": "^7.0.0", | ||
"data-uri-to-buffer": "^2.0.0", | ||
"eslint": "~5.12.1", | ||
"inline-source": "^6.1.5", | ||
"jsdoc-to-markdown": "^4.0.1", | ||
"eslint": "~5.16.0", | ||
"inline-source": "^6.1.9", | ||
"jsdoc-to-markdown": "^5.0.0", | ||
"jsonfile": "^5.0.0", | ||
"jstransformer-markdown-it": "^2.0.0", | ||
"mocha": "^5.0.0", | ||
"mocha": "^6.1.4", | ||
"npm-run-all": "^4.0.1", | ||
"nyc": "^12.0.2", | ||
"nyc": "^14.0.0", | ||
"pixelmatch": "^4.0.2", | ||
"pug-cli": "^1.0.0-alpha6", | ||
"puppeteer": "^1.6.0", | ||
"puppeteer": "^1.15.0", | ||
"rimraf": "^2.5.2", | ||
"rollup": "^1.0.0", | ||
"rollup-plugin-babel": "^4.0.2", | ||
"rollup-plugin-commonjs": "^9.0.0", | ||
"rollup-plugin-node-resolve": "^4.0.0", | ||
"rollup-plugin-uglify": "^6.0.0" | ||
"rollup": "^1.12.3", | ||
"rollup-plugin-babel": "^4.3.2", | ||
"rollup-plugin-commonjs": "^10.0.0", | ||
"rollup-plugin-node-resolve": "^5.0.0", | ||
"rollup-plugin-uglify": "^6.0.2" | ||
}, | ||
"engines": { | ||
"node": ">=6.14.0" | ||
"node": ">=8.16.0" | ||
}, | ||
@@ -75,7 +76,6 @@ "files": [ | ||
"lint": "eslint .", | ||
"pretest:browser": "npm run build:dist", | ||
"pretest": "npm run build:dist", | ||
"test": "nyc --reporter lcov --reporter text-summary --report-dir coverage mocha \"test/**/*.spec.js\"", | ||
"test:browser": "mocha test/browser/test.js", | ||
"version": "npm run build && git add docs/index.html README.md" | ||
} | ||
} |
@@ -48,3 +48,3 @@ 'use strict'; | ||
* @access private | ||
* @param {Object} image - Data. | ||
* @param {object} image - Data. | ||
* @param {number} image.width - Image width. | ||
@@ -51,0 +51,0 @@ * @param {number} image.height - Image height. |
@@ -63,3 +63,3 @@ 'use strict'; | ||
* @access private | ||
* @param {Object} image - Data. | ||
* @param {object} image - Data. | ||
* @param {number} image.width - Image width. | ||
@@ -84,3 +84,3 @@ * @param {number} image.height - Image height. | ||
* @access private | ||
* @param {Object} image - Data. | ||
* @param {object} image - Data. | ||
* @param {number} image.width - Image width. | ||
@@ -87,0 +87,0 @@ * @param {number} image.height - Image height. |
@@ -20,40 +20,31 @@ 'use strict'; | ||
* @param {string} mime - MIME type for output. | ||
* @param {Object} Image - Image encoder/decoder. | ||
* @param {object} Image - Image encoder/decoder. | ||
* @returns {Promise<ParsedImage[]>} Resolves to an array of {@link ParsedImage}. | ||
*/ | ||
const parse = (data, mime, Image) => { | ||
let icons = null; | ||
const parse = async (data, mime, Image) => { | ||
const icons = decodeIco(data); | ||
try { | ||
icons = decodeIco(data); | ||
} catch (err) { | ||
return Promise.reject(err); | ||
} | ||
const transcodeImage = async icon => { | ||
if (mime === MIME_PNG && icon.type === 'png') { | ||
return Object.assign({ buffer: icon.data.buffer.slice(icon.data.byteOffset, icon.data.byteOffset + icon.data.byteLength) }, icon); | ||
} | ||
const decodePng = icon => { | ||
if (icon.type !== 'png') { | ||
return Promise.resolve(icon); | ||
if (icon.type === 'png') { | ||
const decoded = await Image.decode(icon.data); | ||
Object.assign(icon, { | ||
data: decoded.data, | ||
type: 'bmp' | ||
}); | ||
} | ||
return Image.decode(icon.data).then(decoded => Object.assign(icon, { | ||
data: decoded.data, | ||
type: 'bmp' | ||
})); | ||
return Object.assign(icon, { | ||
buffer: await Image.encode(icon, mime), | ||
type: mime.replace('image/', '') | ||
}); | ||
}; | ||
const encodeImage = icon => Image.encode(icon, mime).then(encoded => Object.assign(icon, { | ||
buffer: encoded, | ||
type: mime.replace('image/', '') | ||
})); | ||
const transcodeImage = icon => { | ||
if (mime === MIME_PNG && icon.type === 'png') { | ||
return Promise.resolve(Object.assign({ buffer: icon.data.buffer.slice(icon.data.byteOffset, icon.data.byteOffset + icon.data.byteLength) }, icon)); | ||
} | ||
return decodePng(icon).then(encodeImage); | ||
}; | ||
return Promise.all(icons.map(transcodeImage)); | ||
const parsedImages = await Promise.all(icons.map(transcodeImage)); | ||
return parsedImages; | ||
}; | ||
module.exports = parse; |
@@ -12,3 +12,3 @@ 'use strict'; | ||
* @param {string} mime - MIME type for output. | ||
* @param {Object} Image - Image encoder/decoder. | ||
* @param {object} Image - Image encoder/decoder. | ||
* @returns {ParsedImage[]} Resolves to an array of {@link ParsedImage}. | ||
@@ -38,5 +38,6 @@ */ | ||
return icons.map(transcodeImage); | ||
const parsedImages = icons.map(transcodeImage); | ||
return parsedImages; | ||
}; | ||
module.exports = parseSync; |
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
45181
25
376
+ Addedfile-type@11.1.0(transitive)
- Removedfile-type@10.11.0(transitive)
Updatedfile-type@^11.0.0