diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index 4023bbf..4696ebc 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -28,19 +28,19 @@ jobs: name: Node ${{ matrix.node-version }} on ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' - name: Install Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} # cache: 'pnpm' - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: - version: 8 + version: 9 - name: Install dependencies run: pnpm install --ignore-scripts diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index dad2f18..dd68e61 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -18,21 +18,21 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' - name: Install Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 20 registry-url: https://registry.npmjs.com - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 name: Install pnpm id: pnpm-install with: - version: 8 + version: 9 run_install: false - name: Get pnpm store directory diff --git a/src/common/lib/LRUCache.ts b/src/common/lib/LRUCache.ts index 1a156b3..36dede6 100644 --- a/src/common/lib/LRUCache.ts +++ b/src/common/lib/LRUCache.ts @@ -1,5 +1,5 @@ // @see https://www.npmjs.com/package/lru-cache - +type DisposeReason = 'set' | 'delete' | 'evict' | 'expired'; export interface LRUCacheOptions { /** The maximum number of items that remain in the cache. default 500 */ max?: number; @@ -7,7 +7,7 @@ export interface LRUCacheOptions { ttl?: number; updateAgeOnGet?: boolean; /** Function that is called on items when they are dropped from the cache */ - dispose?(val: LRUCacheItem, key: K, reason: string): void; + dispose?(val: LRUCacheItem, key: K, reason: DisposeReason): void; } interface LRUCacheItem { @@ -65,7 +65,7 @@ export class LRUCache { return value.v as T; } /** Deletes a key out of the cache */ - delete(key: K, reason = 'delete') { + delete(key: K, reason: DisposeReason = 'delete') { if (!this.cache.has(key)) return false; const val = this.cache.get(key); this.cache.delete(key);