aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNathan Rajlich <nathan@tootallnate.net>2011-10-26 11:09:01 -0700
committerkoichik <koichik@improvement.jp>2011-10-27 03:38:29 +0900
commitb8f3e18a5d3b9542e452274adb5422dfc0784e15 (patch)
treed4eca7195c9df2ebd93f6eec1a4bc6ce5f321042 /lib
parentb3ddb895d2e3dc983d6f40dc95179dc7eda3440e (diff)
downloadandroid-node-v8-b8f3e18a5d3b9542e452274adb5422dfc0784e15.tar.gz
android-node-v8-b8f3e18a5d3b9542e452274adb5422dfc0784e15.tar.bz2
android-node-v8-b8f3e18a5d3b9542e452274adb5422dfc0784e15.zip
Export the type checking functions from `util.js`.
As per discussion at: http://groups.google.com/group/nodejs-dev/browse_thread/thread/b08970166e4670cf
Diffstat (limited to 'lib')
-rw-r--r--lib/util.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/util.js b/lib/util.js
index bb6b840bcc..098aab2432 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -383,24 +383,28 @@ function isArray(ar) {
Array.isArray(ar) ||
(ar && ar !== Object.prototype && isArray(ar.__proto__));
}
+exports.isArray = isArray;
function isRegExp(re) {
return re instanceof RegExp ||
(typeof re === 'object' && objectToString(re) === '[object RegExp]');
}
+exports.isRegExp = isRegExp;
function isDate(d) {
return d instanceof Date ||
(typeof d === 'object' && objectToString(d) === '[object Date]');
}
+exports.isDate = isDate;
function isError(e) {
return e instanceof Error ||
(typeof e === 'object' && objectToString(e) === '[object Error]');
}
+exports.isError = isError;
function objectToString(o) {