Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/icon/favicon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@
mask?: Image.Mask;
},
): Image.ImageLike {
// a func adding https:// to the URL
// for cases where the URL is not a full URL
// e.g. "raycast.com"
const withHttps = (url: string) => {

Check warning on line 40 in src/icon/favicon.ts

View workflow job for this annotation

GitHub Actions / tests

'withHttps' is assigned a value but never used
if (!url.startsWith("http")) {
return `https://${url}`;
}
return url;
};

try {
const sanitize = (url: string) => {
if (!url.startsWith("http")) {
Expand All @@ -46,7 +56,7 @@
const hostname = urlObj.hostname;

const faviconProvider: "none" | "raycast" | "apple" | "google" | "duckDuckGo" | "duckduckgo" | "legacy" =
(process.env.FAVICON_PROVIDER as any) ?? "raycast";

Check warning on line 59 in src/icon/favicon.ts

View workflow job for this annotation

GitHub Actions / tests

Unexpected any. Specify a different type

switch (faviconProvider) {
case "none":
Expand Down
1 change: 1 addition & 0 deletions tests/src/favicon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default function Command() {
return (
<List>
<List.Item icon={getFavicon("https://raycast.com")} title="Raycast Website" />
<List.Item icon={getFavicon("raycast.com")} title="Raycast Website" />
</List>
);
}
Loading