"use strict";
exports.id = "node_modules_find-up-simple_index_js";
exports.ids = ["node_modules_find-up-simple_index_js"];
exports.modules = {

/***/ "../../node_modules/find-up-simple/index.js":
/*!**************************************************!*\
  !*** ../../node_modules/find-up-simple/index.js ***!
  \**************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   findUp: () => (/* binding */ findUp),
/* harmony export */   findUpSync: () => (/* binding */ findUpSync)
/* harmony export */ });
/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ "node:process");
/* harmony import */ var node_fs_promises__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node:fs/promises */ "node:fs/promises");
/* harmony import */ var node_url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! node:url */ "node:url");
/* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! node:fs */ "node:fs");
/* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! node:path */ "node:path");






const toPath = urlOrPath => urlOrPath instanceof URL ? (0,node_url__WEBPACK_IMPORTED_MODULE_2__.fileURLToPath)(urlOrPath) : urlOrPath;

async function findUp(name, {
	cwd = node_process__WEBPACK_IMPORTED_MODULE_0__.cwd(),
	type = 'file',
	stopAt,
} = {}) {
	let directory = node_path__WEBPACK_IMPORTED_MODULE_4__.resolve(toPath(cwd) ?? '');
	const {root} = node_path__WEBPACK_IMPORTED_MODULE_4__.parse(directory);
	stopAt = node_path__WEBPACK_IMPORTED_MODULE_4__.resolve(directory, toPath(stopAt ?? root));

	while (directory && directory !== stopAt && directory !== root) {
		const filePath = node_path__WEBPACK_IMPORTED_MODULE_4__.isAbsolute(name) ? name : node_path__WEBPACK_IMPORTED_MODULE_4__.join(directory, name);

		try {
			const stats = await node_fs_promises__WEBPACK_IMPORTED_MODULE_1__.stat(filePath); // eslint-disable-line no-await-in-loop
			if ((type === 'file' && stats.isFile()) || (type === 'directory' && stats.isDirectory())) {
				return filePath;
			}
		} catch {}

		directory = node_path__WEBPACK_IMPORTED_MODULE_4__.dirname(directory);
	}
}

function findUpSync(name, {
	cwd = node_process__WEBPACK_IMPORTED_MODULE_0__.cwd(),
	type = 'file',
	stopAt,
} = {}) {
	let directory = node_path__WEBPACK_IMPORTED_MODULE_4__.resolve(toPath(cwd) ?? '');
	const {root} = node_path__WEBPACK_IMPORTED_MODULE_4__.parse(directory);
	stopAt = node_path__WEBPACK_IMPORTED_MODULE_4__.resolve(directory, toPath(stopAt) ?? root);

	while (directory && directory !== stopAt && directory !== root) {
		const filePath = node_path__WEBPACK_IMPORTED_MODULE_4__.isAbsolute(name) ? name : node_path__WEBPACK_IMPORTED_MODULE_4__.join(directory, name);

		try {
			const stats = node_fs__WEBPACK_IMPORTED_MODULE_3__.statSync(filePath, {throwIfNoEntry: false});
			if ((type === 'file' && stats?.isFile()) || (type === 'directory' && stats?.isDirectory())) {
				return filePath;
			}
		} catch {}

		directory = node_path__WEBPACK_IMPORTED_MODULE_4__.dirname(directory);
	}
}


/***/ })

};
;
//# sourceMappingURL=node_modules_find-up-simple_index_js.index.js.map