Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
}
function calculateOptions(options: BackupOptions): BackupOptions {
return merge(
{
includeArchived: true,
},
options || {}
);
}
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);
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);
}
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();
}
function calculateOptions(options: BackupOptions): BackupOptions {
return merge(
{
includeArchived: true,
},
options || {}
);
}