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.
@@ -1,2 +1,4 @@
1
- export declare function pathname_():string
1
+ export declare function pathname_(
2
+ url?:string
3
+ ):string|undefined
2
4
  export { pathname_ as _pathname, }
@@ -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
- const pathname = typeof window === 'object' && window.location.pathname || ''
6
- return pathname
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, }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ctx-core",
3
- "version": "4.15.0",
3
+ "version": "4.16.0",
4
4
  "description": "ctx-core core library",
5
5
  "keywords": [
6
6
  "ctx-core",