···11+---
22+"ultraflag": patch
33+---
44+55+Fixes an edge case where passing an empty `argv` array would return an empty object without default values.
+7-7
src/index.ts
···11import type {
22- ParseOptions,
22+ Aliases,
33 Args,
44- NestedMapping,
55- Values,
64 BooleanType,
77- StringType,
85 Collectable,
99- Aliases,
66+ NestedMapping,
77+ ParseOptions,
88+ StringType,
99+ Values,
1010} from "./types.js";
1111export { ParseOptions, Args } from "./types.js";
1212···1818 const parts = key.split(".");
1919 for (let i = 0; i < parts.length - 1; i++) {
2020 const k = parts[i];
2121- let tmp = {};
2121+ const tmp = {};
2222 set(obj, k, tmp);
2323 obj = tmp;
2424 }
···8989 ...types
9090 }: ParseOptions<TBooleans, TStrings, TCollectable, TDefaults, TAliases> = {}
9191): Args<TArgs> {
9292- if (argv.length === 0) return {} as Args<TArgs>;
9392 const obj = { ...defaults, _: [] } as unknown as Args<TArgs>;
9393+ if (argv.length === 0) return obj;
94949595 for (let i = 0; i < argv.length; i++) {
9696 const curr = argv[i];