PHP 8.2.30
Preview: index.js Size: 2.93 KB
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/cosmiconfig/dist/index.js

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.cosmiconfig = cosmiconfig;
exports.cosmiconfigSync = cosmiconfigSync;
exports.defaultLoaders = void 0;

var _os = _interopRequireDefault(require("os"));

var _Explorer = require("./Explorer");

var _ExplorerSync = require("./ExplorerSync");

var _loaders = require("./loaders");

var _types = require("./types");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
function cosmiconfig(moduleName, options = {}) {
  const normalizedOptions = normalizeOptions(moduleName, options);
  const explorer = new _Explorer.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)
  };
} // eslint-disable-next-line @typescript-eslint/explicit-function-return-type


function cosmiconfigSync(moduleName, options = {}) {
  const normalizedOptions = normalizeOptions(moduleName, options);
  const explorerSync = new _ExplorerSync.ExplorerSync(normalizedOptions);
  return {
    search: explorerSync.searchSync.bind(explorerSync),
    load: explorerSync.loadSync.bind(explorerSync),
    clearLoadCache: explorerSync.clearLoadCache.bind(explorerSync),
    clearSearchCache: explorerSync.clearSearchCache.bind(explorerSync),
    clearCaches: explorerSync.clearCaches.bind(explorerSync)
  };
} // do not allow mutation of default loaders. Make sure it is set inside options


const defaultLoaders = Object.freeze({
  '.cjs': _loaders.loaders.loadJs,
  '.js': _loaders.loaders.loadJs,
  '.json': _loaders.loaders.loadJson,
  '.yaml': _loaders.loaders.loadYaml,
  '.yml': _loaders.loaders.loadYaml,
  noExt: _loaders.loaders.loadYaml
});
exports.defaultLoaders = defaultLoaders;

const identity = function identity(x) {
  return x;
};

function normalizeOptions(moduleName, options) {
  const defaults = {
    packageProp: moduleName,
    searchPlaces: ['package.json', `.${moduleName}rc`, `.${moduleName}rc.json`, `.${moduleName}rc.yaml`, `.${moduleName}rc.yml`, `.${moduleName}rc.js`, `.${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.cjs`, `${moduleName}.config.js`, `${moduleName}.config.cjs`],
    ignoreEmptySearchPlaces: true,
    stopDir: _os.default.homedir(),
    cache: true,
    transform: identity,
    loaders: defaultLoaders
  };
  const normalizedOptions = { ...defaults,
    ...options,
    loaders: { ...defaults.loaders,
      ...options.loaders
    }
  };
  return normalizedOptions;
}
//# sourceMappingURL=index.js.map

Directory Contents

Dirs: 0 × Files: 40

Name Size Perms Modified Actions
371 B lrw-r--r-- 2026-02-28 00:28:50
Edit Download
450 B lrw-r--r-- 2026-02-28 00:28:08
Edit Download
612 B lrw-r--r-- 2026-02-28 00:26:44
Edit Download
1.43 KB lrw-r--r-- 2026-02-28 00:28:12
Edit Download
550 B lrw-r--r-- 2026-02-28 00:28:52
Edit Download
480 B lrw-r--r-- 2026-02-28 00:28:16
Edit Download
3.08 KB lrw-r--r-- 2026-02-28 00:26:54
Edit Download
6.56 KB lrw-r--r-- 2026-02-28 00:28:20
Edit Download
1.07 KB lrw-r--r-- 2026-02-28 00:28:54
Edit Download
1004 B lrw-r--r-- 2026-02-28 00:28:24
Edit Download
3.36 KB lrw-r--r-- 2026-02-28 00:27:04
Edit Download
7.35 KB lrw-r--r-- 2026-02-28 00:28:26
Edit Download
584 B lrw-r--r-- 2026-02-28 00:28:56
Edit Download
524 B lrw-r--r-- 2026-02-28 00:28:28
Edit Download
3.06 KB lrw-r--r-- 2026-02-28 00:27:14
Edit Download
6.43 KB lrw-r--r-- 2026-02-28 00:28:28
Edit Download
212 B lrw-r--r-- 2026-02-28 00:28:58
Edit Download
280 B lrw-r--r-- 2026-02-28 00:28:28
Edit Download
900 B lrw-r--r-- 2026-02-28 00:27:24
Edit Download
1.29 KB lrw-r--r-- 2026-02-28 00:28:30
Edit Download
193 B lrw-r--r-- 2026-02-28 00:28:58
Edit Download
301 B lrw-r--r-- 2026-02-28 00:28:32
Edit Download
938 B lrw-r--r-- 2026-02-28 00:27:32
Edit Download
1.67 KB lrw-r--r-- 2026-02-28 00:28:34
Edit Download
1.88 KB lrw-r--r-- 2026-02-28 00:28:58
Edit Download
1.18 KB lrw-r--r-- 2026-02-28 00:28:36
Edit Download
2.93 KB lrw-r--r-- 2026-02-28 00:27:38
Edit Download
6.87 KB lrw-r--r-- 2026-02-28 00:28:38
Edit Download
132 B lrw-r--r-- 2026-02-28 00:28:58
Edit Download
216 B lrw-r--r-- 2026-02-28 00:28:38
Edit Download
1.13 KB lrw-r--r-- 2026-02-28 00:27:44
Edit Download
2.68 KB lrw-r--r-- 2026-02-28 00:28:40
Edit Download
295 B lrw-r--r-- 2026-02-28 00:29:00
Edit Download
385 B lrw-r--r-- 2026-02-28 00:28:42
Edit Download
1.29 KB lrw-r--r-- 2026-02-28 00:27:52
Edit Download
2.62 KB lrw-r--r-- 2026-02-28 00:28:42
Edit Download
635 B lrw-r--r-- 2026-02-28 00:29:00
Edit Download
684 B lrw-r--r-- 2026-02-28 00:28:44
Edit Download
113 B lrw-r--r-- 2026-02-28 00:28:00
Edit Download
89 B lrw-r--r-- 2026-02-28 00:28:46
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).