ag-common 0.0.103 → 0.0.104

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.
@@ -5,16 +5,8 @@ const react_1 = require("react");
5
5
  const log_1 = require("../../common/helpers/log");
6
6
  const object_1 = require("../../common/helpers/object");
7
7
  const getTimeSeconds = () => Math.ceil(new Date().getTime() / 1000);
8
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
- if (!process.nodeLocalStorage) {
11
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
- process.nodeLocalStorage = {};
13
- }
14
8
  const clearLocalStorageItem = (key) => {
15
9
  if (typeof window === 'undefined') {
16
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
- delete process.nodeLocalStorage[key];
18
10
  return;
19
11
  }
20
12
  try {
@@ -28,8 +20,6 @@ exports.clearLocalStorageItem = clearLocalStorageItem;
28
20
  const clearAllLocalStorage = (except) => {
29
21
  try {
30
22
  if (typeof window === 'undefined') {
31
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
- process.nodeLocalStorage = {};
33
23
  return;
34
24
  }
35
25
  for (let i = 0; i < localStorage.length; i += 1) {
@@ -48,8 +38,6 @@ exports.clearAllLocalStorage = clearAllLocalStorage;
48
38
  const setLocalStorageItem = (key, value, ttl) => {
49
39
  try {
50
40
  if (typeof window === 'undefined') {
51
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
- process.nodeLocalStorage[key] = value;
53
41
  return;
54
42
  }
55
43
  const set = {
@@ -66,9 +54,7 @@ const setLocalStorageItem = (key, value, ttl) => {
66
54
  exports.setLocalStorageItem = setLocalStorageItem;
67
55
  const getLocalStorageItem = (key, initialValue, ttl) => {
68
56
  if (typeof window === 'undefined') {
69
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
70
- const value = process.nodeLocalStorage[key] || initialValue;
71
- return value;
57
+ return initialValue;
72
58
  }
73
59
  const itemraw = window.localStorage.getItem(key);
74
60
  const item = (0, object_1.tryJsonParse)(itemraw, undefined);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-common",
3
- "version": "0.0.103",
3
+ "version": "0.0.104",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Andrei Gec <@andreigec> (https://gec.dev/)",