Initial commit

This commit is contained in:
Alejandro Martinez
2026-02-12 02:04:10 +01:00
commit f09af719cf
13433 changed files with 2193445 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
function c(n) {
const t = a(n);
return new ReadableStream(
{
async pull(e) {
const { value: r, done: o } = await t.next();
o ? e.close() : e.enqueue(r);
},
async cancel(e) {
if (typeof t.return == "function" && typeof await t.return(e) != "object")
throw new TypeError("return() fulfills with a non-object.");
return e;
}
},
new CountQueuingStrategy({
highWaterMark: 0
})
);
}
function a(n) {
let t = n[Symbol.asyncIterator]?.bind(n);
if (t === void 0) {
const r = n[Symbol.iterator](), o = {
[Symbol.iterator]: () => r
};
t = async function* () {
return yield* o;
};
}
return t();
}
export {
c as fromAnyIterable
};