Remove now unused getFirstString (#1231)

master
Christopher Chedeau 2017-04-13 08:34:49 -07:00 committed by GitHub
parent 4d9edec4e1
commit 3709105199
2 changed files with 0 additions and 24 deletions

View File

@ -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,

View File

@ -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.