babyfs-tiny
Advanced tools
Comparing version 0.3.5 to 0.3.6
@@ -158,4 +158,4 @@ const tinify = require('tinify'); | ||
let manifest = readManifest(path.parse(name).dir); | ||
record(name, true, failsList.length, fullLen); | ||
if (manifest.indexOf(key) === -1) { | ||
console.log(`>>>${name}`); | ||
tinify.fromBuffer(sourceData).toBuffer(function (err, resultData) { | ||
@@ -175,3 +175,3 @@ if (err) { | ||
failsList.push(null); | ||
record(name, true, failsList.length, fullLen); | ||
// record(name, true, failsList.length, fullLen); | ||
fs.writeFileSync(path.join(path.parse(name).dir, 'manifest.json'), JSON.stringify(manifest)); | ||
@@ -183,3 +183,3 @@ resolve(); | ||
failsList.push(name); | ||
record(name, false, failsList.length, fullLen); | ||
// record(name, false, failsList.length, fullLen); | ||
reject(err); | ||
@@ -190,3 +190,2 @@ }); | ||
failsList.push(null); | ||
console.log(`${name}:已缓存`); | ||
resolve(); | ||
@@ -203,4 +202,3 @@ } | ||
const record = (name, success = true, currNum, fullLen) => { | ||
const status = success ? '完成' : '失败'; | ||
console.log(`${name} 压缩${status}。 ${currNum}/${fullLen}`); | ||
console.log(`${name} ${currNum+1}/${fullLen}`); | ||
}; | ||
@@ -207,0 +205,0 @@ |
{ | ||
"name": "babyfs-tiny", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"description": "tiny", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
13929
440