tamino-martinius / node-ts-dedent

TypeScript package which smartly trims and strips indentation from multi-line strings
MIT License
162 stars 8 forks source link

Fix escape sequences #14

Closed ArmaanT closed 3 years ago

ArmaanT commented 3 years ago

This PR fixes a bug where escape sequences aren't processed by dedent when it's used as a tag.

For example using the following code:

console.log(dedent`\${abc}`);
console.log(dedent(`\${abc}`));

The expected result is:

${abc}
${abc}

But the actual behavior is:

\${abc}
${abc}

I'm not sure if removing .raw could have other side effects, but the current tests are passing and from the docs it looks like it shouldn't have any other consequences.

codecov-io commented 3 years ago

Codecov Report

Merging #14 (600b0d1) into master (49635b6) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #14   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           19        19           
  Branches         4         4           
=========================================
  Hits            19        19           
Impacted Files Coverage Δ
src/index.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 49635b6...600b0d1. Read the comment docs.

ArmaanT commented 3 years ago

Pinging @tamino-martinius, let me know what you think