Skip to content


Browse files Browse the repository at this point in the history
util: introduce[…] type checks
Provide public APIs for native typechecking that is actually useful.
The motivation for this is providing alternatives to userland
modules that would currently rely on `process.binding('util')`.

PR-URL: #18415
Reviewed-By: Evan Lucas <>
Reviewed-By: Joyee Cheung <>
Reviewed-By: Colin Ihrig <>
Reviewed-By: James M Snell <>
Reviewed-By: Tiancheng "Timothy" Gu <>
Reviewed-By: Сковорода Никита Андреевич <>
  • Loading branch information
addaleax committed Mar 5, 2018
1 parent bd6e0be commit b20af80
Show file tree
Hide file tree
Showing 15 changed files with 919 additions and 125 deletions.
9 changes: 9 additions & 0 deletions doc/api/
Expand Up @@ -932,6 +932,14 @@ Using the `noAssert` argument has no functionality anymore. All input is going
to be verified, no matter if it is set to true or not. Skipping the verification
could lead to hard to find errors and crashes.
<a id="DEP0XXX"></a>

This comment has been minimized.

Copy link

ChALkeR Mar 5, 2018


@addaleax 😢 This should have been assigned to a number on landing, afaik.

### DEP0XXX: process.binding('util').is[...] typechecks
Type: Documentation-only (supports [`--pending-deprecation`][])
Using `process.binding()` in general should be avoided. The type checking
methods in particular can be replaced by using [`util.types`][].
[`--pending-deprecation`]: cli.html#cli_pending_deprecation
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array
Expand Down Expand Up @@ -1000,6 +1008,7 @@ could lead to hard to find errors and crashes.
[`util.log()`]: util.html#util_util_log_string
[`util.print()`]: util.html#util_util_print_strings
[`util.puts()`]: util.html#util_util_puts_strings
[`util.types`]: util.html#util_util_types
[`util`]: util.html
[`worker.exitedAfterDisconnect`]: cluster.html#cluster_worker_exitedafterdisconnect
[alloc]: buffer.html#buffer_class_method_buffer_alloc_size_fill_encoding
Expand Down

1 comment on commit b20af80


This comment was marked as off-topic.

Please sign in to comment.