Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function _makeIteratorFromFunction(fn, context, args) {
let value;
if (args[0] instanceof Arguments) {
value = fn.apply(context, args[0].args);
} else {
value = fn.apply(context, args);
}
if (isGeneratorIterator(value)) {
return new GeneratorFunctionIterator(value);
} else {
return new RegularFunctionIterator(value);
}
}