mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 23:56:36 +08:00
chore: standardize tsconfig (#9568)
This commit is contained in:
@@ -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('../../../');
|
||||
|
||||
Reference in New Issue
Block a user