"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = toResultObject;
function toResultObject() {
  return function (promise) {
    return promise.then(function (val) {
      return { success: true, val };
    }).catch(function (error) {
      return { success: false, error, val: null };
    });
  };
}