mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-22 16:31:04 -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 files = await File.getRequiredFiles(fileSelector);
|
||||||
const retryAttempts = mapNumberInput(options.retryAttempts);
|
const retryAttempts = mapNumberInput(options.retryAttempts);
|
||||||
const retryDelay = mapNumberInput(options.retryDelay);
|
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 publisher = publisherFactory.create(target, logger);
|
||||||
const func = {
|
const func = {
|
||||||
func: () => publisher.publish(files, options),
|
func: () => publisher.publish(files, options),
|
||||||
|
|
|
@ -90,6 +90,10 @@ function findEnumValueByName<T extends EnumLike<U>, U>(enumClass: T, name: strin
|
||||||
return undefined;
|
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 {
|
export function mapEnumInput<T extends EnumLike<U>, U>(value: any, enumClass: T, defaultValue: U = null): U | null {
|
||||||
return mapInput(value, defaultValue, {
|
return mapInput(value, defaultValue, {
|
||||||
string: (x: string) => {
|
string: (x: string) => {
|
||||||
|
|
Loading…
Reference in a new issue