chore(xo-server/utils): remove unused pDebug
This commit is contained in:
parent
e0a3b8ace8
commit
f6fcae4489
@ -6,7 +6,6 @@ import humanFormat from 'human-format'
|
||||
import isArray from 'lodash/isArray'
|
||||
import isString from 'lodash/isString'
|
||||
import keys from 'lodash/keys'
|
||||
import kindOf from 'kindof'
|
||||
import multiKeyHashInt from 'multikey-hash'
|
||||
import pick from 'lodash/pick'
|
||||
import tmp from 'tmp'
|
||||
@ -192,35 +191,6 @@ export const noop = () => {}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// Usage: pDebug(promise, name) or promise::pDebug(name)
|
||||
export function pDebug (promise, name) {
|
||||
if (arguments.length === 1) {
|
||||
name = promise
|
||||
promise = this
|
||||
}
|
||||
|
||||
Promise.resolve(promise).then(
|
||||
value => {
|
||||
console.log(
|
||||
'%s',
|
||||
`Promise ${name} resolved${
|
||||
value !== undefined ? ` with ${kindOf(value)}` : ''
|
||||
}`
|
||||
)
|
||||
},
|
||||
reason => {
|
||||
console.log(
|
||||
'%s',
|
||||
`Promise ${name} rejected${
|
||||
reason !== undefined ? ` with ${kindOf(reason)}` : ''
|
||||
}`
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
return promise
|
||||
}
|
||||
|
||||
// Given a collection (array or object) which contains promises,
|
||||
// return a promise that is fulfilled when all the items in the
|
||||
// collection are either fulfilled or rejected.
|
||||
|
Loading…
Reference in New Issue
Block a user