paths.js 578 B

1234567891011121314151617
  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.dev/license
  8. */
  9. Object.defineProperty(exports, "__esModule", { value: true });
  10. exports.relativePathToWorkspaceRoot = relativePathToWorkspaceRoot;
  11. const posix_1 = require("node:path/posix");
  12. function relativePathToWorkspaceRoot(projectRoot) {
  13. if (!projectRoot) {
  14. return '.';
  15. }
  16. return (0, posix_1.relative)((0, posix_1.join)('/', projectRoot), '/') || '.';
  17. }