source: trip-planner-front/node_modules/@schematics/angular/migrations/update-10/update-libraries-tslib.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.5 KB
Line 
1"use strict";
2/**
3 * @license
4 * Copyright Google LLC All Rights Reserved.
5 *
6 * Use of this source code is governed by an MIT-style license that can be
7 * found in the LICENSE file at https://angular.io/license
8 */
9Object.defineProperty(exports, "__esModule", { value: true });
10const core_1 = require("@angular-devkit/core");
11const dependencies_1 = require("../../utility/dependencies");
12const workspace_1 = require("../../utility/workspace");
13const workspace_models_1 = require("../../utility/workspace-models");
14function default_1() {
15 return async (host) => {
16 const workspace = await workspace_1.getWorkspace(host);
17 for (const [, project] of workspace.projects) {
18 if (project.extensions.projectType !== workspace_models_1.ProjectType.Library) {
19 // Only interested in library projects
20 continue;
21 }
22 const packageJsonPath = core_1.join(core_1.normalize(project.root), 'package.json');
23 if (!host.exists(packageJsonPath)) {
24 continue;
25 }
26 // Remove tslib from any type of dependency
27 dependencies_1.removePackageJsonDependency(host, 'tslib', packageJsonPath);
28 // Add tslib as a direct dependency
29 dependencies_1.addPackageJsonDependency(host, {
30 name: 'tslib',
31 version: '^2.0.0',
32 type: dependencies_1.NodeDependencyType.Default,
33 }, packageJsonPath);
34 }
35 };
36}
37exports.default = default_1;
Note: See TracBrowser for help on using the repository browser.