Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions review-enrichment/src/analyzers/asset-weight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const BINARY_EXTS = new Set([
"7z",
"rar",
"xz",
"zst",
"pdf",
"psd",
"ai",
Expand Down
5 changes: 5 additions & 0 deletions review-enrichment/test/asset-weight.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ test("isBinaryAsset flags genuine binary extensions and ignores text/case", () =
assert.equal(isBinaryAsset("photos/IMG_0001.heic"), true);
assert.equal(isBinaryAsset("photos/scan.heif"), true);
assert.equal(isBinaryAsset("photos/IMG_0001.HEIC"), true);
// Zstandard blobs are binary compressed assets (siblings of gz/bz2/xz) — only the last extension is matched,
// so a compound `.tar.zst` resolves to `zst`, and the match is case-insensitive.
assert.equal(isBinaryAsset("cache/model.zst"), true);
assert.equal(isBinaryAsset("dist/bundle.tar.zst"), true);
assert.equal(isBinaryAsset("cache/model.ZST"), true);
// Extension match is case-insensitive.
assert.equal(isBinaryAsset("assets/HERO.PNG"), true);
// Text formats whose bytes are already in the diff are NOT binary assets.
Expand Down
Loading