From 1e10ab9b8219ac1b311fa2b0c1b94e510dbd6088 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 13 Sep 2017 03:32:12 +0900 Subject: [PATCH] lint --- src/general.ts | 6 +++++- src/utils/cleanup-title.ts | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/general.ts b/src/general.ts index 4876e1b..2148cf7 100644 --- a/src/general.ts +++ b/src/general.ts @@ -91,8 +91,12 @@ export default async (url: URL.Url): Promise => { const toAbsolute = (relativeURLString: string): string => { const relativeURL = URL.parse(relativeURLString); const isAbsolute = relativeURL.slashes || relativeURL.path[0] === '/'; + // 既に絶対的なら、即座に値を返却 - if (isAbsolute) return relativeURLString; + if (isAbsolute) { + return relativeURLString; + } + // スラッシュを付けて返却 return '/' + relativeURLString; }; diff --git a/src/utils/cleanup-title.ts b/src/utils/cleanup-title.ts index af67157..6b5bc8b 100644 --- a/src/utils/cleanup-title.ts +++ b/src/utils/cleanup-title.ts @@ -15,7 +15,9 @@ export default function(title: string, siteName?: string): string { for (let i = 0; i < patterns.length; i++) { const pattern = new RegExp(patterns[i]); const [, match] = pattern.exec(title) || [null, null]; - if (match) return match; + if (match) { + return match; + } } }