summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordelucis2024-07-27 17:18:58 +0000
committerfredkbot2024-07-27 17:18:58 +0000
commit85b1ab4f7aa4b2732761b5243b1106941195ebfe (patch)
treeade9ef822e81dff02bfe4fc72c43d75ae9302cc9
parent0b381d53f23c31492cf415057d960f9a5eaa2f3d (diff)
downloadIT.starlight-85b1ab4f7aa4b2732761b5243b1106941195ebfe.tar.gz
IT.starlight-85b1ab4f7aa4b2732761b5243b1106941195ebfe.tar.bz2
IT.starlight-85b1ab4f7aa4b2732761b5243b1106941195ebfe.zip
[ci] format
-rw-r--r--packages/starlight/__tests__/basics/head.test.ts16
-rw-r--r--packages/starlight/utils/head.ts2
2 files changed, 10 insertions, 8 deletions
diff --git a/packages/starlight/__tests__/basics/head.test.ts b/packages/starlight/__tests__/basics/head.test.ts
index 999ccce2..3824d1cc 100644
--- a/packages/starlight/__tests__/basics/head.test.ts
+++ b/packages/starlight/__tests__/basics/head.test.ts
@@ -14,21 +14,23 @@ describe('createHead', () => {
test('merges two <link rel="canonical" href="" /> tags', () => {
expect(
createHead(
- [{ tag: 'link', attrs: { rel: 'canonical', href: "https://example.com" }, }],
- [{ tag: 'link', attrs: { rel: 'canonical', href: "https://astro.build" }, content: '' }],
+ [{ tag: 'link', attrs: { rel: 'canonical', href: 'https://example.com' } }],
+ [{ tag: 'link', attrs: { rel: 'canonical', href: 'https://astro.build' }, content: '' }]
)
- ).toEqual([{ tag: 'link', attrs: { rel: 'canonical', href: "https://astro.build" }, content: '' }]);
+ ).toEqual([
+ { tag: 'link', attrs: { rel: 'canonical', href: 'https://astro.build' }, content: '' },
+ ]);
});
test('does not merge same link tags', () => {
expect(
createHead(
- [{ tag: 'link', attrs: { rel: 'stylesheet', href: "primary.css" }, content: '' }],
- [{ tag: 'link', attrs: { rel: 'stylesheet', href: "secondary.css" }, content: '' }],
+ [{ tag: 'link', attrs: { rel: 'stylesheet', href: 'primary.css' }, content: '' }],
+ [{ tag: 'link', attrs: { rel: 'stylesheet', href: 'secondary.css' }, content: '' }]
)
).toEqual([
- { tag: 'link', attrs: { rel: 'stylesheet', href: "primary.css" }, content: '' },
- { tag: 'link', attrs: { rel: 'stylesheet', href: "secondary.css" }, content: '' }
+ { tag: 'link', attrs: { rel: 'stylesheet', href: 'primary.css' }, content: '' },
+ { tag: 'link', attrs: { rel: 'stylesheet', href: 'secondary.css' }, content: '' },
]);
});
diff --git a/packages/starlight/utils/head.ts b/packages/starlight/utils/head.ts
index c84537c6..05be81f2 100644
--- a/packages/starlight/utils/head.ts
+++ b/packages/starlight/utils/head.ts
@@ -26,7 +26,7 @@ function hasTag(head: HeadConfig, entry: HeadConfig[number]): boolean {
case 'meta':
return hasOneOf(head, entry, ['name', 'property', 'http-equiv']);
case 'link':
- return head.some(({ attrs }) => attrs.rel === 'canonical')
+ return head.some(({ attrs }) => attrs.rel === 'canonical');
default:
return false;
}