ctx-core 4.15.0 → 4.16.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.
- package/all/pathname/index.d.ts +3 -1
- package/all/pathname/index.js +7 -4
- package/package.json +1 -1
package/all/pathname/index.d.ts
CHANGED
package/all/pathname/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
/// <reference lib="dom" />
|
|
1
2
|
/**
|
|
2
|
-
* @returns {string}
|
|
3
|
+
* @returns {string|undefined}
|
|
4
|
+
* @private true
|
|
3
5
|
*/
|
|
4
|
-
export function pathname_(
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
export function pathname_(
|
|
7
|
+
url = typeof window === 'object' ? window.location.href : undefined
|
|
8
|
+
) {
|
|
9
|
+
return url != null ? new URL(url).pathname : undefined
|
|
7
10
|
}
|
|
8
11
|
export { pathname_ as _pathname, }
|