diff options
author | RaindropsSys <contact@minteck.org> | 2023-03-21 16:21:21 +0100 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-03-21 16:21:21 +0100 |
commit | 475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd (patch) | |
tree | 2cff46debf9c1e13892e7babff9deb6874ecb4b2 /includes/external/discord/node_modules/readable-web-to-node-stream | |
parent | 7ccc2de87f9e25c715dc09b9aba4eb5c66f80424 (diff) | |
download | pluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.tar.gz pluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.tar.bz2 pluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.zip |
Updated 26 files and added 1074 files (automated)
Diffstat (limited to 'includes/external/discord/node_modules/readable-web-to-node-stream')
3 files changed, 194 insertions, 0 deletions
diff --git a/includes/external/discord/node_modules/readable-web-to-node-stream/README.md b/includes/external/discord/node_modules/readable-web-to-node-stream/README.md new file mode 100644 index 0000000..4a717d8 --- /dev/null +++ b/includes/external/discord/node_modules/readable-web-to-node-stream/README.md @@ -0,0 +1,71 @@ +![Karma CI](https://github.com/Borewit/readable-web-to-node-stream/workflows/Karma%20CI/badge.svg) +[![NPM version](https://badge.fury.io/js/readable-web-to-node-stream.svg)](https://npmjs.org/package/readable-web-to-node-stream) +[![npm downloads](http://img.shields.io/npm/dm/readable-web-to-node-stream.svg)](https://npmcharts.com/compare/readable-web-to-node-stream) +[![dependencies Status](https://david-dm.org/Borewit/readable-web-to-node-stream/status.svg)](https://david-dm.org/Borewit/readable-web-to-node-stream) +[![Known Vulnerabilities](https://snyk.io/test/github/Borewit/readable-web-to-node-stream/badge.svg?targetFile=package.json)](https://snyk.io/test/github/Borewit/readable-web-to-node-stream?targetFile=package.json) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/d4b511481b3a4634b6ca5c0724407eb9)](https://www.codacy.com/gh/Borewit/peek-readable/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Borewit/peek-readable&utm_campaign=Badge_Grade) +[![Coverage Status](https://coveralls.io/repos/github/Borewit/readable-web-to-node-stream/badge.svg?branch=master)](https://coveralls.io/github/Borewit/readable-web-to-node-stream?branch=master) +[![Minified size](https://badgen.net/bundlephobia/min/readable-web-to-node-stream)](https://bundlephobia.com/result?p=readable-web-to-node-stream) + +# readable-web-to-node-stream + +Converts a [Web-API readable stream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader) into a [Node.js readable stream](https://nodejs.org/api/stream.html#stream_readable_streams). + +## Installation +Install via [npm](http://npmjs.org/): + +```bash +npm install readable-web-to-node-stream +``` +or or [yarn](https://yarnpkg.com/): +```bash +yarn add readable-web-to-node-stream +``` + +## Compatibility + +Source is written in TypeScript and compiled to ECMAScript 2017 (ES8). + +Unit tests are performed on the following browsers: + +* Google Chrome 74.0 +* Firefox 68.0 +* Safari 12.0 +* Opera 60.0 + +## Example + +Import readable-web-stream-to-node in JavaScript: +```js +const {ReadableWebToNodeStream} = require('readable-web-to-node-stream'); + +async function download(url) { + const response = await fetch(url); + const readableWebStream = response.body; + const nodeStream = new ReadableWebToNodeStream(readableWebStream); +} +``` + +## API + +**constructor(stream: ReadableStream): Promise<void>** + +`stream: ReadableStream`: the [Web-API readable stream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader). + +**close(): Promise<void>** +Will cancel close the Readable-node stream, and will release Web-API-readable-stream. + +**waitForReadToComplete(): Promise<void>** +If there is no unresolved read call to Web-API ReadableStream immediately returns, otherwise it will wait until the read is resolved. + +## Licence + +(The MIT License) + +Copyright (c) 2019 Borewit + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/includes/external/discord/node_modules/readable-web-to-node-stream/lib/index.d.ts b/includes/external/discord/node_modules/readable-web-to-node-stream/lib/index.d.ts new file mode 100644 index 0000000..7d7145b --- /dev/null +++ b/includes/external/discord/node_modules/readable-web-to-node-stream/lib/index.d.ts @@ -0,0 +1,39 @@ +import { Readable } from 'readable-stream'; +/** + * Converts a Web-API stream into Node stream.Readable class + * Node stream readable: https://nodejs.org/api/stream.html#stream_readable_streams + * Web API readable-stream: https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream + * Node readable stream: https://nodejs.org/api/stream.html#stream_readable_streams + */ +export declare class ReadableWebToNodeStream extends Readable { + bytesRead: number; + released: boolean; + /** + * Default web API stream reader + * https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader + */ + private reader; + private pendingRead; + /** + * + * @param stream ReadableStream: https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream + */ + constructor(stream: ReadableStream); + /** + * Implementation of readable._read(size). + * When readable._read() is called, if data is available from the resource, + * the implementation should begin pushing that data into the read queue + * https://nodejs.org/api/stream.html#stream_readable_read_size_1 + */ + _read(): Promise<void>; + /** + * If there is no unresolved read call to Web-API ReadableStream immediately returns; + * otherwise will wait until the read is resolved. + */ + waitForReadToComplete(): Promise<void>; + /** + * Close wrapper + */ + close(): Promise<void>; + private syncAndRelease; +} diff --git a/includes/external/discord/node_modules/readable-web-to-node-stream/package.json b/includes/external/discord/node_modules/readable-web-to-node-stream/package.json new file mode 100644 index 0000000..057c39f --- /dev/null +++ b/includes/external/discord/node_modules/readable-web-to-node-stream/package.json @@ -0,0 +1,84 @@ +{ + "name": "readable-web-to-node-stream", + "version": "3.0.2", + "description": "Converts a Web-API readable-stream into a Node readable-stream.", + "main": "lib/index.js", + "files": [ + "lib/**/*.js", + "lib/**/*.d.ts" + ], + "engines": { + "node": ">=8" + }, + "types": "lib/index.d.ts", + "scripts": { + "clean": "del-cli lib/**/*.js lib/**/*.js.map lib/**/*.d.ts coverage", + "compile-lib": "tsc -p lib/tsconfig.json", + "compile-test": "tsc -p lib/tsconfig.spec.json", + "prepublishOnly": "yarn run build", + "build": "npm run compile-lib && npm run compile-test", + "tslint": "tslint 'lib/**/*.ts' --exclude 'lib/**/*.d.ts'", + "eslint": "eslint karma.conf.js", + "lint": "npm run tslint && npm run eslint", + "test": "karma start --single-run", + "karma": "karma start", + "karma-firefox": "karma start --browsers Firefox", + "karma-once": "karma start --browsers Chrome --single-run", + "travis-karma": "karma start --browsers Firefox --single-run --reporters coverage-istanbul,spec", + "browserstack": "karma start --browsers bs_win_chrome,bs_win_firefox,bs_osx_safari --single-run --reporters coverage-istanbul,spec", + "travis-karma-browserstack": "karma start --browsers bs_win_chrome,bs_win_firefox,bs_osx_safari --single-run --reporters coverage-istanbul,spec,BrowserStack", + "post-coveralls": "coveralls < coverage/lcov.info", + "post-codacy": " codacy-coverage < coverage/lcov.info" + }, + "keywords": [ + "stream.readable", + "web", + "node", + "browser", + "stream", + "covert", + "coverter", + "readable", + "readablestream" + ], + "repository": "https://github.com/Borewit/readable-web-to-node-stream.git", + "author": { + "name": "Borewit", + "url": "https://github.com/Borewit" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/Borewit/readable-web-to-node-stream/issues" + }, + "dependencies": { + "readable-stream": "^3.6.0" + }, + "devDependencies": { + "@types/jasmine": "^3.8.1", + "@types/node": "^16.3.1", + "@types/readable-stream": "^2.3.9", + "coveralls": "^3.1.0", + "del-cli": "^3.0.1", + "eslint": "^7.18.0", + "istanbul-instrumenter-loader": "^3.0.1", + "jasmine-core": "^3.8.0", + "karma": "^6.3.4", + "karma-browserstack-launcher": "^1.6.0", + "karma-chrome-launcher": "^3.1.0", + "karma-coverage-istanbul-reporter": "^3.0.3", + "karma-firefox-launcher": "^2.1.0", + "karma-jasmine": "^4.0.1", + "karma-jasmine-html-reporter": "^1.7.0", + "karma-spec-reporter": "^0.0.32", + "karma-webpack": "^5.0.0", + "music-metadata-browser": "^2.2.7", + "ts-loader": "^8.0.14", + "tslint": "^6.1.3", + "typescript": "^4.3.5", + "webpack": "^4.46.0" + } +} |