UNPKG

672 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3function getAppFromConfig(apps, nameOrIndex) {
4 let app = apps[0];
5 if (nameOrIndex) {
6 if (nameOrIndex.match(/^[0-9]+$/)) {
7 const index = parseInt(nameOrIndex.toString(), 10);
8 app = apps[index];
9 }
10 else {
11 const filtered = apps.filter((currentApp) => currentApp.name === nameOrIndex);
12 if (filtered.length > 0) {
13 app = filtered[0];
14 }
15 }
16 }
17 return app;
18}
19exports.getAppFromConfig = getAppFromConfig;
20//# sourceMappingURL=/users/hans/sources/angular-cli/utilities/app-utils.js.map
\No newline at end of file