From da442d9cdd3e46a31c37dd993e24cd41f0b6edd6 Mon Sep 17 00:00:00 2001 From: Anas sarkiz Date: Tue, 1 Oct 2024 19:43:18 +0200 Subject: [PATCH] removed regular expressions --- .../create-svg-objects-from-pcb-fabrication-note-text.ts | 6 +----- .../create-svg-objects-from-pcb-silkscreen-text.ts | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/pcb/svg-object-fns/create-svg-objects-from-pcb-fabrication-note-text.ts b/lib/pcb/svg-object-fns/create-svg-objects-from-pcb-fabrication-note-text.ts index e501b06..1a446a2 100644 --- a/lib/pcb/svg-object-fns/create-svg-objects-from-pcb-fabrication-note-text.ts +++ b/lib/pcb/svg-object-fns/create-svg-objects-from-pcb-fabrication-note-text.ts @@ -38,10 +38,6 @@ export function createSvgObjectsFromPcbFabricationNoteText( const transformedFontSize = font_size * Math.abs(transform.a) // Remove ${} from text value and handle undefined text - const cleanedText = (text || "").replace(/\$\{|\}/g, "") - if (!cleanedText) { - return [] - } // Create a composite transformation const textTransform = compose( @@ -66,7 +62,7 @@ export function createSvgObjectsFromPcbFabricationNoteText( children: [ { type: "text", - value: cleanedText, + value: text, name: "", attributes: {}, children: [], diff --git a/lib/pcb/svg-object-fns/create-svg-objects-from-pcb-silkscreen-text.ts b/lib/pcb/svg-object-fns/create-svg-objects-from-pcb-silkscreen-text.ts index f601ac4..01aa5ab 100644 --- a/lib/pcb/svg-object-fns/create-svg-objects-from-pcb-silkscreen-text.ts +++ b/lib/pcb/svg-object-fns/create-svg-objects-from-pcb-silkscreen-text.ts @@ -36,10 +36,6 @@ export function createSvgObjectsFromPcbSilkscreenText( const transformedFontSize = font_size * Math.abs(transform.a) // Remove ${} from text value and handle undefined text - const cleanedText = (text || "").replace(/\$\{|\}/g, "") - if (!cleanedText) { - return [] - } // Create a composite transformation const textTransform = compose( @@ -64,7 +60,7 @@ export function createSvgObjectsFromPcbSilkscreenText( children: [ { type: "text", - value: cleanedText, + value: text, name: "", attributes: {}, children: [],