parse-name.js 672 B

12345678910111213141516171819
  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.parseName = parseName;
  11. const core_1 = require("@angular-devkit/core");
  12. function parseName(path, name) {
  13. const nameWithoutPath = (0, core_1.basename)((0, core_1.normalize)(name));
  14. const namePath = (0, core_1.dirname)((0, core_1.join)((0, core_1.normalize)(path), name));
  15. return {
  16. name: nameWithoutPath,
  17. path: (0, core_1.normalize)('/' + namePath),
  18. };
  19. }