mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 10:23:34 +00:00
Add comments
Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
parent
d7fffe9742
commit
1763c66e23
@ -330,10 +330,19 @@ const hasCustomAdminCode = async dir => {
|
||||
return hasCustomConfigFile || hasCustomWebpackFile;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if the project's installed plugins are not the same as a default one.
|
||||
* @param {Object} plugins
|
||||
* @returns {boolean}
|
||||
*/
|
||||
const hasNonDefaultPlugins = plugins => {
|
||||
const diff = Object.keys(plugins)
|
||||
.filter(x => !DEFAULT_PLUGINS.includes(x))
|
||||
.concat(DEFAULT_PLUGINS.filter(x => !Object.keys(plugins).includes(x)));
|
||||
// List of plugins that are not the ones installed in a generated app
|
||||
const installedPlugins = Object.keys(plugins).filter(x => !DEFAULT_PLUGINS.includes(x));
|
||||
|
||||
// List of default plugins uninstalled from a generated app
|
||||
const missingPlugins = DEFAULT_PLUGINS.filter(x => !Object.keys(plugins).includes(x));
|
||||
|
||||
const diff = [...installedPlugins, ...missingPlugins];
|
||||
|
||||
return diff.length > 0;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user