-
-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correctly handle ObjectTypeSpreadProperty in object type annotat…
…ions (#593) Co-authored-by: Daniel Tschinder <231804+danez@users.noreply.github.com>
- Loading branch information
1 parent
997c7da
commit 4718d8b
Showing
3 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
107 changes: 107 additions & 0 deletions
107
src/utils/__tests__/__snapshots__/getFlowType-test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`getFlowType handles ObjectTypeSpreadProperty 1`] = ` | ||
Object { | ||
"name": "signature", | ||
"raw": "{| apple: string, banana: string, ...OtherFruits |}", | ||
"signature": Object { | ||
"properties": Array [ | ||
Object { | ||
"key": "apple", | ||
"value": Object { | ||
"name": "string", | ||
"required": true, | ||
}, | ||
}, | ||
Object { | ||
"key": "banana", | ||
"value": Object { | ||
"name": "string", | ||
"required": true, | ||
}, | ||
}, | ||
Object { | ||
"key": "orange", | ||
"value": Object { | ||
"name": "string", | ||
"required": true, | ||
}, | ||
}, | ||
], | ||
}, | ||
"type": "object", | ||
} | ||
`; | ||
|
||
exports[`getFlowType handles nested ObjectTypeSpreadProperty 1`] = ` | ||
Object { | ||
"name": "signature", | ||
"raw": "{| apple: string, banana: string, ...BreakfastFruits |}", | ||
"signature": Object { | ||
"properties": Array [ | ||
Object { | ||
"key": "apple", | ||
"value": Object { | ||
"name": "string", | ||
"required": true, | ||
}, | ||
}, | ||
Object { | ||
"key": "banana", | ||
"value": Object { | ||
"name": "string", | ||
"required": true, | ||
}, | ||
}, | ||
Object { | ||
"key": "mango", | ||
"value": Object { | ||
"name": "string", | ||
"required": true, | ||
}, | ||
}, | ||
Object { | ||
"key": "orange", | ||
"value": Object { | ||
"name": "string", | ||
"required": true, | ||
}, | ||
}, | ||
Object { | ||
"key": "lemon", | ||
"value": Object { | ||
"name": "string", | ||
"required": true, | ||
}, | ||
}, | ||
], | ||
}, | ||
"type": "object", | ||
} | ||
`; | ||
|
||
exports[`getFlowType handles unresolved ObjectTypeSpreadProperty 1`] = ` | ||
Object { | ||
"name": "signature", | ||
"raw": "{| apple: string, banana: string, ...MyType |}", | ||
"signature": Object { | ||
"properties": Array [ | ||
Object { | ||
"key": "apple", | ||
"value": Object { | ||
"name": "string", | ||
"required": true, | ||
}, | ||
}, | ||
Object { | ||
"key": "banana", | ||
"value": Object { | ||
"name": "string", | ||
"required": true, | ||
}, | ||
}, | ||
], | ||
}, | ||
"type": "object", | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters