Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow explicitly unsetting hooks on .extend() #599

Merged

Commits on Jun 25, 2024

  1. feat: allow explicitly unsetting hooks on .extend()

    The implementation here is pretty simple: just give hook merging some custom
    logic so it either merges OR resets to an empty array. Matches what was
    discussed in the related ticket.
    
    Documentation has been updated to describe this behavior as well.
    
    The dedicated test is just a modified copy of the existing `ky.extend()` one.
    Admittedly, I did modify a couple of other tests to cover the edge cases
    instead of building brand new tests. No reason other than noticing they were
    already close to what I needed and I'm being lazy.
    
    Closes #408
    Kenneth-Sills committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    ac3f1f8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7947d02 View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2024

  1. Merge branch 'main' of https://github.com/Kenneth-Sills/ky-customizab…

    …le-retry-after-statuses into kesills-better-extend-hooks
    
    Manual resolutions required:
    
    - Conflicts between my updated `extend()` tests in `test/main.ts`
      and the tests added with the new function form of `extend()`. Resolved by
      accepting their modified base test and just adding my changes, then putting my
      new `extend()` test below all their new cases.
    - Trivial resolution for import formatting in `source/core/Ky.ts`.
    - A change to `newHookValue` in `source/utils/merge.ts`, using
      `Object.hasOwn` per the linter's suggestion.
    Kenneth-Sills committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    ca1ca72 View commit details
    Browse the repository at this point in the history