milkio 0.5.1 → 0.5.2

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.
@@ -27,13 +27,13 @@ export function defineCommandHandler(app: MilkioApp, options: CommandOptions = {
27
27
  }
28
28
  }
29
29
  if (argv.length === 2) params.path = `$/default`;
30
- else params.path = `$/${argv[2]}`;
30
+ else params.path = `$/${argv[2] ?? 'default'}`;
31
31
 
32
32
  // @ts-ignore
33
33
  const result = await app.execute(params.path as any, { params: params });
34
34
  if (!result.success) {
35
35
  if (result.fail.code === "NOT_FOUND") {
36
- if (options.notFoundHandler) await options.notFoundHandler({ ...params, name: argv.length === 2 ? "default" : argv[2] });
36
+ if (options.notFoundHandler) await options.notFoundHandler({ ...params, name: argv.length === 2 ? "default" : (argv[2] ?? 'default') });
37
37
  return;
38
38
  }
39
39
  if (result.fail.code !== "INTERNAL_SERVER_ERROR") {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "milkio",
3
3
  "type": "module",
4
4
  "module": "index.ts",
5
- "version": "0.5.1",
5
+ "version": "0.5.2",
6
6
  "peerDependencies": {
7
7
  "typescript": "^5.4.2"
8
8
  },