Skip to content

Commit

Permalink
refactor: デフォルトエンジンのタイプチェックを追加し、パス以外の場合にエラーをスロー
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Nov 10, 2024
1 parent 091df5f commit fa29982
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/backend/browser/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { loadEnvEngineInfos } from "@/domain/defaultEngine/envEngineInfo";
import { type EngineInfo } from "@/type/preload";

const baseEngineInfo = loadEnvEngineInfos()[0];
if (baseEngineInfo.type != "path") {
throw new Error("default engine type must be path");
}

export const defaultEngine: EngineInfo = (() => {
const { protocol, hostname, port, pathname } = new URL(baseEngineInfo.host);
Expand Down

0 comments on commit fa29982

Please sign in to comment.