|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
919 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
|---|
| 4 | value: true
|
|---|
| 5 | });
|
|---|
| 6 | exports.default = consoleFunc;
|
|---|
| 7 |
|
|---|
| 8 | var _wrapAsync = require('./wrapAsync.js');
|
|---|
| 9 |
|
|---|
| 10 | var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
|
|---|
| 11 |
|
|---|
| 12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|---|
| 13 |
|
|---|
| 14 | function consoleFunc(name) {
|
|---|
| 15 | return (fn, ...args) => (0, _wrapAsync2.default)(fn)(...args, (err, ...resultArgs) => {
|
|---|
| 16 | /* istanbul ignore else */
|
|---|
| 17 | if (typeof console === 'object') {
|
|---|
| 18 | /* istanbul ignore else */
|
|---|
| 19 | if (err) {
|
|---|
| 20 | /* istanbul ignore else */
|
|---|
| 21 | if (console.error) {
|
|---|
| 22 | console.error(err);
|
|---|
| 23 | }
|
|---|
| 24 | } else if (console[name]) {
|
|---|
| 25 | /* istanbul ignore else */
|
|---|
| 26 | resultArgs.forEach(x => console[name](x));
|
|---|
| 27 | }
|
|---|
| 28 | }
|
|---|
| 29 | });
|
|---|
| 30 | }
|
|---|
| 31 | module.exports = exports.default; |
|---|
Note:
See
TracBrowser
for help on using the repository browser.