@flopflip/localstorage-cache 1.0.18 → 1.0.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/dist/declarations/src/cache/cache.d.ts +3 -3
- package/dist/declarations/src/cache/index.d.ts +3 -3
- package/dist/declarations/src/index.d.ts +3 -3
- package/dist/flopflip-localstorage-cache.cjs.dev.js +5 -5
- package/dist/flopflip-localstorage-cache.cjs.prod.js +5 -5
- package/dist/flopflip-localstorage-cache.esm.js +5 -6
- package/package.json +5 -8
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { TCache, TCacheOptions } from '@flopflip/types';
|
|
2
|
-
declare const createCache: (options: TCacheOptions) => TCache;
|
|
3
|
-
export default createCache;
|
|
1
|
+
import { TCache, TCacheOptions } from '@flopflip/types';
|
|
2
|
+
declare const createCache: (options: TCacheOptions) => TCache;
|
|
3
|
+
export default createCache;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const version = "
|
|
2
|
-
export { version };
|
|
3
|
-
export { default } from './cache';
|
|
1
|
+
declare const version = "__@FLOPFLIP/VERSION_OF_RELEASE__";
|
|
2
|
+
export { version };
|
|
3
|
+
export { default } from './cache';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const version = "
|
|
2
|
-
export { default } from './cache';
|
|
3
|
-
export { version };
|
|
1
|
+
declare const version = "__@FLOPFLIP/VERSION_OF_RELEASE__";
|
|
2
|
+
export { default } from './cache';
|
|
3
|
+
export { version };
|
|
@@ -5,25 +5,25 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var createCache = function createCache(options) {
|
|
6
6
|
var cache = {
|
|
7
7
|
get: function get(key) {
|
|
8
|
-
var localStorageValue = localStorage.getItem(
|
|
8
|
+
var localStorageValue = localStorage.getItem([options.prefix, key].join('/'));
|
|
9
9
|
return localStorageValue ? JSON.parse(localStorageValue) : null;
|
|
10
10
|
},
|
|
11
11
|
set: function set(key, value) {
|
|
12
12
|
try {
|
|
13
|
-
localStorage.setItem(
|
|
13
|
+
localStorage.setItem([options.prefix, key].join('/'), JSON.stringify(value));
|
|
14
14
|
return true; // eslint-disable-next-line
|
|
15
15
|
} catch (_error) {
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
unset: function unset(key) {
|
|
20
|
-
localStorage.removeItem(
|
|
20
|
+
localStorage.removeItem([options.prefix, key].join('/'));
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
return cache;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
var version =
|
|
26
|
+
var version = "1.0.22";
|
|
27
27
|
|
|
28
|
-
exports
|
|
28
|
+
exports["default"] = createCache;
|
|
29
29
|
exports.version = version;
|
|
@@ -5,25 +5,25 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var createCache = function createCache(options) {
|
|
6
6
|
var cache = {
|
|
7
7
|
get: function get(key) {
|
|
8
|
-
var localStorageValue = localStorage.getItem(
|
|
8
|
+
var localStorageValue = localStorage.getItem([options.prefix, key].join('/'));
|
|
9
9
|
return localStorageValue ? JSON.parse(localStorageValue) : null;
|
|
10
10
|
},
|
|
11
11
|
set: function set(key, value) {
|
|
12
12
|
try {
|
|
13
|
-
localStorage.setItem(
|
|
13
|
+
localStorage.setItem([options.prefix, key].join('/'), JSON.stringify(value));
|
|
14
14
|
return true; // eslint-disable-next-line
|
|
15
15
|
} catch (_error) {
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
unset: function unset(key) {
|
|
20
|
-
localStorage.removeItem(
|
|
20
|
+
localStorage.removeItem([options.prefix, key].join('/'));
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
return cache;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
var version =
|
|
26
|
+
var version = "1.0.22";
|
|
27
27
|
|
|
28
|
-
exports
|
|
28
|
+
exports["default"] = createCache;
|
|
29
29
|
exports.version = version;
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
var createCache = function createCache(options) {
|
|
2
2
|
var cache = {
|
|
3
3
|
get: function get(key) {
|
|
4
|
-
var localStorageValue = localStorage.getItem(
|
|
4
|
+
var localStorageValue = localStorage.getItem([options.prefix, key].join('/'));
|
|
5
5
|
return localStorageValue ? JSON.parse(localStorageValue) : null;
|
|
6
6
|
},
|
|
7
7
|
set: function set(key, value) {
|
|
8
8
|
try {
|
|
9
|
-
localStorage.setItem(
|
|
9
|
+
localStorage.setItem([options.prefix, key].join('/'), JSON.stringify(value));
|
|
10
10
|
return true; // eslint-disable-next-line
|
|
11
11
|
} catch (_error) {
|
|
12
12
|
return false;
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
unset: function unset(key) {
|
|
16
|
-
localStorage.removeItem(
|
|
16
|
+
localStorage.removeItem([options.prefix, key].join('/'));
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
return cache;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
var version =
|
|
22
|
+
var version = "1.0.22";
|
|
23
23
|
|
|
24
|
-
export default
|
|
25
|
-
export { version };
|
|
24
|
+
export { createCache as default, version };
|
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flopflip/localstorage-cache",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
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",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"prepare": "./../../bin/version.js amend"
|
|
9
|
-
},
|
|
10
7
|
"files": [
|
|
11
8
|
"readme.md",
|
|
12
9
|
"dist/**"
|
|
@@ -16,7 +13,8 @@
|
|
|
16
13
|
},
|
|
17
14
|
"repository": {
|
|
18
15
|
"type": "git",
|
|
19
|
-
"url": "
|
|
16
|
+
"url": "https://github.com/tdeekens/flopflip.git",
|
|
17
|
+
"directory": "packages/localstorage-cache"
|
|
20
18
|
},
|
|
21
19
|
"author": "Tobias Deekens <nerd@tdeekens.name>",
|
|
22
20
|
"license": "MIT",
|
|
@@ -32,7 +30,6 @@
|
|
|
32
30
|
"client"
|
|
33
31
|
],
|
|
34
32
|
"dependencies": {
|
|
35
|
-
"@flopflip/types": "4.1.
|
|
36
|
-
}
|
|
37
|
-
"devDependencies": {}
|
|
33
|
+
"@flopflip/types": "4.1.19"
|
|
34
|
+
}
|
|
38
35
|
}
|