Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 95dbb6b

Browse files
EvanCarrollindutny
authored andcommitted
util: made util.isArray a direct alias for Array.isArray
1 parent 42a33c1 commit 95dbb6b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

doc/api/util.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ formatted according to the returned Object. This is similar to how
167167

168168
## util.isArray(object)
169169

170+
Internal alias for Array.isArray.
171+
170172
Returns `true` if the given "object" is an `Array`. `false` otherwise.
171173

172174
var util = require('util');

lib/util.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,7 @@ function reduceToSingleString(output, base, braces) {
505505

506506
// NOTE: These type checking functions intentionally don't use `instanceof`
507507
// because it is fragile and can be easily faked with `Object.create()`.
508-
function isArray(ar) {
509-
return Array.isArray(ar);
510-
}
511-
exports.isArray = isArray;
508+
var isArray = exports.isArray = Array.isArray;
512509

513510
function isBoolean(arg) {
514511
return typeof arg === 'boolean';

0 commit comments

Comments
 (0)