@esportsplus/web-storage 0.1.4 → 0.1.5

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/build/index.d.ts CHANGED
@@ -19,7 +19,7 @@ declare const _default: {
19
19
  push(key: string, ...values: any[]): void;
20
20
  replace(values: {
21
21
  [key: string]: any;
22
- }, whitelist?: string[]): void;
22
+ }): void;
23
23
  shift(key: string): Promise<any>;
24
24
  set(key: string, value: any): void;
25
25
  sync(): Promise<void>;
@@ -18,7 +18,7 @@ declare class Store {
18
18
  push(key: string, ...values: any[]): void;
19
19
  replace(values: {
20
20
  [key: string]: any;
21
- }, whitelist?: string[]): void;
21
+ }): void;
22
22
  shift(key: string): Promise<any>;
23
23
  set(key: string, value: any): void;
24
24
  sync(): Promise<void>;
@@ -114,17 +114,7 @@ class Store {
114
114
  await this.instance.setItem(key, data);
115
115
  });
116
116
  }
117
- replace(values, whitelist = []) {
118
- if (whitelist.length) {
119
- let whitelisted = {};
120
- for (let i = 0, n = whitelist.length; i < n; i++) {
121
- if (!values[whitelist[i]]) {
122
- continue;
123
- }
124
- whitelisted[whitelist[i]] = values[whitelist[i]];
125
- }
126
- values = whitelisted;
127
- }
117
+ replace(values) {
128
118
  if (!Object.keys(values).length) {
129
119
  return;
130
120
  }
package/package.json CHANGED
@@ -1,11 +1,9 @@
1
1
  {
2
2
  "author": "ICJR",
3
- "dependencies": {
4
- "localforage": "^1.10.0"
5
- },
6
3
  "description": "Web storage utility",
7
4
  "devDependencies": {
8
5
  "glob": "^8.0.3",
6
+ "localforage": "^1.10.0",
9
7
  "ts-loader": "^9.4.1",
10
8
  "tsc-alias": "^1.7.0",
11
9
  "tsconfig-paths-webpack-plugin": "^4.0.0",
@@ -23,5 +21,5 @@
23
21
  "prepublishOnly": "npm run build"
24
22
  },
25
23
  "types": "./build/index.d.ts",
26
- "version": "0.1.4"
24
+ "version": "0.1.5"
27
25
  }
@@ -155,21 +155,7 @@ class Store {
155
155
  });
156
156
  }
157
157
 
158
- replace(values: { [key: string]: any }, whitelist: string[] = []): void {
159
- if (whitelist.length) {
160
- let whitelisted: { [key: string]: any } = {};
161
-
162
- for (let i = 0, n = whitelist.length; i < n; i++) {
163
- if (!values[whitelist[i]]) {
164
- continue;
165
- }
166
-
167
- whitelisted[whitelist[i]] = values[whitelist[i]];
168
- }
169
-
170
- values = whitelisted;
171
- }
172
-
158
+ replace(values: { [key: string]: any }): void {
173
159
  if (!Object.keys(values).length) {
174
160
  return;
175
161
  }