From ad632dac12235278c4c7df1a5ca8b9609e460f71 Mon Sep 17 00:00:00 2001 From: Kai Volland Date: Mon, 27 Sep 2021 11:51:40 +0200 Subject: [PATCH 1/3] introduce BetweenFilter --- style.ts | 9 +++++++-- typeguards.ts | 8 +++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/style.ts b/style.ts index f6564b204..03ed1c9ce 100644 --- a/style.ts +++ b/style.ts @@ -31,7 +31,7 @@ export type PropertyValue = string | number | boolean | null; /** * The possible Operators used for comparison Filters. */ -export type ComparisonOperator = '==' | '*=' | '!=' | '<' | '<=' | '>' | '>='; +export type ComparisonOperator = '==' | '*=' | '!=' | '<' | '<=' | '>' | '>=' | ' { isNegationOperator(got); }; export const isComparisonOperator = (got: any): got is ComparisonOperator => { - return ['==', '*=' , '!=' , '<' , '<=' , '>' , '>='].includes(got); + return ['==', '*=' , '!=' , '<' , '<=' , '>' , '>=', ' { return ['&&', '||'].includes(got); @@ -72,11 +72,13 @@ export const isFilter = (got: any): got is Filter => { isNegationFilter(got); }; export const isComparisonFilter = (got: any): got is ComparisonFilter => { + const expectedLength = got[0] === ' { return Array.isArray(got) && From b5b93c3ce43658888b1f825ff92105c24b5606ad Mon Sep 17 00:00:00 2001 From: Kai Volland Date: Mon, 27 Sep 2021 12:04:45 +0200 Subject: [PATCH 2/3] fix samples --- examples/parsersample.ts | 21 ++++++++++++++------- examples/rastersample.ts | 2 +- examples/sample.ts | 5 +++-- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/examples/parsersample.ts b/examples/parsersample.ts index 11ca2e454..32090f31e 100644 --- a/examples/parsersample.ts +++ b/examples/parsersample.ts @@ -1,4 +1,5 @@ -import { Style, StyleParser, UnsupportedProperties } from 'index'; +import { Style, StyleParser, UnsupportedProperties } from '../index'; +import { ReadStyleResult, WriteStyleResult } from '../style'; export class SampleParser implements StyleParser { @@ -20,15 +21,21 @@ export class SampleParser implements StyleParser { title = 'Sample Parser'; - writeStyle(geoStylerStyle: Style): Promise { - return new Promise(() => 'sample'); + writeStyle(geoStylerStyle: Style): Promise { + return new Promise(() => { + return { + output: 'sample' + }; + }); } - readStyle(sldString: string): Promise