@ezs/basics 2.7.1 → 2.8.0
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 +159 -225
- package/lib/bib-parse.js +3 -4
- package/lib/buf-object.js +2 -3
- package/lib/csv-object.js +2 -3
- package/lib/csv-parse.js +3 -4
- package/lib/csv-string.js +3 -4
- package/lib/file-load.js +1 -1
- package/lib/file-save.js +1 -1
- package/lib/index.js +2 -7
- package/lib/ini-string.js +2 -3
- package/lib/json-parse.js +3 -4
- package/lib/obj-count.js +2 -3
- package/lib/obj-flatten.js +2 -2
- package/lib/obj-standardize.js +3 -4
- package/lib/request.js +2 -3
- package/lib/tar-dump.js +1 -1
- package/lib/tar-extract.js +1 -1
- package/lib/txt-concat.js +2 -3
- package/lib/txt-object.js +2 -3
- package/lib/txt-parse.js +2 -3
- package/lib/txt-zip.js +1 -1
- package/lib/url-connect.js +1 -1
- package/lib/url-fetch.js +1 -1
- package/lib/url-parse.js +2 -3
- package/lib/url-request.js +1 -1
- package/lib/url-stream.js +1 -1
- package/lib/url-string.js +2 -3
- package/lib/xml-convert.js +3 -4
- package/lib/xml-parse.js +3 -4
- package/lib/xml-string.js +3 -4
- package/lib/zip-extract.js +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -14,40 +14,38 @@ npm install @ezs/basics
|
|
|
14
14
|
|
|
15
15
|
#### Table of Contents
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- [XMLString](#xmlstring)
|
|
50
|
-
- [ZIPExtract](#zipextract)
|
|
17
|
+
* [BIBParse](#bibparse)
|
|
18
|
+
* [BUFObject](#bufobject)
|
|
19
|
+
* [CSVObject](#csvobject)
|
|
20
|
+
* [CSVParse](#csvparse)
|
|
21
|
+
* [CSVString](#csvstring)
|
|
22
|
+
* [FILELoad](#fileload)
|
|
23
|
+
* [FILEMerge](#filemerge)
|
|
24
|
+
* [FILESave](#filesave)
|
|
25
|
+
* [INIString](#inistring)
|
|
26
|
+
* [JSONParse](#jsonparse)
|
|
27
|
+
* [JSONString](#jsonstring)
|
|
28
|
+
* [OBJCount](#objcount)
|
|
29
|
+
* [OBJFlatten](#objflatten)
|
|
30
|
+
* [OBJNamespaces](#objnamespaces)
|
|
31
|
+
* [OBJStandardize](#objstandardize)
|
|
32
|
+
* [TARDump](#tardump)
|
|
33
|
+
* [TARExtract](#tarextract)
|
|
34
|
+
* [TXTConcat](#txtconcat)
|
|
35
|
+
* [TXTObject](#txtobject)
|
|
36
|
+
* [TXTParse](#txtparse)
|
|
37
|
+
* [TXTZip](#txtzip)
|
|
38
|
+
* [URLConnect](#urlconnect)
|
|
39
|
+
* [URLFetch](#urlfetch)
|
|
40
|
+
* [URLPagination](#urlpagination)
|
|
41
|
+
* [URLParse](#urlparse)
|
|
42
|
+
* [URLRequest](#urlrequest)
|
|
43
|
+
* [URLStream](#urlstream)
|
|
44
|
+
* [URLString](#urlstring)
|
|
45
|
+
* [XMLConvert](#xmlconvert)
|
|
46
|
+
* [XMLParse](#xmlparse)
|
|
47
|
+
* [XMLString](#xmlstring)
|
|
48
|
+
* [ZIPExtract](#zipextract)
|
|
51
49
|
|
|
52
50
|
### BIBParse
|
|
53
51
|
|
|
@@ -65,7 +63,7 @@ Output:
|
|
|
65
63
|
["a", "b", "c", "d"]
|
|
66
64
|
```
|
|
67
65
|
|
|
68
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
66
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
69
67
|
|
|
70
68
|
### BUFObject
|
|
71
69
|
|
|
@@ -74,9 +72,9 @@ For example, it's useful to send string to browser.
|
|
|
74
72
|
|
|
75
73
|
#### Parameters
|
|
76
74
|
|
|
77
|
-
|
|
75
|
+
* `none` **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)** 
|
|
78
76
|
|
|
79
|
-
Returns **[Buffer](https://nodejs.org/api/buffer.html)
|
|
77
|
+
Returns **[Buffer](https://nodejs.org/api/buffer.html)** 
|
|
80
78
|
|
|
81
79
|
### CSVObject
|
|
82
80
|
|
|
@@ -140,9 +138,9 @@ Output:
|
|
|
140
138
|
|
|
141
139
|
#### Parameters
|
|
142
140
|
|
|
143
|
-
|
|
141
|
+
* `none` **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)** 
|
|
144
142
|
|
|
145
|
-
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
143
|
+
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object) | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** 
|
|
146
144
|
|
|
147
145
|
### CSVParse
|
|
148
146
|
|
|
@@ -150,8 +148,8 @@ Take `String` and parse it as CSV to generate arrays.
|
|
|
150
148
|
|
|
151
149
|
See:
|
|
152
150
|
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
* [CSVObject](#csvobject)
|
|
152
|
+
* <https://github.com/Inist-CNRS/node-csv-string>
|
|
155
153
|
|
|
156
154
|
Input:
|
|
157
155
|
|
|
@@ -172,10 +170,10 @@ Output:
|
|
|
172
170
|
|
|
173
171
|
#### Parameters
|
|
174
172
|
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
* `separator` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** to indicate the CSV separator (optional, default `auto`)
|
|
174
|
+
* `quote` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** to indicate the CSV quote. (optional, default `auto`)
|
|
177
175
|
|
|
178
|
-
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)
|
|
176
|
+
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>>** 
|
|
179
177
|
|
|
180
178
|
### CSVString
|
|
181
179
|
|
|
@@ -210,12 +208,12 @@ a;b;c
|
|
|
210
208
|
|
|
211
209
|
#### Parameters
|
|
212
210
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
211
|
+
* `format` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** if set to "strict" the fields will be
|
|
212
|
+
wrapped with double quote (optional, default `standard`)
|
|
213
|
+
* `separator` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** to indicate the CSV separator (optional, default `";"`)
|
|
214
|
+
* `header` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** first line contains key name (optional, default `true`)
|
|
217
215
|
|
|
218
|
-
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
216
|
+
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
219
217
|
|
|
220
218
|
### FILELoad
|
|
221
219
|
|
|
@@ -235,6 +233,7 @@ plugin = basics
|
|
|
235
233
|
[FILELoad]
|
|
236
234
|
location = /tmp
|
|
237
235
|
[CSVParse]
|
|
236
|
+
|
|
238
237
|
```
|
|
239
238
|
|
|
240
239
|
Output:
|
|
@@ -247,10 +246,10 @@ Output:
|
|
|
247
246
|
|
|
248
247
|
#### Parameters
|
|
249
248
|
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
* `location` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Directory location (optional, default `TMPDIR`)
|
|
250
|
+
* `compress` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Enable gzip compression (optional, default `false`)
|
|
252
251
|
|
|
253
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
252
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
254
253
|
|
|
255
254
|
### FILEMerge
|
|
256
255
|
|
|
@@ -271,6 +270,7 @@ plugin = basics
|
|
|
271
270
|
[replace]
|
|
272
271
|
path = contentOfFile1AndFile2
|
|
273
272
|
value = self()
|
|
273
|
+
|
|
274
274
|
```
|
|
275
275
|
|
|
276
276
|
Output:
|
|
@@ -281,7 +281,7 @@ Output:
|
|
|
281
281
|
]
|
|
282
282
|
```
|
|
283
283
|
|
|
284
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
284
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
285
285
|
|
|
286
286
|
### FILESave
|
|
287
287
|
|
|
@@ -315,13 +315,13 @@ Output:
|
|
|
315
315
|
|
|
316
316
|
#### Parameters
|
|
317
317
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
318
|
+
* `location` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Directory location (optional, default `TMPDIR`)
|
|
319
|
+
* `identifier` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** File name
|
|
320
|
+
* `content` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Content to save instead of using input object
|
|
321
|
+
* `jsonl` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Save as json line (optional, default `false`)
|
|
322
|
+
* `compress` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Enable gzip compression (optional, default `false`)
|
|
323
323
|
|
|
324
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
324
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
325
325
|
|
|
326
326
|
### INIString
|
|
327
327
|
|
|
@@ -372,7 +372,7 @@ arg2 = {"x":1,"y":2}
|
|
|
372
372
|
[secvide2]
|
|
373
373
|
```
|
|
374
374
|
|
|
375
|
-
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
375
|
+
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
376
376
|
|
|
377
377
|
### JSONParse
|
|
378
378
|
|
|
@@ -417,9 +417,9 @@ Output:
|
|
|
417
417
|
|
|
418
418
|
#### Parameters
|
|
419
419
|
|
|
420
|
-
|
|
420
|
+
* `separator` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** to split at every JSONPath found (optional, default `"*"`)
|
|
421
421
|
|
|
422
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
422
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
423
423
|
|
|
424
424
|
### JSONString
|
|
425
425
|
|
|
@@ -439,10 +439,10 @@ Output:
|
|
|
439
439
|
|
|
440
440
|
#### Parameters
|
|
441
441
|
|
|
442
|
-
|
|
443
|
-
|
|
442
|
+
* `wrap` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** every document is wrapped into an array (optional, default `true`)
|
|
443
|
+
* `indent` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** indent JSON (optional, default `false`)
|
|
444
444
|
|
|
445
|
-
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
445
|
+
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
446
446
|
|
|
447
447
|
### OBJCount
|
|
448
448
|
|
|
@@ -462,9 +462,9 @@ Output:
|
|
|
462
462
|
|
|
463
463
|
#### Parameters
|
|
464
464
|
|
|
465
|
-
|
|
465
|
+
* `none` **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)** 
|
|
466
466
|
|
|
467
|
-
Returns **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
|
|
467
|
+
Returns **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
|
|
468
468
|
|
|
469
469
|
### OBJFlatten
|
|
470
470
|
|
|
@@ -492,11 +492,11 @@ Output:
|
|
|
492
492
|
|
|
493
493
|
#### Parameters
|
|
494
494
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
495
|
+
* `separator` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** choose a character to flatten keys (optional, default `"/"`)
|
|
496
|
+
* `reverse` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** unflatten instead of flatten keys (optional, default `false`)
|
|
497
|
+
* `safe` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** preserve arrays and their contents, (optional, default `false`)
|
|
498
498
|
|
|
499
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
499
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
500
500
|
|
|
501
501
|
### OBJNamespaces
|
|
502
502
|
|
|
@@ -533,6 +533,7 @@ namespace = http://purl.org/dc/terms/
|
|
|
533
533
|
|
|
534
534
|
prefix = place:
|
|
535
535
|
namespace = http://purl.org/ontology/places#
|
|
536
|
+
|
|
536
537
|
```
|
|
537
538
|
|
|
538
539
|
Output:
|
|
@@ -556,11 +557,11 @@ Output:
|
|
|
556
557
|
|
|
557
558
|
#### Parameters
|
|
558
559
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
560
|
+
* `prefix` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** the alias for a namespace
|
|
561
|
+
* `namespace` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** the namespace to substitute by a prefix
|
|
562
|
+
* `reference` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a regex to find key that contains a namespace to substitute (optional, default `null`)
|
|
562
563
|
|
|
563
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
564
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
564
565
|
|
|
565
566
|
### OBJStandardize
|
|
566
567
|
|
|
@@ -584,9 +585,9 @@ Output:
|
|
|
584
585
|
|
|
585
586
|
#### Parameters
|
|
586
587
|
|
|
587
|
-
|
|
588
|
+
* `none` **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)** 
|
|
588
589
|
|
|
589
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
590
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
590
591
|
|
|
591
592
|
### TARDump
|
|
592
593
|
|
|
@@ -599,12 +600,12 @@ Take all recevied objects and build a tar file
|
|
|
599
600
|
|
|
600
601
|
#### Parameters
|
|
601
602
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
603
|
+
* `manifest` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Location path to store files in the tarball
|
|
604
|
+
* `location` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Location path to store files in the tarball (optional, default `data`)
|
|
605
|
+
* `json` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Convert to JSON the content of each chunk (optional, default `true`)
|
|
606
|
+
* `extension` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Choose extension fo each file (optional, default `json`)
|
|
607
|
+
* `additionalFile` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Path to an additional file that will be add to tarball
|
|
608
|
+
* `compress` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Enable gzip compression (optional, default `false`)
|
|
608
609
|
|
|
609
610
|
### TARExtract
|
|
610
611
|
|
|
@@ -621,12 +622,12 @@ It returns to the output stream
|
|
|
621
622
|
|
|
622
623
|
#### Parameters
|
|
623
624
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
625
|
+
* `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Regex to select the files to extract (optional, default `"**\/*.json"`)
|
|
626
|
+
* `json` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Parse as JSON the content of each file (optional, default `true`)
|
|
627
|
+
* `text` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** The content of each file is converted to a string (otherwise it remains a buffer) (optional, default `true`)
|
|
628
|
+
* `compress` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Enable gzip compression (optional, default `false`)
|
|
628
629
|
|
|
629
|
-
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)
|
|
630
|
+
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<{id: [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), value: [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>** 
|
|
630
631
|
|
|
631
632
|
### TXTConcat
|
|
632
633
|
|
|
@@ -646,49 +647,9 @@ Output:
|
|
|
646
647
|
|
|
647
648
|
#### Parameters
|
|
648
649
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
652
|
-
|
|
653
|
-
### TXTInflection
|
|
654
|
-
|
|
655
|
-
Take a `String` and inflect it with or more transformers from this list
|
|
656
|
-
pluralize, singularize, camelize, underscore, humanize, capitalize,
|
|
657
|
-
dasherize, titleize, demodulize, tableize, classify, foreign_key, ordinalize
|
|
658
|
-
|
|
659
|
-
Input:
|
|
660
|
-
|
|
661
|
-
```json
|
|
662
|
-
{ "id": 1, "value": "all job" }
|
|
663
|
-
```
|
|
664
|
-
|
|
665
|
-
Script:
|
|
666
|
-
|
|
667
|
-
```ini
|
|
668
|
-
[TXTInflection]
|
|
669
|
-
transform = pluralize
|
|
670
|
-
transform = capitalize
|
|
671
|
-
transform = dasherize
|
|
672
|
-
```
|
|
673
|
-
|
|
674
|
-
Output:
|
|
675
|
-
|
|
676
|
-
```json
|
|
677
|
-
{ "id": 1, "value": "All-jobs" }
|
|
678
|
-
```
|
|
679
|
-
|
|
680
|
-
#### Parameters
|
|
681
|
-
|
|
682
|
-
- `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** path of the field to segment (optional, default `"value"`)
|
|
683
|
-
- `transform` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** name of a transformer
|
|
684
|
-
|
|
685
|
-
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**
|
|
686
|
-
|
|
687
|
-
**Meta**
|
|
688
|
-
|
|
689
|
-
- **deprecated**: see <https://inist-cnrs.github.io/ezs/#/plugin-strings?id=inflection>
|
|
690
|
-
see <https://www.npmjs.com/package/inflection>
|
|
650
|
+
* `none` **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)** 
|
|
691
651
|
|
|
652
|
+
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
692
653
|
|
|
693
654
|
### TXTObject
|
|
694
655
|
|
|
@@ -709,9 +670,9 @@ Output:
|
|
|
709
670
|
|
|
710
671
|
#### Parameters
|
|
711
672
|
|
|
712
|
-
|
|
673
|
+
* `key` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** choose a the key name (optional, default `"value"`)
|
|
713
674
|
|
|
714
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
675
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
715
676
|
|
|
716
677
|
### TXTParse
|
|
717
678
|
|
|
@@ -731,36 +692,9 @@ Output:
|
|
|
731
692
|
|
|
732
693
|
#### Parameters
|
|
733
694
|
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
737
|
-
|
|
738
|
-
### TXTSentences
|
|
739
|
-
|
|
740
|
-
Take a `String` and split it into an array of sentences.
|
|
741
|
-
|
|
742
|
-
Input:
|
|
743
|
-
|
|
744
|
-
```json
|
|
745
|
-
{ "id": 1, "value": "First sentence? Second sentence. My name is Bond, J. Bond." }
|
|
746
|
-
```
|
|
747
|
-
|
|
748
|
-
Output:
|
|
749
|
-
|
|
750
|
-
```json
|
|
751
|
-
{ "id": 1, "value": ["First sentence?", "Second sentence.", "My name is Bond, J. Bond."] }
|
|
752
|
-
```
|
|
753
|
-
|
|
754
|
-
#### Parameters
|
|
755
|
-
|
|
756
|
-
- `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** path of the field to segment (optional, default `"value"`)
|
|
757
|
-
|
|
758
|
-
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**
|
|
759
|
-
|
|
760
|
-
**Meta**
|
|
761
|
-
|
|
762
|
-
- **deprecated**: see <https://inist-cnrs.github.io/ezs/#/plugin-strings?id=sentences>
|
|
695
|
+
* `separator` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** choose character which trigger the split (optional, default `"\n"`)
|
|
763
696
|
|
|
697
|
+
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
764
698
|
|
|
765
699
|
### TXTZip
|
|
766
700
|
|
|
@@ -771,9 +705,9 @@ algorithm to compress strings.
|
|
|
771
705
|
|
|
772
706
|
#### Parameters
|
|
773
707
|
|
|
774
|
-
|
|
708
|
+
* `unzip` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** to Unzip input (optional, default `false`)
|
|
775
709
|
|
|
776
|
-
Returns **[Buffer](https://nodejs.org/api/buffer.html)
|
|
710
|
+
Returns **[Buffer](https://nodejs.org/api/buffer.html)** 
|
|
777
711
|
|
|
778
712
|
### URLConnect
|
|
779
713
|
|
|
@@ -785,15 +719,15 @@ Useful to send JSON data to an API and get results.
|
|
|
785
719
|
|
|
786
720
|
#### Parameters
|
|
787
721
|
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
722
|
+
* `url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** URL to fetch
|
|
723
|
+
* `streaming` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Direct connection to the Object Stream server (disables the retries setting) (optional, default `false`)
|
|
724
|
+
* `json` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Parse as JSON the content of URL (optional, default `false`)
|
|
725
|
+
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `1000`)
|
|
726
|
+
* `noerror` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ignore all errors (optional, default `false`)
|
|
727
|
+
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)
|
|
728
|
+
* `encoder` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The statement to encode each chunk to a string (optional, default `dump`)
|
|
795
729
|
|
|
796
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
730
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
797
731
|
|
|
798
732
|
### URLFetch
|
|
799
733
|
|
|
@@ -803,16 +737,16 @@ Or if no target is specified, the output will be the returned content of URL.
|
|
|
803
737
|
|
|
804
738
|
#### Parameters
|
|
805
739
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
740
|
+
* `url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** URL to fetch
|
|
741
|
+
* `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** if present select value to send (by POST)
|
|
742
|
+
* `target` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** choose the key to set
|
|
743
|
+
* `json` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** parse as JSON the content of URL (optional, default `false`)
|
|
744
|
+
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** timeout in milliseconds (optional, default `1000`)
|
|
745
|
+
* `mimetype` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** mimetype for value of path (if presents) (optional, default `"application/json"`)
|
|
746
|
+
* `noerror` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** ignore all errors, the target field will remain undefined (optional, default `false`)
|
|
747
|
+
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)
|
|
814
748
|
|
|
815
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
749
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
816
750
|
|
|
817
751
|
### URLPagination
|
|
818
752
|
|
|
@@ -870,11 +804,11 @@ Output:
|
|
|
870
804
|
|
|
871
805
|
#### Parameters
|
|
872
806
|
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
807
|
+
* `total` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** total to use for the pagination (optional, default `0`)
|
|
808
|
+
* `limit` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** limit to use to pagination (optional, default `10`)
|
|
809
|
+
* `maxPages` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** maxPages to use to pagination (optional, default `1000`)
|
|
876
810
|
|
|
877
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
811
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
878
812
|
|
|
879
813
|
### URLParse
|
|
880
814
|
|
|
@@ -882,26 +816,26 @@ Take an URL `String`, parse it and return `Object`.
|
|
|
882
816
|
|
|
883
817
|
Fields of the returned object:
|
|
884
818
|
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
819
|
+
* href
|
|
820
|
+
* origin
|
|
821
|
+
* protocol
|
|
822
|
+
* username
|
|
823
|
+
* password
|
|
824
|
+
* host
|
|
825
|
+
* hostname
|
|
826
|
+
* port
|
|
827
|
+
* pathname
|
|
828
|
+
* search
|
|
829
|
+
* hash
|
|
896
830
|
|
|
897
831
|
URLString statement convert such an object to a string.
|
|
898
832
|
|
|
899
833
|
See:
|
|
900
834
|
|
|
901
|
-
|
|
902
|
-
|
|
835
|
+
* [URLString](#urlstring)
|
|
836
|
+
* <https://nodejs.org/api/url.html>
|
|
903
837
|
|
|
904
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
838
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
905
839
|
|
|
906
840
|
### URLRequest
|
|
907
841
|
|
|
@@ -932,15 +866,15 @@ Output:
|
|
|
932
866
|
|
|
933
867
|
#### Parameters
|
|
934
868
|
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
869
|
+
* `url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** URL to fetch
|
|
870
|
+
* `json` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** parse result as json (optional, default `true`)
|
|
871
|
+
* `target` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** choose the key to set
|
|
872
|
+
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `1000`)
|
|
873
|
+
* `noerror` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ignore all errors, the target field will remain undefined (optional, default `false`)
|
|
874
|
+
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)
|
|
875
|
+
* `insert` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** a header response value in the result
|
|
942
876
|
|
|
943
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
877
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
944
878
|
|
|
945
879
|
### URLStream
|
|
946
880
|
|
|
@@ -1002,13 +936,13 @@ Output:
|
|
|
1002
936
|
|
|
1003
937
|
#### Parameters
|
|
1004
938
|
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
939
|
+
* `url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** URL to fetch (by default input string is taken)
|
|
940
|
+
* `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** choose the path to split JSON result (optional, default `"*"`)
|
|
941
|
+
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `1000`)
|
|
942
|
+
* `noerror` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ignore all errors, the target field will remain undefined (optional, default `false`)
|
|
943
|
+
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)
|
|
1010
944
|
|
|
1011
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
945
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
1012
946
|
|
|
1013
947
|
### URLString
|
|
1014
948
|
|
|
@@ -1016,7 +950,7 @@ Take an `Object` representing an URL and stringify it.
|
|
|
1016
950
|
|
|
1017
951
|
See [URLParse](#urlparse)
|
|
1018
952
|
|
|
1019
|
-
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
953
|
+
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
1020
954
|
|
|
1021
955
|
### XMLConvert
|
|
1022
956
|
|
|
@@ -1086,10 +1020,10 @@ See <https://www.npmjs.com/package/xml-mapping>
|
|
|
1086
1020
|
|
|
1087
1021
|
#### Parameters
|
|
1088
1022
|
|
|
1089
|
-
|
|
1090
|
-
|
|
1023
|
+
* `invert` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** change conversion (JSON to XML) (optional, default `false`)
|
|
1024
|
+
* `prologue` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** add XML prologue (optional, default `false`)
|
|
1091
1025
|
|
|
1092
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
1026
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
1093
1027
|
|
|
1094
1028
|
### XMLParse
|
|
1095
1029
|
|
|
@@ -1118,9 +1052,9 @@ See <https://www.npmjs.com/package/xml-splitter>
|
|
|
1118
1052
|
|
|
1119
1053
|
#### Parameters
|
|
1120
1054
|
|
|
1121
|
-
|
|
1055
|
+
* `separator` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** choose a character for flatten keys (optional, default `"/"`)
|
|
1122
1056
|
|
|
1123
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
1057
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
1124
1058
|
|
|
1125
1059
|
### XMLString
|
|
1126
1060
|
|
|
@@ -1144,12 +1078,12 @@ See [XMLParse](#xmlparse)
|
|
|
1144
1078
|
|
|
1145
1079
|
#### Parameters
|
|
1146
1080
|
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1081
|
+
* `rootElement` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Root element name for the tag which starts and close the feed (optional, default `"items"`)
|
|
1082
|
+
* `contentElement` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Content element name for the tag which starts and closes each item (optional, default `"item"`)
|
|
1083
|
+
* `rootNamespace` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Namespace for the root tag (xmlns=)
|
|
1084
|
+
* `prologue` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Add XML prologue `<?xml` (optional, default `false`)
|
|
1151
1085
|
|
|
1152
|
-
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
1086
|
+
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
1153
1087
|
|
|
1154
1088
|
### ZIPExtract
|
|
1155
1089
|
|
|
@@ -1166,6 +1100,6 @@ It returns to the output stream
|
|
|
1166
1100
|
|
|
1167
1101
|
#### Parameters
|
|
1168
1102
|
|
|
1169
|
-
|
|
1103
|
+
* `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Regex to select the files to extract (optional, default `"**\/*.json"`)
|
|
1170
1104
|
|
|
1171
|
-
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)
|
|
1105
|
+
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<{id: [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), value: [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>** 
|
package/lib/bib-parse.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _string_decoder = require("string_decoder");
|
|
8
8
|
var _bib2json = _interopRequireDefault(require("bib2json"));
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
function BIBParse(data, feed) {
|
|
11
11
|
if (!this.decoder) {
|
|
12
12
|
this.decoder = new _string_decoder.StringDecoder('utf8');
|
|
@@ -54,7 +54,6 @@ function BIBParse(data, feed) {
|
|
|
54
54
|
* @name BIBParse
|
|
55
55
|
* @returns {Object}
|
|
56
56
|
*/
|
|
57
|
-
var _default = {
|
|
57
|
+
var _default = exports.default = {
|
|
58
58
|
BIBParse
|
|
59
|
-
};
|
|
60
|
-
exports.default = _default;
|
|
59
|
+
};
|
package/lib/buf-object.js
CHANGED
package/lib/csv-object.js
CHANGED
package/lib/csv-parse.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _csvString = _interopRequireDefault(require("csv-string"));
|
|
8
8
|
var _streamWrite = _interopRequireDefault(require("stream-write"));
|
|
9
9
|
var _string_decoder = require("string_decoder");
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
function CSVParse(data, feed) {
|
|
12
12
|
const separator = this.getParam('separator');
|
|
13
13
|
const quote = this.getParam('quote');
|
|
@@ -57,7 +57,6 @@ function CSVParse(data, feed) {
|
|
|
57
57
|
* @param {String} [quote=auto] to indicate the CSV quote.
|
|
58
58
|
* @returns {Array<String[]>}
|
|
59
59
|
*/
|
|
60
|
-
var _default = {
|
|
60
|
+
var _default = exports.default = {
|
|
61
61
|
CSVParse
|
|
62
|
-
};
|
|
63
|
-
exports.default = _default;
|
|
62
|
+
};
|
package/lib/csv-string.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _csvString = _interopRequireDefault(require("csv-string"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
const isNullOrUndefined = value => value === undefined || value === null;
|
|
10
10
|
function strict(data, sep) {
|
|
11
11
|
const q = new RegExp('"', 'g');
|
|
@@ -75,7 +75,6 @@ function CSVString(data, feed) {
|
|
|
75
75
|
* @param {Boolean} [header=true] first line contains key name
|
|
76
76
|
* @returns {String}
|
|
77
77
|
*/
|
|
78
|
-
var _default = {
|
|
78
|
+
var _default = exports.default = {
|
|
79
79
|
CSVString
|
|
80
|
-
};
|
|
81
|
-
exports.default = _default;
|
|
80
|
+
};
|
package/lib/file-load.js
CHANGED
|
@@ -9,7 +9,7 @@ var _fs = require("fs");
|
|
|
9
9
|
var _path = require("path");
|
|
10
10
|
var _os = require("os");
|
|
11
11
|
var _higherPath = _interopRequireDefault(require("higher-path"));
|
|
12
|
-
function _interopRequireDefault(
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
/**
|
|
14
14
|
* Take `Object` containing filename et throw content by chunk
|
|
15
15
|
*
|
package/lib/file-save.js
CHANGED
|
@@ -12,7 +12,7 @@ var _pathExists = _interopRequireDefault(require("path-exists"));
|
|
|
12
12
|
var _makeDir = _interopRequireDefault(require("make-dir"));
|
|
13
13
|
var _streamWrite = _interopRequireDefault(require("stream-write"));
|
|
14
14
|
var _debug = _interopRequireDefault(require("debug"));
|
|
15
|
-
function _interopRequireDefault(
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
const eol = '\n';
|
|
17
17
|
const toJSONL = line => JSON.stringify(line).concat(eol);
|
|
18
18
|
/**
|
package/lib/index.js
CHANGED
|
@@ -13,8 +13,6 @@ var _bibParse = _interopRequireDefault(require("./bib-parse"));
|
|
|
13
13
|
var _txtConcat = _interopRequireDefault(require("./txt-concat"));
|
|
14
14
|
var _txtObject = _interopRequireDefault(require("./txt-object"));
|
|
15
15
|
var _txtParse = _interopRequireDefault(require("./txt-parse"));
|
|
16
|
-
var _txtSentences = _interopRequireDefault(require("./txt-sentences"));
|
|
17
|
-
var _txtInflection = _interopRequireDefault(require("./txt-inflection"));
|
|
18
16
|
var _xmlParse = _interopRequireDefault(require("./xml-parse"));
|
|
19
17
|
var _xmlString = _interopRequireDefault(require("./xml-string"));
|
|
20
18
|
var _xmlConvert = _interopRequireDefault(require("./xml-convert"));
|
|
@@ -38,7 +36,7 @@ var _iniString = _interopRequireDefault(require("./ini-string"));
|
|
|
38
36
|
var _fileSave = _interopRequireDefault(require("./file-save"));
|
|
39
37
|
var _fileLoad = _interopRequireDefault(require("./file-load"));
|
|
40
38
|
var _fileMerge = _interopRequireDefault(require("./file-merge"));
|
|
41
|
-
function _interopRequireDefault(
|
|
39
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
42
40
|
const funcs = {
|
|
43
41
|
BUFObject: _bufObject.default,
|
|
44
42
|
OBJCount: _objCount.default,
|
|
@@ -49,8 +47,6 @@ const funcs = {
|
|
|
49
47
|
TXTParse: _txtParse.default,
|
|
50
48
|
TXTObject: _txtObject.default,
|
|
51
49
|
TXTConcat: _txtConcat.default,
|
|
52
|
-
TXTSentences: _txtSentences.default,
|
|
53
|
-
TXTInflection: _txtInflection.default,
|
|
54
50
|
XMLParse: _xmlParse.default,
|
|
55
51
|
XMLString: _xmlString.default,
|
|
56
52
|
XMLConvert: _xmlConvert.default,
|
|
@@ -81,6 +77,5 @@ const funcs = {
|
|
|
81
77
|
split: _txtParse.default.TXTParse,
|
|
82
78
|
segmenter: _txtParse.default.TXTParse
|
|
83
79
|
};
|
|
84
|
-
var _default = funcs;
|
|
85
|
-
exports.default = _default;
|
|
80
|
+
var _default = exports.default = funcs;
|
|
86
81
|
module.exports = funcs;
|
package/lib/ini-string.js
CHANGED
package/lib/json-parse.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _JSONStream = _interopRequireDefault(require("JSONStream"));
|
|
8
8
|
var _streamWrite = _interopRequireDefault(require("stream-write"));
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
function JSONParse(data, feed) {
|
|
11
11
|
if (this.isFirst()) {
|
|
12
12
|
const separator = this.getParam('separator', '*');
|
|
@@ -63,7 +63,6 @@ function JSONParse(data, feed) {
|
|
|
63
63
|
* @param {String} [separator="*"] to split at every JSONPath found
|
|
64
64
|
* @returns {Object}
|
|
65
65
|
*/
|
|
66
|
-
var _default = {
|
|
66
|
+
var _default = exports.default = {
|
|
67
67
|
JSONParse
|
|
68
|
-
};
|
|
69
|
-
exports.default = _default;
|
|
68
|
+
};
|
package/lib/obj-count.js
CHANGED
package/lib/obj-flatten.js
CHANGED
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = OBJFlatten;
|
|
7
7
|
var _flat = _interopRequireWildcard(require("flat"));
|
|
8
|
-
function _getRequireWildcardCache(
|
|
9
|
-
function _interopRequireWildcard(
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
10
|
/**
|
|
11
11
|
* Flatten an `Object` with a path delimiting character.
|
|
12
12
|
*
|
package/lib/obj-standardize.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _tmpFilepath = _interopRequireDefault(require("tmp-filepath"));
|
|
8
8
|
var _fs = _interopRequireDefault(require("fs"));
|
|
9
9
|
var _streamWrite = _interopRequireDefault(require("stream-write"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
function normalize(data, feed) {
|
|
12
12
|
if (this.isLast()) {
|
|
13
13
|
return feed.close();
|
|
@@ -83,7 +83,6 @@ function OBJStandardize(data, feed) {
|
|
|
83
83
|
* @param {undefined} none
|
|
84
84
|
* @returns {Object}
|
|
85
85
|
*/
|
|
86
|
-
var _default = {
|
|
86
|
+
var _default = exports.default = {
|
|
87
87
|
OBJStandardize
|
|
88
|
-
};
|
|
89
|
-
exports.default = _default;
|
|
88
|
+
};
|
package/lib/request.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _fetchWithProxy = _interopRequireDefault(require("fetch-with-proxy"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
const request = (url, parameters) => async () => {
|
|
10
10
|
const response = await (0, _fetchWithProxy.default)(url, parameters);
|
|
11
11
|
if (!response.ok) {
|
|
@@ -16,5 +16,4 @@ const request = (url, parameters) => async () => {
|
|
|
16
16
|
}
|
|
17
17
|
return response;
|
|
18
18
|
};
|
|
19
|
-
var _default = request;
|
|
20
|
-
exports.default = _default;
|
|
19
|
+
var _default = exports.default = request;
|
package/lib/tar-dump.js
CHANGED
|
@@ -10,7 +10,7 @@ var _fs = require("fs");
|
|
|
10
10
|
var _tarStream = _interopRequireDefault(require("tar-stream"));
|
|
11
11
|
var _zlib = require("zlib");
|
|
12
12
|
var _lodash = require("lodash");
|
|
13
|
-
function _interopRequireDefault(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
// Avoid importing from fs/promise to be compatible with node 12
|
|
15
15
|
const readFilePromise = (0, _util.promisify)(_fs.readFile);
|
|
16
16
|
const eol = '\n';
|
package/lib/tar-extract.js
CHANGED
|
@@ -9,7 +9,7 @@ var _micromatch = _interopRequireDefault(require("micromatch"));
|
|
|
9
9
|
var _zlib = require("zlib");
|
|
10
10
|
var _getStream = _interopRequireDefault(require("get-stream"));
|
|
11
11
|
var _streamWrite = _interopRequireDefault(require("stream-write"));
|
|
12
|
-
function _interopRequireDefault(
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
/**
|
|
14
14
|
* Take the content of a tar file, extract some files.
|
|
15
15
|
* The JSON object is sent to the output stream for each file.
|
package/lib/txt-concat.js
CHANGED
package/lib/txt-object.js
CHANGED
package/lib/txt-parse.js
CHANGED
package/lib/txt-zip.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.default = TXTZip;
|
|
|
7
7
|
var _zlib = _interopRequireDefault(require("zlib"));
|
|
8
8
|
var _stream = require("stream");
|
|
9
9
|
var _streamWrite = _interopRequireDefault(require("stream-write"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
/**
|
|
12
12
|
* Take a `String` and zip it.
|
|
13
13
|
*
|
package/lib/url-connect.js
CHANGED
|
@@ -13,7 +13,7 @@ var _parseHeaders = _interopRequireDefault(require("parse-headers"));
|
|
|
13
13
|
var _asyncRetry = _interopRequireDefault(require("async-retry"));
|
|
14
14
|
var _getStream = _interopRequireDefault(require("get-stream"));
|
|
15
15
|
var _fetchWithProxy = _interopRequireDefault(require("fetch-with-proxy"));
|
|
16
|
-
function _interopRequireDefault(
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
/**
|
|
18
18
|
* Take an `Object` and send it to an URL.
|
|
19
19
|
*
|
package/lib/url-fetch.js
CHANGED
|
@@ -10,7 +10,7 @@ var _nodeAbortController = _interopRequireDefault(require("node-abort-controller
|
|
|
10
10
|
var _parseHeaders = _interopRequireDefault(require("parse-headers"));
|
|
11
11
|
var _asyncRetry = _interopRequireDefault(require("async-retry"));
|
|
12
12
|
var _request = _interopRequireDefault(require("./request"));
|
|
13
|
-
function _interopRequireDefault(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
/**
|
|
15
15
|
* Add a new field to an `Object`, with the returned content of URL.
|
|
16
16
|
*
|
package/lib/url-parse.js
CHANGED
package/lib/url-request.js
CHANGED
|
@@ -11,7 +11,7 @@ var _nodeAbortController = _interopRequireDefault(require("node-abort-controller
|
|
|
11
11
|
var _parseHeaders = _interopRequireDefault(require("parse-headers"));
|
|
12
12
|
var _asyncRetry = _interopRequireDefault(require("async-retry"));
|
|
13
13
|
var _request = _interopRequireDefault(require("./request"));
|
|
14
|
-
function _interopRequireDefault(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
/**
|
|
16
16
|
* Take `Object` as parameters of URL, throw each chunk from the result
|
|
17
17
|
*
|
package/lib/url-stream.js
CHANGED
|
@@ -11,7 +11,7 @@ var _JSONStream = _interopRequireDefault(require("JSONStream"));
|
|
|
11
11
|
var _parseHeaders = _interopRequireDefault(require("parse-headers"));
|
|
12
12
|
var _asyncRetry = _interopRequireDefault(require("async-retry"));
|
|
13
13
|
var _request = _interopRequireDefault(require("./request"));
|
|
14
|
-
function _interopRequireDefault(
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
/**
|
|
16
16
|
* Take `String` as URL, throw each chunk from the result or
|
|
17
17
|
* Take `Object` as parameters of URL, throw each chunk from the result
|
package/lib/url-string.js
CHANGED
package/lib/xml-convert.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _xmlMapping = _interopRequireDefault(require("xml-mapping"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
function XMLConvert(data, feed) {
|
|
10
10
|
if (this.isLast()) {
|
|
11
11
|
return feed.close();
|
|
@@ -87,7 +87,6 @@ function XMLConvert(data, feed) {
|
|
|
87
87
|
* @param {String} [prologue=false] add XML prologue
|
|
88
88
|
* @returns {Object}
|
|
89
89
|
*/
|
|
90
|
-
var _default = {
|
|
90
|
+
var _default = exports.default = {
|
|
91
91
|
XMLConvert
|
|
92
|
-
};
|
|
93
|
-
exports.default = _default;
|
|
92
|
+
};
|
package/lib/xml-parse.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _xmlSplitter = _interopRequireDefault(require("xml-splitter"));
|
|
8
8
|
var _streamWrite = _interopRequireDefault(require("stream-write"));
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
function XMLParse(data, feed) {
|
|
11
11
|
if (!this.handle) {
|
|
12
12
|
const separator = this.getParam('separator', '/');
|
|
@@ -56,7 +56,6 @@ function XMLParse(data, feed) {
|
|
|
56
56
|
* @param {String} [separator="/"] choose a character for flatten keys
|
|
57
57
|
* @returns {Object}
|
|
58
58
|
*/
|
|
59
|
-
var _default = {
|
|
59
|
+
var _default = exports.default = {
|
|
60
60
|
XMLParse
|
|
61
|
-
};
|
|
62
|
-
exports.default = _default;
|
|
61
|
+
};
|
package/lib/xml-string.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _xmlMapping = _interopRequireDefault(require("xml-mapping"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
function XMLString(data, feed) {
|
|
10
10
|
const rootElement = this.getParam('rootElement', 'items');
|
|
11
11
|
const contentElement = this.getParam('contentElement', 'item');
|
|
@@ -52,7 +52,6 @@ function XMLString(data, feed) {
|
|
|
52
52
|
* @param {Boolean} [prologue=false] Add XML prologue `<?xml`
|
|
53
53
|
* @returns {String}
|
|
54
54
|
*/
|
|
55
|
-
var _default = {
|
|
55
|
+
var _default = exports.default = {
|
|
56
56
|
XMLString
|
|
57
|
-
};
|
|
58
|
-
exports.default = _default;
|
|
57
|
+
};
|
package/lib/zip-extract.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.default = ZIPExtract;
|
|
|
7
7
|
var _unzipper = _interopRequireDefault(require("unzipper"));
|
|
8
8
|
var _micromatch = _interopRequireDefault(require("micromatch"));
|
|
9
9
|
var _streamWrite = _interopRequireDefault(require("stream-write"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
/**
|
|
12
12
|
* Take the content of a zip file, extract some files.
|
|
13
13
|
* The JSON object is sent to the output stream for each file.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezs/basics",
|
|
3
3
|
"description": "Basics statements for EZS",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.8.0",
|
|
5
5
|
"author": "Nicolas Thouvenin <nthouvenin@gmail.com>",
|
|
6
6
|
"bugs": "https://github.com/Inist-CNRS/ezs/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -16,10 +16,9 @@
|
|
|
16
16
|
"from": "0.1.7",
|
|
17
17
|
"get-stream": "6.0.1",
|
|
18
18
|
"higher-path": "1.0.0",
|
|
19
|
-
"inflection": "2.0.1",
|
|
20
19
|
"lodash": "4.17.21",
|
|
21
20
|
"make-dir": "4.0.0",
|
|
22
|
-
"micromatch": "4.0.
|
|
21
|
+
"micromatch": "4.0.8",
|
|
23
22
|
"node-abort-controller": "1.1.0",
|
|
24
23
|
"parse-headers": "2.0.4",
|
|
25
24
|
"path-exists": "4.0.0",
|
|
@@ -36,7 +35,7 @@
|
|
|
36
35
|
"directories": {
|
|
37
36
|
"test": "test"
|
|
38
37
|
},
|
|
39
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "b18a8d2423c12ee1956af75cb8a172b86f968023",
|
|
40
39
|
"homepage": "https://github.com/Inist-CNRS/ezs/tree/master/packages/basics#readme",
|
|
41
40
|
"keywords": [
|
|
42
41
|
"ezs"
|