From 546c75b9558345f34b11729334e45752a438b2a1 Mon Sep 17 00:00:00 2001 From: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com> Date: Tue, 19 Nov 2024 08:07:35 -0800 Subject: [PATCH] Chore: Remove unused function in string-utils.ts (#11413) --- 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 05d2a3ad1f..63d4bbbe59 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');