console-app/lib/Sources/Interactive/NumberSubSource.ts
Timo Hocker 7ad999878a
All checks were successful
continuous-integration/drone/push Build is passing
fix for number input, new integer input
2020-07-19 11:41:06 +02:00

20 lines
498 B
TypeScript

import { NumberPrompt } from 'enquirer';
import { InteractiveSubSource } from './InteractiveSubSource';
export class NumberSubSource extends InteractiveSubSource {
protected condition ():boolean {
return this.val.type_validation.option_type === 'number';
}
protected async run ():Promise<void> {
await this.val.assign_arg (
this.opt,
await new NumberPrompt ({
message: this.get_message (),
default: this.opt.default
})
.run ()
);
}
}