
With API V3 we have some relationships (like lastBuild on branch) specified as asynchronuous, so sometimes we may deal with promises. This commit fixes the situation by handling both plain records and promises.
10 lines
218 B
JavaScript
10 lines
218 B
JavaScript
export default function(anObjectOrAPromise, callback) {
|
|
if(anObjectOrAPromise.then) {
|
|
anObjectOrAPromise.then(function(result) {
|
|
callback(result);
|
|
});
|
|
} else {
|
|
callback(anObjectOrAPromise);
|
|
}
|
|
}
|