frontend/.pnpm-store/v3/files/e8/72c915bdd367b258633bb16f250651e89e4b2cf97c6370cedf370a3bdf59ffb41fd3b334f1465f842c4b6f58b4d7d45937bfd9643eb7767ef379cc8cefb4c3

18 lines
462 B
Plaintext

import {fileURLToPath} from 'node:url';
import {Transform} from 'node:stream';
export const toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
export class FilterStream extends Transform {
constructor(filter) {
super({
objectMode: true,
transform(data, encoding, callback) {
callback(undefined, filter(data) ? data : undefined);
},
});
}
}
export const isNegativePattern = pattern => pattern[0] === '!';