internal: use util.types to migrate DEP0103 in Node.js (#3704)

- Use require('util').types instead of using process.binding('util')
  to get the type checking helpers
- Rename nodeUtil to nodeTypes since that is what it is for

Refs: https://github.com/nodejs/node/pull/18415
This commit is contained in:
Joyee Cheung
2018-03-23 22:31:36 +08:00
committed by John-David Dalton
parent 6e4cdc0c5e
commit 363fef0efc
7 changed files with 21 additions and 15 deletions

View File

@@ -1,12 +1,12 @@
import getTag from './.internal/getTag.js'
import nodeUtil from './.internal/nodeUtil.js'
import nodeTypes from './.internal/nodeTypes.js'
import isObjectLike from './isObjectLike'
/** Used to match `toStringTag` values of typed arrays. */
const reTypedTag = /^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)\]$/
/* Node.js helper references. */
const nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray
const nodeIsTypedArray = nodeTypes && nodeTypes.isTypedArray
/**
* Checks if `value` is classified as a typed array.