"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const default_resolver_1 = require("@pnpm/default-resolver");
const fetch_1 = require("@pnpm/fetch");
const git_fetcher_1 = require("@pnpm/git-fetcher");
const tarball_fetcher_1 = require("@pnpm/tarball-fetcher");
const getCredentialsByURI = require("credentials-by-uri");
const mem = require("mem");
function default_1(opts) {
    const fetchFromRegistry = fetch_1.createFetchFromRegistry(opts);
    const getCredentials = mem((registry) => getCredentialsByURI(opts.authConfig, registry));
    return {
        fetchers: createFetchers(fetchFromRegistry, getCredentials, opts),
        resolve: default_resolver_1.default(fetchFromRegistry, getCredentials, opts),
    };
}
exports.default = default_1;
function createFetchers(fetchFromRegistry, getCredentials, opts) {
    return {
        ...tarball_fetcher_1.default(fetchFromRegistry, getCredentials, opts),
        ...git_fetcher_1.default(),
    };
}
//# sourceMappingURL=index.js.map