@logtape/logtape 0.6.2 → 0.6.4-dev.96
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/fs.cjs +10 -7
- package/esm/nodeUtil.cjs +10 -7
- package/package.json +1 -1
- package/script/fs.js +10 -7
- package/script/nodeUtil.js +10 -7
package/esm/fs.cjs
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
let fs = null;
|
|
2
2
|
if (
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
typeof window === "undefined" && (
|
|
4
|
+
"process" in globalThis && "versions" in globalThis.process &&
|
|
5
|
+
"node" in globalThis.process.versions &&
|
|
6
|
+
typeof globalThis.caches === "undefined" &&
|
|
7
|
+
typeof globalThis.addEventListener !== "function" ||
|
|
8
|
+
"Bun" in globalThis
|
|
9
|
+
)
|
|
8
10
|
) {
|
|
9
11
|
try {
|
|
10
12
|
// Intentionally confuse static analysis of bundlers:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
const $require = [require];
|
|
14
|
+
fs = $require[0](`${["node", "fs"].join(":")}`);
|
|
15
|
+
} catch {
|
|
13
16
|
fs = null;
|
|
14
17
|
}
|
|
15
18
|
}
|
package/esm/nodeUtil.cjs
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
let util = null;
|
|
2
2
|
if (
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
typeof window === "undefined" && (
|
|
4
|
+
"process" in globalThis && "versions" in globalThis.process &&
|
|
5
|
+
"node" in globalThis.process.versions &&
|
|
6
|
+
typeof globalThis.caches === "undefined" &&
|
|
7
|
+
typeof globalThis.addEventListener !== "function" ||
|
|
8
|
+
"Bun" in globalThis
|
|
9
|
+
)
|
|
8
10
|
) {
|
|
9
11
|
try {
|
|
10
12
|
// Intentionally confuse static analysis of bundlers:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
const $require = [require];
|
|
14
|
+
util = $require[0](`${["node", "util"].join(":")}`);
|
|
15
|
+
} catch {
|
|
13
16
|
util = null;
|
|
14
17
|
}
|
|
15
18
|
}
|
package/package.json
CHANGED
package/script/fs.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
let fs = null;
|
|
2
2
|
if (
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
typeof window === "undefined" && (
|
|
4
|
+
"process" in globalThis && "versions" in globalThis.process &&
|
|
5
|
+
"node" in globalThis.process.versions &&
|
|
6
|
+
typeof globalThis.caches === "undefined" &&
|
|
7
|
+
typeof globalThis.addEventListener !== "function" ||
|
|
8
|
+
"Bun" in globalThis
|
|
9
|
+
)
|
|
8
10
|
) {
|
|
9
11
|
try {
|
|
10
12
|
// Intentionally confuse static analysis of bundlers:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
const $require = [require];
|
|
14
|
+
fs = $require[0](`${["node", "fs"].join(":")}`);
|
|
15
|
+
} catch {
|
|
13
16
|
fs = null;
|
|
14
17
|
}
|
|
15
18
|
}
|
package/script/nodeUtil.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
let util = null;
|
|
2
2
|
if (
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
typeof window === "undefined" && (
|
|
4
|
+
"process" in globalThis && "versions" in globalThis.process &&
|
|
5
|
+
"node" in globalThis.process.versions &&
|
|
6
|
+
typeof globalThis.caches === "undefined" &&
|
|
7
|
+
typeof globalThis.addEventListener !== "function" ||
|
|
8
|
+
"Bun" in globalThis
|
|
9
|
+
)
|
|
8
10
|
) {
|
|
9
11
|
try {
|
|
10
12
|
// Intentionally confuse static analysis of bundlers:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
const $require = [require];
|
|
14
|
+
util = $require[0](`${["node", "util"].join(":")}`);
|
|
15
|
+
} catch {
|
|
13
16
|
util = null;
|
|
14
17
|
}
|
|
15
18
|
}
|