lysergic
Version:
Synaptic's neural network compiler
31 lines • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function childrenRef(index) {
return function (target, propertyKey) {
if (delete target[propertyKey]) {
target.nameMapping = target.nameMapping || {};
target.nameMapping[index] = propertyKey;
Object.defineProperty(target, propertyKey.toString(), {
get: function () {
return this.children[index] || null;
},
set: function (value) {
this.children[index] = value || null;
if (value) {
value.parent = this;
if (value.stop && value.stop.offset > this.stop.offset) {
this.stop = value.stop;
}
}
},
enumerable: true
});
}
};
}
exports.childrenRef = childrenRef;
function indent(text) {
return text.replace(/^(.*)/gm, ' $1');
}
exports.indent = indent;
//# sourceMappingURL=helpers.js.map