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
@@ -52,20 +52,20 @@ export class Query {
52
52
* Filter resources where attribute is equal to value.
53
53
*
54
54
* @param {string } attribute
55
- * @param {QueryTypes } value
55
+ * @param {QueryTypes | any[] } value
56
56
* @returns {string }
57
57
*/
58
- static equal = ( attribute : string , value : QueryTypes ) : string =>
58
+ static equal = ( attribute : string , value : QueryTypes | any [ ] ) : string =>
59
59
new Query ( "equal" , attribute , value ) . toString ( ) ;
60
60
61
61
/**
62
62
* Filter resources where attribute is not equal to value.
63
63
*
64
64
* @param {string } attribute
65
- * @param {QueryTypes } value
65
+ * @param {QueryTypes | any[] } value
66
66
* @returns {string }
67
67
*/
68
- static notEqual = ( attribute : string , value : QueryTypes ) : string =>
68
+ static notEqual = ( attribute : string , value : QueryTypes | any [ ] ) : string =>
69
69
new Query ( "notEqual" , attribute , value ) . toString ( ) ;
70
70
71
71
/**
@@ -238,17 +238,17 @@ export class Query {
238
238
* @param {string | string[] } value
239
239
* @returns {string }
240
240
*/
241
- static contains = ( attribute : string , value : string | string [ ] ) : string =>
241
+ static contains = ( attribute : string , value : string | any [ ] ) : string =>
242
242
new Query ( "contains" , attribute , value ) . toString ( ) ;
243
243
244
244
/**
245
245
* Filter resources where attribute does not contain the specified value.
246
246
*
247
247
* @param {string } attribute
248
- * @param {string | string [] } value
248
+ * @param {string | any [] } value
249
249
* @returns {string }
250
250
*/
251
- static notContains = ( attribute : string , value : string | string [ ] ) : string =>
251
+ static notContains = ( attribute : string , value : string | any [ ] ) : string =>
252
252
new Query ( "notContains" , attribute , value ) . toString ( ) ;
253
253
254
254
/**
@@ -377,7 +377,7 @@ export class Query {
377
377
* @returns {string }
378
378
*/
379
379
static distanceEqual = ( attribute : string , values : any [ ] , distance : number , meters : boolean = true ) : string =>
380
- new Query ( "distanceEqual" , attribute , [ values , distance , meters ] as QueryTypesList ) . toString ( ) ;
380
+ new Query ( "distanceEqual" , attribute , [ [ values , distance , meters ] ] as QueryTypesList ) . toString ( ) ;
381
381
382
382
/**
383
383
* Filter resources where attribute is not at a specific distance from the given coordinates.
@@ -389,7 +389,7 @@ export class Query {
389
389
* @returns {string }
390
390
*/
391
391
static distanceNotEqual = ( attribute : string , values : any [ ] , distance : number , meters : boolean = true ) : string =>
392
- new Query ( "distanceNotEqual" , attribute , [ values , distance , meters ] as QueryTypesList ) . toString ( ) ;
392
+ new Query ( "distanceNotEqual" , attribute , [ [ values , distance , meters ] ] as QueryTypesList ) . toString ( ) ;
393
393
394
394
/**
395
395
* Filter resources where attribute is at a distance greater than the specified value from the given coordinates.
@@ -401,7 +401,7 @@ export class Query {
401
401
* @returns {string }
402
402
*/
403
403
static distanceGreaterThan = ( attribute : string , values : any [ ] , distance : number , meters : boolean = true ) : string =>
404
- new Query ( "distanceGreaterThan" , attribute , [ values , distance , meters ] as QueryTypesList ) . toString ( ) ;
404
+ new Query ( "distanceGreaterThan" , attribute , [ [ values , distance , meters ] ] as QueryTypesList ) . toString ( ) ;
405
405
406
406
/**
407
407
* Filter resources where attribute is at a distance less than the specified value from the given coordinates.
@@ -413,7 +413,7 @@ export class Query {
413
413
* @returns {string }
414
414
*/
415
415
static distanceLessThan = ( attribute : string , values : any [ ] , distance : number , meters : boolean = true ) : string =>
416
- new Query ( "distanceLessThan" , attribute , [ values , distance , meters ] as QueryTypesList ) . toString ( ) ;
416
+ new Query ( "distanceLessThan" , attribute , [ [ values , distance , meters ] ] as QueryTypesList ) . toString ( ) ;
417
417
418
418
/**
419
419
* Filter resources where attribute intersects with the given geometry.
@@ -423,7 +423,7 @@ export class Query {
423
423
* @returns {string }
424
424
*/
425
425
static intersects = ( attribute : string , values : any [ ] ) : string =>
426
- new Query ( "intersects" , attribute , values ) . toString ( ) ;
426
+ new Query ( "intersects" , attribute , [ values ] ) . toString ( ) ;
427
427
428
428
/**
429
429
* Filter resources where attribute does not intersect with the given geometry.
@@ -433,7 +433,7 @@ export class Query {
433
433
* @returns {string }
434
434
*/
435
435
static notIntersects = ( attribute : string , values : any [ ] ) : string =>
436
- new Query ( "notIntersects" , attribute , values ) . toString ( ) ;
436
+ new Query ( "notIntersects" , attribute , [ values ] ) . toString ( ) ;
437
437
438
438
/**
439
439
* Filter resources where attribute crosses the given geometry.
@@ -443,7 +443,7 @@ export class Query {
443
443
* @returns {string }
444
444
*/
445
445
static crosses = ( attribute : string , values : any [ ] ) : string =>
446
- new Query ( "crosses" , attribute , values ) . toString ( ) ;
446
+ new Query ( "crosses" , attribute , [ values ] ) . toString ( ) ;
447
447
448
448
/**
449
449
* Filter resources where attribute does not cross the given geometry.
@@ -453,7 +453,7 @@ export class Query {
453
453
* @returns {string }
454
454
*/
455
455
static notCrosses = ( attribute : string , values : any [ ] ) : string =>
456
- new Query ( "notCrosses" , attribute , values ) . toString ( ) ;
456
+ new Query ( "notCrosses" , attribute , [ values ] ) . toString ( ) ;
457
457
458
458
/**
459
459
* Filter resources where attribute overlaps with the given geometry.
@@ -463,7 +463,7 @@ export class Query {
463
463
* @returns {string }
464
464
*/
465
465
static overlaps = ( attribute : string , values : any [ ] ) : string =>
466
- new Query ( "overlaps" , attribute , values ) . toString ( ) ;
466
+ new Query ( "overlaps" , attribute , [ values ] ) . toString ( ) ;
467
467
468
468
/**
469
469
* Filter resources where attribute does not overlap with the given geometry.
@@ -473,7 +473,7 @@ export class Query {
473
473
* @returns {string }
474
474
*/
475
475
static notOverlaps = ( attribute : string , values : any [ ] ) : string =>
476
- new Query ( "notOverlaps" , attribute , values ) . toString ( ) ;
476
+ new Query ( "notOverlaps" , attribute , [ values ] ) . toString ( ) ;
477
477
478
478
/**
479
479
* Filter resources where attribute touches the given geometry.
@@ -483,7 +483,7 @@ export class Query {
483
483
* @returns {string }
484
484
*/
485
485
static touches = ( attribute : string , values : any [ ] ) : string =>
486
- new Query ( "touches" , attribute , values ) . toString ( ) ;
486
+ new Query ( "touches" , attribute , [ values ] ) . toString ( ) ;
487
487
488
488
/**
489
489
* Filter resources where attribute does not touch the given geometry.
@@ -493,5 +493,5 @@ export class Query {
493
493
* @returns {string }
494
494
*/
495
495
static notTouches = ( attribute : string , values : any [ ] ) : string =>
496
- new Query ( "notTouches" , attribute , values ) . toString ( ) ;
496
+ new Query ( "notTouches" , attribute , [ values ] ) . toString ( ) ;
497
497
}
0 commit comments