This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| function isGenerator(obj) { | |
| return typeof obj.next === 'function' && typeof obj.throw === 'function'; | |
| } | |
| // co returns a promise that resolves to the return value of the generator arg | |
| function co(generator) { | |
| return new Promise(resolve => { | |
| function next(result) { |