icon-gen
Advanced tools
Comparing version 1.1.4 to 1.1.5
# ChangeLog | ||
## v1.1.5 | ||
### Bug Fixes | ||
* Fail if the `sizes` option is not specified [#66](https://github.com/akabekobeko/npm-icon-gen/issues/66) | ||
## v1.1.4 | ||
@@ -4,0 +10,0 @@ |
@@ -158,3 +158,3 @@ 'use strict'; | ||
path = _path2.default.join(dir, options.names.ico + '.ico'); | ||
const icoImageFilter = options.sizes['ico'] || _icoGenerator.ICO.imageSizes; | ||
const icoImageFilter = IconGenerator.getSizes(_icoGenerator.ICO.imageSizes, options, 'ico'); | ||
tasks.push(_icoGenerator2.default.generate(IconGenerator.filter(images, icoImageFilter), path, logger)); | ||
@@ -165,3 +165,3 @@ break; | ||
path = _path2.default.join(dir, options.names.icns + '.icns'); | ||
const icnsImageFilter = options.sizes['ico'] || _icnsGenerator.ICNS.imageSizes; | ||
const icnsImageFilter = IconGenerator.getSizes(_icnsGenerator.ICNS.imageSizes, options, 'icns'); | ||
tasks.push(_icnsGenerator2.default.generate(IconGenerator.filter(images, icnsImageFilter), path, logger)); | ||
@@ -189,2 +189,15 @@ break; | ||
/** | ||
* Get the icon sizes. | ||
* | ||
* @param {Array.<Number>} defaltSizes Sizes of the defalt. | ||
* @param {Object} options CLI options. | ||
* @param {String} type Type of the icon, 'ico' or 'icns'. | ||
* | ||
* @return {Array.<Number>} Sizes. | ||
*/ | ||
static getSizes(defaltSizes, options, type) { | ||
return options && options.sizes && options.sizes[type] ? options.sizes[type] : defaltSizes; | ||
} | ||
/** | ||
* Filter by size to the specified image informations. | ||
@@ -191,0 +204,0 @@ * |
{ | ||
"name": "icon-gen", | ||
"description": "Generate an icon files from the SVG or PNG files", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"author": "akabeko (http://akabeko.me/)", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
51270
1267