22 lines
2.2 KiB
JavaScript
22 lines
2.2 KiB
JavaScript
|
"use strict";
|
||
|
/**
|
||
|
* @license
|
||
|
* Copyright Google LLC All Rights Reserved.
|
||
|
*
|
||
|
* Use of this source code is governed by an MIT-style license that can be
|
||
|
* found in the LICENSE file at https://angular.io/license
|
||
|
*/
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
exports.relativePathToWorkspaceRoot = void 0;
|
||
|
const core_1 = require("@angular-devkit/core");
|
||
|
function relativePathToWorkspaceRoot(projectRoot) {
|
||
|
const normalizedPath = (0, core_1.split)((0, core_1.normalize)(projectRoot || ''));
|
||
|
if (normalizedPath.length === 0 || !normalizedPath[0]) {
|
||
|
return '.';
|
||
|
}
|
||
|
else {
|
||
|
return normalizedPath.map(() => '..').join('/');
|
||
|
}
|
||
|
}
|
||
|
exports.relativePathToWorkspaceRoot = relativePathToWorkspaceRoot;
|
||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGF0aHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9zY2hlbWF0aWNzL2FuZ3VsYXIvdXRpbGl0eS9wYXRocy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7OztHQU1HOzs7QUFFSCwrQ0FBd0Q7QUFFeEQsU0FBZ0IsMkJBQTJCLENBQUMsV0FBK0I7SUFDekUsTUFBTSxjQUFjLEdBQUcsSUFBQSxZQUFLLEVBQUMsSUFBQSxnQkFBUyxFQUFDLFdBQVcsSUFBSSxFQUFFLENBQUMsQ0FBQyxDQUFDO0lBRTNELElBQUksY0FBYyxDQUFDLE1BQU0sS0FBSyxDQUFDLElBQUksQ0FBQyxjQUFjLENBQUMsQ0FBQyxDQUFDLEVBQUU7UUFDckQsT0FBTyxHQUFHLENBQUM7S0FDWjtTQUFNO1FBQ0wsT0FBTyxjQUFjL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