Remove now unused getFirstString (#1231)
parent
4d9edec4e1
commit
3709105199
|
@ -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,
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue