Pushing changes

This commit is contained in:
2017-03-23 23:52:08 -05:00
parent 6075860b82
commit ac667ec74f
1465 changed files with 345149 additions and 3 deletions

10
node_modules/superagent/lib/node/parsers/image.js generated vendored Normal file
View File

@ -0,0 +1,10 @@
module.exports = function(res, fn){
var data = []; // Binary data needs binary storage
res.on('data', function(chunk){
data.push(chunk);
});
res.on('end', function () {
fn(null, Buffer.concat(data));
});
};

5
node_modules/superagent/lib/node/parsers/index.js generated vendored Normal file
View File

@ -0,0 +1,5 @@
exports['application/x-www-form-urlencoded'] = require('./urlencoded');
exports['application/json'] = require('./json');
exports.text = require('./text');
exports.image = require('./image');

19
node_modules/superagent/lib/node/parsers/json.js generated vendored Normal file
View File

@ -0,0 +1,19 @@
module.exports = function parseJSON(res, fn){
res.text = '';
res.setEncoding('utf8');
res.on('data', function(chunk){ res.text += chunk;});
res.on('end', function(){
try {
var body = res.text && JSON.parse(res.text);
} catch (e) {
var err = e;
// issue #675: return the raw response if the response parsing fails
err.rawResponse = res.text || null;
// issue #876: return the http status code if the response parsing fails
err.statusCode = res.statusCode;
} finally {
fn(err, body);
}
});
};

7
node_modules/superagent/lib/node/parsers/text.js generated vendored Normal file
View File

@ -0,0 +1,7 @@
module.exports = function(res, fn){
res.text = '';
res.setEncoding('utf8');
res.on('data', function(chunk){ res.text += chunk; });
res.on('end', fn);
};

19
node_modules/superagent/lib/node/parsers/urlencoded.js generated vendored Normal file
View File

@ -0,0 +1,19 @@
/**
* Module dependencies.
*/
var qs = require('qs');
module.exports = function(res, fn){
res.text = '';
res.setEncoding('ascii');
res.on('data', function(chunk){ res.text += chunk; });
res.on('end', function(){
try {
fn(null, qs.parse(res.text));
} catch (err) {
fn(err);
}
});
};