documentation.federated.com.../node_modules/globby/to-path.js
2023-05-30 11:55:11 -06:00

16 lines
288 B
JavaScript

import {fileURLToPath} from 'node:url';
const toPath = urlOrPath => {
if (!urlOrPath) {
return urlOrPath;
}
if (urlOrPath instanceof URL) {
urlOrPath = urlOrPath.href;
}
return urlOrPath.startsWith('file://') ? fileURLToPath(urlOrPath) : urlOrPath;
};
export default toPath;