This commit is contained in:
nik
2025-10-03 22:27:28 +03:00
parent 829fad0e17
commit 871cf7e792
16520 changed files with 2967597 additions and 3 deletions

2
node_modules/cosmiconfig/dist/Explorer.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=Explorer.d.ts.map

1
node_modules/cosmiconfig/dist/Explorer.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Explorer.d.ts","sourceRoot":"","sources":["../src/Explorer.ts"],"names":[],"mappings":""}

170
node_modules/cosmiconfig/dist/Explorer.js generated vendored Normal file
View File

@@ -0,0 +1,170 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Explorer = void 0;
const promises_1 = __importDefault(require("fs/promises"));
const path_1 = __importDefault(require("path"));
const defaults_1 = require("./defaults");
const ExplorerBase_js_1 = require("./ExplorerBase.js");
const merge_1 = require("./merge");
const util_js_1 = require("./util.js");
/**
* @internal
*/
class Explorer extends ExplorerBase_js_1.ExplorerBase {
async load(filepath) {
filepath = path_1.default.resolve(filepath);
const load = async () => {
return await this.config.transform(await this.#readConfiguration(filepath));
};
if (this.loadCache) {
return await (0, util_js_1.emplace)(this.loadCache, filepath, load);
}
return await load();
}
async search(from = '') {
if (this.config.metaConfigFilePath) {
this.loadingMetaConfig = true;
const config = await this.load(this.config.metaConfigFilePath);
this.loadingMetaConfig = false;
if (config && !config.isEmpty) {
return config;
}
}
from = path_1.default.resolve(from);
const dirs = this.#getDirs(from);
const firstDirIter = await dirs.next();
/* istanbul ignore if -- @preserve */
if (firstDirIter.done) {
// this should never happen
throw new Error(`Could not find any folders to iterate through (start from ${from})`);
}
let currentDir = firstDirIter.value;
const search = async () => {
/* istanbul ignore if -- @preserve */
if (await (0, util_js_1.isDirectory)(currentDir.path)) {
for (const filepath of this.getSearchPlacesForDir(currentDir, defaults_1.globalConfigSearchPlaces)) {
try {
const result = await this.#readConfiguration(filepath);
if (result !== null &&
!(result.isEmpty && this.config.ignoreEmptySearchPlaces)) {
return await this.config.transform(result);
}
}
catch (error) {
if (error.code === 'ENOENT' ||
error.code === 'EISDIR' ||
error.code === 'ENOTDIR' ||
error.code === 'EACCES') {
continue;
}
throw error;
}
}
}
const nextDirIter = await dirs.next();
if (!nextDirIter.done) {
currentDir = nextDirIter.value;
if (this.searchCache) {
return await (0, util_js_1.emplace)(this.searchCache, currentDir.path, search);
}
return await search();
}
return await this.config.transform(null);
};
if (this.searchCache) {
return await (0, util_js_1.emplace)(this.searchCache, from, search);
}
return await search();
}
async #readConfiguration(filepath, importStack = []) {
const contents = await promises_1.default.readFile(filepath, { encoding: 'utf-8' });
return this.toCosmiconfigResult(filepath, await this.#loadConfigFileWithImports(filepath, contents, importStack));
}
async #loadConfigFileWithImports(filepath, contents, importStack) {
const loadedContent = await this.#loadConfiguration(filepath, contents);
if (!loadedContent || !(0, merge_1.hasOwn)(loadedContent, '$import')) {
return loadedContent;
}
const fileDirectory = path_1.default.dirname(filepath);
const { $import: imports, ...ownContent } = loadedContent;
const importPaths = Array.isArray(imports) ? imports : [imports];
const newImportStack = [...importStack, filepath];
this.validateImports(filepath, importPaths, newImportStack);
const importedConfigs = await Promise.all(importPaths.map(async (importPath) => {
const fullPath = path_1.default.resolve(fileDirectory, importPath);
const result = await this.#readConfiguration(fullPath, newImportStack);
return result?.config;
}));
return (0, merge_1.mergeAll)([...importedConfigs, ownContent], {
mergeArrays: this.config.mergeImportArrays,
});
}
async #loadConfiguration(filepath, contents) {
if (contents.trim() === '') {
return;
}
const extension = path_1.default.extname(filepath);
const loader = this.config.loaders[extension || 'noExt'] ??
this.config.loaders['default'];
if (!loader) {
throw new Error(`No loader specified for ${(0, ExplorerBase_js_1.getExtensionDescription)(extension)}`);
}
try {
const loadedContents = await loader(filepath, contents);
if (path_1.default.basename(filepath, extension) !== 'package') {
return loadedContents;
}
return ((0, util_js_1.getPropertyByPath)(loadedContents, this.config.packageProp ?? this.config.moduleName) ?? null);
}
catch (error) {
error.filepath = filepath;
throw error;
}
}
async #fileExists(path) {
try {
await promises_1.default.stat(path);
return true;
}
catch (e) {
return false;
}
}
async *#getDirs(startDir) {
switch (this.config.searchStrategy) {
case 'none': {
// only check in the passed directory (defaults to working directory)
yield { path: startDir, isGlobalConfig: false };
return;
}
case 'project': {
let currentDir = startDir;
while (true) {
yield { path: currentDir, isGlobalConfig: false };
for (const ext of ['json', 'yaml']) {
const packageFile = path_1.default.join(currentDir, `package.${ext}`);
if (await this.#fileExists(packageFile)) {
break;
}
}
const parentDir = path_1.default.dirname(currentDir);
/* istanbul ignore if -- @preserve */
if (parentDir === currentDir) {
// we're probably at the root of the directory structure
break;
}
currentDir = parentDir;
}
return;
}
case 'global': {
yield* this.getGlobalDirs(startDir);
}
}
}
}
exports.Explorer = Explorer;
//# sourceMappingURL=Explorer.js.map

1
node_modules/cosmiconfig/dist/Explorer.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/cosmiconfig/dist/ExplorerBase.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=ExplorerBase.d.ts.map

1
node_modules/cosmiconfig/dist/ExplorerBase.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ExplorerBase.d.ts","sourceRoot":"","sources":["../src/ExplorerBase.ts"],"names":[],"mappings":""}

126
node_modules/cosmiconfig/dist/ExplorerBase.js generated vendored Normal file
View File

@@ -0,0 +1,126 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getExtensionDescription = exports.ExplorerBase = void 0;
const env_paths_1 = __importDefault(require("env-paths"));
const os_1 = __importDefault(require("os"));
const path_1 = __importDefault(require("path"));
const util_js_1 = require("./util.js");
/**
* @internal
*/
class ExplorerBase {
#loadingMetaConfig = false;
config;
loadCache;
searchCache;
constructor(options) {
this.config = options;
if (options.cache) {
this.loadCache = new Map();
this.searchCache = new Map();
}
this.#validateConfig();
}
set loadingMetaConfig(value) {
this.#loadingMetaConfig = value;
}
#validateConfig() {
const config = this.config;
for (const place of config.searchPlaces) {
const extension = path_1.default.extname(place);
const loader = this.config.loaders[extension || 'noExt'] ??
this.config.loaders['default'];
if (loader === undefined) {
throw new Error(`Missing loader for ${getExtensionDescription(place)}.`);
}
if (typeof loader !== 'function') {
throw new Error(`Loader for ${getExtensionDescription(place)} is not a function: Received ${typeof loader}.`);
}
}
}
clearLoadCache() {
if (this.loadCache) {
this.loadCache.clear();
}
}
clearSearchCache() {
if (this.searchCache) {
this.searchCache.clear();
}
}
clearCaches() {
this.clearLoadCache();
this.clearSearchCache();
}
toCosmiconfigResult(filepath, config) {
if (config === null) {
return null;
}
if (config === undefined) {
return { filepath, config: undefined, isEmpty: true };
}
if (this.config.applyPackagePropertyPathToConfiguration ||
this.#loadingMetaConfig) {
const packageProp = this.config.packageProp ?? this.config.moduleName;
config = (0, util_js_1.getPropertyByPath)(config, packageProp);
}
if (config === undefined) {
return { filepath, config: undefined, isEmpty: true };
}
return { config, filepath };
}
validateImports(containingFilePath, imports, importStack) {
const fileDirectory = path_1.default.dirname(containingFilePath);
for (const importPath of imports) {
if (typeof importPath !== 'string') {
throw new Error(`${containingFilePath}: Key $import must contain a string or a list of strings`);
}
const fullPath = path_1.default.resolve(fileDirectory, importPath);
if (fullPath === containingFilePath) {
throw new Error(`Self-import detected in ${containingFilePath}`);
}
const idx = importStack.indexOf(fullPath);
if (idx !== -1) {
throw new Error(`Circular import detected:
${[...importStack, fullPath]
.map((path, i) => `${i + 1}. ${path}`)
.join('\n')} (same as ${idx + 1}.)`);
}
}
}
getSearchPlacesForDir(dir, globalConfigPlaces) {
return (dir.isGlobalConfig ? globalConfigPlaces : this.config.searchPlaces).map((place) => path_1.default.join(dir.path, place));
}
getGlobalConfigDir() {
return (0, env_paths_1.default)(this.config.moduleName, { suffix: '' }).config;
}
*getGlobalDirs(startDir) {
const stopDir = path_1.default.resolve(this.config.stopDir ?? os_1.default.homedir());
yield { path: startDir, isGlobalConfig: false };
let currentDir = startDir;
while (currentDir !== stopDir) {
const parentDir = path_1.default.dirname(currentDir);
/* istanbul ignore if -- @preserve */
if (parentDir === currentDir) {
// we're probably at the root of the directory structure
break;
}
yield { path: parentDir, isGlobalConfig: false };
currentDir = parentDir;
}
yield { path: this.getGlobalConfigDir(), isGlobalConfig: true };
}
}
exports.ExplorerBase = ExplorerBase;
/**
* @internal
*/
function getExtensionDescription(extension) {
/* istanbul ignore next -- @preserve */
return extension ? `extension "${extension}"` : 'files without extensions';
}
exports.getExtensionDescription = getExtensionDescription;
//# sourceMappingURL=ExplorerBase.js.map

1
node_modules/cosmiconfig/dist/ExplorerBase.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ExplorerBase.js","sourceRoot":"","sources":["../src/ExplorerBase.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAiC;AACjC,4CAAoB;AACpB,gDAAwB;AAUxB,uCAA8C;AAE9C;;GAEG;AACH,MAAsB,YAAY;IAGhC,kBAAkB,GAAG,KAAK,CAAC;IAER,MAAM,CAAI;IACV,SAAS,CAEb;IACI,WAAW,CAEf;IAEf,YAAmB,OAAoB;QACrC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;QACtB,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;YAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;SAC9B;QACD,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAED,IAAc,iBAAiB,CAAC,KAAc;QAC5C,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;IAClC,CAAC;IAED,eAAe;QACb,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAE3B,KAAK,MAAM,KAAK,IAA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ync.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=ExplorerSync.d.ts.map

1
node_modules/cosmiconfig/dist/ExplorerSync.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"ExplorerSync.d.ts","sourceRoot":"","sources":["../src/ExplorerSync.ts"],"names":[],"mappings":""}

184
node_modules/cosmiconfig/dist/ExplorerSync.js generated vendored Normal file
View File

@@ -0,0 +1,184 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExplorerSync = void 0;
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
const defaults_1 = require("./defaults");
const ExplorerBase_js_1 = require("./ExplorerBase.js");
const merge_1 = require("./merge");
const util_js_1 = require("./util.js");
/**
* @internal
*/
class ExplorerSync extends ExplorerBase_js_1.ExplorerBase {
load(filepath) {
filepath = path_1.default.resolve(filepath);
const load = () => {
return this.config.transform(this.#readConfiguration(filepath));
};
if (this.loadCache) {
return (0, util_js_1.emplace)(this.loadCache, filepath, load);
}
return load();
}
search(from = '') {
if (this.config.metaConfigFilePath) {
this.loadingMetaConfig = true;
const config = this.load(this.config.metaConfigFilePath);
this.loadingMetaConfig = false;
if (config && !config.isEmpty) {
return config;
}
}
from = path_1.default.resolve(from);
const dirs = this.#getDirs(from);
const firstDirIter = dirs.next();
/* istanbul ignore if -- @preserve */
if (firstDirIter.done) {
// this should never happen
throw new Error(`Could not find any folders to iterate through (start from ${from})`);
}
let currentDir = firstDirIter.value;
const search = () => {
/* istanbul ignore if -- @preserve */
if ((0, util_js_1.isDirectorySync)(currentDir.path)) {
for (const filepath of this.getSearchPlacesForDir(currentDir, defaults_1.globalConfigSearchPlacesSync)) {
try {
const result = this.#readConfiguration(filepath);
if (result !== null &&
!(result.isEmpty && this.config.ignoreEmptySearchPlaces)) {
return this.config.transform(result);
}
}
catch (error) {
if (error.code === 'ENOENT' ||
error.code === 'EISDIR' ||
error.code === 'ENOTDIR' ||
error.code === 'EACCES') {
continue;
}
throw error;
}
}
}
const nextDirIter = dirs.next();
if (!nextDirIter.done) {
currentDir = nextDirIter.value;
if (this.searchCache) {
return (0, util_js_1.emplace)(this.searchCache, currentDir.path, search);
}
return search();
}
return this.config.transform(null);
};
if (this.searchCache) {
return (0, util_js_1.emplace)(this.searchCache, from, search);
}
return search();
}
#readConfiguration(filepath, importStack = []) {
const contents = fs_1.default.readFileSync(filepath, 'utf8');
return this.toCosmiconfigResult(filepath, this.#loadConfigFileWithImports(filepath, contents, importStack));
}
#loadConfigFileWithImports(filepath, contents, importStack) {
const loadedContent = this.#loadConfiguration(filepath, contents);
if (!loadedContent || !(0, merge_1.hasOwn)(loadedContent, '$import')) {
return loadedContent;
}
const fileDirectory = path_1.default.dirname(filepath);
const { $import: imports, ...ownContent } = loadedContent;
const importPaths = Array.isArray(imports) ? imports : [imports];
const newImportStack = [...importStack, filepath];
this.validateImports(filepath, importPaths, newImportStack);
const importedConfigs = importPaths.map((importPath) => {
const fullPath = path_1.default.resolve(fileDirectory, importPath);
const result = this.#readConfiguration(fullPath, newImportStack);
return result?.config;
});
return (0, merge_1.mergeAll)([...importedConfigs, ownContent], {
mergeArrays: this.config.mergeImportArrays,
});
}
#loadConfiguration(filepath, contents) {
if (contents.trim() === '') {
return;
}
const extension = path_1.default.extname(filepath);
const loader = this.config.loaders[extension || 'noExt'] ??
this.config.loaders['default'];
if (!loader) {
throw new Error(`No loader specified for ${(0, ExplorerBase_js_1.getExtensionDescription)(extension)}`);
}
try {
const loadedContents = loader(filepath, contents);
if (path_1.default.basename(filepath, extension) !== 'package') {
return loadedContents;
}
return ((0, util_js_1.getPropertyByPath)(loadedContents, this.config.packageProp ?? this.config.moduleName) ?? null);
}
catch (error) {
error.filepath = filepath;
throw error;
}
}
#fileExists(path) {
try {
fs_1.default.statSync(path);
return true;
}
catch (e) {
return false;
}
}
*#getDirs(startDir) {
switch (this.config.searchStrategy) {
case 'none': {
// there is no next dir
yield { path: startDir, isGlobalConfig: false };
return;
}
case 'project': {
let currentDir = startDir;
while (true) {
yield { path: currentDir, isGlobalConfig: false };
for (const ext of ['json', 'yaml']) {
const packageFile = path_1.default.join(currentDir, `package.${ext}`);
if (this.#fileExists(packageFile)) {
break;
}
}
const parentDir = path_1.default.dirname(currentDir);
/* istanbul ignore if -- @preserve */
if (parentDir === currentDir) {
// we're probably at the root of the directory structure
break;
}
currentDir = parentDir;
}
return;
}
case 'global': {
yield* this.getGlobalDirs(startDir);
}
}
}
/**
* @deprecated Use {@link ExplorerSync.prototype.load}.
*/
/* istanbul ignore next */
loadSync(filepath) {
return this.load(filepath);
}
/**
* @deprecated Use {@link ExplorerSync.prototype.search}.
*/
/* istanbul ignore next */
searchSync(from = '') {
return this.search(from);
}
}
exports.ExplorerSync = ExplorerSync;
//# sourceMappingURL=ExplorerSync.js.map

1
node_modules/cosmiconfig/dist/ExplorerSync.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

5
node_modules/cosmiconfig/dist/cacheWrapper.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import { Cache, CosmiconfigResult } from './types';
declare function cacheWrapper(cache: Cache, key: string, fn: () => Promise<CosmiconfigResult>): Promise<CosmiconfigResult>;
declare function cacheWrapperSync(cache: Cache, key: string, fn: () => CosmiconfigResult): CosmiconfigResult;
export { cacheWrapper, cacheWrapperSync };
//# sourceMappingURL=cacheWrapper.d.ts.map

1
node_modules/cosmiconfig/dist/cacheWrapper.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"cacheWrapper.d.ts","sourceRoot":"","sources":["../src/cacheWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEnD,iBAAe,YAAY,CACzB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,GACnC,OAAO,CAAC,iBAAiB,CAAC,CAS5B;AAED,iBAAS,gBAAgB,CACvB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,iBAAiB,GAC1B,iBAAiB,CASnB;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC"}

32
node_modules/cosmiconfig/dist/cacheWrapper.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cacheWrapper = cacheWrapper;
exports.cacheWrapperSync = cacheWrapperSync;
async function cacheWrapper(cache, key, fn) {
const cached = cache.get(key);
if (cached !== undefined) {
return cached;
}
const result = await fn();
cache.set(key, result);
return result;
}
function cacheWrapperSync(cache, key, fn) {
const cached = cache.get(key);
if (cached !== undefined) {
return cached;
}
const result = fn();
cache.set(key, result);
return result;
}
//# sourceMappingURL=cacheWrapper.js.map

1
node_modules/cosmiconfig/dist/cacheWrapper.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"cacheWrapper.js","names":["cacheWrapper","cache","key","fn","cached","get","undefined","result","set","cacheWrapperSync"],"sources":["../src/cacheWrapper.ts"],"sourcesContent":["import { Cache, CosmiconfigResult } from './types';\n\nasync function cacheWrapper(\n cache: Cache,\n key: string,\n fn: () => Promise<CosmiconfigResult>,\n): Promise<CosmiconfigResult> {\n const cached = cache.get(key);\n if (cached !== undefined) {\n return cached;\n }\n\n const result = await fn();\n cache.set(key, result);\n return result;\n}\n\nfunction cacheWrapperSync(\n cache: Cache,\n key: string,\n fn: () => CosmiconfigResult,\n): CosmiconfigResult {\n const cached = cache.get(key);\n if (cached !== undefined) {\n return cached;\n }\n\n const result = fn();\n cache.set(key, result);\n return result;\n}\n\nexport { cacheWrapper, cacheWrapperSync };\n"],"mappings":";;;;;;;;AAEA,eAAeA,YAAf,CACEC,KADF,EAEEC,GAFF,EAGEC,EAHF,EAI8B;EAC5B,MAAMC,MAAM,GAAGH,KAAK,CAACI,GAAN,CAAUH,GAAV,CAAf;;EACA,IAAIE,MAAM,KAAKE,SAAf,EAA0B;IACxB,OAAOF,MAAP;EACD;;EAED,MAAMG,MAAM,GAAG,MAAMJ,EAAE,EAAvB;EACAF,KAAK,CAACO,GAAN,CAAUN,GAAV,EAAeK,MAAf;EACA,OAAOA,MAAP;AACD;;AAED,SAASE,gBAAT,CACER,KADF,EAEEC,GAFF,EAGEC,EAHF,EAIqB;EACnB,MAAMC,MAAM,GAAGH,KAAK,CAACI,GAAN,CAAUH,GAAV,CAAf;;EACA,IAAIE,MAAM,KAAKE,SAAf,EAA0B;IACxB,OAAOF,MAAP;EACD;;EAED,MAAMG,MAAM,GAAGJ,EAAE,EAAjB;EACAF,KAAK,CAACO,GAAN,CAAUN,GAAV,EAAeK,MAAf;EACA,OAAOA,MAAP;AACD"}

View File

@@ -0,0 +1,3 @@
declare function canUseDynamicImport(): boolean;
export { canUseDynamicImport };
//# sourceMappingURL=canUseDynamicImport.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"canUseDynamicImport.d.ts","sourceRoot":"","sources":["../src/canUseDynamicImport.ts"],"names":[],"mappings":"AAEA,iBAAS,mBAAmB,IAAI,OAAO,CAUtC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}

23
node_modules/cosmiconfig/dist/canUseDynamicImport.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.canUseDynamicImport = canUseDynamicImport;
/* istanbul ignore file -- @preserve */
let result;
function canUseDynamicImport() {
if (result === undefined) {
try {
new Function('id', 'return import(id);');
result = true;
} catch (e) {
result = false;
}
}
return result;
}
//# sourceMappingURL=canUseDynamicImport.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"canUseDynamicImport.js","names":["result","canUseDynamicImport","undefined","Function","e"],"sources":["../src/canUseDynamicImport.ts"],"sourcesContent":["/* istanbul ignore file -- @preserve */\nlet result: boolean;\nfunction canUseDynamicImport(): boolean {\n if (result === undefined) {\n try {\n new Function('id', 'return import(id);');\n result = true;\n } catch (e) {\n result = false;\n }\n }\n return result;\n}\n\nexport { canUseDynamicImport };\n"],"mappings":";;;;;;;AAAA;AACA,IAAIA,MAAJ;;AACA,SAASC,mBAAT,GAAwC;EACtC,IAAID,MAAM,KAAKE,SAAf,EAA0B;IACxB,IAAI;MACF,IAAIC,QAAJ,CAAa,IAAb,EAAmB,oBAAnB;MACAH,MAAM,GAAG,IAAT;IACD,CAHD,CAGE,OAAOI,CAAP,EAAU;MACVJ,MAAM,GAAG,KAAT;IACD;EACF;;EACD,OAAOA,MAAP;AACD"}

25
node_modules/cosmiconfig/dist/defaults.d.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
export declare function getDefaultSearchPlaces(moduleName: string): Array<string>;
export declare function getDefaultSearchPlacesSync(moduleName: string): Array<string>;
export declare const globalConfigSearchPlaces: string[];
export declare const globalConfigSearchPlacesSync: string[];
export declare const metaSearchPlaces: string[];
export declare const defaultLoaders: Readonly<{
readonly '.mjs': import("./types").Loader;
readonly '.cjs': import("./types").Loader;
readonly '.js': import("./types").Loader;
readonly '.ts': import("./types").Loader;
readonly '.json': import("./types").LoaderSync;
readonly '.yaml': import("./types").LoaderSync;
readonly '.yml': import("./types").LoaderSync;
readonly noExt: import("./types").LoaderSync;
}>;
export declare const defaultLoadersSync: Readonly<{
readonly '.cjs': import("./types").LoaderSync;
readonly '.js': import("./types").LoaderSync;
readonly '.ts': import("./types").LoaderSync;
readonly '.json': import("./types").LoaderSync;
readonly '.yaml': import("./types").LoaderSync;
readonly '.yml': import("./types").LoaderSync;
readonly noExt: import("./types").LoaderSync;
}>;
//# sourceMappingURL=defaults.d.ts.map

1
node_modules/cosmiconfig/dist/defaults.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AASA,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAwBxE;AAED,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAqB5E;AAED,eAAO,MAAM,wBAAwB,UASpC,CAAC;AACF,eAAO,MAAM,4BAA4B,UAQxC,CAAC;AAGF,eAAO,MAAM,gBAAgB,UAU5B,CAAC;AAGF,eAAO,MAAM,cAAc;;;;;;;;;EAShB,CAAC;AAEZ,eAAO,MAAM,kBAAkB;;;;;;;;EAQpB,CAAC"}

105
node_modules/cosmiconfig/dist/defaults.js generated vendored Normal file
View File

@@ -0,0 +1,105 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultLoadersSync = exports.defaultLoaders = exports.metaSearchPlaces = exports.globalConfigSearchPlacesSync = exports.globalConfigSearchPlaces = exports.getDefaultSearchPlacesSync = exports.getDefaultSearchPlaces = void 0;
const loaders_1 = require("./loaders");
function getDefaultSearchPlaces(moduleName) {
return [
'package.json',
`.${moduleName}rc`,
`.${moduleName}rc.json`,
`.${moduleName}rc.yaml`,
`.${moduleName}rc.yml`,
`.${moduleName}rc.js`,
`.${moduleName}rc.ts`,
`.${moduleName}rc.cjs`,
`.${moduleName}rc.mjs`,
`.config/${moduleName}rc`,
`.config/${moduleName}rc.json`,
`.config/${moduleName}rc.yaml`,
`.config/${moduleName}rc.yml`,
`.config/${moduleName}rc.js`,
`.config/${moduleName}rc.ts`,
`.config/${moduleName}rc.cjs`,
`.config/${moduleName}rc.mjs`,
`${moduleName}.config.js`,
`${moduleName}.config.ts`,
`${moduleName}.config.cjs`,
`${moduleName}.config.mjs`,
];
}
exports.getDefaultSearchPlaces = getDefaultSearchPlaces;
function getDefaultSearchPlacesSync(moduleName) {
return [
'package.json',
`.${moduleName}rc`,
`.${moduleName}rc.json`,
`.${moduleName}rc.yaml`,
`.${moduleName}rc.yml`,
`.${moduleName}rc.js`,
`.${moduleName}rc.ts`,
`.${moduleName}rc.cjs`,
`.config/${moduleName}rc`,
`.config/${moduleName}rc.json`,
`.config/${moduleName}rc.yaml`,
`.config/${moduleName}rc.yml`,
`.config/${moduleName}rc.js`,
`.config/${moduleName}rc.ts`,
`.config/${moduleName}rc.cjs`,
`${moduleName}.config.js`,
`${moduleName}.config.ts`,
`${moduleName}.config.cjs`,
];
}
exports.getDefaultSearchPlacesSync = getDefaultSearchPlacesSync;
exports.globalConfigSearchPlaces = [
'config',
'config.json',
'config.yaml',
'config.yml',
'config.js',
'config.ts',
'config.cjs',
'config.mjs',
];
exports.globalConfigSearchPlacesSync = [
'config',
'config.json',
'config.yaml',
'config.yml',
'config.js',
'config.ts',
'config.cjs',
];
// this needs to be hardcoded, as this is intended for end users, who can't supply options at this point
exports.metaSearchPlaces = [
'package.json',
'package.yaml',
'.config/config.json',
'.config/config.yaml',
'.config/config.yml',
'.config/config.js',
'.config/config.ts',
'.config/config.cjs',
'.config/config.mjs',
];
// do not allow mutation of default loaders. Make sure it is set inside options
exports.defaultLoaders = Object.freeze({
'.mjs': loaders_1.loadJs,
'.cjs': loaders_1.loadJs,
'.js': loaders_1.loadJs,
'.ts': loaders_1.loadTs,
'.json': loaders_1.loadJson,
'.yaml': loaders_1.loadYaml,
'.yml': loaders_1.loadYaml,
noExt: loaders_1.loadYaml,
});
exports.defaultLoadersSync = Object.freeze({
'.cjs': loaders_1.loadJsSync,
'.js': loaders_1.loadJsSync,
'.ts': loaders_1.loadTsSync,
'.json': loaders_1.loadJson,
'.yaml': loaders_1.loadYaml,
'.yml': loaders_1.loadYaml,
noExt: loaders_1.loadYaml,
});
//# sourceMappingURL=defaults.js.map

1
node_modules/cosmiconfig/dist/defaults.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":";;;AAAA,uCAOmB;AAEnB,SAAgB,sBAAsB,CAAC,UAAkB;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IAC1C,QAAQ;IACR,aAAa;IACb,aAAa;IACb,YAAY;IACZ,WAAW;IACX,WAAW;IACX,YAAY;CACb,CAAC;AAEF,wGAAwG;AAC3F,QAAA,gBAAgB,GAAG;IAC9B,cAAc;IACd,cAAc;IACd,qBAAqB;IACrB,qBAAqB;IACrB,oBAAoB;IACpB,mBAAmB;IACnB,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;CACrB,CAAC;AAEF,+EAA+E;AAClE,QAAA,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,gBAAM;IACd,MAAM,EAAE,gBAAM;IACd,KAAK,EAAE,gBAAM;IACb,KAAK,EAAE,gBAAM;IACb,OAAO,EAAE,kBAAQ;IACjB,OAAO,EAAE,kBAAQ;IACjB,MAAM,EAAE,kBAAQ;IAChB,KAAK,EAAE,kBAAQ;CACP,CAAC,CAAC;AAEC,QAAA,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,oBAAU;IAClB,KAAK,EAAE,oBAAU;IACjB,KAAK,EAAE,oBAAU;IACjB,OAAO,EAAE,kBAAQ;IACjB,OAAO,EAAE,kBAAQ;IACjB,MAAM,EAAE,kBAAQ;IAChB,KAAK,EAAE,kBAAQ;CACP,CAAC,CAAC"}

4
node_modules/cosmiconfig/dist/getDirectory.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
declare function getDirectory(filepath: string): Promise<string>;
declare function getDirectorySync(filepath: string): string;
export { getDirectory, getDirectorySync };
//# sourceMappingURL=getDirectory.d.ts.map

1
node_modules/cosmiconfig/dist/getDirectory.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"getDirectory.d.ts","sourceRoot":"","sources":["../src/getDirectory.ts"],"names":[],"mappings":"AAGA,iBAAe,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAU7D;AAED,iBAAS,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAUlD;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC"}

38
node_modules/cosmiconfig/dist/getDirectory.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDirectory = getDirectory;
exports.getDirectorySync = getDirectorySync;
var _path = _interopRequireDefault(require("path"));
var _pathType = require("path-type");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
async function getDirectory(filepath) {
const filePathIsDirectory = await (0, _pathType.isDirectory)(filepath);
if (filePathIsDirectory === true) {
return filepath;
}
const directory = _path.default.dirname(filepath);
return directory;
}
function getDirectorySync(filepath) {
const filePathIsDirectory = (0, _pathType.isDirectorySync)(filepath);
if (filePathIsDirectory === true) {
return filepath;
}
const directory = _path.default.dirname(filepath);
return directory;
}
//# sourceMappingURL=getDirectory.js.map

1
node_modules/cosmiconfig/dist/getDirectory.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"getDirectory.js","names":["getDirectory","filepath","filePathIsDirectory","isDirectory","directory","path","dirname","getDirectorySync","isDirectorySync"],"sources":["../src/getDirectory.ts"],"sourcesContent":["import path from 'path';\nimport { isDirectory, isDirectorySync } from 'path-type';\n\nasync function getDirectory(filepath: string): Promise<string> {\n const filePathIsDirectory = await isDirectory(filepath);\n\n if (filePathIsDirectory === true) {\n return filepath;\n }\n\n const directory = path.dirname(filepath);\n\n return directory;\n}\n\nfunction getDirectorySync(filepath: string): string {\n const filePathIsDirectory = isDirectorySync(filepath);\n\n if (filePathIsDirectory === true) {\n return filepath;\n }\n\n const directory = path.dirname(filepath);\n\n return directory;\n}\n\nexport { getDirectory, getDirectorySync };\n"],"mappings":";;;;;;;;AAAA;;AACA;;;;AAEA,eAAeA,YAAf,CAA4BC,QAA5B,EAA+D;EAC7D,MAAMC,mBAAmB,GAAG,MAAM,IAAAC,qBAAA,EAAYF,QAAZ,CAAlC;;EAEA,IAAIC,mBAAmB,KAAK,IAA5B,EAAkC;IAChC,OAAOD,QAAP;EACD;;EAED,MAAMG,SAAS,GAAGC,aAAA,CAAKC,OAAL,CAAaL,QAAb,CAAlB;;EAEA,OAAOG,SAAP;AACD;;AAED,SAASG,gBAAT,CAA0BN,QAA1B,EAAoD;EAClD,MAAMC,mBAAmB,GAAG,IAAAM,yBAAA,EAAgBP,QAAhB,CAA5B;;EAEA,IAAIC,mBAAmB,KAAK,IAA5B,EAAkC;IAChC,OAAOD,QAAP;EACD;;EAED,MAAMG,SAAS,GAAGC,aAAA,CAAKC,OAAL,CAAaL,QAAb,CAAlB;;EAEA,OAAOG,SAAP;AACD"}

5
node_modules/cosmiconfig/dist/getPropertyByPath.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
declare function getPropertyByPath(source: {
[key: string]: unknown;
}, path: string | Array<string>): unknown;
export { getPropertyByPath };
//# sourceMappingURL=getPropertyByPath.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getPropertyByPath.d.ts","sourceRoot":"","sources":["../src/getPropertyByPath.ts"],"names":[],"mappings":"AAKA,iBAAS,iBAAiB,CACxB,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAClC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAC3B,OAAO,CAgBT;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}

28
node_modules/cosmiconfig/dist/getPropertyByPath.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPropertyByPath = getPropertyByPath;
// Resolves property names or property paths defined with period-delimited
// strings or arrays of strings. Property names that are found on the source
// object are used directly (even if they include a period).
// Nested property names that include periods, within a path, are only
// understood in array paths.
function getPropertyByPath(source, path) {
if (typeof path === 'string' && Object.prototype.hasOwnProperty.call(source, path)) {
return source[path];
}
const parsedPath = typeof path === 'string' ? path.split('.') : path; // eslint-disable-next-line @typescript-eslint/no-explicit-any
return parsedPath.reduce((previous, key) => {
if (previous === undefined) {
return previous;
}
return previous[key];
}, source);
}
//# sourceMappingURL=getPropertyByPath.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"getPropertyByPath.js","names":["getPropertyByPath","source","path","Object","prototype","hasOwnProperty","call","parsedPath","split","reduce","previous","key","undefined"],"sources":["../src/getPropertyByPath.ts"],"sourcesContent":["// Resolves property names or property paths defined with period-delimited\n// strings or arrays of strings. Property names that are found on the source\n// object are used directly (even if they include a period).\n// Nested property names that include periods, within a path, are only\n// understood in array paths.\nfunction getPropertyByPath(\n source: { [key: string]: unknown },\n path: string | Array<string>,\n): unknown {\n if (\n typeof path === 'string' &&\n Object.prototype.hasOwnProperty.call(source, path)\n ) {\n return source[path];\n }\n\n const parsedPath = typeof path === 'string' ? path.split('.') : path;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return parsedPath.reduce((previous: any, key): unknown => {\n if (previous === undefined) {\n return previous;\n }\n return previous[key];\n }, source);\n}\n\nexport { getPropertyByPath };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,SAASA,iBAAT,CACEC,MADF,EAEEC,IAFF,EAGW;EACT,IACE,OAAOA,IAAP,KAAgB,QAAhB,IACAC,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCL,MAArC,EAA6CC,IAA7C,CAFF,EAGE;IACA,OAAOD,MAAM,CAACC,IAAD,CAAb;EACD;;EAED,MAAMK,UAAU,GAAG,OAAOL,IAAP,KAAgB,QAAhB,GAA2BA,IAAI,CAACM,KAAL,CAAW,GAAX,CAA3B,GAA6CN,IAAhE,CARS,CAST;;EACA,OAAOK,UAAU,CAACE,MAAX,CAAkB,CAACC,QAAD,EAAgBC,GAAhB,KAAiC;IACxD,IAAID,QAAQ,KAAKE,SAAjB,EAA4B;MAC1B,OAAOF,QAAP;IACD;;IACD,OAAOA,QAAQ,CAACC,GAAD,CAAf;EACD,CALM,EAKJV,MALI,CAAP;AAMD"}

6
node_modules/cosmiconfig/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
import { defaultLoaders, defaultLoadersSync, getDefaultSearchPlaces, getDefaultSearchPlacesSync, globalConfigSearchPlaces, globalConfigSearchPlacesSync } from './defaults';
import { CommonOptions, Config, CosmiconfigResult, Loader, LoaderResult, Loaders, LoadersSync, LoaderSync, Options, OptionsSync, PublicExplorer, PublicExplorerBase, PublicExplorerSync, SearchStrategy, Transform, TransformSync } from './types.js';
export declare function cosmiconfig(moduleName: string, options?: Readonly<Partial<Options>>): PublicExplorer;
export declare function cosmiconfigSync(moduleName: string, options?: Readonly<Partial<OptionsSync>>): PublicExplorerSync;
export { Config, CosmiconfigResult, LoaderResult, Loader, Loaders, LoaderSync, LoadersSync, Transform, TransformSync, SearchStrategy, CommonOptions, Options, OptionsSync, PublicExplorerBase, PublicExplorer, PublicExplorerSync, getDefaultSearchPlaces, getDefaultSearchPlacesSync, globalConfigSearchPlaces, globalConfigSearchPlacesSync, defaultLoaders, defaultLoadersSync, };
//# sourceMappingURL=index.d.ts.map

1
node_modules/cosmiconfig/dist/index.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAE1B,wBAAwB,EACxB,4BAA4B,EAC7B,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,aAAa,EACb,MAAM,EACN,iBAAiB,EAGjB,MAAM,EACN,YAAY,EACZ,OAAO,EACP,WAAW,EACX,UAAU,EACV,OAAO,EACP,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,SAAS,EACT,aAAa,EACd,MAAM,YAAY,CAAC;AAqKpB,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAM,GACvC,cAAc,CAUhB;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAM,GAC3C,kBAAkB,CAUpB;AAED,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,EACT,aAAa,EACb,cAAc,EACd,aAAa,EACb,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,cAAc,EACd,kBAAkB,GACnB,CAAC"}

148
node_modules/cosmiconfig/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,148 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultLoadersSync = exports.defaultLoaders = exports.globalConfigSearchPlacesSync = exports.globalConfigSearchPlaces = exports.getDefaultSearchPlacesSync = exports.getDefaultSearchPlaces = exports.cosmiconfigSync = exports.cosmiconfig = void 0;
const defaults_1 = require("./defaults");
Object.defineProperty(exports, "defaultLoaders", { enumerable: true, get: function () { return defaults_1.defaultLoaders; } });
Object.defineProperty(exports, "defaultLoadersSync", { enumerable: true, get: function () { return defaults_1.defaultLoadersSync; } });
Object.defineProperty(exports, "getDefaultSearchPlaces", { enumerable: true, get: function () { return defaults_1.getDefaultSearchPlaces; } });
Object.defineProperty(exports, "getDefaultSearchPlacesSync", { enumerable: true, get: function () { return defaults_1.getDefaultSearchPlacesSync; } });
Object.defineProperty(exports, "globalConfigSearchPlaces", { enumerable: true, get: function () { return defaults_1.globalConfigSearchPlaces; } });
Object.defineProperty(exports, "globalConfigSearchPlacesSync", { enumerable: true, get: function () { return defaults_1.globalConfigSearchPlacesSync; } });
const Explorer_js_1 = require("./Explorer.js");
const ExplorerSync_js_1 = require("./ExplorerSync.js");
const util_1 = require("./util");
const identity = function identity(x) {
return x;
};
function getUserDefinedOptionsFromMetaConfig() {
const metaExplorer = new ExplorerSync_js_1.ExplorerSync({
moduleName: 'cosmiconfig',
stopDir: process.cwd(),
searchPlaces: defaults_1.metaSearchPlaces,
ignoreEmptySearchPlaces: false,
applyPackagePropertyPathToConfiguration: true,
loaders: defaults_1.defaultLoaders,
transform: identity,
cache: true,
metaConfigFilePath: null,
mergeImportArrays: true,
mergeSearchPlaces: true,
searchStrategy: 'none',
});
const metaConfig = metaExplorer.search();
if (!metaConfig) {
return null;
}
if (metaConfig.config?.loaders) {
throw new Error('Can not specify loaders in meta config file');
}
if (metaConfig.config?.searchStrategy) {
throw new Error('Can not specify searchStrategy in meta config file');
}
const overrideOptions = {
mergeSearchPlaces: true,
...(metaConfig.config ?? {}),
};
return {
config: (0, util_1.removeUndefinedValuesFromObject)(overrideOptions),
filepath: metaConfig.filepath,
};
}
function getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions) {
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path) => path.replace('{name}', moduleName));
if (userConfiguredOptions.mergeSearchPlaces) {
return [...(userConfiguredSearchPlaces ?? []), ...toolDefinedSearchPlaces];
}
return (userConfiguredSearchPlaces ??
/* istanbul ignore next */ toolDefinedSearchPlaces);
}
function mergeOptionsBase(moduleName, defaults, options) {
const userDefinedConfig = getUserDefinedOptionsFromMetaConfig();
if (!userDefinedConfig) {
return {
...defaults,
...(0, util_1.removeUndefinedValuesFromObject)(options),
loaders: {
...defaults.loaders,
...options.loaders,
},
};
}
const userConfiguredOptions = userDefinedConfig.config;
const toolDefinedSearchPlaces = options.searchPlaces ?? defaults.searchPlaces;
return {
...defaults,
...(0, util_1.removeUndefinedValuesFromObject)(options),
metaConfigFilePath: userDefinedConfig.filepath,
...userConfiguredOptions,
searchPlaces: getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions),
loaders: {
...defaults.loaders,
...options.loaders,
},
};
}
function validateOptions(options) {
if (options.searchStrategy != null &&
options.searchStrategy !== 'global' &&
options.stopDir) {
throw new Error('Can not supply `stopDir` option with `searchStrategy` other than "global"');
}
}
function mergeOptions(moduleName, options) {
validateOptions(options);
const defaults = {
moduleName,
searchPlaces: (0, defaults_1.getDefaultSearchPlaces)(moduleName),
ignoreEmptySearchPlaces: true,
cache: true,
transform: identity,
loaders: defaults_1.defaultLoaders,
metaConfigFilePath: null,
mergeImportArrays: true,
mergeSearchPlaces: true,
searchStrategy: options.stopDir ? 'global' : 'none',
};
return mergeOptionsBase(moduleName, defaults, options);
}
function mergeOptionsSync(moduleName, options) {
validateOptions(options);
const defaults = {
moduleName,
searchPlaces: (0, defaults_1.getDefaultSearchPlacesSync)(moduleName),
ignoreEmptySearchPlaces: true,
cache: true,
transform: identity,
loaders: defaults_1.defaultLoadersSync,
metaConfigFilePath: null,
mergeImportArrays: true,
mergeSearchPlaces: true,
searchStrategy: options.stopDir ? 'global' : 'none',
};
return mergeOptionsBase(moduleName, defaults, options);
}
function cosmiconfig(moduleName, options = {}) {
const normalizedOptions = mergeOptions(moduleName, options);
const explorer = new Explorer_js_1.Explorer(normalizedOptions);
return {
search: explorer.search.bind(explorer),
load: explorer.load.bind(explorer),
clearLoadCache: explorer.clearLoadCache.bind(explorer),
clearSearchCache: explorer.clearSearchCache.bind(explorer),
clearCaches: explorer.clearCaches.bind(explorer),
};
}
exports.cosmiconfig = cosmiconfig;
function cosmiconfigSync(moduleName, options = {}) {
const normalizedOptions = mergeOptionsSync(moduleName, options);
const explorerSync = new ExplorerSync_js_1.ExplorerSync(normalizedOptions);
return {
search: explorerSync.search.bind(explorerSync),
load: explorerSync.load.bind(explorerSync),
clearLoadCache: explorerSync.clearLoadCache.bind(explorerSync),
clearSearchCache: explorerSync.clearSearchCache.bind(explorerSync),
clearCaches: explorerSync.clearCaches.bind(explorerSync),
};
}
exports.cosmiconfigSync = cosmiconfigSync;
//# sourceMappingURL=index.js.map

1
node_modules/cosmiconfig/dist/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAQoB;AA8OlB,+FArPA,yBAAc,OAqPA;AACd,mGArPA,6BAAkB,OAqPA;AALlB,uGA/OA,iCAAsB,OA+OA;AACtB,2GA/OA,qCAA0B,OA+OA;AAC1B,yGA9OA,mCAAwB,OA8OA;AACxB,6GA9OA,uCAA4B,OA8OA;AA5O9B,+CAAyC;AACzC,uDAAiD;AAqBjD,iCAAyD;AAEzD,MAAM,QAAQ,GAAkB,SAAS,QAAQ,CAAC,CAAC;IACjD,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,SAAS,mCAAmC;IAC1C,MAAM,YAAY,GAAG,IAAI,8BAAY,CAAC;QACpC,UAAU,EAAE,aAAa;QACzB,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;QACtB,YAAY,EAAE,2BAAgB;QAC9B,uBAAuB,EAAE,KAAK;QAC9B,uCAAuC,EAAE,IAAI;QAC7C,OAAO,EAAE,yBAAc;QACvB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,IAAI;QACX,kBAAkB,EAAE,IAAI;QACxB,iBAAiB,EAAE,IAAI;QACvB,iBAAiB,EAAE,IAAI;QACvB,cAAc,EAAE,MAAM;KACvB,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;IAEzC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,IAAI,CAAC;KACb;IAED,IAAI,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE;QAC9B,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;KAChE;IAED,IAAI,UAAU,CAAC,MAAM,EAAE,cAAc,EAAE;QACrC,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;KACvE;IAED,MAAM,eAAe,GAAmC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CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC;QAClE,WAAW,EAAE,YAAY,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC;KACzD,CAAC;AACJ,CAAC;AAbD,0CAaC"}

8
node_modules/cosmiconfig/dist/loaders.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
import { Loader, LoaderSync } from './types.js';
export declare const loadJsSync: LoaderSync;
export declare const loadJs: Loader;
export declare const loadJson: LoaderSync;
export declare const loadYaml: LoaderSync;
export declare const loadTsSync: LoaderSync;
export declare const loadTs: Loader;
//# sourceMappingURL=loaders.d.ts.map

1
node_modules/cosmiconfig/dist/loaders.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"loaders.d.ts","sourceRoot":"","sources":["../src/loaders.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGhD,eAAO,MAAM,UAAU,EAAE,UAMxB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,MAqBpB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,UAWtB,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,UAWtB,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,UA0BxB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,MAgCpB,CAAC"}

148
node_modules/cosmiconfig/dist/loaders.js generated vendored Normal file
View File

@@ -0,0 +1,148 @@
"use strict";
/* eslint-disable @typescript-eslint/no-require-imports */
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadTs = exports.loadTsSync = exports.loadYaml = exports.loadJson = exports.loadJs = exports.loadJsSync = void 0;
const fs_1 = require("fs");
const promises_1 = require("fs/promises");
const path_1 = __importDefault(require("path"));
const url_1 = require("url");
let importFresh;
const loadJsSync = function loadJsSync(filepath) {
if (importFresh === undefined) {
importFresh = require('import-fresh');
}
return importFresh(filepath);
};
exports.loadJsSync = loadJsSync;
const loadJs = async function loadJs(filepath) {
try {
const { href } = (0, url_1.pathToFileURL)(filepath);
return (await import(href)).default;
}
catch (error) {
try {
return (0, exports.loadJsSync)(filepath, '');
}
catch (requireError) {
if (requireError.code === 'ERR_REQUIRE_ESM' ||
(requireError instanceof SyntaxError &&
requireError
.toString()
.includes('Cannot use import statement outside a module'))) {
throw error;
}
throw requireError;
}
}
};
exports.loadJs = loadJs;
let parseJson;
const loadJson = function loadJson(filepath, content) {
if (parseJson === undefined) {
parseJson = require('parse-json');
}
try {
return parseJson(content);
}
catch (error) {
error.message = `JSON Error in ${filepath}:\n${error.message}`;
throw error;
}
};
exports.loadJson = loadJson;
let yaml;
const loadYaml = function loadYaml(filepath, content) {
if (yaml === undefined) {
yaml = require('js-yaml');
}
try {
return yaml.load(content);
}
catch (error) {
error.message = `YAML Error in ${filepath}:\n${error.message}`;
throw error;
}
};
exports.loadYaml = loadYaml;
let typescript;
const loadTsSync = function loadTsSync(filepath, content) {
/* istanbul ignore next -- @preserve */
if (typescript === undefined) {
typescript = require('typescript');
}
const compiledFilepath = `${filepath.slice(0, -2)}cjs`;
try {
const config = resolveTsConfig(path_1.default.dirname(filepath)) ?? {};
config.compilerOptions = {
...config.compilerOptions,
module: typescript.ModuleKind.NodeNext,
moduleResolution: typescript.ModuleResolutionKind.NodeNext,
target: typescript.ScriptTarget.ES2022,
noEmit: false,
};
content = typescript.transpileModule(content, config).outputText;
(0, fs_1.writeFileSync)(compiledFilepath, content);
return (0, exports.loadJsSync)(compiledFilepath, content).default;
}
catch (error) {
error.message = `TypeScript Error in ${filepath}:\n${error.message}`;
throw error;
}
finally {
if ((0, fs_1.existsSync)(compiledFilepath)) {
(0, fs_1.rmSync)(compiledFilepath);
}
}
};
exports.loadTsSync = loadTsSync;
const loadTs = async function loadTs(filepath, content) {
if (typescript === undefined) {
typescript = (await import('typescript')).default;
}
const compiledFilepath = `${filepath.slice(0, -2)}mjs`;
let transpiledContent;
try {
try {
const config = resolveTsConfig(path_1.default.dirname(filepath)) ?? {};
config.compilerOptions = {
...config.compilerOptions,
module: typescript.ModuleKind.ES2022,
moduleResolution: typescript.ModuleResolutionKind.Bundler,
target: typescript.ScriptTarget.ES2022,
noEmit: false,
};
transpiledContent = typescript.transpileModule(content, config).outputText;
await (0, promises_1.writeFile)(compiledFilepath, transpiledContent);
}
catch (error) {
error.message = `TypeScript Error in ${filepath}:\n${error.message}`;
throw error;
}
// eslint-disable-next-line @typescript-eslint/return-await
return await (0, exports.loadJs)(compiledFilepath, transpiledContent);
}
finally {
if ((0, fs_1.existsSync)(compiledFilepath)) {
await (0, promises_1.rm)(compiledFilepath);
}
}
};
exports.loadTs = loadTs;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function resolveTsConfig(directory) {
const filePath = typescript.findConfigFile(directory, (fileName) => {
return typescript.sys.fileExists(fileName);
});
if (filePath !== undefined) {
const { config, error } = typescript.readConfigFile(filePath, (path) => typescript.sys.readFile(path));
if (error) {
throw new Error(`Error in ${filePath}: ${error.messageText.toString()}`);
}
return config;
}
return;
}
//# sourceMappingURL=loaders.js.map

1
node_modules/cosmiconfig/dist/loaders.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"loaders.js","sourceRoot":"","sources":["../src/loaders.ts"],"names":[],"mappings":";AAAA,0DAA0D;;;;;;AAE1D,2BAAuD;AACvD,0CAA4C;AAC5C,gDAAwB;AACxB,6BAAoC;AAGpC,IAAI,WAA0C,CAAC;AACxC,MAAM,UAAU,GAAe,SAAS,UAAU,CAAC,QAAQ;IAChE,IAAI,WAAW,KAAK,SAAS,EAAE;QAC7B,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;KACvC;IAED,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC,CAAC;AANW,QAAA,UAAU,cAMrB;AAEK,MAAM,MAAM,GAAW,KAAK,UAAU,MAAM,CA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C,MAAM,IAAA,aAAE,EAAC,gBAAgB,CAAC,CAAC;SAC5B;KACF;AACH,CAAC,CAAC;AAhCW,QAAA,MAAM,UAgCjB;AAEF,8DAA8D;AAC9D,SAAS,eAAe,CAAC,SAAiB;IACxC,MAAM,QAAQ,GAAG,UAAU,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,EAAE;QACjE,OAAO,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,IAAI,QAAQ,KAAK,SAAS,EAAE;QAC1B,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CACrE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAC9B,CAAC;QACF,IAAI,KAAK,EAAE;YACT,MAAM,IAAI,KAAK,CAAC,YAAY,QAAQ,KAAK,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;SAC1E;QACD,OAAO,MAAM,CAAC;KACf;IACD,OAAO;AACT,CAAC"}

9
node_modules/cosmiconfig/dist/merge.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
export declare const hasOwn: (thisArg: any, ...argArray: any[]) => any;
export interface MergeOptions {
mergeArrays: boolean;
}
/**
* Merges multiple objects. Doesn't care about cloning non-primitives, as we load all these objects fresh from a file.
*/
export declare function mergeAll(objects: ReadonlyArray<any>, options: MergeOptions): any;
//# sourceMappingURL=merge.d.ts.map

1
node_modules/cosmiconfig/dist/merge.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../src/merge.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,MAAM,2CAElB,CAAC;AASF,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,OAAO,CAAC;CACtB;AAuBD;;GAEG;AACH,wBAAgB,QAAQ,CAEtB,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,EAC3B,OAAO,EAAE,YAAY,GAEpB,GAAG,CAEL"}

40
node_modules/cosmiconfig/dist/merge.js generated vendored Normal file
View File

@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeAll = exports.hasOwn = void 0;
/* eslint-disable @typescript-eslint/unbound-method */
exports.hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
const objToString = Function.prototype.call.bind(Object.prototype.toString);
/* eslint-enable @typescript-eslint/unbound-method */
function isPlainObject(obj) {
return objToString(obj) === '[object Object]';
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function merge(target, source, options) {
for (const key of Object.keys(source)) {
const newValue = source[key];
if ((0, exports.hasOwn)(target, key)) {
if (Array.isArray(target[key]) && Array.isArray(newValue)) {
if (options.mergeArrays) {
target[key].push(...newValue);
continue;
}
}
else if (isPlainObject(target[key]) && isPlainObject(newValue)) {
target[key] = merge(target[key], newValue, options);
continue;
}
}
target[key] = newValue;
}
return target;
}
/**
* Merges multiple objects. Doesn't care about cloning non-primitives, as we load all these objects fresh from a file.
*/
function mergeAll(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
objects, options) {
return objects.reduce((target, source) => merge(target, source, options), {});
}
exports.mergeAll = mergeAll;
//# sourceMappingURL=merge.js.map

1
node_modules/cosmiconfig/dist/merge.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../src/merge.ts"],"names":[],"mappings":";;;AAAA,sDAAsD;AACzC,QAAA,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAChD,MAAM,CAAC,SAAS,CAAC,cAAc,CAChC,CAAC;AACF,MAAM,WAAW,GAAG,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE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normal file
View File

@@ -0,0 +1,7 @@
interface Options {
throwNotFound?: boolean;
}
declare function readFile(filepath: string, options?: Options): Promise<string | null>;
declare function readFileSync(filepath: string, options?: Options): string | null;
export { readFile, readFileSync };
//# sourceMappingURL=readFile.d.ts.map

1
node_modules/cosmiconfig/dist/readFile.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"readFile.d.ts","sourceRoot":"","sources":["../src/readFile.ts"],"names":[],"mappings":"AAkBA,UAAU,OAAO;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,iBAAe,QAAQ,CACrB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,OAAY,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiBxB;AAED,iBAAS,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,GAAG,MAAM,GAAG,IAAI,CAiB5E;AAED,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC"}

56
node_modules/cosmiconfig/dist/readFile.js generated vendored Normal file
View File

@@ -0,0 +1,56 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.readFile = readFile;
exports.readFileSync = readFileSync;
var _fs = _interopRequireDefault(require("fs"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
async function fsReadFileAsync(pathname, encoding) {
return new Promise((resolve, reject) => {
_fs.default.readFile(pathname, encoding, (error, contents) => {
if (error) {
reject(error);
return;
}
resolve(contents);
});
});
}
async function readFile(filepath, options = {}) {
const throwNotFound = options.throwNotFound === true;
try {
const content = await fsReadFileAsync(filepath, 'utf8');
return content;
} catch (error) {
if (throwNotFound === false && (error.code === 'ENOENT' || error.code === 'EISDIR')) {
return null;
}
throw error;
}
}
function readFileSync(filepath, options = {}) {
const throwNotFound = options.throwNotFound === true;
try {
const content = _fs.default.readFileSync(filepath, 'utf8');
return content;
} catch (error) {
if (throwNotFound === false && (error.code === 'ENOENT' || error.code === 'EISDIR')) {
return null;
}
throw error;
}
}
//# sourceMappingURL=readFile.js.map

1
node_modules/cosmiconfig/dist/readFile.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"readFile.js","names":["fsReadFileAsync","pathname","encoding","Promise","resolve","reject","fs","readFile","error","contents","filepath","options","throwNotFound","content","code","readFileSync"],"sources":["../src/readFile.ts"],"sourcesContent":["import fs from 'fs';\n\nasync function fsReadFileAsync(\n pathname: string,\n encoding: BufferEncoding,\n): Promise<string> {\n return new Promise((resolve, reject): void => {\n fs.readFile(pathname, encoding, (error, contents): void => {\n if (error) {\n reject(error);\n return;\n }\n\n resolve(contents);\n });\n });\n}\n\ninterface Options {\n throwNotFound?: boolean;\n}\n\nasync function readFile(\n filepath: string,\n options: Options = {},\n): Promise<string | null> {\n const throwNotFound = options.throwNotFound === true;\n\n try {\n const content = await fsReadFileAsync(filepath, 'utf8');\n\n return content;\n } catch (error: any) {\n if (\n throwNotFound === false &&\n (error.code === 'ENOENT' || error.code === 'EISDIR')\n ) {\n return null;\n }\n\n throw error;\n }\n}\n\nfunction readFileSync(filepath: string, options: Options = {}): string | null {\n const throwNotFound = options.throwNotFound === true;\n\n try {\n const content = fs.readFileSync(filepath, 'utf8');\n\n return content;\n } catch (error: any) {\n if (\n throwNotFound === false &&\n (error.code === 'ENOENT' || error.code === 'EISDIR')\n ) {\n return null;\n }\n\n throw error;\n }\n}\n\nexport { readFile, readFileSync };\n"],"mappings":";;;;;;;;AAAA;;;;AAEA,eAAeA,eAAf,CACEC,QADF,EAEEC,QAFF,EAGmB;EACjB,OAAO,IAAIC,OAAJ,CAAY,CAACC,OAAD,EAAUC,MAAV,KAA2B;IAC5CC,WAAA,CAAGC,QAAH,CAAYN,QAAZ,EAAsBC,QAAtB,EAAgC,CAACM,KAAD,EAAQC,QAAR,KAA2B;MACzD,IAAID,KAAJ,EAAW;QACTH,MAAM,CAACG,KAAD,CAAN;QACA;MACD;;MAEDJ,OAAO,CAACK,QAAD,CAAP;IACD,CAPD;EAQD,CATM,CAAP;AAUD;;AAMD,eAAeF,QAAf,CACEG,QADF,EAEEC,OAAgB,GAAG,EAFrB,EAG0B;EACxB,MAAMC,aAAa,GAAGD,OAAO,CAACC,aAAR,KAA0B,IAAhD;;EAEA,IAAI;IACF,MAAMC,OAAO,GAAG,MAAMb,eAAe,CAACU,QAAD,EAAW,MAAX,CAArC;IAEA,OAAOG,OAAP;EACD,CAJD,CAIE,OAAOL,KAAP,EAAmB;IACnB,IACEI,aAAa,KAAK,KAAlB,KACCJ,KAAK,CAACM,IAAN,KAAe,QAAf,IAA2BN,KAAK,CAACM,IAAN,KAAe,QAD3C,CADF,EAGE;MACA,OAAO,IAAP;IACD;;IAED,MAAMN,KAAN;EACD;AACF;;AAED,SAASO,YAAT,CAAsBL,QAAtB,EAAwCC,OAAgB,GAAG,EAA3D,EAA8E;EAC5E,MAAMC,aAAa,GAAGD,OAAO,CAACC,aAAR,KAA0B,IAAhD;;EAEA,IAAI;IACF,MAAMC,OAAO,GAAGP,WAAA,CAAGS,YAAH,CAAgBL,QAAhB,EAA0B,MAA1B,CAAhB;;IAEA,OAAOG,OAAP;EACD,CAJD,CAIE,OAAOL,KAAP,EAAmB;IACnB,IACEI,aAAa,KAAK,KAAlB,KACCJ,KAAK,CAACM,IAAN,KAAe,QAAf,IAA2BN,KAAK,CAACM,IAAN,KAAe,QAD3C,CADF,EAGE;MACA,OAAO,IAAP;IACD;;IAED,MAAMN,KAAN;EACD;AACF"}

98
node_modules/cosmiconfig/dist/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,98 @@
/**
* @public
*/
export type Config = any;
/**
* @public
*/
export type CosmiconfigResult = {
config: Config;
filepath: string;
isEmpty?: boolean;
} | null;
/**
* @public
*/
export type LoaderResult = Config | null;
/**
* @public
*/
export type Loader = ((filepath: string, content: string) => Promise<LoaderResult>) | LoaderSync;
/**
* @public
*/
export type LoaderSync = (filepath: string, content: string) => LoaderResult;
/**
* @public
*/
export type Transform = ((CosmiconfigResult: CosmiconfigResult) => Promise<CosmiconfigResult>) | TransformSync;
/**
* @public
*/
export type TransformSync = (CosmiconfigResult: CosmiconfigResult) => CosmiconfigResult;
/**
* @public
*/
export type SearchStrategy = 'none' | 'project' | 'global';
/**
* @public
*/
export interface CommonOptions {
packageProp?: string | Array<string>;
searchPlaces: Array<string>;
ignoreEmptySearchPlaces: boolean;
stopDir?: string;
cache: boolean;
mergeImportArrays: boolean;
mergeSearchPlaces: boolean;
searchStrategy: SearchStrategy;
}
/**
* @public
*/
export interface Options extends CommonOptions {
loaders: Loaders;
transform: Transform;
}
/**
* @public
*/
export interface OptionsSync extends CommonOptions {
loaders: LoadersSync;
transform: TransformSync;
}
/**
* @public
*/
export interface Loaders {
[key: string]: Loader;
}
/**
* @public
*/
export interface LoadersSync {
[key: string]: LoaderSync;
}
/**
* @public
*/
export interface PublicExplorerBase {
clearLoadCache: () => void;
clearSearchCache: () => void;
clearCaches: () => void;
}
/**
* @public
*/
export interface PublicExplorer extends PublicExplorerBase {
search: (searchFrom?: string) => Promise<CosmiconfigResult>;
load: (filepath: string) => Promise<CosmiconfigResult>;
}
/**
* @public
*/
export interface PublicExplorerSync extends PublicExplorerBase {
search: (searchFrom?: string) => CosmiconfigResult;
load: (filepath: string) => CosmiconfigResult;
}
//# sourceMappingURL=types.d.ts.map

1
node_modules/cosmiconfig/dist/types.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,MAAM,GAAG,GAAG,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAAC;AAET;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAA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,MAAM,GAAG,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC5D,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACxD;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D,MAAM,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,iBAAiB,CAAC;IACnD,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,iBAAiB,CAAC;CAC/C"}

3
node_modules/cosmiconfig/dist/types.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

1
node_modules/cosmiconfig/dist/types.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}

2
node_modules/cosmiconfig/dist/util.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=util.d.ts.map

1
node_modules/cosmiconfig/dist/util.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":""}

99
node_modules/cosmiconfig/dist/util.js generated vendored Normal file
View File

@@ -0,0 +1,99 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDirectorySync = exports.isDirectory = exports.removeUndefinedValuesFromObject = exports.getPropertyByPath = exports.emplace = void 0;
const fs_1 = __importStar(require("fs"));
/**
* @internal
*/
function emplace(map, key, fn) {
const cached = map.get(key);
if (cached !== undefined) {
return cached;
}
const result = fn();
map.set(key, result);
return result;
}
exports.emplace = emplace;
// Resolves property names or property paths defined with period-delimited
// strings or arrays of strings. Property names that are found on the source
// object are used directly (even if they include a period).
// Nested property names that include periods, within a path, are only
// understood in array paths.
/**
* @internal
*/
function getPropertyByPath(source, path) {
if (typeof path === 'string' &&
Object.prototype.hasOwnProperty.call(source, path)) {
return source[path];
}
const parsedPath = typeof path === 'string' ? path.split('.') : path;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return parsedPath.reduce((previous, key) => {
if (previous === undefined) {
return previous;
}
return previous[key];
}, source);
}
exports.getPropertyByPath = getPropertyByPath;
/** @internal */
function removeUndefinedValuesFromObject(options) {
return Object.fromEntries(Object.entries(options).filter(([, value]) => value !== undefined));
}
exports.removeUndefinedValuesFromObject = removeUndefinedValuesFromObject;
/** @internal */
/* istanbul ignore next -- @preserve */
async function isDirectory(path) {
try {
const stat = await fs_1.promises.stat(path);
return stat.isDirectory();
}
catch (e) {
if (e.code === 'ENOENT') {
return false;
}
throw e;
}
}
exports.isDirectory = isDirectory;
/** @internal */
/* istanbul ignore next -- @preserve */
function isDirectorySync(path) {
try {
const stat = fs_1.default.statSync(path);
return stat.isDirectory();
}
catch (e) {
if (e.code === 'ENOENT') {
return false;
}
throw e;
}
}
exports.isDirectorySync = isDirectorySync;
//# sourceMappingURL=util.js.map

1
node_modules/cosmiconfig/dist/util.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAyC;AAEzC;;GAEG;AACH,SAAgB,OAAO,CAAO,GAAc,EAAE,GAAM,EAAE,EAAW;IAC/D,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,MAAM,CAAC;KACf;IACD,MAAM,MAAM,GAAG,EAAE,EAAE,CAAC;IACpB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACrB,OAAO,MAAM,CAAC;AAChB,CAAC;AARD,0BAQC;AAED,0EAA0E;AAC1E,4EAA4E;AAC5E,4DAA4D;AAC5D,sEAAsE;AACtE,6BAA6B;AAC7B;;GAEG;AACH,SAAgB,iBAAiB,CAC/B,MAAkC,EAClC,IAA4B;IAE5B,IACE,OAAO,IAAI,KAAK,QAAQ;QACxB,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAClD;QACA,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;KACrB;IAED,MAAM,UAAU,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAA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