(tag)
| 89 | |
| 90 | // Normalize a tag (lowercase, trim, remove special chars) |
| 91 | function 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 | } |
no outgoing calls
no test coverage detected