From 14e8f07031cf6f5f0b9a8afc35ea13057ec05ee4 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Tue, 8 Nov 2022 17:34:26 -0800 Subject: [PATCH] Replace dedent package with string-dedent The dedent package seems to be dead. I ran into this issue which has been open for 4 years and seems pretty serious: https://github.com/dmnd/dedent/issues/20 Replace the package with string-dedent, an alternative maintained by the author of the TC39 String.dedent proposal. --- package-lock.json | 17 ++++++++++++++++- package.json | 2 +- src/examples/adding-with-logging.js | 2 +- src/examples/arith-operators.js | 2 +- src/examples/comparisons.js | 2 +- src/examples/equality.js | 3 +-- src/examples/formatting.js | 2 +- src/examples/rounding.js | 2 +- src/examples/scientific.js | 2 +- src/examples/using-the-dom.js | 2 +- 10 files changed, 25 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index a493d8cc..61b1ac2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,6 @@ "babel-plugin-tester": "^10.1.0", "big.js": "6.1.1", "decimal.js": "10.3.1", - "dedent": "^0.7.0", "eslint": "^8.5.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-react": "^7.30.1", @@ -38,6 +37,7 @@ "node-polyfill-webpack-plugin": "^1.1.4", "path-browserify": "^1.0.1", "prettier": "2.5.1", + "string-dedent": "^3.0.1", "webpack": "^5.65.0", "webpack-cli": "^4.9.1" } @@ -10817,6 +10817,15 @@ } ] }, + "node_modules/string-dedent": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/string-dedent/-/string-dedent-3.0.1.tgz", + "integrity": "sha512-A2zCXSgpPrpFi1lDJlDwIPYakBWeDtQZ8ZBKssB8M/WbtNEKTzsl1yCDRmHx55jSB27xZDQ6NOtRYekESWx6fw==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -20089,6 +20098,12 @@ } } }, + "string-dedent": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/string-dedent/-/string-dedent-3.0.1.tgz", + "integrity": "sha512-A2zCXSgpPrpFi1lDJlDwIPYakBWeDtQZ8ZBKssB8M/WbtNEKTzsl1yCDRmHx55jSB27xZDQ6NOtRYekESWx6fw==", + "dev": true + }, "string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", diff --git a/package.json b/package.json index 718094c2..6d4f80ff 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "babel-plugin-tester": "^10.1.0", "big.js": "6.1.1", "decimal.js": "10.3.1", - "dedent": "^0.7.0", "eslint": "^8.5.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-react": "^7.30.1", @@ -45,6 +44,7 @@ "node-polyfill-webpack-plugin": "^1.1.4", "path-browserify": "^1.0.1", "prettier": "2.5.1", + "string-dedent": "^3.0.1", "webpack": "^5.65.0", "webpack-cli": "^4.9.1" }, diff --git a/src/examples/adding-with-logging.js b/src/examples/adding-with-logging.js index c61d305d..dcc8e85f 100644 --- a/src/examples/adding-with-logging.js +++ b/src/examples/adding-with-logging.js @@ -1,4 +1,4 @@ -import dedent from "dedent"; +import dedent from "string-dedent"; export const ADDING_WITH_LOGGING = { title: "Using the Playground: Adding with Logging", diff --git a/src/examples/arith-operators.js b/src/examples/arith-operators.js index 5888aef9..6a78ef0d 100644 --- a/src/examples/arith-operators.js +++ b/src/examples/arith-operators.js @@ -1,4 +1,4 @@ -import dedent from "dedent"; +import dedent from "string-dedent"; const title = "Basics: Arithmetic Operators"; const description = "A tour of the arithmetic operators: + - * / %."; diff --git a/src/examples/comparisons.js b/src/examples/comparisons.js index 1ed323e0..706f2ae5 100644 --- a/src/examples/comparisons.js +++ b/src/examples/comparisons.js @@ -1,4 +1,4 @@ -import dedent from "dedent"; +import dedent from "string-dedent"; const title = "Basics: Comparisons"; const description = "Contrast comparisons: < > <= >=."; diff --git a/src/examples/equality.js b/src/examples/equality.js index 94e8736f..6baa9379 100644 --- a/src/examples/equality.js +++ b/src/examples/equality.js @@ -1,4 +1,4 @@ -import dedent from "dedent"; +import dedent from "string-dedent"; const title = "Basics: Equality"; const description = "Egads, check out equality."; @@ -18,7 +18,6 @@ const mixedTypesTriple = 2m === 2; const mixedBigIntTriple = 10n === 10m; log("not all equal:", sameTypesTriple, mixedTypesTriple, mixedBigIntTriple); - `; export const EQUALITY = { diff --git a/src/examples/formatting.js b/src/examples/formatting.js index 6a518b2d..364907c8 100644 --- a/src/examples/formatting.js +++ b/src/examples/formatting.js @@ -1,4 +1,4 @@ -import dedent from "dedent"; +import dedent from "string-dedent"; const title = "Methods: Formatting"; const description = "Format your decimals."; diff --git a/src/examples/rounding.js b/src/examples/rounding.js index 8e47b2af..df3f9e08 100644 --- a/src/examples/rounding.js +++ b/src/examples/rounding.js @@ -1,4 +1,4 @@ -import dedent from "dedent"; +import dedent from "string-dedent"; const title = "Methods: Rounding"; const description = "Getting precise with decimals."; diff --git a/src/examples/scientific.js b/src/examples/scientific.js index 45190ebb..13fdd72b 100644 --- a/src/examples/scientific.js +++ b/src/examples/scientific.js @@ -1,4 +1,4 @@ -import dedent from "dedent"; +import dedent from "string-dedent"; export const SCIENTIFIC_NOTATION = { title: "In Action: Scientific Notation", diff --git a/src/examples/using-the-dom.js b/src/examples/using-the-dom.js index 9484e102..1f2517ae 100644 --- a/src/examples/using-the-dom.js +++ b/src/examples/using-the-dom.js @@ -1,4 +1,4 @@ -import dedent from "dedent"; +import dedent from "string-dedent"; export const USING_THE_DOM = { title: "Using the DOM",