@weborigami/async-tree 0.0.56 → 0.0.58
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weborigami/async-tree",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.58",
|
|
4
4
|
"description": "Asynchronous tree drivers based on standard JavaScript classes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./main.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"typescript": "5.4.5"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@weborigami/types": "0.0.
|
|
14
|
+
"@weborigami/types": "0.0.58"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"test": "node --test --test-reporter=spec",
|
package/src/FileTree.js
CHANGED
|
@@ -144,7 +144,11 @@ export default class FileTree {
|
|
|
144
144
|
// Treat null value as empty string; will create an empty file.
|
|
145
145
|
value = "";
|
|
146
146
|
packed = true;
|
|
147
|
-
} else if (isPacked(value)) {
|
|
147
|
+
} else if (!(value instanceof String) && isPacked(value)) {
|
|
148
|
+
// As of Node 22, fs.writeFile is incredibly slow for large String
|
|
149
|
+
// instances. Instead of treating a String instance as a Packed value, we
|
|
150
|
+
// want to consider it as a stringlike below. That will convert it to a
|
|
151
|
+
// primitive string before writing — which is orders of magnitude faster.
|
|
148
152
|
packed = true;
|
|
149
153
|
} else if (typeof value.pack === "function") {
|
|
150
154
|
// Pack the value for writing.
|
|
File without changes
|