Allow StringLiteral to be used as ObjectTypeProperty.key (#7639)
This commit is contained in:
parent
9a26c2b07a
commit
0200e6256a
@ -1553,7 +1553,7 @@ See also `t.isObjectTypeProperty(node, opts)` and `t.assertObjectTypeProperty(no
|
||||
|
||||
Aliases: `Flow`, `UserWhitespacable`
|
||||
|
||||
- `key`: `Identifier` (required)
|
||||
- `key`: `Identifier | StringLiteral` (required)
|
||||
- `value`: `FlowType` (required)
|
||||
- `variance`: `Variance` (default: `null`)
|
||||
- `kind`: `"init" | "get" | "set"` (default: `null`)
|
||||
|
||||
@ -291,7 +291,7 @@ defineType("ObjectTypeProperty", {
|
||||
visitor: ["key", "value", "variance"],
|
||||
aliases: ["Flow", "UserWhitespacable"],
|
||||
fields: {
|
||||
key: validateType("Identifier"),
|
||||
key: validateType(["Identifier", "StringLiteral"]),
|
||||
value: validateType("FlowType"),
|
||||
kind: validate(assertOneOf("init", "get", "set")),
|
||||
static: validate(assertValueType("boolean")),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user