befly-shared 2.0.15 → 2.0.16
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/package.json +1 -1
- package/utils/createStore.js +5 -5
package/package.json
CHANGED
package/utils/createStore.js
CHANGED
|
@@ -28,7 +28,7 @@ function parseValue(value, defaultValue) {
|
|
|
28
28
|
|
|
29
29
|
function createStorageApi(storage) {
|
|
30
30
|
return {
|
|
31
|
-
set(key, value) {
|
|
31
|
+
set: function (key, value) {
|
|
32
32
|
if (typeof key !== "string" || key.trim() === "") {
|
|
33
33
|
return false;
|
|
34
34
|
}
|
|
@@ -40,7 +40,7 @@ function createStorageApi(storage) {
|
|
|
40
40
|
storage.setItem(key, serializeValue(value));
|
|
41
41
|
return true;
|
|
42
42
|
},
|
|
43
|
-
get(key, defaultValue = null) {
|
|
43
|
+
get: function (key, defaultValue = null) {
|
|
44
44
|
if (typeof key !== "string" || key.trim() === "") {
|
|
45
45
|
return defaultValue;
|
|
46
46
|
}
|
|
@@ -51,7 +51,7 @@ function createStorageApi(storage) {
|
|
|
51
51
|
|
|
52
52
|
return parseValue(storage.getItem(key), defaultValue);
|
|
53
53
|
},
|
|
54
|
-
remove(key) {
|
|
54
|
+
remove: function (key) {
|
|
55
55
|
if (typeof key !== "string" || key.trim() === "") {
|
|
56
56
|
return false;
|
|
57
57
|
}
|
|
@@ -63,7 +63,7 @@ function createStorageApi(storage) {
|
|
|
63
63
|
storage.removeItem(key);
|
|
64
64
|
return true;
|
|
65
65
|
},
|
|
66
|
-
has(key) {
|
|
66
|
+
has: function (key) {
|
|
67
67
|
if (typeof key !== "string" || key.trim() === "") {
|
|
68
68
|
return false;
|
|
69
69
|
}
|
|
@@ -74,7 +74,7 @@ function createStorageApi(storage) {
|
|
|
74
74
|
|
|
75
75
|
return storage.getItem(key) !== null;
|
|
76
76
|
},
|
|
77
|
-
clear() {
|
|
77
|
+
clear: function () {
|
|
78
78
|
if (!storage || typeof storage.clear !== "function") {
|
|
79
79
|
return false;
|
|
80
80
|
}
|