isaacscript 1.1.23 → 1.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/.cspell.json +2 -2
  2. package/.vscode/settings.json +4 -0
  3. package/README.md +1 -1
  4. package/dist/package.json +8 -9
  5. package/dist/src/checkForWindowsTerminalBugs.js +6 -6
  6. package/dist/src/commands/copy/copy.js +4 -3
  7. package/dist/src/commands/copy/copy.js.map +1 -1
  8. package/dist/src/commands/init/checkIfProjectPathExists.js +2 -2
  9. package/dist/src/commands/init/checkModTargetDirectory.js +2 -2
  10. package/dist/src/commands/init/createMod.js +4 -4
  11. package/dist/src/commands/init/getModsDir.js +6 -6
  12. package/dist/src/commands/init/getProjectPath.js +3 -3
  13. package/dist/src/commands/init/installVSCodeExtensions.js +3 -3
  14. package/dist/src/commands/init/promptSaveSlot.js +2 -2
  15. package/dist/src/commands/init/promptVSCode.js +2 -2
  16. package/dist/src/commands/monitor/copyWatcherMod.js +11 -0
  17. package/dist/src/commands/monitor/copyWatcherMod.js.map +1 -1
  18. package/dist/src/commands/monitor/getTSConfigInclude.js +4 -4
  19. package/dist/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js +6 -4
  20. package/dist/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.js.map +1 -1
  21. package/dist/src/commands/monitor/monitor.js +13 -12
  22. package/dist/src/commands/monitor/monitor.js.map +1 -1
  23. package/dist/src/commands/monitor/notifyGame.js +2 -2
  24. package/dist/src/commands/monitor/saveDatWriter/saveDatWriter.js +3 -3
  25. package/dist/src/commands/monitor/spawnSaveDatWriter.js +3 -3
  26. package/dist/src/commands/monitor/spawnSaveDatWriter.js.map +1 -1
  27. package/dist/src/commands/monitor/{touchSaveDatFiles.js → touchWatcherSaveDatFiles.js} +3 -3
  28. package/dist/src/commands/monitor/touchWatcherSaveDatFiles.js.map +1 -0
  29. package/dist/src/commands/publish/publish.js +27 -26
  30. package/dist/src/commands/publish/publish.js.map +1 -1
  31. package/dist/src/configFile.js +3 -3
  32. package/dist/src/configFile.js.map +1 -1
  33. package/dist/src/file.js +11 -11
  34. package/dist/src/main.js +3 -3
  35. package/dist/src/main.js.map +1 -1
  36. package/dist/src/types/Config.js.map +1 -1
  37. package/dist/src/{misc.js → util.js} +8 -2
  38. package/dist/src/{misc.js.map → util.js.map} +1 -1
  39. package/dist/src/validateNodeVersion.js +5 -5
  40. package/dist/src/validateOS.js +1 -2
  41. package/dist/src/validateOS.js.map +1 -1
  42. package/file-templates/dynamic/README.md +1 -1
  43. package/file-templates/dynamic/package.json +1 -1
  44. package/isaacscript-watcher/main.lua +17 -12
  45. package/isaacscript-watcher/resources/gfx/{emoji-eyes.anm2 → logo.anm2} +27 -27
  46. package/isaacscript-watcher/resources/gfx/logo.png +0 -0
  47. package/package.json +8 -9
  48. package/src/checkForWindowsTerminalBugs.ts +1 -1
  49. package/src/commands/copy/copy.ts +4 -3
  50. package/src/commands/init/checkIfProjectPathExists.ts +1 -1
  51. package/src/commands/init/checkModTargetDirectory.ts +1 -1
  52. package/src/commands/init/createMod.ts +1 -1
  53. package/src/commands/init/getModsDir.ts +1 -1
  54. package/src/commands/init/getProjectPath.ts +1 -1
  55. package/src/commands/init/installVSCodeExtensions.ts +1 -1
  56. package/src/commands/init/promptSaveSlot.ts +1 -1
  57. package/src/commands/init/promptVSCode.ts +1 -1
  58. package/src/commands/monitor/copyWatcherMod.ts +19 -0
  59. package/src/commands/monitor/getTSConfigInclude.ts +1 -1
  60. package/src/commands/monitor/modDirectorySyncer/modDirectorySyncer.ts +12 -4
  61. package/src/commands/monitor/monitor.ts +9 -10
  62. package/src/commands/monitor/notifyGame.ts +1 -1
  63. package/src/commands/monitor/saveDatWriter/saveDatWriter.ts +1 -1
  64. package/src/commands/monitor/spawnSaveDatWriter.ts +1 -1
  65. package/src/commands/monitor/{touchSaveDatFiles.ts → touchWatcherSaveDatFiles.ts} +1 -1
  66. package/src/commands/publish/publish.ts +8 -3
  67. package/src/configFile.ts +1 -1
  68. package/src/file.ts +1 -1
  69. package/src/main.ts +1 -1
  70. package/src/types/Config.ts +12 -0
  71. package/src/{misc.ts → util.ts} +8 -1
  72. package/src/validateNodeVersion.ts +1 -1
  73. package/src/validateOS.ts +1 -4
  74. package/dist/src/commands/monitor/touchSaveDatFiles.js.map +0 -1
  75. package/isaacscript-watcher/resources/gfx/emoji-eyes.png +0 -0
package/.cspell.json CHANGED
@@ -10,7 +10,6 @@
10
10
  "hkey",
11
11
  "isaacconfig",
12
12
  "isaacscript",
13
- "isaacscriptrc",
14
13
  "lua's",
15
14
  "luadebug",
16
15
  "luamod",
@@ -19,6 +18,8 @@
19
18
  "plusplus",
20
19
  "sarisia",
21
20
  "setversion",
21
+ "Spritesheet",
22
+ "Spritesheets",
22
23
  "steamapps",
23
24
  "steamcmd",
24
25
  "subprocesses",
@@ -30,7 +31,6 @@
30
31
  "tstl",
31
32
  "turnbull",
32
33
  "xmls",
33
- "zamiel",
34
34
  "zamiell"
35
35
  ]
36
36
  }
@@ -8,6 +8,10 @@
8
8
  "editor.rulers": [100],
9
9
  "editor.tabSize": 2,
10
10
 
11
+ "files.associations": {
12
+ "*.anm2": "xml", // anm2 files are just XML files
13
+ },
14
+
11
15
  // Linux line endings are used in this project
12
16
  "files.eol": "\n",
13
17
 
package/README.md CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  # IsaacScript
4
4
 
5
- IsaacScript is a tool to help you create *Binding of Isaac: Afterbirth+* mods using [TypeScript](https://www.typescriptlang.org/).
5
+ IsaacScript is a tool to help you create *Binding of Isaac: Repentance* mods using [TypeScript](https://www.typescriptlang.org/).
6
6
 
7
7
  Please visit the [official website](https://isaacscript.github.io/) for more information.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript",
3
- "version": "1.1.23",
3
+ "version": "1.1.27",
4
4
  "description": "A command line tool for managing Isaac mods written in TypeScript",
5
5
  "homepage": "https://isaacscript.github.io/",
6
6
  "bugs": {
@@ -24,11 +24,11 @@
24
24
  "jsonc-parser": "^3.0.0",
25
25
  "moment": "^2.29.1",
26
26
  "npm-check-updates": "^11.8.5",
27
- "prompts": "^2.4.1",
27
+ "prompts": "^2.4.2",
28
28
  "source-map-support": "^0.5.20",
29
- "sync-directory": "^2.2.22",
30
- "typescript": "4.4.3",
31
- "typescript-to-lua": "^1.0.1",
29
+ "sync-directory": "^4.0.5",
30
+ "typescript": "4.4.4",
31
+ "typescript-to-lua": "^1.1.0",
32
32
  "update-notifier": "^5.1.0",
33
33
  "yargs": "^17.2.1"
34
34
  },
@@ -36,12 +36,11 @@
36
36
  "@types/command-exists": "^1.2.0",
37
37
  "@types/figlet": "^1.5.4",
38
38
  "@types/fs-extra": "^9.0.13",
39
- "@types/node": "^16.10.1",
39
+ "@types/node": "^16.11.6",
40
40
  "@types/prompts": "^2.0.14",
41
41
  "@types/source-map-support": "^0.5.4",
42
42
  "@types/update-notifier": "^5.1.0",
43
- "@types/yargs": "^17.0.3",
44
- "isaacscript-lint": "^1.0.61",
45
- "ts-prune": "^0.10.0"
43
+ "@types/yargs": "^17.0.4",
44
+ "isaacscript-lint": "^1.0.63"
46
45
  }
47
46
  }
@@ -28,7 +28,7 @@ const os_1 = __importDefault(require("os"));
28
28
  const path_1 = __importDefault(require("path"));
29
29
  const prompts_1 = __importDefault(require("prompts"));
30
30
  const file = __importStar(require("./file"));
31
- const misc_1 = require("./misc");
31
+ const util_1 = require("./util");
32
32
  // https://stackoverflow.com/questions/9080085/node-js-find-home-directory-in-platform-agnostic-way
33
33
  const homeDir = os_1.default.homedir();
34
34
  const BASH_PROFILE_PATH = path_1.default.join(homeDir, ".bash_profile");
@@ -49,12 +49,12 @@ async function checkForWindowsTerminalBugs() {
49
49
  exports.default = checkForWindowsTerminalBugs;
50
50
  async function checkForCodePage() {
51
51
  const chcpPath = "C:\\Windows\\System32\\chcp.com";
52
- const stdout = (0, misc_1.execExe)(chcpPath).trim();
52
+ const stdout = (0, util_1.execExe)(chcpPath).trim();
53
53
  // The output of "chcp" will be different depending on the language of the Windows installation,
54
54
  // so we only parse the final number
55
55
  const match = /(\d+)$/.exec(stdout);
56
56
  if (match === null) {
57
- (0, misc_1.error)(`Failed to parse the results of "${chalk_1.default.green(chcpPath)}":`, stdout);
57
+ (0, util_1.error)(`Failed to parse the results of "${chalk_1.default.green(chcpPath)}":`, stdout);
58
58
  }
59
59
  const activeCodePage = match[1].trim();
60
60
  if (activeCodePage === WINDOWS_CODE_PAGE) {
@@ -68,7 +68,7 @@ async function checkForCodePage() {
68
68
  initial: true,
69
69
  });
70
70
  if (response.fixCodePage === false) {
71
- (0, misc_1.error)("Ok then. Good-bye.");
71
+ (0, util_1.error)("Ok then. Good-bye.");
72
72
  }
73
73
  applyFixesToBashProfile();
74
74
  }
@@ -85,7 +85,7 @@ async function checkForWindowsBugColor() {
85
85
  initial: true,
86
86
  });
87
87
  if (response.fixColors === false) {
88
- (0, misc_1.error)("Ok then. Good-bye.");
88
+ (0, util_1.error)("Ok then. Good-bye.");
89
89
  }
90
90
  applyFixesToBashProfile();
91
91
  }
@@ -118,7 +118,7 @@ function applyFixesToBashProfile() {
118
118
  fs_1.default.appendFileSync(BASH_PROFILE_PATH, newText);
119
119
  }
120
120
  catch (err) {
121
- (0, misc_1.error)(`Failed to append text to "${BASH_PROFILE_PATH}":`, err);
121
+ (0, util_1.error)(`Failed to append text to "${BASH_PROFILE_PATH}":`, err);
122
122
  }
123
123
  console.log(chalk_1.default.green("Complete!"), `I have added the terminal fixes to "${BASH_PROFILE_PATH}".`);
124
124
  console.log(chalk_1.default.red("Please close and re-open your terminal, then run this program again."));
@@ -26,10 +26,11 @@ exports.compileAndCopy = void 0;
26
26
  const path_1 = __importDefault(require("path"));
27
27
  const constants_1 = require("../../constants");
28
28
  const file = __importStar(require("../../file"));
29
- const misc_1 = require("../../misc");
30
29
  const monkeyPatch_1 = require("../../monkeyPatch");
30
+ const util_1 = require("../../util");
31
31
  function copy(config) {
32
- const modTargetPath = path_1.default.join(config.modsDirectory, constants_1.CURRENT_DIRECTORY_NAME);
32
+ const modTargetDirectoryName = (0, util_1.getModTargetDirectoryName)(config);
33
+ const modTargetPath = path_1.default.join(config.modsDirectory, modTargetDirectoryName);
33
34
  compileAndCopy(constants_1.MOD_SOURCE_PATH, modTargetPath);
34
35
  }
35
36
  exports.default = copy;
@@ -40,7 +41,7 @@ function compileAndCopy(modSourcePath, modTargetPath) {
40
41
  }
41
42
  exports.compileAndCopy = compileAndCopy;
42
43
  function compile() {
43
- (0, misc_1.execShell)("npx", ["tstl"]);
44
+ (0, util_1.execShell)("npx", ["tstl"]);
44
45
  console.log("Mod compiled successfully.");
45
46
  }
46
47
  function copyMod(modSourcePath, modTargetPath) {
@@ -1 +1 @@
1
- {"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../../src/commands/copy/copy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,+CAA0E;AAC1E,iDAAmC;AACnC,qCAAuC;AACvC,mDAAuD;AAGvD,SAAwB,IAAI,CAAC,MAAc;IACzC,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,kCAAsB,CAAC,CAAC;IAC9E,cAAc,CAAC,2BAAe,EAAE,aAAa,CAAC,CAAC;AACjD,CAAC;AAHD,uBAGC;AAED,SAAgB,cAAc,CAC5B,aAAqB,EACrB,aAAqB;IAErB,OAAO,EAAE,CAAC;IACV,OAAO,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IACtC,IAAA,gCAAkB,EAAC,aAAa,CAAC,CAAC;AACpC,CAAC;AAPD,wCAOC;AAED,SAAS,OAAO;IACd,IAAA,gBAAS,EAAC,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3B,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,OAAO,CAAC,aAAqB,EAAE,aAAqB;IAC3D,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAC9B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAC1C,CAAC"}
1
+ {"version":3,"file":"copy.js","sourceRoot":"","sources":["../../../../src/commands/copy/copy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,+CAAkD;AAClD,iDAAmC;AACnC,mDAAuD;AAEvD,qCAAkE;AAElE,SAAwB,IAAI,CAAC,MAAc;IACzC,MAAM,sBAAsB,GAAG,IAAA,gCAAyB,EAAC,MAAM,CAAC,CAAC;IACjE,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAC;IAC9E,cAAc,CAAC,2BAAe,EAAE,aAAa,CAAC,CAAC;AACjD,CAAC;AAJD,uBAIC;AAED,SAAgB,cAAc,CAC5B,aAAqB,EACrB,aAAqB;IAErB,OAAO,EAAE,CAAC;IACV,OAAO,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IACtC,IAAA,gCAAkB,EAAC,aAAa,CAAC,CAAC;AACpC,CAAC;AAPD,wCAOC;AAED,SAAS,OAAO;IACd,IAAA,gBAAS,EAAC,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3B,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,OAAO,CAAC,aAAqB,EAAE,aAAqB;IAC3D,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAC9B,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAC1C,CAAC"}
@@ -26,7 +26,7 @@ const chalk_1 = __importDefault(require("chalk"));
26
26
  const prompts_1 = __importDefault(require("prompts"));
27
27
  const constants_1 = require("../../constants");
28
28
  const file = __importStar(require("../../file"));
29
- const misc_1 = require("../../misc");
29
+ const util_1 = require("../../util");
30
30
  async function checkIfProjectPathExists(projectPath) {
31
31
  if (projectPath !== constants_1.CWD && file.exists(projectPath)) {
32
32
  const fileType = file.isDir(projectPath) ? "directory" : "file";
@@ -37,7 +37,7 @@ async function checkIfProjectPathExists(projectPath) {
37
37
  message: "Do you want me to delete it?",
38
38
  });
39
39
  if (!response.delete) { // eslint-disable-line
40
- (0, misc_1.error)("Ok then. Good-bye.");
40
+ (0, util_1.error)("Ok then. Good-bye.");
41
41
  }
42
42
  if (fileType === "directory") {
43
43
  file.deleteDir(projectPath);
@@ -26,7 +26,7 @@ const chalk_1 = __importDefault(require("chalk"));
26
26
  const path_1 = __importDefault(require("path"));
27
27
  const prompts_1 = __importDefault(require("prompts"));
28
28
  const file = __importStar(require("../../file"));
29
- const misc_1 = require("../../misc");
29
+ const util_1 = require("../../util");
30
30
  async function checkModTargetDirectory(modsDirectory, projectName) {
31
31
  const modTargetPath = path_1.default.join(modsDirectory, projectName);
32
32
  if (!file.exists(modTargetPath)) {
@@ -41,7 +41,7 @@ async function checkModTargetDirectory(modsDirectory, projectName) {
41
41
  initial: true,
42
42
  });
43
43
  if (response.deleteDirectory === false) {
44
- (0, misc_1.error)("Ok then. You delete it yourself. Good bye.");
44
+ (0, util_1.error)("Ok then. You delete it yourself. Good bye.");
45
45
  }
46
46
  file.deleteDir(modTargetPath);
47
47
  }
@@ -26,7 +26,7 @@ const path_1 = __importDefault(require("path"));
26
26
  const configFile = __importStar(require("../../configFile"));
27
27
  const constants_1 = require("../../constants");
28
28
  const file = __importStar(require("../../file"));
29
- const misc_1 = require("../../misc");
29
+ const util_1 = require("../../util");
30
30
  function createMod(projectName, projectPath, createNewDir, modsDirectory, saveSlot) {
31
31
  if (createNewDir) {
32
32
  file.makeDir(projectPath);
@@ -121,7 +121,7 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory) {
121
121
  // Convert snake_case and kebab-case to camelCase
122
122
  // (kebab-case in particular will make the example TypeScript file fail to compile)
123
123
  const srcPath = path_1.default.join(projectPath, "src");
124
- const camelCaseProjectName = (0, misc_1.snakeKebabToCamel)(projectName);
124
+ const camelCaseProjectName = (0, util_1.snakeKebabToCamel)(projectName);
125
125
  const fileName = constants_1.MAIN_TS;
126
126
  const templatePath = constants_1.MAIN_TS_TEMPLATE_PATH;
127
127
  const template = file.read(templatePath);
@@ -134,10 +134,10 @@ function copyDynamicFiles(projectName, projectPath, targetModDirectory) {
134
134
  }
135
135
  function updateNodeModules(projectPath) {
136
136
  console.log("Updating node modules...");
137
- (0, misc_1.execShell)("npx", ["npm-check-updates", "--upgrade", "--packageFile", "package.json"], false, projectPath);
137
+ (0, util_1.execShell)("npx", ["npm-check-updates", "--upgrade", "--packageFile", "package.json"], false, projectPath);
138
138
  }
139
139
  function installNodeModules(projectPath) {
140
140
  console.log("Installing node modules... (This can take a long time.)");
141
- (0, misc_1.execShell)("npm", ["install"], false, projectPath);
141
+ (0, util_1.execShell)("npm", ["install"], false, projectPath);
142
142
  }
143
143
  //# sourceMappingURL=createMod.js.map
@@ -27,7 +27,7 @@ const os_1 = __importDefault(require("os"));
27
27
  const path_1 = __importDefault(require("path"));
28
28
  const prompts_1 = __importDefault(require("prompts"));
29
29
  const file = __importStar(require("../../file"));
30
- const misc_1 = require("../../misc");
30
+ const util_1 = require("../../util");
31
31
  // https://stackoverflow.com/questions/9080085/node-js-find-home-directory-in-platform-agnostic-way
32
32
  const homeDir = os_1.default.homedir();
33
33
  const MODS = "mods";
@@ -51,17 +51,17 @@ async function getModsDir(argv) {
51
51
  message: `Enter the full path to the "${MODS}" directory on your system, which should be next to your "isaac-ng.exe" program:`,
52
52
  });
53
53
  if (typeof response.modsDir !== "string") {
54
- (0, misc_1.error)("Error: The response was not a string.");
54
+ (0, util_1.error)("Error: The response was not a string.");
55
55
  }
56
56
  const modsDir = response.modsDir.trim();
57
57
  if (!file.exists(modsDir)) {
58
- (0, misc_1.error)(`Error: The directory of "${chalk_1.default.green(modsDir)}" does not exist. Exiting.`);
58
+ (0, util_1.error)(`Error: The directory of "${chalk_1.default.green(modsDir)}" does not exist. Exiting.`);
59
59
  }
60
60
  if (!file.isDir(modsDir)) {
61
- (0, misc_1.error)(`Error: The path of "${chalk_1.default.green(modsDir)}" is not a directory. Exiting.`);
61
+ (0, util_1.error)(`Error: The path of "${chalk_1.default.green(modsDir)}" is not a directory. Exiting.`);
62
62
  }
63
63
  if (path_1.default.basename(modsDir) !== MODS) {
64
- (0, misc_1.error)(`Error: You entered a path of "${chalk_1.default.green(modsDir)}", but you need to input a directory with a name of "${MODS}" at the end. Exiting.`);
64
+ (0, util_1.error)(`Error: You entered a path of "${chalk_1.default.green(modsDir)}", but you need to input a directory with a name of "${MODS}" at the end. Exiting.`);
65
65
  }
66
66
  return modsDir;
67
67
  }
@@ -75,7 +75,7 @@ function getDefaultModsPath(platform) {
75
75
  return DEFAULT_MODS_PATH_LINUX;
76
76
  }
77
77
  default: {
78
- (0, misc_1.error)(`There does not exist a default mod path for the platform of: ${chalk_1.default.green(platform)}`);
78
+ (0, util_1.error)(`There does not exist a default mod path for the platform of: ${chalk_1.default.green(platform)}`);
79
79
  return "";
80
80
  }
81
81
  }
@@ -7,7 +7,7 @@ const chalk_1 = __importDefault(require("chalk"));
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const prompts_1 = __importDefault(require("prompts"));
9
9
  const constants_1 = require("../../constants");
10
- const misc_1 = require("../../misc");
10
+ const util_1 = require("../../util");
11
11
  // From: https://gist.github.com/doctaphred/d01d05291546186941e1b7ddc02034d3
12
12
  const ILLEGAL_CHARACTERS_FOR_WINDOWS_FILENAMES = [
13
13
  "<",
@@ -67,7 +67,7 @@ async function getNewProjectName() {
67
67
  message: "Enter the name of the project:",
68
68
  });
69
69
  if (typeof response2.projectName !== "string") {
70
- (0, misc_1.error)("Error: The response was not a string.");
70
+ (0, util_1.error)("Error: The response was not a string.");
71
71
  }
72
72
  const projectName = response2.projectName.trim();
73
73
  const projectPath = path_1.default.join(constants_1.CWD, projectName);
@@ -86,7 +86,7 @@ function validateProjectName(projectName) {
86
86
  }
87
87
  }
88
88
  }
89
- if ((0, misc_1.hasWhiteSpace)(projectName)) {
89
+ if ((0, util_1.hasWhiteSpace)(projectName)) {
90
90
  console.error('Error: The project name has whitespace in it, which is not allowed. Use kebab-case for your project name. (e.g. "green-candle")');
91
91
  return false;
92
92
  }
@@ -26,11 +26,11 @@ const chalk_1 = __importDefault(require("chalk"));
26
26
  const JSONC = __importStar(require("jsonc-parser"));
27
27
  const path_1 = __importDefault(require("path"));
28
28
  const file = __importStar(require("../../file"));
29
- const misc_1 = require("../../misc");
29
+ const util_1 = require("../../util");
30
30
  function installVSCodeExtensions(projectPath) {
31
31
  const extensions = getExtensionsFromJSON(projectPath);
32
32
  for (const extensionName of extensions) {
33
- (0, misc_1.execShell)("code", ["--install-extension", extensionName]);
33
+ (0, util_1.execShell)("code", ["--install-extension", extensionName]);
34
34
  }
35
35
  }
36
36
  exports.default = installVSCodeExtensions;
@@ -45,7 +45,7 @@ function getExtensionsFromJSON(projectPath) {
45
45
  extensionsJSON = JSONC.parse(extensionsJSONRaw);
46
46
  }
47
47
  catch (err) {
48
- (0, misc_1.error)(`Failed to parse the "${chalk_1.default.green(extensionsJSONPath)}" file:`, err);
48
+ (0, util_1.error)(`Failed to parse the "${chalk_1.default.green(extensionsJSONPath)}" file:`, err);
49
49
  }
50
50
  return extensionsJSON.recommendations;
51
51
  }
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const prompts_1 = __importDefault(require("prompts"));
7
- const misc_1 = require("../../misc");
7
+ const util_1 = require("../../util");
8
8
  async function promptSaveSlot(argv) {
9
9
  if (argv.saveSlot !== undefined) {
10
10
  // They specified the "--save-slot" command-line flag,
@@ -20,7 +20,7 @@ async function promptSaveSlot(argv) {
20
20
  if (response.saveSlot !== 1 &&
21
21
  response.saveSlot !== 2 &&
22
22
  response.saveSlot !== 3) {
23
- (0, misc_1.error)("Error: You must choose a number between 1 and 3.");
23
+ (0, util_1.error)("Error: You must choose a number between 1 and 3.");
24
24
  }
25
25
  return response.saveSlot;
26
26
  }
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const path_1 = __importDefault(require("path"));
7
7
  const prompts_1 = __importDefault(require("prompts"));
8
8
  const constants_1 = require("../../constants");
9
- const misc_1 = require("../../misc");
9
+ const util_1 = require("../../util");
10
10
  async function promptVSCode(projectPath, argv) {
11
11
  if (argv.vscode !== undefined) {
12
12
  // They supplied the "--vscode" command-line flag,
@@ -27,6 +27,6 @@ async function promptVSCode(projectPath, argv) {
27
27
  exports.default = promptVSCode;
28
28
  function openVSCode(projectPath) {
29
29
  const MAIN_TS_PATH = path_1.default.join(projectPath, "src", constants_1.MAIN_TS);
30
- (0, misc_1.execShell)("code", [projectPath, MAIN_TS_PATH]);
30
+ (0, util_1.execShell)("code", [projectPath, MAIN_TS_PATH]);
31
31
  }
32
32
  //# sourceMappingURL=promptVSCode.js.map
@@ -41,10 +41,21 @@ function copyWatcherMod(config) {
41
41
  // Restore it
42
42
  file.write(disableItPath, "");
43
43
  }
44
+ // By default, the IsaacScript watcher mod automatically restarts the game,
45
+ // so we only need to disable it if the config option is explicitly set to false
46
+ if (config.enableIsaacScriptWatcherAutoRestart === false) {
47
+ disableIsaacScriptWatcherAutomaticRestart(watcherModPath);
48
+ }
44
49
  // If we copied a new version of the watcher mod into place,
45
50
  // but the user currently has the game open, then the old version will stay loaded
46
51
  // However, if the watcher mod reloads itself, the game will crash,
47
52
  // so there is no automated solution for this
48
53
  }
49
54
  exports.default = copyWatcherMod;
55
+ function disableIsaacScriptWatcherAutomaticRestart(watcherModPath) {
56
+ const mainLuaPath = path_1.default.join(watcherModPath, constants_1.MAIN_LUA);
57
+ const mainLua = file.read(mainLuaPath);
58
+ const modifiedMainLua = mainLua.replace("local RESTART_GAME_ON_RECOMPILATION = true", "local RESTART_GAME_ON_RECOMPILATION = false");
59
+ file.write(mainLuaPath, modifiedMainLua);
60
+ }
50
61
  //# sourceMappingURL=copyWatcherMod.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"copyWatcherMod.js","sourceRoot":"","sources":["../../../../src/commands/monitor/copyWatcherMod.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,+CAIyB;AACzB,iDAAmC;AAGnC,SAAwB,cAAc,CAAC,MAAc;IACnD,wCAAwC;IACxC,MAAM,cAAc,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,4BAAgB,CAAC,CAAC;IACzE,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,cAAc,EAAE,2BAAe,CAAC,CAAC;IACjE,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAEtD,mEAAmE;IACnE,oDAAoD;IACpD,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QAC/B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;KAChC;IAED,IAAI,CAAC,IAAI,CAAC,mCAAuB,EAAE,cAAc,CAAC,CAAC;IAEnD,IAAI,kBAAkB,EAAE;QACtB,oEAAoE;QACpE,aAAa;QACb,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;KAC/B;IAED,4DAA4D;IAC5D,kFAAkF;IAClF,mEAAmE;IACnE,6CAA6C;AAC/C,CAAC;AAxBD,iCAwBC"}
1
+ {"version":3,"file":"copyWatcherMod.js","sourceRoot":"","sources":["../../../../src/commands/monitor/copyWatcherMod.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,+CAKyB;AACzB,iDAAmC;A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c-parser"));
27
27
  const constants_1 = require("../../constants");
28
28
  const file = __importStar(require("../../file"));
29
- const misc_1 = require("../../misc");
29
+ const util_1 = require("../../util");
30
30
  function getTSConfigInclude() {
31
31
  const tsConfigRaw = file.read(constants_1.TSCONFIG_PATH);
32
32
  let tsConfig;
@@ -34,13 +34,13 @@ function getTSConfigInclude() {
34
34
  tsConfig = JSONC.parse(tsConfigRaw);
35
35
  }
36
36
  catch (err) {
37
- (0, misc_1.error)(`Failed to parse "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}":`, err);
37
+ (0, util_1.error)(`Failed to parse "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}":`, err);
38
38
  }
39
39
  if (!Object.prototype.hasOwnProperty.call(tsConfig, "include")) {
40
- (0, misc_1.error)(`Your "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}" file does not have an include directive, which is surely a mistake. Delete the file and re-run isaacscript.`);
40
+ (0, util_1.error)(`Your "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}" file does not have an include directive, which is surely a mistake. Delete the file and re-run isaacscript.`);
41
41
  }
42
42
  if (tsConfig.include.length === 0) {
43
- (0, misc_1.error)(`Your "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}" file has an empty include directive, which is surely a mistake. Delete the file and re-run isaacscript.`);
43
+ (0, util_1.error)(`Your "${chalk_1.default.green(constants_1.TSCONFIG_PATH)}" file has an empty include directive, which is surely a mistake. Delete the file and re-run isaacscript.`);
44
44
  }
45
45
  return tsConfig.include[0];
46
46
  }
@@ -21,7 +21,7 @@ function init() {
21
21
  (0, sync_directory_1.default)(modSourcePath, modTargetPath, {
22
22
  watch: true,
23
23
  type: "copy",
24
- afterSync,
24
+ afterEachSync,
25
25
  onError,
26
26
  chokidarWatchOptions: {
27
27
  awaitWriteFinish: {
@@ -30,14 +30,16 @@ function init() {
30
30
  },
31
31
  });
32
32
  }
33
- function afterSync(params) {
34
- if (params.type === "init:copy") {
33
+ function afterEachSync(params) {
34
+ if (params === undefined) {
35
35
  return;
36
36
  }
37
37
  if (params.relativePath === `${path_1.default.sep}${constants_1.MAIN_LUA}`) {
38
38
  (0, monkeyPatch_1.monkeyPatchMainLua)(modTargetPath);
39
39
  }
40
- send(`${constants_1.FILE_SYNCED_MESSAGE} ${params.relativePath}`);
40
+ if (params.eventType !== "init:copy") {
41
+ send(`${constants_1.FILE_SYNCED_MESSAGE} ${params.relativePath}`);
42
+ }
41
43
  }
42
44
  function onError(err) {
43
45
  console.error("The directory syncer encountered an error:", err);
@@ -1 +1 @@
1
- {"version":3,"file":"modDirectorySyncer.js","sourceRoot":"","sources":["../../../../../src/commands/monitor/modDirectorySyncer/modDirectorySyncer.ts"],"names":[],"mappings":";AAAA,6CAA6C;;;;;AAE7C,gDAAwB;AACxB,oEAA2C;AAC3C,kDAAmE;AACnE,sDAA0D;AAE1D,IAAI,aAAqB,CAAC;AAC1B,IAAI,aAAqB,CAAC;AAE1B,IAAI,EAAE,CAAC;AAEP,SAAS,IAAI;IACX,MAAM,OAAO,GAAG,CAAC,CAAC;IAClB,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,GAAG,OAAO,EAAE;QACvC,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;KACH;IAED,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEhC,IAAA,wBAAa,EAAC,aAAa,EAAE,aAAa,EAAE;QAC1C,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,MAAM;QACZ,SAAS;QACT,OAAO;QACP,oBAAoB,EAAE;YACpB,gBAAgB,EAAE;gBAChB,kBAAkB,EAAE,IAAI;aACzB;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,SAAS,CAAC,MAA8C;IAC/D,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,EAAE;QAC/B,OAAO;KACR;IAED,IAAI,MAAM,CAAC,YAAY,KAAK,GAAG,cAAI,CAAC,GAAG,GAAG,oBAAQ,EAAE,EAAE;QACpD,IAAA,gCAAkB,EAAC,aAAa,CAAC,CAAC;KACnC;IAED,IAAI,CAAC,GAAG,+BAAmB,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,OAAO,CAAC,GAAU;IACzB,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,GAAG,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,IAAI,CAAC,GAAW;IACvB,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE;QACtC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACnB;AACH,CAAC"}
1
+ {"version":3,"file":"modDirectorySyncer.js","sourceRoot":"","sources":["../../../../../src/commands/monitor/modDirectorySyncer/modDirectorySyncer.ts"],"names":[],"mappings":";AAAA,6CAA6C;;;;;AAE7C,gDAAwB;AACxB,oEAA2C;AAC3C,kDAAmE;AACnE,sDAA0D;AAE1D,IAAI,aAAqB,CAAC;AAC1B,IAAI,aAAqB,CAAC;AAE1B,IAAI,EAAE,CAAC;AAEP,SAAS,IAAI;IACX,MAAM,OAAO,GAAG,CAAC,CAAC;IAClB,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,GAAG,OAAO,EAAE;QACvC,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;KACH;IAED,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEhC,IAAA,wBAAa,EAAC,aAAa,EAAE,aAAa,EAAE;QAC1C,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,MAAM;QACZ,aAAa;QACb,OAAO;QACP,oBAAoB,EAAE;YACpB,gBAAgB,EAAE;gBAChB,kBAAkB,EAAE,IAAI;aACzB;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,aAAa,CAAC,MAMtB;IACC,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO;KACR;IAED,IAAI,MAAM,CAAC,YAAY,KAAK,GAAG,cAAI,CAAC,GAAG,GAAG,oBAAQ,EAAE,EAAE;QACpD,IAAA,gCAAkB,EAAC,aAAa,CAAC,CAAC;KACnC;IAED,IAAI,MAAM,CAAC,SAAS,KAAK,WAAW,EAAE;QACpC,IAAI,CAAC,GAAG,+BAAmB,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;KACvD;AACH,CAAC;AAED,SAAS,OAAO,CAAC,GAAU;IACzB,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,GAAG,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,IAAI,CAAC,GAAW;IACvB,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE;QACtC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACnB;AACH,CAAC"}
@@ -27,12 +27,12 @@ const child_process_1 = require("child_process");
27
27
  const path_1 = __importDefault(require("path"));
28
28
  const constants_1 = require("../../constants");
29
29
  const file = __importStar(require("../../file"));
30
- const misc_1 = require("../../misc");
30
+ const util_1 = require("../../util");
31
31
  const copyWatcherMod_1 = __importDefault(require("./copyWatcherMod"));
32
32
  const getTSConfigInclude_1 = __importDefault(require("./getTSConfigInclude"));
33
33
  const notifyGame = __importStar(require("./notifyGame"));
34
34
  const spawnSaveDatWriter_1 = require("./spawnSaveDatWriter");
35
- const touchSaveDatFiles_1 = __importDefault(require("./touchSaveDatFiles"));
35
+ const touchWatcherSaveDatFiles_1 = __importDefault(require("./touchWatcherSaveDatFiles"));
36
36
  function monitor(argv, config) {
37
37
  // If they specified some command-line flags, override the values found in the config file
38
38
  if (argv.modsDirectory !== undefined) {
@@ -41,10 +41,9 @@ function monitor(argv, config) {
41
41
  if (argv.saveSlot !== undefined) {
42
42
  config.saveSlot = argv.saveSlot; // eslint-disable-line no-param-reassign
43
43
  }
44
- // Prepare the watcher mod
44
+ // Prepare the IsaacScript watcher mod
45
45
  (0, copyWatcherMod_1.default)(config);
46
- // Ensure that the "save#.dat" file exists
47
- (0, touchSaveDatFiles_1.default)(config);
46
+ (0, touchWatcherSaveDatFiles_1.default)(config);
48
47
  // Subprocess #1 - The "save#.dat" file writer
49
48
  (0, spawnSaveDatWriter_1.spawnSaveDatWriter)(config);
50
49
  // Subprocess #2 - The mod directory syncer
@@ -58,7 +57,8 @@ function monitor(argv, config) {
58
57
  // Read the "tsconfig.json" file
59
58
  const tsConfigInclude = (0, getTSConfigInclude_1.default)();
60
59
  const resolvedIncludePath = path_1.default.resolve(constants_1.CWD, tsConfigInclude);
61
- const modTargetPath = path_1.default.join(config.modsDirectory, constants_1.CURRENT_DIRECTORY_NAME);
60
+ const modTargetDirectoryName = (0, util_1.getModTargetDirectoryName)(config);
61
+ const modTargetPath = path_1.default.join(config.modsDirectory, modTargetDirectoryName);
62
62
  console.log("Automatically monitoring the following for changes:");
63
63
  console.log(`1) your TypeScript code: ${chalk_1.default.green(resolvedIncludePath)}`);
64
64
  console.log(`2) the source mod directory: ${chalk_1.default.green(constants_1.MOD_SOURCE_PATH)}`);
@@ -72,7 +72,8 @@ function spawnModDirectorySyncer(config) {
72
72
  const processName = "modDirectorySyncer";
73
73
  const processDescription = "Directory syncer";
74
74
  const processPath = path_1.default.join(__dirname, processName, processName);
75
- const modTargetPath = path_1.default.join(config.modsDirectory, constants_1.CURRENT_DIRECTORY_NAME);
75
+ const modTargetName = (0, util_1.getModTargetDirectoryName)(config);
76
+ const modTargetPath = path_1.default.join(config.modsDirectory, modTargetName);
76
77
  const directorySycner = (0, child_process_1.fork)(processPath, [constants_1.MOD_SOURCE_PATH, modTargetPath]);
77
78
  directorySycner.on("message", (msg) => {
78
79
  notifyGame.msg(msg);
@@ -80,16 +81,16 @@ function spawnModDirectorySyncer(config) {
80
81
  // to reload the mod
81
82
  // Look for something like: "File synced: \main.lua"
82
83
  if (msg === `${constants_1.FILE_SYNCED_MESSAGE} ${path_1.default.sep}${constants_1.MAIN_LUA}`) {
83
- notifyGame.command(`luamod ${constants_1.CURRENT_DIRECTORY_NAME}`);
84
+ notifyGame.command(`luamod ${modTargetName}`);
84
85
  notifyGame.command("restart");
85
86
  notifyGame.msg("Reloaded the mod.");
86
87
  }
87
88
  });
88
89
  directorySycner.on("close", (code) => {
89
- (0, misc_1.error)(`Error: ${processDescription} subprocess closed with code: ${code}`);
90
+ (0, util_1.error)(`Error: ${processDescription} subprocess closed with code: ${code}`);
90
91
  });
91
92
  directorySycner.on("exit", (code) => {
92
- (0, misc_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
93
+ (0, util_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
93
94
  });
94
95
  }
95
96
  function spawnTSTLWatcher() {
@@ -134,10 +135,10 @@ function spawnTSTLWatcher() {
134
135
  notifyGame.msg(`Error: ${msg}`);
135
136
  });
136
137
  tstl.on("close", (code) => {
137
- (0, misc_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
138
+ (0, util_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
138
139
  });
139
140
  tstl.on("exit", (code) => {
140
- (0, misc_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
141
+ (0, util_1.error)(`Error: ${processDescription} subprocess exited with code: ${code}`);
141
142
  });
142
143
  }
143
144
  // Returns whether or not IsaacScript is a local path in "package.json"
@@ -1 +1 @@
1
- {"version":3,"file":"monitor.js","sourceRoot":"","sources":["../../../../src/commands/monitor/monitor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,iDAA4E;AAC5E,gDAAwB;AACxB,+CAOyB;AACzB,iDAAmC;AACnC,qCAAmC;AAEnC,sEAA8C;AAC9C,8EAAsD;AACtD,yDAA2C;AAC3C,6DAA0D;AAC1D,4EAAoD;AAEpD,SAAwB,OAAO,CAC7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C,QAAQ,CAAC,sCAAsC,CAAC,CAAC;AACtE,CAAC"}
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ping = exports.command = exports.msg = void 0;
7
7
  const chalk_1 = __importDefault(require("chalk"));
8
- const misc_1 = require("../../misc");
8
+ const util_1 = require("../../util");
9
9
  const spawnSaveDatWriter_1 = require("./spawnSaveDatWriter");
10
10
  function msg(data) {
11
11
  const formattedData = data
@@ -21,7 +21,7 @@ function msg(data) {
21
21
  return;
22
22
  }
23
23
  // Add a time prefix
24
- const formattedLine = `[${(0, misc_1.getTime)()}] ${trimmedLine}`;
24
+ const formattedLine = `[${(0, util_1.getTime)()}] ${trimmedLine}`;
25
25
  (0, spawnSaveDatWriter_1.sendMsgToSaveDatWriter)({
26
26
  type: "msg",
27
27
  data: formattedLine,
@@ -27,7 +27,7 @@ const chalk_1 = __importDefault(require("chalk"));
27
27
  const JSONC = __importStar(require("jsonc-parser"));
28
28
  const path_1 = __importDefault(require("path"));
29
29
  const file = __importStar(require("../../../file"));
30
- const misc_1 = require("../../../misc");
30
+ const util_1 = require("../../../util");
31
31
  const MAX_MESSAGES = 100;
32
32
  let saveDatPath;
33
33
  let saveDatFileName;
@@ -73,7 +73,7 @@ function readSaveDatFromDisk() {
73
73
  saveDat = JSONC.parse(saveDatRaw);
74
74
  }
75
75
  catch (err) {
76
- (0, misc_1.error)(`Failed to parse "${chalk_1.default.green(saveDatPath)}":`, err);
76
+ (0, util_1.error)(`Failed to parse "${chalk_1.default.green(saveDatPath)}":`, err);
77
77
  }
78
78
  }
79
79
  else {
@@ -105,7 +105,7 @@ function addMessageToSaveDat(type, saveDat, data) {
105
105
  break;
106
106
  }
107
107
  default: {
108
- (0, misc_1.ensureAllCases)(type);
108
+ (0, util_1.ensureAllCases)(type);
109
109
  break;
110
110
  }
111
111
  }