Skip to content

Commit

Permalink
add node 20 to ci, workarounds for ts-node loader failing on node 20
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Apr 27, 2023
1 parent 7d51bb3 commit df2451d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
strategy:
matrix:
node-version: [16.x, 18.x, 19.x]
node-version: [16.x, 18.x, 20.x]
platform:
- os: ubuntu-latest
shell: bash
Expand Down
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
"prettier": "^2.6.2",
"size-limit": "^7.0.8",
"tap": "^16.3.4",
"ts-node": "^10.7.0",
"ts-node": "^10.9.1",
"tslib": "^2.4.0",
"typedoc": "^0.23.24",
"typescript": "^4.6.4"
"typedoc": "^0.24.6",
"typescript": "^5.0.4"
},
"license": "ISC",
"files": [
Expand All @@ -95,9 +95,8 @@
"coverage": false,
"node-arg": [
"--expose-gc",
"--no-warnings",
"--loader",
"ts-node/esm"
"-r",
"ts-node/register"
],
"ts": false
},
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ export namespace LRUCache {
* Options provided to {@link LRUCache#fetch} when the FC type is
* `undefined` or `void`
*/
export interface FetchOptionsNoContext<K, V, FC>
extends FetchOptions<K, V, FC> {
export interface FetchOptionsNoContext<K, V>
extends FetchOptions<K, V, undefined> {
context?: undefined
}

Expand Down Expand Up @@ -1994,7 +1994,7 @@ export class LRUCache<K extends {}, V extends {}, FC = unknown> {
fetchOptions: unknown extends FC
? LRUCache.FetchOptions<K, V, FC>
: FC extends undefined | void
? LRUCache.FetchOptionsNoContext<K, V, FC>
? LRUCache.FetchOptionsNoContext<K, V>
: LRUCache.FetchOptionsWithContext<K, V, FC>
): Promise<void | V>
// this overload not allowed if context is required
Expand All @@ -2007,7 +2007,7 @@ export class LRUCache<K extends {}, V extends {}, FC = unknown> {
fetchOptions?: unknown extends FC
? LRUCache.FetchOptions<K, V, FC>
: FC extends undefined | void
? LRUCache.FetchOptionsNoContext<K, V, FC>
? LRUCache.FetchOptionsNoContext<K, V>
: never
): Promise<void | V>
async fetch(
Expand Down
1 change: 0 additions & 1 deletion tsconfig-base.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"exclude": ["./test", "./tap-snapshots"],
"include": ["src/**/*.ts"],
"compilerOptions": {
"allowSyntheticDefaultImports": true,
Expand Down

0 comments on commit df2451d

Please sign in to comment.