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

Add init hook #683

Merged
merged 7 commits into from
Jan 14, 2019
Merged

Conversation

szmarczak
Copy link
Collaborator

@szmarczak szmarczak commented Dec 22, 2018

Introduces a new hook: init. It gets called right before option normalization - very useful when you need to handle some things on your own.
For example, this fixes the jsonReplacer example in migration-guides.md.

Checklist

  • I have read the documentation.
  • I have included a pull request description of my changes.
  • I have included some tests.
  • If it's a new feature, I have included documentation updates.

@szmarczak szmarczak changed the title Before normalization hook Add init hook Dec 22, 2018
readme.md Outdated Show resolved Hide resolved
test/hooks.js Outdated Show resolved Hide resolved
migration-guides.md Outdated Show resolved Hide resolved
@szmarczak szmarczak force-pushed the before-normalization-hook branch from 98f2872 to ca26663 Compare January 11, 2019 19:19
source/normalize-arguments.js Outdated Show resolved Hide resolved
@sindresorhus sindresorhus merged commit 677d0a4 into sindresorhus:master Jan 14, 2019
Kikobeats pushed a commit to microlinkhq/unavatar that referenced this pull request Jan 17, 2019
## The dependency [got](https://github.com/sindresorhus/got) was updated from `9.5.1` to `9.6.0`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

---

<details>
<summary>Release Notes for v9.6.0</summary>

<ul>
<li>Add <code>init</code> hook (<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="393703177" data-permission-text="Issue title is private" data-url="sindresorhus/got#683" data-hovercard-type="pull_request" data-hovercard-url="/sindresorhus/got/pull/683/hovercard" href="https://urls.greenkeeper.io/sindresorhus/got/pull/683">#683</a>)  <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/sindresorhus/got/commit/677d0a479bd99c0cbcffdc5847038745dfa72bd1/hovercard" href="https://urls.greenkeeper.io/sindresorhus/got/commit/677d0a479bd99c0cbcffdc5847038745dfa72bd1"><tt>677d0a4</tt></a></li>
<li>Add <code>beforeError</code> hook (<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="398544251" data-permission-text="Issue title is private" data-url="sindresorhus/got#696" data-hovercard-type="pull_request" data-hovercard-url="/sindresorhus/got/pull/696/hovercard" href="https://urls.greenkeeper.io/sindresorhus/got/pull/696">#696</a>)  <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/sindresorhus/got/commit/29ffb44f6be951e1103bb076dadf2b0e5cbd62f1/hovercard" href="https://urls.greenkeeper.io/sindresorhus/got/commit/29ffb44f6be951e1103bb076dadf2b0e5cbd62f1"><tt>29ffb44</tt></a></li>
</ul>
<p><a class="commit-link" href="https://urls.greenkeeper.io/sindresorhus/got/compare/v9.5.1...v9.6.0"><tt>v9.5.1...v9.6.0</tt></a></p>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 4 commits.</p>
<ul>
<li><a href="https://urls.greenkeeper.io/sindresorhus/got/commit/a45e071e8dc5027ab9c7fad5919195501cd9e9ca"><code>a45e071</code></a> <code>9.6.0</code></li>
<li><a href="https://urls.greenkeeper.io/sindresorhus/got/commit/29ffb44f6be951e1103bb076dadf2b0e5cbd62f1"><code>29ffb44</code></a> <code>Add <code>beforeError</code> hook (#696)</code></li>
<li><a href="https://urls.greenkeeper.io/sindresorhus/got/commit/677d0a479bd99c0cbcffdc5847038745dfa72bd1"><code>677d0a4</code></a> <code>Add <code>init</code> hook (#683)</code></li>
<li><a href="https://urls.greenkeeper.io/sindresorhus/got/commit/e2d360211e2101ab966ee6617abe8f22881caf84"><code>e2d3602</code></a> <code>Bump XO</code></li>
</ul>
<p>See the <a href="https://urls.greenkeeper.io/sindresorhus/got/compare/6ce603e99a17d258751ddce23b1c9d424b7be795...a45e071e8dc5027ab9c7fad5919195501cd9e9ca">full diff</a></p>
</details>

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot 🌴
@szmarczak szmarczak deleted the before-normalization-hook branch January 17, 2019 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants