12345678910111213141516171819202122232425262728 |
- 'use strict';
- var _ = {
- isFunction: require('lodash/isFunction'),
- };
- var { from, of } = require('rxjs');
- var runAsync = require('run-async');
- exports.fetchAsyncQuestionProperty = function (question, prop, answers) {
- if (!_.isFunction(question[prop])) {
- return of(question);
- }
- return from(
- runAsync(question[prop])(answers).then((value) => {
- question[prop] = value;
- return question;
- })
- );
- };
|