I wasn't sure what to do with the filename when extension is loner than maxLength, as removing it completely would create a dotfile which might have unintended consequences, so I decided to keep at least 1 character of the filename in place.
Also found another bug: filenamify doesn't account for dotfiles, so this test:
Can't pass as other parts of filenamify remove the leading dot as they consider it a relative path, and than truncation later on treats it as a filename.
I wasn't sure what to do with the filename when extension is loner than
maxLength
, as removing it completely would create a dotfile which might have unintended consequences, so I decided to keep at least 1 character of the filename in place.Also found another bug: filenamify doesn't account for dotfiles, so this test:
Can't pass as other parts of filenamify remove the leading dot as they consider it a relative path, and than truncation later on treats it as a filename.
Separate PR? :)