Skip to content

Commit

Permalink
chore(deps): bump lru-cache from 8.0.5 to 9.0.0 (#197)
Browse files Browse the repository at this point in the history
* chore(deps): bump lru-cache from 8.0.5 to 9.0.0

Bumps [lru-cache](https://github.com/isaacs/node-lru-cache) from 8.0.5 to 9.0.0.
- [Release notes](https://github.com/isaacs/node-lru-cache/releases)
- [Changelog](https://github.com/isaacs/node-lru-cache/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-lru-cache@v8.0.5...v9.0.0)

---
updated-dependencies:
- dependency-name: lru-cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: replace lru-cache default import with named import

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michal Sevcik <sevcik.dev@gmail.com>
  • Loading branch information
dependabot[bot] and MelkorNemesis committed Apr 11, 2023
1 parent d3d40dd commit 2210fff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"homepage": "https://github.com/nearform/get-jwks#readme",
"dependencies": {
"jwk-to-pem": "^2.0.4",
"lru-cache": "^8.0.0",
"lru-cache": "^9.0.0",
"node-fetch": "^2.6.1"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/get-jwks.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import LRU from 'lru-cache'
import type { LRUCache } from 'lru-cache'
import type { Agent } from 'https'

type JWKSignature = { domain: string; alg: string; kid: string }
Expand All @@ -23,8 +23,8 @@ type GetJwks = {
getPublicKey: (options?: GetPublicKeyOptions) => Promise<string>
getJwk: (signature: JWKSignature) => Promise<JWK>
getJwksUri: (normalizedDomain: string) => Promise<string>
cache: LRU<string, JWK>
staleCache: LRU<string, JWK>
cache: LRUCache<string, JWK>
staleCache: LRUCache<string, JWK>
}

export default function buildGetJwks(options?: GetJwksOptions): GetJwks
6 changes: 3 additions & 3 deletions src/get-jwks.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const fetch = require('node-fetch')
const LRU = require('lru-cache')
const { LRUCache } = require('lru-cache')
const jwkToPem = require('jwk-to-pem')

const { errorCode, GetJwksError } = require('./error')
Expand All @@ -23,8 +23,8 @@ function buildGetJwks(options = {}) {
? ensureNoLeadingSlash(options.jwksPath)
: false
const agent = options.agent || null
const staleCache = new LRU({ max: max * 2, ttl })
const cache = new LRU({
const staleCache = new LRUCache({ max: max * 2, ttl })
const cache = new LRUCache({
max,
ttl,
dispose: (value, key) => staleCache.set(key, value),
Expand Down
6 changes: 3 additions & 3 deletions test/types/get-jwks.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { expectAssignable } from 'tsd'
import LRU from 'lru-cache'
import type { LRUCache } from 'lru-cache'
import buildGetJwks, { GetPublicKeyOptions, JWK, JWKSignature } from '../../src/get-jwks'

const { getPublicKey, getJwk, getJwksUri, cache, staleCache } = buildGetJwks()

expectAssignable<(signature: JWKSignature) => Promise<JWK>>(getJwk)
expectAssignable<(normalizedDomain: string) => Promise<string>>(getJwksUri)
expectAssignable<(options?: GetPublicKeyOptions) => Promise<string>>(getPublicKey)
expectAssignable<LRU<string, JWK>>(cache)
expectAssignable<LRU<string, JWK>>(staleCache)
expectAssignable<LRUCache<string, JWK>>(cache)
expectAssignable<LRUCache<string, JWK>>(staleCache)

0 comments on commit 2210fff

Please sign in to comment.