MCPcopy Create free account
hub / github.com/bywwcnll/StreamPanel / getAvailableFields

Function getAvailableFields

devtools/modules/filterManager.js:20–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18}
19
20export function getAvailableFields() {
21 const connection = state.connections[state.selectedConnectionId];
22 if (!connection || !connection.messages) {
23 return [];
24 }
25
26 const fieldsSet = new Set();
27
28 connection.messages.forEach(msg => {
29 try {
30 const parsed = JSON.parse(msg.data);
31 extractFields(parsed, '', fieldsSet);
32 } catch (e) {
33 // Not JSON, skip
34 }
35 });
36
37 return Array.from(fieldsSet).sort();
38}
39
40export function extractFields(obj, prefix = '', fields = new Set()) {
41 if (obj === null || obj === undefined) {

Callers 2

addFilterConditionFunction · 0.70
renderFilterConditionsFunction · 0.70

Calls 1

extractFieldsFunction · 0.70

Tested by

no test coverage detected