rawx
Version:
process daemon with utilities
74 lines • 2.95 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const Ops = require("../../ops/ops.js");
const Files_Tree = require("./files_tree");
let accent;
class Files_Complex {
constructor({ complex: c_arg, match }) {
Object.defineProperty(this, "_trees", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
// Will remove from class when done testing
Object.defineProperty(this, "complex_opts", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "debug", {
enumerable: true,
configurable: true,
writable: true,
value: 9
});
Object.defineProperty(this, "trees", {
enumerable: true,
configurable: true,
writable: true,
value: () => {
return this._trees;
}
});
// Just a quicky with defaults
({ accent } = new Ops());
this._trees = [];
this.complex_opts = c_arg;
c_arg.forEach((complex) => [
this._trees.push(new Files_Tree({
root_paths: complex.paths,
match: Object.assign(Object.assign({}, match), complex.match),
})),
]);
// o._l(11, `this.trees`);
// o._l(11, this.trees);
}
// These are all in a way syncro, TODO async ->{...sq} issues
setup_complex_tree() {
return __awaiter(this, void 0, void 0, function* () {
const once_per_complex = (i = 0) => __awaiter(this, void 0, void 0, function* () {
if (i >= this.trees.length)
return;
const f_tree = this._trees[i];
yield f_tree.setup_tree();
yield once_per_complex(i + 1);
});
yield once_per_complex();
if (this.debug > 9)
accent(10, this._trees.map((tree) => tree.trunks));
});
}
}
module.exports = Files_Complex;
//# sourceMappingURL=files_complex.js.map