@karpeleslab/klbfw 0.2.2 → 0.2.4

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/fw-wrapper.js CHANGED
@@ -119,17 +119,26 @@ const getRegistry = () => getFWProperty('Registry', undefined);
119
119
 
120
120
  /**
121
121
  * Gets URL information
122
- * @returns {Object} URL information
122
+ * @returns {Object} URL information with path, full, host, query, and scheme properties
123
123
  */
124
124
  const getUrl = () => {
125
125
  if (typeof FW !== "undefined") return FW.URL;
126
126
  if (typeof window !== "undefined") {
127
127
  return {
128
128
  path: window.location.pathname,
129
- full: window.location.href
129
+ full: window.location.href,
130
+ host: window.location.host,
131
+ query: window.location.search,
132
+ scheme: window.location.protocol.replace(':', '')
130
133
  };
131
134
  }
132
- return { path: '/', full: '/' };
135
+ return {
136
+ path: '/',
137
+ full: '/',
138
+ host: 'localhost',
139
+ query: '',
140
+ scheme: 'https'
141
+ };
133
142
  };
134
143
 
135
144
  /**
package/index.d.ts CHANGED
@@ -18,7 +18,7 @@ declare function getLocale(): string;
18
18
  declare function getUserGroup(): string | undefined;
19
19
  declare function getCurrency(): string;
20
20
  declare function getToken(): string | undefined;
21
- declare function getUrl(): { path: string; full: string };
21
+ declare function getUrl(): { path: string; full: string; host: string; query: string; scheme: string };
22
22
  declare function getPath(): string;
23
23
  declare function getUuid(): string | undefined;
24
24
  declare function getInitialState(): Record<string, any> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karpeleslab/klbfw",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Frontend Framework",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",