tona-db-mini
Version:
Tona-DB mini is a JavaScript library for simulating small local databases in JSON.
17 lines (16 loc) • 649 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeDefaultConfig = mergeDefaultConfig;
const schema_1 = require("./schema");
/**
* Merges the user's configuration file with the default configuration.
* If the file does not exist, the default configuration is used.
* @param config The user's configuration
* @returns {NonNullable<Required<Config>>} The complete configuration with defaults applied.
*/
function mergeDefaultConfig(config) {
return {
baseDir: config.baseDir ?? schema_1.defaultConfig.baseDir,
prettyJson: config.prettyJson ?? schema_1.defaultConfig.prettyJson,
};
}