HEX
Server: Apache
System: Linux www 6.18.4-i1-ampere #899 SMP Thu Jan 8 10:39:05 CET 2026 aarch64
User: sws1073755998 (1073755998)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/share/nodejs/globby/utilities.js
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] === '!';