@jsenv/snapshot 2.2.4 → 2.2.5
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/filesystem_snapshot.js +11 -6
package/package.json
CHANGED
|
@@ -8,7 +8,11 @@ import {
|
|
|
8
8
|
writeFileSync,
|
|
9
9
|
} from "@jsenv/filesystem";
|
|
10
10
|
import { URL_META } from "@jsenv/url-meta";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
ensurePathnameTrailingSlash,
|
|
13
|
+
urlToFilename,
|
|
14
|
+
urlToRelativeUrl,
|
|
15
|
+
} from "@jsenv/urls";
|
|
12
16
|
import { CONTENT_TYPE } from "@jsenv/utils/src/content_type/content_type.js";
|
|
13
17
|
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
14
18
|
import { fileURLToPath } from "node:url";
|
|
@@ -357,20 +361,21 @@ ${extraUrls.join("\n")}`);
|
|
|
357
361
|
}
|
|
358
362
|
const relativeUrl = urlToRelativeUrl(directoryItemUrl, directoryUrl);
|
|
359
363
|
if (directoryItemStat.isDirectory()) {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}
|
|
363
|
-
if (!shouldVisitDirectory(directoryUrl)) {
|
|
364
|
+
ensurePathnameTrailingSlash(directoryItemUrl);
|
|
365
|
+
if (!shouldVisitDirectory(directoryItemUrl)) {
|
|
364
366
|
continue;
|
|
365
367
|
}
|
|
366
368
|
contentSnapshotNaturalOrder[relativeUrl] = createDirectorySnapshot(
|
|
367
|
-
|
|
369
|
+
directoryItemUrl,
|
|
368
370
|
{
|
|
369
371
|
shouldVisitDirectory,
|
|
370
372
|
shouldIncludeFile,
|
|
371
373
|
clean,
|
|
372
374
|
},
|
|
373
375
|
);
|
|
376
|
+
if (clean) {
|
|
377
|
+
removeDirectorySync(directoryItemUrl);
|
|
378
|
+
}
|
|
374
379
|
continue;
|
|
375
380
|
}
|
|
376
381
|
if (!shouldIncludeFile(directoryItemUrl)) {
|