← back to Dw Photo Capture
fix(lint): drop redundant \/ escape in COLOR/NAME label regexes (TK-11962)
5e89becfa97b552d23326b0e43ee17ef8a596682 · 2026-09-21 17:08:03 -0700 · Steve Abrams
server.js:482/483 — no-useless-escape errors. Inside a character class
[A-Za-z '\/-] the forward slash never terminates the regex, so the
backslash is redundant; hyphen stays last = literal. Behavior-preserving
(verified: /Grey and 12/Panel still captured). Clears the 2 eslint errors.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vBEHxUrUejKV7JCQ3uYdg
Files touched
Diff
commit 5e89becfa97b552d23326b0e43ee17ef8a596682
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon Sep 21 17:08:03 2026 -0700
fix(lint): drop redundant \/ escape in COLOR/NAME label regexes (TK-11962)
server.js:482/483 — no-useless-escape errors. Inside a character class
[A-Za-z '\/-] the forward slash never terminates the regex, so the
backslash is redundant; hyphen stays last = literal. Behavior-preserving
(verified: /Grey and 12/Panel still captured). Clears the 2 eslint errors.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vBEHxUrUejKV7JCQ3uYdg
---
server.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/server.js b/server.js
index b4ca154..8e133a1 100644
--- a/server.js
+++ b/server.js
@@ -479,8 +479,8 @@ function isDwNoise(tok, dwLabel) {
// Common interior-design colorway names + basic colors, so a printed color name is caught.
const COLOR_WORDS = 'oatmeal|alabaster|greige|celadon|ecru|taupe|linen|flax|dove|pewter|charcoal|ebony|onyx|ivory|cream|bone|chalk|parchment|sand|camel|fawn|mushroom|mocha|espresso|chocolate|walnut|honey|amber|ochre|mustard|saffron|terracotta|rust|clay|brick|coral|blush|rose|blossom|mauve|plum|aubergine|burgundy|claret|scarlet|crimson|cardinal|sage|celery|moss|fern|olive|forest|emerald|jade|hunter|teal|aqua|turquoise|peacock|cerulean|cobalt|navy|indigo|denim|slate|sky|powder|periwinkle|lavender|lilac|violet|amethyst|gold|brass|bronze|copper|champagne|platinum|silver|graphite|smoke|stone|pearl|white|black|grey|gray|beige|blue|green|red|yellow|orange|purple|pink|brown|tan';
const COLOR_RE = new RegExp('\\b(' + COLOR_WORDS + ')\\b', 'i');
-const COLOR_LABEL_RE = /colou?r(?:way)?\s*[:#]?\s*([A-Za-z][A-Za-z '\/-]{1,28})/i; // "Color: Oatmeal"
-const NAME_LABEL_RE = /(?:pattern|design|collection|name)\s*[:#]?\s*([A-Za-z][A-Za-z0-9 '\/-]{2,34})/i;
+const COLOR_LABEL_RE = /colou?r(?:way)?\s*[:#]?\s*([A-Za-z][A-Za-z '/-]{1,28})/i; // "Color: Oatmeal"
+const NAME_LABEL_RE = /(?:pattern|design|collection|name)\s*[:#]?\s*([A-Za-z][A-Za-z0-9 '/-]{2,34})/i;
const CODE_LABEL_RE = /(?:sku|item|model|mfr|product|pattern)\s*(?:#|no\.?|number)?\s*[:#]?\s*([A-Z0-9][A-Z0-9-]{2,15})/i;
// From an OCR read (rows + analyzeOcr result), pull the human-facing fields the UI highlights:
← 10fd713 auto-data-snapshot: 2026-09-21T10:59:35 (1 data files) — dat
·
back to Dw Photo Capture
·
auto-data-snapshot: 2026-09-21T17:27:28 (2 data files) — 5x/ b272ac4 →