Welcome to mirror list, hosted at ThFree Co, Russian Federation.

FieldEquals.js « Field « NextSearch « js « src - github.com/marius-wieschollek/passwords-webextension.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 08f694e427a367b7e4d57d240bd583e6465f944c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import AbstractSearchField from '@js/NextSearch/Field/AbstractSearchField';

export default class FieldEquals extends AbstractSearchField {

    get TYPE() {
        return 'equals';
    }

    /**
     * @inheritDoc
     */
    evaluate(item) {
        let value = item.getProperty(this._name);

        if(!value) return {passed: false};
        if(value === this._value) return {matches: 1, checks: 1, passed: true};

        return {passed: false};
    }
}