How to use the @casual-simulation/aux-common.merge 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-player / interaction / DragOperation / PlayerNewFileDragOperation.ts View on Github external
protected _updateFile(file: File, data: PartialFile): FileEvent {
        if (!this._fileAdded) {
            // Add the duplicated file.
            this._file = merge(this._file, data || {});
            this._file = createFile(undefined, this._file.tags);
            this._files = [this._file];
            this._fileAdded = true;

            return fileAdded(this._file);
        } else {
            return super._updateFile(this._file, data);
        }
    }
github casual-simulation / aux / src / aux-server / server / modules / BackupModule.ts View on Github external
function calculateOptions(options: BackupOptions): BackupOptions {
    return merge(
        {
            includeArchived: true,
        },
        options || {}
    );
}
github casual-simulation / aux / src / aux-server / aux-web / shared / scene / BotRenderer.ts View on Github external
async render(
        bot: AuxObject,
        calc: BotCalculationContext,
        diffball: boolean = false
    ): Promise {
        bot = merge(
            bot,
            diffball
                ? {
                      tags: {
                          ['auxShape']: 'sphere',
                      },
                      values: {
                          ['auxShape']: 'sphere',
                      },
                  }
                : {}
        );

        this._bot.bot = bot;
        this._bot.botUpdated(bot, new Set(), calc);
github casual-simulation / aux / src / aux-vm-browser / partitions / ProxyClientPartition.ts View on Github external
private _handleOnBotsUpdated(bots: UpdatedBot[]): void {
        let newState = Object.assign({}, this.state);
        for (let b of bots) {
            const existing = newState[b.bot.id];
            newState[b.bot.id] = merge(existing, b.bot);
        }
        this.state = newState;
        this._onBotsUpdated.next(bots);
    }
github casual-simulation / aux / src / aux-server / aux-web / shared / RecentFilesManager.ts View on Github external
addFileDiff(file: File, updateTags: boolean = false) {
        let id: string;
        if (isDiff(null, file)) {
            id = file.id;
        } else {
            id = `diff-${file.id}`;
        }
        this._cleanFiles(id, file);
        let { 'aux.diff': diff, 'aux.diffTags': t, ...others } = file.tags;

        const f = merge(file, {
            id: id,
            tags: {
                'aux.diff': true,
                'aux.diffTags':
                    updateTags || !t
                        ? keys(others).filter(t => !isTagWellKnown(t))
                        : t,
            },
        });
        this.files.unshift(f);
        this._trimList();
        this._updateSelectedRecentFile();
        this._onUpdated.next();
    }
github casual-simulation / aux / src / aux-server / server / modules / BackupModule2.ts View on Github external
function calculateOptions(options: BackupOptions): BackupOptions {
    return merge(
        {
            includeArchived: true,
        },
        options || {}
    );
}