Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/happy-seahorses-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"aws-sdk-js-codemod": patch
---

Check for raw string in extra.raw when searching for quotes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const AWS = require('aws-sdk');

const client = new AWS.DynamoDB();
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const { DynamoDB } = require('@aws-sdk/client-dynamodb');

const client = new DynamoDB();
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const getMostUsedStringLiteralQuote = (
if (typeof value === "string") {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore Property 'raw' does not exist on type 'Literal'.
const rawValue = path.node.raw || "";
const rawValue = path.node.raw || path.node.extra?.raw || "";
if (rawValue.startsWith("'")) {
quoteCount[StringLiteralQuoteType.SINGLE]++;
} else if (rawValue.startsWith('"')) {
Expand Down