Skip to content

Commit

Permalink
feat: new Function - canUseDom
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatAuk committed Aug 16, 2023
1 parent 704c5ef commit 2371049
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/dom/src/canUseDom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* The function checks if the DOM (Document Object Model) can be used in the current environment.
* @returns a boolean value indicating whether the DOM (Document Object Model) can be used.
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/canUseDom.ts
*/
export function canUseDom() {
return !!(typeof window !== 'undefined' && window.document && window.document.createElement)
}

0 comments on commit 2371049

Please sign in to comment.