Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else {
let
maxDifference = TestUtil.bitmapMaxDifference(fusion, pngImage),
chickenPaintPNG = new PNG({
width: this.width,
height: this.height
});
console.log(chiName + " max difference " + maxDifference);
failures++;
chickenPaintPNG.data.set(fusion.data);
// fs.writeFileSync(filenameRoot + ".chickenpaint.raw", chickenPaintPNG.data, { defaultEncoding: null });
pipe(chickenPaintPNG.pack(), fs.createWriteStream(filenameRoot + ".chickenpaint.png", {defaultEncoding: null}), (err) => {
if (err) {
reject(err);
} else {
resolve();
}
});
}
});
}));
return new Promise((resolve, reject) => {
pipe(...streams, err =>
err ? reject(err) : resolve())
.resume() // Drain.
})
}
function stream (env) {
let parseStream = parseFilter(env)
let filter = through.obj((file, enc, cb) => cb(), function (cb) {
parseStream.promise.then(data => {
this.push(data)
cb()
}, cb)
})
return pipe(parseStream, filter)
}
}
Object.keys(ids).forEach(id => {
css.push(styleSheet.inserted[id].join(''))
})
if(css){
this.queue(`<style data-glamor-chunk="">${css.join('')}</style>`)
}
}
this.queue(data)
}, function end(){
this.queue(null)
})
return pipe(tokenStream, inlineStream)
}
if (css !== '') {
this.queue(
`<style>${css}</style>`
)
}
}
this.queue(data)
},
function end() {
this.queue(null)
}
)
return pipe(
tokenStream,
inlineStream
)
}