Only use keys from settings.json to create documentation files, fix array concat only for routes in extensions

This commit is contained in:
Alexandre Bodin 2019-06-14 23:07:04 +02:00
parent 8bc172d535
commit c5dc672cc7
2 changed files with 394 additions and 155 deletions

View File

@ -266,8 +266,9 @@ class Strapi extends EventEmitter {
* Handle plugin extensions
*/
// merge extensions config folders
_.mergeWith(this.plugins, extensions.merges, (objValue, srcValue) => {
if (_.isArray(srcValue) && _.isArray(objValue)) {
_.mergeWith(this.plugins, extensions.merges, (objValue, srcValue, key) => {
// concat routes
if (_.isArray(srcValue) && _.isArray(objValue) && key === 'routes') {
return srcValue.concat(objValue);
}
});