Skip to content

Commit

Permalink
Remove now unused getFirstString (#1231)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeux committed Apr 13, 2017
1 parent 4d9edec commit 3709105
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
13 changes: 0 additions & 13 deletions src/doc-utils.js
Expand Up @@ -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,
Expand Down Expand Up @@ -150,7 +138,6 @@ function propagateBreaks(doc) {

module.exports = {
isEmpty,
getFirstString,
willBreak,
isLineNext,
traverseDoc,
Expand Down
11 changes: 0 additions & 11 deletions src/printer.js
Expand Up @@ -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");
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 3709105

Please sign in to comment.