@awsless/ts-file-cache 0.0.14 → 0.0.16
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/dist/index.cjs +5 -1
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -131,9 +131,13 @@ var generateRecursiveFileHashes = async (workspace, file, sourceFile, allowedExt
|
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
const code = await (0, import_promises2.readFile)(file, "utf8");
|
|
134
|
-
const
|
|
134
|
+
const ext = file.split(".").pop();
|
|
135
135
|
const hash = (0, import_crypto.createHash)("sha1").update(code).digest();
|
|
136
136
|
hashes.set(relFile, hash);
|
|
137
|
+
if (!ext || !allowedExtensions.includes(ext)) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const deps = await findImports(file, code);
|
|
137
141
|
for (const dep of deps) {
|
|
138
142
|
await generateRecursiveFileHashes(workspace, dep, file, allowedExtensions, hashes);
|
|
139
143
|
}
|
package/dist/index.js
CHANGED
|
@@ -105,9 +105,13 @@ var generateRecursiveFileHashes = async (workspace, file, sourceFile, allowedExt
|
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
const code = await readFile(file, "utf8");
|
|
108
|
-
const
|
|
108
|
+
const ext = file.split(".").pop();
|
|
109
109
|
const hash = createHash("sha1").update(code).digest();
|
|
110
110
|
hashes.set(relFile, hash);
|
|
111
|
+
if (!ext || !allowedExtensions.includes(ext)) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const deps = await findImports(file, code);
|
|
111
115
|
for (const dep of deps) {
|
|
112
116
|
await generateRecursiveFileHashes(workspace, dep, file, allowedExtensions, hashes);
|
|
113
117
|
}
|