Skip to content

Commit

Permalink
🐛 直接編成の出力コードを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
madonoharu committed Jul 2, 2022
1 parent 84ccecc commit 10d29b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/kcs/.swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"module": {
"type": "commonjs",
"strict": true,
"strictMode": false
"strictMode": false,
"noInterop": true
}
}
10 changes: 8 additions & 2 deletions packages/kcs/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
AirSquadronState,
FleetState,
GearState,
Expand Down Expand Up @@ -163,7 +163,13 @@ function createOrgState(model: Model): OrgState {
return result;
}

declare const temp1: { model: Model };
declare const temp1: { model: Model | undefined } | undefined;

if (typeof temp1 === "undefined") {
throw new Error(`temp1が存在しません。手順を確認してください。`);
} else if (typeof temp1.model === "undefined") {
throw new Error(`temp1内にmodelが存在しません。手順を確認してください。`);
}

const org = createOrgState(temp1.model);
const str = JSON.stringify(org);
Expand Down

0 comments on commit 10d29b1

Please sign in to comment.