Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as treeify from 'treeify';
function log(s: string): void {}
treeify.asTree(
{
apples: 'gala', // ├─ apples: gala
oranges: 'mandarin' // └─ oranges: mandarin
},
true,
true
);
treeify.asLines(
{
apples: 'gala', // ├─ apples: gala
oranges: 'mandarin', // ├─ oranges: mandarin
grapes: { // └─ grapes
seedless: 'Thompson, Selma Pete', // ├─ seedless: Thompson, Selma Pete
seeded: 'concord' // └─ seeded: Concord
}
},
true,
log
);
treeify.asLines(
{
apples: 'gala', // ├─ apples: gala
oranges: 'mandarin' // └─ oranges: mandarin
crawler.read(nodeId, function (err, obj) {
console.log(" Time = ", (new Date()).getTime() - t);
console.log(" read = ", crawler.readCounter);
console.log(" browse = ", crawler.browseCounter);
console.log(" transaction = ", crawler.transactionCounter);
if (!err) {
if (false) {
// todo : treeify.asTree performance is *very* slow on large object, replace with better implementation
//xx console.log(treeify.asTree(obj, true));
treeify.asLines(obj, true, true, function (line) {
console.log(line);
});
} else {
process.exit(1);
}
}
client.removeListener("receive_response", print_stat);
callback(err);
});
crawler.read(nodeId, function (err, obj) {
console.log(" Time = ", (new Date()).getTime() - t);
console.log(" read = ", crawler.readCounter);
console.log(" browse = ", crawler.browseCounter);
console.log(" transaction = ", crawler.transactionCounter);
if (!err) {
if (false) {
// todo : treeify.asTree performance is *very* slow on large object, replace with better implementation
//xx console.log(treeify.asTree(obj, true));
treeify.asLines(obj, true, true, function (line) {
console.log(line);
});
} else {
// process.exit(1);
}
}
client.removeListener("receive_response", print_stat);
crawler.dispose();
callback(err);
});
// xx console.log("->",(new Date()).getTime()-t,element.browseName.name,element.nodeId.toString());
// xx });
const nodeId = "ObjectsFolder";
console.log("now crawling object folder ...please wait...");
const obj = await crawler.read(nodeId);
console.log(" Time = ", (new Date()).getTime() - t5);
console.log(" read = ", crawler.readCounter);
console.log(" browse = ", crawler.browseCounter);
console.log(" browseNext = ", crawler.browseNextCounter);
console.log(" transaction = ", crawler.transactionCounter);
if (false) {
// todo : treeify.asTree performance is *very* slow on large object, replace with better implementation
// xx console.log(treeify.asTree(obj, true));
treeify.asLines(obj, true, true, (line: string) => {
console.log(line);
});
}
crawler.dispose();
}
client.removeListener("receive_response", print_stat);
// -----------------------------------------------------------------------------------------------------------------
// enumerate all Condition Types exposed by the server
// -----------------------------------------------------------------------------------------------------------------
console.log("--------------------------------------------------------------- Enumerate all Condition Types exposed by the server");
const conditionTree = await enumerateAllConditionTypes(the_session);
console.log(treeify.asTree(conditionTree));
console.log(" -----------------------------------------------------------------------------------------------------------------");
crawler.read(nodeId, function (err, obj) {
if (!err) {
treeify.asLines(obj, true, true, function (line) {
console.log(line);
});
}
callback(err);
});