forked from MapComplete/MapComplete
Switch to doctest-ts-improved
This commit is contained in:
parent
9af6608f63
commit
676787eaf7
5 changed files with 84 additions and 603 deletions
|
@ -2,12 +2,6 @@ import {TagsFilter} from "./TagsFilter";
|
|||
import {Or} from "./Or";
|
||||
import {TagUtils} from "./TagUtils";
|
||||
|
||||
|
||||
// @ts-ignore
|
||||
import {Tag} from "./Tag";// needed for tests
|
||||
// @ts-ignore
|
||||
import {RegexTag} from "./RegexTag";// needed for tests
|
||||
|
||||
export class And extends TagsFilter {
|
||||
public and: TagsFilter[]
|
||||
constructor(and: TagsFilter[]) {
|
||||
|
@ -46,6 +40,10 @@ export class And extends TagsFilter {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* import {Tag} from "./Tag";
|
||||
* import {RegexTag} from "./RegexTag";
|
||||
*
|
||||
* const and = new And([new Tag("boundary","protected_area"), new RegexTag("protect_class","98",true)])
|
||||
* and.asOverpass() // => [ "[\"boundary\"=\"protected_area\"][\"protect_class\"!~\"^98$\"]" ]
|
||||
*/
|
||||
|
|
|
@ -2,10 +2,6 @@ import {TagsFilter} from "./TagsFilter";
|
|||
import {TagUtils} from "./TagUtils";
|
||||
import {And} from "./And";
|
||||
|
||||
// @ts-ignore
|
||||
import {Tag} from "./Tag";// needed for tests
|
||||
// @ts-ignore
|
||||
import {RegexTag} from "./RegexTag";// needed for tests
|
||||
|
||||
export class Or extends TagsFilter {
|
||||
public or: TagsFilter[]
|
||||
|
@ -26,6 +22,10 @@ export class Or extends TagsFilter {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* import {Tag} from "./Tag";
|
||||
* import {RegexTag} from "./RegexTag";
|
||||
*
|
||||
* const and = new And([new Tag("boundary","protected_area"), new RegexTag("protect_class","98",true)])
|
||||
* const or = new Or([and, new Tag("leisure", "nature_reserve"])
|
||||
* or.asOverpass() // => [ "[\"boundary\"=\"protected_area\"][\"protect_class\"!~\"^98$\"]", "[\"leisure\"=\"nature_reserve\"]" ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue