mapcomplete/test.ts

10 lines
510 B
TypeScript
Raw Normal View History

import {TextField, ValidatedTextField} from "./UI/Input/TextField";
2020-08-22 12:44:11 +02:00
import {CustomLayoutFromJSON} from "./Customizations/JSON/CustomLayoutFromJSON";
import {And} from "./Logic/TagsFilter";
2020-08-22 12:44:11 +02:00
const tags = CustomLayoutFromJSON.TagsFromJson("indoor=yes&access!=private");
console.log(tags);
const m0 = new And(tags).matches([{k:"indoor",v:"yes"}, {k:"access",v: "yes"}]);
console.log("Matches 0", m0)
const m1 = new And(tags).matches([{k:"indoor",v:"yes"}, {k:"access",v: "private"}]);
console.log("Matches 1", m1)