(chunk)
| 71 | } |
| 72 | |
| 73 | function initializeChunkKeywordMetadata(chunk) { |
| 74 | if (!chunk) return; |
| 75 | chunk.systemKeywords = ensureArrayValue(chunk.systemKeywords); |
| 76 | chunk.customKeywords = ensureArrayValue(chunk.customKeywords); |
| 77 | chunk.disabledKeywords = ensureArrayValue(chunk.disabledKeywords); |
| 78 | if (!chunk.customWeights) chunk.customWeights = {}; |
| 79 | |
| 80 | const disabledSet = new Set(chunk.disabledKeywords.map(normalizeKeywordClient)); |
| 81 | const customKeywordSet = new Set(chunk.customKeywords.map(normalizeKeywordClient)); |
| 82 | const active = [ |
| 83 | ...chunk.systemKeywords.filter(k => !disabledSet.has(normalizeKeywordClient(k))), |
| 84 | ...chunk.customKeywords |
| 85 | ]; |
| 86 | chunk.keywords = active; |
| 87 | } |
| 88 | |
| 89 | function isValidRegex(str) { |
| 90 | if (!str) return false; |
no test coverage detected