Skip to content

Commit

Permalink
Chore: Remove unused function in string-utils.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator committed Nov 19, 2024
1 parent cad00cb commit 094d2ad
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions packages/lib/string-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 094d2ad

Please sign in to comment.