@atomist/automation-client
Version:
Atomist API for software low-level client
30 lines • 792 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function isActionResult(a) {
return a.target !== undefined && a.success !== undefined;
}
exports.isActionResult = isActionResult;
/**
* Convenient implementation of ActionResult
*/
class SimpleActionResult {
constructor(target, success) {
this.target = target;
this.success = success;
}
}
exports.SimpleActionResult = SimpleActionResult;
function successOn(t) {
return new SimpleActionResult(t, true);
}
exports.successOn = successOn;
function failureOn(t, err, f /* function */) {
return {
success: false,
target: t,
error: err,
errorStep: f ? f.name : undefined,
};
}
exports.failureOn = failureOn;
//# sourceMappingURL=ActionResult.js.map