@kvs/localstorage 1.1.0 → 2.1.0

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @kvs/localstorage
1
+ # @kvs/localstorage ![](https://badgen.net/bundlephobia/minzip/@kvs/localstorage)
2
2
 
3
3
  localstorage for KVS.
4
4
 
package/lib/index.d.ts CHANGED
@@ -7,4 +7,4 @@ export declare type KvsLocalStorage<Schema extends KvsLocalStorageSchema> = KVS<
7
7
  export declare type KvsLocalStorageOptions<Schema extends KvsLocalStorageSchema> = KVSOptions<Schema> & {
8
8
  kvsVersionKey?: string;
9
9
  };
10
- export declare const kvsLocalStorage: <Schema extends KvsLocalStorageSchema>(options: KvsLocalStorageOptions<Schema>) => Promise<KVS<Schema>>;
10
+ export declare const kvsLocalStorage: <Schema extends KvsLocalStorageSchema>(options: KvsLocalStorageOptions<Schema>) => Promise<KvsStorage<Schema>>;
package/lib/index.js CHANGED
@@ -1,17 +1,12 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.kvsLocalStorage = void 0;
13
4
  const storage_1 = require("@kvs/storage");
14
- exports.kvsLocalStorage = (options) => __awaiter(void 0, void 0, void 0, function* () {
15
- return storage_1.kvsStorage(Object.assign(Object.assign({}, options), { storage: window.localStorage }));
16
- });
5
+ const kvsLocalStorage = async (options) => {
6
+ return (0, storage_1.kvsStorage)({
7
+ ...options,
8
+ storage: window.localStorage
9
+ });
10
+ };
11
+ exports.kvsLocalStorage = kvsLocalStorage;
17
12
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAiE;AAUpD,QAAA,eAAe,GAAG,CAC3B,OAAuC,EACZ,EAAE;IAC7B,OAAO,oBAAU,iCACV,OAAO,KACV,OAAO,EAAE,MAAM,CAAC,YAAY,IAC9B,CAAC;AACP,CAAC,CAAA,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,0CAAiE;AAU1D,MAAM,eAAe,GAAG,KAAK,EAChC,OAAuC,EACZ,EAAE;IAC7B,OAAO,IAAA,oBAAU,EAAC;QACd,GAAG,OAAO;QACV,OAAO,EAAE,MAAM,CAAC,YAAY;KAC/B,CAAC,CAAC;AACP,CAAC,CAAC;AAPW,QAAA,eAAe,mBAO1B"}
package/module/index.d.ts CHANGED
@@ -7,4 +7,4 @@ export declare type KvsLocalStorage<Schema extends KvsLocalStorageSchema> = KVS<
7
7
  export declare type KvsLocalStorageOptions<Schema extends KvsLocalStorageSchema> = KVSOptions<Schema> & {
8
8
  kvsVersionKey?: string;
9
9
  };
10
- export declare const kvsLocalStorage: <Schema extends KvsLocalStorageSchema>(options: KvsLocalStorageOptions<Schema>) => Promise<KVS<Schema>>;
10
+ export declare const kvsLocalStorage: <Schema extends KvsLocalStorageSchema>(options: KvsLocalStorageOptions<Schema>) => Promise<KvsStorage<Schema>>;
package/module/index.js CHANGED
@@ -1,14 +1,8 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1
+ import { kvsStorage } from "@kvs/storage";
2
+ export const kvsLocalStorage = async (options) => {
3
+ return kvsStorage({
4
+ ...options,
5
+ storage: window.localStorage
8
6
  });
9
7
  };
10
- import { kvsStorage } from "@kvs/storage";
11
- export const kvsLocalStorage = (options) => __awaiter(void 0, void 0, void 0, function* () {
12
- return kvsStorage(Object.assign(Object.assign({}, options), { storage: window.localStorage }));
13
- });
14
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAyB,UAAU,EAAE,MAAM,cAAc,CAAC;AAUjE,MAAM,CAAC,MAAM,eAAe,GAAG,CAC3B,OAAuC,EACZ,EAAE;IAC7B,OAAO,UAAU,iCACV,OAAO,KACV,OAAO,EAAE,MAAM,CAAC,YAAY,IAC9B,CAAC;AACP,CAAC,CAAA,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,UAAU,EAAE,MAAM,cAAc,CAAC;AAUjE,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAChC,OAAuC,EACZ,EAAE;IAC7B,OAAO,UAAU,CAAC;QACd,GAAG,OAAO;QACV,OAAO,EAAE,MAAM,CAAC,YAAY;KAC/B,CAAC,CAAC;AACP,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvs/localstorage",
3
- "version": "1.1.0",
3
+ "version": "2.1.0",
4
4
  "description": "localstorage for KVS.",
5
5
  "keywords": [
6
6
  "kvs",
@@ -45,23 +45,22 @@
45
45
  "trailingComma": "none"
46
46
  },
47
47
  "dependencies": {
48
- "@kvs/storage": "^1.1.0"
48
+ "@kvs/storage": "^2.0.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@jsdevtools/karma-config": "^3.1.7",
52
- "@types/mocha": "^8.0.1",
53
- "@types/node": "^14.0.27",
54
- "karma": "^5.1.1",
52
+ "@types/mocha": "^9.0.0",
53
+ "@types/node": "^16.9.1",
54
+ "karma": "^6.3.4",
55
55
  "karma-cli": "^2.0.0",
56
- "lerna": "^3.22.1",
57
- "mocha": "^8.1.1",
56
+ "mocha": "^9.1.1",
58
57
  "prettier": "^2.0.5",
59
58
  "rimraf": "^3.0.2",
60
- "ts-loader": "^8.0.2",
61
- "typescript": "^3.9.7"
59
+ "ts-loader": "^8.2.0",
60
+ "typescript": "^4.2.4"
62
61
  },
63
62
  "publishConfig": {
64
63
  "access": "public"
65
64
  },
66
- "gitHead": "8059a1e365484eab697477640c0dc7257d899db5"
65
+ "gitHead": "ac9e606e7952f1fd69b2bbf27671d068cb71ade8"
67
66
  }
package/CHANGELOG.md DELETED
@@ -1,59 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [1.1.0](https://github.com/azu/kvs/compare/v1.0.0...v1.1.0) (2020-10-29)
7
-
8
-
9
- ### Features
10
-
11
- * **examples:** add basic example ([#14](https://github.com/azu/kvs/issues/14)) ([351215d](https://github.com/azu/kvs/commit/351215d6c04158201768036caaa6e792c72717ea))
12
-
13
-
14
-
15
-
16
-
17
- # [1.0.0](https://github.com/azu/kvs/compare/v0.3.1...v1.0.0) (2020-08-22)
18
-
19
- **Note:** Version bump only for package @kvs/localstorage
20
-
21
-
22
-
23
-
24
-
25
- # [0.3.0](https://github.com/azu/kvs/compare/v0.2.1...v0.3.0) (2020-08-22)
26
-
27
- **Note:** Version bump only for package @kvs/localstorage
28
-
29
-
30
-
31
-
32
-
33
- ## [0.2.1](https://github.com/azu/kvs/compare/v0.2.0...v0.2.1) (2020-08-22)
34
-
35
- **Note:** Version bump only for package @kvs/localstorage
36
-
37
-
38
-
39
-
40
-
41
- # [0.2.0](https://github.com/azu/kvs/compare/v0.1.0...v0.2.0) (2020-08-08)
42
-
43
-
44
- ### Features
45
-
46
- * **@kvs/localstorage:** migrate to Schema type ([0c84640](https://github.com/azu/kvs/commit/0c84640c1c1d28955c60ca83d8a01bdce936d9ef))
47
-
48
-
49
-
50
-
51
-
52
- # 0.1.0 (2020-08-08)
53
-
54
-
55
- ### Features
56
-
57
- * **@kvs/node-localstorage:** add node implementation ([5160012](https://github.com/azu/kvs/commit/516001286c96ac85cb54d55fbba62549d6d7eb0e))
58
- * add `close()` to interface ([a269d1d](https://github.com/azu/kvs/commit/a269d1dda6ce63388771e6fa4d897a26f284b72c))
59
- * **@kvs/localstorage:** add localstorage implementation ([54fc38b](https://github.com/azu/kvs/commit/54fc38b8a3a75923d8e8383af9c907979a2dba52))