Permalink
Browse files

doc: document deprecation of util.is* functions

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 <jasnell@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
  • Loading branch information...
thefourtheye committed Aug 19, 2015
1 parent 3b60252 commit 93e28306864d14aaeef14061990abb733bbe7105
Showing with 30 additions and 15 deletions.
  1. +30 −15 doc/api/util.markdown
View
@@ -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.
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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');
@@ -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.
@@ -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');
@@ -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');
@@ -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');
@@ -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

0 comments on commit 93e2830

Please sign in to comment.