UNPKG

molstar

Version:

A comprehensive macromolecular library.

29 lines 1.25 kB
"use strict"; /** * Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> */ Object.defineProperty(exports, "__esModule", { value: true }); exports.Progress = void 0; var Progress; (function (Progress) { function _format(root, prefix) { if (prefix === void 0) { prefix = ''; } var p = root.progress; if (!root.children.length) { if (p.isIndeterminate) return "" + prefix + p.taskName + ": " + p.message; return "" + prefix + p.taskName + ": [" + p.current + "/" + p.max + "] " + p.message; } var newPrefix = prefix + ' |_ '; var subTree = root.children.map(function (c) { return _format(c, newPrefix); }); if (p.isIndeterminate) return "" + prefix + p.taskName + ": " + p.message + "\n" + subTree.join('\n'); return "" + prefix + p.taskName + ": [" + p.current + "/" + p.max + "] " + p.message + "\n" + subTree.join('\n'); } function format(p) { return _format(p.root); } Progress.format = format; })(Progress || (Progress = {})); exports.Progress = Progress; //# sourceMappingURL=progress.js.map