@kvs/memorystorage 2.0.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/lib/index.js +6 -12
- package/lib/index.js.map +1 -1
- package/module/index.js +6 -12
- package/module/index.js.map +1 -1
- package/package.json +3 -3
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
|
};
|
|
@@ -17,8 +8,11 @@ const storage_1 = require("@kvs/storage");
|
|
|
17
8
|
// @ts-ignore
|
|
18
9
|
// import localstorage from "localstorage-memory";
|
|
19
10
|
const localstorage_memory_1 = __importDefault(require("./localstorage-memory"));
|
|
20
|
-
const kvsMemoryStorage = (options) =>
|
|
21
|
-
return (0, storage_1.kvsStorage)(
|
|
22
|
-
|
|
11
|
+
const kvsMemoryStorage = async (options) => {
|
|
12
|
+
return (0, storage_1.kvsStorage)({
|
|
13
|
+
...options,
|
|
14
|
+
storage: localstorage_memory_1.default
|
|
15
|
+
});
|
|
16
|
+
};
|
|
23
17
|
exports.kvsMemoryStorage = kvsMemoryStorage;
|
|
24
18
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAiE;AAEjE,aAAa;AACb,kDAAkD;AAClD,gFAAiD;AAS1C,MAAM,gBAAgB,GAAG,KAAK,EACjC,OAAwC,EACb,EAAE;IAC7B,OAAO,IAAA,oBAAU,EAAC;QACd,GAAG,OAAO;QACV,OAAO,EAAE,6BAAY;KACxB,CAAC,CAAC;AACP,CAAC,CAAC;AAPW,QAAA,gBAAgB,oBAO3B"}
|
package/module/index.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
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 { kvsStorage } from "@kvs/storage";
|
|
11
2
|
// @ts-ignore
|
|
12
3
|
// import localstorage from "localstorage-memory";
|
|
13
4
|
import localstorage from "./localstorage-memory";
|
|
14
|
-
export const kvsMemoryStorage = (options) =>
|
|
15
|
-
return kvsStorage(
|
|
16
|
-
|
|
5
|
+
export const kvsMemoryStorage = async (options) => {
|
|
6
|
+
return kvsStorage({
|
|
7
|
+
...options,
|
|
8
|
+
storage: localstorage
|
|
9
|
+
});
|
|
10
|
+
};
|
|
17
11
|
//# sourceMappingURL=index.js.map
|
package/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,UAAU,EAAE,MAAM,cAAc,CAAC;AAEjE,aAAa;AACb,kDAAkD;AAClD,OAAO,YAAY,MAAM,uBAAuB,CAAC;AASjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EACjC,OAAwC,EACb,EAAE;IAC7B,OAAO,UAAU,CAAC;QACd,GAAG,OAAO;QACV,OAAO,EAAE,YAAY;KACxB,CAAC,CAAC;AACP,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kvs/memorystorage",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Node.js localstorage for KVS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kvs",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@jsdevtools/karma-config": "^3.1.7",
|
|
49
|
-
"@kvs/common-test-case": "^2.
|
|
49
|
+
"@kvs/common-test-case": "^2.1.0",
|
|
50
50
|
"@types/mocha": "^9.0.0",
|
|
51
51
|
"@types/node": "^16.9.1",
|
|
52
52
|
"mocha": "^9.1.1",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "ac9e606e7952f1fd69b2bbf27671d068cb71ade8"
|
|
62
62
|
}
|