mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
e10e71cc26
no issue - The folder was overseen to be added to lint rules after it has been extracted out of /server
14 lines
422 B
JavaScript
14 lines
422 B
JavaScript
var _ = require('lodash'),
|
|
defaultConfig = require('./defaults'),
|
|
allowedKeys = ['posts_per_page', 'image_sizes'];
|
|
|
|
module.exports.create = function configLoader(packageJson) {
|
|
var config = _.cloneDeep(defaultConfig);
|
|
|
|
if (packageJson && Object.prototype.hasOwnProperty.call(packageJson, 'config')) {
|
|
config = _.assign(config, _.pick(packageJson.config, allowedKeys));
|
|
}
|
|
|
|
return config;
|
|
};
|