mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-28 05:58:38 +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
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import {createHash} from 'crypto';
|
||||
import {kebabCase} from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import {shortName, isNameTooLong} from './pathUtils';
|
||||
|
||||
export function md5Hash(str: string): string {
|
||||
|
@ -29,9 +29,9 @@ export function docuHash(str: string): string {
|
|||
return 'index';
|
||||
}
|
||||
const shortHash = simpleHash(str, 3);
|
||||
const parsedPath = `${kebabCase(str)}-${shortHash}`;
|
||||
const parsedPath = `${_.kebabCase(str)}-${shortHash}`;
|
||||
if (isNameTooLong(parsedPath)) {
|
||||
return `${shortName(kebabCase(str))}-${shortHash}`;
|
||||
return `${shortName(_.kebabCase(str))}-${shortHash}`;
|
||||
}
|
||||
return parsedPath;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue