(stackOption: StackOptionType)
| 86 | } |
| 87 | |
| 88 | function initializeStack(stackOption: StackOptionType): Required<StackInfo> | undefined { |
| 89 | if (!stackOption) { |
| 90 | return; |
| 91 | } |
| 92 | |
| 93 | const defaultStackOption = { |
| 94 | type: 'normal', |
| 95 | connector: false, |
| 96 | } as StackInfo; |
| 97 | |
| 98 | if (isStackObject(stackOption)) { |
| 99 | return { ...defaultStackOption, ...stackOption } as Required<StackInfo>; |
| 100 | } |
| 101 | |
| 102 | return defaultStackOption as Required<StackInfo>; |
| 103 | } |
| 104 | |
| 105 | function isStackObject(stackOption: StackOptionType): stackOption is StackInfo { |
| 106 | return isObject(stackOption); |
no test coverage detected