File tree 7 files changed +21
-15
lines changed 7 files changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,16 @@ const moduleExports = freeModule && freeModule.exports === freeExports
13
13
const freeProcess = moduleExports && freeGlobal . process
14
14
15
15
/** Used to access faster Node.js helpers. */
16
- const nodeUtil = ( ( ( ) => {
16
+ const nodeTypes = ( ( ( ) => {
17
17
try {
18
- return freeProcess && freeProcess . binding && freeProcess . binding ( 'util' )
18
+ /* Detect public `util.types` helpers for Node.js v10+. */
19
+ /* Node.js deprecation code: DEP0103. */
20
+ const typesHelper = freeModule && freeModule . require && freeModule . require ( 'util' ) . types
21
+ return typesHelper
22
+ ? typesHelper
23
+ /* Legacy process.binding('util') for Node.js earlier than v10. */
24
+ : freeProcess && freeProcess . binding && freeProcess . binding ( 'util' )
19
25
} catch ( e ) { }
20
26
} ) ( ) )
21
27
22
- export default nodeUtil
28
+ export default nodeTypes
Original file line number Diff line number Diff line change 1
1
import baseGetTag from './.internal/baseGetTag.js'
2
2
import isObjectLike from './isObjectLike.js'
3
- import nodeUtil from './.internal/nodeUtil .js'
3
+ import nodeTypes from './.internal/nodeTypes .js'
4
4
5
5
/* Node.js helper references. */
6
- const nodeIsArrayBuffer = nodeUtil && nodeUtil . isArrayBuffer
6
+ const nodeIsArrayBuffer = nodeTypes && nodeTypes . isArrayBuffer
7
7
8
8
/**
9
9
* Checks if `value` is classified as an `ArrayBuffer` object.
Original file line number Diff line number Diff line change 1
1
import baseGetTag from './.internal/baseGetTag.js'
2
2
import isObjectLike from './isObjectLike.js'
3
- import nodeUtil from './.internal/nodeUtil .js'
3
+ import nodeTypes from './.internal/nodeTypes .js'
4
4
5
5
/* Node.js helper references. */
6
- const nodeIsDate = nodeUtil && nodeUtil . isDate
6
+ const nodeIsDate = nodeTypes && nodeTypes . isDate
7
7
8
8
/**
9
9
* Checks if `value` is classified as a `Date` object.
Original file line number Diff line number Diff line change 1
1
import getTag from './.internal/getTag.js'
2
2
import isObjectLike from './isObjectLike.js'
3
- import nodeUtil from './.internal/nodeUtil .js'
3
+ import nodeTypes from './.internal/nodeTypes .js'
4
4
5
5
/* Node.js helper references. */
6
- const nodeIsMap = nodeUtil && nodeUtil . isMap
6
+ const nodeIsMap = nodeTypes && nodeTypes . isMap
7
7
8
8
/**
9
9
* Checks if `value` is classified as a `Map` object.
Original file line number Diff line number Diff line change 1
1
import baseGetTag from './.internal/baseGetTag.js'
2
2
import isObjectLike from './isObjectLike.js'
3
- import nodeUtil from './.internal/nodeUtil .js'
3
+ import nodeTypes from './.internal/nodeTypes .js'
4
4
5
5
/* Node.js helper references. */
6
- const nodeIsRegExp = nodeUtil && nodeUtil . isRegExp
6
+ const nodeIsRegExp = nodeTypes && nodeTypes . isRegExp
7
7
8
8
/**
9
9
* Checks if `value` is classified as a `RegExp` object.
Original file line number Diff line number Diff line change 1
1
import getTag from './.internal/getTag.js'
2
- import nodeUtil from './.internal/nodeUtil .js'
2
+ import nodeTypes from './.internal/nodeTypes .js'
3
3
import isObjectLike from './isObjectLike'
4
4
5
5
/* Node.js helper references. */
6
- const nodeIsSet = nodeUtil && nodeUtil . isSet
6
+ const nodeIsSet = nodeTypes && nodeTypes . isSet
7
7
8
8
/**
9
9
* Checks if `value` is classified as a `Set` object.
Original file line number Diff line number Diff line change 1
1
import getTag from './.internal/getTag.js'
2
- import nodeUtil from './.internal/nodeUtil .js'
2
+ import nodeTypes from './.internal/nodeTypes .js'
3
3
import isObjectLike from './isObjectLike'
4
4
5
5
/** Used to match `toStringTag` values of typed arrays. */
6
6
const reTypedTag = / ^ \[ o b j e c t (?: F l o a t (?: 3 2 | 6 4 ) | (?: I n t | U i n t ) (?: 8 | 1 6 | 3 2 ) | U i n t 8 C l a m p e d ) \] $ /
7
7
8
8
/* Node.js helper references. */
9
- const nodeIsTypedArray = nodeUtil && nodeUtil . isTypedArray
9
+ const nodeIsTypedArray = nodeTypes && nodeTypes . isTypedArray
10
10
11
11
/**
12
12
* Checks if `value` is classified as a typed array.
You can’t perform that action at this time.
0 commit comments