MCPcopy Create free account
hub / github.com/WinterTC55/iter-streams / syncToAsync

Function syncToAsync

src/pull.js:931–954  ·  view source on GitHub ↗

* Convert sync iterable to async iterable.

(source)

Source from the content-addressed store, hash-verified

929 * Convert sync iterable to async iterable.
930 */
931function syncToAsync(source) {
932 return __asyncGenerator(this, arguments, function syncToAsync_1() {
933 var _i, source_5, item;
934 return __generator(this, function (_a) {
935 switch (_a.label) {
936 case 0:
937 _i = 0, source_5 = source;
938 _a.label = 1;
939 case 1:
940 if (!(_i < source_5.length)) return [3 /*break*/, 5];
941 item = source_5[_i];
942 return [4 /*yield*/, __await(item)];
943 case 2: return [4 /*yield*/, _a.sent()];
944 case 3:
945 _a.sent();
946 _a.label = 4;
947 case 4:
948 _i++;
949 return [3 /*break*/, 1];
950 case 5: return [2 /*return*/];
951 }
952 });
953 });
954}
955/**
956 * Create an async pipeline from source through transforms.
957 */

Callers 1

createAsyncPipelineFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected