@kvs/node-localstorage 2.1.3 → 2.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/lib/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { JsonValue, KvsStorage } from "@kvs/storage";
2
2
  import { KVS, KVSOptions } from "@kvs/types";
3
- export declare type KvsLocalStorageSchema = {
3
+ export type KvsLocalStorageSchema = {
4
4
  [index: string]: JsonValue;
5
5
  };
6
- export declare type KvsLocalStorage<Schema extends KvsLocalStorageSchema> = KVS<Schema>;
7
- export declare type KvsLocalStorageOptions<Schema extends KvsLocalStorageSchema> = KVSOptions<Schema> & {
6
+ export type KvsLocalStorage<Schema extends KvsLocalStorageSchema> = KVS<Schema>;
7
+ export type KvsLocalStorageOptions<Schema extends KvsLocalStorageSchema> = KVSOptions<Schema> & {
8
8
  kvsVersionKey?: string;
9
9
  storeFilePath?: string;
10
10
  };
package/lib/index.js CHANGED
@@ -6,16 +6,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.kvsLocalStorage = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const storage_1 = require("@kvs/storage");
9
+ const promises_1 = __importDefault(require("node:fs/promises"));
9
10
  // @ts-ignore
10
11
  const node_localstorage_1 = require("node-localstorage");
11
12
  // @ts-ignore
12
13
  const app_root_path_1 = __importDefault(require("app-root-path"));
13
- // @ts-ignore
14
- const mkdirp_1 = __importDefault(require("mkdirp"));
15
14
  const kvsLocalStorage = async (options) => {
16
15
  const defaultCacheDir = path_1.default.join(app_root_path_1.default.toString(), ".cache");
17
16
  if (!options.storeFilePath) {
18
- await (0, mkdirp_1.default)(defaultCacheDir);
17
+ await promises_1.default.mkdir(defaultCacheDir, {
18
+ recursive: true
19
+ });
19
20
  }
20
21
  const saveFilePath = options.storeFilePath
21
22
  ? options.storeFilePath
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,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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,0CAAiE;AAEjE,gEAAkC;AAClC,aAAa;AACb,yDAAiD;AACjD,aAAa;AACb,kEAAoC;AAU7B,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,kBAAE,CAAC,KAAK,CAAC,eAAe,EAAE;YAC5B,SAAS,EAAE,IAAI;SAClB,CAAC,CAAC;KACN;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;AAhBW,QAAA,eAAe,mBAgB1B"}
package/module/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { JsonValue, KvsStorage } from "@kvs/storage";
2
2
  import { KVS, KVSOptions } from "@kvs/types";
3
- export declare type KvsLocalStorageSchema = {
3
+ export type KvsLocalStorageSchema = {
4
4
  [index: string]: JsonValue;
5
5
  };
6
- export declare type KvsLocalStorage<Schema extends KvsLocalStorageSchema> = KVS<Schema>;
7
- export declare type KvsLocalStorageOptions<Schema extends KvsLocalStorageSchema> = KVSOptions<Schema> & {
6
+ export type KvsLocalStorage<Schema extends KvsLocalStorageSchema> = KVS<Schema>;
7
+ export type KvsLocalStorageOptions<Schema extends KvsLocalStorageSchema> = KVSOptions<Schema> & {
8
8
  kvsVersionKey?: string;
9
9
  storeFilePath?: string;
10
10
  };
package/module/index.js CHANGED
@@ -1,15 +1,16 @@
1
1
  import path from "path";
2
2
  import { kvsStorage } from "@kvs/storage";
3
+ import fs from "node:fs/promises";
3
4
  // @ts-ignore
4
5
  import { LocalStorage } from "node-localstorage";
5
6
  // @ts-ignore
6
7
  import appRoot from "app-root-path";
7
- // @ts-ignore
8
- import mkdirp from "mkdirp";
9
8
  export const kvsLocalStorage = async (options) => {
10
9
  const defaultCacheDir = path.join(appRoot.toString(), ".cache");
11
10
  if (!options.storeFilePath) {
12
- await mkdirp(defaultCacheDir);
11
+ await fs.mkdir(defaultCacheDir, {
12
+ recursive: true
13
+ });
13
14
  }
14
15
  const saveFilePath = options.storeFilePath
15
16
  ? options.storeFilePath
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.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AE,EAAE,QAAQ,CAAC,CAAC;IAChE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;QACxB,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE;YAC5B,SAAS,EAAE,IAAI;SAClB,CAAC,CAAC;KACN;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": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "Node.js localstorage for KVS.",
5
5
  "keywords": [
6
6
  "kvs",
@@ -45,24 +45,22 @@
45
45
  "trailingComma": "none"
46
46
  },
47
47
  "dependencies": {
48
- "@kvs/storage": "^2.1.3",
49
- "app-root-path": "^3.0.0",
50
- "mkdirp": "^1.0.4",
48
+ "@kvs/storage": "^2.1.4",
49
+ "app-root-path": "^3.1.0",
51
50
  "node-localstorage": "^2.1.6"
52
51
  },
53
52
  "devDependencies": {
54
- "@jsdevtools/karma-config": "^3.1.7",
55
- "@kvs/common-test-case": "^2.1.3",
56
- "@types/mocha": "^9.0.0",
57
- "@types/node": "^16.9.1",
58
- "mocha": "^9.1.1",
59
- "prettier": "^2.0.5",
60
- "rimraf": "^3.0.2",
61
- "ts-loader": "^8.2.0",
62
- "typescript": "^4.2.4"
53
+ "@kvs/common-test-case": "^2.1.4",
54
+ "@types/mocha": "^10.0.1",
55
+ "@types/node": "^20.4.2",
56
+ "mocha": "^10.2.0",
57
+ "prettier": "^3.0.0",
58
+ "rimraf": "^5.0.1",
59
+ "ts-loader": "^9.4.4",
60
+ "typescript": "^5.1.6"
63
61
  },
64
62
  "publishConfig": {
65
63
  "access": "public"
66
64
  },
67
- "gitHead": "85b5649aa83c332a644a356c210037cadd073943"
65
+ "gitHead": "bd85ca1e2b31c32bcf52f780727f971db115aab7"
68
66
  }