@karpeleslab/klbfw 0.2.6 → 0.2.8
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 +14 -1
- package/index.d.ts +3 -3
- package/package.json +1 -1
package/fw-wrapper.js
CHANGED
|
@@ -196,7 +196,20 @@ const supported = () => true;
|
|
|
196
196
|
* Gets the current GET parameters
|
|
197
197
|
* @returns {Object} GET parameters
|
|
198
198
|
*/
|
|
199
|
-
const getGET = () =>
|
|
199
|
+
const getGET = () => {
|
|
200
|
+
if (typeof FW !== "undefined") {
|
|
201
|
+
return FW.GET !== undefined ? FW.GET : {};
|
|
202
|
+
}
|
|
203
|
+
if (typeof window !== "undefined") {
|
|
204
|
+
const params = {};
|
|
205
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
206
|
+
urlParams.forEach((value, key) => {
|
|
207
|
+
params[key] = value;
|
|
208
|
+
});
|
|
209
|
+
return params;
|
|
210
|
+
}
|
|
211
|
+
return {};
|
|
212
|
+
};
|
|
200
213
|
|
|
201
214
|
/**
|
|
202
215
|
* Gets a specific GET parameter
|
package/index.d.ts
CHANGED
|
@@ -29,9 +29,9 @@ declare function hasCookie(name: string): boolean;
|
|
|
29
29
|
declare function setCookie(name: string, value: string, expires?: Date | number, path?: string, domain?: string, secure?: boolean): void;
|
|
30
30
|
|
|
31
31
|
// REST API types
|
|
32
|
-
declare function rest(name: string, verb: string, params?: Record<string, any
|
|
33
|
-
declare function rest_get(name: string, params?: Record<string, any>
|
|
34
|
-
declare function restGet(name: string, params?: Record<string, any>
|
|
32
|
+
declare function rest(name: string, verb: string, params?: Record<string, any>, context?: Record<string, any>): Promise<any>;
|
|
33
|
+
declare function rest_get(name: string, params?: Record<string, any>): Promise<any>; // Backward compatibility
|
|
34
|
+
declare function restGet(name: string, params?: Record<string, any>): Promise<any>;
|
|
35
35
|
|
|
36
36
|
// Upload module types
|
|
37
37
|
interface UploadOptions {
|