-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
Status: TriageThis is being looked at and prioritizedThis is being looked at and prioritizedType: BugSomething isn't working as documented, or is being fixedSomething isn't working as documented, or is being fixed
Description
What happened?
It's currently not possible to use a custom cache that returns no value, because there might be no value yet stored for the key. The return type is expected to be string.
Current type:
export type Cache = Lru<string> | {
get: (key: string) => string | Promise<string>;
set: (key: string, value: string) => any;
};
Simple cache implementation with map:
const cache = new Map<string, string>();
const result = createAppAuth({
appId,
privateKey,
installationId,
cache: {
get(key: string) {
// This causes a type error, even if the current implementation just checks for the cache with cache.get(key) and then checking if with if(!cache) return
return cache.get(key);
},
set(key: string, value: string) {
cache.set(key, value);
},
}
})
Versions
octokit
5.0.3@octokit/auth-app
8.1.0- NodeJS v22.15.1
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Status: TriageThis is being looked at and prioritizedThis is being looked at and prioritizedType: BugSomething isn't working as documented, or is being fixedSomething isn't working as documented, or is being fixed
Type
Projects
Status
🆕 Triage