"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_primordials_array = require('../primordials/array.js');
const require_globs_defaults = require('./defaults.js');
const require_globs__internal = require('./_internal.js');
const require_paths_globs = require('../paths/globs.js');

//#region src/globs/stream.ts
/**
* @file `globStreamLicenses` — license-file discovery as an async stream.
*   Specialized for the npm-packlist-style license file search (`LICENSE*`,
*   `COPYING*`, etc.) with optional originals inclusion.
*/
/**
* Create a stream of license file paths matching glob patterns.
*
* @example
*   ;```typescript
*   const stream = globStreamLicenses('/tmp/my-package')
*   for await (const licensePath of stream) {
*     console.log(licensePath)
*   }
*   ```
*/
/*@__NO_SIDE_EFFECTS__*/
function globStreamLicenses(dirname, options) {
	const { ignore: ignoreOpt, ignoreOriginals, recursive, ...globOptions } = {
		__proto__: null,
		...options
	};
	const ignore = [...require_primordials_array.ArrayIsArray(ignoreOpt) ? require_globs__internal.normalizeIgnorePatterns(ignoreOpt) : require_globs_defaults.defaultIgnore, "**/*.{cjs,cts,js,json,mjs,mts,ts}"];
	if (ignoreOriginals) ignore.push(require_paths_globs.LICENSE_ORIGINAL_GLOB_RECURSIVE);
	return (/* @__PURE__ */ require_globs__internal.getFastGlob()).globStream([recursive ? require_paths_globs.LICENSE_GLOB_RECURSIVE : require_paths_globs.LICENSE_GLOB], {
		__proto__: null,
		absolute: true,
		caseSensitiveMatch: false,
		cwd: dirname,
		...globOptions,
		...ignore ? { ignore } : {}
	});
	/* c8 ignore stop */
}

//#endregion
exports.globStreamLicenses = globStreamLicenses;