Skip to content

Commit d221d7c

Browse files
pbarbierogajus
authored andcommitted
fix: use t.stringLiteral to create an identifier (#92)
From #89 `Identifiers can't have quotes. If the key is supposed to be a string, it should be t.stringLiteral(name). Because it is an identifier it is an invalid AST.`
1 parent fe1b3a5 commit d221d7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/createObjectExpression.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const createObjectExpression = (t: BabelTypes, object: InputObjectType): ObjectE
3232

3333
properties.push(
3434
t.objectProperty(
35-
t.identifier('\'' + name + '\''),
35+
t.stringLiteral(name),
3636
newValue
3737
)
3838
);

0 commit comments

Comments
 (0)