mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-22 00:11:02 -05:00
Changed mapEnumInput
's signature
This commit is contained in:
parent
2860874170
commit
5d39b55de2
2 changed files with 5 additions and 1 deletions
|
@ -32,7 +32,7 @@ async function main() {
|
|||
const files = await File.getRequiredFiles(fileSelector);
|
||||
const retryAttempts = mapNumberInput(options.retryAttempts);
|
||||
const retryDelay = mapNumberInput(options.retryDelay);
|
||||
const failMode = mapEnumInput(options.failMode, FailMode, FailMode.Fail as FailMode);
|
||||
const failMode = mapEnumInput<FailMode>(options.failMode, FailMode, FailMode.Fail);
|
||||
const publisher = publisherFactory.create(target, logger);
|
||||
const func = {
|
||||
func: () => publisher.publish(files, options),
|
||||
|
|
|
@ -90,6 +90,10 @@ function findEnumValueByName<T extends EnumLike<U>, U>(enumClass: T, name: strin
|
|||
return undefined;
|
||||
}
|
||||
|
||||
export function mapEnumInput<T>(value: any, enumClass: any, defaultValue?: T): T;
|
||||
|
||||
export function mapEnumInput<T extends EnumLike<U>, U>(value: any, enumClass: T, defaultValue?: U): U;
|
||||
|
||||
export function mapEnumInput<T extends EnumLike<U>, U>(value: any, enumClass: T, defaultValue: U = null): U | null {
|
||||
return mapInput(value, defaultValue, {
|
||||
string: (x: string) => {
|
||||
|
|
Loading…
Reference in a new issue