@kvs/node-localstorage 2.1.3 → 2.1.4
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 +3 -3
- package/lib/index.js +2 -3
- package/lib/index.js.map +1 -1
- package/module/index.d.ts +3 -3
- package/module/index.js +1 -2
- package/module/index.js.map +1 -1
- package/package.json +13 -14
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
|
|
3
|
+
export type KvsLocalStorageSchema = {
|
|
4
4
|
[index: string]: JsonValue;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
7
|
-
export
|
|
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
|
@@ -10,12 +10,11 @@ const storage_1 = require("@kvs/storage");
|
|
|
10
10
|
const node_localstorage_1 = require("node-localstorage");
|
|
11
11
|
// @ts-ignore
|
|
12
12
|
const app_root_path_1 = __importDefault(require("app-root-path"));
|
|
13
|
-
|
|
14
|
-
const mkdirp_1 = __importDefault(require("mkdirp"));
|
|
13
|
+
const mkdirp_1 = 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.
|
|
17
|
+
await (0, mkdirp_1.mkdirp)(defaultCacheDir);
|
|
19
18
|
}
|
|
20
19
|
const saveFilePath = options.storeFilePath
|
|
21
20
|
? 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,
|
|
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,mCAAgC;AAUzB,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,eAAM,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.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
|
|
3
|
+
export type KvsLocalStorageSchema = {
|
|
4
4
|
[index: string]: JsonValue;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
7
|
-
export
|
|
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
|
@@ -4,8 +4,7 @@ import { kvsStorage } from "@kvs/storage";
|
|
|
4
4
|
import { LocalStorage } from "node-localstorage";
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
import appRoot from "app-root-path";
|
|
7
|
-
|
|
8
|
-
import mkdirp from "mkdirp";
|
|
7
|
+
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) {
|
package/module/index.js.map
CHANGED
|
@@ -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,
|
|
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,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAUhC,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": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"description": "Node.js localstorage for KVS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kvs",
|
|
@@ -45,24 +45,23 @@
|
|
|
45
45
|
"trailingComma": "none"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@kvs/storage": "^2.1.
|
|
49
|
-
"app-root-path": "^3.
|
|
50
|
-
"mkdirp": "^
|
|
48
|
+
"@kvs/storage": "^2.1.4",
|
|
49
|
+
"app-root-path": "^3.1.0",
|
|
50
|
+
"mkdirp": "^3.0.1",
|
|
51
51
|
"node-localstorage": "^2.1.6"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@types/
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"typescript": "^4.2.4"
|
|
54
|
+
"@kvs/common-test-case": "^2.1.4",
|
|
55
|
+
"@types/mocha": "^10.0.1",
|
|
56
|
+
"@types/node": "^20.4.2",
|
|
57
|
+
"mocha": "^10.2.0",
|
|
58
|
+
"prettier": "^3.0.0",
|
|
59
|
+
"rimraf": "^5.0.1",
|
|
60
|
+
"ts-loader": "^9.4.4",
|
|
61
|
+
"typescript": "^5.1.6"
|
|
63
62
|
},
|
|
64
63
|
"publishConfig": {
|
|
65
64
|
"access": "public"
|
|
66
65
|
},
|
|
67
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "d7a5ac9d3c859cceaa75711916bc6bb4e6cd61be"
|
|
68
67
|
}
|