UNPKG

@angular/material

Version:
31 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const schematics_1 = require("@angular-devkit/schematics"); exports.configPath = '/.angular-cli.json'; function getConfig(host) { const configBuffer = host.read(exports.configPath); if (configBuffer === null) { throw new schematics_1.SchematicsException('Could not find .angular-cli.json'); } const config = JSON.parse(configBuffer.toString()); return config; } exports.getConfig = getConfig; function getAppFromConfig(config, appIndexOrName) { if (!config.apps) { return null; } if (parseInt(appIndexOrName) >= 0) { return config.apps[parseInt(appIndexOrName)]; } return config.apps.filter((app) => app.name === appIndexOrName)[0]; } exports.getAppFromConfig = getAppFromConfig; //# sourceMappingURL=config.js.map