@koine/browser 2.0.0-beta.20 → 2.0.0-beta.22

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/createStorage.js CHANGED
@@ -14,7 +14,7 @@ export var createStorage = function (config, useSessionStorage) {
14
14
  },
15
15
  getAll: function (defaultValues) {
16
16
  if (!isBrowser) {
17
- if (process.env["NODE_ENV"] !== "production") {
17
+ if (process.env["NODE_ENV"] === "development") {
18
18
  console.log("[@koine/utils:createStorage] attempt to use 'getAll' outside of browser.");
19
19
  }
20
20
  return {};
@@ -36,7 +36,7 @@ export var createStorage = function (config, useSessionStorage) {
36
36
  client.set(keys[key], value, encode);
37
37
  },
38
38
  setMany: function (newValues) {
39
- if (process.env["NODE_ENV"] !== "production") {
39
+ if (process.env["NODE_ENV"] === "development") {
40
40
  if (!isBrowser) {
41
41
  console.log("[@koine/utils:createStorage] attempt to use 'setMany' outside of browser.");
42
42
  }
@@ -60,7 +60,7 @@ export var createStorage = function (config, useSessionStorage) {
60
60
  client.remove(keys[key]);
61
61
  },
62
62
  clear: function () {
63
- if (process.env["NODE_ENV"] !== "production") {
63
+ if (process.env["NODE_ENV"] === "development") {
64
64
  if (!isBrowser) {
65
65
  console.log("[@koine/utils:createStorage] attempt to use 'clear' outside of browser.");
66
66
  }
@@ -73,7 +73,7 @@ export var createStorage = function (config, useSessionStorage) {
73
73
  },
74
74
  watch: function (keyToWatch, onRemoved, onAdded) {
75
75
  if (!isBrowser) {
76
- if (process.env["NODE_ENV"] !== "production") {
76
+ if (process.env["NODE_ENV"] === "development") {
77
77
  console.log("[@koine/utils:createStorage] attempt to use 'watch' outside of browser.");
78
78
  }
79
79
  return noop;
package/getZonedDate.js CHANGED
@@ -9,7 +9,7 @@ export function getZonedDate(dateString, timeZone) {
9
9
  timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
10
10
  }
11
11
  catch (e) {
12
- if (process.env["NODE_ENV"] !== "production") {
12
+ if (process.env["NODE_ENV"] === "development") {
13
13
  console.warn("[@koine/utils:getZonedDate] failed reading timeZone, error", e);
14
14
  }
15
15
  }
package/package.json CHANGED
@@ -2,12 +2,11 @@
2
2
  "name": "@koine/browser",
3
3
  "sideEffects": false,
4
4
  "dependencies": {
5
- "@koine/dom": "2.0.0-beta.20",
6
- "@koine/utils": "2.0.0-beta.20"
5
+ "@koine/dom": "2.0.0-beta.22",
6
+ "@koine/utils": "2.0.0-beta.22"
7
7
  },
8
- "types": "./index.d.ts",
9
- "type": "module",
10
8
  "module": "./index.js",
9
+ "type": "module",
11
10
  "exports": {
12
11
  ".": {
13
12
  "import": "./index.js"
@@ -65,5 +64,5 @@
65
64
  }
66
65
  },
67
66
  "peerDependencies": {},
68
- "version": "2.0.0-beta.20"
67
+ "version": "2.0.0-beta.22"
69
68
  }
package/storageClient.js CHANGED
@@ -5,14 +5,14 @@ export var storageClient = function (useSessionStorage) {
5
5
  return isBrowser
6
6
  ? window[useSessionStorage ? "sessionStorage" : "localStorage"][methodsMap[method]](key, value)
7
7
  : function () {
8
- if (process.env["NODE_ENV"] !== "production") {
8
+ if (process.env["NODE_ENV"] === "development") {
9
9
  console.warn("[@koine/utils:storageClient]: ".concat(useSessionStorage ? "sessionStorage" : "localStorage", " does not exists outside of browser."));
10
10
  }
11
11
  };
12
12
  };
13
13
  var get = function (key, transform, defaultValue) {
14
14
  var value = defaultValue !== null && defaultValue !== void 0 ? defaultValue : null;
15
- if (process.env["NODE_ENV"] !== "production") {
15
+ if (process.env["NODE_ENV"] === "development") {
16
16
  if (!isBrowser) {
17
17
  console.log("[@koine/utils:storage] called 'get' outside of browser with default value '".concat(JSON.stringify(defaultValue), "'."));
18
18
  }
@@ -35,7 +35,7 @@ export var storageClient = function (useSessionStorage) {
35
35
  };
36
36
  var set = function (key, value, transform) {
37
37
  if (transform === void 0) { transform = function (value) { return value; }; }
38
- if (process.env["NODE_ENV"] !== "production") {
38
+ if (process.env["NODE_ENV"] === "development") {
39
39
  if (!isBrowser) {
40
40
  console.log("[@koine/utils:storage] called 'set' outside of browser does not work.");
41
41
  }
@@ -48,14 +48,14 @@ export var storageClient = function (useSessionStorage) {
48
48
  nativeMethod("s", key, transformedValue);
49
49
  }
50
50
  catch (_e) {
51
- if (process.env["NODE_ENV"] !== "production") {
51
+ if (process.env["NODE_ENV"] === "development") {
52
52
  console.warn("[@koine/utils:createStorage]: 'set' error.", _e);
53
53
  }
54
54
  }
55
55
  }
56
56
  };
57
57
  var remove = function (key) {
58
- if (process.env["NODE_ENV"] !== "production") {
58
+ if (process.env["NODE_ENV"] === "development") {
59
59
  if (!isBrowser) {
60
60
  console.log("[@koine/utils:storage] called 'remove' outside of browser does not work.");
61
61
  }
@@ -65,7 +65,7 @@ export var storageClient = function (useSessionStorage) {
65
65
  nativeMethod("r", key);
66
66
  }
67
67
  catch (_e) {
68
- if (process.env["NODE_ENV"] !== "production") {
68
+ if (process.env["NODE_ENV"] === "development") {
69
69
  console.warn("[@koine/utils:createStorage]: 'remove' error.", _e);
70
70
  }
71
71
  }
@@ -73,7 +73,7 @@ export var storageClient = function (useSessionStorage) {
73
73
  };
74
74
  var has = function (key, defaultValue) {
75
75
  var value = defaultValue !== null && defaultValue !== void 0 ? defaultValue : false;
76
- if (process.env["NODE_ENV"] !== "production") {
76
+ if (process.env["NODE_ENV"] === "development") {
77
77
  if (!isBrowser) {
78
78
  console.log("[@koine/utils:storage] called 'has' outside of browser with default value '".concat(JSON.stringify(defaultValue), "'."));
79
79
  }