Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: octokit/plugin-paginate-rest.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v11.3.4
Choose a base ref
Loading
...
head repository: octokit/plugin-paginate-rest.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v11.3.5
Choose a head ref
Loading
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Sep 29, 2024

  1. fix(types): improve type extraction for namespaced responses and corr…

    …ect async iterator types (#637)
    
    The `iterator()` function returns an object containing a key of `Symbol.asyncIterator`, which is an object with a `next()` function. Only the top-level has the `Symbol.asyncIterator`, and the `next()` function is not present at the top-level
    
    The `GetResultsType<T>` sometimes doesn't return the paginated data and returns the whole data object. For some reason TypeScript sometimes get's confused and returns all the keys in the object in the call `KnownKeysMatching<T["data"], any[]>`
    In order to remedy that, we remove keys that we know do not contain the data (`"repository_selection" | "total_count" | "incomplete_results"`) and we then always get the data.
    
    The `NormalizeResponse<T>` type would return the intersection of the original data from the request and the paginated data. To remedy that, we use `Omit<T, K>` to remove the `data` from the request data and only return the paginated data instead.
    wolfy1339 authored Sep 29, 2024
    Configuration menu
    Copy the full SHA
    e95444d View commit details
    Browse the repository at this point in the history
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.