mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
c687df21e1
refs: bf0823c9a2
- continuing the work of splitting up the theme service into logical components
14 lines
428 B
JavaScript
14 lines
428 B
JavaScript
const _ = require('lodash');
|
|
const defaultConfig = require('./defaults');
|
|
const allowedKeys = ['posts_per_page', 'image_sizes'];
|
|
|
|
module.exports.create = function configLoader(packageJson) {
|
|
let config = _.cloneDeep(defaultConfig);
|
|
|
|
if (packageJson && Object.prototype.hasOwnProperty.call(packageJson, 'config')) {
|
|
config = _.assign(config, _.pick(packageJson.config, allowedKeys));
|
|
}
|
|
|
|
return config;
|
|
};
|