dedent
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -14,6 +14,4 @@ "use strict"; | ||
result += raw[i] | ||
// join lines when there is a suppressed newline | ||
.replace(/\\\n[ \t]*/g, "") | ||
// handle escaped backticks | ||
.replace(/\\`/g, "`"); | ||
// handle escaped newlines, backticks, and interpolation characters | ||
.replace(/\\`/g, "`").replace(/\\\n[ \t]*/g, "").replace(/\\\$/g, "$").replace(/\\{/g, "{"); | ||
if (i < values.length) { | ||
@@ -20,0 +18,0 @@ result += values[i]; |
{ | ||
"name": "dedent", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "An ES6 string tag that strips indentation from multi-line strings", | ||
@@ -10,5 +10,10 @@ "main": "dist/dedent.js", | ||
".": { | ||
"types": "./dist/dedent.d.ts", | ||
"import": "./dist/dedent.mjs", | ||
"default": "./dist/dedent.js" | ||
"import": { | ||
"types": "./dist/dedent.d.mts", | ||
"default": "./dist/dedent.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/dedent.d.ts", | ||
"default": "./dist/dedent.js" | ||
} | ||
} | ||
@@ -76,3 +81,3 @@ }, | ||
"build:modern": "BABEL_ENV=modern babel dedent.ts --out-file dist/dedent.mjs", | ||
"build:types": "tsup dedent.ts --dts-only", | ||
"build:types": "tsup dedent.ts --dts-only --format cjs,esm", | ||
"lint": "eslint .", | ||
@@ -79,0 +84,0 @@ "prepack": "yarn build", |
Sorry, the diff of this file is not supported yet
9024
120