Skip to content

Commit

Permalink
doc: fix doc for napi_get_value_string_utf8
Browse files Browse the repository at this point in the history
The API for napi_get_value_string_utf8() appears to have been
previously changed. This improves the doc reflect the current design.

PR-URL: #14529
Fixes: #14398
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
Daniel Taveras authored and MylesBorins committed Sep 12, 2017
1 parent 9f46bde commit 6179c27
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1811,10 +1811,10 @@ NAPI_EXTERN napi_status napi_get_value_string_latin1(napi_env env,
- `[in] value`: `napi_value` representing JavaScript string.
- `[in] buf`: Buffer to write the ISO-8859-1-encoded string into. If NULL is
passed in, the length of the string (in bytes) is returned.
- `[in] bufsize`: Size of the destination buffer.
- `[out] result`: Number of bytes copied into the buffer including the null
terminator. If the buffer size is insufficient, the string will be truncated
including a null terminator.
- `[in] bufsize`: Size of the destination buffer. When this value is
insufficient, the returned string will be truncated.
- `[out] result`: Number of bytes copied into the buffer, excluding the null
terminator.

Returns `napi_ok` if the API succeeded. If a non-String `napi_value`
is passed in it returns `napi_string_expected`.
Expand All @@ -1837,11 +1837,11 @@ napi_status napi_get_value_string_utf8(napi_env env,
- `[in] env`: The environment that the API is invoked under.
- `[in] value`: `napi_value` representing JavaScript string.
- `[in] buf`: Buffer to write the UTF8-encoded string into. If NULL is passed
in, the length of the string (in bytes) is returned.
- `[in] bufsize`: Size of the destination buffer.
- `[out] result`: Number of bytes copied into the buffer including the null
terminator. If the buffer size is insufficient, the string will be truncated
including a null terminator.
in, the length of the string (in bytes) is returned.
- `[in] bufsize`: Size of the destination buffer. When this value is
insufficient, the returned string will be truncated.
- `[out] result`: Number of bytes copied into the buffer, excluding the null
terminator.
Returns `napi_ok` if the API succeeded. If a non-String `napi_value`
is passed in it returns `napi_string_expected`.
Expand All @@ -1864,10 +1864,10 @@ napi_status napi_get_value_string_utf16(napi_env env,
- `[in] value`: `napi_value` representing JavaScript string.
- `[in] buf`: Buffer to write the UTF16-LE-encoded string into. If NULL is
passed in, the length of the string (in 2-byte code units) is returned.
- `[in] bufsize`: Size of the destination buffer.
- `[out] result`: Number of 2-byte code units copied into the buffer including
the null terminator. If the buffer size is insufficient, the string will be
truncated including a null terminator.
- `[in] bufsize`: Size of the destination buffer. When this value is
insufficient, the returned string will be truncated.
- `[out] result`: Number of 2-byte code units copied into the buffer, excluding the null
terminator.

Returns `napi_ok` if the API succeeded. If a non-String `napi_value`
is passed in it returns `napi_string_expected`.
Expand Down

0 comments on commit 6179c27

Please sign in to comment.