Skip to content

Commit b09eeb4

Browse files
XadillaXjasnell
authored andcommitted
doc, tls: mark parseCertString() as deprecated
`tls.parseCertString()` was made public by mistack. So mark it as deprecated. PR-URL: #14245 Refs: #14193 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 7dfd570 commit b09eeb4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

doc/api/deprecations.md

+23
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,29 @@ Type: Runtime
630630

631631
*Note*: change was made while `async_hooks` was an experimental API.
632632

633+
<a id="DEP0076"></a>
634+
### DEP0076: tls.parseCertString()
635+
636+
Type: Documentation-only
637+
638+
`tls.parseCertString()` is a trivial parsing helper that was made public by
639+
mistake. This function can usually be replaced with:
640+
641+
```js
642+
const querystring = require('querystring');
643+
querystring.parse(str, '\n', '=');
644+
```
645+
646+
*Note*: This function is not completely equivalent to `querystring.parse()`. One
647+
difference is that `querystring.parse()` does url encoding:
648+
649+
```sh
650+
> querystring.parse('%E5%A5%BD=1', '\n', '=');
651+
{ '': '1' }
652+
> tls.parseCertString('%E5%A5%BD=1');
653+
{ '%E5%A5%BD': '1' }
654+
```
655+
633656
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
634657
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array
635658
[`Buffer.from(buffer)`]: buffer.html#buffer_class_method_buffer_from_buffer

0 commit comments

Comments
 (0)