mirror of
https://github.com/github/codeql-action.git
synced 2026-01-01 20:20:07 +08:00
The [release notes](https://github.com/avajs/ava/releases/tag/v4.3.3) mention compatibility with Node 18.8.
18 lines
462 B
JavaScript
18 lines
462 B
JavaScript
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] === '!';
|