@kvs/node-localstorage 1.2.0 → 2.1.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.
package/lib/index.js CHANGED
@@ -1,13 +1,4 @@
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
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -21,15 +12,18 @@ const node_localstorage_1 = require("node-localstorage");
21
12
  const app_root_path_1 = __importDefault(require("app-root-path"));
22
13
  // @ts-ignore
23
14
  const mkdirp_1 = __importDefault(require("mkdirp"));
24
- const kvsLocalStorage = (options) => __awaiter(void 0, void 0, void 0, function* () {
15
+ const kvsLocalStorage = async (options) => {
25
16
  const defaultCacheDir = path_1.default.join(app_root_path_1.default.toString(), ".cache");
26
17
  if (!options.storeFilePath) {
27
- yield mkdirp_1.default(defaultCacheDir);
18
+ await (0, mkdirp_1.default)(defaultCacheDir);
28
19
  }
29
20
  const saveFilePath = options.storeFilePath
30
21
  ? options.storeFilePath
31
22
  : path_1.default.join(defaultCacheDir, "kvs-node-localstorage");
32
- return storage_1.kvsStorage(Object.assign(Object.assign({}, options), { storage: new node_localstorage_1.LocalStorage(saveFilePath) }));
33
- });
23
+ return (0, storage_1.kvsStorage)({
24
+ ...options,
25
+ storage: new node_localstorage_1.LocalStorage(saveFilePath)
26
+ });
27
+ };
34
28
  exports.kvsLocalStorage = kvsLocalStorage;
35
29
  //# 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,gDAAwB;AACxB,0CAAiE;AAEjE,aAAa;AACb,yDAAiD;AACjD,aAAa;AACb,kEAAoC;AACpC,aAAa;AACb,oDAA4B;AAUrB,MAAM,eAAe,GAAG,CAC3B,OAAuC,EACZ,EAAE;IAC7B,MAAM,eAAe,GAAG,cAAI,CAAC,IAAI,CAAC,uBAAO,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;IAChE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;QACxB,MAAM,gBAAM,CAAC,eAAe,CAAC,CAAC;KACjC;IACD,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa;QACtC,CAAC,CAAC,OAAO,CAAC,aAAa;QACvB,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC;IAC1D,OAAO,oBAAU,iCACV,OAAO,KACV,OAAO,EAAE,IAAI,gCAAY,CAAC,YAAY,CAAC,IACzC,CAAC;AACP,CAAC,CAAA,CAAC;AAdW,QAAA,eAAe,mBAc1B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,0CAAiE;AAEjE,aAAa;AACb,yDAAiD;AACjD,aAAa;AACb,kEAAoC;AACpC,aAAa;AACb,oDAA4B;AAUrB,MAAM,eAAe,GAAG,KAAK,EAChC,OAAuC,EACZ,EAAE;IAC7B,MAAM,eAAe,GAAG,cAAI,CAAC,IAAI,CAAC,uBAAO,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;IAChE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;QACxB,MAAM,IAAA,gBAAM,EAAC,eAAe,CAAC,CAAC;KACjC;IACD,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa;QACtC,CAAC,CAAC,OAAO,CAAC,aAAa;QACvB,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC;IAC1D,OAAO,IAAA,oBAAU,EAAC;QACd,GAAG,OAAO;QACV,OAAO,EAAE,IAAI,gCAAY,CAAC,YAAY,CAAC;KAC1C,CAAC,CAAC;AACP,CAAC,CAAC;AAdW,QAAA,eAAe,mBAc1B"}
package/module/index.js CHANGED
@@ -1,12 +1,3 @@
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());
8
- });
9
- };
10
1
  import path from "path";
11
2
  import { kvsStorage } from "@kvs/storage";
12
3
  // @ts-ignore
@@ -15,14 +6,17 @@ import { LocalStorage } from "node-localstorage";
15
6
  import appRoot from "app-root-path";
16
7
  // @ts-ignore
17
8
  import mkdirp from "mkdirp";
18
- export const kvsLocalStorage = (options) => __awaiter(void 0, void 0, void 0, function* () {
9
+ export const kvsLocalStorage = async (options) => {
19
10
  const defaultCacheDir = path.join(appRoot.toString(), ".cache");
20
11
  if (!options.storeFilePath) {
21
- yield mkdirp(defaultCacheDir);
12
+ await mkdirp(defaultCacheDir);
22
13
  }
23
14
  const saveFilePath = options.storeFilePath
24
15
  ? options.storeFilePath
25
16
  : path.join(defaultCacheDir, "kvs-node-localstorage");
26
- return kvsStorage(Object.assign(Object.assign({}, options), { storage: new LocalStorage(saveFilePath) }));
27
- });
17
+ return kvsStorage({
18
+ ...options,
19
+ storage: new LocalStorage(saveFilePath)
20
+ });
21
+ };
28
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAyB,UAAU,EAAE,MAAM,cAAc,CAAC;AAEjE,aAAa;AACb,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,aAAa;AACb,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,aAAa;AACb,OAAO,MAAM,MAAM,QAAQ,CAAC;AAU5B,MAAM,CAAC,MAAM,eAAe,GAAG,CAC3B,OAAuC,EACZ,EAAE;IAC7B,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;IAChE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;QACxB,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;KACjC;IACD,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa;QACtC,CAAC,CAAC,OAAO,CAAC,aAAa;QACvB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC;IAC1D,OAAO,UAAU,iCACV,OAAO,KACV,OAAO,EAAE,IAAI,YAAY,CAAC,YAAY,CAAC,IACzC,CAAC;AACP,CAAC,CAAA,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAyB,UAAU,EAAE,MAAM,cAAc,CAAC;AAEjE,aAAa;AACb,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,aAAa;AACb,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,aAAa;AACb,OAAO,MAAM,MAAM,QAAQ,CAAC;AAU5B,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAChC,OAAuC,EACZ,EAAE;IAC7B,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;IAChE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;QACxB,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;KACjC;IACD,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa;QACtC,CAAC,CAAC,OAAO,CAAC,aAAa;QACvB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC;IAC1D,OAAO,UAAU,CAAC;QACd,GAAG,OAAO;QACV,OAAO,EAAE,IAAI,YAAY,CAAC,YAAY,CAAC;KAC1C,CAAC,CAAC;AACP,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvs/node-localstorage",
3
- "version": "1.2.0",
3
+ "version": "2.1.1",
4
4
  "description": "Node.js localstorage for KVS.",
5
5
  "keywords": [
6
6
  "kvs",
@@ -45,25 +45,24 @@
45
45
  "trailingComma": "none"
46
46
  },
47
47
  "dependencies": {
48
- "@kvs/storage": "^1.2.0",
48
+ "@kvs/storage": "^2.1.1",
49
49
  "app-root-path": "^3.0.0",
50
50
  "mkdirp": "^1.0.4",
51
51
  "node-localstorage": "^2.1.6"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@jsdevtools/karma-config": "^3.1.7",
55
- "@kvs/common-test-case": "^1.2.0",
56
- "@types/mocha": "^8.0.1",
57
- "@types/node": "^14.0.27",
58
- "lerna": "^3.22.1",
59
- "mocha": "^8.1.1",
55
+ "@kvs/common-test-case": "^2.1.1",
56
+ "@types/mocha": "^9.0.0",
57
+ "@types/node": "^16.9.1",
58
+ "mocha": "^9.1.1",
60
59
  "prettier": "^2.0.5",
61
60
  "rimraf": "^3.0.2",
62
- "ts-loader": "^8.1.0",
61
+ "ts-loader": "^8.2.0",
63
62
  "typescript": "^4.2.4"
64
63
  },
65
64
  "publishConfig": {
66
65
  "access": "public"
67
66
  },
68
- "gitHead": "63a9bf838e8efa7690163d28476edd90e2c6b94c"
67
+ "gitHead": "d8ec6e0ba796bc2cab189a395bcda9754ffc4c9e"
69
68
  }
package/CHANGELOG.md DELETED
@@ -1,81 +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.2.0](https://github.com/azu/kvs/compare/v1.1.0...v1.2.0) (2021-04-17)
7
-
8
-
9
- ### Features
10
-
11
- * **types:** Use Key Remapping in Mapped Types. ([#17](https://github.com/azu/kvs/issues/17)) ([7c099be](https://github.com/azu/kvs/commit/7c099be4ae39adedba78d111574347395e024362))
12
-
13
-
14
- ### BREAKING CHANGES
15
-
16
- * **types:** require TypeScript 4.1+
17
-
18
- It aims to support to following schema:
19
-
20
- ```ts
21
- const storage = kvs<{
22
- [index: string]: string;
23
- }>;
24
- ```
25
-
26
-
27
-
28
-
29
-
30
- # [1.1.0](https://github.com/azu/kvs/compare/v1.0.0...v1.1.0) (2020-10-29)
31
-
32
-
33
- ### Features
34
-
35
- * **examples:** add basic example ([#14](https://github.com/azu/kvs/issues/14)) ([351215d](https://github.com/azu/kvs/commit/351215d6c04158201768036caaa6e792c72717ea))
36
-
37
-
38
-
39
-
40
-
41
- # [1.0.0](https://github.com/azu/kvs/compare/v0.3.1...v1.0.0) (2020-08-22)
42
-
43
- **Note:** Version bump only for package @kvs/node-localstorage
44
-
45
-
46
-
47
-
48
-
49
- # [0.3.0](https://github.com/azu/kvs/compare/v0.2.1...v0.3.0) (2020-08-22)
50
-
51
- **Note:** Version bump only for package @kvs/node-localstorage
52
-
53
-
54
-
55
-
56
-
57
- ## [0.2.1](https://github.com/azu/kvs/compare/v0.2.0...v0.2.1) (2020-08-22)
58
-
59
- **Note:** Version bump only for package @kvs/node-localstorage
60
-
61
-
62
-
63
-
64
-
65
- # [0.2.0](https://github.com/azu/kvs/compare/v0.1.0...v0.2.0) (2020-08-08)
66
-
67
-
68
- ### Features
69
-
70
- * **@kvs/env:** migrate Schema Type ([0951d08](https://github.com/azu/kvs/commit/0951d08405d42588454878a03c9082961ad0c363))
71
-
72
-
73
-
74
-
75
-
76
- # 0.1.0 (2020-08-08)
77
-
78
-
79
- ### Features
80
-
81
- * **@kvs/node-localstorage:** add node implementation ([5160012](https://github.com/azu/kvs/commit/516001286c96ac85cb54d55fbba62549d6d7eb0e))