summaryrefslogtreecommitdiffstats
path: root/src/server/utils/relDir.ts
blob: 1e3cb3c8b0f5a918272fb926b03a902d319a0a29 (plain) (blame)
1
2
3
4
5
6
7
8
9
import { dirname, join } from "node:path";
import { URL, fileURLToPath } from "node:url";

export default function relDir(url: URL | string) {
	const base = dirname(fileURLToPath(url));
	return function (dirname: string) {
		return join(base, dirname);
	};
}