@honkit/internal-test-utils 3.7.0 → 4.0.7
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/lib/directorySnapshot.d.ts +1 -1
- package/lib/directorySnapshot.js +29 -22
- package/lib/directorySnapshot.js.map +1 -1
- package/package.json +2 -2
- package/CHANGELOG.md +0 -75
package/lib/directorySnapshot.js
CHANGED
|
@@ -31,8 +31,8 @@ exports.iterateDirectoryContents = void 0;
|
|
|
31
31
|
const path_1 = __importDefault(require("path"));
|
|
32
32
|
const fs_1 = __importDefault(require("fs"));
|
|
33
33
|
const util_1 = require("util");
|
|
34
|
-
const readdir = util_1.promisify(fs_1.default.readdir);
|
|
35
|
-
const readFile = util_1.promisify(fs_1.default.readFile);
|
|
34
|
+
const readdir = (0, util_1.promisify)(fs_1.default.readdir);
|
|
35
|
+
const readFile = (0, util_1.promisify)(fs_1.default.readFile);
|
|
36
36
|
function getFiles(dir) {
|
|
37
37
|
return __asyncGenerator(this, arguments, function* getFiles_1() {
|
|
38
38
|
const dirents = yield __await(readdir(dir, { withFileTypes: true }));
|
|
@@ -53,33 +53,40 @@ function getFiles(dir) {
|
|
|
53
53
|
const defaultMask = (s) => s;
|
|
54
54
|
function iterateDirectoryContents({ baseDir, allowExtensions, maskContent = defaultMask, }) {
|
|
55
55
|
return __asyncGenerator(this, arguments, function* iterateDirectoryContents_1() {
|
|
56
|
-
var e_1,
|
|
56
|
+
var _a, e_1, _b, _c;
|
|
57
57
|
try {
|
|
58
|
-
for (var
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
for (var _d = true, _e = __asyncValues(getFiles(baseDir)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a;) {
|
|
59
|
+
_c = _f.value;
|
|
60
|
+
_d = false;
|
|
61
|
+
try {
|
|
62
|
+
const item = _c;
|
|
63
|
+
const { dirent, filePath } = item;
|
|
64
|
+
if (!allowExtensions.includes(path_1.default.extname(filePath))) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const isFile = dirent.isFile();
|
|
68
|
+
const contents = maskContent(isFile ? (yield __await(readFile(filePath))).toString() : "");
|
|
69
|
+
yield yield __await({
|
|
70
|
+
stats: {
|
|
71
|
+
isDirectory: dirent.isDirectory(),
|
|
72
|
+
isFile: isFile,
|
|
73
|
+
isSymbolicLink: dirent.isSymbolicLink(),
|
|
74
|
+
isSocket: dirent.isSocket(),
|
|
75
|
+
},
|
|
76
|
+
// normalize file path
|
|
77
|
+
filePath: path_1.default.relative(baseDir, filePath).split(path_1.default.sep).join("/"),
|
|
78
|
+
contents,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
_d = true;
|
|
63
83
|
}
|
|
64
|
-
const isFile = dirent.isFile();
|
|
65
|
-
const contents = maskContent(isFile ? (yield __await(readFile(filePath))).toString() : "");
|
|
66
|
-
yield yield __await({
|
|
67
|
-
stats: {
|
|
68
|
-
isDirectory: dirent.isDirectory(),
|
|
69
|
-
isFile: isFile,
|
|
70
|
-
isSymbolicLink: dirent.isSymbolicLink(),
|
|
71
|
-
isSocket: dirent.isSocket(),
|
|
72
|
-
},
|
|
73
|
-
// normalize file path
|
|
74
|
-
filePath: path_1.default.relative(baseDir, filePath).split(path_1.default.sep).join("/"),
|
|
75
|
-
contents,
|
|
76
|
-
});
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
86
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
80
87
|
finally {
|
|
81
88
|
try {
|
|
82
|
-
if (
|
|
89
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
83
90
|
}
|
|
84
91
|
finally { if (e_1) throw e_1.error; }
|
|
85
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directorySnapshot.js","sourceRoot":"","sources":["../src/directorySnapshot.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;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AAE,GAAG,IAAI,CAAC;oBAClC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;wBACnD,SAAS;qBACZ;oBACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;oBAC/B,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,cAAM,QAAQ,CAAC,QAAQ,CAAC,CAAA,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;oBAClF,oBAAM;wBACF,KAAK,EAAE;4BACH,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE;4BACjC,MAAM,EAAE,MAAM;4BACd,cAAc,EAAE,MAAM,CAAC,cAAc,EAAE;4BACvC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE;yBAC9B;wBACD,sBAAsB;wBACtB,QAAQ,EAAE,cAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,cAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;wBACpE,QAAQ;qBACX,CAAA,CAAC;;;;;aACL;;;;;;;;;IACL,CAAC;CAAA;AA5BD,4DA4BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@honkit/internal-test-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.7",
|
|
4
4
|
"description": "Internal utility for testing.",
|
|
5
5
|
"homepage": "https://github.com/honkit/honkit/tree/master/packages/@honkit/internal-test-utils/",
|
|
6
6
|
"bugs": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "b12f6eb9937552d1ff1d9a8cad75e74f1664c666"
|
|
48
48
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
# 3.7.0 (2021-04-14)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @honkit/internal-test-utils
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## [3.6.17](https://github.com/honkit/honkit/compare/v3.6.16...v3.6.17) (2021-02-15)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @honkit/internal-test-utils
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## 3.6.16 (2020-12-15)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @honkit/internal-test-utils
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## 3.6.15 (2020-12-05)
|
|
31
|
-
|
|
32
|
-
**Note:** Version bump only for package @honkit/internal-test-utils
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## 3.6.14 (2020-11-29)
|
|
39
|
-
|
|
40
|
-
**Note:** Version bump only for package @honkit/internal-test-utils
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## 3.6.13 (2020-11-17)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### Bug Fixes
|
|
50
|
-
|
|
51
|
-
* **honkit:** browser print layout in default theme ([#159](https://github.com/honkit/honkit/issues/159)) ([672cb9c](https://github.com/honkit/honkit/commit/672cb9c92f90dd154793b7a36d4dbf2654e7aec4))
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
## 3.6.12 (2020-11-13)
|
|
58
|
-
|
|
59
|
-
**Note:** Version bump only for package @honkit/internal-test-utils
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
## [3.5.3](https://github.com/honkit/honkit/compare/v3.5.2...v3.5.3) (2020-07-31)
|
|
66
|
-
|
|
67
|
-
**Note:** Version bump only for package @honkit/internal-test-utils
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
## [3.5.1](https://github.com/honkit/honkit/compare/v3.5.0...v3.5.1) (2020-07-04)
|
|
74
|
-
|
|
75
|
-
**Note:** Version bump only for package @honkit/internal-test-utils
|