Comparing version 0.1.0 to 0.1.1
42
cdir.js
@@ -129,15 +129,9 @@ var tty = require('tty'); | ||
for (name in value) { | ||
if (Object.prototype.hasOwnProperty.call(value, name)) { | ||
nu[name] = derez(value[name], | ||
path + '[' + JSON.stringify(name) + ']'); | ||
} | ||
nu[name] = derez(value[name], path + '[' + JSON.stringify(name) + ']'); | ||
} | ||
} | ||
return nu; | ||
case 'number': | ||
case 'string': | ||
case 'boolean': | ||
case 'undefined': | ||
case 'function': | ||
default: | ||
return value; | ||
break; | ||
} | ||
@@ -289,3 +283,21 @@ | ||
addStrData(node.toString()); | ||
if (Object.keys(node.prototype).length > 0) { | ||
indent++; | ||
depth++; | ||
constructMeta(type, depth, node.toString(), ws(indent, true)); | ||
for (var key in node.prototype) { | ||
var description = ws(indent, true) + key + ': '; | ||
constructMeta(type, depth, node.prototype[key], description); | ||
} | ||
indent--; | ||
} | ||
else { | ||
addStrData(node.toString()); | ||
} | ||
break; | ||
@@ -336,2 +348,3 @@ case 'array': | ||
break; | ||
} | ||
@@ -590,4 +603,2 @@ }; | ||
var downAction = (key.name === 'tab' && !key.shift) || key.name === 'down'; | ||
@@ -621,3 +632,3 @@ var upAction = (key.shift && key.name === 'tab') || key.name === 'up'; | ||
// | ||
// if this is a toggle, the value must be of type array or object. | ||
// if this is a toggle. | ||
// | ||
@@ -627,3 +638,4 @@ if ((key.name === 'space' || key.name === 'enter' || | ||
(meta[index].type === 'array' || meta[index].type === 'object' || | ||
meta[index].type === 'function' || meta[index].type === 'string')) { | ||
meta[index].type === 'function' || meta[index].type === 'string') | ||
&& selection <= displayed) { | ||
@@ -647,4 +659,4 @@ index = map[selection-1]; | ||
} | ||
stdin.removeListener('keypress', listener); | ||
tty.setRawMode(false); | ||
} | ||
@@ -651,0 +663,0 @@ |
@@ -12,3 +12,3 @@ { | ||
], | ||
"version" : "0.1.0", | ||
"version" : "0.1.1", | ||
"author" : "Paolo Fragomeni <paolo@nodejisu.com>", | ||
@@ -15,0 +15,0 @@ "repository" : { |
111723
10
707