refactor: capitalize comments (#7188)

* refactor: capitalize comments

* revert...
This commit is contained in:
Joshua Chen 2022-04-17 16:39:11 +08:00 committed by GitHub
parent 200009008b
commit fa1ce230ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
99 changed files with 241 additions and 350 deletions

View file

@ -21,8 +21,10 @@ const isWindows = () => process.platform === 'win32';
export const isNameTooLong = (str: string): boolean =>
// Not entirely correct: we can't assume FS from OS. But good enough?
isMacOs() || isWindows()
? 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)
? // Windows (NTFS) and macOS (APFS) filename length limit (255 chars)
str.length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_CHARS
: // Other (255 bytes)
Buffer.from(str).length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_BYTES;
export function shortName(str: string): string {
if (isMacOs() || isWindows()) {