@gajae-code/utils 0.10.2 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,7 @@ export declare function formatBunRuntimeError(opts: {
35
35
  platform?: NodeJS.Platform;
36
36
  }): string;
37
37
  export declare function resolveEquivalentPath(inputPath: string): string;
38
- export declare function normalizePathForComparison(inputPath: string): string;
38
+ export declare function normalizePathForComparison(inputPath: string, platform?: NodeJS.Platform): string;
39
39
  export declare function pathIsWithin(root: string, candidate: string): boolean;
40
40
  export declare function relativePathWithinRoot(root: string, candidate: string): string | null;
41
41
  /** Get the project directory. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/utils",
4
- "version": "0.10.2",
4
+ "version": "0.11.0",
5
5
  "description": "Shared utilities for pi packages",
6
6
  "homepage": "https://gajae-code.com",
7
7
  "author": "Yeachan-Heo",
@@ -31,7 +31,7 @@
31
31
  "fmt": "biome format --write ."
32
32
  },
33
33
  "dependencies": {
34
- "@gajae-code/natives": "0.10.2",
34
+ "@gajae-code/natives": "0.11.0",
35
35
  "beautiful-mermaid": "^1.1.3",
36
36
  "handlebars": "^4.7.9",
37
37
  "winston": "^3.19.0",
package/src/dirs.ts CHANGED
@@ -108,9 +108,10 @@ export function resolveEquivalentPath(inputPath: string): string {
108
108
  }
109
109
  }
110
110
 
111
- export function normalizePathForComparison(inputPath: string): string {
112
- const resolvedPath = resolveEquivalentPath(inputPath);
113
- return process.platform === "win32" ? resolvedPath.toLowerCase() : resolvedPath;
111
+ export function normalizePathForComparison(inputPath: string, platform: NodeJS.Platform = process.platform): string {
112
+ const pathApi = platform === "win32" ? path.win32 : path;
113
+ const resolvedPath = platform === process.platform ? resolveEquivalentPath(inputPath) : pathApi.resolve(inputPath);
114
+ return platform === "win32" ? resolvedPath.toLowerCase() : resolvedPath;
114
115
  }
115
116
 
116
117
  export function pathIsWithin(root: string, candidate: string): boolean {