@logtape/logtape 0.4.2-dev.45 → 0.4.2-dev.46
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/esm/filesink.node.js +16 -11
- package/esm/fs.js +12 -0
- package/package.json +1 -1
- package/script/filesink.node.js +16 -11
- package/script/fs.js +8 -0
- package/types/filesink.node.d.ts +1 -1
- package/types/filesink.node.d.ts.map +1 -1
- package/types/fs.d.ts +3 -0
- package/types/fs.d.ts.map +1 -0
package/esm/filesink.node.js
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import * as dntShim from "./_dnt.shims.js";
|
|
2
|
-
|
|
2
|
+
// @ts-ignore: a trick to avoid module resolution error on non-Node.js environ
|
|
3
|
+
import fsMod from "./fs.js";
|
|
3
4
|
import { webDriver } from "./filesink.web.js";
|
|
4
5
|
import { getFileSink as getBaseFileSink, getRotatingFileSink as getBaseRotatingFileSink, } from "./sink.js";
|
|
6
|
+
// @ts-ignore: a trick to avoid module resolution error on non-Node.js environ
|
|
7
|
+
const fs = fsMod;
|
|
5
8
|
/**
|
|
6
9
|
* A Node.js-specific file sink driver.
|
|
7
10
|
*/
|
|
8
|
-
export const nodeDriver =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
export const nodeDriver = fs == null
|
|
12
|
+
? webDriver
|
|
13
|
+
: {
|
|
14
|
+
openSync(path) {
|
|
15
|
+
return fs.openSync(path, "a");
|
|
16
|
+
},
|
|
17
|
+
writeSync: fs.writeSync,
|
|
18
|
+
flushSync: fs.fsyncSync,
|
|
19
|
+
closeSync: fs.closeSync,
|
|
20
|
+
statSync: fs.statSync,
|
|
21
|
+
renameSync: fs.renameSync,
|
|
22
|
+
};
|
|
18
23
|
/**
|
|
19
24
|
* Get a file sink.
|
|
20
25
|
*
|
package/esm/fs.js
ADDED
package/package.json
CHANGED
package/script/filesink.node.js
CHANGED
|
@@ -28,22 +28,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.getRotatingFileSink = exports.getFileSink = exports.nodeDriver = void 0;
|
|
30
30
|
const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
31
|
-
|
|
31
|
+
// @ts-ignore: a trick to avoid module resolution error on non-Node.js environ
|
|
32
|
+
const fs_js_1 = __importDefault(require("./fs.js"));
|
|
32
33
|
const filesink_web_js_1 = require("./filesink.web.js");
|
|
33
34
|
const sink_js_1 = require("./sink.js");
|
|
35
|
+
// @ts-ignore: a trick to avoid module resolution error on non-Node.js environ
|
|
36
|
+
const fs = fs_js_1.default;
|
|
34
37
|
/**
|
|
35
38
|
* A Node.js-specific file sink driver.
|
|
36
39
|
*/
|
|
37
|
-
exports.nodeDriver =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
exports.nodeDriver = fs == null
|
|
41
|
+
? filesink_web_js_1.webDriver
|
|
42
|
+
: {
|
|
43
|
+
openSync(path) {
|
|
44
|
+
return fs.openSync(path, "a");
|
|
45
|
+
},
|
|
46
|
+
writeSync: fs.writeSync,
|
|
47
|
+
flushSync: fs.fsyncSync,
|
|
48
|
+
closeSync: fs.closeSync,
|
|
49
|
+
statSync: fs.statSync,
|
|
50
|
+
renameSync: fs.renameSync,
|
|
51
|
+
};
|
|
47
52
|
/**
|
|
48
53
|
* Get a file sink.
|
|
49
54
|
*
|
package/script/fs.js
ADDED
package/types/filesink.node.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type FileSinkOptions, type RotatingFileSinkDriver, type RotatingFileSin
|
|
|
3
3
|
/**
|
|
4
4
|
* A Node.js-specific file sink driver.
|
|
5
5
|
*/
|
|
6
|
-
export declare const nodeDriver: RotatingFileSinkDriver<number>;
|
|
6
|
+
export declare const nodeDriver: RotatingFileSinkDriver<number | void>;
|
|
7
7
|
/**
|
|
8
8
|
* Get a file sink.
|
|
9
9
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesink.node.d.ts","sourceRoot":"","sources":["../src/filesink.node.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"filesink.node.d.ts","sourceRoot":"","sources":["../src/filesink.node.ts"],"names":[],"mappings":";AAKA,OAAO,EACL,KAAK,eAAe,EAGpB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,IAAI,EACV,MAAM,WAAW,CAAC;AAKnB;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,sBAAsB,CAAC,MAAM,GAAG,IAAI,CAW1D,CAAC;AAEJ;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAoB,GAC5B,IAAI,GAAG,UAAU,CAKnB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,uBAA4B,GACpC,IAAI,GAAG,UAAU,CAKnB"}
|
package/types/fs.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../src/fs.js"],"names":[],"mappings":""}
|