Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private _removeCommand(bundle: { id: string }): void {
const { id } = bundle;
if (Private.customCommands.has(id)) {
Private.customCommands.get(id).dispose();
}
const commands = this.get('_commands').slice();
ArrayExt.removeAllWhere(commands, (w: any) => w.id === id);
this.set('_commands', commands);
this.save_changes();
this._sendCommandList();
}
MessageLoop.installMessageHook(pWidget, (handler: any, msg: Message) => {
switch (msg.type) {
case 'close-request': {
const widgets = this.get('_widgets').slice();
ArrayExt.removeAllWhere(widgets, (w: any) => w.id === handler.id);
this.set('_widgets', widgets);
this.save_changes();
break;
}
}
return true;
});
function cleanupHooks(hooks: Array): void {
ArrayExt.removeAllWhere(hooks, isNull);
}
return new DisposableDelegate(() => {
ArrayExt.removeAllWhere(this._keydownHandlers, val => val === handler);
});
}
function cleanupConnections(connections: IConnection[]): void {
ArrayExt.removeAllWhere(connections, isDeadConnection);
}