@efebia/pino-mongodb 1.0.0 → 1.0.1
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/lib/index.js +7 -12
- package/lib/log.js +1 -1
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -41,20 +41,15 @@ const bulkTransport = async (opts) => {
|
|
|
41
41
|
return (0, pino_abstract_transport_1.default)(async (source) => {
|
|
42
42
|
var _a, e_1, _b, _c;
|
|
43
43
|
try {
|
|
44
|
-
for (var _d = true, source_1 = __asyncValues(source), source_1_1; source_1_1 = await source_1.next(), _a = source_1_1.done, !_a;) {
|
|
44
|
+
for (var _d = true, source_1 = __asyncValues(source), source_1_1; source_1_1 = await source_1.next(), _a = source_1_1.done, !_a; _d = true) {
|
|
45
45
|
_c = source_1_1.value;
|
|
46
46
|
_d = false;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
finally {
|
|
56
|
-
_d = true;
|
|
57
|
-
}
|
|
47
|
+
let obj = _c;
|
|
48
|
+
await collection.insertOne((0, log_js_1.default)(obj), { forceServerObjectId: true }).catch((e) => {
|
|
49
|
+
if (e instanceof Error) {
|
|
50
|
+
console.error(e);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
58
53
|
}
|
|
59
54
|
}
|
|
60
55
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
package/lib/log.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
3
4
|
function default_1(data) {
|
|
4
5
|
let log;
|
|
5
6
|
try {
|
|
@@ -19,4 +20,3 @@ function default_1(data) {
|
|
|
19
20
|
}
|
|
20
21
|
return log;
|
|
21
22
|
}
|
|
22
|
-
exports.default = default_1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@efebia/pino-mongodb",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"mongodb": "^6.15.0",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@types/node": "18",
|
|
11
|
-
"typescript": "
|
|
11
|
+
"typescript": "~5.8.3"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"/lib"
|