mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
Added support for options parameter in console.dir()
Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
1 parent
03e9f84933
commit
e00cafa311
3 files changed
+26
-4
No files matched your search
+7
-2
@@ -65,8 +65,13 @@ Console.prototype.warn = function() {
|
||||
Console.prototype.error = Console.prototype.warn;
|
||||
|
||||
|
||||
Console.prototype.dir = function(object) {
|
||||
this._stdout.write(util.inspect(object, { customInspect: false }) + '\n');
|
||||
Console.prototype.dir = function(object, options) {
|
||||
if (typeof options === 'object' && options !== null) {
|
||||
options.customInspect = false;
|
||||
} else {
|
||||
options = { customInspect: false };
|
||||
}
|
||||
this._stdout.write(util.inspect(object, options) + '\n');
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user