How to use the @casual-simulation/aux-common.isAssignment function in @casual-simulation/aux-common

To help you get started, we’ve selected a few @casual-simulation/aux-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github casual-simulation / aux / src / aux-server / aux-web / aux-projector / BotValue / BotValue.ts View on Github external
private _updateVisibleValue() {
        if (!this._focused || !this.showFormulaWhenFocused) {
            this.value = this.getBotManager().helper.calculateFormattedBotValue(
                this.bot,
                this.tag
            );
        } else {
            const val = this.bot.tags[this.tag];
            if (isAssignment(val)) {
                const assignment: Assignment = val;
                this.value = assignment.editing
                    ? assignment.formula
                    : assignment.value;
            } else if (typeof val === 'object') {
                this.value = JSON.stringify(val);
            } else {
                this.value = val;
            }
        }
    }
github casual-simulation / aux / src / aux-server / aux-web / aux-projector / BotValue / BotValue.ts View on Github external
private _updateAssignment() {
        const val = this.bot.tags[this.tag];
        if (isAssignment(val)) {
            const assignment: Assignment = val;
            if (assignment.editing) {
                this.getBotManager().helper.updateBot(this.bot, {
                    tags: {
                        [this.tag]: assign(assignment, {
                            editing: false,
                        }),
                    },
                });
            }
        }
    }
}