Skip to content

Commit b0d660c

Browse files
committed
refactor(fs): Fix resource integrity for resources without content
1 parent b0b6dcc commit b0d660c

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

packages/fs/lib/Resource.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ class Resource {
792792
isDirectory: this.#isDirectory,
793793
byteSize: this.#isDirectory ? undefined : await this.getSize(),
794794
lastModified: this.#lastModified,
795-
integrity: this.#isDirectory ? undefined : await this.getIntegrity(),
795+
integrity: this.#isDirectory ? undefined : (this.#contentType ? await this.getIntegrity() : undefined),
796796
sourceMetadata: clone(this.#sourceMetadata)
797797
};
798798

packages/fs/test/lib/package-exports.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test("export of package.json", (t) => {
1212
// Check number of definied exports
1313
test("check number of exports", (t) => {
1414
const packageJson = require("@ui5/fs/package.json");
15-
t.is(Object.keys(packageJson.exports).length, 12);
15+
t.is(Object.keys(packageJson.exports).length, 13);
1616
});
1717

1818
// Public API contract (exported modules)
@@ -74,6 +74,10 @@ test("check number of exports", (t) => {
7474
exportedSpecifier: "@ui5/fs/internal/ResourceTagCollection",
7575
mappedModule: "../../lib/ResourceTagCollection.js"
7676
},
77+
{
78+
exportedSpecifier: "@ui5/fs/internal/MonitoredResourceTagCollection",
79+
mappedModule: "../../lib/MonitoredResourceTagCollection.js"
80+
},
7781
].forEach(({exportedSpecifier, mappedModule}) => {
7882
test(`${exportedSpecifier}`, async (t) => {
7983
const actual = await import(exportedSpecifier);

0 commit comments

Comments
 (0)