1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.normalizeSchema = void 0;
|
4 | const devkit_1 = require("@nrwl/devkit");
|
5 | const path_1 = require("nx/src/utils/path");
|
6 | const utils_1 = require("./utils");
|
7 | function normalizeSchema(tree, schema, projectConfiguration) {
|
8 | var _a;
|
9 | const destination = schema.destination.startsWith('/')
|
10 | ? (0, utils_1.normalizeSlashes)(schema.destination.slice(1))
|
11 | : schema.destination;
|
12 | const newProjectName = (0, utils_1.getNewProjectName)(destination);
|
13 | const { npmScope } = (0, devkit_1.getWorkspaceLayout)(tree);
|
14 | return Object.assign(Object.assign({}, schema), { destination, importPath: (_a = schema.importPath) !== null && _a !== void 0 ? _a : (0, utils_1.normalizeSlashes)((0, path_1.getImportPath)(npmScope, destination)), newProjectName, relativeToRootDestination: (0, utils_1.getDestination)(tree, schema, projectConfiguration) });
|
15 | }
|
16 | exports.normalizeSchema = normalizeSchema;
|
17 |
|
\ | No newline at end of file |