@wener/common 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,675 @@
1
+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
+
3
+ exports[`AdvanceSearch > should parse 1`] = `"-a"`;
4
+
5
+ exports[`AdvanceSearch > should parse 2`] = `"-a"`;
6
+
7
+ exports[`AdvanceSearch > should parse 3`] = `
8
+ [
9
+ {
10
+ "negative": true,
11
+ "type": "keyword",
12
+ "value": "a",
13
+ },
14
+ ]
15
+ `;
16
+
17
+ exports[`AdvanceSearch > should parse 4`] = `"a"`;
18
+
19
+ exports[`AdvanceSearch > should parse 5`] = `"a"`;
20
+
21
+ exports[`AdvanceSearch > should parse 6`] = `
22
+ [
23
+ {
24
+ "type": "keyword",
25
+ "value": "a",
26
+ },
27
+ ]
28
+ `;
29
+
30
+ exports[`AdvanceSearch > should parse 7`] = `"a b"`;
31
+
32
+ exports[`AdvanceSearch > should parse 8`] = `"a b"`;
33
+
34
+ exports[`AdvanceSearch > should parse 9`] = `
35
+ [
36
+ {
37
+ "type": "keyword",
38
+ "value": "a",
39
+ },
40
+ {
41
+ "type": "keyword",
42
+ "value": "b",
43
+ },
44
+ ]
45
+ `;
46
+
47
+ exports[`AdvanceSearch > should parse 10`] = `"a -b"`;
48
+
49
+ exports[`AdvanceSearch > should parse 11`] = `"a -b"`;
50
+
51
+ exports[`AdvanceSearch > should parse 12`] = `
52
+ [
53
+ {
54
+ "negative": false,
55
+ "type": "keyword",
56
+ "value": "a",
57
+ },
58
+ {
59
+ "negative": true,
60
+ "type": "keyword",
61
+ "value": "b",
62
+ },
63
+ ]
64
+ `;
65
+
66
+ exports[`AdvanceSearch > should parse 13`] = `"a-b"`;
67
+
68
+ exports[`AdvanceSearch > should parse 14`] = `"a-b"`;
69
+
70
+ exports[`AdvanceSearch > should parse 15`] = `
71
+ [
72
+ {
73
+ "negative": false,
74
+ "type": "keyword",
75
+ "value": "a-b",
76
+ },
77
+ ]
78
+ `;
79
+
80
+ exports[`AdvanceSearch > should parse 16`] = `"a"b"`;
81
+
82
+ exports[`AdvanceSearch > should parse 17`] = `"a"b"`;
83
+
84
+ exports[`AdvanceSearch > should parse 18`] = `
85
+ [
86
+ {
87
+ "negative": false,
88
+ "type": "keyword",
89
+ "value": "a"b",
90
+ },
91
+ ]
92
+ `;
93
+
94
+ exports[`AdvanceSearch > should parse 19`] = `"a&b"`;
95
+
96
+ exports[`AdvanceSearch > should parse 20`] = `"a&b"`;
97
+
98
+ exports[`AdvanceSearch > should parse 21`] = `
99
+ [
100
+ {
101
+ "type": "keyword",
102
+ "value": "a&b",
103
+ },
104
+ ]
105
+ `;
106
+
107
+ exports[`AdvanceSearch > should parse 22`] = `"NOT a"`;
108
+
109
+ exports[`AdvanceSearch > should parse 23`] = `"-a"`;
110
+
111
+ exports[`AdvanceSearch > should parse 24`] = `
112
+ [
113
+ {
114
+ "type": "not",
115
+ "value": {
116
+ "negative": false,
117
+ "type": "keyword",
118
+ "value": "a",
119
+ },
120
+ },
121
+ ]
122
+ `;
123
+
124
+ exports[`AdvanceSearch > should parse 25`] = `"NOT -a"`;
125
+
126
+ exports[`AdvanceSearch > should parse 26`] = `"a"`;
127
+
128
+ exports[`AdvanceSearch > should parse 27`] = `
129
+ [
130
+ {
131
+ "type": "not",
132
+ "value": {
133
+ "negative": true,
134
+ "type": "keyword",
135
+ "value": "a",
136
+ },
137
+ },
138
+ ]
139
+ `;
140
+
141
+ exports[`AdvanceSearch > should parse 28`] = `"HELLO -WORLD"`;
142
+
143
+ exports[`AdvanceSearch > should parse 29`] = `"HELLO -WORLD"`;
144
+
145
+ exports[`AdvanceSearch > should parse 30`] = `
146
+ [
147
+ {
148
+ "negative": false,
149
+ "type": "keyword",
150
+ "value": "HELLO",
151
+ },
152
+ {
153
+ "negative": true,
154
+ "type": "keyword",
155
+ "value": "WORLD",
156
+ },
157
+ ]
158
+ `;
159
+
160
+ exports[`AdvanceSearch > should parse 31`] = `"(a)"`;
161
+
162
+ exports[`AdvanceSearch > should parse 32`] = `"a"`;
163
+
164
+ exports[`AdvanceSearch > should parse 33`] = `
165
+ [
166
+ {
167
+ "type": "parentheses",
168
+ "value": [
169
+ {
170
+ "negative": false,
171
+ "type": "keyword",
172
+ "value": "a",
173
+ },
174
+ ],
175
+ },
176
+ ]
177
+ `;
178
+
179
+ exports[`AdvanceSearch > should parse 34`] = `"(a OR B)"`;
180
+
181
+ exports[`AdvanceSearch > should parse 35`] = `"a OR B"`;
182
+
183
+ exports[`AdvanceSearch > should parse 36`] = `
184
+ [
185
+ {
186
+ "type": "parentheses",
187
+ "value": [
188
+ {
189
+ "operator": "or",
190
+ "type": "logical",
191
+ "value": [
192
+ {
193
+ "negative": false,
194
+ "type": "keyword",
195
+ "value": "a",
196
+ },
197
+ {
198
+ "negative": false,
199
+ "type": "keyword",
200
+ "value": "B",
201
+ },
202
+ ],
203
+ },
204
+ ],
205
+ },
206
+ ]
207
+ `;
208
+
209
+ exports[`AdvanceSearch > should parse 37`] = `"A OR B"`;
210
+
211
+ exports[`AdvanceSearch > should parse 38`] = `"A OR B"`;
212
+
213
+ exports[`AdvanceSearch > should parse 39`] = `
214
+ [
215
+ {
216
+ "operator": "or",
217
+ "type": "logical",
218
+ "value": [
219
+ {
220
+ "negative": false,
221
+ "type": "keyword",
222
+ "value": "A",
223
+ },
224
+ {
225
+ "negative": false,
226
+ "type": "keyword",
227
+ "value": "B",
228
+ },
229
+ ],
230
+ },
231
+ ]
232
+ `;
233
+
234
+ exports[`AdvanceSearch > should parse 40`] = `"a:[1,2]"`;
235
+
236
+ exports[`AdvanceSearch > should parse 41`] = `"a:[1,2]"`;
237
+
238
+ exports[`AdvanceSearch > should parse 42`] = `
239
+ [
240
+ {
241
+ "field": "a",
242
+ "operator": "range",
243
+ "type": "compare",
244
+ "value": {
245
+ "maximum": {
246
+ "type": "literal",
247
+ "value": 2,
248
+ },
249
+ "maximumExclusive": false,
250
+ "minimum": {
251
+ "type": "literal",
252
+ "value": 1,
253
+ },
254
+ "minimumExclusive": false,
255
+ "type": "range",
256
+ },
257
+ },
258
+ ]
259
+ `;
260
+
261
+ exports[`AdvanceSearch > should parse 43`] = `"a:*..1"`;
262
+
263
+ exports[`AdvanceSearch > should parse 44`] = `"a:*..1"`;
264
+
265
+ exports[`AdvanceSearch > should parse 45`] = `
266
+ [
267
+ {
268
+ "field": "a",
269
+ "operator": "range",
270
+ "type": "compare",
271
+ "value": {
272
+ "maximum": {
273
+ "type": "literal",
274
+ "value": 1,
275
+ },
276
+ "minimum": undefined,
277
+ "type": "range",
278
+ },
279
+ },
280
+ ]
281
+ `;
282
+
283
+ exports[`AdvanceSearch > should parse 46`] = `"a:ok a:=1 a:>1 a:<1 a:>=1 a:<=1 a:!=1 a:1..2 a:*..1 a:1..* a:[1,2] a:(1,2) a:[1,2) a:(1,2]"`;
284
+
285
+ exports[`AdvanceSearch > should parse 47`] = `"a:ok a:=1 a:>1 a:<1 a:>=1 a:<=1 a:!=1 a:1..2 a:*..1 a:1..* a:[1,2] a:(1,2) a:[1,2) a:(1,2]"`;
286
+
287
+ exports[`AdvanceSearch > should parse 48`] = `
288
+ [
289
+ {
290
+ "field": "a",
291
+ "operator": "has",
292
+ "type": "compare",
293
+ "value": {
294
+ "type": "literal",
295
+ "value": "ok",
296
+ },
297
+ },
298
+ {
299
+ "field": "a",
300
+ "operator": "eq",
301
+ "type": "compare",
302
+ "value": {
303
+ "type": "literal",
304
+ "value": 1,
305
+ },
306
+ },
307
+ {
308
+ "field": "a",
309
+ "operator": "gt",
310
+ "type": "compare",
311
+ "value": {
312
+ "type": "literal",
313
+ "value": 1,
314
+ },
315
+ },
316
+ {
317
+ "field": "a",
318
+ "operator": "lt",
319
+ "type": "compare",
320
+ "value": {
321
+ "type": "literal",
322
+ "value": 1,
323
+ },
324
+ },
325
+ {
326
+ "negative": false,
327
+ "type": "keyword",
328
+ "value": "a:>=1",
329
+ },
330
+ {
331
+ "negative": false,
332
+ "type": "keyword",
333
+ "value": "a:<=1",
334
+ },
335
+ {
336
+ "field": "a",
337
+ "operator": "ne",
338
+ "type": "compare",
339
+ "value": {
340
+ "type": "literal",
341
+ "value": 1,
342
+ },
343
+ },
344
+ {
345
+ "field": "a",
346
+ "operator": "range",
347
+ "type": "compare",
348
+ "value": {
349
+ "maximum": {
350
+ "type": "literal",
351
+ "value": 2,
352
+ },
353
+ "minimum": {
354
+ "type": "literal",
355
+ "value": 1,
356
+ },
357
+ "type": "range",
358
+ },
359
+ },
360
+ {
361
+ "field": "a",
362
+ "operator": "range",
363
+ "type": "compare",
364
+ "value": {
365
+ "maximum": {
366
+ "type": "literal",
367
+ "value": 1,
368
+ },
369
+ "minimum": undefined,
370
+ "type": "range",
371
+ },
372
+ },
373
+ {
374
+ "field": "a",
375
+ "operator": "range",
376
+ "type": "compare",
377
+ "value": {
378
+ "maximum": undefined,
379
+ "minimum": {
380
+ "type": "literal",
381
+ "value": 1,
382
+ },
383
+ "type": "range",
384
+ },
385
+ },
386
+ {
387
+ "field": "a",
388
+ "operator": "range",
389
+ "type": "compare",
390
+ "value": {
391
+ "maximum": {
392
+ "type": "literal",
393
+ "value": 2,
394
+ },
395
+ "maximumExclusive": false,
396
+ "minimum": {
397
+ "type": "literal",
398
+ "value": 1,
399
+ },
400
+ "minimumExclusive": false,
401
+ "type": "range",
402
+ },
403
+ },
404
+ {
405
+ "field": "a",
406
+ "operator": "range",
407
+ "type": "compare",
408
+ "value": {
409
+ "maximum": {
410
+ "type": "literal",
411
+ "value": 2,
412
+ },
413
+ "maximumExclusive": true,
414
+ "minimum": {
415
+ "type": "literal",
416
+ "value": 1,
417
+ },
418
+ "minimumExclusive": true,
419
+ "type": "range",
420
+ },
421
+ },
422
+ {
423
+ "field": "a",
424
+ "operator": "range",
425
+ "type": "compare",
426
+ "value": {
427
+ "maximum": {
428
+ "type": "literal",
429
+ "value": 2,
430
+ },
431
+ "maximumExclusive": true,
432
+ "minimum": {
433
+ "type": "literal",
434
+ "value": 1,
435
+ },
436
+ "minimumExclusive": false,
437
+ "type": "range",
438
+ },
439
+ },
440
+ {
441
+ "field": "a",
442
+ "operator": "range",
443
+ "type": "compare",
444
+ "value": {
445
+ "maximum": {
446
+ "type": "literal",
447
+ "value": 2,
448
+ },
449
+ "maximumExclusive": false,
450
+ "minimum": {
451
+ "type": "literal",
452
+ "value": 1,
453
+ },
454
+ "minimumExclusive": true,
455
+ "type": "range",
456
+ },
457
+ },
458
+ ]
459
+ `;
460
+
461
+ exports[`AdvanceSearch > should parse 49`] = `"NOT (A B) AND (a:ok AND size:>1)"`;
462
+
463
+ exports[`AdvanceSearch > should parse 50`] = `"NOT (A B) AND (a:ok AND size:>1)"`;
464
+
465
+ exports[`AdvanceSearch > should parse 51`] = `
466
+ [
467
+ {
468
+ "operator": "and",
469
+ "type": "logical",
470
+ "value": [
471
+ {
472
+ "type": "not",
473
+ "value": {
474
+ "type": "parentheses",
475
+ "value": [
476
+ {
477
+ "negative": false,
478
+ "type": "keyword",
479
+ "value": "A",
480
+ },
481
+ {
482
+ "negative": false,
483
+ "type": "keyword",
484
+ "value": "B",
485
+ },
486
+ ],
487
+ },
488
+ },
489
+ {
490
+ "type": "parentheses",
491
+ "value": [
492
+ {
493
+ "operator": "and",
494
+ "type": "logical",
495
+ "value": [
496
+ {
497
+ "field": "a",
498
+ "operator": "has",
499
+ "type": "compare",
500
+ "value": {
501
+ "type": "literal",
502
+ "value": "ok",
503
+ },
504
+ },
505
+ {
506
+ "field": "size",
507
+ "operator": "gt",
508
+ "type": "compare",
509
+ "value": {
510
+ "type": "literal",
511
+ "value": 1,
512
+ },
513
+ },
514
+ ],
515
+ },
516
+ ],
517
+ },
518
+ ],
519
+ },
520
+ ]
521
+ `;
522
+
523
+ exports[`AdvanceSearch > should parse 52`] = `"NOT -a"`;
524
+
525
+ exports[`AdvanceSearch > should parse 53`] = `"a"`;
526
+
527
+ exports[`AdvanceSearch > should parse 54`] = `
528
+ [
529
+ {
530
+ "type": "not",
531
+ "value": {
532
+ "negative": true,
533
+ "type": "keyword",
534
+ "value": "a",
535
+ },
536
+ },
537
+ ]
538
+ `;
539
+
540
+ exports[`AdvanceSearch > should parse 55`] = `"NOT (NOT -a)"`;
541
+
542
+ exports[`AdvanceSearch > should parse 56`] = `"-a"`;
543
+
544
+ exports[`AdvanceSearch > should parse 57`] = `
545
+ [
546
+ {
547
+ "type": "not",
548
+ "value": {
549
+ "type": "parentheses",
550
+ "value": [
551
+ {
552
+ "type": "not",
553
+ "value": {
554
+ "negative": true,
555
+ "type": "keyword",
556
+ "value": "a",
557
+ },
558
+ },
559
+ ],
560
+ },
561
+ },
562
+ ]
563
+ `;
564
+
565
+ exports[`AdvanceSearch > should parse 58`] = `"owner:=@me owner:=@me owner:!=@me"`;
566
+
567
+ exports[`AdvanceSearch > should parse 59`] = `"owner:=@me owner:=@me owner:!=@me"`;
568
+
569
+ exports[`AdvanceSearch > should parse 60`] = `
570
+ [
571
+ {
572
+ "field": "owner",
573
+ "operator": "eq",
574
+ "type": "compare",
575
+ "value": {
576
+ "format": "mention",
577
+ "value": "me",
578
+ },
579
+ },
580
+ {
581
+ "field": "owner",
582
+ "operator": "eq",
583
+ "type": "compare",
584
+ "value": {
585
+ "format": "mention",
586
+ "value": "me",
587
+ },
588
+ },
589
+ {
590
+ "field": "owner",
591
+ "operator": "ne",
592
+ "type": "compare",
593
+ "value": {
594
+ "format": "mention",
595
+ "value": "me",
596
+ },
597
+ },
598
+ ]
599
+ `;
600
+
601
+ exports[`AdvanceSearch > should parse 61`] = `"@AI:"Where is my car""`;
602
+
603
+ exports[`AdvanceSearch > should parse 62`] = `"@AI:"Where is my car""`;
604
+
605
+ exports[`AdvanceSearch > should parse 63`] = `
606
+ [
607
+ {
608
+ "field": "AI",
609
+ "mention": true,
610
+ "operator": "has",
611
+ "type": "compare",
612
+ "value": {
613
+ "value": "Where is my car",
614
+ },
615
+ },
616
+ ]
617
+ `;
618
+
619
+ exports[`AdvanceSearch > should parse 64`] = `"/* */ a"`;
620
+
621
+ exports[`AdvanceSearch > should parse 65`] = `"a"`;
622
+
623
+ exports[`AdvanceSearch > should parse 66`] = `
624
+ [
625
+ {
626
+ "type": "comment",
627
+ "value": "",
628
+ },
629
+ {
630
+ "negative": false,
631
+ "type": "keyword",
632
+ "value": "a",
633
+ },
634
+ ]
635
+ `;
636
+
637
+ exports[`AdvanceSearch > should parse 67`] = `"/* Hint */ a"`;
638
+
639
+ exports[`AdvanceSearch > should parse 68`] = `"/* Hint */ a"`;
640
+
641
+ exports[`AdvanceSearch > should parse 69`] = `
642
+ [
643
+ {
644
+ "type": "comment",
645
+ "value": "Hint",
646
+ },
647
+ {
648
+ "negative": false,
649
+ "type": "keyword",
650
+ "value": "a",
651
+ },
652
+ ]
653
+ `;
654
+
655
+ exports[`AdvanceSearch > should parse 70`] = `"/* a */ a /* b */"`;
656
+
657
+ exports[`AdvanceSearch > should parse 71`] = `"/* a */ a /* b */"`;
658
+
659
+ exports[`AdvanceSearch > should parse 72`] = `
660
+ [
661
+ {
662
+ "type": "comment",
663
+ "value": "a",
664
+ },
665
+ {
666
+ "negative": false,
667
+ "type": "keyword",
668
+ "value": "a",
669
+ },
670
+ {
671
+ "type": "comment",
672
+ "value": "b",
673
+ },
674
+ ]
675
+ `;