@anchan828/nest-redlock 0.1.6 → 0.1.7

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.
@@ -28,14 +28,15 @@ function Redlock(key, duration, settings = {}) {
28
28
  }
29
29
  exports.Redlock = Redlock;
30
30
  function getKeys(key, descriptorThis, args) {
31
+ const keys = new Set();
31
32
  if (typeof key === "string") {
32
- return [key];
33
+ keys.add(key);
33
34
  }
34
35
  else if (Array.isArray(key)) {
35
- return key;
36
+ key.forEach((k) => keys.add(k));
36
37
  }
37
38
  else if (typeof key === "function") {
38
- return [key(descriptorThis, ...args)].flat();
39
+ [key(descriptorThis, ...args)].flat().forEach((k) => keys.add(k));
39
40
  }
40
- return [];
41
+ return Array.from(keys);
41
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anchan828/nest-redlock",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "This is a [Nest](https://github.com/nestjs/nest) implementation of the redlock algorithm for distributed redis locks.",
5
5
  "homepage": "https://github.com/anchan828/nest-redlock#readme",
6
6
  "bugs": {
@@ -33,16 +33,16 @@
33
33
  "@nestjs/platform-express": "^9.1.4",
34
34
  "@nestjs/testing": "^9.1.4",
35
35
  "@types/jest": "^29.1.2",
36
- "@types/node": "^18.8.3",
36
+ "@types/node": "^18.11.0",
37
37
  "@types/supertest": "^2.0.12",
38
- "@typescript-eslint/eslint-plugin": "^5.39.0",
39
- "@typescript-eslint/parser": "^5.39.0",
38
+ "@typescript-eslint/eslint-plugin": "^5.40.0",
39
+ "@typescript-eslint/parser": "^5.40.0",
40
40
  "eslint": "^8.25.0",
41
41
  "eslint-config-prettier": "^8.5.0",
42
42
  "eslint-plugin-prettier": "^4.2.1",
43
43
  "husky": "^8.0.1",
44
44
  "ioredis": "^5.2.3",
45
- "jest": "^29.1.2",
45
+ "jest": "^29.2.0",
46
46
  "lint-staged": "^13.0.3",
47
47
  "prettier": "^2.7.1",
48
48
  "reflect-metadata": "^0.1.13",