您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.js 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Generated by CoffeeScript 1.7.1
  2. (function() {
  3. var exports, iferr, printerr, throwerr, tiferr,
  4. __slice = [].slice;
  5. iferr = function(fail, succ) {
  6. return function() {
  7. var a, err;
  8. err = arguments[0], a = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
  9. if (err != null) {
  10. return fail(err);
  11. } else {
  12. return typeof succ === "function" ? succ.apply(null, a) : void 0;
  13. }
  14. };
  15. };
  16. tiferr = function(fail, succ) {
  17. return iferr(fail, function() {
  18. var a, err;
  19. a = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
  20. try {
  21. return succ.apply(null, a);
  22. } catch (_error) {
  23. err = _error;
  24. return fail(err);
  25. }
  26. });
  27. };
  28. throwerr = iferr.bind(null, function(err) {
  29. throw err;
  30. });
  31. printerr = iferr(function(err) {
  32. return console.error(err.stack || err);
  33. });
  34. module.exports = exports = iferr;
  35. exports.iferr = iferr;
  36. exports.tiferr = tiferr;
  37. exports.throwerr = throwerr;
  38. exports.printerr = printerr;
  39. }).call(this);