Skip to content

Commit d05218c

Browse files
committed
fix(formatter): properties
support for latest properties types
1 parent 272c48c commit d05218c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/utils/formatter.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ const formatHypercertData = ({
4848
external_url?: string;
4949
image: string;
5050
version: string;
51-
properties?: { trait_type: string; value?: string; [k: string]: unknown }[];
51+
properties?: (
52+
| { trait_type: string; value: string }
53+
| { trait_type: string; type: string; src: string; name: string }
54+
)[];
5255
impactScope: string[];
5356
excludedImpactScope: string[];
5457
workScope: string[];

test/utils/formatter.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ const testData: Partial<TestDataType> = {
1717
workScope: ["test work scope"],
1818
workTimeframeStart: Math.floor(new Date().getTime()) / 1000,
1919
workTimeframeEnd: Math.floor(new Date().getTime()) / 1000,
20-
properties: [{ trait_type: "test trait type", value: "aaa" }],
20+
properties: [
21+
{ trait_type: "test trait type", value: "aaa" },
22+
{ trait_type: "test trait type", type: "image", src: "https://example.com", name: "test name" },
23+
],
2124
rights: ["test right 1", "test right 2"],
2225
version: "0.0.1",
2326
};

0 commit comments

Comments
 (0)