archy
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -19,3 +19,3 @@ var archy = require('../'); | ||
}, | ||
'party!' | ||
'party\ntime!' | ||
] | ||
@@ -22,0 +22,0 @@ } |
@@ -5,5 +5,7 @@ module.exports = function archy (obj, prefix) { | ||
var nodes = obj.nodes || []; | ||
var lines = (obj.label || '').split('\n'); | ||
var splitter = '\n' + prefix + (nodes.length ? '│' : ' ') + ' '; | ||
return prefix | ||
+ (obj.label || '') + '\n' | ||
+ lines.join(splitter) + '\n' | ||
+ nodes.map(function (node, ix) { | ||
@@ -10,0 +12,0 @@ var last = ix === nodes.length - 1; |
{ | ||
"name" : "archy", | ||
"version" : "0.0.0", | ||
"version" : "0.0.1", | ||
"description" : "render nested hierarchies `npm ls` style with unicode pipes", | ||
@@ -5,0 +5,0 @@ "main" : "index.js", |
var test = require('tap').test; | ||
var archy = require('../'); | ||
test(function (t) { | ||
test('beep', function (t) { | ||
var s = archy({ | ||
@@ -6,0 +6,0 @@ label : 'beep', |
Sorry, the diff of this file is not supported yet
5894
8
151
90