unifiedjs / unified

☔️ interface for parsing, inspecting, transforming, and serializing content through syntax trees
https://unifiedjs.com
MIT License
4.49k stars 110 forks source link

Fix typo #185

Closed jablko closed 2 years ago

jablko commented 2 years ago

Initial checklist

Description of changes

https://github.com/unifiedjs/unified/pull/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[bot] commented 2 years ago

Hi! It seems some of the things asked in the template are missing? Please edit your post to fill out everything.

You won’t get any more notifications from me, but I’ll keep on updating this comment, and remove it when done!

If you need it, here’s the original template ```markdown ### 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 TODO ```

Thanks, — bb

codecov-commenter commented 2 years ago

Codecov Report

Merging #185 (daf03b5) into main (6f6a5c2) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #185   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          600       600           
=========================================
  Hits           600       600           
Impacted Files Coverage Δ
lib/index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6f6a5c2...daf03b5. Read the comment docs.

wooorm commented 2 years ago

Probably a typo, yeah! Good catch!

github-actions[bot] commented 2 years ago

Hi! This was closed. Team: If this was merged, please describe when this is likely to be released. Otherwise, please add one of the no/* labels.

wooorm commented 2 years ago

Released, thanks!