source: trip-planner-front/node_modules/@schematics/angular/migrations/update-12/schematic-options.js@ 6c1585f

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

initial commit

  • Property mode set to 100644
File size: 1.4 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 workspace_1 = require("../../utility/workspace");
12function default_1() {
13 return workspace_1.updateWorkspace((workspace) => {
14 // Update root level schematics options if present
15 const rootSchematics = workspace.extensions.schematics;
16 if (rootSchematics && core_1.json.isJsonObject(rootSchematics)) {
17 updateSchematicsField(rootSchematics);
18 }
19 // Update project level schematics options if present
20 for (const [, project] of workspace.projects) {
21 const projectSchematics = project.extensions.schematics;
22 if (projectSchematics && core_1.json.isJsonObject(projectSchematics)) {
23 updateSchematicsField(projectSchematics);
24 }
25 }
26 });
27}
28exports.default = default_1;
29function updateSchematicsField(schematics) {
30 for (const [schematicName, schematicOptions] of Object.entries(schematics)) {
31 if (!core_1.json.isJsonObject(schematicOptions)) {
32 continue;
33 }
34 if (schematicName === '@schematics/angular:module') {
35 delete schematicOptions.skipTests;
36 }
37 }
38}
Note: See TracBrowser for help on using the repository browser.