From 82ae00cae497cffc5084d11aae8ecdac4843511e Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Thu, 19 Aug 2021 21:40:18 +0200 Subject: util: expose toUSVString Expose toUSVString so it can be used by user libraries. PR-URL: https://github.com/nodejs/node/pull/39814 Refs: https://github.com/nodejs/undici/pull/986 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- doc/api/util.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc/api') diff --git a/doc/api/util.md b/doc/api/util.md index 4cdba522744..dc47704e0b7 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -2492,6 +2492,18 @@ const util = require('util'); util.log('Timestamped message.'); ``` + +### `util.toUSVString(string)` + + +* `string` {string} + +Returns the `string` after replacing any surrogate code points +(or equivalently, any unpaired surrogate code units) with the +Unicode "replacement character" U+FFFD. + [Common System Errors]: errors.md#errors_common_system_errors [Custom inspection functions on objects]: #util_custom_inspection_functions_on_objects [Custom promisified functions]: #util_custom_promisified_functions -- cgit v1.2.3