Skip to content

Commit

Permalink
fix fetch-meta-tags async
Browse files Browse the repository at this point in the history
  • Loading branch information
silversonicaxel committed May 4, 2024
1 parent 1c01676 commit 628ac8d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 14 additions & 12 deletions types/fetch-meta-tags/fetch-meta-tags-tests.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import fetchMeta from "fetch-meta-tags";

// $ExpectType fetchedMeta
const data = fetchMeta("https://alessandrorabitti.com/");
(async () => {
// $ExpectType fetchedMeta
const data = await fetchMeta("https://alessandrorabitti.com/");

// @ts-expect-error
fetchMeta(true);
// @ts-expect-error
await fetchMeta(true);

// @ts-expect-error
fetchMeta(false);
// @ts-expect-error
await fetchMeta(false);

// @ts-expect-error
fetchMeta(1983);
// @ts-expect-error
await fetchMeta(1983);

// @ts-expect-error
fetchMeta(undefined);
// @ts-expect-error
await fetchMeta(undefined);

// @ts-expect-error
fetchMeta({});
// @ts-expect-error
await fetchMeta({});
})();
2 changes: 1 addition & 1 deletion types/fetch-meta-tags/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export interface fetchedMeta {
image?: string;
}

export default function fetchMeta(site: string): fetchedMeta;
export default function fetchMeta(site: string): Promise<fetchedMeta>;

0 comments on commit 628ac8d

Please sign in to comment.