Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!penultimate) {
localStorage.removeItem(lsKeys.last)
} else {
localStorage.setItem(lsKeys.last, JSON.stringify(penultimate))
}
}
// update the list of all runs
which.forEach(idx => {
list[idx] = null
})
list = list.filter(_ => _) // remove the nulls
localStorage.setItem(lsKeys.history, JSON.stringify(list))
eventBus.emit('/wrk/history/delete', which)
return true
}
role: 'replacement',
badge: isZip ? 'zip' : 'jar'
}
]
})
options.action.annotations.push({ key: 'binary', value: true })
}
if (options.native) {
// native code blackbox action
options.action.exec.kind = 'blackbox'
options.action.exec.image = 'openwhisk/dockerskeleton'
}
eventBus.emit('/action/update', {
file: filepath,
action: { name: options.name, namespace: options.namespace }
})
// set the default kind
if (!options.action.exec.kind) {
if (options.kind) {
options.action.exec.kind = options.kind
} else {
const extension = filepath.substring(filepath.lastIndexOf('.') + 1)
if (extension) {
options.action.exec.kind = extensionToKind[extension] || extension
}
}
}
}
const makeThisTabActive = (tab.nextElementSibling as Tab) || (tab.previousElementSibling as Tab)
debug('makeThisTabActive', makeThisTabActive, tab.nextSibling)
switchTab(getTabId(makeThisTabActive), true)
}
// remove the tab state for the current tab
const tabState = tab.state
tabState.abortAllJobs()
tabState.closed = true
// remove the UI for the current tab
const tabButton = getTabButton(tab)
tab.parentNode.removeChild(tab)
tabButton.parentNode.removeChild(tabButton)
eventBus.emit('/tab/close', tab)
return true
}
const push = () => {
// notify the client of an incremental data point
if (eventBus) {
debug('row', row)
eventBus.emit('/wrk/iter', row)
}
// and also push on the overall list of results
results.push(row)
return true
}
setTimeout(async () => {
getReplImpl(tab)
eventBus.emit('/tab/new', tab)
})
async () =>
eventBus.emit('/auth/change', {
namespace: await namespace.current(),
subject: subject
}),
0
invoke: options => {
eventBus.emit('/action/invoke', {
name: options.name,
namespace: options.namespace
})
if (options && options.action && options.action.parameters) {
options.params =
options.action &&
options.action.parameters &&
options.action.parameters.reduce((M, kv) => {
M[kv.key] = kv.value
return M
}, {})
}
}
}
export const end = (): boolean => {
eventBus.emit('/wrk/terminate')
return true
}
const notifyOfHostChange = host => async () => {
eventBus.emit('/host/change', {
namespace: await namespace.current({ noNamespaceOk: true }),
host: host
})
}