MCPcopy
hub / github.com/apache/echarts / FilterEqualityComparator

Class FilterEqualityComparator

src/data/helper/dataValueHelper.ts:192–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192class FilterEqualityComparator implements FilterComparator {
193 private _isEQ: boolean;
194 private _rval: unknown;
195 private _rvalTypeof: string;
196 private _rvalFloat: number;
197 constructor(isEq: boolean, rval: unknown) {
198 this._rval = rval;
199 this._isEQ = isEq;
200 this._rvalTypeof = typeof rval;
201 this._rvalFloat = numericToNumber(rval);
202 }
203 // Performance sensitive.
204 evaluate(lval: unknown): boolean {
205 let eqResult = lval === this._rval;
206 if (!eqResult) {
207 const lvalTypeof = typeof lval;
208 if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === 'number' || this._rvalTypeof === 'number')) {
209 eqResult = numericToNumber(lval) === this._rvalFloat;
210 }
211 }
212 return this._isEQ ? eqResult : !eqResult;
213 }
214}
215
216type OrderRelationOperator = 'lt' | 'lte' | 'gt' | 'gte';
217export type RelationalOperator = OrderRelationOperator | 'eq' | 'ne';

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…