Skip to content

Commit

Permalink
docs: update transforms example to use factory (#1386)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyhede committed Mar 16, 2023
1 parent 42d811e commit dc1c1b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/manipulation/transforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sourceFile.transform(traversal => {

if (ts.isNumericLiteral(node)) {
const incrementedValue = parseInt(node.text, 10) + 1;
return ts.createNumericLiteral(incrementedValue.toString());
return traversal.factory.createNumericLiteral(incrementedValue.toString());
}

return node;
Expand Down

0 comments on commit dc1c1b4

Please sign in to comment.