From 00ee00bc03524c3214deb415dc2515bfb11ab28b Mon Sep 17 00:00:00 2001 From: infloop Date: Sun, 23 Jul 2023 21:58:23 +0500 Subject: [PATCH] feat: add glob types, specify base for int parsing --- package.json | 5 +++-- src/cache/cache.service.ts | 2 +- yarn.lock | 13 +++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c6971965..566bbc60 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lido-council-daemon", - "version": "1.8.2", + "version": "1.9.1", "description": "Lido Council Daemon", "author": "Lido team", "private": true, @@ -65,6 +65,7 @@ "@typechain/ethers-v5": "^7.1.2", "@types/app-root-path": "^1.2.4", "@types/cache-manager": "^3.4.3", + "@types/glob": "^8.1.0", "@types/jest": "^27.0.1", "@types/kafkajs": "^1.9.0", "@types/node": "^16.0.0", @@ -107,4 +108,4 @@ "coverageDirectory": "../coverage", "testEnvironment": "node" } -} \ No newline at end of file +} diff --git a/src/cache/cache.service.ts b/src/cache/cache.service.ts index 4d8a86a0..9fd34331 100644 --- a/src/cache/cache.service.ts +++ b/src/cache/cache.service.ts @@ -63,7 +63,7 @@ export class CacheService< const result = await glob(`*([0-9]).${this.cacheFile}`, { cwd: dirPath }); return result - .sort((a, b) => parseInt(a) - parseInt(b)) + .sort((a, b) => parseInt(a, 10) - parseInt(b, 10)) .map((filePath) => join(dirPath, filePath)); } diff --git a/yarn.lock b/yarn.lock index 964ea2c7..6bc729c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1347,6 +1347,14 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== +"@types/glob@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-8.1.0.tgz#b63e70155391b0584dce44e7ea25190bbc38f2fc" + integrity sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w== + dependencies: + "@types/minimatch" "^5.1.2" + "@types/node" "*" + "@types/graceful-fs@^4.1.2": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" @@ -1403,6 +1411,11 @@ resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== +"@types/minimatch@^5.1.2": + version "5.1.2" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" + integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== + "@types/node-fetch@^2.5.12": version "2.6.2" resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz#d1a9c5fd049d9415dce61571557104dec3ec81da"