Use objectMode
This commit is contained in:
parent
80912cb6e2
commit
6e38e2b0d9
|
@ -13,8 +13,7 @@ export default function (manifestName: string) {
|
|||
const mappings: { [path: string]: string } = {};
|
||||
|
||||
return new Transform({
|
||||
readableObjectMode: true,
|
||||
writableObjectMode: true,
|
||||
objectMode: true,
|
||||
transform(chunk: File, _, callback) {
|
||||
const hash = PRODUCTION ? fileHash(chunk.contents as Buffer) : "00000000";
|
||||
const newName = `${chunk.basename.substring(0, chunk.basename.length - chunk.extname.length)}.${hash.substring(0, 8)}${chunk.extname}`;
|
||||
|
|
|
@ -62,8 +62,7 @@ function renderArticle() {
|
|||
reloadAssets();
|
||||
|
||||
return new Transform({
|
||||
readableObjectMode: true,
|
||||
writableObjectMode: true,
|
||||
objectMode: true,
|
||||
async transform(file: File, _, callback) {
|
||||
try {
|
||||
const slug = basename(file.path, ".asciidoc");
|
||||
|
|
|
@ -13,8 +13,7 @@ const FONT_PRESETS = {
|
|||
|
||||
function compileFont() {
|
||||
return new Transform({
|
||||
readableObjectMode: true,
|
||||
writableObjectMode: true,
|
||||
objectMode: true,
|
||||
async transform(chunk: File, _, callback) {
|
||||
const [, variant, weight] = /([A-Z][a-z]+)-(\w+)\.ttf$/.exec(chunk.basename);
|
||||
const tmpOutput = tmp.fileSync({ discardDescriptor: true });
|
||||
|
|
Loading…
Reference in New Issue
Block a user