mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-20 22:52:46 -05:00
a828271d63
* refactor: download manifest endpoint and integrate fastify * fix file not found issue * add temporary migration method to storage memory * sanitize fs methods * restore tests * chore: restore sanitilize will do later * add tests * add changeset * lint * trying something test * chore: lint * restore code * fix e2e * fix lint
26 lines
752 B
TypeScript
26 lines
752 B
TypeScript
import buildDebug from 'debug';
|
|
import _ from 'lodash';
|
|
import path from 'path';
|
|
|
|
import { parseConfigFile } from '@verdaccio/config';
|
|
|
|
const debug = buildDebug('verdaccio:mock:config');
|
|
|
|
/**
|
|
* Override the default.yaml configuration file with any new config provided.
|
|
*/
|
|
function configExample(
|
|
externalConfig = {},
|
|
configFile: string = 'default.yaml',
|
|
location: string = ''
|
|
) {
|
|
const locationFile = location
|
|
? path.join(location, configFile)
|
|
: path.join(__dirname, `./config/yaml/${configFile}`);
|
|
debug('config location: %s', locationFile);
|
|
const config = parseConfigFile(locationFile);
|
|
debug('config file: %o', JSON.stringify(config));
|
|
return _.assign({}, _.cloneDeep(config), externalConfig);
|
|
}
|
|
|
|
export { configExample };
|