Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
this._botIdMap.set(update.bot.id, update.bot);
const tags = this._botMap.get(update.bot.id);
if (tags) {
// ID never updates so we don't need to include it.
const botTags = tagsOnBot(update.bot);
tags.splice(0, tags.length, ...botTags);
const dependencies = this.getDependencies(update.bot.id);
for (let tag of update.tags) {
const bots = this._tagMap.get(tag);
const val = update.bot.tags[tag];
if (hasValue(val)) {
if (isFormula(val)) {
let formulaDependencies = this._dependencies.calculateAuxDependencies(
val
);
if (dependencies[tag]) {
this._removeTagDependents(
dependencies,
tag,
update.bot.id
);
}
dependencies[tag] = formulaDependencies;
this._addTagDependents(
formulaDependencies,
tag,
if (!bot) {
return {};
}
const tags = ['id', ...tagsOnBot(bot)];
let deps: BotDependencyInfo = {};
const dependents = tags.map(t => this.getDependents(t));
const updates =
reduce(dependents, (first, second) =>
this._mergeDependents(first, second)
) || {};
for (let tag of tags) {
const val = bot.tags[tag];
if (isFormula(val)) {
let formulaDependencies = this._dependencies.calculateAuxDependencies(
val
);
deps[tag] = formulaDependencies;
this._addTagDependents(formulaDependencies, tag, bot);
}
let arr = this._tagMap.get(tag);
if (arr) {
arr.push(bot.id);
} else {
this._tagMap.set(tag, [bot.id]);
}
}
this._dependencyMap.set(bot.id, deps);
this._botMap.set(bot.id, tags);
private _updateValue(force?: boolean) {
this.isFormula = isFormula(this.value);
if (!this._focused || force) {
this._updateVisibleValue();
}
}
get isTagFormula(): boolean {
return isFormula(this.tagValue);
}