mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-21 20:17:50 +02:00
refactor: ensure lodash is default-imported (#6716)
This commit is contained in:
parent
47c9a37c5f
commit
ea6ceaa371
44 changed files with 239 additions and 221 deletions
|
@ -17,7 +17,7 @@ import {Globby} from '@docusaurus/utils';
|
|||
import logger from '@docusaurus/logger';
|
||||
import type {PluginOptions} from '@docusaurus/plugin-content-docs';
|
||||
import Yaml from 'js-yaml';
|
||||
import {groupBy, mapValues} from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import combinePromises from 'combine-promises';
|
||||
|
||||
export const DefaultSidebars: SidebarsConfig = {
|
||||
|
@ -46,9 +46,9 @@ async function readCategoriesMetadata(contentPath: string) {
|
|||
const categoryFiles = await Globby('**/_category_.{json,yml,yaml}', {
|
||||
cwd: contentPath,
|
||||
});
|
||||
const categoryToFile = groupBy(categoryFiles, path.dirname);
|
||||
const categoryToFile = _.groupBy(categoryFiles, path.dirname);
|
||||
return combinePromises(
|
||||
mapValues(categoryToFile, async (files, folder) => {
|
||||
_.mapValues(categoryToFile, async (files, folder) => {
|
||||
const [filePath] = files;
|
||||
if (files.length > 1) {
|
||||
logger.warn`There are more than one category metadata files for path=${folder}: ${files.join(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue