Skip to content

Commit

Permalink
doc: document deprecation of util.is* functions
Browse files Browse the repository at this point in the history
This patch documentes the deprecation of util.is* functions.
As per the deprecation policy dicussion, nodejs/dev-policy/issues/49,
we need to start with documenting the deprecation. So, this is
the first step towards officially removing them.

PR-URL: #2447
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rod Vagg <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
  • Loading branch information
thefourtheye committed Aug 24, 2015
1 parent 3b60252 commit 93e2830
Showing 1 changed file with 30 additions and 15 deletions.
45 changes: 30 additions & 15 deletions doc/api/util.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ formatted according to the returned Object. This is similar to how

## util.isArray(object)

Stability: 0 - Deprecated

Internal alias for Array.isArray.

Returns `true` if the given "object" is an `Array`. `false` otherwise.
Expand All @@ -180,9 +182,10 @@ Returns `true` if the given "object" is an `Array`. `false` otherwise.
util.isArray({})
// false


## util.isRegExp(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is a `RegExp`. `false` otherwise.

var util = require('util');
Expand All @@ -194,9 +197,10 @@ Returns `true` if the given "object" is a `RegExp`. `false` otherwise.
util.isRegExp({})
// false


## util.isDate(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is a `Date`. `false` otherwise.

var util = require('util');
Expand All @@ -208,9 +212,10 @@ Returns `true` if the given "object" is a `Date`. `false` otherwise.
util.isDate({})
// false


## util.isError(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is an `Error`. `false` otherwise.

var util = require('util');
Expand All @@ -222,9 +227,10 @@ Returns `true` if the given "object" is an `Error`. `false` otherwise.
util.isError({ name: 'Error', message: 'an error occurred' })
// false


## util.isBoolean(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is a `Boolean`. `false` otherwise.

var util = require('util');
Expand All @@ -236,9 +242,10 @@ Returns `true` if the given "object" is a `Boolean`. `false` otherwise.
util.isBoolean(false)
// true


## util.isNull(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is strictly `null`. `false` otherwise.

var util = require('util');
Expand All @@ -250,9 +257,10 @@ Returns `true` if the given "object" is strictly `null`. `false` otherwise.
util.isNull(null)
// true


## util.isNullOrUndefined(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is `null` or `undefined`. `false` otherwise.

var util = require('util');
Expand All @@ -264,9 +272,10 @@ Returns `true` if the given "object" is `null` or `undefined`. `false` otherwise
util.isNullOrUndefined(null)
// true


## util.isNumber(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is a `Number`. `false` otherwise.

var util = require('util');
Expand All @@ -280,9 +289,10 @@ Returns `true` if the given "object" is a `Number`. `false` otherwise.
util.isNumber(NaN)
// true


## util.isString(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is a `String`. `false` otherwise.

var util = require('util');
Expand All @@ -296,9 +306,10 @@ Returns `true` if the given "object" is a `String`. `false` otherwise.
util.isString(5)
// false


## util.isSymbol(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is a `Symbol`. `false` otherwise.

var util = require('util');
Expand All @@ -310,9 +321,10 @@ Returns `true` if the given "object" is a `Symbol`. `false` otherwise.
util.isSymbol(Symbol('foo'))
// true


## util.isUndefined(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is `undefined`. `false` otherwise.

var util = require('util');
Expand All @@ -325,9 +337,10 @@ Returns `true` if the given "object" is `undefined`. `false` otherwise.
util.isUndefined(null)
// false


## util.isObject(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is strictly an `Object` __and__ not a
`Function`. `false` otherwise.

Expand All @@ -342,9 +355,10 @@ Returns `true` if the given "object" is strictly an `Object` __and__ not a
util.isObject(function(){})
// false


## util.isFunction(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is a `Function`. `false` otherwise.

var util = require('util');
Expand All @@ -359,9 +373,10 @@ Returns `true` if the given "object" is a `Function`. `false` otherwise.
util.isFunction(Bar)
// true


## util.isPrimitive(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is a primitive type. `false` otherwise.

var util = require('util');
Expand All @@ -385,9 +400,10 @@ Returns `true` if the given "object" is a primitive type. `false` otherwise.
util.isPrimitive(new Date())
// false


## util.isBuffer(object)

Stability: 0 - Deprecated

Returns `true` if the given "object" is a `Buffer`. `false` otherwise.

var util = require('util');
Expand All @@ -399,7 +415,6 @@ Returns `true` if the given "object" is a `Buffer`. `false` otherwise.
util.isBuffer(new Buffer('hello world'))
// true


## util.inherits(constructor, superConstructor)

Inherit the prototype methods from one
Expand Down

0 comments on commit 93e2830

Please sign in to comment.