first commit

This commit is contained in:
s.golasch
2023-08-01 13:49:46 +02:00
commit 1fc239fd54
20238 changed files with 3112246 additions and 0 deletions

56
build/node_modules/ware/History.md generated vendored Normal file
View File

@@ -0,0 +1,56 @@
1.3.0 - April 30, 2015
----------------------
* throw on errors without a `done` callback
* add `files` to `package.json`
1.2.0 - September 25, 2014
--------------------------
* move `co` to `devDependencies`
* add client-side support
1.1.0 - September 19, 2014
--------------------------
* refactor to use `wrap-fn`
1.0.1 - August 26, 2014
-----------------------
* add support for passing an array of ware instances
1.0.0 - August 26, 2014
-----------------------
* add support for sync middleware
* add support for generators
* remove support for error middleware with arity
0.3.0 - April 24, 2014
----------------------
* let `use` accept arrays
* let `use` accept `Ware` instances
* allow passing `fns` to the constructor
0.2.2 - March 18, 2013
----------------------
* moving to settimeout to fix dom validation issues
* add travis
0.2.1 - December 12, 2013
-------------------------
* fix skipping error handlers without error
0.2.0 - October 18, 2013
------------------------
* rewrite:
* handle any amount of input arguments
* allow multiple error handlers
* only call error handlers after the error is `next`'d
* make passing callback optional
* rename `end` to `run` since it can happen multiple times
0.1.0 - July 29, 2013
---------------------
* updating api
0.0.1 - July 29, 2013
---------------------
* first commit

104
build/node_modules/ware/Readme.md generated vendored Normal file
View File

@@ -0,0 +1,104 @@
# ware
Easily create your own middleware layer.
[![Build Status](https://travis-ci.org/segmentio/ware.png?branch=master)](https://travis-ci.org/segmentio/ware)
## Installation
Node:
```bash
$ npm install ware
```
Component:
```bash
$ component install segmentio/ware
```
Duo:
```js
var ware = require('segmentio/ware');
```
## Example
```js
var ware = require('ware');
var middleware = ware()
.use(function (req, res, next) {
res.x = 'hello';
next();
})
.use(function (req, res, next) {
res.y = 'world';
next();
});
middleware.run({}, {}, function (err, req, res) {
res.x; // "hello"
res.y; // "world"
});
```
Give it any number of arguments:
```js
var ware = require('ware');
var middleware = ware()
.use(function (a, b, c, next) {
console.log(a, b, c);
next();
})
middleware.run(1, 2, 3); // 1, 2, 3
```
Supports generators (on the server):
```js
var ware = require('ware');
var middleware = ware()
.use(function (obj) {
obj.url = 'http://google.com';
})
.use(function *(obj) {
obj.src = yield http.get(obj.url);
})
middleware.run({ url: 'http://facebook.com' }, function(err, obj) {
if (err) throw err;
obj.src // "obj.url" source
});
```
## API
#### ware()
Create a new list of middleware.
#### .use(fn)
Push a middleware `fn` onto the list. `fn` can be a synchronous, asynchronous, or generator function.
`fn` can also be an array of functions or an instance of `Ware`.
#### .run(input..., [callback])
Runs the middleware functions with `input...` and optionally calls `callback(err, input...)`.
## License
(The MIT License)
Copyright (c) 2013 Segment.io <friends@segment.io>
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.

91
build/node_modules/ware/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,91 @@
/**
* Module Dependencies
*/
var slice = [].slice;
var wrap = require('wrap-fn');
/**
* Expose `Ware`.
*/
module.exports = Ware;
/**
* Throw an error.
*
* @param {Error} error
*/
function fail (err) {
throw err;
}
/**
* Initialize a new `Ware` manager, with optional `fns`.
*
* @param {Function or Array or Ware} fn (optional)
*/
function Ware (fn) {
if (!(this instanceof Ware)) return new Ware(fn);
this.fns = [];
if (fn) this.use(fn);
}
/**
* Use a middleware `fn`.
*
* @param {Function or Array or Ware} fn
* @return {Ware}
*/
Ware.prototype.use = function (fn) {
if (fn instanceof Ware) {
return this.use(fn.fns);
}
if (fn instanceof Array) {
for (var i = 0, f; f = fn[i++];) this.use(f);
return this;
}
this.fns.push(fn);
return this;
};
/**
* Run through the middleware with the given `args` and optional `callback`.
*
* @param {Mixed} args...
* @param {Function} callback (optional)
* @return {Ware}
*/
Ware.prototype.run = function () {
var fns = this.fns;
var ctx = this;
var i = 0;
var last = arguments[arguments.length - 1];
var done = 'function' == typeof last && last;
var args = done
? slice.call(arguments, 0, arguments.length - 1)
: slice.call(arguments);
// next step
function next (err) {
if (err) return (done || fail)(err);
var fn = fns[i++];
var arr = slice.call(args);
if (!fn) {
return done && done.apply(null, [null].concat(args));
}
wrap(fn, next).apply(ctx, arr);
}
next();
return this;
};

65
build/node_modules/ware/package.json generated vendored Normal file
View File

@@ -0,0 +1,65 @@
{
"_args": [
[
"ware@1.3.0",
"/Users/asciidisco/Desktop/asciidisco.com/build"
]
],
"_from": "ware@1.3.0",
"_id": "ware@1.3.0",
"_inBundle": false,
"_integrity": "sha1-0bFPOdLiy0q4xAmPdW/ksWTkc9Q=",
"_location": "/ware",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "ware@1.3.0",
"name": "ware",
"escapedName": "ware",
"rawSpec": "1.3.0",
"saveSpec": null,
"fetchSpec": "1.3.0"
},
"_requiredBy": [
"/download"
],
"_resolved": "https://registry.npmjs.org/ware/-/ware-1.3.0.tgz",
"_spec": "1.3.0",
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
"bugs": {
"url": "https://github.com/segmentio/ware/issues"
},
"dependencies": {
"wrap-fn": "^0.1.0"
},
"description": "Easily create your own middleware layer.",
"devDependencies": {
"co": "^3.1.0",
"co-mocha": "^1.0.0",
"gnode": "0.0.8",
"mocha": "^1.21.4"
},
"files": [
"lib"
],
"homepage": "https://github.com/segmentio/ware#readme",
"keywords": [
"compose",
"connect",
"express",
"layer",
"middleware"
],
"license": "MIT",
"main": "lib/index.js",
"name": "ware",
"repository": {
"type": "git",
"url": "git://github.com/segmentio/ware.git"
},
"scripts": {
"test": "make test"
},
"version": "1.3.0"
}