diff --git a/src/doc-utils.js b/src/doc-utils.js index f727bdb8d08c..61c5babeacbb 100644 --- a/src/doc-utils.js +++ b/src/doc-utils.js @@ -68,18 +68,6 @@ function isEmpty(n) { return typeof n === "string" && n.length === 0; } -function getFirstString(doc) { - return findInDoc( - doc, - doc => { - if (typeof doc === "string" && doc.trim().length !== 0) { - return doc; - } - }, - null - ); -} - function isLineNext(doc) { return findInDoc( doc, @@ -150,7 +138,6 @@ function propagateBreaks(doc) { module.exports = { isEmpty, - getFirstString, willBreak, isLineNext, traverseDoc, diff --git a/src/printer.js b/src/printer.js index f1da58fc0653..e403e103050f 100644 --- a/src/printer.js +++ b/src/printer.js @@ -24,7 +24,6 @@ var lineSuffixBoundary = docBuilders.lineSuffixBoundary; var docUtils = require("./doc-utils"); var willBreak = docUtils.willBreak; var isLineNext = docUtils.isLineNext; -var getFirstString = docUtils.getFirstString; var isEmpty = docUtils.isEmpty; var types = require("ast-types"); @@ -3201,16 +3200,6 @@ function adjustClause(node, clause, forceSpace) { return indent(concat([line, clause])); } -function isCurlyBracket(doc) { - const str = getFirstString(doc); - return str === "{" || str === "{}"; -} - -function isEmptyBlock(doc) { - const str = getFirstString(doc); - return str === "{}"; -} - function shouldTypeScriptTypeAvoidColon(path) { // As the special TS nodes isn't returned by the node helpers, // we use the stack directly to get the parent node.