summaryrefslogtreecommitdiff
path: root/frontend-old/node_modules/@protobufjs/fetch
diff options
context:
space:
mode:
Diffstat (limited to 'frontend-old/node_modules/@protobufjs/fetch')
-rw-r--r--frontend-old/node_modules/@protobufjs/fetch/LICENSE26
-rw-r--r--frontend-old/node_modules/@protobufjs/fetch/README.md13
-rw-r--r--frontend-old/node_modules/@protobufjs/fetch/index.d.ts56
-rw-r--r--frontend-old/node_modules/@protobufjs/fetch/index.js115
-rw-r--r--frontend-old/node_modules/@protobufjs/fetch/package.json25
-rw-r--r--frontend-old/node_modules/@protobufjs/fetch/tests/index.js16
6 files changed, 0 insertions, 251 deletions
diff --git a/frontend-old/node_modules/@protobufjs/fetch/LICENSE b/frontend-old/node_modules/@protobufjs/fetch/LICENSE
deleted file mode 100644
index 2a2d560..0000000
--- a/frontend-old/node_modules/@protobufjs/fetch/LICENSE
+++ /dev/null
@@ -1,26 +0,0 @@
-Copyright (c) 2016, Daniel Wirtz All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-* Neither the name of its author, nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/frontend-old/node_modules/@protobufjs/fetch/README.md b/frontend-old/node_modules/@protobufjs/fetch/README.md
deleted file mode 100644
index 11088a0..0000000
--- a/frontend-old/node_modules/@protobufjs/fetch/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-@protobufjs/fetch
-=================
-[![npm](https://img.shields.io/npm/v/@protobufjs/fetch.svg)](https://www.npmjs.com/package/@protobufjs/fetch)
-
-Fetches the contents of a file accross node and browsers.
-
-API
----
-
-* **fetch(path: `string`, [options: { binary: boolean } ], [callback: `function(error: ?Error, [contents: string])`]): `Promise<string|Uint8Array>|undefined`**
- Fetches the contents of a file.
-
-**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
diff --git a/frontend-old/node_modules/@protobufjs/fetch/index.d.ts b/frontend-old/node_modules/@protobufjs/fetch/index.d.ts
deleted file mode 100644
index 77cf9f3..0000000
--- a/frontend-old/node_modules/@protobufjs/fetch/index.d.ts
+++ /dev/null
@@ -1,56 +0,0 @@
-export = fetch;
-
-/**
- * Node-style callback as used by {@link util.fetch}.
- * @typedef FetchCallback
- * @type {function}
- * @param {?Error} error Error, if any, otherwise `null`
- * @param {string} [contents] File contents, if there hasn't been an error
- * @returns {undefined}
- */
-type FetchCallback = (error: Error, contents?: string) => void;
-
-/**
- * Options as used by {@link util.fetch}.
- * @typedef FetchOptions
- * @type {Object}
- * @property {boolean} [binary=false] Whether expecting a binary response
- * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest
- */
-
-interface FetchOptions {
- binary?: boolean;
- xhr?: boolean
-}
-
-/**
- * Fetches the contents of a file.
- * @memberof util
- * @param {string} filename File path or url
- * @param {FetchOptions} options Fetch options
- * @param {FetchCallback} callback Callback function
- * @returns {undefined}
- */
-declare function fetch(filename: string, options: FetchOptions, callback: FetchCallback): void;
-
-/**
- * Fetches the contents of a file.
- * @name util.fetch
- * @function
- * @param {string} path File path or url
- * @param {FetchCallback} callback Callback function
- * @returns {undefined}
- * @variation 2
- */
-declare function fetch(path: string, callback: FetchCallback): void;
-
-/**
- * Fetches the contents of a file.
- * @name util.fetch
- * @function
- * @param {string} path File path or url
- * @param {FetchOptions} [options] Fetch options
- * @returns {Promise<string|Uint8Array>} Promise
- * @variation 3
- */
-declare function fetch(path: string, options?: FetchOptions): Promise<(string|Uint8Array)>;
diff --git a/frontend-old/node_modules/@protobufjs/fetch/index.js b/frontend-old/node_modules/@protobufjs/fetch/index.js
deleted file mode 100644
index f2766f5..0000000
--- a/frontend-old/node_modules/@protobufjs/fetch/index.js
+++ /dev/null
@@ -1,115 +0,0 @@
-"use strict";
-module.exports = fetch;
-
-var asPromise = require("@protobufjs/aspromise"),
- inquire = require("@protobufjs/inquire");
-
-var fs = inquire("fs");
-
-/**
- * Node-style callback as used by {@link util.fetch}.
- * @typedef FetchCallback
- * @type {function}
- * @param {?Error} error Error, if any, otherwise `null`
- * @param {string} [contents] File contents, if there hasn't been an error
- * @returns {undefined}
- */
-
-/**
- * Options as used by {@link util.fetch}.
- * @typedef FetchOptions
- * @type {Object}
- * @property {boolean} [binary=false] Whether expecting a binary response
- * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest
- */
-
-/**
- * Fetches the contents of a file.
- * @memberof util
- * @param {string} filename File path or url
- * @param {FetchOptions} options Fetch options
- * @param {FetchCallback} callback Callback function
- * @returns {undefined}
- */
-function fetch(filename, options, callback) {
- if (typeof options === "function") {
- callback = options;
- options = {};
- } else if (!options)
- options = {};
-
- if (!callback)
- return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this
-
- // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.
- if (!options.xhr && fs && fs.readFile)
- return fs.readFile(filename, function fetchReadFileCallback(err, contents) {
- return err && typeof XMLHttpRequest !== "undefined"
- ? fetch.xhr(filename, options, callback)
- : err
- ? callback(err)
- : callback(null, options.binary ? contents : contents.toString("utf8"));
- });
-
- // use the XHR version otherwise.
- return fetch.xhr(filename, options, callback);
-}
-
-/**
- * Fetches the contents of a file.
- * @name util.fetch
- * @function
- * @param {string} path File path or url
- * @param {FetchCallback} callback Callback function
- * @returns {undefined}
- * @variation 2
- */
-
-/**
- * Fetches the contents of a file.
- * @name util.fetch
- * @function
- * @param {string} path File path or url
- * @param {FetchOptions} [options] Fetch options
- * @returns {Promise<string|Uint8Array>} Promise
- * @variation 3
- */
-
-/**/
-fetch.xhr = function fetch_xhr(filename, options, callback) {
- var xhr = new XMLHttpRequest();
- xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {
-
- if (xhr.readyState !== 4)
- return undefined;
-
- // local cors security errors return status 0 / empty string, too. afaik this cannot be
- // reliably distinguished from an actually empty file for security reasons. feel free
- // to send a pull request if you are aware of a solution.
- if (xhr.status !== 0 && xhr.status !== 200)
- return callback(Error("status " + xhr.status));
-
- // if binary data is expected, make sure that some sort of array is returned, even if
- // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.
- if (options.binary) {
- var buffer = xhr.response;
- if (!buffer) {
- buffer = [];
- for (var i = 0; i < xhr.responseText.length; ++i)
- buffer.push(xhr.responseText.charCodeAt(i) & 255);
- }
- return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer);
- }
- return callback(null, xhr.responseText);
- };
-
- if (options.binary) {
- // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers
- if ("overrideMimeType" in xhr)
- xhr.overrideMimeType("text/plain; charset=x-user-defined");
- xhr.responseType = "arraybuffer";
- }
-
- xhr.open("GET", filename);
- xhr.send();
-};
diff --git a/frontend-old/node_modules/@protobufjs/fetch/package.json b/frontend-old/node_modules/@protobufjs/fetch/package.json
deleted file mode 100644
index 10096ea..0000000
--- a/frontend-old/node_modules/@protobufjs/fetch/package.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "@protobufjs/fetch",
- "description": "Fetches the contents of a file accross node and browsers.",
- "version": "1.1.0",
- "author": "Daniel Wirtz <dcode+protobufjs@dcode.io>",
- "repository": {
- "type": "git",
- "url": "https://github.com/dcodeIO/protobuf.js.git"
- },
- "dependencies": {
- "@protobufjs/aspromise": "^1.1.1",
- "@protobufjs/inquire": "^1.1.0"
- },
- "license": "BSD-3-Clause",
- "main": "index.js",
- "types": "index.d.ts",
- "devDependencies": {
- "istanbul": "^0.4.5",
- "tape": "^4.6.3"
- },
- "scripts": {
- "test": "tape tests/*.js",
- "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js"
- }
-} \ No newline at end of file
diff --git a/frontend-old/node_modules/@protobufjs/fetch/tests/index.js b/frontend-old/node_modules/@protobufjs/fetch/tests/index.js
deleted file mode 100644
index 3cb0dae..0000000
--- a/frontend-old/node_modules/@protobufjs/fetch/tests/index.js
+++ /dev/null
@@ -1,16 +0,0 @@
-var tape = require("tape");
-
-var fetch = require("..");
-
-tape.test("fetch", function(test) {
-
- if (typeof Promise !== "undefined") {
- var promise = fetch("NOTFOUND");
- promise.catch(function() {});
- test.ok(promise instanceof Promise, "should return a promise if callback has been omitted");
- }
-
- // TODO - some way to test this properly?
-
- test.end();
-});