-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Labels
Status: Needs infoFull requirements are not yet known, so implementation should not be startedFull requirements are not yet known, so implementation should not be startedType: BugSomething isn't working as documentedSomething isn't working as documentedreleased
Description
Hey there.
When running await paginate(...) on apps.listReposAccessibleToInstallation, the TypeScript inferred data type is not correct.
// context is an Octokit with an installation.id
const repos = await context.paginate(context.apps.listReposAccessibleToInstallation, {
per_page: 100,
});
// TypeScript compiler/VSCode sees `repos` as:
// {
// total_count: number,
// repositories: { id: number, /*...*/ }[ ],
// repository_selection: ?string
// }But really at runtime it contains repositories data array:
console.log(repos)
// [
// { id: 123, /*...*/ },
// { id: 456, /*...*/ }
// ]Workaround
// FIXME: Have been doing this as a workaround.
const installationRepos = repos.repositories ?? repos;
installationRepos.forEach(/*...*/);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: Needs infoFull requirements are not yet known, so implementation should not be startedFull requirements are not yet known, so implementation should not be startedType: BugSomething isn't working as documentedSomething isn't working as documentedreleased
Type
Projects
Status
✅ Done