diff options
author | Timothy J Fontaine <tjfontaine@gmail.com> | 2014-08-07 16:33:35 -0700 |
---|---|---|
committer | Timothy J Fontaine <tjfontaine@gmail.com> | 2014-08-07 16:33:35 -0700 |
commit | a5778cdf01425ae39cea80b62f9ec6740aec724a (patch) | |
tree | 6b011b6046ca68ee33e2cd811048f3e40558d7d9 /deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js | |
parent | 28eee0adb7884e21217c99cbf10a681c7d91b64a (diff) | |
parent | b0277f35bd86d441255dc5a4c19e577e03f03a47 (diff) | |
download | android-node-v8-a5778cdf01425ae39cea80b62f9ec6740aec724a.tar.gz android-node-v8-a5778cdf01425ae39cea80b62f9ec6740aec724a.tar.bz2 android-node-v8-a5778cdf01425ae39cea80b62f9ec6740aec724a.zip |
Merge remote-tracking branch 'upstream/v0.10' into v0.12
Conflicts:
ChangeLog
Makefile
deps/uv/ChangeLog
deps/uv/build.mk
deps/uv/src/unix/darwin.c
deps/uv/src/unix/getaddrinfo.c
deps/uv/src/version.c
deps/v8/src/checks.h
deps/v8/src/isolate.h
lib/cluster.js
lib/module.js
lib/timers.js
lib/tls.js
src/node_version.h
Diffstat (limited to 'deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js')
-rw-r--r-- | deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js new file mode 100644 index 0000000000..007fa10575 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js @@ -0,0 +1,106 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && objectToString(e) === '[object Error]'; +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +function isBuffer(arg) { + return arg instanceof Buffer; +} +exports.isBuffer = isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} |