sonic-forest
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,3 +0,1 @@ | ||
type Child = (tab: string) => string; | ||
export declare const printBinary: (tab: string | undefined, children: [left?: null | Child, right?: null | Child]) => string; | ||
export {}; | ||
export * from 'tree-dump/lib/printBinary'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.printBinary = void 0; | ||
const printBinary = (tab = '', children) => { | ||
const [left, right] = children; | ||
let str = ''; | ||
if (left) | ||
str += `\n${tab}← ${left(tab + ' ')}`; | ||
if (right) | ||
str += `\n${tab}→ ${right(tab + ' ')}`; | ||
return str; | ||
}; | ||
exports.printBinary = printBinary; | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("tree-dump/lib/printBinary"), exports); |
@@ -1,3 +0,1 @@ | ||
type Child = (tab: string) => string; | ||
export declare const printTree: (tab: string | undefined, children: (Child | null)[]) => string; | ||
export {}; | ||
export * from 'tree-dump/lib/printTree'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.printTree = void 0; | ||
const printTree = (tab = '', children) => { | ||
children = children.filter(Boolean); | ||
let str = ''; | ||
for (let i = 0; i < children.length; i++) { | ||
const isLast = i >= children.length - 1; | ||
const fn = children[i]; | ||
if (!fn) | ||
continue; | ||
const child = fn(tab + `${isLast ? ' ' : '│'} `); | ||
const branch = child ? (isLast ? '└─' : '├─') : '│ '; | ||
str += `\n${tab}${branch} ${child}`; | ||
} | ||
return str; | ||
}; | ||
exports.printTree = printTree; | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("tree-dump/lib/printTree"), exports); |
@@ -1,3 +0,1 @@ | ||
export interface Printable { | ||
toString(tab?: string): string; | ||
} | ||
export type * from 'tree-dump/lib/types'; |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "High-performance (binary) tree and sorted map implementation (AVL, Splay, Radix, Red-Black)", | ||
@@ -62,3 +62,5 @@ "author": { | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"tree-dump": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
@@ -65,0 +67,0 @@ "@types/benchmark": "^2.1.2", |
61796
2
1997
+ Addedtree-dump@^1.0.0
+ Addedtree-dump@1.0.2(transitive)