( a?: AliasOptions, b?: AliasOptions, )
| 1522 | } |
| 1523 | |
| 1524 | export function mergeAlias( |
| 1525 | a?: AliasOptions, |
| 1526 | b?: AliasOptions, |
| 1527 | ): AliasOptions | undefined { |
| 1528 | if (!a) return b |
| 1529 | if (!b) return a |
| 1530 | if (isObject(a) && isObject(b)) { |
| 1531 | return { ...a, ...b } |
| 1532 | } |
| 1533 | // the order is flipped because the alias is resolved from top-down, |
| 1534 | // where the later should have higher priority |
| 1535 | return [...normalizeAlias(b), ...normalizeAlias(a)] |
| 1536 | } |
| 1537 | |
| 1538 | export function normalizeAlias(o: AliasOptions = []): Alias[] { |
| 1539 | return Array.isArray(o) |
no test coverage detected