1
1
type QueryTypesSingle = string | number | boolean;
2
- export type QueryTypesList = string[] | number[] | boolean[] | Query[];
2
+ export type QueryTypesList = string[] | number[] | boolean[] | Query[] | any[] ;
3
3
export type QueryTypes = QueryTypesSingle | QueryTypesList;
4
4
type AttributesTypes = string | string[];
5
5
@@ -33,10 +33,10 @@ export class Query {
33
33
});
34
34
}
35
35
36
- static equal = (attribute: string, value: QueryTypes): string =>
36
+ static equal = (attribute: string, value: QueryTypes | any[] ): string =>
37
37
new Query("equal", attribute, value).toString();
38
38
39
- static notEqual = (attribute: string, value: QueryTypes): string =>
39
+ static notEqual = (attribute: string, value: QueryTypes | any[] ): string =>
40
40
new Query("notEqual", attribute, value).toString();
41
41
42
42
static lessThan = (attribute: string, value: QueryTypes): string =>
@@ -100,7 +100,7 @@ export class Query {
100
100
* @param {string | string[]} value
101
101
* @returns {string}
102
102
*/
103
- static contains = (attribute: string, value: string | string []): string =>
103
+ static contains = (attribute: string, value: string | any []): string =>
104
104
new Query("contains", attribute, value).toString();
105
105
106
106
/**
@@ -110,7 +110,7 @@ export class Query {
110
110
* @param {string | string[]} value
111
111
* @returns {string}
112
112
*/
113
- static notContains = (attribute: string, value: string | string []): string =>
113
+ static notContains = (attribute: string, value: string | any []): string =>
114
114
new Query("notContains", attribute, value).toString();
115
115
116
116
/**
@@ -227,7 +227,7 @@ export class Query {
227
227
* @returns {string}
228
228
*/
229
229
static distanceEqual = (attribute: string, values: any[], distance: number, meters: boolean = true): string =>
230
- new Query("distanceEqual", attribute, [values, distance, meters] as QueryTypesList ).toString();
230
+ new Query("distanceEqual", attribute, [[ values, distance, meters]] ).toString();
231
231
232
232
/**
233
233
* Filter resources where attribute is not at a specific distance from the given coordinates.
@@ -239,7 +239,7 @@ export class Query {
239
239
* @returns {string}
240
240
*/
241
241
static distanceNotEqual = (attribute: string, values: any[], distance: number, meters: boolean = true): string =>
242
- new Query("distanceNotEqual", attribute, [values, distance, meters] as QueryTypesList ).toString();
242
+ new Query("distanceNotEqual", attribute, [[ values, distance, meters]] ).toString();
243
243
244
244
/**
245
245
* Filter resources where attribute is at a distance greater than the specified value from the given coordinates.
@@ -251,7 +251,7 @@ export class Query {
251
251
* @returns {string}
252
252
*/
253
253
static distanceGreaterThan = (attribute: string, values: any[], distance: number, meters: boolean = true): string =>
254
- new Query("distanceGreaterThan", attribute, [values, distance, meters] as QueryTypesList ).toString();
254
+ new Query("distanceGreaterThan", attribute, [[ values, distance, meters]] ).toString();
255
255
256
256
/**
257
257
* Filter resources where attribute is at a distance less than the specified value from the given coordinates.
@@ -263,7 +263,7 @@ export class Query {
263
263
* @returns {string}
264
264
*/
265
265
static distanceLessThan = (attribute: string, values: any[], distance: number, meters: boolean = true): string =>
266
- new Query("distanceLessThan", attribute, [values, distance, meters] as QueryTypesList ).toString();
266
+ new Query("distanceLessThan", attribute, [[ values, distance, meters]] ).toString();
267
267
268
268
/**
269
269
* Filter resources where attribute intersects with the given geometry.
@@ -273,7 +273,7 @@ export class Query {
273
273
* @returns {string}
274
274
*/
275
275
static intersects = (attribute: string, values: any[]): string =>
276
- new Query("intersects", attribute, values).toString();
276
+ new Query("intersects", attribute, [ values] ).toString();
277
277
278
278
/**
279
279
* Filter resources where attribute does not intersect with the given geometry.
@@ -283,7 +283,7 @@ export class Query {
283
283
* @returns {string}
284
284
*/
285
285
static notIntersects = (attribute: string, values: any[]): string =>
286
- new Query("notIntersects", attribute, values).toString();
286
+ new Query("notIntersects", attribute, [ values] ).toString();
287
287
288
288
/**
289
289
* Filter resources where attribute crosses the given geometry.
@@ -293,7 +293,7 @@ export class Query {
293
293
* @returns {string}
294
294
*/
295
295
static crosses = (attribute: string, values: any[]): string =>
296
- new Query("crosses", attribute, values).toString();
296
+ new Query("crosses", attribute, [ values] ).toString();
297
297
298
298
/**
299
299
* Filter resources where attribute does not cross the given geometry.
@@ -303,7 +303,7 @@ export class Query {
303
303
* @returns {string}
304
304
*/
305
305
static notCrosses = (attribute: string, values: any[]): string =>
306
- new Query("notCrosses", attribute, values).toString();
306
+ new Query("notCrosses", attribute, [ values] ).toString();
307
307
308
308
/**
309
309
* Filter resources where attribute overlaps with the given geometry.
@@ -313,7 +313,7 @@ export class Query {
313
313
* @returns {string}
314
314
*/
315
315
static overlaps = (attribute: string, values: any[]): string =>
316
- new Query("overlaps", attribute, values).toString();
316
+ new Query("overlaps", attribute, [ values] ).toString();
317
317
318
318
/**
319
319
* Filter resources where attribute does not overlap with the given geometry.
@@ -323,7 +323,7 @@ export class Query {
323
323
* @returns {string}
324
324
*/
325
325
static notOverlaps = (attribute: string, values: any[]): string =>
326
- new Query("notOverlaps", attribute, values).toString();
326
+ new Query("notOverlaps", attribute, [ values] ).toString();
327
327
328
328
/**
329
329
* Filter resources where attribute touches the given geometry.
@@ -333,7 +333,7 @@ export class Query {
333
333
* @returns {string}
334
334
*/
335
335
static touches = (attribute: string, values: any[]): string =>
336
- new Query("touches", attribute, values).toString();
336
+ new Query("touches", attribute, [ values] ).toString();
337
337
338
338
/**
339
339
* Filter resources where attribute does not touch the given geometry.
@@ -343,5 +343,5 @@ export class Query {
343
343
* @returns {string}
344
344
*/
345
345
static notTouches = (attribute: string, values: any[]): string =>
346
- new Query("notTouches", attribute, values).toString();
346
+ new Query("notTouches", attribute, [ values] ).toString();
347
347
}
0 commit comments