Browse Source

fixed the doc of the decoder.

decoder may get also string, not just buffer - so rename it to chunk.
pull/650/head
Ran Grizm 6 years ago
parent
commit
4e1de42673
  1. 8
      docs/docs.html

8
docs/docs.html

@ -536,11 +536,11 @@ var csv = Papa.unparse({ @@ -536,11 +536,11 @@ var csv = Papa.unparse({
<code>decoder</code>
</td>
<td>
A function which allows custom decoding for the buffer string.
The function get Buffer and Encoding, and returns a string.
A function which allows custom decoding of the chunk.
The function get Chunk (Buffer/string) and Encoding, and returns a string.
i.e assuming const iconv = require('iconv-lite'):
(buf , encoding) => {
if (iconv.encodingExists(encoding)) { return iconv.decode(buf, encoding) };
(chunk , encoding) => {
if (iconv.encodingExists(encoding)) { return iconv.decode(chunk, encoding) };
throw new TypeError('[ERR_UNKNOWN_ENCODING]', 'Unknown encoding: ' + encoding)
}
</td>

Loading…
Cancel
Save