mirror of
https://github.com/misskey-dev/summaly.git
synced 2025-06-21 10:57:58 +09:00
lint
This commit is contained in:
parent
f8953abefb
commit
1e10ab9b82
@ -91,8 +91,12 @@ export default async (url: URL.Url): Promise<Summary> => {
|
|||||||
const toAbsolute = (relativeURLString: string): string => {
|
const toAbsolute = (relativeURLString: string): string => {
|
||||||
const relativeURL = URL.parse(relativeURLString);
|
const relativeURL = URL.parse(relativeURLString);
|
||||||
const isAbsolute = relativeURL.slashes || relativeURL.path[0] === '/';
|
const isAbsolute = relativeURL.slashes || relativeURL.path[0] === '/';
|
||||||
|
|
||||||
// 既に絶対的なら、即座に値を返却
|
// 既に絶対的なら、即座に値を返却
|
||||||
if (isAbsolute) return relativeURLString;
|
if (isAbsolute) {
|
||||||
|
return relativeURLString;
|
||||||
|
}
|
||||||
|
|
||||||
// スラッシュを付けて返却
|
// スラッシュを付けて返却
|
||||||
return '/' + relativeURLString;
|
return '/' + relativeURLString;
|
||||||
};
|
};
|
||||||
|
@ -15,7 +15,9 @@ export default function(title: string, siteName?: string): string {
|
|||||||
for (let i = 0; i < patterns.length; i++) {
|
for (let i = 0; i < patterns.length; i++) {
|
||||||
const pattern = new RegExp(patterns[i]);
|
const pattern = new RegExp(patterns[i]);
|
||||||
const [, match] = pattern.exec(title) || [null, null];
|
const [, match] = pattern.exec(title) || [null, null];
|
||||||
if (match) return match;
|
if (match) {
|
||||||
|
return match;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user