Comparing version 2.5.1 to 2.5.2
@@ -25,2 +25,8 @@ const zlib = require('zlib') | ||
const VALID_EXTENSIONS = [ | ||
'.js', '.css', '.html', | ||
'.png', '.jpg', '.jpeg', '.webp', '.svg', | ||
'.json', '.csv' | ||
]; | ||
/** | ||
@@ -79,6 +85,3 @@ * Compressing files. | ||
try { | ||
if ( | ||
path.extname(filePath) === '.js' || | ||
path.extname(filePath) === '.css' | ||
) { | ||
if (VALID_EXTENSIONS.includes(path.extname(filePath))) { | ||
const hrtimeStart = process.hrtime() | ||
@@ -182,3 +185,3 @@ compressedFiles.push(filePath) | ||
this.logger.warn( | ||
`we couldn't find any appropriate files (.css, .js).`, | ||
`we couldn't find any appropriate files. valid extensions are: ${VALID_EXTENSIONS.join(', ')}`, | ||
true | ||
@@ -185,0 +188,0 @@ ) |
{ | ||
"name": "gzipper", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"description": "CLI for compressing files.", | ||
@@ -38,10 +38,10 @@ "main": "index.js", | ||
"@types/mocha": "^5.2.6", | ||
"@types/node": "^11.13.4", | ||
"@types/node": "^11.13.10", | ||
"@types/sinon": "^7.0.11", | ||
"eslint": "^5.16.0", | ||
"eslint-config-prettier": "^4.1.0", | ||
"eslint-plugin-prettier": "^3.0.1", | ||
"mocha": "^6.1.3", | ||
"prettier": "^1.17.0", | ||
"sinon": "^7.3.1" | ||
"eslint-config-prettier": "^4.3.0", | ||
"eslint-plugin-prettier": "^3.1.0", | ||
"mocha": "^6.1.4", | ||
"prettier": "^1.17.1", | ||
"sinon": "^7.3.2" | ||
}, | ||
@@ -48,0 +48,0 @@ "engines": { |
@@ -61,3 +61,3 @@ const assert = require('assert') | ||
await gzipper.compress() | ||
const responseMessage = `we couldn't find any appropriate files (.css, .js).` | ||
const responseMessage = `we couldn't find any appropriate files. valid extensions are: .js, .css, .html, .png, .jpg, .jpeg, .webp, .svg, .json, .csv` | ||
@@ -76,3 +76,3 @@ assert.ok(noFilesWarnSpy.calledWithExactly(responseMessage, true)) | ||
await gzipper.compress() | ||
const responseMessage = `we couldn't find any appropriate files (.css, .js).` | ||
const responseMessage = `we couldn't find any appropriate files. valid extensions are: .js, .css, .html, .png, .jpg, .jpeg, .webp, .svg, .json, .csv` | ||
@@ -79,0 +79,0 @@ assert.ok(noFilesWarnSpy.calledWithExactly(responseMessage, true)) |
503211
30
1086