forked from gajus/flow-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support alternative syntax for exact object
Sometimes `{ [any]: empty }` is used as a workaround instead of `{||}`. See: - facebook/flow#2977 - facebook/flow#4582
- Loading branch information
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
...gin-flow-runtime/src/__tests__/__fixtures__/typeAliases/objects/objectWithExactIndexer.js
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,15 @@ | ||
/* @flow */ | ||
|
||
export const input = ` | ||
type Demo = { | ||
foo?: number; | ||
[any]: empty; | ||
}; | ||
`; | ||
|
||
export const expected = ` | ||
import t from "flow-runtime"; | ||
const Demo = t.type("Demo", t.exactObject( | ||
t.property("foo", t.number(), true) | ||
)); | ||
`; |
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
11acd6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skovhus do you mind if I close this since
$Shape
works instead?