Skip to content

Commit 640d887

Browse files
committed
fix(parse): check if interface already collected
1 parent 353ba8f commit 640d887

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

src/parse.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function collectUsed(
7777
) {
7878
complexTypes.forEach(typeName => {
7979
const fi = interfaces.find(i => i.name === typeName);
80-
if (fi) {
80+
if (fi && !data.interfaces.some(i => i.name === fi.name)) {
8181
collectInterfaces(data, fi, interfaces, enums);
8282
}
8383
const ei = enums.find(i => i.name === typeName);

src/test/README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,11 @@ Trigger a selection started haptic hint
123123

124124
#### HapticsImpactOptions
125125

126-
| Prop | Type | Description | Default | Since |
127-
| --------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ----- |
128-
| **style** | [HapticsImpactStyle](#hapticsimpactstyle) | Impact Feedback Style The mass of the objects in the collision simulated by a [UIImpactFeedbackGenerator](https://developer.apple.com/documentation/uikit/uiimpactfeedbackstyle) object. | HapticsImpactStyle.Heavy | 1.0.0 |
129-
| **value** | boolean | | | |
126+
| Prop | Type | Description | Default | Since |
127+
| ------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ----- |
128+
| **style** | [HapticsImpactStyle](#hapticsimpactstyle) | Impact Feedback Style The mass of the objects in the collision simulated by a [UIImpactFeedbackGenerator](https://developer.apple.com/documentation/uikit/uiimpactfeedbackstyle) object. | HapticsImpactStyle.Heavy | 1.0.0 |
129+
| **value** | boolean | | | |
130+
| **recursive** | [HapticsImpactOptions](#hapticsimpactoptions) | | | |
130131

131132

132133
#### HapticsNotificationOptions

src/test/docs.json

+9
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@
156156
"docs": "",
157157
"complexTypes": [],
158158
"type": "boolean"
159+
},
160+
{
161+
"name": "recursive",
162+
"tags": [],
163+
"docs": "",
164+
"complexTypes": [
165+
"HapticsImpactOptions"
166+
],
167+
"type": "HapticsImpactOptions"
159168
}
160169
]
161170
},

src/test/fixtures/definitions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export interface HapticsImpactOptions {
5656
style: HapticsImpactStyle;
5757

5858
value: boolean;
59+
60+
recursive: HapticsImpactOptions;
5961
}
6062

6163
/**

src/test/parse.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('parse', () => {
8282
const i = interfaces.find(i => i.name === 'HapticsImpactOptions');
8383
expect(i.slug).toBe(`hapticsimpactoptions`);
8484
expect(i.methods).toHaveLength(0);
85-
expect(i.properties).toHaveLength(2);
85+
expect(i.properties).toHaveLength(3);
8686

8787
const p0 = i.properties[0];
8888
expect(p0.name).toBe(`style`);

0 commit comments

Comments
 (0)