jexp 0.1.6 → 0.1.9
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.
- package/README.md +115 -55
- package/index.js +1 -8
- package/index.js.map +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -4,12 +4,15 @@ Command line application that allows parser and evaluator of json/yaml applying
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
7
|
+
- json and yaml formats
|
|
8
|
+
- Constants, enums, number, string, datetime, variables, objects and array
|
|
9
|
+
- Arithmetic , assignment , comparison , logical and bitwise operators
|
|
10
|
+
- Number , string , datetime , array and nullable functions
|
|
11
|
+
- Conversion functions
|
|
12
|
+
- Arrow functions
|
|
13
|
+
- Group functions (distinct, first, last, min, max, sum and avg)
|
|
14
|
+
- Sets functions (union, intersection, difference and symmetric difference)
|
|
11
15
|
- Environment variables
|
|
12
|
-
- json and yaml
|
|
13
16
|
|
|
14
17
|
## Global installation
|
|
15
18
|
|
|
@@ -27,11 +30,10 @@ jexp <expression> <source> [options]
|
|
|
27
30
|
|
|
28
31
|
### Expression
|
|
29
32
|
|
|
30
|
-
The expressions correspond to the package [js-expressions](https://www.npmjs.com/package/js-expressions)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
the root of the data is accessed from **dot**
|
|
33
|
+
> The expressions correspond to the package [js-expressions](https://www.npmjs.com/package/js-expressions)
|
|
34
|
+
> expression that is applied to the data source
|
|
35
|
+
>
|
|
36
|
+
> The root of the data is accessed from **dot**
|
|
35
37
|
|
|
36
38
|
```sh
|
|
37
39
|
jexp '.' ./data/orders.json
|
|
@@ -79,7 +81,6 @@ curl -s https://raw.githubusercontent.com/FlavioLionelRita/jexp/main/data/orders
|
|
|
79
81
|
|-------------------|--------------|----------------|-----------|
|
|
80
82
|
|--output <format> |-o |Force output | json, yaml|
|
|
81
83
|
|--beautiful |-b |Beautiful output| |
|
|
82
|
-
|--decorate |-d |Decorate output | |
|
|
83
84
|
|
|
84
85
|
## Examples
|
|
85
86
|
|
|
@@ -106,6 +107,17 @@ file orders.js
|
|
|
106
107
|
{ "article": "Banana", "unitPrice": 1.99, "qty": 2 },
|
|
107
108
|
{ "article": "Pear", "unitPrice": 1.78, "qty": 1 }
|
|
108
109
|
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"number": "20003",
|
|
113
|
+
"customer": { "firstName": "George", "lastName": "Williams" },
|
|
114
|
+
"orderTime": "2022-07-30T14:43:11",
|
|
115
|
+
"details": [
|
|
116
|
+
{ "article": "Apple", "unitPrice": 2.15, "qty": 1 },
|
|
117
|
+
{ "article": "Banana", "unitPrice": 1.99, "qty": 1 },
|
|
118
|
+
{ "article": "Pear", "unitPrice": 1.78, "qty": 1 },
|
|
119
|
+
{ "article": "White grape", "unitPrice": 2.03, "qty": 1 }
|
|
120
|
+
]
|
|
109
121
|
}
|
|
110
122
|
]
|
|
111
123
|
```
|
|
@@ -119,7 +131,7 @@ jexp '.' ./data/orders.json
|
|
|
119
131
|
*Result*:
|
|
120
132
|
|
|
121
133
|
```json
|
|
122
|
-
[{"number":"20001","customer":{"firstName":"John","lastName":"Murphy"},"orderTime":"2022-07-30T10:15:54","details":[{"article":"Pear","unitPrice":1.78,"qty":2},{"article":"Banana","unitPrice":1.99,"qty":1},{"article":"White grape","unitPrice":2.03,"qty":1}]},{"number":"20002","customer":{"firstName":"Paul","lastName":"Smith"},"orderTime":"2022-07-30T12:12:43","details":[{"article":"Apple","unitPrice":2.15,"qty":1},{"article":"Banana","unitPrice":1.99,"qty":2},{"article":"Pear","unitPrice":1.78,"qty":1}]}]
|
|
134
|
+
[{"number":"20001","customer":{"firstName":"John","lastName":"Murphy"},"orderTime":"2022-07-30T10:15:54","details":[{"article":"Pear","unitPrice":1.78,"qty":2},{"article":"Banana","unitPrice":1.99,"qty":1},{"article":"White grape","unitPrice":2.03,"qty":1}]},{"number":"20002","customer":{"firstName":"Paul","lastName":"Smith"},"orderTime":"2022-07-30T12:12:43","details":[{"article":"Apple","unitPrice":2.15,"qty":1},{"article":"Banana","unitPrice":1.99,"qty":2},{"article":"Pear","unitPrice":1.78,"qty":1}]},{"number":"20003","customer":{"firstName":"George","lastName":"Williams"},"orderTime":"2022-07-30T14:43:11","details":[{"article":"Apple","unitPrice":2.15,"qty":1},{"article":"Banana","unitPrice":1.99,"qty":1},{"article":"Pear","unitPrice":1.78,"qty":1},{"article":"White grape","unitPrice":2.03,"qty":1}]}]
|
|
123
135
|
```
|
|
124
136
|
|
|
125
137
|
**Returns the number property of the list**:
|
|
@@ -131,7 +143,7 @@ jexp '.number' ./data/orders.json
|
|
|
131
143
|
*Result*:
|
|
132
144
|
|
|
133
145
|
```json
|
|
134
|
-
["20001","20002"]
|
|
146
|
+
["20001","20002","20003"]
|
|
135
147
|
```
|
|
136
148
|
|
|
137
149
|
**Concatenates two properties and capitalizes the first one**:
|
|
@@ -259,7 +271,7 @@ jexp '.details' ./data/orders.json
|
|
|
259
271
|
*Result*:
|
|
260
272
|
|
|
261
273
|
```json
|
|
262
|
-
[{"article":"Pear","unitPrice":1.78,"qty":2},{"article":"Banana","unitPrice":1.99,"qty":1},{"article":"White grape","unitPrice":2.03,"qty":1},{"article":"Apple","unitPrice":2.15,"qty":1},{"article":"Banana","unitPrice":1.99,"qty":2},{"article":"Pear","unitPrice":1.78,"qty":1}]
|
|
274
|
+
[{"article":"Pear","unitPrice":1.78,"qty":2},{"article":"Banana","unitPrice":1.99,"qty":1},{"article":"White grape","unitPrice":2.03,"qty":1},{"article":"Apple","unitPrice":2.15,"qty":1},{"article":"Banana","unitPrice":1.99,"qty":2},{"article":"Pear","unitPrice":1.78,"qty":1},{"article":"Apple","unitPrice":2.15,"qty":1},{"article":"Banana","unitPrice":1.99,"qty":1},{"article":"Pear","unitPrice":1.78,"qty":1},{"article":"White grape","unitPrice":2.03,"qty":1}]
|
|
263
275
|
```
|
|
264
276
|
|
|
265
277
|
**Returns the article property of the list of details of each element of the list**:
|
|
@@ -271,7 +283,7 @@ jexp '.details.article' ./data/orders.json
|
|
|
271
283
|
*Result*:
|
|
272
284
|
|
|
273
285
|
```json
|
|
274
|
-
["Pear","Banana","White grape","Apple","Banana","Pear"]
|
|
286
|
+
["Pear","Banana","White grape","Apple","Banana","Pear","Apple","Banana","Pear","White grape"]
|
|
275
287
|
```
|
|
276
288
|
|
|
277
289
|
**Get the minimum of the total property**:
|
|
@@ -313,13 +325,13 @@ jexp '.details.max(p=> p.unitPrice * p.qty )' ./data/orders.json
|
|
|
313
325
|
**Get the middle value "unitPrice * p.qty" from all the details**:
|
|
314
326
|
|
|
315
327
|
```sh
|
|
316
|
-
jexp '.details.avg(p=> p.unitPrice * p.qty
|
|
328
|
+
jexp 'round(.details.avg(p=> p.unitPrice * p.qty),2)' ./data/orders.json
|
|
317
329
|
```
|
|
318
330
|
|
|
319
331
|
*Result*:
|
|
320
332
|
|
|
321
333
|
```json
|
|
322
|
-
2.
|
|
334
|
+
2.35
|
|
323
335
|
```
|
|
324
336
|
|
|
325
337
|
**Gets the sum of the total property**:
|
|
@@ -355,7 +367,7 @@ jexp '.details.count(p=> p.unitPrice * p.qty < 3 )' ./data/orders.json
|
|
|
355
367
|
*Result*:
|
|
356
368
|
|
|
357
369
|
```json
|
|
358
|
-
|
|
370
|
+
8
|
|
359
371
|
```
|
|
360
372
|
|
|
361
373
|
**Get the first article property of all details where "unitPrice * p.qty" is less than 3**:
|
|
@@ -367,19 +379,13 @@ jexp '.details.first(p=> p.unitPrice * p.qty < 3 ).article' ./data/orders.json
|
|
|
367
379
|
*Result*:
|
|
368
380
|
|
|
369
381
|
```json
|
|
370
|
-
"
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
**Get the last article property of all details where "unitPrice * p.qty" is less than 3**:
|
|
374
|
-
|
|
375
|
-
```sh
|
|
376
|
-
jexp '.details.last(p=> p.unitPrice * p.qty < 3 ).article' ./data/orders.json
|
|
382
|
+
"Banan…unitPrice * p.qty < 3 ).article' ./data/orders.json
|
|
377
383
|
```
|
|
378
384
|
|
|
379
385
|
*Result*:
|
|
380
386
|
|
|
381
387
|
```json
|
|
382
|
-
"
|
|
388
|
+
"White grape"
|
|
383
389
|
```
|
|
384
390
|
|
|
385
391
|
**Get the first detail where "unitPrice * p.qty" is less than 3 in beautiful format**:
|
|
@@ -407,7 +413,7 @@ curl -s https://raw.githubusercontent.com/FlavioLionelRita/jexp/main/data/orders
|
|
|
407
413
|
*Result*:
|
|
408
414
|
|
|
409
415
|
```json
|
|
410
|
-
|
|
416
|
+
23.44
|
|
411
417
|
```
|
|
412
418
|
|
|
413
419
|
**Get the smallest article**:
|
|
@@ -434,16 +440,16 @@ jexp '.details.max(p=> p.unitPrice * p.qty )' ./data/orders.json
|
|
|
434
440
|
3.98
|
|
435
441
|
```
|
|
436
442
|
|
|
437
|
-
**
|
|
443
|
+
**Average value of the price of the items purchased in the order 20003**:
|
|
438
444
|
|
|
439
445
|
```sh
|
|
440
|
-
jexp '.details.avg(p=> p.unitPrice
|
|
446
|
+
jexp 'round(.filter(p=> p.number == "20003").details.avg(p=> p.unitPrice),2)' ./data/orders.json
|
|
441
447
|
```
|
|
442
448
|
|
|
443
449
|
*Result*:
|
|
444
450
|
|
|
445
451
|
```json
|
|
446
|
-
2
|
|
452
|
+
2
|
|
447
453
|
```
|
|
448
454
|
|
|
449
455
|
**Get the total of the details of order 1**:
|
|
@@ -467,7 +473,7 @@ jexp '.details.count(p=> p.unitPrice * p.qty < 3 )' ./data/orders.json
|
|
|
467
473
|
*Result*:
|
|
468
474
|
|
|
469
475
|
```json
|
|
470
|
-
|
|
476
|
+
8
|
|
471
477
|
```
|
|
472
478
|
|
|
473
479
|
**Get the article of the first detail where the subtotal is less than 3**:
|
|
@@ -491,7 +497,7 @@ jexp '.details.last(p=> p.unitPrice * p.qty < 3 ).article' ./data/orders.json
|
|
|
491
497
|
*Result*:
|
|
492
498
|
|
|
493
499
|
```json
|
|
494
|
-
"
|
|
500
|
+
"White grape"
|
|
495
501
|
```
|
|
496
502
|
|
|
497
503
|
**Get the first detail where the subtotal is less than 3**:
|
|
@@ -515,7 +521,7 @@ jexp '.each(p=>p.total=p.details.sum(q=>q.qty*q.unitPrice)).map(p=>{nro:p.number
|
|
|
515
521
|
*Result*:
|
|
516
522
|
|
|
517
523
|
```json
|
|
518
|
-
[{"nro":"20001","total":7.58},{"nro":"20002","total":7.91}]
|
|
524
|
+
[{"nro":"20001","total":7.58},{"nro":"20002","total":7.91},{"nro":"20003","total":7.949999999999999}]
|
|
519
525
|
```
|
|
520
526
|
|
|
521
527
|
**Calculate the subtotal for each order**:
|
|
@@ -527,7 +533,7 @@ jexp '.details.foreach(p=>p.subtotal=p.qty*p.unitPrice).subtotal' ./data/orders.
|
|
|
527
533
|
*Result*:
|
|
528
534
|
|
|
529
535
|
```json
|
|
530
|
-
[3.56,1.99,2.03,2.15,3.98,1.78]
|
|
536
|
+
[3.56,1.99,2.03,2.15,3.98,1.78,2.15,1.99,1.78,2.03]
|
|
531
537
|
```
|
|
532
538
|
|
|
533
539
|
**calculates the total of all the details**:
|
|
@@ -539,7 +545,7 @@ jexp '.details.foreach(p=>total=nvl(total,0)+p.qty*p.unitPrice);total' ./data/or
|
|
|
539
545
|
*Result*:
|
|
540
546
|
|
|
541
547
|
```json
|
|
542
|
-
|
|
548
|
+
23.44
|
|
543
549
|
```
|
|
544
550
|
|
|
545
551
|
**Get the list of items without repeating**:
|
|
@@ -583,23 +589,23 @@ jexp '.details.map(p=>{article:p.article,count:count(1),total:sum(p.qty * p.unit
|
|
|
583
589
|
[
|
|
584
590
|
{
|
|
585
591
|
"article": "Pear",
|
|
586
|
-
"count":
|
|
587
|
-
"total":
|
|
592
|
+
"count": 3,
|
|
593
|
+
"total": 7.12
|
|
588
594
|
},
|
|
589
595
|
{
|
|
590
596
|
"article": "Banana",
|
|
591
|
-
"count":
|
|
592
|
-
"total":
|
|
597
|
+
"count": 3,
|
|
598
|
+
"total": 7.96
|
|
593
599
|
},
|
|
594
600
|
{
|
|
595
601
|
"article": "White grape",
|
|
596
|
-
"count":
|
|
597
|
-
"total":
|
|
602
|
+
"count": 2,
|
|
603
|
+
"total": 4.06
|
|
598
604
|
},
|
|
599
605
|
{
|
|
600
606
|
"article": "Apple",
|
|
601
|
-
"count":
|
|
602
|
-
"total":
|
|
607
|
+
"count": 2,
|
|
608
|
+
"total": 4.3
|
|
603
609
|
}
|
|
604
610
|
]
|
|
605
611
|
```
|
|
@@ -619,14 +625,14 @@ jexp '{total:.[0].details.sum(p=>p.qty * p.unitPrice)}' ./data/orders.json
|
|
|
619
625
|
**Get the total of the last order**:
|
|
620
626
|
|
|
621
627
|
```sh
|
|
622
|
-
jexp '{total
|
|
628
|
+
jexp '{total:round(.[.length()-1].details.sum(p=>p.qty * p.unitPrice),2)}' ./data/orders.json -b
|
|
623
629
|
```
|
|
624
630
|
|
|
625
631
|
*Result*:
|
|
626
632
|
|
|
627
633
|
```json
|
|
628
634
|
{
|
|
629
|
-
"total": 7.
|
|
635
|
+
"total": 7.95
|
|
630
636
|
}
|
|
631
637
|
```
|
|
632
638
|
|
|
@@ -639,24 +645,78 @@ jexp '.map(p=>{nro:p.number,total:p.details.sum(q=>q.qty * q.unitPrice)})' ./dat
|
|
|
639
645
|
*Result*:
|
|
640
646
|
|
|
641
647
|
```json
|
|
642
|
-
[{"nro":"20001","total":7.58},{"nro":"20002","total":7.91}]
|
|
648
|
+
[{"nro":"20001","total":7.58},{"nro":"20002","total":7.91},{"nro":"20003","total":7.949999999999999}]
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
**All articles that are in orders 20001 and 20003**:
|
|
652
|
+
|
|
653
|
+
```sh
|
|
654
|
+
jexp '.[0].details.article.union(.[1].details.article)' ./data/orders.json
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
*Result*:
|
|
658
|
+
|
|
659
|
+
```json
|
|
660
|
+
["Pear","Banana","White grape","Apple"]
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
**The articles in common between order 20001 and 20002**:
|
|
664
|
+
|
|
665
|
+
```sh
|
|
666
|
+
jexp '.[0].details.article.intersection(.[1].details.article)' ./data/orders.json
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
*Result*:
|
|
670
|
+
|
|
671
|
+
```json
|
|
672
|
+
["Banana","Pear"]
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
**Articles that are in order 20001 and are not in order 20002**:
|
|
676
|
+
|
|
677
|
+
```sh
|
|
678
|
+
jexp '.[0].details.article.difference(.[1].details.article)' ./data/orders.json
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
*Result*:
|
|
682
|
+
|
|
683
|
+
```json
|
|
684
|
+
["White grape"]
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
**Articles of orders 20001 and 20003 that are not shared**:
|
|
688
|
+
|
|
689
|
+
```sh
|
|
690
|
+
jexp '.[0].details.article.symmetricDifference(.[1].details.article)' ./data/orders.json
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
*Result*:
|
|
694
|
+
|
|
695
|
+
```json
|
|
696
|
+
["White grape","Apple"]
|
|
643
697
|
```
|
|
644
698
|
|
|
645
699
|
## js-expression
|
|
646
700
|
|
|
647
|
-
[Js-expression](https://www.npmjs.com/package/js-expressions) is an extensible expression evaluator and parser.
|
|
648
|
-
|
|
701
|
+
> [Js-expression](https://www.npmjs.com/package/js-expressions) is an extensible expression evaluator and parser.
|
|
702
|
+
>
|
|
703
|
+
> Besides the operators, functions, variables, objects and arrays that are supported.
|
|
649
704
|
|
|
650
705
|
### Documentation
|
|
651
706
|
|
|
652
|
-
- [
|
|
653
|
-
- [Assignment](https://github.com/FlavioLionelRita/js-expressions/wiki/Assignment)
|
|
654
|
-
- [Bitwise](https://github.com/FlavioLionelRita/js-expressions/wiki/Bitwise)
|
|
707
|
+
- [Arithmetic](https://github.com/FlavioLionelRita/js-expressions/wiki/Arithmetic)
|
|
655
708
|
- [Comparison](https://github.com/FlavioLionelRita/js-expressions/wiki/Comparison)
|
|
656
|
-
- [Control flows](https://github.com/FlavioLionelRita/js-expressions/wiki/Flows)
|
|
657
|
-
- [Datetime](https://github.com/FlavioLionelRita/js-expressions/wiki/Datetime)
|
|
658
|
-
- [Extend](https://github.com/FlavioLionelRita/js-expressions/wiki/Extend)
|
|
659
709
|
- [Logical](https://github.com/FlavioLionelRita/js-expressions/wiki/Logical)
|
|
660
|
-
- [
|
|
710
|
+
- [Bitwise](https://github.com/FlavioLionelRita/js-expressions/wiki/Bitwise)
|
|
661
711
|
- [Numeric](https://github.com/FlavioLionelRita/js-expressions/wiki/Numeric)
|
|
662
712
|
- [String](https://github.com/FlavioLionelRita/js-expressions/wiki/String)
|
|
713
|
+
- [Datetime](https://github.com/FlavioLionelRita/js-expressions/wiki/Datetime)
|
|
714
|
+
- [Nullable](https://github.com/FlavioLionelRita/js-expressions/wiki/Nullable)
|
|
715
|
+
- [Conversion](https://github.com/FlavioLionelRita/js-expressions/wiki/Conversion)
|
|
716
|
+
- [Assignment](https://github.com/FlavioLionelRita/js-expressions/wiki/Assignment)
|
|
717
|
+
- [Array](https://github.com/FlavioLionelRita/js-expressions/wiki/Array)
|
|
718
|
+
- [Arrow](https://github.com/FlavioLionelRita/js-expressions/wiki/Arrow)
|
|
719
|
+
- [Group](https://github.com/FlavioLionelRita/js-expressions/wiki/Group)
|
|
720
|
+
- [Sets](https://github.com/FlavioLionelRita/js-expressions/wiki/Sets)
|
|
721
|
+
- [Control flows](https://github.com/FlavioLionelRita/js-expressions/wiki/Flows)
|
|
722
|
+
- [Extend](https://github.com/FlavioLionelRita/js-expressions/wiki/Extend)
|
package/index.js
CHANGED
|
@@ -16,7 +16,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
const js_expressions_1 = require("js-expressions");
|
|
17
17
|
const path_1 = __importDefault(require("path"));
|
|
18
18
|
const { program, Option } = require('commander');
|
|
19
|
-
const colorize = require('json-colorizer');
|
|
20
19
|
const yaml = require('js-yaml');
|
|
21
20
|
const run = (expression, source, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
21
|
let data = {};
|
|
@@ -51,12 +50,7 @@ const run = (expression, source, options) => __awaiter(void 0, void 0, void 0, f
|
|
|
51
50
|
}
|
|
52
51
|
else {
|
|
53
52
|
const formatted = options.beautiful ? JSON.stringify(result, null, 2) : JSON.stringify(result);
|
|
54
|
-
|
|
55
|
-
console.log(colorize(formatted));
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
console.log(formatted);
|
|
59
|
-
}
|
|
53
|
+
console.log(formatted);
|
|
60
54
|
}
|
|
61
55
|
});
|
|
62
56
|
const getInput = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -81,7 +75,6 @@ function main() {
|
|
|
81
75
|
.argument('[source]')
|
|
82
76
|
.addOption(new Option('-o, --output <format>', 'Force output').choices(['json', 'yaml']))
|
|
83
77
|
.option('-b, --beautiful', 'Beautiful output', false)
|
|
84
|
-
.option('-d, --decorate', 'Decorate output', false)
|
|
85
78
|
.option('-q, --query-file <path>', 'query file')
|
|
86
79
|
.action((expression, source, options) => __awaiter(this, void 0, void 0, function* () {
|
|
87
80
|
try {
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,mDAA2D;AAC3D,gDAAuB;AACvB,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;AAChD,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,mDAA2D;AAC3D,gDAAuB;AACvB,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,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AC,uBAAuB,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;aACxF,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,KAAK,CAAC;aACpD,MAAM,CAAC,yBAAyB,EAAE,YAAY,CAAC;aAC/C,MAAM,CAAC,CAAO,UAAiB,EAAE,MAAU,EAAE,OAAW,EAAE,EAAE;YAC5D,IAAI;gBACH,MAAM,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,QAAQ,EAAS,CAAA;gBACtE,MAAM,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;aACpC;YAAC,OAAO,KAAS,EAAE;gBACnB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;aAC5B;QACF,CAAC,CAAA,CAAC,CAAA;QACH,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACvC,CAAC;CAAA;AACD,IAAI,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jexp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Parser and evaluator of expressions by line of commands. The expressions correspond to the package js-expressions",
|
|
5
5
|
"author": "Flavio Lionel Rita <flaviolrita@hotmail.com>",
|
|
6
6
|
"license": "Apache-2.0 License",
|
|
@@ -18,9 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"commander": "^9.4.0",
|
|
21
|
-
"js-expressions": "1.0
|
|
22
|
-
"js-yaml": "^4.1.0"
|
|
23
|
-
"json-colorizer": "^2.2.2"
|
|
21
|
+
"js-expressions": "1.1.0",
|
|
22
|
+
"js-yaml": "^4.1.0"
|
|
24
23
|
},
|
|
25
24
|
"keywords": [
|
|
26
25
|
"cli",
|