chore(xo-server/http): use @xen-orchestra/defined

This commit is contained in:
Julien Fontanet 2021-04-07 12:15:33 +02:00
parent 1c9b4cf552
commit a7f5f8889c
2 changed files with 1 additions and 15 deletions

View File

@ -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')

View File

@ -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