@syncfusion/ej2-angular-base
Version:
A common package of Essential JS 2 base Angular libraries, methods and class definitions
21 lines (20 loc) • 749 B
JavaScript
;
/**
* @license
* Copyright Google LLC 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
*/
Object.defineProperty(exports, "__esModule", { value: true });
function getProjectFromWorkspace(workspace, projectName) {
let project = workspace.projects[projectName || workspace.defaultProject];
if (workspace.defaultProject === undefined) {
project = workspace.projects[projectName || Object.keys(workspace.projects)[0]];
}
if (!project) {
throw new Error(`Could not find project in workspace: ${projectName}`);
}
return project;
}
exports.getProjectFromWorkspace = getProjectFromWorkspace;