Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit ab953e5

Browse files
committed
Add a shortcut for expandAliases.
1 parent eadc04d commit ab953e5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/shell/CommandExpander.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import {Aliases} from "../Aliases";
22
import {scan, Token, concatTokens} from "./Scanner";
33

44
export function expandAliases(tokens: Token[], aliases: Aliases): Token[] {
5+
if (tokens.length === 0) {
6+
return [];
7+
}
8+
59
const commandWordToken = tokens[0];
610
const argumentTokens = tokens.slice(1);
711
const alias: string = aliases.get(commandWordToken.value);

0 commit comments

Comments
 (0)