mobbdev 0.0.50 → 0.0.52
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.mjs +9 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -600,6 +600,11 @@ import { globby } from "globby";
|
|
|
600
600
|
import { isBinary } from "istextorbinary";
|
|
601
601
|
var debug4 = Debug4("mobbdev:pack");
|
|
602
602
|
var MAX_FILE_SIZE = 1024 * 1024 * 5;
|
|
603
|
+
function endsWithAny(str, suffixes) {
|
|
604
|
+
return suffixes.some(function(suffix) {
|
|
605
|
+
return str.endsWith(suffix);
|
|
606
|
+
});
|
|
607
|
+
}
|
|
603
608
|
async function pack(srcDirPath, vulnFiles) {
|
|
604
609
|
debug4("pack folder %s", srcDirPath);
|
|
605
610
|
const filepaths = await globby("**", {
|
|
@@ -613,7 +618,10 @@ async function pack(srcDirPath, vulnFiles) {
|
|
|
613
618
|
debug4("compressing files");
|
|
614
619
|
for (const filepath of filepaths) {
|
|
615
620
|
const absFilepath = path3.join(srcDirPath, filepath.toString());
|
|
616
|
-
if (!
|
|
621
|
+
if (!endsWithAny(
|
|
622
|
+
absFilepath.toString().replaceAll(path3.win32.sep, path3.posix.sep),
|
|
623
|
+
vulnFiles
|
|
624
|
+
)) {
|
|
617
625
|
debug4("ignoring %s because it is not a vulnerability file", filepath);
|
|
618
626
|
continue;
|
|
619
627
|
}
|