forked from dotansimha/graphql-yoga
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update LRU Cache package (dotansimha#2801)
* Update LRU Cache * chore(dependencies): updated changesets for modified dependencies --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
7bb2703
commit 6f83c0c
Showing
10 changed files
with
35 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@graphql-yoga/plugin-apq': patch | ||
--- | ||
dependencies updates: | ||
- Removed dependency [`lru-cache@^7.14.1` ↗︎](https://www.npmjs.com/package/lru-cache/v/7.14.1) (from `dependencies`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'graphql-yoga': patch | ||
--- | ||
dependencies updates: | ||
- Updated dependency [`lru-cache@^9.0.0` ↗︎](https://www.npmjs.com/package/lru-cache/v/9.0.0) (from `^7.14.1`, in `dependencies`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,6 @@ | |
"@whatwg-node/events": "npm:@whatwg-node/[email protected]", | ||
"@whatwg-node/server": "npm:@whatwg-node/server", | ||
"@repeaterjs/repeater": "npm:@repeaterjs/repeater", | ||
"lru-cache": "npm:lru-cache@^7.14.1" | ||
"lru-cache": "npm:lru-cache@^9.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
import LRU from 'lru-cache' | ||
/* eslint-disable @typescript-eslint/ban-types */ | ||
import { LRUCache as LRU } from 'lru-cache' | ||
|
||
const DEFAULT_MAX = 1024 | ||
const DEFAULT_TTL = 3_600_000 | ||
|
||
export function createLRUCache<T>() { | ||
return new LRU<string, T>({ max: DEFAULT_MAX, ttl: DEFAULT_TTL }) | ||
export type LRUCache<T extends {}> = LRU<string, T> | ||
export interface LRUCacheOptions { | ||
max?: number | ||
ttl?: number | ||
} | ||
|
||
export function createLRUCache<T extends {}>({ | ||
max = DEFAULT_MAX, | ||
ttl = DEFAULT_TTL, | ||
}: LRUCacheOptions = {}) { | ||
return new LRU<string, T>({ max, ttl }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.