From 094d2ad8fcd5647a6504adaf231ea59511d94617 Mon Sep 17 00:00:00 2001 From: Henry Heino Date: Mon, 18 Nov 2024 20:38:43 -0800 Subject: [PATCH] Chore: Remove unused function in string-utils.ts --- packages/lib/string-utils.ts | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/packages/lib/string-utils.ts b/packages/lib/string-utils.ts index 05d2a3ad1fe..63d4bbbe597 100644 --- a/packages/lib/string-utils.ts +++ b/packages/lib/string-utils.ts @@ -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');