fix: patch middle truncation func (#465)

resolves #456
This commit is contained in:
Timothy Carambat 2023-12-17 16:04:50 -08:00 committed by GitHub
parent 1c549e2844
commit 2d700b13f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ export function getFileExtension(path) {
}
export function middleTruncate(str, n) {
const fileExtensionPattern = /(\..+)$/;
const fileExtensionPattern = /([^.]*)$/;
const extensionMatch = str.match(fileExtensionPattern);
if (str.length <= n) return str;