Skip to content

Commit

Permalink
Allow StringLiteral to be used as ObjectTypeProperty.key (#7639)
Browse files Browse the repository at this point in the history
  • Loading branch information
unconfident authored and existentialism committed Mar 28, 2018
1 parent 9a26c2b commit 0200e62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/babel-types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-types/src/definitions/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand Down

0 comments on commit 0200e62

Please sign in to comment.