Switch to doctest-ts-improved

This commit is contained in:
Pieter Vander Vennet 2022-03-25 16:42:33 +01:00
parent 9af6608f63
commit 676787eaf7
5 changed files with 84 additions and 603 deletions

View file

@ -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$\"]" ]
*/

View file

@ -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\"]" ]