"use strict";
const constantDefaults_1 = require('./constantDefaults');
const env_1 = require('../env');
const defaults = () => ({
    fetchRetries: 2,
    fetchRetryFactor: 10,
    fetchRetryMintimeout: 1e4,
    fetchRetryMaxtimeout: 6e4,
    storePath: getDefaultStorePath(),
    globalPath: constantDefaults_1.GlobalPath,
    logger: 'pretty',
    ignoreScripts: false,
    linkLocal: false,
    strictSsl: true,
    tag: 'latest',
    production: process.env.NODE_ENV === 'production',
    cwd: process.cwd(),
    nodeVersion: process.version,
    force: false,
    silent: true,
    depth: 0,
    cacheTTL: 60 * 60 * 24,
    flatTree: false,
    engineStrict: false,
});
function getDefaultStorePath() {
    if (env_1.preserveSymlinks)
        return constantDefaults_1.GlobalStorePath;
    return 'node_modules/.store';
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (opts) => {
    opts = opts || {};
    if (opts.flatTree === true && !env_1.preserveSymlinks) {
        throw new Error('`--preserve-symlinks` and so `--flat-tree` are not supported on your system, make sure you are running on Node ≽ 6.3.0');
    }
    return Object.assign({}, defaults(), opts);
};
//# sourceMappingURL=extendOptions.js.map