chore: standardize tsconfig (#9568)

This commit is contained in:
forehalo
2025-01-08 04:07:56 +00:00
parent 39f4b17315
commit c0ed74dfed
151 changed files with 1041 additions and 1566 deletions
+9 -1
View File
@@ -1,5 +1,5 @@
import { existsSync, statSync } from 'node:fs';
import { join } from 'node:path';
import { join, relative } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
export class Path {
@@ -21,6 +21,10 @@ export class Path {
return new Path(join(this.path, ...paths));
}
parent() {
return this.join('..');
}
toString() {
return this.path;
}
@@ -44,6 +48,10 @@ export class Path {
toFileUrl() {
return pathToFileURL(this.path);
}
relative(to: string) {
return relative(this.value, to);
}
}
export const ProjectRoot = Path.dir(import.meta.url).join('../../../');