@flopflip/localstorage-cache 12.5.6 → 13.0.1
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.
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
get
|
|
8
|
-
|
|
5
|
+
const createCache = options => {
|
|
6
|
+
const cache = {
|
|
7
|
+
get(key) {
|
|
8
|
+
const localStorageValue = localStorage.getItem([options.prefix, key].join('/'));
|
|
9
9
|
return localStorageValue ? JSON.parse(localStorageValue) : null;
|
|
10
10
|
},
|
|
11
|
-
set
|
|
11
|
+
set(key, value) {
|
|
12
12
|
try {
|
|
13
13
|
localStorage.setItem([options.prefix, key].join('/'), JSON.stringify(value));
|
|
14
14
|
return true;
|
|
@@ -17,14 +17,14 @@ var createCache = function createCache(options) {
|
|
|
17
17
|
return false;
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
unset
|
|
20
|
+
unset(key) {
|
|
21
21
|
localStorage.removeItem([options.prefix, key].join('/'));
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
return cache;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
const version = "13.0.1";
|
|
28
28
|
|
|
29
29
|
exports["default"] = createCache;
|
|
30
30
|
exports.version = version;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
get
|
|
8
|
-
|
|
5
|
+
const createCache = options => {
|
|
6
|
+
const cache = {
|
|
7
|
+
get(key) {
|
|
8
|
+
const localStorageValue = localStorage.getItem([options.prefix, key].join('/'));
|
|
9
9
|
return localStorageValue ? JSON.parse(localStorageValue) : null;
|
|
10
10
|
},
|
|
11
|
-
set
|
|
11
|
+
set(key, value) {
|
|
12
12
|
try {
|
|
13
13
|
localStorage.setItem([options.prefix, key].join('/'), JSON.stringify(value));
|
|
14
14
|
return true;
|
|
@@ -17,14 +17,14 @@ var createCache = function createCache(options) {
|
|
|
17
17
|
return false;
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
unset
|
|
20
|
+
unset(key) {
|
|
21
21
|
localStorage.removeItem([options.prefix, key].join('/'));
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
return cache;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
const version = "13.0.1";
|
|
28
28
|
|
|
29
29
|
exports["default"] = createCache;
|
|
30
30
|
exports.version = version;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
get
|
|
4
|
-
|
|
1
|
+
const createCache = options => {
|
|
2
|
+
const cache = {
|
|
3
|
+
get(key) {
|
|
4
|
+
const localStorageValue = localStorage.getItem([options.prefix, key].join('/'));
|
|
5
5
|
return localStorageValue ? JSON.parse(localStorageValue) : null;
|
|
6
6
|
},
|
|
7
|
-
set
|
|
7
|
+
set(key, value) {
|
|
8
8
|
try {
|
|
9
9
|
localStorage.setItem([options.prefix, key].join('/'), JSON.stringify(value));
|
|
10
10
|
return true;
|
|
@@ -13,13 +13,13 @@ var createCache = function createCache(options) {
|
|
|
13
13
|
return false;
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
-
unset
|
|
16
|
+
unset(key) {
|
|
17
17
|
localStorage.removeItem([options.prefix, key].join('/'));
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
return cache;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
const version = "13.0.1";
|
|
24
24
|
|
|
25
25
|
export { createCache as default, version };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flopflip/localstorage-cache",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.1",
|
|
4
4
|
"description": "Localstorage cache for flipflop adapters",
|
|
5
5
|
"main": "dist/flopflip-localstorage-cache.cjs.js",
|
|
6
6
|
"module": "dist/flopflip-localstorage-cache.esm.js",
|
|
@@ -30,6 +30,6 @@
|
|
|
30
30
|
"client"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@flopflip/types": "
|
|
33
|
+
"@flopflip/types": "13.0.1"
|
|
34
34
|
}
|
|
35
35
|
}
|