feat(smartgulp): modernize file glob handling and refresh package metadata
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import * as plugins from './smartgulp.plugins.js';
|
||||
import { SmartFile } from '@push.rocks/smartfile';
|
||||
|
||||
import { Transform } from 'stream';
|
||||
import { Transform } from 'node:stream';
|
||||
|
||||
export class GulpStream {
|
||||
stream = new Transform({ objectMode: true });
|
||||
@@ -11,13 +11,13 @@ export class GulpStream {
|
||||
/**
|
||||
* allows you to pipe a SmartfileArray into the stream
|
||||
*/
|
||||
async pipeSmartfileArray(smartfileArray: SmartFile[]) {
|
||||
async pipeSmartfileArray(smartfileArray: SmartFile[]): Promise<void> {
|
||||
// ensure what we get is an array
|
||||
if (!Array.isArray(smartfileArray)) {
|
||||
throw new Error('fileArg has unknown format');
|
||||
}
|
||||
for (let smartfile of smartfileArray) {
|
||||
let hasWritten = this.stream.push(smartfile);
|
||||
for (const smartfile of smartfileArray) {
|
||||
const hasWritten = this.stream.push(smartfile);
|
||||
if (!hasWritten) {
|
||||
await plugins.smartevent.once(this.stream, 'drain');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user