Skip to content

Commit

Permalink
fix: typeof string literal in isBrowser check
Browse files Browse the repository at this point in the history
  • Loading branch information
nadilas committed May 31, 2024
1 parent ee1d091 commit 5174cb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/ogre/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const emailRegex =
/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/;

export const isBrowser = () =>
typeof window !== "undefined" && typeof window.document !== undefined;
typeof window !== "undefined" && typeof window.document !== "undefined";

export const cleanAuthor = (author: string): [name: string, email: string] => {
if (author === "") {
throw new Error(`author not provided`);
Expand Down

0 comments on commit 5174cb4

Please sign in to comment.