function withEvaluator()

in grafana/alert/condition.js [29:45]


  function withEvaluator(value, type) {
    const types = ['gt', 'lt', 'within_range'];

    if (!types.includes(type)) {
      throw Error(`Evaluator type must be one of [${types.toString()}]`);
    }

    that._evaluator.type = type;

    if (['gt', 'lt'].includes(type)) {
      that._evaluator.params = [value];
    } else if (Array.isArray(value)) {
      that._evaluator.params = value;
    }

    return this;
  }