source: trip-planner-front/node_modules/@schematics/angular/migrations/update-9/schematic-options.js@ 8d391a1

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

initial commit

  • Property mode set to 100644
File size: 1.9 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.startsWith('@schematics/angular:')) {
35 continue;
36 }
37 // Replace `styleext` with `style`
38 if (schematicOptions.styleext !== undefined) {
39 schematicOptions.style = schematicOptions.styleext;
40 delete schematicOptions.styleext;
41 }
42 // Replace `spec` with `skipTests`
43 if (schematicOptions.spec !== undefined) {
44 // skipTests value is inverted
45 schematicOptions.skipTests = !schematicOptions.spec;
46 delete schematicOptions.spec;
47 }
48 }
49}
Note: See TracBrowser for help on using the repository browser.