@sec-ant/readable-stream
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -22,7 +22,7 @@ /** | ||
* Get an async iterable iterator from a readable stream | ||
* @param this | ||
* @param readableStream | ||
* @param readableStreamIteratorOptions | ||
* @returns | ||
*/ | ||
export declare function asyncIterator<R, TReturn>(this: ReadableStream<R>, { preventCancel }?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterableIterator<R, TReturn>; | ||
export declare function asyncIterator<R, TReturn>(readableStream: ReadableStream<R>, { preventCancel }?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterableIterator<R, TReturn>; | ||
export {}; |
@@ -1,3 +0,5 @@ | ||
import { asyncIterator as e } from "../ponyfill/asyncIterator.js"; | ||
ReadableStream.prototype.values ??= ReadableStream.prototype[Symbol.asyncIterator] ??= e; | ||
import { asyncIterator as t } from "../ponyfill/asyncIterator.js"; | ||
ReadableStream.prototype.values ??= ReadableStream.prototype[Symbol.asyncIterator] ??= function(...e) { | ||
return t(this, ...e); | ||
}; | ||
ReadableStream.prototype[Symbol.asyncIterator] ??= ReadableStream.prototype.values; |
@@ -1,2 +0,2 @@ | ||
const a = Object.getPrototypeOf( | ||
const c = Object.getPrototypeOf( | ||
Object.getPrototypeOf( | ||
@@ -8,3 +8,3 @@ /* istanbul ignore next */ | ||
); | ||
class c { | ||
class u { | ||
#t; | ||
@@ -67,3 +67,3 @@ #n; | ||
Object.defineProperty(o, "name", { value: "return" }); | ||
const u = Object.create(a, { | ||
const l = Object.create(c, { | ||
next: { | ||
@@ -82,8 +82,8 @@ enumerable: !0, | ||
}); | ||
function h({ preventCancel: r = !1 } = {}) { | ||
const e = this.getReader(), t = new c( | ||
e, | ||
r | ||
), s = Object.create(u); | ||
return s[n] = t, s; | ||
function h(r, { preventCancel: e = !1 } = {}) { | ||
const t = r.getReader(), a = new u( | ||
t, | ||
e | ||
), s = Object.create(l); | ||
return s[n] = a, s; | ||
} | ||
@@ -90,0 +90,0 @@ export { |
@@ -5,3 +5,3 @@ { | ||
"private": false, | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"type": "module", | ||
@@ -55,4 +55,2 @@ "files": ["./dist"], | ||
"scripts": { | ||
"install:ci": "npm ci && npx playwright install --with-deps", | ||
"install:codesandbox": "npm ci && ./scripts/prepare.sh", | ||
"update-hooks": "simple-git-hooks", | ||
@@ -65,3 +63,3 @@ "changeset": "changeset", | ||
"format": "conc \"npm:format:prettier\" \"npm:format:biome\"", | ||
"check:biome": "biome check --apply .", | ||
"check:biome": "biome check --write .", | ||
"check": "conc \"npm:format:prettier\" \"npm:check:biome\"", | ||
@@ -82,19 +80,19 @@ "prebuild": "npm run check && npm run type-check", | ||
"devDependencies": { | ||
"@biomejs/biome": "1.6.1", | ||
"@changesets/cli": "^2.27.1", | ||
"@commitlint/cli": "^19.1.0", | ||
"@commitlint/config-conventional": "^19.1.0", | ||
"@vitest/browser": "^1.3.1", | ||
"@vitest/coverage-istanbul": "^1.3.1", | ||
"@vitest/ui": "^1.3.1", | ||
"@biomejs/biome": "1.8.3", | ||
"@changesets/cli": "^2.27.7", | ||
"@commitlint/cli": "^19.3.0", | ||
"@commitlint/config-conventional": "^19.2.2", | ||
"@vitest/browser": "^2.0.3", | ||
"@vitest/coverage-istanbul": "^2.0.3", | ||
"@vitest/ui": "^2.0.3", | ||
"concurrently": "^8.2.2", | ||
"copy-files-from-to": "^3.9.1", | ||
"lint-staged": "^15.2.2", | ||
"playwright": "^1.42.1", | ||
"prettier": "^3.2.5", | ||
"simple-git-hooks": "^2.10.0", | ||
"typescript": "^5.4.2", | ||
"vite": "^5.1.6", | ||
"vitest": "^1.3.1" | ||
"copy-files-from-to": "^3.11.0", | ||
"lint-staged": "^15.2.7", | ||
"playwright": "^1.45.2", | ||
"prettier": "^3.3.3", | ||
"simple-git-hooks": "^2.11.1", | ||
"typescript": "^5.5.3", | ||
"vite": "^5.3.4", | ||
"vitest": "^2.0.3" | ||
} | ||
} |
@@ -56,3 +56,3 @@ # @sec-ant/readable-stream | ||
let total = 0; | ||
for await (const chunk of asyncIterator.call(readableStream)) { | ||
for await (const chunk of asyncIterator(readableStream)) { | ||
total += chunk.length; | ||
@@ -59,0 +59,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
217
15493