19 lines
400 B
TypeScript
19 lines
400 B
TypeScript
import { OptionProcess } from '../Types';
|
|
|
|
export abstract class OptionSource {
|
|
public abstract async parse(opt: OptionProcess[]): Promise<void>;
|
|
|
|
protected async assign_arg (
|
|
opt: OptionProcess,
|
|
value: unknown
|
|
): Promise<void> {
|
|
try {
|
|
opt.value = await opt.type_validation.to_type (value);
|
|
opt.filled = true;
|
|
}
|
|
catch (e) {
|
|
// could not assing
|
|
}
|
|
}
|
|
}
|