@koine/browser 1.1.9 → 1.1.11

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.
Files changed (47) hide show
  1. package/createStorage.js +28 -20
  2. package/{node/createStorage.js → createStorage.mjs} +24 -24
  3. package/getZonedDate.js +11 -6
  4. package/{node/getZonedDate.js → getZonedDate.mjs} +6 -11
  5. package/gtagPageview.js +9 -4
  6. package/{node/gtagPageview.js → gtagPageview.mjs} +4 -8
  7. package/index.js +18 -15
  8. package/index.mjs +15 -0
  9. package/isIE.js +9 -4
  10. package/{node/isIE.js → isIE.mjs} +4 -8
  11. package/isMobile.js +9 -4
  12. package/{node/isMobile.js → isMobile.mjs} +4 -8
  13. package/navigateToHash.js +9 -4
  14. package/navigateToHash.mjs +13 -0
  15. package/navigateToHashParams.d.ts +1 -1
  16. package/navigateToHashParams.js +11 -5
  17. package/navigateToHashParams.mjs +22 -0
  18. package/navigateToMergedHashParams.d.ts +1 -1
  19. package/navigateToMergedHashParams.js +11 -5
  20. package/navigateToMergedHashParams.mjs +14 -0
  21. package/navigateToMergedParams.d.ts +1 -1
  22. package/navigateToMergedParams.js +11 -5
  23. package/navigateToMergedParams.mjs +14 -0
  24. package/navigateToParams.d.ts +1 -1
  25. package/navigateToParams.js +13 -7
  26. package/navigateToParams.mjs +19 -0
  27. package/navigateToUrl.js +6 -2
  28. package/{node/navigateToUrl.js → navigateToUrl.mjs} +2 -6
  29. package/navigateWithoutUrlParam.js +11 -6
  30. package/navigateWithoutUrlParam.mjs +19 -0
  31. package/package.json +3 -6
  32. package/redirectTo.d.ts +1 -1
  33. package/redirectTo.js +11 -5
  34. package/redirectTo.mjs +15 -0
  35. package/storage.js +9 -5
  36. package/storage.mjs +9 -0
  37. package/storageClient.js +19 -13
  38. package/{node/storageClient.js → storageClient.mjs} +14 -17
  39. package/node/index.js +0 -18
  40. package/node/navigateToHash.js +0 -18
  41. package/node/navigateToHashParams.js +0 -25
  42. package/node/navigateToMergedHashParams.js +0 -17
  43. package/node/navigateToMergedParams.js +0 -17
  44. package/node/navigateToParams.js +0 -23
  45. package/node/navigateWithoutUrlParam.js +0 -23
  46. package/node/redirectTo.js +0 -18
  47. package/node/storage.js +0 -13
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.navigateToParams = void 0;
4
- var tslib_1 = require("tslib");
5
- var utils_1 = require("@koine/utils");
6
- var navigateToUrl_1 = tslib_1.__importDefault(require("./navigateToUrl"));
7
- /**
8
- * Change current URL query parameters, it uses `history`.
9
- *
10
- * @category location
11
- * @param replace Replace URL instead of pushing it in the history stack. By default it pushes it.
12
- * @returns The query string with initial `?`
13
- */
14
- function navigateToParams(params, replace) {
15
- if (params === void 0) { params = {}; }
16
- var queryString = typeof params === "string" ? params : (0, utils_1.buildUrlQueryString)(params);
17
- if (utils_1.isBrowser) {
18
- (0, navigateToUrl_1.default)(location.pathname + queryString, replace);
19
- }
20
- return queryString;
21
- }
22
- exports.navigateToParams = navigateToParams;
23
- exports.default = navigateToParams;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.navigateWithoutUrlParam = void 0;
4
- var utils_1 = require("@koine/utils");
5
- var navigateToParams_1 = require("./navigateToParams");
6
- /**
7
- * Remove URL query parameter, it uses `history`
8
- *
9
- * @category location
10
- * @param replace Replace URL instead of pushing it in the history stack. By default it pushes it.
11
- */
12
- function navigateWithoutUrlParam(paramName, replace) {
13
- var params = {};
14
- var currentParams = (0, utils_1.getUrlQueryParams)();
15
- for (var key in currentParams) {
16
- if (key !== paramName) {
17
- params[key] = currentParams[key];
18
- }
19
- }
20
- return (0, navigateToParams_1.navigateToParams)(params, replace);
21
- }
22
- exports.navigateWithoutUrlParam = navigateWithoutUrlParam;
23
- exports.default = navigateWithoutUrlParam;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.redirectTo = void 0;
4
- var utils_1 = require("@koine/utils");
5
- /**
6
- * Redirect to url with params {optionally}, removes eventual trailing question
7
- * marks from the given URL, it uses `location`
8
- *
9
- * @category location
10
- */
11
- function redirectTo(url, params) {
12
- if (utils_1.isBrowser) {
13
- var queryString = (0, utils_1.buildUrlQueryString)(params);
14
- location.href = url.replace(/\?+$/g, "") + queryString;
15
- }
16
- }
17
- exports.redirectTo = redirectTo;
18
- exports.default = redirectTo;
package/node/storage.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.storage = void 0;
4
- var tslib_1 = require("tslib");
5
- var storageClient_1 = tslib_1.__importDefault(require("./storageClient"));
6
- /**
7
- * Storage, for `localStorage` and `sessionStorage`
8
- */
9
- exports.storage = {
10
- l: (0, storageClient_1.default)(),
11
- s: (0, storageClient_1.default)(true),
12
- };
13
- exports.default = exports.storage;