@ng-doc/builder
Version:
<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>
19 lines • 1.05 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.createImportPath = createImportPath;
const tslib_1 = require("tslib");
const path_1 = tslib_1.__importDefault(require("path"));
const posix_1 = require("./posix");
/**
* Creates a relative import path from the current directory to the destination path.
* @param {string} currentDir - The current directory path.
* @param {string} destinationPath - The destination path.
* @returns {string} The relative import path from the current directory to the destination path.
*/
function createImportPath(currentDir, destinationPath) {
// Use the posix function from the helpers module to ensure the path is in POSIX format.
// Then, use the relative method from the path module to get the relative path from the current directory to the destination path.
// Finally, remove the .ts extension from the path.
return (0, posix_1.posix)(path_1.default.relative(currentDir, destinationPath)).replace(/\.ts$/, '');
}
//# sourceMappingURL=create-import-path.js.map
;