UNPKG

1.02 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.normalizeSchema = void 0;
4const devkit_1 = require("@nrwl/devkit");
5const path_1 = require("nx/src/utils/path");
6const utils_1 = require("./utils");
7function 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}
16exports.normalizeSchema = normalizeSchema;
17//# sourceMappingURL=normalize-schema.js.map
\No newline at end of file