MCPcopy Create free account
hub / github.com/Coneja-Chibi/CarrotKernel / initializeChunkKeywordMetadata

Function initializeChunkKeywordMetadata

chunk-visualizer.js:73–87  ·  view source on GitHub ↗
(chunk)

Source from the content-addressed store, hash-verified

71}
72
73function 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
89function isValidRegex(str) {
90 if (!str) return false;

Callers 5

openChunkVisualizerFunction · 0.85
renderChunksFunction · 0.85
bindActualEventsFunction · 0.85

Calls 2

normalizeKeywordClientFunction · 0.85
ensureArrayValueFunction · 0.70

Tested by

no test coverage detected