Skip to content
Browse files

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 Jan 27, 2018
1 parent bd6e0be commit b20af8088a4d5cccb1901d42107f6d9ca82d306f
@@ -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
@@ -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
Oops, something went wrong.

1 comment on commit b20af80


This comment was marked as off-topic.

Copy link

commented on b20af80 Apr 25, 2018


Please sign in to comment.
You can’t perform that action at this time.