21 lines
2.3 KiB
JavaScript
21 lines
2.3 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.parseName = void 0;
|
|
const core_1 = require("@angular-devkit/core");
|
|
function parseName(path, name) {
|
|
const nameWithoutPath = (0, core_1.basename)((0, core_1.normalize)(name));
|
|
const namePath = (0, core_1.dirname)((0, core_1.join)((0, core_1.normalize)(path), name));
|
|
return {
|
|
name: nameWithoutPath,
|
|
path: (0, core_1.normalize)('/' + namePath),
|
|
};
|
|
}
|
|
exports.parseName = parseName;
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyc2UtbmFtZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3NjaGVtYXRpY3MvYW5ndWxhci91dGlsaXR5L3BhcnNlLW5hbWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7R0FNRzs7O0FBRUgsK0NBQWdGO0FBT2hGLFNBQWdCLFNBQVMsQ0FBQyxJQUFZLEVBQUUsSUFBWTtJQUNsRCxNQUFNLGVBQWUsR0FBRyxJQUFBLGVBQVEsRUFBQyxJQUFBLGdCQUFTLEVBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQztJQUNsRCxNQUFNLFFBQVEsR0FBRyxJQUFBLGNBQU8sRUFBQyxJQUFBLFdBQUksRUFBQyxJQUFBLGdCQUFTLEVBQUMsSUFBSSxDQUFDLEVBQUUsSUFBSSxDQUFDLENBQUMsQ0FBQztJQUV0RCxPQUFPO1FBQ0wsSUFBSSxFQUFFLGVBQWU7UUFDckIsSUFBSSxFQUFFLElBQUEsZ0JBQVMsRUFBQ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