@tomsd/redis-client 1.0.1 → 1.0.3
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 +13 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/package.json +28 -28
package/README.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
It's a wrapper of [ioredis](https://www.npmjs.com/package/ioredis).
|
|
4
4
|
See [redis-client.netlify.app](https://redis-client.netlify.app/) also.
|
|
5
5
|
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+
|
|
11
|
+

|
|
12
|
+

|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
|
|
6
19
|
## Installation
|
|
7
20
|
|
|
8
21
|
``` shell
|
package/dist/cjs/index.js
CHANGED
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -27,8 +27,8 @@ export class Redis {
|
|
|
27
27
|
return this.redis;
|
|
28
28
|
}
|
|
29
29
|
getKeys() {
|
|
30
|
-
var _a, _b, _c;
|
|
31
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
var _a, _b, _c;
|
|
32
32
|
const keyFilter = `${(_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.keyPrefix) !== null && _c !== void 0 ? _c : ""}*`;
|
|
33
33
|
const sliceKey = (s) => { var _a, _b, _c, _d; return s.slice((_d = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.keyPrefix) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0); };
|
|
34
34
|
return yield this.getRedis()
|
|
@@ -53,7 +53,7 @@ export class Redis {
|
|
|
53
53
|
const redis = this.getRedis();
|
|
54
54
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
55
55
|
const savingObj = Object.assign({ [this.keyProp]: uuid() }, value);
|
|
56
|
-
// @ts-expect-error
|
|
56
|
+
// @ts-expect-error prop name
|
|
57
57
|
const key = savingObj[this.keyProp];
|
|
58
58
|
return this.expireSeconds !== undefined
|
|
59
59
|
? yield redis
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomsd/redis-client",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "It's a wrapper of
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "It's a wrapper of ioredis.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/esm/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
8
11
|
"scripts": {
|
|
9
12
|
"build": "tsc --project tsconfig.cjs.json && tsc --project tsconfig.esm.json",
|
|
10
13
|
"format": "npm run format:src && npm run format:test",
|
|
@@ -13,11 +16,9 @@
|
|
|
13
16
|
"lint": "npm run lint:src && npm run lint:test",
|
|
14
17
|
"lint:src": "eslint src/**/*.ts",
|
|
15
18
|
"lint:test": "eslint __test__/**/*.ts",
|
|
16
|
-
"prepare": "husky
|
|
17
|
-
"start-redis": "
|
|
18
|
-
"
|
|
19
|
-
"serve-redis": "docker run --name redis-alpine-instance -p 6379:6379 --rm -d redis-alpine-image:v1.0.0",
|
|
20
|
-
"stop-redis": "docker container stop redis-alpine-instance",
|
|
19
|
+
"prepare": "husky",
|
|
20
|
+
"start-redis": "docker run --rm -d -p 6379:6379 --name redis-instance redis:alpine",
|
|
21
|
+
"stop-redis": "docker container stop redis-instance",
|
|
21
22
|
"serve:doc": "mdbook --serve --directory docs",
|
|
22
23
|
"test": "jest"
|
|
23
24
|
},
|
|
@@ -45,28 +46,27 @@
|
|
|
45
46
|
},
|
|
46
47
|
"homepage": "https://github.com/tomsdoo/redis-client#readme",
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@babel/core": "
|
|
49
|
-
"@babel/preset-env": "
|
|
50
|
-
"@babel/preset-typescript": "
|
|
51
|
-
"@tomsd/md-book": "
|
|
52
|
-
"@types/uuid": "
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "
|
|
54
|
-
"babel-jest": "
|
|
55
|
-
"eslint": "
|
|
56
|
-
"eslint-config-prettier": "
|
|
57
|
-
"eslint-
|
|
58
|
-
"eslint-plugin-
|
|
59
|
-
"eslint-plugin-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"typescript": "^4.9.4"
|
|
49
|
+
"@babel/core": "7.26.0",
|
|
50
|
+
"@babel/preset-env": "7.26.0",
|
|
51
|
+
"@babel/preset-typescript": "7.26.0",
|
|
52
|
+
"@tomsd/md-book": "1.3.3",
|
|
53
|
+
"@types/uuid": "10.0.0",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "8.16.0",
|
|
55
|
+
"babel-jest": "29.7.0",
|
|
56
|
+
"eslint": "8.57.1",
|
|
57
|
+
"eslint-config-prettier": "9.1.0",
|
|
58
|
+
"eslint-plugin-import": "2.31.0",
|
|
59
|
+
"eslint-plugin-n": "17.14.0",
|
|
60
|
+
"eslint-plugin-promise": "7.2.1",
|
|
61
|
+
"husky": "9.1.7",
|
|
62
|
+
"jest": "29.7.0",
|
|
63
|
+
"lint-staged": "15.2.10",
|
|
64
|
+
"prettier": "3.4.1",
|
|
65
|
+
"ts-node": "10.9.2",
|
|
66
|
+
"typescript": "5.7.2"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"ioredis": "
|
|
70
|
-
"uuid": "
|
|
69
|
+
"ioredis": "5.4.1",
|
|
70
|
+
"uuid": "11.0.3"
|
|
71
71
|
}
|
|
72
72
|
}
|