MCPcopy Create free account
hub / github.com/microsoft/SandDance / _makeBlobIterator

Function _makeBlobIterator

docs/app/js/sanddance-app.js:56391–56423  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56389 return _makeBlobIterator.apply(this, arguments);
56390}
56391function _makeBlobIterator() {
56392 _makeBlobIterator = (0, _wrapAsyncGeneratorDefault.default)((0, _regeneratorDefault.default).mark(function _callee(file) {
56393 var options, chunkSize, offset, end, chunk, _args = arguments;
56394 return (0, _regeneratorDefault.default).wrap(function _callee$(_context) {
56395 while(true)switch(_context.prev = _context.next){
56396 case 0:
56397 options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
56398 chunkSize = options.chunkSize || DEFAULT_CHUNK_SIZE;
56399 offset = 0;
56400 case 3:
56401 if (!(offset < file.size)) {
56402 _context.next = 13;
56403 break;
56404 }
56405 end = offset + chunkSize;
56406 _context.next = 7;
56407 return (0, _awaitAsyncGeneratorDefault.default)(readFileSlice(file, offset, end));
56408 case 7:
56409 chunk = _context.sent;
56410 offset = end;
56411 _context.next = 11;
56412 return chunk;
56413 case 11:
56414 _context.next = 3;
56415 break;
56416 case 13:
56417 case "end":
56418 return _context.stop();
56419 }
56420 }, _callee);
56421 }));
56422 return _makeBlobIterator.apply(this, arguments);
56423}
56424function readFileSlice(_x2, _x3, _x4) {
56425 return _readFileSlice.apply(this, arguments);
56426}

Callers

nothing calls this directly

Calls 1

readFileSliceFunction · 0.70

Tested by

no test coverage detected