@jsenv/snapshot 2.2.0 → 2.2.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/package.json +1 -1
- package/src/function_snapshot.js +4 -4
package/package.json
CHANGED
package/src/function_snapshot.js
CHANGED
|
@@ -14,7 +14,7 @@ export const snapshotFunctionSideEffects = (
|
|
|
14
14
|
sideEffectDirectoryName = "output",
|
|
15
15
|
rootDirectoryUrl = new URL("./", fnFileUrl),
|
|
16
16
|
captureConsole = true,
|
|
17
|
-
|
|
17
|
+
filesystemEffects,
|
|
18
18
|
} = {},
|
|
19
19
|
) => {
|
|
20
20
|
const sideEffectDirectoryUrl = new URL(sideEffectDirectoryName, fnFileUrl);
|
|
@@ -91,14 +91,14 @@ export const snapshotFunctionSideEffects = (
|
|
|
91
91
|
new URL("./console_logs.txt", sideEffectDirectoryUrl),
|
|
92
92
|
);
|
|
93
93
|
}
|
|
94
|
-
if (
|
|
94
|
+
if (filesystemEffects) {
|
|
95
95
|
const filesystemEffectDirectoryUrl = new URL(
|
|
96
96
|
"./fs/",
|
|
97
97
|
sideEffectDirectoryUrl,
|
|
98
98
|
);
|
|
99
|
-
for (const
|
|
99
|
+
for (const filesystemEffect of filesystemEffects) {
|
|
100
100
|
finallyCallbackSet.add(() => {
|
|
101
|
-
const from = new URL(
|
|
101
|
+
const from = new URL(filesystemEffect, fnFileUrl);
|
|
102
102
|
const relativeUrl = urlToRelativeUrl(from, fnFileUrl);
|
|
103
103
|
moveEntrySync({
|
|
104
104
|
from,
|