From 0c4d91cbefa06ca5b84f99eef0f8bb5bb42a5af8 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 13 Apr 2026 16:50:16 +0200 Subject: [PATCH] Remove unused messagePatternToGlob and patternHasSubdirectories These two internal functions in cli-module-translations were never imported by any production code. Remove them along with their tests. Signed-off-by: Patrik Oldsberg Made-with: Cursor --- .../src/lib/messageFilePath.test.ts | 24 ------------------- .../src/lib/messageFilePath.ts | 10 -------- 2 files changed, 34 deletions(-) diff --git a/packages/cli-module-translations/src/lib/messageFilePath.test.ts b/packages/cli-module-translations/src/lib/messageFilePath.test.ts index 4c276e114c..3746db2f60 100644 --- a/packages/cli-module-translations/src/lib/messageFilePath.test.ts +++ b/packages/cli-module-translations/src/lib/messageFilePath.test.ts @@ -17,8 +17,6 @@ import { formatMessagePath, createMessagePathParser, - messagePatternToGlob, - patternHasSubdirectories, DEFAULT_MESSAGE_PATTERN, } from './messageFilePath'; @@ -97,26 +95,4 @@ describe('messageFilePath', () => { ); }); }); - - describe('messagePatternToGlob', () => { - it('converts the default pattern', () => { - expect(messagePatternToGlob(DEFAULT_MESSAGE_PATTERN)).toBe( - 'messages/*.*.json', - ); - }); - - it('converts a language-directory pattern', () => { - expect(messagePatternToGlob('{lang}/{id}.json')).toBe('*/*.json'); - }); - }); - - describe('patternHasSubdirectories', () => { - it('returns true for the default pattern', () => { - expect(patternHasSubdirectories(DEFAULT_MESSAGE_PATTERN)).toBe(true); - }); - - it('returns true for patterns with directories', () => { - expect(patternHasSubdirectories('{lang}/{id}.json')).toBe(true); - }); - }); }); diff --git a/packages/cli-module-translations/src/lib/messageFilePath.ts b/packages/cli-module-translations/src/lib/messageFilePath.ts index eb3dc8ea5c..6f88d2a166 100644 --- a/packages/cli-module-translations/src/lib/messageFilePath.ts +++ b/packages/cli-module-translations/src/lib/messageFilePath.ts @@ -54,16 +54,6 @@ export function createMessagePathParser( }; } -/** Converts a message pattern into a glob string for discovering files. */ -export function messagePatternToGlob(pattern: string): string { - return pattern.replace(/\{id\}/g, '*').replace(/\{lang\}/g, '*'); -} - -/** Returns whether the pattern produces paths with subdirectories. */ -export function patternHasSubdirectories(pattern: string): boolean { - return pattern.includes('/'); -} - export function validatePattern(pattern: string) { if (!pattern.includes('{id}')) { throw new Error(