summaryrefslogtreecommitdiff
path: root/together/node_modules/superagent/lib/node/parsers
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-08-21 17:31:56 +0200
committerMinteck <contact@minteck.org>2022-08-21 17:31:56 +0200
commita2df9a69dcc14cb70118cda2ded499055e7ee358 (patch)
tree6dd283e4e9452d38bce81ddaaae49b5335755842 /together/node_modules/superagent/lib/node/parsers
parent84dd0735820b16b60f600284d35183d76547a71f (diff)
downloadpluralconnect-a2df9a69dcc14cb70118cda2ded499055e7ee358.tar.gz
pluralconnect-a2df9a69dcc14cb70118cda2ded499055e7ee358.tar.bz2
pluralconnect-a2df9a69dcc14cb70118cda2ded499055e7ee358.zip
m. update
Diffstat (limited to 'together/node_modules/superagent/lib/node/parsers')
-rw-r--r--together/node_modules/superagent/lib/node/parsers/image.js13
-rw-r--r--together/node_modules/superagent/lib/node/parsers/index.js13
-rw-r--r--together/node_modules/superagent/lib/node/parsers/json.js26
-rw-r--r--together/node_modules/superagent/lib/node/parsers/text.js11
-rw-r--r--together/node_modules/superagent/lib/node/parsers/urlencoded.js22
5 files changed, 85 insertions, 0 deletions
diff --git a/together/node_modules/superagent/lib/node/parsers/image.js b/together/node_modules/superagent/lib/node/parsers/image.js
new file mode 100644
index 0000000..504f1f3
--- /dev/null
+++ b/together/node_modules/superagent/lib/node/parsers/image.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = (res, fn) => {
+ const data = []; // Binary data needs binary storage
+
+ res.on('data', chunk => {
+ data.push(chunk);
+ });
+ res.on('end', () => {
+ fn(null, Buffer.concat(data));
+ });
+};
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJkYXRhIiwib24iLCJjaHVuayIsInB1c2giLCJCdWZmZXIiLCJjb25jYXQiXSwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbm9kZS9wYXJzZXJzL2ltYWdlLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gKHJlcywgZm4pID0+IHtcbiAgY29uc3QgZGF0YSA9IFtdOyAvLyBCaW5hcnkgZGF0YSBuZWVkcyBiaW5hcnkgc3RvcmFnZVxuXG4gIHJlcy5vbignZGF0YScsIChjaHVuaykgPT4ge1xuICAgIGRhdGEucHVzaChjaHVuayk7XG4gIH0pO1xuICByZXMub24oJ2VuZCcsICgpID0+IHtcbiAgICBmbihudWxsLCBCdWZmZXIuY29uY2F0KGRhdGEpKTtcbiAgfSk7XG59O1xuIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxNQUFNLENBQUNDLE9BQVAsR0FBaUIsQ0FBQ0MsR0FBRCxFQUFNQyxFQUFOLEtBQWE7RUFDNUIsTUFBTUMsSUFBSSxHQUFHLEVBQWIsQ0FENEIsQ0FDWDs7RUFFakJGLEdBQUcsQ0FBQ0csRUFBSixDQUFPLE1BQVAsRUFBZ0JDLEtBQUQsSUFBVztJQUN4QkYsSUFBSSxDQUFDRyxJQUFMLENBQVVELEtBQVY7RUFDRCxDQUZEO0VBR0FKLEdBQUcsQ0FBQ0csRUFBSixDQUFPLEtBQVAsRUFBYyxNQUFNO0lBQ2xCRixFQUFFLENBQUMsSUFBRCxFQUFPSyxNQUFNLENBQUNDLE1BQVAsQ0FBY0wsSUFBZCxDQUFQLENBQUY7RUFDRCxDQUZEO0FBR0QsQ0FURCJ9 \ No newline at end of file
diff --git a/together/node_modules/superagent/lib/node/parsers/index.js b/together/node_modules/superagent/lib/node/parsers/index.js
new file mode 100644
index 0000000..a0afdf1
--- /dev/null
+++ b/together/node_modules/superagent/lib/node/parsers/index.js
@@ -0,0 +1,13 @@
+"use strict";
+
+exports['application/x-www-form-urlencoded'] = require('./urlencoded');
+exports['application/json'] = require('./json');
+exports.text = require('./text');
+exports['application/json-seq'] = exports.text;
+
+const binary = require('./image');
+
+exports['application/octet-stream'] = binary;
+exports['application/pdf'] = binary;
+exports.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dEI7O0FBRUFELE9BQU8sQ0FBQywwQkFBRCxDQUFQLEdBQXNDRyxNQUF0QztBQUNBSCxPQUFPLENBQUMsaUJBQUQsQ0FBUCxHQUE2QkcsTUFBN0I7QUFDQUgsT0FBTyxDQUFDSSxLQUFSLEdBQWdCRCxNQUFoQiJ9 \ No newline at end of file
diff --git a/together/node_modules/superagent/lib/node/parsers/json.js b/together/node_modules/superagent/lib/node/parsers/json.js
new file mode 100644
index 0000000..ccf6d35
--- /dev/null
+++ b/together/node_modules/superagent/lib/node/parsers/json.js
@@ -0,0 +1,26 @@
+"use strict";
+
+module.exports = function (res, fn) {
+ res.text = '';
+ res.setEncoding('utf8');
+ res.on('data', chunk => {
+ res.text += chunk;
+ });
+ res.on('end', () => {
+ let body;
+ let error;
+
+ try {
+ body = res.text && JSON.parse(res.text);
+ } catch (err) {
+ error = err; // issue #675: return the raw response if the response parsing fails
+
+ error.rawResponse = res.text || null; // issue #876: return the http status code if the response parsing fails
+
+ error.statusCode = res.statusCode;
+ } finally {
+ fn(error, body);
+ }
+ });
+};
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJ0ZXh0Iiwic2V0RW5jb2RpbmciLCJvbiIsImNodW5rIiwiYm9keSIsImVycm9yIiwiSlNPTiIsInBhcnNlIiwiZXJyIiwicmF3UmVzcG9uc2UiLCJzdGF0dXNDb2RlIl0sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL25vZGUvcGFyc2Vycy9qc29uLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKHJlcywgZm4pIHtcbiAgcmVzLnRleHQgPSAnJztcbiAgcmVzLnNldEVuY29kaW5nKCd1dGY4Jyk7XG4gIHJlcy5vbignZGF0YScsIChjaHVuaykgPT4ge1xuICAgIHJlcy50ZXh0ICs9IGNodW5rO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0FBRyxDQUFDRSxJQUFKLElBQVlNLElBQUksQ0FBQ0MsS0FBTCxDQUFXVCxHQUFHLENBQUNFLElBQWYsQ0FBbkI7SUFDRCxDQUZELENBRUUsT0FBT1EsR0FBUCxFQUFZO01BQ1pILEtBQUssR0FBR0csR0FBUixDQURZLENBRVo7O01BQ0FILEtBQUssQ0FBQ0ksV0FBTixHQUFvQlgsR0FBRyxDQUFDRSxJQUFKLElBQVksSUFBaEMsQ0FIWSxDQUlaOztNQUNBSyxLQUFLLENBQUNLLFVBQU4sR0FBbUJaLEdBQUcsQ0FBQ1ksVUFBdkI7SUFDRCxDQVJELFNBUVU7TUFDUlgsRUFBRSxDQUFDTSxLQUFELEVBQVFELElBQVIsQ0FBRjtJQUNEO0VBQ0YsQ0FkRDtBQWVELENBckJEIn0= \ No newline at end of file
diff --git a/together/node_modules/superagent/lib/node/parsers/text.js b/together/node_modules/superagent/lib/node/parsers/text.js
new file mode 100644
index 0000000..c8c3e16
--- /dev/null
+++ b/together/node_modules/superagent/lib/node/parsers/text.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = (res, fn) => {
+ res.text = '';
+ res.setEncoding('utf8');
+ res.on('data', chunk => {
+ res.text += chunk;
+ });
+ res.on('end', fn);
+};
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJ0ZXh0Iiwic2V0RW5jb2RpbmciLCJvbiIsImNodW5rIl0sInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL25vZGUvcGFyc2Vycy90ZXh0LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gKHJlcywgZm4pID0+IHtcbiAgcmVzLnRleHQgPSAnJztcbiAgcmVzLnNldEVuY29kaW5nKCd1dGY4Jyk7XG4gIHJlcy5vbignZGF0YScsIChjaHVuaykgPT4ge1xuICAgIHJlcy50ZXh0ICs9IGNodW5rO1xuICB9KTtcbiAgcmVzLm9uKCdlbmQnLCBmbik7XG59O1xuIl0sIm1hcHBpbmdzIjoiOztBQUFBQSxNQUFNLENBQUNDLE9BQVAsR0FBaUIsQ0FBQ0MsR0FBRCxFQUFNQyxFQUFOLEtBQWE7RUFDNUJELEdBQUcsQ0FBQ0UsSUFBSixHQUFXLEVBQVg7RUFDQUYsR0FBRyxDQUFDRyxXQUFKLENBQWdCLE1BQWhCO0VBQ0FILEdBQUcsQ0FBQ0ksRUFBSixDQUFPLE1BQVAsRUFBZ0JDLEtBQUQsSUFBVztJQUN4QkwsR0FBRyxDQUFDRSxJQUFKLElBQVlHLEtBQVo7RUFDRCxDQUZEO0VBR0FMLEdBQUcsQ0FBQ0ksRUFBSixDQUFPLEtBQVAsRUFBY0gsRUFBZDtBQUNELENBUEQifQ== \ No newline at end of file
diff --git a/together/node_modules/superagent/lib/node/parsers/urlencoded.js b/together/node_modules/superagent/lib/node/parsers/urlencoded.js
new file mode 100644
index 0000000..88a2475
--- /dev/null
+++ b/together/node_modules/superagent/lib/node/parsers/urlencoded.js
@@ -0,0 +1,22 @@
+"use strict";
+
+/**
+ * Module dependencies.
+ */
+const qs = require('qs');
+
+module.exports = (res, fn) => {
+ res.text = '';
+ res.setEncoding('ascii');
+ res.on('data', chunk => {
+ res.text += chunk;
+ });
+ res.on('end', () => {
+ try {
+ fn(null, qs.parse(res.text));
+ } catch (err) {
+ fn(err);
+ }
+ });
+};
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJxcyIsInJlcXVpcmUiLCJtb2R1bGUiLCJleHBvcnRzIiwicmVzIiwiZm4iLCJ0ZXh0Iiwic2V0RW5jb2RpbmciLCJvbiIsImNodW5rIiwicGFyc2UiLCJlcnIiXSwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbm9kZS9wYXJzZXJzL3VybGVuY29kZWQuanMiXSwic291cmNlc0NvbnRlbnQiOl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