This commit is contained in:
Lukian LEIZOUR 2022-11-26 15:56:34 +01:00
parent 70e2f7a8aa
commit 008d2f30d7
675 changed files with 189892 additions and 0 deletions

25
node_modules/xhr-send/index.js generated vendored Normal file
View file

@ -0,0 +1,25 @@
'use strict';
/**
* Safely send data over XHR.
*
* @param {XHR} xhr The XHR object that we should send.
* @param {Mixed} data The data that needs to be send.
* @param {Function} fn Send callback.
* @returns {Boolean} Successful sending
* @api public
*/
module.exports = function send(xhr, data, fn) {
//
// @TODO detect binary data.
// @TODO polyfill sendAsBinary (firefoxy only)?
//
try { xhr.send(data); }
catch (e) { return fn(e), false; }
//
// Call the completion callback __after__ the try catch to prevent unwanted
// and extended try wrapping.
//
return fn(), true;
};