mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-23 03:29:11 +02:00
feat(utils): JSDoc for all APIs (#6980)
* feat(utils): JSDoc for all APIs * fix tests
This commit is contained in:
parent
b8d2a4e84d
commit
2eeb0e46a2
31 changed files with 637 additions and 255 deletions
|
@ -24,7 +24,7 @@ export const isNameTooLong = (str: string): boolean =>
|
|||
? str.length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_CHARS // MacOS (APFS) and Windows (NTFS) filename length limit (255 chars)
|
||||
: Buffer.from(str).length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_BYTES; // Other (255 bytes)
|
||||
|
||||
export const shortName = (str: string): string => {
|
||||
export function shortName(str: string): string {
|
||||
if (isMacOs() || isWindows()) {
|
||||
const overflowingChars = str.length - MAX_PATH_SEGMENT_CHARS;
|
||||
return str.slice(
|
||||
|
@ -41,7 +41,7 @@ export const shortName = (str: string): string => {
|
|||
Buffer.byteLength(strBuffer) - overflowingBytes - SPACE_FOR_APPENDING - 1,
|
||||
)
|
||||
.toString();
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert Windows backslash paths to posix style paths.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue