mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-19 20:45:35 +00:00
19 lines
635 B
JavaScript
19 lines
635 B
JavaScript
// NOTICE: This file is generated by Rollup. To modify it,
|
|
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
|
|
'use strict';
|
|
|
|
const path = require('node:path');
|
|
|
|
/**
|
|
* Returns the relative path of a file to the current working directory.
|
|
* Always in POSIX format for consistency and interoperability.
|
|
* @param {string} cwd The current working directory.
|
|
* @param {string} filePath The file path.
|
|
* @returns {string} The relative file path.
|
|
*/
|
|
function getRelativePath(cwd, filePath) {
|
|
return path.relative(cwd, filePath).split(path.sep).join(path.posix.sep);
|
|
}
|
|
|
|
module.exports = getRelativePath;
|