From fd2d35f0782397252e175f9796987519b979ec5d Mon Sep 17 00:00:00 2001 From: Mateusz Kadlubowski Date: Sun, 29 Dec 2024 13:01:17 +0800 Subject: [PATCH 1/4] define `win32` --- src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 19ac6e0..69f5b7c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,6 @@ +import * as path from "./path"; + export * from "./path"; -export * as default from "./path"; +export const win32 = path satisfies Omit; +export default path; From 49bf64e3004e031dbe6e3a316166435f56fd2b4f Mon Sep 17 00:00:00 2001 From: Mateusz Kadlubowski Date: Sun, 29 Dec 2024 14:07:27 +0800 Subject: [PATCH 2/4] add `posix` & use `PlatformPath` type --- src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 69f5b7c..7e1b582 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,9 @@ +import type { PlatformPath } from "node:path"; import * as path from "./path"; export * from "./path"; -export const win32 = path satisfies Omit; +export const posix = path satisfies Omit; +export const win32 = path satisfies Omit; + export default path; From a3c1ef066e629dfc2764c05b872435117ebaef80 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 30 Dec 2024 15:15:06 +0100 Subject: [PATCH 3/4] update --- src/index.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7e1b582..a141864 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,16 @@ -import type { PlatformPath } from "node:path"; +import type NodePath from "node:path"; + import * as path from "./path"; export * from "./path"; -export const posix = path satisfies Omit; -export const win32 = path satisfies Omit; +export type Pathe = Omit< + typeof NodePath, + "posix" | "win32" | "matchesGlob" /* TODO */ +>; + +export const posix = path satisfies Pathe; + +export const win32 = path satisfies Pathe; -export default path; +export default path satisfies Pathe; From 730852d233c28eb0d3dfd22a41ca7a4fb905e6cb Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 30 Dec 2024 15:16:55 +0100 Subject: [PATCH 4/4] update comment --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index a141864..48f882f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,7 +6,7 @@ export * from "./path"; export type Pathe = Omit< typeof NodePath, - "posix" | "win32" | "matchesGlob" /* TODO */ + "posix" | "win32" | "matchesGlob" // https://github.com/unjs/pathe/issues/182 >; export const posix = path satisfies Pathe;