[REF] *: reformat with prettier and printWidth=100

closes #214
This commit is contained in:
Géry Debongnie
2019-06-28 10:32:03 +02:00
parent 0095bfa61f
commit af7520d869
28 changed files with 268 additions and 948 deletions
+4 -9
View File
@@ -52,15 +52,11 @@ interface FileData {
sections: MarkDownSection[];
}
function isLinkValid(
link: MarkDownLink,
current: FileData,
files: FileData[]
): boolean {
function isLinkValid(link: MarkDownLink, current: FileData, files: FileData[]): boolean {
const parts = link.link.split("#");
const currentParts = current.name.split("/");
const path = currentParts.length > 1 ? currentParts[0] + '/' : "";
const fullName = path + parts[0];
const path = currentParts.length > 1 ? currentParts[0] + "/" : "";
const fullName = path + parts[0];
if (parts.length === 1) {
// no # in url
if (parts[0].endsWith(".md")) {
@@ -70,8 +66,7 @@ function isLinkValid(
}
}
} else {
const file =
parts[0] === "" ? current : files.find(f => f.name === fullName);
const file = parts[0] === "" ? current : files.find(f => f.name === fullName);
if (!file) {
return false;
}