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

2
node_modules/xhr-send/.npmignore generated vendored Normal file
View file

@ -0,0 +1,2 @@
node_modules
coverage

20
node_modules/xhr-send/.travis.yml generated vendored Normal file
View file

@ -0,0 +1,20 @@
language: node_js
node_js:
- "0.12"
- "0.10"
- "0.8"
- "iojs"
before_install:
- "npm install -g npm@1.4.x"
script:
- "npm run test-travis"
after_script:
- "npm install coveralls@2.11.x && cat coverage/lcov.info | coveralls"
matrix:
fast_finish: true
notifications:
irc:
channels:
- "irc.freenode.org#unshift"
on_success: change
on_failure: change

22
node_modules/xhr-send/LICENSE generated vendored Normal file
View file

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors.
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.

41
node_modules/xhr-send/README.md generated vendored Normal file
View file

@ -0,0 +1,41 @@
# xhr-send
[![Made by unshift][made-by]](http://unshift.io)[![Version npm][version]](http://browsenpm.org/package/xhr-send)[![Build Status][build]](https://travis-ci.org/unshiftio/xhr-send)[![Dependencies][david]](https://david-dm.org/unshiftio/xhr-send)[![Coverage Status][cover]](https://coveralls.io/r/unshiftio/xhr-send?branch=master)[![IRC channel][irc]](http://webchat.freenode.net/?channels=unshift)
[made-by]: https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square
[version]: https://img.shields.io/npm/v/xhr-send.svg?style=flat-square
[build]: https://img.shields.io/travis/unshiftio/xhr-send/master.svg?style=flat-square
[david]: https://img.shields.io/david/unshiftio/xhr-send.svg?style=flat-square
[cover]: https://img.shields.io/coveralls/unshiftio/xhr-send/master.svg?style=flat-square
[irc]: https://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square
A cross-browser implementation for sending data over the supplied XHR
connection.
## Installation
```
npm install --save xhr-send
```
## Usage
The module requires 3 arguments:
- `xhr` The reference to your constructed `XMLHTTPRequest` instance.
- `data` The data that needs to be send.
- `fn` Completion callback that receives the error as first argument.
```js
var send = require('xhr-send');
send(xhr, 'data', function (err) {
if (err) return console.error('failed to send because of reasons', err);
console.log('send without any isseus.');
});
```
## License
MIT

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;
};

35
node_modules/xhr-send/package.json generated vendored Normal file
View file

@ -0,0 +1,35 @@
{
"name": "xhr-send",
"version": "1.0.0",
"description": "Send data over the given XHR request.",
"main": "index.js",
"scripts": {
"100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
"test": "mocha test.js",
"watch": "mocha --watch test.js",
"coverage": "istanbul cover ./node_modules/.bin/_mocha -- test.js",
"test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- test.js"
},
"repository": {
"type": "git",
"url": "https://github.com/unshiftio/xhr-send"
},
"keywords": [
"xhr",
"send",
"sent",
"XMLHTTPRequest"
],
"author": "Arnout Kazemier",
"license": "MIT",
"bugs": {
"url": "https://github.com/unshiftio/xhr-send/issues"
},
"homepage": "https://github.com/unshiftio/xhr-send",
"devDependencies": {
"assume": "1.2.x",
"istanbul": "0.3.x",
"mocha": "2.2.x",
"pre-commit": "1.0.x"
}
}

37
node_modules/xhr-send/test.js generated vendored Normal file
View file

@ -0,0 +1,37 @@
describe('xhr-send', function () {
'use strict';
var send = require('./')
, assume = require('assume');
it('is exported as function', function () {
assume(send).is.a('function');
});
it('calls the supplied callback with an error', function (next) {
send(undefined, '', function (err) {
assume(err).is.instanceOf(Error);
next();
});
});
it('returns false when it fails', function () {
assume(send(undefined, '', function (err) {
assume(err).is.instanceOf(Error);
})).is.false();
});
it('calls xhr open with the supplied data', function (next) {
next = assume.plan(2, next);
var stub = {
send: function (data) {
assume(data).equals('foo');
}
};
send(stub, 'foo', function (err) {
assume(err).is.undefined();
next();
});
});
});