From 21729d8207a789c110f54d85374856aedc41126e Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Fri, 20 Jan 2017 14:55:41 -0800 Subject: [PATCH] Drop jsesc (#357) Even though JSON.stringify is not 100% correct, this is only used for debugging and doesn't warrant adding a dependency for it. --- package.json | 1 - src/doc-debug.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index 4d7a05f37..ad28ca236 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "esutils": "2.0.2", "flow-parser": "0.38.0", "get-stdin": "5.0.1", - "jsesc": "2.4.0", "minimist": "1.2.0", "private": "0.1.6" }, diff --git a/src/doc-debug.js b/src/doc-debug.js index ef5b08210..af39cc881 100644 --- a/src/doc-debug.js +++ b/src/doc-debug.js @@ -1,5 +1,4 @@ "use strict"; -var jsesc = require("jsesc"); function flattenDoc(doc) { if (!doc || typeof doc === "string" || doc.type === "line") { @@ -47,7 +46,7 @@ function flattenDoc(doc) { function printDoc(doc) { if (typeof doc === "string") { - return jsesc(doc, { wrap: true }); + return JSON.stringify(doc); } if (doc.type === "line") {