AIdentity

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

wasmCheck.ts (591B)


      1 // utils/featureChecks.ts
      2 
      3 /**
      4  * ブラウザがWebAssemblyをサポートしているかを確認します。
      5  * クライアントサイドでのみ実行する必要があります。
      6  * @returns {boolean} WASMがサポートされていれば true
      7  */
      8 export const isWasmSupported = (): boolean => {
      9   // サーバーサイドレンダリング (SSR) を回避
     10   if (typeof window === 'undefined') {
     11     return false;
     12   }
     13 
     14   // グローバルスコープで `WebAssembly` オブジェクトが存在するかチェック
     15   return typeof WebAssembly !== 'undefined';
     16 };