8000 Use util.types to migrate DEP0103 in Node.js. · lodash/lodash@852988e · GitHub
[go: up one dir, main page]

Skip to content

Commit 852988e

Browse files
committed
Use util.types to migrate DEP0103 in Node.js.
PR: #3704
1 parent 97e9edc commit 852988e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lodash.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,14 @@
436436
/** Used to access faster Node.js helpers. */
437437
var nodeUtil = (function() {
438438
try {
439+
// Use `util.types` for Node.js 10+.
440+
var types = freeModule && freeModule.require && freeModule.require('util').types;
441+
442+
if (types) {
443+
return types;
444+
}
445+
446+
// Legacy `process.binding('util')` for Node.js < 10.
439447
return freeProcess && freeProcess.binding && freeProcess.binding('util');
440448
} catch (e) {}
441449
}());

0 commit comments

Comments
 (0)
0