@ezs/basics 2.1.1 → 2.1.3
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/CHANGELOG.md +19 -0
- package/README.md +0 -33
- package/lib/url-connect.js +7 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.1.3](https://github.com/Inist-CNRS/ezs/compare/@ezs/basics@2.1.2...@ezs/basics@2.1.3) (2023-05-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @ezs/basics
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.1.2](https://github.com/Inist-CNRS/ezs/compare/@ezs/basics@2.1.1...@ezs/basics@2.1.2) (2023-05-30)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* 🐛 retry without json parse ([90e17b5](https://github.com/Inist-CNRS/ezs/commit/90e17b5ea2cbf60f18a9ecbf29b338b1395e318e))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [2.1.1](https://github.com/Inist-CNRS/ezs/compare/@ezs/basics@2.1.0...@ezs/basics@2.1.1) (2023-05-12)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @ezs/basics
|
package/README.md
CHANGED
|
@@ -23,7 +23,6 @@ npm install @ezs/basics
|
|
|
23
23
|
- [INIString](#inistring)
|
|
24
24
|
- [JSONParse](#jsonparse)
|
|
25
25
|
- [JSONString](#jsonstring)
|
|
26
|
-
- [OBJColumns](#objcolumns)
|
|
27
26
|
- [OBJCount](#objcount)
|
|
28
27
|
- [OBJFlatten](#objflatten)
|
|
29
28
|
- [OBJNamespaces](#objnamespaces)
|
|
@@ -393,38 +392,6 @@ Output:
|
|
|
393
392
|
|
|
394
393
|
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
395
394
|
|
|
396
|
-
### OBJColumns
|
|
397
|
-
|
|
398
|
-
Take an `Object` and flatten it to get only one level of keys.
|
|
399
|
-
|
|
400
|
-
<caption>Input:</caption>
|
|
401
|
-
|
|
402
|
-
```json
|
|
403
|
-
[{
|
|
404
|
-
"foo": {
|
|
405
|
-
"hello": "world"
|
|
406
|
-
},
|
|
407
|
-
"bar": "anything else",
|
|
408
|
-
"baz": 1
|
|
409
|
-
}]
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
<caption>Output:</caption>
|
|
413
|
-
|
|
414
|
-
```json
|
|
415
|
-
[{
|
|
416
|
-
"foo": "{\"hello\":\"world\"}",
|
|
417
|
-
"bar": "anything else",
|
|
418
|
-
"baz": 1
|
|
419
|
-
}]
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
#### Parameters
|
|
423
|
-
|
|
424
|
-
- `none` **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)**
|
|
425
|
-
|
|
426
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
427
|
-
|
|
428
395
|
### OBJCount
|
|
429
396
|
|
|
430
397
|
Count how many objects are received, and yield the total.
|
package/lib/url-connect.js
CHANGED
|
@@ -106,9 +106,13 @@ async function URLConnect(data, feed) {
|
|
|
106
106
|
});
|
|
107
107
|
bodyOut.pipe(output);
|
|
108
108
|
} else {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
if (json) {
|
|
110
|
+
const bodyOutRaw = await (0, _getStream.default)(response.body);
|
|
111
|
+
const bodyOutArray = JSON.parse(bodyOutRaw);
|
|
112
|
+
(0, _from.default)(bodyOutArray).pipe(output);
|
|
113
|
+
} else {
|
|
114
|
+
response.body.pipe(output);
|
|
115
|
+
}
|
|
112
116
|
}
|
|
113
117
|
}, {
|
|
114
118
|
retries
|
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.1.
|
|
4
|
+
"version": "2.1.3",
|
|
5
5
|
"author": "Nicolas Thouvenin <nthouvenin@gmail.com>",
|
|
6
6
|
"bugs": "https://github.com/Inist-CNRS/ezs/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"directories": {
|
|
41
41
|
"test": "test"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "2296d653ec1f8ce2ee9999ed77e6c803faa74de9",
|
|
44
44
|
"homepage": "https://github.com/Inist-CNRS/ezs/tree/master/packages/basics#readme",
|
|
45
45
|
"keywords": [
|
|
46
46
|
"ezs"
|