({ onError, onResult, resultReturns, rethrowIfPossible })
| 9 | |
| 10 | class SyncWaterfallHookCodeFactory extends HookCodeFactory { |
| 11 | content({ onError, onResult, resultReturns, rethrowIfPossible }) { |
| 12 | return this.callTapsSeries({ |
| 13 | onError: (i, err) => onError(err), |
| 14 | onResult: (i, result, next) => { |
| 15 | let code = ""; |
| 16 | code += `if(${result} !== undefined) {\n`; |
| 17 | code += `${this._args[0]} = ${result};\n`; |
| 18 | code += "}\n"; |
| 19 | code += next(); |
| 20 | return code; |
| 21 | }, |
| 22 | onDone: () => onResult(this._args[0]), |
| 23 | doneReturns: resultReturns, |
| 24 | rethrowIfPossible |
| 25 | }); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | const factory = new SyncWaterfallHookCodeFactory(); |
nothing calls this directly
no test coverage detected