Skip to content

Commit b286aa3

Browse files
committed
fix biome formatting in web3-adapter file mapping code
1 parent 2007c68 commit b286aa3

3 files changed

Lines changed: 22 additions & 25 deletions

File tree

infrastructure/web3-adapter/src/mapper/file-directive.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ function mockClient(): EVaultClient {
1515
uploadFile: vi.fn(async (_w3id: string, input: { filename: string }) => ({
1616
uri: "w3ds://file?id=@owner/env-123",
1717
metaEnvelopeId: "env-123",
18-
publicUrl: "https://cdn.example.com/files/owner/env-123-" + input.filename,
18+
publicUrl:
19+
"https://cdn.example.com/files/owner/env-123-" + input.filename,
1920
})),
2021
fetchMetaEnvelope: vi.fn(async (id: string) => ({
2122
id,

infrastructure/web3-adapter/src/mapper/mapper.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ export async function fromGlobal({
174174
const uriValue = getValueByPath(data, alias ?? localPath);
175175
if (Array.isArray(uriValue)) {
176176
result[localKey] = await Promise.all(
177-
uriValue.map((v) =>
178-
dereferenceFileValue(v, evaultClient, localKey),
179-
),
177+
uriValue.map((v) => dereferenceFileValue(v, evaultClient, localKey)),
180178
);
181179
} else {
182180
result[localKey] = await dereferenceFileValue(
@@ -315,9 +313,7 @@ export async function toGlobal({
315313
if (evaultClient && ownerEvault) {
316314
if (Array.isArray(rawVal)) {
317315
result[fileTargetKey] = await Promise.all(
318-
rawVal.map((v) =>
319-
referenceFileValue(v, ownerEvault, evaultClient),
320-
),
316+
rawVal.map((v) => referenceFileValue(v, ownerEvault, evaultClient)),
321317
);
322318
} else {
323319
result[fileTargetKey] = await referenceFileValue(

infrastructure/web3-adapter/src/w3ds/uri.test.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ import {
99
describe("w3ds file URI", () => {
1010
describe("buildFileUri", () => {
1111
it("builds a canonical URI", () => {
12-
expect(
13-
buildFileUri({ ename: "@alice", metaEnvelopeId: "abc123" }),
14-
).toBe("w3ds://file?id=@alice/abc123");
12+
expect(buildFileUri({ ename: "@alice", metaEnvelopeId: "abc123" })).toBe(
13+
"w3ds://file?id=@alice/abc123",
14+
);
1515
});
1616

1717
it("normalises a missing @ prefix on the ename", () => {
18-
expect(
19-
buildFileUri({ ename: "alice", metaEnvelopeId: "abc123" }),
20-
).toBe("w3ds://file?id=@alice/abc123");
18+
expect(buildFileUri({ ename: "alice", metaEnvelopeId: "abc123" })).toBe(
19+
"w3ds://file?id=@alice/abc123",
20+
);
2121
});
2222

2323
it("throws when ename or metaEnvelopeId is missing", () => {
24-
expect(() =>
25-
buildFileUri({ ename: "", metaEnvelopeId: "abc" }),
26-
).toThrow(InvalidW3dsUriError);
24+
expect(() => buildFileUri({ ename: "", metaEnvelopeId: "abc" })).toThrow(
25+
InvalidW3dsUriError,
26+
);
2727
expect(() =>
2828
buildFileUri({ ename: "@alice", metaEnvelopeId: "" }),
2929
).toThrow(InvalidW3dsUriError);
@@ -47,15 +47,15 @@ describe("w3ds file URI", () => {
4747
});
4848

4949
it("rejects a non-w3ds scheme", () => {
50-
expect(() =>
51-
parseFileUri("https://file?id=@alice/abc"),
52-
).toThrow(/expected scheme/);
50+
expect(() => parseFileUri("https://file?id=@alice/abc")).toThrow(
51+
/expected scheme/,
52+
);
5353
});
5454

5555
it("rejects a wrong host", () => {
56-
expect(() =>
57-
parseFileUri("w3ds://blob?id=@alice/abc"),
58-
).toThrow(/expected host/);
56+
expect(() => parseFileUri("w3ds://blob?id=@alice/abc")).toThrow(
57+
/expected host/,
58+
);
5959
});
6060

6161
it("rejects a missing id parameter", () => {
@@ -65,9 +65,9 @@ describe("w3ds file URI", () => {
6565
});
6666

6767
it("rejects an id without an ename", () => {
68-
expect(() =>
69-
parseFileUri("w3ds://file?id=alice/abc"),
70-
).toThrow(/must be in the form/);
68+
expect(() => parseFileUri("w3ds://file?id=alice/abc")).toThrow(
69+
/must be in the form/,
70+
);
7171
});
7272

7373
it("rejects an id without a meta-envelope-id segment", () => {

0 commit comments

Comments
 (0)