Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: document deprecation of util.is* functions #2447

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
doc: document deprecation of util.is* functions
This patch documentes the deprecation of util.is* functions.
[Official deprecation policy](nodejs/dev-policy/issues/49) states that,
we need to start with documenting the deprecation first. So, this is
the first step towards officially removing them.
  • Loading branch information
thefourtheye committed Aug 22, 2015
commit d13620550f9fcfd5baaaa5ab1de12a478232a76c
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