chore(xo-server/http): use @xen-orchestra/defined
This commit is contained in:
parent
1c9b4cf552
commit
a7f5f8889c
@ -56,19 +56,6 @@ export function extractProperty(obj, prop) {
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// Returns the first defined (non-undefined) value.
|
||||
export const firstDefined = function () {
|
||||
const n = arguments.length
|
||||
for (let i = 0; i < n; ++i) {
|
||||
const arg = arguments[i]
|
||||
if (arg !== undefined) {
|
||||
return arg
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
export const getUserPublicProperties = user =>
|
||||
pick(user.properties || user, 'authProviders', 'id', 'email', 'groups', 'permission', 'preferences')
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
import hrp from 'http-request-plus'
|
||||
import ProxyAgent from 'proxy-agent'
|
||||
|
||||
import { firstDefined } from '../utils'
|
||||
import firstDefined from '@xen-orchestra/defined'
|
||||
|
||||
export default class Http {
|
||||
// whether XO has a proxy set from its own config/environment
|
||||
|
Loading…
Reference in New Issue
Block a user