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(cli-separator): negative value on a long text #553

Merged
merged 1 commit into from
Sep 3, 2021

Conversation

Mesteery
Copy link
Member

@Mesteery Mesteery commented Jul 28, 2021

When text is longer than 78 characters (with default length), rest is negative, which raises an error at repeat, making some commands unusable (when a long argument is given).

RangeError: Invalid count value
    at String.repeat (<anonymous>)
    at CLI.separator (C:\Users\me\AppData\Local\Volta\tools\image\packages\node-core-utils\node_modules\node-core-utils\lib\cli.js:133:22)
    at WPTUpdater.checkNeedsUpdate (C:\Users\me\AppData\Local\Volta\tools\image\packages\node-core-utils\node_modules\node-core-utils\lib\wpt\index.js:127:14)
    at WPTUpdater.update (C:\Users\me\AppData\Local\Volta\tools\image\packages\node-core-utils\node_modules\node-core-utils\lib\wpt\index.js:155:36)
    at main (C:\Users\me\AppData\Local\Volta\tools\image\packages\node-core-utils\node_modules\node-core-utils\components\git\wpt.js:78:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

When `text` is longer than 78 characters, `rest` is negative, which raises
an error at `repeat`, making some commands unusable.
@codecov
Copy link

codecov bot commented Jul 28, 2021

Codecov Report

Merging #553 (d79b216) into main (f2f77dd) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #553   +/-   ##
=======================================
  Coverage   82.57%   82.57%           
=======================================
  Files          35       35           
  Lines        1750     1750           
=======================================
  Hits         1445     1445           
  Misses        305      305           
Impacted Files Coverage Δ
lib/cli.js 88.73% <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 f2f77dd...d79b216. Read the comment docs.

@targos targos merged commit 3e8b07d into nodejs:main Sep 3, 2021
@Mesteery Mesteery deleted the patch-1 branch September 3, 2021 10:01
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.

None yet

3 participants