@jpillora/take 0.9.1 → 0.10.0
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.
- package/package.json +1 -1
- package/take.d.mts +1 -0
- package/take.mjs +2 -1
package/package.json
CHANGED
package/take.d.mts
CHANGED
|
@@ -20,6 +20,7 @@ export declare function newFlags<F extends Flags>(flags: F): F;
|
|
|
20
20
|
export type NewCommand<F extends Flags = Flags> = TakeCommand<F> & {
|
|
21
21
|
flagValues: FlagValues<F>;
|
|
22
22
|
input: CommandInput<F>;
|
|
23
|
+
flagsInitial: FlagValues<F>;
|
|
23
24
|
};
|
|
24
25
|
export type CommandInput<F extends Flags> = {
|
|
25
26
|
flags: FlagValues<F>;
|
package/take.mjs
CHANGED
|
@@ -372,7 +372,8 @@ export async function Register(...commands) {
|
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
export function Command(command) {
|
|
375
|
-
|
|
375
|
+
const flagsInitial = Object.fromEntries(Object.entries(command.flags).map(([k, v]) => [k, v.initial]));
|
|
376
|
+
return { ...command, flagValues: null, input: null, flagsInitial };
|
|
376
377
|
}
|
|
377
378
|
// deno-lint-ignore no-constant-condition
|
|
378
379
|
if (42 < 7) {
|