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:
parent
bcff7ac1d3
commit
546c75b955
@ -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');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user