{"version":3,"file":"equalMatchers.cjs","sources":["../../../../../src/transformations/matchers/valueMatchers/equalMatchers.ts"],"sourcesContent":["import { Field } from '../../../types/dataFrame';\nimport { ValueMatcherInfo } from '../../../types/transformations';\nimport { ValueMatcherID } from '../ids';\n\nimport { BasicValueMatcherOptions } from './types';\n\nconst isEqualValueMatcher: ValueMatcherInfo<BasicValueMatcherOptions> = {\n  id: ValueMatcherID.equal,\n  name: 'Is equal',\n  description: 'Match where value for given field is equal to options value.',\n  get: (options) => {\n    return (valueIndex: number, field: Field) => {\n      const value = field.values[valueIndex];\n      // eslint-disable-next-line eqeqeq\n      return value == options.value;\n    };\n  },\n  getOptionsDisplayText: () => {\n    return `Matches all rows where field is null.`;\n  },\n  isApplicable: () => true,\n  getDefaultOptions: () => ({ value: '' }),\n};\n\nconst isNotEqualValueMatcher: ValueMatcherInfo<BasicValueMatcherOptions> = {\n  id: ValueMatcherID.notEqual,\n  name: 'Is not equal',\n  description: 'Match where value for given field is not equal to options value.',\n  get: (options) => {\n    return (valueIndex: number, field: Field) => {\n      const value = field.values[valueIndex];\n      // eslint-disable-next-line eqeqeq\n      return value != options.value;\n    };\n  },\n  getOptionsDisplayText: () => {\n    return `Matches all rows where field is not null.`;\n  },\n  isApplicable: () => true,\n  getDefaultOptions: () => ({ value: '' }),\n};\n\nexport const getEqualValueMatchers = (): ValueMatcherInfo[] => [isEqualValueMatcher, isNotEqualValueMatcher];\n"],"names":["ValueMatcherID"],"mappings":";;;;;;;AAMA,MAAM,mBAAA,GAAkE;AAAA,EACtE,IAAIA,kBAAA,CAAe,KAAA;AAAA,EACnB,IAAA,EAAM,UAAA;AAAA,EACN,WAAA,EAAa,8DAAA;AAAA,EACb,GAAA,EAAK,CAAC,OAAA,KAAY;AAChB,IAAA,OAAO,CAAC,YAAoB,KAAA,KAAiB;AAC3C,MAAA,MAAM,KAAA,GAAQ,KAAA,CAAM,MAAA,CAAO,UAAU,CAAA;AAErC,MAAA,OAAO,SAAS,OAAA,CAAQ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