MCPcopy Index your code
hub / github.com/microsoft/SandDance / getOperators

Function getOperators

packages/sanddance-explorer/src/controls/searchTerm.tsx:96–115  ·  view source on GitHub ↗
(ex: InputSearchExpression, column: SandDance.types.Column)

Source from the content-addressed store, hash-verified

94}
95
96function getOperators(ex: InputSearchExpression, column: SandDance.types.Column) {
97 let anySelected = false;
98 const validOperators = getValidOperators(column);
99 const options = validOperators.map(validoperator => {
100 const [op, text] = validoperator;
101 const selected = ex.operator === op;
102 anySelected = anySelected || selected;
103 const option: FluentUITypes.IDropdownOption = {
104 key: op,
105 text,
106 data: op,
107 selected,
108 };
109 return option;
110 });
111 if (!anySelected) {
112 options[0].selected = true;
113 }
114 return options;
115}
116
117function getDistinctValues(data: object[], columnName: string) {
118 const distinctMap = {};

Callers 1

SearchTermFunction · 0.70

Calls 1

getValidOperatorsFunction · 0.70

Tested by

no test coverage detected