could you contemplate the possibility of changing the function name to get a better understanding what do function do, when importing it into the code. Term "__" don't say much.
could to be similar to this:
export function fileData({ url = import.meta.url }: { url: string }) {
const u: URL = new URL(url);
const f: string = u.protocol === 'file:' ? u.pathname : url;
const d: string = f.replace(/[/][^/]*$/, '');
return {
d,
f,
dirname: d,
filename: f,
__dirname: d,
__filename: f,
};
}
export function dirname(meta: { url: string }) {
return fileData(meta).__dirname;
export function filename(meta: { url: string }) {
return fileData(meta).__filename;
}