MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / isTagValid

Function isTagValid

aitagging.js:91–98  ·  view source on GitHub ↗
(tag)

Source from the content-addressed store, hash-verified

89
90// Normalize a tag (lowercase, trim, remove special chars)
91function normalizeTag(tag) {
92 if (!tag || typeof tag !== 'string') return '';
93
94 return tag
95 .toLowerCase()
96 .trim()
97 .replace(/[^\w\s-]/g, '') // Remove special chars except hyphens
98 .replace(/\s+/g, ' ') // Normalize whitespace
99 .replace(/^3d\s+model$/i, '') // Remove "3d model" tag
100 .trim();
101}

Callers 2

deduplicateTagsFunction · 0.85
parseTagsFromResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected