documentation.federated.com.../node_modules/globby/to-path.js

16 lines
288 B
JavaScript
Raw Permalink Normal View History

2023-05-30 17:55:11 +00:00
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;