initial commit taken from gitlab.lrz.de

This commit is contained in:
privatereese
2018-08-24 18:09:42 +02:00
parent ae54ed4c48
commit fc05486403
28494 changed files with 2159823 additions and 0 deletions

12
node_modules/denodeify/.editorconfig generated vendored Normal file
View File

@@ -0,0 +1,12 @@
root=true
[*]
end_of_line = lf
insert_final_newline = true
[*.js]
indent_style = tab
[*.json]
indent_style = space
indent_size = 2

3
node_modules/denodeify/.jshintrc generated vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"predef": ["describe", "it"]
}

1
node_modules/denodeify/.npmignore generated vendored Normal file
View File

@@ -0,0 +1 @@
/node_modules/

21
node_modules/denodeify/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,21 @@
# Changelog
## v1.2.0
- Add UMD so that `denodeify` can be used in the browser
## v1.1.2
- Performance improvements, no API changes
## v1.1.1
- Add `'use strict';`
## v1.1.0
- First bower release
## v1.0.0
- First version of `denodeify`

91
node_modules/denodeify/README.md generated vendored Normal file
View File

@@ -0,0 +1,91 @@
denodeify [ ![Codeship Status for matthew-andrews/denodeify](https://codeship.io/projects/02ac77d0-1a58-0132-bf86-4a07366ee29d/status)](https://codeship.io/projects/34622)
=========
Tool to turn functions with Node-style callback APIs into functions that return [Promises](https://github.com/jakearchibald/es6-promise).
Inspired by and adapted from Q's [`Q.denodeify`/`Q.nfcall` function](https://github.com/kriskowal/q/wiki/API-Reference#qnfbindnodefunc-args).
Warning: This micro-library doesn't force you to use any particular Promise implementation by using whatever `Promise` has been defined as globally. This is so that you may use any ES6 standard Promise compliant library - or, of course, native ES6 Promises.
If you're running the code on a browser or node version that doesn't include native promises you will need to include a polyfill. The following polyfills are tested as part of this module's test suite:-
- [Jake Archibald](https://twitter.com/jaffathecake)'s [ES6 Promise library](https://github.com/jakearchibald/es6-promise) (which is actually adapted from [Stefan Penner](https://twitter.com/stefanpenner)'s [RSVP.js](https://github.com/tildeio/rsvp.js)). - `require('es6-promise').polyfill();`
- [Getify](https://twitter.com/getify)'s [Native Promise Only library](https://github.com/getify/native-promise-only) - `require('native-promise-only');`
- [ES6 Shim](https://github.com/es-shims/es6-shim) - `require('es6-shim');`
- [Calvin Metcalf](https://twitter.com/CWMma)'s [Lie](https://github.com/calvinmetcalf/lie) - `global.Promise = global.Promise || require('lie');`
Note: as of v1.2.0 you can use **denodeify** in the front end. Pull it in via CommonJS, AMD or simply add to your webpage and it'll be available on `window.denodeify`.
## Installation
```
npm install denodeify --save
```
Or:-
```
bower install denodeify --save
```
## Examples
Simple example with [`readFile`](https://www.npmjs.org/package/read-file):-
```js
require('es6-promise').polyfill();
var denodeify = require('denodeify');
var readFile = denodeify(require('fs').readFile);
readFile('my-file.txt', { encoding: 'UTF-8' })
.then(function(text) {
console.log("My file's contents is: " + text);
});
```
(Note: you will need to also install [es6-promise](https://github.com/jakearchibald/es6-promise) with `npm install es6-promise` for this code sample to work within node versions that don't have `Promise` natively available)
More complex example with `exec`:-
## Advanced usage
You can also pass in a function as a second argument of `denodeify` that allows you to manipulate the data returned by the wrapped function before it gets passed to the Promise's `reject` or `resolve` functions, for example:-
```js
require('es6-promise').polyfill();
var denodeify = require('denodeify');
var exec = denodeify(require('child_process').exec, function(err, stdout, stderr) {
// Throw away stderr data
return [err, stdout];
});
exec('hostname')
.then(function(host) {
console.log("My hostname is: " + host.replace('\n', ''));
});
```
Or,
```js
require('es6-promise').polyfill();
var denodeify = require('denodeify');
var exec = denodeify(require('child_process').exec, function(err, stdout, stderr) {
return [err, [stdout, stderr]];
});
exec('my-command')
.then(function(results) {
console.log("stdout is: " + results[0]);
console.log("stderr is: " + results[1]);
});
```
Useful for functions that return multiple arguments, for example [`child_process#exec`](http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback).
## Credits and collaboration ##
The lead developer of **denodeify** is [Matt Andrews](http://twitter.com/andrewsmatt) at FT Labs with much help and support from [Kornel Lesiński](https://twitter.com/pornelski). All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request.

22
node_modules/denodeify/bower.json generated vendored Normal file
View File

@@ -0,0 +1,22 @@
{
"name": "denodeify",
"main": "index.js",
"homepage": "https://github.com/matthew-andrews/denodeify",
"authors": [
"Matthew Andrews <matt@mattandre.ws>"
],
"description": "Tool to turn functions with Node-style callback APIs into functions that return Promises.",
"keywords": [
"denodeify",
"Promise",
"node"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
".editorconfig"
]
}

49
node_modules/denodeify/index.js generated vendored Normal file
View File

@@ -0,0 +1,49 @@
;(function(define){define(function(require,exports,module){
function denodeify(nodeStyleFunction, filter) {
'use strict';
return function() {
var self = this;
var functionArguments = new Array(arguments.length + 1);
for (var i = 0; i < arguments.length; i += 1) {
functionArguments[i] = arguments[i];
}
function promiseHandler(resolve, reject) {
function callbackFunction() {
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i += 1) {
args[i] = arguments[i];
}
if (filter) {
args = filter.apply(self, args);
}
var error = args[0];
var result = args[1];
if (error) {
return reject(error);
}
return resolve(result);
}
functionArguments[functionArguments.length - 1] = callbackFunction;
nodeStyleFunction.apply(self, functionArguments);
}
return new Promise(promiseHandler);
};
}
module.exports = denodeify;
});})(typeof define=='function'&&define.amd?define
:(function(n,w){'use strict';return typeof module=='object'?function(c){
c(require,exports,module);}:function(c){var m={exports:{}};c(function(n){
return w[n];},m.exports,m);w[n]=m.exports;};})('denodeify',this));

85
node_modules/denodeify/package.json generated vendored Normal file
View File

@@ -0,0 +1,85 @@
{
"_args": [
[
"denodeify@^1.2.1",
"/home/bernhard/freifunk-app/node_modules/react-native"
]
],
"_from": "denodeify@>=1.2.1 <2.0.0",
"_id": "denodeify@1.2.1",
"_inCache": true,
"_installable": true,
"_location": "/denodeify",
"_nodeVersion": "0.10.33",
"_npmUser": {
"email": "matt@mattandre.ws",
"name": "mattandrews"
},
"_npmVersion": "2.1.14",
"_phantomChildren": {},
"_requested": {
"name": "denodeify",
"raw": "denodeify@^1.2.1",
"rawSpec": "^1.2.1",
"scope": null,
"spec": ">=1.2.1 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/metro",
"/react-native"
],
"_resolved": "https://registry.npmjs.org/denodeify/-/denodeify-1.2.1.tgz",
"_shasum": "3a36287f5034e699e7577901052c2e6c94251631",
"_shrinkwrap": null,
"_spec": "denodeify@^1.2.1",
"_where": "/home/bernhard/freifunk-app/node_modules/react-native",
"author": {
"name": "Matt Andrews"
},
"bugs": {
"url": "https://github.com/matthew-andrews/denodeify/issues"
},
"dependencies": {},
"description": "Tool to turn functions with Node-style callback APIs into functions that return Promises",
"devDependencies": {
"es6-promise": "^1.0.0",
"es6-shim": "^0.18.0",
"jshint": "^2.5.5",
"lie": "^2.7.7",
"lintspaces-cli": "0.0.4",
"mocha": "^1.21.4",
"native-promise-only": "^0.7.6-a"
},
"directories": {
"test": "test"
},
"dist": {
"shasum": "3a36287f5034e699e7577901052c2e6c94251631",
"tarball": "https://registry.npmjs.org/denodeify/-/denodeify-1.2.1.tgz"
},
"gitHead": "e500054eb336c748264507e9553af949981ee2c3",
"homepage": "https://github.com/matthew-andrews/denodeify",
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "mattandrews",
"email": "matt@mattandre.ws"
}
],
"name": "denodeify",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/matthew-andrews/denodeify.git"
},
"scripts": {
"files": "find . -name '*.js' ! -path './node_modules/*'",
"jshint": "jshint `npm run -s files`",
"lintspaces": "lintspaces -i js-comments -e .editorconfig `npm run -s files`",
"test": "mocha test/*test.js && npm run jshint && npm run lintspaces"
},
"version": "1.2.1"
}

7
node_modules/denodeify/test/es6-promise-test.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
delete global.Promise;
require('es6-promise').polyfill();
var helpers = require('./helpers');
describe('denodeify with es6 promise', helpers.basicDenodeify);
describe('denodeify with es6 promise using multiple arguments', helpers.multipleArguments);

7
node_modules/denodeify/test/es6-shim-test.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
delete global.Promise;
require('es6-shim');
var helpers = require('./helpers');
describe('denodeify with es6 shim', helpers.basicDenodeify);
describe('denodeify with es6 shim using multiple arguments', helpers.multipleArguments);

56
node_modules/denodeify/test/helpers.js generated vendored Normal file
View File

@@ -0,0 +1,56 @@
var assert = require('assert');
var denodeify = require('../');
function myNodeStyleFunction(argument1, argument2, callback) {
if (argument1 && argument2) {
callback(null, argument1+argument2);
} else {
callback('Need both arguments');
}
}
exports.basicDenodeify = function() {
it('should resolve when there are no errors', function(done) {
var myDenodeifiedNodeStyleFunction = denodeify(myNodeStyleFunction);
myDenodeifiedNodeStyleFunction(1, 2)
.then(function(result) {
assert.equal(3, result);
done();
}, function() {
throw new Error('Error callback called wrongly');
});
});
it('should reject when there are errors', function(done) {
var myDenodeifiedNodeStyleFunction = denodeify(myNodeStyleFunction);
var promise = myDenodeifiedNodeStyleFunction(1, undefined);
assert(promise instanceof Promise);
promise
.then(function(result) {
throw new Error('A Promised myNodeStyleFunction with one argument should never resolve');
}, function(error) {
assert.equal(error, 'Need both arguments');
done();
});
});
};
function multipleArgumentsNodeStyleFunction(callback) {
callback(null, 'a', 'b');
}
function myFilter(err, a, b) {
return [err, [a, b]];
}
exports.multipleArguments = function() {
it('should pass multiple arguments to the next then', function(done) {
var myDenodeifiedNodeStyleFunction = denodeify(multipleArgumentsNodeStyleFunction, myFilter);
myDenodeifiedNodeStyleFunction()
.then(function(results) {
assert.equal(results[0], 'a');
assert.equal(results[1], 'b');
done();
});
});
};

7
node_modules/denodeify/test/lie-test.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
delete global.Promise;
global.Promise = require('lie');
var helpers = require('./helpers');
describe('denodeify with lie', helpers.basicDenodeify);
describe('denodeify with lie using multiple arguments', helpers.multipleArguments);

View File

@@ -0,0 +1,7 @@
delete global.Promise;
require("native-promise-only");
var helpers = require('./helpers');
describe('denodeify with native promise only', helpers.basicDenodeify);
describe('denodeify with native promise only using multiple arguments', helpers.multipleArguments);