// 默认成功处理
const defOnResolve = function (...res) {
  return Promise.resolve(...res);
};

// 默认失败处理
const defOnReject = function (err) {
  return Promise.reject(err);
};

/**
 * newPromise 默认处理
 * @param {*} executor 
 */
export default function (executor) {
  return new Promise(executor).then(defOnResolve, defOnReject);
}