MCPcopy
hub / github.com/facebook/docusaurus / isNameTooLong

Function isNameTooLong

packages/docusaurus-utils/src/pathUtils.ts:21–27  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

19const isWindows = () => process.platform === 'win32';
20
21export const isNameTooLong = (str: string): boolean =>
22 // Not entirely correct: we can't assume FS from OS. But good enough?
23 isMacOs() || isWindows()
24 ? // Windows (NTFS) and macOS (APFS) filename length limit (255 chars)
25 str.length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_CHARS
26 : // Other (255 bytes)
27 Buffer.from(str).length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_BYTES;
28
29export function shortName(str: string): string {
30 if (isMacOs() || isWindows()) {

Callers 2

docuHashFunction · 0.90
pathUtils.test.tsFile · 0.90

Calls 2

isMacOsFunction · 0.85
isWindowsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…