Skip to content

Commit a766802

Browse files
Daniel TaverasMylesBorins
Daniel Taveras
authored andcommitted
doc: fix doc for napi_get_value_string_utf8
The API for napi_get_value_string_utf8() appears to have been previously changed. This improves the doc reflect the current design. Backport-PR-URL: #19447 PR-URL: #14529 Fixes: #14398 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 73cc251 commit a766802

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

doc/api/n-api.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -1811,10 +1811,10 @@ NAPI_EXTERN napi_status napi_get_value_string_latin1(napi_env env,
18111811
- `[in] value`: `napi_value` representing JavaScript string.
18121812
- `[in] buf`: Buffer to write the ISO-8859-1-encoded string into. If NULL is
18131813
passed in, the length of the string (in bytes) is returned.
1814-
- `[in] bufsize`: Size of the destination buffer.
1815-
- `[out] result`: Number of bytes copied into the buffer including the null
1816-
terminator. If the buffer size is insufficient, the string will be truncated
1817-
including a null terminator.
1814+
- `[in] bufsize`: Size of the destination buffer. When this value is
1815+
insufficient, the returned string will be truncated.
1816+
- `[out] result`: Number of bytes copied into the buffer, excluding the null
1817+
terminator.
18181818

18191819
Returns `napi_ok` if the API succeeded. If a non-String `napi_value`
18201820
is passed in it returns `napi_string_expected`.
@@ -1837,11 +1837,11 @@ napi_status napi_get_value_string_utf8(napi_env env,
18371837
- `[in] env`: The environment that the API is invoked under.
18381838
- `[in] value`: `napi_value` representing JavaScript string.
18391839
- `[in] buf`: Buffer to write the UTF8-encoded string into. If NULL is passed
1840-
in, the length of the string (in bytes) is returned.
1841-
- `[in] bufsize`: Size of the destination buffer.
1842-
- `[out] result`: Number of bytes copied into the buffer including the null
1843-
terminator. If the buffer size is insufficient, the string will be truncated
1844-
including a null terminator.
1840+
in, the length of the string (in bytes) is returned.
1841+
- `[in] bufsize`: Size of the destination buffer. When this value is
1842+
insufficient, the returned string will be truncated.
1843+
- `[out] result`: Number of bytes copied into the buffer, excluding the null
1844+
terminator.
18451845
18461846
Returns `napi_ok` if the API succeeded. If a non-String `napi_value`
18471847
is passed in it returns `napi_string_expected`.
@@ -1864,10 +1864,10 @@ napi_status napi_get_value_string_utf16(napi_env env,
18641864
- `[in] value`: `napi_value` representing JavaScript string.
18651865
- `[in] buf`: Buffer to write the UTF16-LE-encoded string into. If NULL is
18661866
passed in, the length of the string (in 2-byte code units) is returned.
1867-
- `[in] bufsize`: Size of the destination buffer.
1868-
- `[out] result`: Number of 2-byte code units copied into the buffer including
1869-
the null terminator. If the buffer size is insufficient, the string will be
1870-
truncated including a null terminator.
1867+
- `[in] bufsize`: Size of the destination buffer. When this value is
1868+
insufficient, the returned string will be truncated.
1869+
- `[out] result`: Number of 2-byte code units copied into the buffer, excluding the null
1870+
terminator.
18711871

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

0 commit comments

Comments
 (0)