1234567891011121314151617181920212223242526 |
- 'use strict';
- var _ = require('lodash');
- 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;
- })
- );
- };
|