compressing
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -81,2 +81,7 @@ 'use strict'; | ||
opts.source = source; | ||
if (!source) { // !source 和 sourceType中返回undeined对应 | ||
const error = new Error('Type is not supported, must be a file path, file buffer, or a readable stream'); | ||
error.name = 'IlligalSourceError'; | ||
throw error; | ||
} | ||
if (destType(destDir) !== 'path') { | ||
@@ -83,0 +88,0 @@ const error = new Error('uncompress destination must be a directory'); |
{ | ||
"name": "compressing", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "Everything you need for compressing and uncompressing", | ||
@@ -56,3 +56,2 @@ "main": "index.js", | ||
"egg-bin": "^1.9.1", | ||
"egg-ci": "^2.1.0", | ||
"eslint": "^3.10.2", | ||
@@ -70,11 +69,3 @@ "eslint-config-egg": "^3.2.0", | ||
"node": ">= 4.0.0" | ||
}, | ||
"ci": { | ||
"version": "10, 12, 14, 16, 18", | ||
"os": "linux, macos", | ||
"license": { | ||
"year": "2017", | ||
"fullname": "node-modules and other contributors" | ||
} | ||
} | ||
} |
@@ -75,4 +75,4 @@ # compressing | ||
// You should take care of stream errors in caution, use pump to handle error in one place | ||
const pump = require('pump';) | ||
const sourceStream = fs.createReadStream('file/path/to/compress') | ||
const pump = require('pump'); | ||
const sourceStream = fs.createReadStream('file/path/to/compress'); | ||
const gzipStream = new compressing.gzip.FileStream(); | ||
@@ -79,0 +79,0 @@ const destStream = fs.createWriteStream('path/to/destination.gz'); |
13
954
50518
23