/
githubmirror
/
strapi
Обзор
Документация
Войти
/
githubmirror
/
strapi
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/plugins/documentation/server/src/services/utils/get-plugins-that-need-documentation.ts
24 строки
764 B
Alexandre Bodin
chore: migrate doc plugin to ts
21 мар 2024, 20:20
21 мар 2024, 20:20
eedd4c9
Код
Авторство
О чём код?
import type { PluginConfig } from '../../types'; const getPluginsThatNeedDocumentation = (config: PluginConfig) => { // Default plugins that need documentation generated const defaultPlugins = ['upload', 'users-permissions']; // User specified plugins that need documentation generated const userPluginsConfig = config['x-strapi-config'].plugins; if (userPluginsConfig === null) { // The user hasn't specified any plugins to document, use the defaults return defaultPlugins; } if (userPluginsConfig.length) { // The user has specified certain plugins to document, use them return userPluginsConfig; } // The user has specified that no plugins should be documented return []; }; export { getPluginsThatNeedDocumentation };