(str: string)
| 19 | const isWindows = () => process.platform === 'win32'; |
| 20 | |
| 21 | export 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 | |
| 29 | export function shortName(str: string): string { |
| 30 | if (isMacOs() || isWindows()) { |
no test coverage detected
searching dependent graphs…