Skip to content

Conversation

@olanb7
Copy link

@olanb7 olanb7 commented Oct 8, 2016

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

Update to the docs

Description of change

As discussed in #8971, the docs for this method could be improved. This is my attempt at clarification.

Fixes: #8971

As discussed in nodejs#8971, the docs for this method could be improved.

Fixes: nodejs#8971
@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels Oct 8, 2016
// Prints: tés
console.log(buf.toString('utf8', 0, 3));
// Prints: 74c3a97374
console.log(buf2.toString('hex'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this isn’t mentioned in #8971, but the console.log(buf.toString(…)) statements should probably refer to buf1, not buf, so it would make sense to fix that, too?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, totally missed that. Sure.

* `encoding` {String} The character encoding to decode to. **Default:** `'utf8'`
* `start` {Integer} Where to start decoding. **Default:** `0`
* `end` {Integer} Where to stop decoding (not inclusive). **Default:** [`buf.length`]
* `start` {Integer} They byte offset to start decoding at. **Default:** `0`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: They

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Silly me. Resolved!

Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

* `start` {Integer} Where to start decoding. **Default:** `0`
* `end` {Integer} Where to stop decoding (not inclusive). **Default:** [`buf.length`]
* `start` {Integer} The byte offset to start decoding at. **Default:** `0`
* `end` {Integer} The byte offset to stop decoding at (not inclusive). **Default:** [`buf.length`]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: long line

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a nit

@rvagg rvagg force-pushed the master branch 2 times, most recently from c133999 to 83c7a88 Compare October 18, 2016 17:02
jasnell pushed a commit that referenced this pull request Oct 26, 2016
Fixes: #8971
PR-URL: #8984
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Oct 26, 2016

Landed in 366fc7a. fixed nits on landing

@jasnell jasnell closed this Oct 26, 2016
evanlucas pushed a commit that referenced this pull request Nov 3, 2016
Fixes: #8971
PR-URL: #8984
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 17, 2016
Fixes: #8971
PR-URL: #8984
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 19, 2016
Fixes: #8971
PR-URL: #8984
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants