1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-19 20:31:46 +02:00

Chore: Remove unused function in string-utils.ts (#11413)

This commit is contained in:
Henry Heino 2024-11-19 08:07:35 -08:00 committed by GitHub
parent bcff7ac1d3
commit 546c75b955
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -100,25 +100,6 @@ export function removeDiacritics(str: string) {
return str;
}
export function escapeFilename(s: string, maxLength = 32) {
let output = removeDiacritics(s);
output = output.replace('\n\r', ' ');
output = output.replace('\r\n', ' ');
output = output.replace('\r', ' ');
output = output.replace('\n', ' ');
output = output.replace('\t', ' ');
output = output.replace('\0', '');
const unsafe = '/\\:*"\'?<>|'; // In Windows
for (let i = 0; i < unsafe.length; i++) {
output = output.replace(unsafe[i], '_');
}
if (output.toLowerCase() === 'nul') output = 'n_l'; // For Windows...
return output.substr(0, maxLength);
}
export function wrap(text: string, indent: string, width: number) {
const wrap_ = require('word-wrap');