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

Fix typo #185

Merged
merged 1 commit into from
Mar 8, 2022
Merged

Fix typo #185

merged 1 commit into from
Mar 8, 2022

Conversation

jablko
Copy link
Contributor

@jablko jablko commented Mar 7, 2022

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and couldn’t find anything (or linked relevant results below)
  • If applicable, I’ve added docs and tests

Description of changes

#150 moved index.js -> lib/index.js and changed values[1] -> options[0]. options[1] is a typo?

     }
 
     while (++freezeIndex < attachers.length) {
-      const values = attachers[freezeIndex]
+      const [attacher, ...options] = attachers[freezeIndex]
 
-      if (values[1] === false) {
+      if (options[0] === false) {
         continue
       }
 
-      if (values[1] === true) {
-        values[1] = undefined
+      if (options[0] === true) {
+        options[1] = undefined
       }
 
-      const transformer = values[0].apply(processor, values.slice(1))
+      /** @type {Transformer|void} */
+      const transformer = attacher.call(processor, ...options)
 
       if (typeof transformer === 'function') {
         transformers.use(transformer)

@github-actions github-actions bot added the 👋 phase/new Post is being triaged automatically label Mar 7, 2022
@github-actions

This comment has been minimized.

@codecov-commenter

This comment was marked as resolved.

@github-actions github-actions bot added 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Mar 7, 2022
@wooorm
Copy link
Member

wooorm commented Mar 7, 2022

Probably a typo, yeah! Good catch!

@wooorm wooorm changed the title Typo Fix typo Mar 8, 2022
@wooorm wooorm merged commit dc85d21 into unifiedjs:main Mar 8, 2022
@github-actions

This comment has been minimized.

@wooorm wooorm added 🐛 type/bug This is a problem 👶 semver/patch This is a backwards-compatible fix 💪 phase/solved Post is done 🗄 area/interface This affects the public interface labels Mar 8, 2022
@github-actions github-actions bot removed the 🤞 phase/open Post is being triaged manually label Mar 8, 2022
@wooorm
Copy link
Member

wooorm commented Mar 8, 2022

Released, thanks!

kodiakhq bot referenced this pull request in X-oss-byte/Nextjs Oct 16, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [unified](https://unifiedjs.com) ([source](https://togithub.com/unifiedjs/unified)) | [`8.4.2` -> `11.0.3`](https://renovatebot.com/diffs/npm/unified/8.4.2/11.0.3) | [![age](https://developer.mend.io/api/mc/badges/age/npm/unified/11.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/unified/11.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/unified/8.4.2/11.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/unified/8.4.2/11.0.3?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>unifiedjs/unified (unified)</summary>

### [`v11.0.3`](https://togithub.com/unifiedjs/unified/releases/tag/11.0.3)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/11.0.2...11.0.3)

##### Fix

-   [`8dee2ab`](https://togithub.com/unifiedjs/unified/commit/8dee2ab) Fix support for functions in data

**Full Changelog**: unifiedjs/unified@11.0.2...11.0.3

### [`v11.0.2`](https://togithub.com/unifiedjs/unified/releases/tag/11.0.2)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/11.0.1...11.0.2)

-   [`cea788b`](https://togithub.com/unifiedjs/unified/commit/cea788b) Fix type of settings if nothing is registered yet

**Full Changelog**: unifiedjs/unified@11.0.1...11.0.2

### [`v11.0.1`](https://togithub.com/unifiedjs/unified/releases/tag/11.0.1)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/11.0.0...11.0.1)

-   [`d1a915d`](https://togithub.com/unifiedjs/unified/commit/d1a915d) Fix incorrect type of `settings` in presets

**Full Changelog**: unifiedjs/unified@11.0.0...11.0.1

### [`v11.0.0`](https://togithub.com/unifiedjs/unified/releases/tag/11.0.0)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/10.1.2...11.0.0)

##### Change

-   [`baf80b2`](https://togithub.com/unifiedjs/unified/commit/baf80b2) Change to require Node.js 16
    **migrate**: update too
-   [`dd9834a`](https://togithub.com/unifiedjs/unified/commit/dd9834a) Update `@types/unist`
    **migrate**: update too
-   [`620ccf9`](https://togithub.com/unifiedjs/unified/commit/620ccf9) Update [`vfile`](https://togithub.com/vfile/vfile/releases/tag/6.0.0)
    **migrate**: update too

##### Change (unlikey to affect you)

-   [`a44db46`](https://togithub.com/unifiedjs/unified/commit/a44db46) Add `Data`, `Settings` types to augment shared data
    **migrate**: if you deal with data, type it, see commit for info
-   [`fb49556`](https://togithub.com/unifiedjs/unified/commit/fb49556) Change to replace `Buffer` with `Uint8Array`
    **migrate**: you’re probably fine unless you use weird encodings, see commit for details if so
-   [`f3e71a8`](https://togithub.com/unifiedjs/unified/commit/f3e71a8) Remove `Attacher` type
    **migrate**: use `Plugin` instead
-   [`cc53bb6`](https://togithub.com/unifiedjs/unified/commit/cc53bb6) Remove `FrozenProcessor` type
    **migrate**: use `Processor` instead
-   [`1aa3494`](https://togithub.com/unifiedjs/unified/commit/1aa3494) Change to yield `undefined`, not `null`
    **migrate**: expect `undefined`
-   [`932c140`](https://togithub.com/unifiedjs/unified/commit/932c140) Change to use `exports`
    **migrate**: don’t use private APIs
-   [`8e57478`](https://togithub.com/unifiedjs/unified/commit/8e57478) Remove support for classes as compilers, parsers
    **migrate**: if you love classes, see commit message
-   [`4676814`](https://togithub.com/unifiedjs/unified/commit/4676814) Remove support for compilers returning nullish
    **migrate**: nobody did that
-   [`807ffb9`](https://togithub.com/unifiedjs/unified/commit/807ffb9) Add improved types
    **migrate**: it’s probably just better if anything changed at all
-   [`b35afe0`](https://togithub.com/unifiedjs/unified/commit/b35afe0) Add useful error on empty presets
    by [@&#8203;wooorm](https://togithub.com/wooorm) in [https://github.com/unifiedjs/unified/pull/202](https://togithub.com/unifiedjs/unified/pull/202)
-   [`6f068a0`](https://togithub.com/unifiedjs/unified/commit/6f068a0) Fix to deep clone preset settings
-   [`56ee288`](https://togithub.com/unifiedjs/unified/commit/56ee288) Fix non-first parameter merging when reconfiguring plugins

##### Misc

-   [`e58b095`](https://togithub.com/unifiedjs/unified/commit/e58b095) [`ad06700`](https://togithub.com/unifiedjs/unified/commit/ad06700) [`40f0329`](https://togithub.com/unifiedjs/unified/commit/40f0329) Refactor code-style
-   [`ffc146c`](https://togithub.com/unifiedjs/unified/commit/ffc146c) Update `typescript`
    by [@&#8203;ChristianMurphy](https://togithub.com/ChristianMurphy) in [https://github.com/unifiedjs/unified/pull/216](https://togithub.com/unifiedjs/unified/pull/216)
-   [`7148746`](https://togithub.com/unifiedjs/unified/commit/7148746) [`144eec0`](https://togithub.com/unifiedjs/unified/commit/144eec0) [`2d95451`](https://togithub.com/unifiedjs/unified/commit/2d95451) Add improved docs
-   [`afb704a`](https://togithub.com/unifiedjs/unified/commit/afb704a) Fix some typos
    by [@&#8203;ChristianMurphy](https://togithub.com/ChristianMurphy) in [https://github.com/unifiedjs/unified/pull/225](https://togithub.com/unifiedjs/unified/pull/225)
-   [`2aa15ea`](https://togithub.com/unifiedjs/unified/commit/2aa15ea) Refactor types
-   [`a06537c`](https://togithub.com/unifiedjs/unified/commit/a06537c) Add sponsor

**Full Changelog**: unifiedjs/unified@10.1.2...11.0.0

### [`v10.1.2`](https://togithub.com/unifiedjs/unified/releases/tag/10.1.2)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/10.1.1...10.1.2)

-   [`dc85d21`](https://togithub.com/unifiedjs/unified/commit/dc85d21) Fix typo
    by [@&#8203;jablko](https://togithub.com/jablko) in [https://github.com/unifiedjs/unified/pull/185](https://togithub.com/unifiedjs/unified/pull/185)

**Full Changelog**: unifiedjs/unified@10.1.1...10.1.2

### [`v10.1.1`](https://togithub.com/unifiedjs/unified/releases/tag/10.1.1)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/10.1.0...10.1.1)

-   [`6b060c2`](https://togithub.com/unifiedjs/unified/commit/6b060c2) Fix type of `run` signature
    by [@&#8203;alvinleung1996](https://togithub.com/alvinleung1996) in [https://github.com/unifiedjs/unified/pull/174](https://togithub.com/unifiedjs/unified/pull/174)

**Full Changelog**: unifiedjs/unified@10.1.0...10.1.1

### [`v10.1.0`](https://togithub.com/unifiedjs/unified/releases/tag/10.1.0)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/10.0.1...10.1.0)

-   [`134ecad`](https://togithub.com/unifiedjs/unified/commit/134ecad) Add plugin input/output type parameters

### [`v10.0.1`](https://togithub.com/unifiedjs/unified/releases/tag/10.0.1)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/10.0.0...10.0.1)

-   [`591b0c0`](https://togithub.com/unifiedjs/unified/commit/591b0c0) Fix types to support `void` async transformers

### [`v10.0.0`](https://togithub.com/unifiedjs/unified/releases/tag/10.0.0)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/9.2.2...10.0.0)

##### Breaking

-   [`dc46bc5`](https://togithub.com/unifiedjs/unified/commit/dc46bc5) Use ESM and update `vfile`
    -   Change:

        ```js
        // from cjs import
        var unified = require('unified')

        // to esm import
        import {unified} from 'unified'
        ```

        Learn [more about ESM in this guide](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
    -   **Breaking**: this updates `vfile`, which importantly renames ~~`vfile.contents`~~ to `vfile.value`. See [`vfile@5`](https://togithub.com/vfile/vfile/releases/tag/5.0.0)
    -   Inconsequential: this updates `trough`, which removes support for Promise-like objects returned from plugins, in favor of only support actual promises. To update, instead of returning an object with a `then` function, return and *actual* promise

##### Types

-   [`b3e2464`](https://togithub.com/unifiedjs/unified/commit/b3e2464) Rewrite types
    -   Removed the type parameter `P` for processor settings
    -   Use `any[]` instead of `[Record<string, unknown>?]` for the default plugin type parameters
-   [`45eb72e`](https://togithub.com/unifiedjs/unified/commit/45eb72e) Update types for ESM
-   [`2c7ba99`](https://togithub.com/unifiedjs/unified/commit/2c7ba99) [`8eda349`](https://togithub.com/unifiedjs/unified/commit/8eda349) Add explicit dependency on `@types/unist`
-   [`0e8f611`](https://togithub.com/unifiedjs/unified/commit/0e8f611) Remove typescript@3 legacy support
-   [`350ed9d`](https://togithub.com/unifiedjs/unified/commit/350ed9d) Fix `next` in types of transformer signature
-   [`b22bf8e`](https://togithub.com/unifiedjs/unified/commit/b22bf8e) Add support for buffer, other return values
-   [`4bfd6c8`](https://togithub.com/unifiedjs/unified/commit/4bfd6c8) [`b8fe5ec`](https://togithub.com/unifiedjs/unified/commit/b8fe5ec) [`6ef3933`](https://togithub.com/unifiedjs/unified/commit/6ef3933) Add support for boolean plugin options

##### Project

-   [`88374fc`](https://togithub.com/unifiedjs/unified/commit/88374fc) Add `esast` to list of syntax trees
-   [`a6ff3c1`](https://togithub.com/unifiedjs/unified/commit/a6ff3c1) Fix links
-   [`ee6ee47`](https://togithub.com/unifiedjs/unified/commit/ee6ee47) Update examples in `readme.md`
-   [`32abf7c`](https://togithub.com/unifiedjs/unified/commit/32abf7c) [`60de570`](https://togithub.com/unifiedjs/unified/commit/60de570) [`115898a`](https://togithub.com/unifiedjs/unified/commit/115898a) Refactor code style

### [`v9.2.2`](https://togithub.com/unifiedjs/unified/releases/tag/9.2.2)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/9.2.1...9.2.2)

-   [`bc50a01`](https://togithub.com/unifiedjs/unified/commit/bc50a01) Fix to set `vfile.value` if a vfile@5 is given

### [`v9.2.1`](https://togithub.com/unifiedjs/unified/releases/tag/9.2.1)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/9.2.0...9.2.1)

-   [`fe51be2`](https://togithub.com/unifiedjs/unified/commit/fe51be2) Fix mutating options
-   [`8f135d0`](https://togithub.com/unifiedjs/unified/commit/8f135d0) Refactor to improve bundle size
-   [`ad12369`](https://togithub.com/unifiedjs/unified/commit/ad12369) Remove outdated description of compile results

### [`v9.2.0`](https://togithub.com/unifiedjs/unified/releases/tag/9.2.0)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/9.1.0...9.2.0)

-   [`7fc4271`](https://togithub.com/unifiedjs/unified/commit/7fc4271) Add variadic tuple types for plugin tuple

### [`v9.1.0`](https://togithub.com/unifiedjs/unified/releases/tag/9.1.0)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/9.0.0...9.1.0)

-   [`56fdba4`](https://togithub.com/unifiedjs/unified/commit/56fdba4) Add `FrozenProcessor` interface to types

### [`v9.0.0`](https://togithub.com/unifiedjs/unified/releases/tag/9.0.0)

[Compare Source](https://togithub.com/unifiedjs/unified/compare/8.4.2...9.0.0)

-   [`c3ba172`](https://togithub.com/unifiedjs/unified/commit/c3ba172) Set `file.result` when processing to non-text
    (**breaking**, if you’re using `.process` or `.processSync` with a compiler that returns an object, then those results were available at ~~`file.contents`~~ and are now at `file.result`)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/X-oss-byte/Nextjs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem
Development

Successfully merging this pull request may close these issues.

3 participants