Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 2x 2x 110x 110x 110x 14499x 14499x 110x 3x 3x 3x 110x | import { PrototypeTransform } from "./PrototypeTransform.js";
export class GeneratorTransform extends PrototypeTransform<Iterator<any>> {
uniqueId = 'Generator'
serializePrototypes = ['next', 'return', 'throw'];
check(data: any): data is Iterator<any> {
return (typeof data[Symbol.iterator] === 'function' || typeof data[Symbol.asyncIterator] === 'function') && typeof data.next === 'function';
}
override deserialize(data: any) {
data[Symbol.asyncIterator] = () => data
return data;
}
} |