Detailansicht verbessert
This commit is contained in:
		
							
								
								
									
										20
									
								
								express-server/node_modules/readdirp/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								express-server/node_modules/readdirp/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
This software is released under the MIT license:
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2012-2015 Thorsten Lorenz
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
							
								
								
									
										204
									
								
								express-server/node_modules/readdirp/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										204
									
								
								express-server/node_modules/readdirp/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,204 @@
 | 
			
		||||
# readdirp [](http://travis-ci.org/thlorenz/readdirp)
 | 
			
		||||
 | 
			
		||||
[](https://nodei.co/npm/readdirp/)
 | 
			
		||||
 | 
			
		||||
Recursive version of [fs.readdir](http://nodejs.org/docs/latest/api/fs.html#fs_fs_readdir_path_callback). Exposes a **stream api**.
 | 
			
		||||
 | 
			
		||||
```javascript
 | 
			
		||||
var readdirp = require('readdirp')
 | 
			
		||||
  , path = require('path')
 | 
			
		||||
  , es = require('event-stream');
 | 
			
		||||
 | 
			
		||||
// print out all JavaScript files along with their size
 | 
			
		||||
 | 
			
		||||
var stream = readdirp({ root: path.join(__dirname), fileFilter: '*.js' });
 | 
			
		||||
stream
 | 
			
		||||
  .on('warn', function (err) {
 | 
			
		||||
    console.error('non-fatal error', err);
 | 
			
		||||
    // optionally call stream.destroy() here in order to abort and cause 'close' to be emitted
 | 
			
		||||
  })
 | 
			
		||||
  .on('error', function (err) { console.error('fatal error', err); })
 | 
			
		||||
  .pipe(es.mapSync(function (entry) {
 | 
			
		||||
    return { path: entry.path, size: entry.stat.size };
 | 
			
		||||
  }))
 | 
			
		||||
  .pipe(es.stringify())
 | 
			
		||||
  .pipe(process.stdout);
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Meant to be one of the recursive versions of [fs](http://nodejs.org/docs/latest/api/fs.html) functions, e.g., like [mkdirp](https://github.com/substack/node-mkdirp).
 | 
			
		||||
 | 
			
		||||
**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*
 | 
			
		||||
 | 
			
		||||
- [Installation](#installation)
 | 
			
		||||
- [API](#api)
 | 
			
		||||
	- [entry stream](#entry-stream)
 | 
			
		||||
	- [options](#options)
 | 
			
		||||
	- [entry info](#entry-info)
 | 
			
		||||
	- [Filters](#filters)
 | 
			
		||||
	- [Callback API](#callback-api)
 | 
			
		||||
		- [allProcessed ](#allprocessed)
 | 
			
		||||
		- [fileProcessed](#fileprocessed)
 | 
			
		||||
- [More Examples](#more-examples)
 | 
			
		||||
	- [stream api](#stream-api)
 | 
			
		||||
	- [stream api pipe](#stream-api-pipe)
 | 
			
		||||
	- [grep](#grep)
 | 
			
		||||
	- [using callback api](#using-callback-api)
 | 
			
		||||
	- [tests](#tests)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Installation
 | 
			
		||||
 | 
			
		||||
    npm install readdirp
 | 
			
		||||
 | 
			
		||||
# API
 | 
			
		||||
 | 
			
		||||
***var entryStream = readdirp (options)***
 | 
			
		||||
 | 
			
		||||
Reads given root recursively and returns a `stream` of [entry info](#entry-info)s.
 | 
			
		||||
 | 
			
		||||
## entry stream
 | 
			
		||||
 | 
			
		||||
Behaves as follows:
 | 
			
		||||
 | 
			
		||||
- `emit('data')` passes an [entry info](#entry-info) whenever one is found
 | 
			
		||||
- `emit('warn')` passes a non-fatal `Error` that prevents a file/directory from being processed (i.e., if it is
 | 
			
		||||
  inaccessible to the user)
 | 
			
		||||
- `emit('error')` passes a fatal `Error` which also ends the stream (i.e., when illegal options where passed)
 | 
			
		||||
- `emit('end')` called when all entries were found and no more will be emitted (i.e., we are done)
 | 
			
		||||
- `emit('close')` called when the stream is destroyed via `stream.destroy()` (which could be useful if you want to
 | 
			
		||||
  manually abort even on a non fatal error) - at that point the stream is no longer `readable` and no more entries,
 | 
			
		||||
  warning or errors are emitted
 | 
			
		||||
- to learn more about streams, consult the very detailed
 | 
			
		||||
  [nodejs streams documentation](http://nodejs.org/api/stream.html) or the
 | 
			
		||||
  [stream-handbook](https://github.com/substack/stream-handbook)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## options
 | 
			
		||||
 | 
			
		||||
- **root**: path in which to start reading and recursing into subdirectories
 | 
			
		||||
 | 
			
		||||
- **fileFilter**: filter to include/exclude files found (see [Filters](#filters) for more)
 | 
			
		||||
 | 
			
		||||
- **directoryFilter**: filter to include/exclude directories found and to recurse into (see [Filters](#filters) for more)
 | 
			
		||||
 | 
			
		||||
- **depth**: depth at which to stop recursing even if more subdirectories are found
 | 
			
		||||
 | 
			
		||||
- **entryType**: determines if data events on the stream should be emitted for `'files'`, `'directories'`, `'both'`, or `'all'`. Setting to `'all'` will also include entries for other types of file descriptors like character devices, unix sockets and named pipes. Defaults to `'files'`.
 | 
			
		||||
 | 
			
		||||
- **lstat**: if `true`, readdirp uses `fs.lstat` instead of `fs.stat` in order to stat files and includes symlink entries in the stream along with files.
 | 
			
		||||
 | 
			
		||||
## entry info
 | 
			
		||||
 | 
			
		||||
Has the following properties:
 | 
			
		||||
 | 
			
		||||
- **parentDir**     :  directory in which entry was found (relative to given root)
 | 
			
		||||
- **fullParentDir** :  full path to parent directory
 | 
			
		||||
- **name**          :  name of the file/directory
 | 
			
		||||
- **path**          :  path to the file/directory (relative to given root)
 | 
			
		||||
- **fullPath**      :  full path to the file/directory found
 | 
			
		||||
- **stat**          :  built in [stat object](http://nodejs.org/docs/v0.4.9/api/fs.html#fs.Stats)
 | 
			
		||||
- **Example**: (assuming root was `/User/dev/readdirp`)
 | 
			
		||||
 | 
			
		||||
        parentDir     :  'test/bed/root_dir1',
 | 
			
		||||
        fullParentDir :  '/User/dev/readdirp/test/bed/root_dir1',
 | 
			
		||||
        name          :  'root_dir1_subdir1',
 | 
			
		||||
        path          :  'test/bed/root_dir1/root_dir1_subdir1',
 | 
			
		||||
        fullPath      :  '/User/dev/readdirp/test/bed/root_dir1/root_dir1_subdir1',
 | 
			
		||||
        stat          :  [ ... ]
 | 
			
		||||
 | 
			
		||||
## Filters
 | 
			
		||||
 | 
			
		||||
There are three different ways to specify filters for files and directories respectively.
 | 
			
		||||
 | 
			
		||||
- **function**: a function that takes an entry info as a parameter and returns true to include or false to exclude the entry
 | 
			
		||||
 | 
			
		||||
- **glob string**: a string (e.g., `*.js`) which is matched using [minimatch](https://github.com/isaacs/minimatch), so go there for more
 | 
			
		||||
    information.
 | 
			
		||||
 | 
			
		||||
    Globstars (`**`) are not supported since specifying a recursive pattern for an already recursive function doesn't make sense.
 | 
			
		||||
 | 
			
		||||
    Negated globs (as explained in the minimatch documentation) are allowed, e.g., `!*.txt` matches everything but text files.
 | 
			
		||||
 | 
			
		||||
- **array of glob strings**: either need to be all inclusive or all exclusive (negated) patterns otherwise an error is thrown.
 | 
			
		||||
 | 
			
		||||
    `[ '*.json', '*.js' ]` includes all JavaScript and Json files.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    `[ '!.git', '!node_modules' ]` includes all directories except the '.git' and 'node_modules'.
 | 
			
		||||
 | 
			
		||||
Directories that do not pass a filter will not be recursed into.
 | 
			
		||||
 | 
			
		||||
## Callback API
 | 
			
		||||
 | 
			
		||||
Although the stream api is recommended, readdirp also exposes a callback based api.
 | 
			
		||||
 | 
			
		||||
***readdirp (options, callback1 [, callback2])***
 | 
			
		||||
 | 
			
		||||
If callback2 is given, callback1 functions as the **fileProcessed** callback, and callback2 as the **allProcessed** callback.
 | 
			
		||||
 | 
			
		||||
If only callback1 is given, it functions as the **allProcessed** callback.
 | 
			
		||||
 | 
			
		||||
### allProcessed
 | 
			
		||||
 | 
			
		||||
- function with err and res parameters, e.g., `function (err, res) { ... }`
 | 
			
		||||
- **err**: array of errors that occurred during the operation, **res may still be present, even if errors occurred**
 | 
			
		||||
- **res**: collection of file/directory [entry infos](#entry-info)
 | 
			
		||||
 | 
			
		||||
### fileProcessed
 | 
			
		||||
 | 
			
		||||
- function with [entry info](#entry-info) parameter e.g., `function (entryInfo) { ... }`
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# More Examples
 | 
			
		||||
 | 
			
		||||
`on('error', ..)`, `on('warn', ..)` and `on('end', ..)` handling omitted for brevity
 | 
			
		||||
 | 
			
		||||
```javascript
 | 
			
		||||
var readdirp = require('readdirp');
 | 
			
		||||
 | 
			
		||||
// Glob file filter
 | 
			
		||||
readdirp({ root: './test/bed', fileFilter: '*.js' })
 | 
			
		||||
  .on('data', function (entry) {
 | 
			
		||||
    // do something with each JavaScript file entry
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
// Combined glob file filters
 | 
			
		||||
readdirp({ root: './test/bed', fileFilter: [ '*.js', '*.json' ] })
 | 
			
		||||
  .on('data', function (entry) {
 | 
			
		||||
    // do something with each JavaScript and Json file entry
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
// Combined negated directory filters
 | 
			
		||||
readdirp({ root: './test/bed', directoryFilter: [ '!.git', '!*modules' ] })
 | 
			
		||||
  .on('data', function (entry) {
 | 
			
		||||
    // do something with each file entry found outside '.git' or any modules directory
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
// Function directory filter
 | 
			
		||||
readdirp({ root: './test/bed', directoryFilter: function (di) { return di.name.length === 9; } })
 | 
			
		||||
  .on('data', function (entry) {
 | 
			
		||||
    // do something with each file entry found inside directories whose name has length 9
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
// Limiting depth
 | 
			
		||||
readdirp({ root: './test/bed', depth: 1 })
 | 
			
		||||
  .on('data', function (entry) {
 | 
			
		||||
    // do something with each file entry found up to 1 subdirectory deep
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
// callback api
 | 
			
		||||
readdirp({ root: '.' }, function(fileInfo) {
 | 
			
		||||
   // do something with file entry here
 | 
			
		||||
  }, function (err, res) {
 | 
			
		||||
    // all done, move on or do final step for all file entries here
 | 
			
		||||
});
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Try more examples by following [instructions](https://github.com/paulmillr/readdirp/blob/master/examples/Readme.md)
 | 
			
		||||
on how to get going.
 | 
			
		||||
 | 
			
		||||
## tests
 | 
			
		||||
 | 
			
		||||
The [readdirp tests](https://github.com/paulmillr/readdirp/blob/master/test/readdirp.js) also will give you a good idea on
 | 
			
		||||
how things work.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/isarray/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/isarray/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
node_modules
 | 
			
		||||
							
								
								
									
										4
									
								
								express-server/node_modules/readdirp/node_modules/isarray/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								express-server/node_modules/readdirp/node_modules/isarray/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
language: node_js
 | 
			
		||||
node_js:
 | 
			
		||||
  - "0.8"
 | 
			
		||||
  - "0.10"
 | 
			
		||||
							
								
								
									
										6
									
								
								express-server/node_modules/readdirp/node_modules/isarray/Makefile
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								express-server/node_modules/readdirp/node_modules/isarray/Makefile
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
 | 
			
		||||
test:
 | 
			
		||||
	@node_modules/.bin/tape test.js
 | 
			
		||||
 | 
			
		||||
.PHONY: test
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										60
									
								
								express-server/node_modules/readdirp/node_modules/isarray/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								express-server/node_modules/readdirp/node_modules/isarray/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,60 @@
 | 
			
		||||
 | 
			
		||||
# isarray
 | 
			
		||||
 | 
			
		||||
`Array#isArray` for older browsers.
 | 
			
		||||
 | 
			
		||||
[](http://travis-ci.org/juliangruber/isarray)
 | 
			
		||||
[](https://www.npmjs.org/package/isarray)
 | 
			
		||||
 | 
			
		||||
[
 | 
			
		||||
](https://ci.testling.com/juliangruber/isarray)
 | 
			
		||||
 | 
			
		||||
## Usage
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
var isArray = require('isarray');
 | 
			
		||||
 | 
			
		||||
console.log(isArray([])); // => true
 | 
			
		||||
console.log(isArray({})); // => false
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Installation
 | 
			
		||||
 | 
			
		||||
With [npm](http://npmjs.org) do
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
$ npm install isarray
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Then bundle for the browser with
 | 
			
		||||
[browserify](https://github.com/substack/browserify).
 | 
			
		||||
 | 
			
		||||
With [component](http://component.io) do
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
$ component install juliangruber/isarray
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## License
 | 
			
		||||
 | 
			
		||||
(MIT)
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
							
								
								
									
										19
									
								
								express-server/node_modules/readdirp/node_modules/isarray/component.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								express-server/node_modules/readdirp/node_modules/isarray/component.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
{
 | 
			
		||||
  "name" : "isarray",
 | 
			
		||||
  "description" : "Array#isArray for older browsers",
 | 
			
		||||
  "version" : "0.0.1",
 | 
			
		||||
  "repository" : "juliangruber/isarray",
 | 
			
		||||
  "homepage": "https://github.com/juliangruber/isarray",
 | 
			
		||||
  "main" : "index.js",
 | 
			
		||||
  "scripts" : [
 | 
			
		||||
    "index.js"
 | 
			
		||||
  ],
 | 
			
		||||
  "dependencies" : {},
 | 
			
		||||
  "keywords": ["browser","isarray","array"],
 | 
			
		||||
  "author": {
 | 
			
		||||
    "name": "Julian Gruber",
 | 
			
		||||
    "email": "mail@juliangruber.com",
 | 
			
		||||
    "url": "http://juliangruber.com"
 | 
			
		||||
  },
 | 
			
		||||
  "license": "MIT"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										5
									
								
								express-server/node_modules/readdirp/node_modules/isarray/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								express-server/node_modules/readdirp/node_modules/isarray/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
var toString = {}.toString;
 | 
			
		||||
 | 
			
		||||
module.exports = Array.isArray || function (arr) {
 | 
			
		||||
  return toString.call(arr) == '[object Array]';
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										73
									
								
								express-server/node_modules/readdirp/node_modules/isarray/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								express-server/node_modules/readdirp/node_modules/isarray/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,73 @@
 | 
			
		||||
{
 | 
			
		||||
  "_from": "isarray@~1.0.0",
 | 
			
		||||
  "_id": "isarray@1.0.0",
 | 
			
		||||
  "_inBundle": false,
 | 
			
		||||
  "_integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
 | 
			
		||||
  "_location": "/readdirp/isarray",
 | 
			
		||||
  "_phantomChildren": {},
 | 
			
		||||
  "_requested": {
 | 
			
		||||
    "type": "range",
 | 
			
		||||
    "registry": true,
 | 
			
		||||
    "raw": "isarray@~1.0.0",
 | 
			
		||||
    "name": "isarray",
 | 
			
		||||
    "escapedName": "isarray",
 | 
			
		||||
    "rawSpec": "~1.0.0",
 | 
			
		||||
    "saveSpec": null,
 | 
			
		||||
    "fetchSpec": "~1.0.0"
 | 
			
		||||
  },
 | 
			
		||||
  "_requiredBy": [
 | 
			
		||||
    "/readdirp/readable-stream"
 | 
			
		||||
  ],
 | 
			
		||||
  "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
 | 
			
		||||
  "_shasum": "bb935d48582cba168c06834957a54a3e07124f11",
 | 
			
		||||
  "_spec": "isarray@~1.0.0",
 | 
			
		||||
  "_where": "D:\\5CHITM\\Diplomarbeit\\SmartShopper\\SmartShopper\\express-server\\node_modules\\readdirp\\node_modules\\readable-stream",
 | 
			
		||||
  "author": {
 | 
			
		||||
    "name": "Julian Gruber",
 | 
			
		||||
    "email": "mail@juliangruber.com",
 | 
			
		||||
    "url": "http://juliangruber.com"
 | 
			
		||||
  },
 | 
			
		||||
  "bugs": {
 | 
			
		||||
    "url": "https://github.com/juliangruber/isarray/issues"
 | 
			
		||||
  },
 | 
			
		||||
  "bundleDependencies": false,
 | 
			
		||||
  "dependencies": {},
 | 
			
		||||
  "deprecated": false,
 | 
			
		||||
  "description": "Array#isArray for older browsers",
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "tape": "~2.13.4"
 | 
			
		||||
  },
 | 
			
		||||
  "homepage": "https://github.com/juliangruber/isarray",
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "browser",
 | 
			
		||||
    "isarray",
 | 
			
		||||
    "array"
 | 
			
		||||
  ],
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
  "main": "index.js",
 | 
			
		||||
  "name": "isarray",
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
    "url": "git://github.com/juliangruber/isarray.git"
 | 
			
		||||
  },
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "test": "tape test.js"
 | 
			
		||||
  },
 | 
			
		||||
  "testling": {
 | 
			
		||||
    "files": "test.js",
 | 
			
		||||
    "browsers": [
 | 
			
		||||
      "ie/8..latest",
 | 
			
		||||
      "firefox/17..latest",
 | 
			
		||||
      "firefox/nightly",
 | 
			
		||||
      "chrome/22..latest",
 | 
			
		||||
      "chrome/canary",
 | 
			
		||||
      "opera/12..latest",
 | 
			
		||||
      "opera/next",
 | 
			
		||||
      "safari/5.1..latest",
 | 
			
		||||
      "ipad/6.0..latest",
 | 
			
		||||
      "iphone/6.0..latest",
 | 
			
		||||
      "android-browser/4.2..latest"
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  "version": "1.0.0"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										20
									
								
								express-server/node_modules/readdirp/node_modules/isarray/test.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								express-server/node_modules/readdirp/node_modules/isarray/test.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
var isArray = require('./');
 | 
			
		||||
var test = require('tape');
 | 
			
		||||
 | 
			
		||||
test('is array', function(t){
 | 
			
		||||
  t.ok(isArray([]));
 | 
			
		||||
  t.notOk(isArray({}));
 | 
			
		||||
  t.notOk(isArray(null));
 | 
			
		||||
  t.notOk(isArray(false));
 | 
			
		||||
 | 
			
		||||
  var obj = {};
 | 
			
		||||
  obj[0] = true;
 | 
			
		||||
  t.notOk(isArray(obj));
 | 
			
		||||
 | 
			
		||||
  var arr = [];
 | 
			
		||||
  arr.foo = 'bar';
 | 
			
		||||
  t.ok(isArray(arr));
 | 
			
		||||
 | 
			
		||||
  t.end();
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										55
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
			
		||||
sudo: false
 | 
			
		||||
language: node_js
 | 
			
		||||
before_install:
 | 
			
		||||
  - npm install -g npm@2
 | 
			
		||||
  - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g
 | 
			
		||||
notifications:
 | 
			
		||||
  email: false
 | 
			
		||||
matrix:
 | 
			
		||||
  fast_finish: true
 | 
			
		||||
  include:
 | 
			
		||||
  - node_js: '0.8'
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: '0.10'
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: '0.11'
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: '0.12'
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: 1
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: 2
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: 3
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: 4
 | 
			
		||||
    env: TASK=test
 | 
			
		||||
  - node_js: 5
 | 
			
		||||
    env: TASK=test
 | 
			
		||||
  - node_js: 6
 | 
			
		||||
    env: TASK=test
 | 
			
		||||
  - node_js: 7
 | 
			
		||||
    env: TASK=test
 | 
			
		||||
  - node_js: 8
 | 
			
		||||
    env: TASK=test
 | 
			
		||||
  - node_js: 9
 | 
			
		||||
    env: TASK=test
 | 
			
		||||
script: "npm run $TASK"
 | 
			
		||||
env:
 | 
			
		||||
  global:
 | 
			
		||||
  - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc=
 | 
			
		||||
  - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI=
 | 
			
		||||
							
								
								
									
										38
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/CONTRIBUTING.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/CONTRIBUTING.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,38 @@
 | 
			
		||||
# Developer's Certificate of Origin 1.1
 | 
			
		||||
 | 
			
		||||
By making a contribution to this project, I certify that:
 | 
			
		||||
 | 
			
		||||
* (a) The contribution was created in whole or in part by me and I
 | 
			
		||||
  have the right to submit it under the open source license
 | 
			
		||||
  indicated in the file; or
 | 
			
		||||
 | 
			
		||||
* (b) The contribution is based upon previous work that, to the best
 | 
			
		||||
  of my knowledge, is covered under an appropriate open source
 | 
			
		||||
  license and I have the right under that license to submit that
 | 
			
		||||
  work with modifications, whether created in whole or in part
 | 
			
		||||
  by me, under the same open source license (unless I am
 | 
			
		||||
  permitted to submit under a different license), as indicated
 | 
			
		||||
  in the file; or
 | 
			
		||||
 | 
			
		||||
* (c) The contribution was provided directly to me by some other
 | 
			
		||||
  person who certified (a), (b) or (c) and I have not modified
 | 
			
		||||
  it.
 | 
			
		||||
 | 
			
		||||
* (d) I understand and agree that this project and the contribution
 | 
			
		||||
  are public and that a record of the contribution (including all
 | 
			
		||||
  personal information I submit with it, including my sign-off) is
 | 
			
		||||
  maintained indefinitely and may be redistributed consistent with
 | 
			
		||||
  this project or the open source license(s) involved.
 | 
			
		||||
 | 
			
		||||
## Moderation Policy
 | 
			
		||||
 | 
			
		||||
The [Node.js Moderation Policy] applies to this WG.
 | 
			
		||||
 | 
			
		||||
## Code of Conduct
 | 
			
		||||
 | 
			
		||||
The [Node.js Code of Conduct][] applies to this WG.
 | 
			
		||||
 | 
			
		||||
[Node.js Code of Conduct]:
 | 
			
		||||
https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md
 | 
			
		||||
[Node.js Moderation Policy]:
 | 
			
		||||
https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md
 | 
			
		||||
							
								
								
									
										136
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/GOVERNANCE.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										136
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/GOVERNANCE.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,136 @@
 | 
			
		||||
### Streams Working Group
 | 
			
		||||
 | 
			
		||||
The Node.js Streams is jointly governed by a Working Group
 | 
			
		||||
(WG)
 | 
			
		||||
that is responsible for high-level guidance of the project.
 | 
			
		||||
 | 
			
		||||
The WG has final authority over this project including:
 | 
			
		||||
 | 
			
		||||
* Technical direction
 | 
			
		||||
* Project governance and process (including this policy)
 | 
			
		||||
* Contribution policy
 | 
			
		||||
* GitHub repository hosting
 | 
			
		||||
* Conduct guidelines
 | 
			
		||||
* Maintaining the list of additional Collaborators
 | 
			
		||||
 | 
			
		||||
For the current list of WG members, see the project
 | 
			
		||||
[README.md](./README.md#current-project-team-members).
 | 
			
		||||
 | 
			
		||||
### Collaborators
 | 
			
		||||
 | 
			
		||||
The readable-stream GitHub repository is
 | 
			
		||||
maintained by the WG and additional Collaborators who are added by the
 | 
			
		||||
WG on an ongoing basis.
 | 
			
		||||
 | 
			
		||||
Individuals making significant and valuable contributions are made
 | 
			
		||||
Collaborators and given commit-access to the project. These
 | 
			
		||||
individuals are identified by the WG and their addition as
 | 
			
		||||
Collaborators is discussed during the WG meeting.
 | 
			
		||||
 | 
			
		||||
_Note:_ If you make a significant contribution and are not considered
 | 
			
		||||
for commit-access log an issue or contact a WG member directly and it
 | 
			
		||||
will be brought up in the next WG meeting.
 | 
			
		||||
 | 
			
		||||
Modifications of the contents of the readable-stream repository are
 | 
			
		||||
made on
 | 
			
		||||
a collaborative basis. Anybody with a GitHub account may propose a
 | 
			
		||||
modification via pull request and it will be considered by the project
 | 
			
		||||
Collaborators. All pull requests must be reviewed and accepted by a
 | 
			
		||||
Collaborator with sufficient expertise who is able to take full
 | 
			
		||||
responsibility for the change. In the case of pull requests proposed
 | 
			
		||||
by an existing Collaborator, an additional Collaborator is required
 | 
			
		||||
for sign-off. Consensus should be sought if additional Collaborators
 | 
			
		||||
participate and there is disagreement around a particular
 | 
			
		||||
modification. See _Consensus Seeking Process_ below for further detail
 | 
			
		||||
on the consensus model used for governance.
 | 
			
		||||
 | 
			
		||||
Collaborators may opt to elevate significant or controversial
 | 
			
		||||
modifications, or modifications that have not found consensus to the
 | 
			
		||||
WG for discussion by assigning the ***WG-agenda*** tag to a pull
 | 
			
		||||
request or issue. The WG should serve as the final arbiter where
 | 
			
		||||
required.
 | 
			
		||||
 | 
			
		||||
For the current list of Collaborators, see the project
 | 
			
		||||
[README.md](./README.md#members).
 | 
			
		||||
 | 
			
		||||
### WG Membership
 | 
			
		||||
 | 
			
		||||
WG seats are not time-limited.  There is no fixed size of the WG.
 | 
			
		||||
However, the expected target is between 6 and 12, to ensure adequate
 | 
			
		||||
coverage of important areas of expertise, balanced with the ability to
 | 
			
		||||
make decisions efficiently.
 | 
			
		||||
 | 
			
		||||
There is no specific set of requirements or qualifications for WG
 | 
			
		||||
membership beyond these rules.
 | 
			
		||||
 | 
			
		||||
The WG may add additional members to the WG by unanimous consensus.
 | 
			
		||||
 | 
			
		||||
A WG member may be removed from the WG by voluntary resignation, or by
 | 
			
		||||
unanimous consensus of all other WG members.
 | 
			
		||||
 | 
			
		||||
Changes to WG membership should be posted in the agenda, and may be
 | 
			
		||||
suggested as any other agenda item (see "WG Meetings" below).
 | 
			
		||||
 | 
			
		||||
If an addition or removal is proposed during a meeting, and the full
 | 
			
		||||
WG is not in attendance to participate, then the addition or removal
 | 
			
		||||
is added to the agenda for the subsequent meeting.  This is to ensure
 | 
			
		||||
that all members are given the opportunity to participate in all
 | 
			
		||||
membership decisions.  If a WG member is unable to attend a meeting
 | 
			
		||||
where a planned membership decision is being made, then their consent
 | 
			
		||||
is assumed.
 | 
			
		||||
 | 
			
		||||
No more than 1/3 of the WG members may be affiliated with the same
 | 
			
		||||
employer.  If removal or resignation of a WG member, or a change of
 | 
			
		||||
employment by a WG member, creates a situation where more than 1/3 of
 | 
			
		||||
the WG membership shares an employer, then the situation must be
 | 
			
		||||
immediately remedied by the resignation or removal of one or more WG
 | 
			
		||||
members affiliated with the over-represented employer(s).
 | 
			
		||||
 | 
			
		||||
### WG Meetings
 | 
			
		||||
 | 
			
		||||
The WG meets occasionally on a Google Hangout On Air. A designated moderator
 | 
			
		||||
approved by the WG runs the meeting. Each meeting should be
 | 
			
		||||
published to YouTube.
 | 
			
		||||
 | 
			
		||||
Items are added to the WG agenda that are considered contentious or
 | 
			
		||||
are modifications of governance, contribution policy, WG membership,
 | 
			
		||||
or release process.
 | 
			
		||||
 | 
			
		||||
The intention of the agenda is not to approve or review all patches;
 | 
			
		||||
that should happen continuously on GitHub and be handled by the larger
 | 
			
		||||
group of Collaborators.
 | 
			
		||||
 | 
			
		||||
Any community member or contributor can ask that something be added to
 | 
			
		||||
the next meeting's agenda by logging a GitHub Issue. Any Collaborator,
 | 
			
		||||
WG member or the moderator can add the item to the agenda by adding
 | 
			
		||||
the ***WG-agenda*** tag to the issue.
 | 
			
		||||
 | 
			
		||||
Prior to each WG meeting the moderator will share the Agenda with
 | 
			
		||||
members of the WG. WG members can add any items they like to the
 | 
			
		||||
agenda at the beginning of each meeting. The moderator and the WG
 | 
			
		||||
cannot veto or remove items.
 | 
			
		||||
 | 
			
		||||
The WG may invite persons or representatives from certain projects to
 | 
			
		||||
participate in a non-voting capacity.
 | 
			
		||||
 | 
			
		||||
The moderator is responsible for summarizing the discussion of each
 | 
			
		||||
agenda item and sends it as a pull request after the meeting.
 | 
			
		||||
 | 
			
		||||
### Consensus Seeking Process
 | 
			
		||||
 | 
			
		||||
The WG follows a
 | 
			
		||||
[Consensus
 | 
			
		||||
Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making)
 | 
			
		||||
decision-making model.
 | 
			
		||||
 | 
			
		||||
When an agenda item has appeared to reach a consensus the moderator
 | 
			
		||||
will ask "Does anyone object?" as a final call for dissent from the
 | 
			
		||||
consensus.
 | 
			
		||||
 | 
			
		||||
If an agenda item cannot reach a consensus a WG member can call for
 | 
			
		||||
either a closing vote or a vote to table the issue to the next
 | 
			
		||||
meeting. The call for a vote must be seconded by a majority of the WG
 | 
			
		||||
or else the discussion will continue. Simple majority wins.
 | 
			
		||||
 | 
			
		||||
Note that changes to WG membership require a majority consensus.  See
 | 
			
		||||
"WG Membership" above.
 | 
			
		||||
							
								
								
									
										47
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,47 @@
 | 
			
		||||
Node.js is licensed for use as follows:
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
Copyright Node.js contributors. All rights reserved.
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
This license applies to parts of Node.js originating from the
 | 
			
		||||
https://github.com/joyent/node repository:
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
 | 
			
		||||
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.
 | 
			
		||||
"""
 | 
			
		||||
							
								
								
									
										58
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,58 @@
 | 
			
		||||
# readable-stream
 | 
			
		||||
 | 
			
		||||
***Node-core v8.11.1 streams for userland*** [](https://travis-ci.org/nodejs/readable-stream)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
[](https://nodei.co/npm/readable-stream/)
 | 
			
		||||
[](https://nodei.co/npm/readable-stream/)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
[](https://saucelabs.com/u/readable-stream)
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
npm install --save readable-stream
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
***Node-core streams for userland***
 | 
			
		||||
 | 
			
		||||
This package is a mirror of the Streams2 and Streams3 implementations in
 | 
			
		||||
Node-core.
 | 
			
		||||
 | 
			
		||||
Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html).
 | 
			
		||||
 | 
			
		||||
If you want to guarantee a stable streams base, regardless of what version of
 | 
			
		||||
Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
 | 
			
		||||
 | 
			
		||||
As of version 2.0.0 **readable-stream** uses semantic versioning.
 | 
			
		||||
 | 
			
		||||
# Streams Working Group
 | 
			
		||||
 | 
			
		||||
`readable-stream` is maintained by the Streams Working Group, which
 | 
			
		||||
oversees the development and maintenance of the Streams API within
 | 
			
		||||
Node.js. The responsibilities of the Streams Working Group include:
 | 
			
		||||
 | 
			
		||||
* Addressing stream issues on the Node.js issue tracker.
 | 
			
		||||
* Authoring and editing stream documentation within the Node.js project.
 | 
			
		||||
* Reviewing changes to stream subclasses within the Node.js project.
 | 
			
		||||
* Redirecting changes to streams from the Node.js project to this
 | 
			
		||||
  project.
 | 
			
		||||
* Assisting in the implementation of stream providers within Node.js.
 | 
			
		||||
* Recommending versions of `readable-stream` to be included in Node.js.
 | 
			
		||||
* Messaging about the future of streams to give the community advance
 | 
			
		||||
  notice of changes.
 | 
			
		||||
 | 
			
		||||
<a name="members"></a>
 | 
			
		||||
## Team Members
 | 
			
		||||
 | 
			
		||||
* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com>
 | 
			
		||||
  - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B
 | 
			
		||||
* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com>
 | 
			
		||||
  - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
 | 
			
		||||
* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org>
 | 
			
		||||
  - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D
 | 
			
		||||
* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com>
 | 
			
		||||
* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com>
 | 
			
		||||
* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me>
 | 
			
		||||
* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com>
 | 
			
		||||
  - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E
 | 
			
		||||
* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com>
 | 
			
		||||
							
								
								
									
										60
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,60 @@
 | 
			
		||||
# streams WG Meeting 2015-01-30
 | 
			
		||||
 | 
			
		||||
## Links
 | 
			
		||||
 | 
			
		||||
* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg
 | 
			
		||||
* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106
 | 
			
		||||
* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/
 | 
			
		||||
 | 
			
		||||
## Agenda
 | 
			
		||||
 | 
			
		||||
Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting.
 | 
			
		||||
 | 
			
		||||
* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105)
 | 
			
		||||
* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101)
 | 
			
		||||
* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102)
 | 
			
		||||
* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99)
 | 
			
		||||
 | 
			
		||||
## Minutes
 | 
			
		||||
 | 
			
		||||
### adopt a charter
 | 
			
		||||
 | 
			
		||||
* group: +1's all around
 | 
			
		||||
 | 
			
		||||
### What versioning scheme should be adopted?
 | 
			
		||||
* group: +1’s 3.0.0
 | 
			
		||||
* domenic+group: pulling in patches from other sources where appropriate
 | 
			
		||||
* mikeal: version independently, suggesting versions for io.js
 | 
			
		||||
* mikeal+domenic: work with TC to notify in advance of changes
 | 
			
		||||
simpler stream creation
 | 
			
		||||
 | 
			
		||||
### streamline creation of streams
 | 
			
		||||
* sam: streamline creation of streams
 | 
			
		||||
* domenic: nice simple solution posted
 | 
			
		||||
  but, we lose the opportunity to change the model
 | 
			
		||||
  may not be backwards incompatible (double check keys)
 | 
			
		||||
 | 
			
		||||
  **action item:** domenic will check
 | 
			
		||||
 | 
			
		||||
### remove implicit flowing of streams on(‘data’)
 | 
			
		||||
* add isFlowing / isPaused
 | 
			
		||||
* mikeal: worrying that we’re documenting polyfill methods – confuses users
 | 
			
		||||
* domenic: more reflective API is probably good, with warning labels for users
 | 
			
		||||
* new section for mad scientists (reflective stream access)
 | 
			
		||||
* calvin: name the “third state”
 | 
			
		||||
* mikeal: maybe borrow the name from whatwg?
 | 
			
		||||
* domenic: we’re missing the “third state”
 | 
			
		||||
* consensus: kind of difficult to name the third state
 | 
			
		||||
* mikeal: figure out differences in states / compat
 | 
			
		||||
* mathias: always flow on data – eliminates third state
 | 
			
		||||
  * explore what it breaks
 | 
			
		||||
 | 
			
		||||
**action items:**
 | 
			
		||||
* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream)
 | 
			
		||||
* ask rod/build for infrastructure
 | 
			
		||||
* **chris**: explore the “flow on data” approach
 | 
			
		||||
* add isPaused/isFlowing
 | 
			
		||||
* add new docs section
 | 
			
		||||
* move isPaused to that section
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/duplex-browser.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/duplex-browser.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
module.exports = require('./lib/_stream_duplex.js');
 | 
			
		||||
							
								
								
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/duplex.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/duplex.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
module.exports = require('./readable').Duplex
 | 
			
		||||
							
								
								
									
										131
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/_stream_duplex.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										131
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/_stream_duplex.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,131 @@
 | 
			
		||||
// Copyright Joyent, Inc. and other Node 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.
 | 
			
		||||
 | 
			
		||||
// a duplex stream is just a stream that is both readable and writable.
 | 
			
		||||
// Since JS doesn't have multiple prototypal inheritance, this class
 | 
			
		||||
// prototypally inherits from Readable, and then parasitically from
 | 
			
		||||
// Writable.
 | 
			
		||||
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
 | 
			
		||||
var pna = require('process-nextick-args');
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
var objectKeys = Object.keys || function (obj) {
 | 
			
		||||
  var keys = [];
 | 
			
		||||
  for (var key in obj) {
 | 
			
		||||
    keys.push(key);
 | 
			
		||||
  }return keys;
 | 
			
		||||
};
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
module.exports = Duplex;
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
var util = require('core-util-is');
 | 
			
		||||
util.inherits = require('inherits');
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
var Readable = require('./_stream_readable');
 | 
			
		||||
var Writable = require('./_stream_writable');
 | 
			
		||||
 | 
			
		||||
util.inherits(Duplex, Readable);
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  // avoid scope creep, the keys array can then be collected
 | 
			
		||||
  var keys = objectKeys(Writable.prototype);
 | 
			
		||||
  for (var v = 0; v < keys.length; v++) {
 | 
			
		||||
    var method = keys[v];
 | 
			
		||||
    if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function Duplex(options) {
 | 
			
		||||
  if (!(this instanceof Duplex)) return new Duplex(options);
 | 
			
		||||
 | 
			
		||||
  Readable.call(this, options);
 | 
			
		||||
  Writable.call(this, options);
 | 
			
		||||
 | 
			
		||||
  if (options && options.readable === false) this.readable = false;
 | 
			
		||||
 | 
			
		||||
  if (options && options.writable === false) this.writable = false;
 | 
			
		||||
 | 
			
		||||
  this.allowHalfOpen = true;
 | 
			
		||||
  if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
 | 
			
		||||
 | 
			
		||||
  this.once('end', onend);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
 | 
			
		||||
  // making it explicit this property is not enumerable
 | 
			
		||||
  // because otherwise some prototype manipulation in
 | 
			
		||||
  // userland will fail
 | 
			
		||||
  enumerable: false,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return this._writableState.highWaterMark;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// the no-half-open enforcer
 | 
			
		||||
function onend() {
 | 
			
		||||
  // if we allow half-open state, or if the writable side ended,
 | 
			
		||||
  // then we're ok.
 | 
			
		||||
  if (this.allowHalfOpen || this._writableState.ended) return;
 | 
			
		||||
 | 
			
		||||
  // no more data can be written.
 | 
			
		||||
  // But allow more writes to happen in this tick.
 | 
			
		||||
  pna.nextTick(onEndNT, this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function onEndNT(self) {
 | 
			
		||||
  self.end();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(Duplex.prototype, 'destroyed', {
 | 
			
		||||
  get: function () {
 | 
			
		||||
    if (this._readableState === undefined || this._writableState === undefined) {
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
    return this._readableState.destroyed && this._writableState.destroyed;
 | 
			
		||||
  },
 | 
			
		||||
  set: function (value) {
 | 
			
		||||
    // we ignore the value if the stream
 | 
			
		||||
    // has not been initialized yet
 | 
			
		||||
    if (this._readableState === undefined || this._writableState === undefined) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // backward compatibility, the user is explicitly
 | 
			
		||||
    // managing destroyed
 | 
			
		||||
    this._readableState.destroyed = value;
 | 
			
		||||
    this._writableState.destroyed = value;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
Duplex.prototype._destroy = function (err, cb) {
 | 
			
		||||
  this.push(null);
 | 
			
		||||
  this.end();
 | 
			
		||||
 | 
			
		||||
  pna.nextTick(cb, err);
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										47
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/_stream_passthrough.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/_stream_passthrough.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,47 @@
 | 
			
		||||
// Copyright Joyent, Inc. and other Node 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.
 | 
			
		||||
 | 
			
		||||
// a passthrough stream.
 | 
			
		||||
// basically just the most minimal sort of Transform stream.
 | 
			
		||||
// Every written chunk gets output as-is.
 | 
			
		||||
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
module.exports = PassThrough;
 | 
			
		||||
 | 
			
		||||
var Transform = require('./_stream_transform');
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
var util = require('core-util-is');
 | 
			
		||||
util.inherits = require('inherits');
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
util.inherits(PassThrough, Transform);
 | 
			
		||||
 | 
			
		||||
function PassThrough(options) {
 | 
			
		||||
  if (!(this instanceof PassThrough)) return new PassThrough(options);
 | 
			
		||||
 | 
			
		||||
  Transform.call(this, options);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
PassThrough.prototype._transform = function (chunk, encoding, cb) {
 | 
			
		||||
  cb(null, chunk);
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										1019
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/_stream_readable.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1019
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/_stream_readable.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										214
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/_stream_transform.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										214
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/_stream_transform.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,214 @@
 | 
			
		||||
// Copyright Joyent, Inc. and other Node 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.
 | 
			
		||||
 | 
			
		||||
// a transform stream is a readable/writable stream where you do
 | 
			
		||||
// something with the data.  Sometimes it's called a "filter",
 | 
			
		||||
// but that's not a great name for it, since that implies a thing where
 | 
			
		||||
// some bits pass through, and others are simply ignored.  (That would
 | 
			
		||||
// be a valid example of a transform, of course.)
 | 
			
		||||
//
 | 
			
		||||
// While the output is causally related to the input, it's not a
 | 
			
		||||
// necessarily symmetric or synchronous transformation.  For example,
 | 
			
		||||
// a zlib stream might take multiple plain-text writes(), and then
 | 
			
		||||
// emit a single compressed chunk some time in the future.
 | 
			
		||||
//
 | 
			
		||||
// Here's how this works:
 | 
			
		||||
//
 | 
			
		||||
// The Transform stream has all the aspects of the readable and writable
 | 
			
		||||
// stream classes.  When you write(chunk), that calls _write(chunk,cb)
 | 
			
		||||
// internally, and returns false if there's a lot of pending writes
 | 
			
		||||
// buffered up.  When you call read(), that calls _read(n) until
 | 
			
		||||
// there's enough pending readable data buffered up.
 | 
			
		||||
//
 | 
			
		||||
// In a transform stream, the written data is placed in a buffer.  When
 | 
			
		||||
// _read(n) is called, it transforms the queued up data, calling the
 | 
			
		||||
// buffered _write cb's as it consumes chunks.  If consuming a single
 | 
			
		||||
// written chunk would result in multiple output chunks, then the first
 | 
			
		||||
// outputted bit calls the readcb, and subsequent chunks just go into
 | 
			
		||||
// the read buffer, and will cause it to emit 'readable' if necessary.
 | 
			
		||||
//
 | 
			
		||||
// This way, back-pressure is actually determined by the reading side,
 | 
			
		||||
// since _read has to be called to start processing a new chunk.  However,
 | 
			
		||||
// a pathological inflate type of transform can cause excessive buffering
 | 
			
		||||
// here.  For example, imagine a stream where every byte of input is
 | 
			
		||||
// interpreted as an integer from 0-255, and then results in that many
 | 
			
		||||
// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in
 | 
			
		||||
// 1kb of data being output.  In this case, you could write a very small
 | 
			
		||||
// amount of input, and end up with a very large amount of output.  In
 | 
			
		||||
// such a pathological inflating mechanism, there'd be no way to tell
 | 
			
		||||
// the system to stop doing the transform.  A single 4MB write could
 | 
			
		||||
// cause the system to run out of memory.
 | 
			
		||||
//
 | 
			
		||||
// However, even in such a pathological case, only a single written chunk
 | 
			
		||||
// would be consumed, and then the rest would wait (un-transformed) until
 | 
			
		||||
// the results of the previous transformed chunk were consumed.
 | 
			
		||||
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
module.exports = Transform;
 | 
			
		||||
 | 
			
		||||
var Duplex = require('./_stream_duplex');
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
var util = require('core-util-is');
 | 
			
		||||
util.inherits = require('inherits');
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
util.inherits(Transform, Duplex);
 | 
			
		||||
 | 
			
		||||
function afterTransform(er, data) {
 | 
			
		||||
  var ts = this._transformState;
 | 
			
		||||
  ts.transforming = false;
 | 
			
		||||
 | 
			
		||||
  var cb = ts.writecb;
 | 
			
		||||
 | 
			
		||||
  if (!cb) {
 | 
			
		||||
    return this.emit('error', new Error('write callback called multiple times'));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ts.writechunk = null;
 | 
			
		||||
  ts.writecb = null;
 | 
			
		||||
 | 
			
		||||
  if (data != null) // single equals check for both `null` and `undefined`
 | 
			
		||||
    this.push(data);
 | 
			
		||||
 | 
			
		||||
  cb(er);
 | 
			
		||||
 | 
			
		||||
  var rs = this._readableState;
 | 
			
		||||
  rs.reading = false;
 | 
			
		||||
  if (rs.needReadable || rs.length < rs.highWaterMark) {
 | 
			
		||||
    this._read(rs.highWaterMark);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function Transform(options) {
 | 
			
		||||
  if (!(this instanceof Transform)) return new Transform(options);
 | 
			
		||||
 | 
			
		||||
  Duplex.call(this, options);
 | 
			
		||||
 | 
			
		||||
  this._transformState = {
 | 
			
		||||
    afterTransform: afterTransform.bind(this),
 | 
			
		||||
    needTransform: false,
 | 
			
		||||
    transforming: false,
 | 
			
		||||
    writecb: null,
 | 
			
		||||
    writechunk: null,
 | 
			
		||||
    writeencoding: null
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  // start out asking for a readable event once data is transformed.
 | 
			
		||||
  this._readableState.needReadable = true;
 | 
			
		||||
 | 
			
		||||
  // we have implemented the _read method, and done the other things
 | 
			
		||||
  // that Readable wants before the first _read call, so unset the
 | 
			
		||||
  // sync guard flag.
 | 
			
		||||
  this._readableState.sync = false;
 | 
			
		||||
 | 
			
		||||
  if (options) {
 | 
			
		||||
    if (typeof options.transform === 'function') this._transform = options.transform;
 | 
			
		||||
 | 
			
		||||
    if (typeof options.flush === 'function') this._flush = options.flush;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // When the writable side finishes, then flush out anything remaining.
 | 
			
		||||
  this.on('prefinish', prefinish);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function prefinish() {
 | 
			
		||||
  var _this = this;
 | 
			
		||||
 | 
			
		||||
  if (typeof this._flush === 'function') {
 | 
			
		||||
    this._flush(function (er, data) {
 | 
			
		||||
      done(_this, er, data);
 | 
			
		||||
    });
 | 
			
		||||
  } else {
 | 
			
		||||
    done(this, null, null);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Transform.prototype.push = function (chunk, encoding) {
 | 
			
		||||
  this._transformState.needTransform = false;
 | 
			
		||||
  return Duplex.prototype.push.call(this, chunk, encoding);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// This is the part where you do stuff!
 | 
			
		||||
// override this function in implementation classes.
 | 
			
		||||
// 'chunk' is an input chunk.
 | 
			
		||||
//
 | 
			
		||||
// Call `push(newChunk)` to pass along transformed output
 | 
			
		||||
// to the readable side.  You may call 'push' zero or more times.
 | 
			
		||||
//
 | 
			
		||||
// Call `cb(err)` when you are done with this chunk.  If you pass
 | 
			
		||||
// an error, then that'll put the hurt on the whole operation.  If you
 | 
			
		||||
// never call cb(), then you'll never get another chunk.
 | 
			
		||||
Transform.prototype._transform = function (chunk, encoding, cb) {
 | 
			
		||||
  throw new Error('_transform() is not implemented');
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Transform.prototype._write = function (chunk, encoding, cb) {
 | 
			
		||||
  var ts = this._transformState;
 | 
			
		||||
  ts.writecb = cb;
 | 
			
		||||
  ts.writechunk = chunk;
 | 
			
		||||
  ts.writeencoding = encoding;
 | 
			
		||||
  if (!ts.transforming) {
 | 
			
		||||
    var rs = this._readableState;
 | 
			
		||||
    if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// Doesn't matter what the args are here.
 | 
			
		||||
// _transform does all the work.
 | 
			
		||||
// That we got here means that the readable side wants more data.
 | 
			
		||||
Transform.prototype._read = function (n) {
 | 
			
		||||
  var ts = this._transformState;
 | 
			
		||||
 | 
			
		||||
  if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
 | 
			
		||||
    ts.transforming = true;
 | 
			
		||||
    this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
 | 
			
		||||
  } else {
 | 
			
		||||
    // mark that we need a transform, so that any data that comes in
 | 
			
		||||
    // will get processed, now that we've asked for it.
 | 
			
		||||
    ts.needTransform = true;
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Transform.prototype._destroy = function (err, cb) {
 | 
			
		||||
  var _this2 = this;
 | 
			
		||||
 | 
			
		||||
  Duplex.prototype._destroy.call(this, err, function (err2) {
 | 
			
		||||
    cb(err2);
 | 
			
		||||
    _this2.emit('close');
 | 
			
		||||
  });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function done(stream, er, data) {
 | 
			
		||||
  if (er) return stream.emit('error', er);
 | 
			
		||||
 | 
			
		||||
  if (data != null) // single equals check for both `null` and `undefined`
 | 
			
		||||
    stream.push(data);
 | 
			
		||||
 | 
			
		||||
  // if there's nothing in the write buffer, then that means
 | 
			
		||||
  // that nothing more will ever be provided
 | 
			
		||||
  if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
 | 
			
		||||
 | 
			
		||||
  if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
 | 
			
		||||
 | 
			
		||||
  return stream.push(null);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										687
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/_stream_writable.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										687
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/_stream_writable.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,687 @@
 | 
			
		||||
// Copyright Joyent, Inc. and other Node 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.
 | 
			
		||||
 | 
			
		||||
// A bit simpler than readable streams.
 | 
			
		||||
// Implement an async ._write(chunk, encoding, cb), and it'll handle all
 | 
			
		||||
// the drain event emission and buffering.
 | 
			
		||||
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
 | 
			
		||||
var pna = require('process-nextick-args');
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
module.exports = Writable;
 | 
			
		||||
 | 
			
		||||
/* <replacement> */
 | 
			
		||||
function WriteReq(chunk, encoding, cb) {
 | 
			
		||||
  this.chunk = chunk;
 | 
			
		||||
  this.encoding = encoding;
 | 
			
		||||
  this.callback = cb;
 | 
			
		||||
  this.next = null;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// It seems a linked list but it is not
 | 
			
		||||
// there will be only 2 of these for each stream
 | 
			
		||||
function CorkedRequest(state) {
 | 
			
		||||
  var _this = this;
 | 
			
		||||
 | 
			
		||||
  this.next = null;
 | 
			
		||||
  this.entry = null;
 | 
			
		||||
  this.finish = function () {
 | 
			
		||||
    onCorkedFinish(_this, state);
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
/* </replacement> */
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
var Duplex;
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
Writable.WritableState = WritableState;
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
var util = require('core-util-is');
 | 
			
		||||
util.inherits = require('inherits');
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
var internalUtil = {
 | 
			
		||||
  deprecate: require('util-deprecate')
 | 
			
		||||
};
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
var Stream = require('./internal/streams/stream');
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
 | 
			
		||||
var Buffer = require('safe-buffer').Buffer;
 | 
			
		||||
var OurUint8Array = global.Uint8Array || function () {};
 | 
			
		||||
function _uint8ArrayToBuffer(chunk) {
 | 
			
		||||
  return Buffer.from(chunk);
 | 
			
		||||
}
 | 
			
		||||
function _isUint8Array(obj) {
 | 
			
		||||
  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
var destroyImpl = require('./internal/streams/destroy');
 | 
			
		||||
 | 
			
		||||
util.inherits(Writable, Stream);
 | 
			
		||||
 | 
			
		||||
function nop() {}
 | 
			
		||||
 | 
			
		||||
function WritableState(options, stream) {
 | 
			
		||||
  Duplex = Duplex || require('./_stream_duplex');
 | 
			
		||||
 | 
			
		||||
  options = options || {};
 | 
			
		||||
 | 
			
		||||
  // Duplex streams are both readable and writable, but share
 | 
			
		||||
  // the same options object.
 | 
			
		||||
  // However, some cases require setting options to different
 | 
			
		||||
  // values for the readable and the writable sides of the duplex stream.
 | 
			
		||||
  // These options can be provided separately as readableXXX and writableXXX.
 | 
			
		||||
  var isDuplex = stream instanceof Duplex;
 | 
			
		||||
 | 
			
		||||
  // object stream flag to indicate whether or not this stream
 | 
			
		||||
  // contains buffers or objects.
 | 
			
		||||
  this.objectMode = !!options.objectMode;
 | 
			
		||||
 | 
			
		||||
  if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
 | 
			
		||||
 | 
			
		||||
  // the point at which write() starts returning false
 | 
			
		||||
  // Note: 0 is a valid value, means that we always return false if
 | 
			
		||||
  // the entire buffer is not flushed immediately on write()
 | 
			
		||||
  var hwm = options.highWaterMark;
 | 
			
		||||
  var writableHwm = options.writableHighWaterMark;
 | 
			
		||||
  var defaultHwm = this.objectMode ? 16 : 16 * 1024;
 | 
			
		||||
 | 
			
		||||
  if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
 | 
			
		||||
 | 
			
		||||
  // cast to ints.
 | 
			
		||||
  this.highWaterMark = Math.floor(this.highWaterMark);
 | 
			
		||||
 | 
			
		||||
  // if _final has been called
 | 
			
		||||
  this.finalCalled = false;
 | 
			
		||||
 | 
			
		||||
  // drain event flag.
 | 
			
		||||
  this.needDrain = false;
 | 
			
		||||
  // at the start of calling end()
 | 
			
		||||
  this.ending = false;
 | 
			
		||||
  // when end() has been called, and returned
 | 
			
		||||
  this.ended = false;
 | 
			
		||||
  // when 'finish' is emitted
 | 
			
		||||
  this.finished = false;
 | 
			
		||||
 | 
			
		||||
  // has it been destroyed
 | 
			
		||||
  this.destroyed = false;
 | 
			
		||||
 | 
			
		||||
  // should we decode strings into buffers before passing to _write?
 | 
			
		||||
  // this is here so that some node-core streams can optimize string
 | 
			
		||||
  // handling at a lower level.
 | 
			
		||||
  var noDecode = options.decodeStrings === false;
 | 
			
		||||
  this.decodeStrings = !noDecode;
 | 
			
		||||
 | 
			
		||||
  // Crypto is kind of old and crusty.  Historically, its default string
 | 
			
		||||
  // encoding is 'binary' so we have to make this configurable.
 | 
			
		||||
  // Everything else in the universe uses 'utf8', though.
 | 
			
		||||
  this.defaultEncoding = options.defaultEncoding || 'utf8';
 | 
			
		||||
 | 
			
		||||
  // not an actual buffer we keep track of, but a measurement
 | 
			
		||||
  // of how much we're waiting to get pushed to some underlying
 | 
			
		||||
  // socket or file.
 | 
			
		||||
  this.length = 0;
 | 
			
		||||
 | 
			
		||||
  // a flag to see when we're in the middle of a write.
 | 
			
		||||
  this.writing = false;
 | 
			
		||||
 | 
			
		||||
  // when true all writes will be buffered until .uncork() call
 | 
			
		||||
  this.corked = 0;
 | 
			
		||||
 | 
			
		||||
  // a flag to be able to tell if the onwrite cb is called immediately,
 | 
			
		||||
  // or on a later tick.  We set this to true at first, because any
 | 
			
		||||
  // actions that shouldn't happen until "later" should generally also
 | 
			
		||||
  // not happen before the first write call.
 | 
			
		||||
  this.sync = true;
 | 
			
		||||
 | 
			
		||||
  // a flag to know if we're processing previously buffered items, which
 | 
			
		||||
  // may call the _write() callback in the same tick, so that we don't
 | 
			
		||||
  // end up in an overlapped onwrite situation.
 | 
			
		||||
  this.bufferProcessing = false;
 | 
			
		||||
 | 
			
		||||
  // the callback that's passed to _write(chunk,cb)
 | 
			
		||||
  this.onwrite = function (er) {
 | 
			
		||||
    onwrite(stream, er);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  // the callback that the user supplies to write(chunk,encoding,cb)
 | 
			
		||||
  this.writecb = null;
 | 
			
		||||
 | 
			
		||||
  // the amount that is being written when _write is called.
 | 
			
		||||
  this.writelen = 0;
 | 
			
		||||
 | 
			
		||||
  this.bufferedRequest = null;
 | 
			
		||||
  this.lastBufferedRequest = null;
 | 
			
		||||
 | 
			
		||||
  // number of pending user-supplied write callbacks
 | 
			
		||||
  // this must be 0 before 'finish' can be emitted
 | 
			
		||||
  this.pendingcb = 0;
 | 
			
		||||
 | 
			
		||||
  // emit prefinish if the only thing we're waiting for is _write cbs
 | 
			
		||||
  // This is relevant for synchronous Transform streams
 | 
			
		||||
  this.prefinished = false;
 | 
			
		||||
 | 
			
		||||
  // True if the error was already emitted and should not be thrown again
 | 
			
		||||
  this.errorEmitted = false;
 | 
			
		||||
 | 
			
		||||
  // count buffered requests
 | 
			
		||||
  this.bufferedRequestCount = 0;
 | 
			
		||||
 | 
			
		||||
  // allocate the first CorkedRequest, there is always
 | 
			
		||||
  // one allocated and free to use, and we maintain at most two
 | 
			
		||||
  this.corkedRequestsFree = new CorkedRequest(this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
WritableState.prototype.getBuffer = function getBuffer() {
 | 
			
		||||
  var current = this.bufferedRequest;
 | 
			
		||||
  var out = [];
 | 
			
		||||
  while (current) {
 | 
			
		||||
    out.push(current);
 | 
			
		||||
    current = current.next;
 | 
			
		||||
  }
 | 
			
		||||
  return out;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
(function () {
 | 
			
		||||
  try {
 | 
			
		||||
    Object.defineProperty(WritableState.prototype, 'buffer', {
 | 
			
		||||
      get: internalUtil.deprecate(function () {
 | 
			
		||||
        return this.getBuffer();
 | 
			
		||||
      }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
 | 
			
		||||
    });
 | 
			
		||||
  } catch (_) {}
 | 
			
		||||
})();
 | 
			
		||||
 | 
			
		||||
// Test _writableState for inheritance to account for Duplex streams,
 | 
			
		||||
// whose prototype chain only points to Readable.
 | 
			
		||||
var realHasInstance;
 | 
			
		||||
if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
 | 
			
		||||
  realHasInstance = Function.prototype[Symbol.hasInstance];
 | 
			
		||||
  Object.defineProperty(Writable, Symbol.hasInstance, {
 | 
			
		||||
    value: function (object) {
 | 
			
		||||
      if (realHasInstance.call(this, object)) return true;
 | 
			
		||||
      if (this !== Writable) return false;
 | 
			
		||||
 | 
			
		||||
      return object && object._writableState instanceof WritableState;
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
} else {
 | 
			
		||||
  realHasInstance = function (object) {
 | 
			
		||||
    return object instanceof this;
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function Writable(options) {
 | 
			
		||||
  Duplex = Duplex || require('./_stream_duplex');
 | 
			
		||||
 | 
			
		||||
  // Writable ctor is applied to Duplexes, too.
 | 
			
		||||
  // `realHasInstance` is necessary because using plain `instanceof`
 | 
			
		||||
  // would return false, as no `_writableState` property is attached.
 | 
			
		||||
 | 
			
		||||
  // Trying to use the custom `instanceof` for Writable here will also break the
 | 
			
		||||
  // Node.js LazyTransform implementation, which has a non-trivial getter for
 | 
			
		||||
  // `_writableState` that would lead to infinite recursion.
 | 
			
		||||
  if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
 | 
			
		||||
    return new Writable(options);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  this._writableState = new WritableState(options, this);
 | 
			
		||||
 | 
			
		||||
  // legacy.
 | 
			
		||||
  this.writable = true;
 | 
			
		||||
 | 
			
		||||
  if (options) {
 | 
			
		||||
    if (typeof options.write === 'function') this._write = options.write;
 | 
			
		||||
 | 
			
		||||
    if (typeof options.writev === 'function') this._writev = options.writev;
 | 
			
		||||
 | 
			
		||||
    if (typeof options.destroy === 'function') this._destroy = options.destroy;
 | 
			
		||||
 | 
			
		||||
    if (typeof options.final === 'function') this._final = options.final;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Stream.call(this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Otherwise people can pipe Writable streams, which is just wrong.
 | 
			
		||||
Writable.prototype.pipe = function () {
 | 
			
		||||
  this.emit('error', new Error('Cannot pipe, not readable'));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function writeAfterEnd(stream, cb) {
 | 
			
		||||
  var er = new Error('write after end');
 | 
			
		||||
  // TODO: defer error events consistently everywhere, not just the cb
 | 
			
		||||
  stream.emit('error', er);
 | 
			
		||||
  pna.nextTick(cb, er);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Checks that a user-supplied chunk is valid, especially for the particular
 | 
			
		||||
// mode the stream is in. Currently this means that `null` is never accepted
 | 
			
		||||
// and undefined/non-string values are only allowed in object mode.
 | 
			
		||||
function validChunk(stream, state, chunk, cb) {
 | 
			
		||||
  var valid = true;
 | 
			
		||||
  var er = false;
 | 
			
		||||
 | 
			
		||||
  if (chunk === null) {
 | 
			
		||||
    er = new TypeError('May not write null values to stream');
 | 
			
		||||
  } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
 | 
			
		||||
    er = new TypeError('Invalid non-string/buffer chunk');
 | 
			
		||||
  }
 | 
			
		||||
  if (er) {
 | 
			
		||||
    stream.emit('error', er);
 | 
			
		||||
    pna.nextTick(cb, er);
 | 
			
		||||
    valid = false;
 | 
			
		||||
  }
 | 
			
		||||
  return valid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Writable.prototype.write = function (chunk, encoding, cb) {
 | 
			
		||||
  var state = this._writableState;
 | 
			
		||||
  var ret = false;
 | 
			
		||||
  var isBuf = !state.objectMode && _isUint8Array(chunk);
 | 
			
		||||
 | 
			
		||||
  if (isBuf && !Buffer.isBuffer(chunk)) {
 | 
			
		||||
    chunk = _uint8ArrayToBuffer(chunk);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (typeof encoding === 'function') {
 | 
			
		||||
    cb = encoding;
 | 
			
		||||
    encoding = null;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
 | 
			
		||||
 | 
			
		||||
  if (typeof cb !== 'function') cb = nop;
 | 
			
		||||
 | 
			
		||||
  if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
 | 
			
		||||
    state.pendingcb++;
 | 
			
		||||
    ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return ret;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Writable.prototype.cork = function () {
 | 
			
		||||
  var state = this._writableState;
 | 
			
		||||
 | 
			
		||||
  state.corked++;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Writable.prototype.uncork = function () {
 | 
			
		||||
  var state = this._writableState;
 | 
			
		||||
 | 
			
		||||
  if (state.corked) {
 | 
			
		||||
    state.corked--;
 | 
			
		||||
 | 
			
		||||
    if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
 | 
			
		||||
  // node::ParseEncoding() requires lower case.
 | 
			
		||||
  if (typeof encoding === 'string') encoding = encoding.toLowerCase();
 | 
			
		||||
  if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
 | 
			
		||||
  this._writableState.defaultEncoding = encoding;
 | 
			
		||||
  return this;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function decodeChunk(state, chunk, encoding) {
 | 
			
		||||
  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
 | 
			
		||||
    chunk = Buffer.from(chunk, encoding);
 | 
			
		||||
  }
 | 
			
		||||
  return chunk;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
 | 
			
		||||
  // making it explicit this property is not enumerable
 | 
			
		||||
  // because otherwise some prototype manipulation in
 | 
			
		||||
  // userland will fail
 | 
			
		||||
  enumerable: false,
 | 
			
		||||
  get: function () {
 | 
			
		||||
    return this._writableState.highWaterMark;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// if we're already writing something, then just put this
 | 
			
		||||
// in the queue, and wait our turn.  Otherwise, call _write
 | 
			
		||||
// If we return false, then we need a drain event, so set that flag.
 | 
			
		||||
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
 | 
			
		||||
  if (!isBuf) {
 | 
			
		||||
    var newChunk = decodeChunk(state, chunk, encoding);
 | 
			
		||||
    if (chunk !== newChunk) {
 | 
			
		||||
      isBuf = true;
 | 
			
		||||
      encoding = 'buffer';
 | 
			
		||||
      chunk = newChunk;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  var len = state.objectMode ? 1 : chunk.length;
 | 
			
		||||
 | 
			
		||||
  state.length += len;
 | 
			
		||||
 | 
			
		||||
  var ret = state.length < state.highWaterMark;
 | 
			
		||||
  // we must ensure that previous needDrain will not be reset to false.
 | 
			
		||||
  if (!ret) state.needDrain = true;
 | 
			
		||||
 | 
			
		||||
  if (state.writing || state.corked) {
 | 
			
		||||
    var last = state.lastBufferedRequest;
 | 
			
		||||
    state.lastBufferedRequest = {
 | 
			
		||||
      chunk: chunk,
 | 
			
		||||
      encoding: encoding,
 | 
			
		||||
      isBuf: isBuf,
 | 
			
		||||
      callback: cb,
 | 
			
		||||
      next: null
 | 
			
		||||
    };
 | 
			
		||||
    if (last) {
 | 
			
		||||
      last.next = state.lastBufferedRequest;
 | 
			
		||||
    } else {
 | 
			
		||||
      state.bufferedRequest = state.lastBufferedRequest;
 | 
			
		||||
    }
 | 
			
		||||
    state.bufferedRequestCount += 1;
 | 
			
		||||
  } else {
 | 
			
		||||
    doWrite(stream, state, false, len, chunk, encoding, cb);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
 | 
			
		||||
  state.writelen = len;
 | 
			
		||||
  state.writecb = cb;
 | 
			
		||||
  state.writing = true;
 | 
			
		||||
  state.sync = true;
 | 
			
		||||
  if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
 | 
			
		||||
  state.sync = false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function onwriteError(stream, state, sync, er, cb) {
 | 
			
		||||
  --state.pendingcb;
 | 
			
		||||
 | 
			
		||||
  if (sync) {
 | 
			
		||||
    // defer the callback if we are being called synchronously
 | 
			
		||||
    // to avoid piling up things on the stack
 | 
			
		||||
    pna.nextTick(cb, er);
 | 
			
		||||
    // this can emit finish, and it will always happen
 | 
			
		||||
    // after error
 | 
			
		||||
    pna.nextTick(finishMaybe, stream, state);
 | 
			
		||||
    stream._writableState.errorEmitted = true;
 | 
			
		||||
    stream.emit('error', er);
 | 
			
		||||
  } else {
 | 
			
		||||
    // the caller expect this to happen before if
 | 
			
		||||
    // it is async
 | 
			
		||||
    cb(er);
 | 
			
		||||
    stream._writableState.errorEmitted = true;
 | 
			
		||||
    stream.emit('error', er);
 | 
			
		||||
    // this can emit finish, but finish must
 | 
			
		||||
    // always follow error
 | 
			
		||||
    finishMaybe(stream, state);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function onwriteStateUpdate(state) {
 | 
			
		||||
  state.writing = false;
 | 
			
		||||
  state.writecb = null;
 | 
			
		||||
  state.length -= state.writelen;
 | 
			
		||||
  state.writelen = 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function onwrite(stream, er) {
 | 
			
		||||
  var state = stream._writableState;
 | 
			
		||||
  var sync = state.sync;
 | 
			
		||||
  var cb = state.writecb;
 | 
			
		||||
 | 
			
		||||
  onwriteStateUpdate(state);
 | 
			
		||||
 | 
			
		||||
  if (er) onwriteError(stream, state, sync, er, cb);else {
 | 
			
		||||
    // Check if we're actually ready to finish, but don't emit yet
 | 
			
		||||
    var finished = needFinish(state);
 | 
			
		||||
 | 
			
		||||
    if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
 | 
			
		||||
      clearBuffer(stream, state);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (sync) {
 | 
			
		||||
      /*<replacement>*/
 | 
			
		||||
      asyncWrite(afterWrite, stream, state, finished, cb);
 | 
			
		||||
      /*</replacement>*/
 | 
			
		||||
    } else {
 | 
			
		||||
      afterWrite(stream, state, finished, cb);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function afterWrite(stream, state, finished, cb) {
 | 
			
		||||
  if (!finished) onwriteDrain(stream, state);
 | 
			
		||||
  state.pendingcb--;
 | 
			
		||||
  cb();
 | 
			
		||||
  finishMaybe(stream, state);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Must force callback to be called on nextTick, so that we don't
 | 
			
		||||
// emit 'drain' before the write() consumer gets the 'false' return
 | 
			
		||||
// value, and has a chance to attach a 'drain' listener.
 | 
			
		||||
function onwriteDrain(stream, state) {
 | 
			
		||||
  if (state.length === 0 && state.needDrain) {
 | 
			
		||||
    state.needDrain = false;
 | 
			
		||||
    stream.emit('drain');
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// if there's something in the buffer waiting, then process it
 | 
			
		||||
function clearBuffer(stream, state) {
 | 
			
		||||
  state.bufferProcessing = true;
 | 
			
		||||
  var entry = state.bufferedRequest;
 | 
			
		||||
 | 
			
		||||
  if (stream._writev && entry && entry.next) {
 | 
			
		||||
    // Fast case, write everything using _writev()
 | 
			
		||||
    var l = state.bufferedRequestCount;
 | 
			
		||||
    var buffer = new Array(l);
 | 
			
		||||
    var holder = state.corkedRequestsFree;
 | 
			
		||||
    holder.entry = entry;
 | 
			
		||||
 | 
			
		||||
    var count = 0;
 | 
			
		||||
    var allBuffers = true;
 | 
			
		||||
    while (entry) {
 | 
			
		||||
      buffer[count] = entry;
 | 
			
		||||
      if (!entry.isBuf) allBuffers = false;
 | 
			
		||||
      entry = entry.next;
 | 
			
		||||
      count += 1;
 | 
			
		||||
    }
 | 
			
		||||
    buffer.allBuffers = allBuffers;
 | 
			
		||||
 | 
			
		||||
    doWrite(stream, state, true, state.length, buffer, '', holder.finish);
 | 
			
		||||
 | 
			
		||||
    // doWrite is almost always async, defer these to save a bit of time
 | 
			
		||||
    // as the hot path ends with doWrite
 | 
			
		||||
    state.pendingcb++;
 | 
			
		||||
    state.lastBufferedRequest = null;
 | 
			
		||||
    if (holder.next) {
 | 
			
		||||
      state.corkedRequestsFree = holder.next;
 | 
			
		||||
      holder.next = null;
 | 
			
		||||
    } else {
 | 
			
		||||
      state.corkedRequestsFree = new CorkedRequest(state);
 | 
			
		||||
    }
 | 
			
		||||
    state.bufferedRequestCount = 0;
 | 
			
		||||
  } else {
 | 
			
		||||
    // Slow case, write chunks one-by-one
 | 
			
		||||
    while (entry) {
 | 
			
		||||
      var chunk = entry.chunk;
 | 
			
		||||
      var encoding = entry.encoding;
 | 
			
		||||
      var cb = entry.callback;
 | 
			
		||||
      var len = state.objectMode ? 1 : chunk.length;
 | 
			
		||||
 | 
			
		||||
      doWrite(stream, state, false, len, chunk, encoding, cb);
 | 
			
		||||
      entry = entry.next;
 | 
			
		||||
      state.bufferedRequestCount--;
 | 
			
		||||
      // if we didn't call the onwrite immediately, then
 | 
			
		||||
      // it means that we need to wait until it does.
 | 
			
		||||
      // also, that means that the chunk and cb are currently
 | 
			
		||||
      // being processed, so move the buffer counter past them.
 | 
			
		||||
      if (state.writing) {
 | 
			
		||||
        break;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (entry === null) state.lastBufferedRequest = null;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  state.bufferedRequest = entry;
 | 
			
		||||
  state.bufferProcessing = false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Writable.prototype._write = function (chunk, encoding, cb) {
 | 
			
		||||
  cb(new Error('_write() is not implemented'));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
Writable.prototype._writev = null;
 | 
			
		||||
 | 
			
		||||
Writable.prototype.end = function (chunk, encoding, cb) {
 | 
			
		||||
  var state = this._writableState;
 | 
			
		||||
 | 
			
		||||
  if (typeof chunk === 'function') {
 | 
			
		||||
    cb = chunk;
 | 
			
		||||
    chunk = null;
 | 
			
		||||
    encoding = null;
 | 
			
		||||
  } else if (typeof encoding === 'function') {
 | 
			
		||||
    cb = encoding;
 | 
			
		||||
    encoding = null;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
 | 
			
		||||
 | 
			
		||||
  // .end() fully uncorks
 | 
			
		||||
  if (state.corked) {
 | 
			
		||||
    state.corked = 1;
 | 
			
		||||
    this.uncork();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // ignore unnecessary end() calls.
 | 
			
		||||
  if (!state.ending && !state.finished) endWritable(this, state, cb);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function needFinish(state) {
 | 
			
		||||
  return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
 | 
			
		||||
}
 | 
			
		||||
function callFinal(stream, state) {
 | 
			
		||||
  stream._final(function (err) {
 | 
			
		||||
    state.pendingcb--;
 | 
			
		||||
    if (err) {
 | 
			
		||||
      stream.emit('error', err);
 | 
			
		||||
    }
 | 
			
		||||
    state.prefinished = true;
 | 
			
		||||
    stream.emit('prefinish');
 | 
			
		||||
    finishMaybe(stream, state);
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
function prefinish(stream, state) {
 | 
			
		||||
  if (!state.prefinished && !state.finalCalled) {
 | 
			
		||||
    if (typeof stream._final === 'function') {
 | 
			
		||||
      state.pendingcb++;
 | 
			
		||||
      state.finalCalled = true;
 | 
			
		||||
      pna.nextTick(callFinal, stream, state);
 | 
			
		||||
    } else {
 | 
			
		||||
      state.prefinished = true;
 | 
			
		||||
      stream.emit('prefinish');
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function finishMaybe(stream, state) {
 | 
			
		||||
  var need = needFinish(state);
 | 
			
		||||
  if (need) {
 | 
			
		||||
    prefinish(stream, state);
 | 
			
		||||
    if (state.pendingcb === 0) {
 | 
			
		||||
      state.finished = true;
 | 
			
		||||
      stream.emit('finish');
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  return need;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function endWritable(stream, state, cb) {
 | 
			
		||||
  state.ending = true;
 | 
			
		||||
  finishMaybe(stream, state);
 | 
			
		||||
  if (cb) {
 | 
			
		||||
    if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
 | 
			
		||||
  }
 | 
			
		||||
  state.ended = true;
 | 
			
		||||
  stream.writable = false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function onCorkedFinish(corkReq, state, err) {
 | 
			
		||||
  var entry = corkReq.entry;
 | 
			
		||||
  corkReq.entry = null;
 | 
			
		||||
  while (entry) {
 | 
			
		||||
    var cb = entry.callback;
 | 
			
		||||
    state.pendingcb--;
 | 
			
		||||
    cb(err);
 | 
			
		||||
    entry = entry.next;
 | 
			
		||||
  }
 | 
			
		||||
  if (state.corkedRequestsFree) {
 | 
			
		||||
    state.corkedRequestsFree.next = corkReq;
 | 
			
		||||
  } else {
 | 
			
		||||
    state.corkedRequestsFree = corkReq;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Object.defineProperty(Writable.prototype, 'destroyed', {
 | 
			
		||||
  get: function () {
 | 
			
		||||
    if (this._writableState === undefined) {
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
    return this._writableState.destroyed;
 | 
			
		||||
  },
 | 
			
		||||
  set: function (value) {
 | 
			
		||||
    // we ignore the value if the stream
 | 
			
		||||
    // has not been initialized yet
 | 
			
		||||
    if (!this._writableState) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // backward compatibility, the user is explicitly
 | 
			
		||||
    // managing destroyed
 | 
			
		||||
    this._writableState.destroyed = value;
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
Writable.prototype.destroy = destroyImpl.destroy;
 | 
			
		||||
Writable.prototype._undestroy = destroyImpl.undestroy;
 | 
			
		||||
Writable.prototype._destroy = function (err, cb) {
 | 
			
		||||
  this.end();
 | 
			
		||||
  cb(err);
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										79
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/internal/streams/BufferList.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/internal/streams/BufferList.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,79 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 | 
			
		||||
 | 
			
		||||
var Buffer = require('safe-buffer').Buffer;
 | 
			
		||||
var util = require('util');
 | 
			
		||||
 | 
			
		||||
function copyBuffer(src, target, offset) {
 | 
			
		||||
  src.copy(target, offset);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = function () {
 | 
			
		||||
  function BufferList() {
 | 
			
		||||
    _classCallCheck(this, BufferList);
 | 
			
		||||
 | 
			
		||||
    this.head = null;
 | 
			
		||||
    this.tail = null;
 | 
			
		||||
    this.length = 0;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  BufferList.prototype.push = function push(v) {
 | 
			
		||||
    var entry = { data: v, next: null };
 | 
			
		||||
    if (this.length > 0) this.tail.next = entry;else this.head = entry;
 | 
			
		||||
    this.tail = entry;
 | 
			
		||||
    ++this.length;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  BufferList.prototype.unshift = function unshift(v) {
 | 
			
		||||
    var entry = { data: v, next: this.head };
 | 
			
		||||
    if (this.length === 0) this.tail = entry;
 | 
			
		||||
    this.head = entry;
 | 
			
		||||
    ++this.length;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  BufferList.prototype.shift = function shift() {
 | 
			
		||||
    if (this.length === 0) return;
 | 
			
		||||
    var ret = this.head.data;
 | 
			
		||||
    if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
 | 
			
		||||
    --this.length;
 | 
			
		||||
    return ret;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  BufferList.prototype.clear = function clear() {
 | 
			
		||||
    this.head = this.tail = null;
 | 
			
		||||
    this.length = 0;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  BufferList.prototype.join = function join(s) {
 | 
			
		||||
    if (this.length === 0) return '';
 | 
			
		||||
    var p = this.head;
 | 
			
		||||
    var ret = '' + p.data;
 | 
			
		||||
    while (p = p.next) {
 | 
			
		||||
      ret += s + p.data;
 | 
			
		||||
    }return ret;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  BufferList.prototype.concat = function concat(n) {
 | 
			
		||||
    if (this.length === 0) return Buffer.alloc(0);
 | 
			
		||||
    if (this.length === 1) return this.head.data;
 | 
			
		||||
    var ret = Buffer.allocUnsafe(n >>> 0);
 | 
			
		||||
    var p = this.head;
 | 
			
		||||
    var i = 0;
 | 
			
		||||
    while (p) {
 | 
			
		||||
      copyBuffer(p.data, ret, i);
 | 
			
		||||
      i += p.data.length;
 | 
			
		||||
      p = p.next;
 | 
			
		||||
    }
 | 
			
		||||
    return ret;
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return BufferList;
 | 
			
		||||
}();
 | 
			
		||||
 | 
			
		||||
if (util && util.inspect && util.inspect.custom) {
 | 
			
		||||
  module.exports.prototype[util.inspect.custom] = function () {
 | 
			
		||||
    var obj = util.inspect({ length: this.length });
 | 
			
		||||
    return this.constructor.name + ' ' + obj;
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										74
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/internal/streams/destroy.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/internal/streams/destroy.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,74 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
 | 
			
		||||
var pna = require('process-nextick-args');
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
// undocumented cb() API, needed for core, not for public API
 | 
			
		||||
function destroy(err, cb) {
 | 
			
		||||
  var _this = this;
 | 
			
		||||
 | 
			
		||||
  var readableDestroyed = this._readableState && this._readableState.destroyed;
 | 
			
		||||
  var writableDestroyed = this._writableState && this._writableState.destroyed;
 | 
			
		||||
 | 
			
		||||
  if (readableDestroyed || writableDestroyed) {
 | 
			
		||||
    if (cb) {
 | 
			
		||||
      cb(err);
 | 
			
		||||
    } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
 | 
			
		||||
      pna.nextTick(emitErrorNT, this, err);
 | 
			
		||||
    }
 | 
			
		||||
    return this;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // we set destroyed to true before firing error callbacks in order
 | 
			
		||||
  // to make it re-entrance safe in case destroy() is called within callbacks
 | 
			
		||||
 | 
			
		||||
  if (this._readableState) {
 | 
			
		||||
    this._readableState.destroyed = true;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // if this is a duplex stream mark the writable part as destroyed as well
 | 
			
		||||
  if (this._writableState) {
 | 
			
		||||
    this._writableState.destroyed = true;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  this._destroy(err || null, function (err) {
 | 
			
		||||
    if (!cb && err) {
 | 
			
		||||
      pna.nextTick(emitErrorNT, _this, err);
 | 
			
		||||
      if (_this._writableState) {
 | 
			
		||||
        _this._writableState.errorEmitted = true;
 | 
			
		||||
      }
 | 
			
		||||
    } else if (cb) {
 | 
			
		||||
      cb(err);
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  return this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function undestroy() {
 | 
			
		||||
  if (this._readableState) {
 | 
			
		||||
    this._readableState.destroyed = false;
 | 
			
		||||
    this._readableState.reading = false;
 | 
			
		||||
    this._readableState.ended = false;
 | 
			
		||||
    this._readableState.endEmitted = false;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (this._writableState) {
 | 
			
		||||
    this._writableState.destroyed = false;
 | 
			
		||||
    this._writableState.ended = false;
 | 
			
		||||
    this._writableState.ending = false;
 | 
			
		||||
    this._writableState.finished = false;
 | 
			
		||||
    this._writableState.errorEmitted = false;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function emitErrorNT(self, err) {
 | 
			
		||||
  self.emit('error', err);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = {
 | 
			
		||||
  destroy: destroy,
 | 
			
		||||
  undestroy: undestroy
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/internal/streams/stream-browser.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/internal/streams/stream-browser.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
module.exports = require('events').EventEmitter;
 | 
			
		||||
							
								
								
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/internal/streams/stream.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/lib/internal/streams/stream.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
module.exports = require('stream');
 | 
			
		||||
							
								
								
									
										81
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										81
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,81 @@
 | 
			
		||||
{
 | 
			
		||||
  "_from": "readable-stream@^2.0.2",
 | 
			
		||||
  "_id": "readable-stream@2.3.6",
 | 
			
		||||
  "_inBundle": false,
 | 
			
		||||
  "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
 | 
			
		||||
  "_location": "/readdirp/readable-stream",
 | 
			
		||||
  "_phantomChildren": {},
 | 
			
		||||
  "_requested": {
 | 
			
		||||
    "type": "range",
 | 
			
		||||
    "registry": true,
 | 
			
		||||
    "raw": "readable-stream@^2.0.2",
 | 
			
		||||
    "name": "readable-stream",
 | 
			
		||||
    "escapedName": "readable-stream",
 | 
			
		||||
    "rawSpec": "^2.0.2",
 | 
			
		||||
    "saveSpec": null,
 | 
			
		||||
    "fetchSpec": "^2.0.2"
 | 
			
		||||
  },
 | 
			
		||||
  "_requiredBy": [
 | 
			
		||||
    "/readdirp"
 | 
			
		||||
  ],
 | 
			
		||||
  "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
 | 
			
		||||
  "_shasum": "b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf",
 | 
			
		||||
  "_spec": "readable-stream@^2.0.2",
 | 
			
		||||
  "_where": "D:\\5CHITM\\Diplomarbeit\\SmartShopper\\SmartShopper\\express-server\\node_modules\\readdirp",
 | 
			
		||||
  "browser": {
 | 
			
		||||
    "util": false,
 | 
			
		||||
    "./readable.js": "./readable-browser.js",
 | 
			
		||||
    "./writable.js": "./writable-browser.js",
 | 
			
		||||
    "./duplex.js": "./duplex-browser.js",
 | 
			
		||||
    "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js"
 | 
			
		||||
  },
 | 
			
		||||
  "bugs": {
 | 
			
		||||
    "url": "https://github.com/nodejs/readable-stream/issues"
 | 
			
		||||
  },
 | 
			
		||||
  "bundleDependencies": false,
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "core-util-is": "~1.0.0",
 | 
			
		||||
    "inherits": "~2.0.3",
 | 
			
		||||
    "isarray": "~1.0.0",
 | 
			
		||||
    "process-nextick-args": "~2.0.0",
 | 
			
		||||
    "safe-buffer": "~5.1.1",
 | 
			
		||||
    "string_decoder": "~1.1.1",
 | 
			
		||||
    "util-deprecate": "~1.0.1"
 | 
			
		||||
  },
 | 
			
		||||
  "deprecated": false,
 | 
			
		||||
  "description": "Streams3, a user-land copy of the stream library from Node.js",
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "assert": "^1.4.0",
 | 
			
		||||
    "babel-polyfill": "^6.9.1",
 | 
			
		||||
    "buffer": "^4.9.0",
 | 
			
		||||
    "lolex": "^2.3.2",
 | 
			
		||||
    "nyc": "^6.4.0",
 | 
			
		||||
    "tap": "^0.7.0",
 | 
			
		||||
    "tape": "^4.8.0"
 | 
			
		||||
  },
 | 
			
		||||
  "homepage": "https://github.com/nodejs/readable-stream#readme",
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "readable",
 | 
			
		||||
    "stream",
 | 
			
		||||
    "pipe"
 | 
			
		||||
  ],
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
  "main": "readable.js",
 | 
			
		||||
  "name": "readable-stream",
 | 
			
		||||
  "nyc": {
 | 
			
		||||
    "include": [
 | 
			
		||||
      "lib/**.js"
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
    "url": "git://github.com/nodejs/readable-stream.git"
 | 
			
		||||
  },
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
 | 
			
		||||
    "cover": "nyc npm test",
 | 
			
		||||
    "report": "nyc report --reporter=lcov",
 | 
			
		||||
    "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js"
 | 
			
		||||
  },
 | 
			
		||||
  "version": "2.3.6"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/passthrough.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/passthrough.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
module.exports = require('./readable').PassThrough
 | 
			
		||||
							
								
								
									
										7
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/readable-browser.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/readable-browser.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
exports = module.exports = require('./lib/_stream_readable.js');
 | 
			
		||||
exports.Stream = exports;
 | 
			
		||||
exports.Readable = exports;
 | 
			
		||||
exports.Writable = require('./lib/_stream_writable.js');
 | 
			
		||||
exports.Duplex = require('./lib/_stream_duplex.js');
 | 
			
		||||
exports.Transform = require('./lib/_stream_transform.js');
 | 
			
		||||
exports.PassThrough = require('./lib/_stream_passthrough.js');
 | 
			
		||||
							
								
								
									
										19
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/readable.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/readable.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
var Stream = require('stream');
 | 
			
		||||
if (process.env.READABLE_STREAM === 'disable' && Stream) {
 | 
			
		||||
  module.exports = Stream;
 | 
			
		||||
  exports = module.exports = Stream.Readable;
 | 
			
		||||
  exports.Readable = Stream.Readable;
 | 
			
		||||
  exports.Writable = Stream.Writable;
 | 
			
		||||
  exports.Duplex = Stream.Duplex;
 | 
			
		||||
  exports.Transform = Stream.Transform;
 | 
			
		||||
  exports.PassThrough = Stream.PassThrough;
 | 
			
		||||
  exports.Stream = Stream;
 | 
			
		||||
} else {
 | 
			
		||||
  exports = module.exports = require('./lib/_stream_readable.js');
 | 
			
		||||
  exports.Stream = Stream || exports;
 | 
			
		||||
  exports.Readable = exports;
 | 
			
		||||
  exports.Writable = require('./lib/_stream_writable.js');
 | 
			
		||||
  exports.Duplex = require('./lib/_stream_duplex.js');
 | 
			
		||||
  exports.Transform = require('./lib/_stream_transform.js');
 | 
			
		||||
  exports.PassThrough = require('./lib/_stream_passthrough.js');
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/transform.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/transform.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
module.exports = require('./readable').Transform
 | 
			
		||||
							
								
								
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/writable-browser.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/writable-browser.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
module.exports = require('./lib/_stream_writable.js');
 | 
			
		||||
							
								
								
									
										8
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/writable.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								express-server/node_modules/readdirp/node_modules/readable-stream/writable.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
var Stream = require("stream")
 | 
			
		||||
var Writable = require("./lib/_stream_writable.js")
 | 
			
		||||
 | 
			
		||||
if (process.env.READABLE_STREAM === 'disable') {
 | 
			
		||||
  module.exports = Stream && Stream.Writable || Writable
 | 
			
		||||
} else {
 | 
			
		||||
  module.exports = Writable
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										50
									
								
								express-server/node_modules/readdirp/node_modules/string_decoder/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								express-server/node_modules/readdirp/node_modules/string_decoder/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,50 @@
 | 
			
		||||
sudo: false
 | 
			
		||||
language: node_js
 | 
			
		||||
before_install:
 | 
			
		||||
  - npm install -g npm@2
 | 
			
		||||
  - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g
 | 
			
		||||
notifications:
 | 
			
		||||
  email: false
 | 
			
		||||
matrix:
 | 
			
		||||
  fast_finish: true
 | 
			
		||||
  include:
 | 
			
		||||
  - node_js: '0.8'
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: '0.10'
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: '0.11'
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: '0.12'
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: 1
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: 2
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: 3
 | 
			
		||||
    env:
 | 
			
		||||
      - TASK=test
 | 
			
		||||
      - NPM_LEGACY=true
 | 
			
		||||
  - node_js: 4
 | 
			
		||||
    env: TASK=test
 | 
			
		||||
  - node_js: 5
 | 
			
		||||
    env: TASK=test
 | 
			
		||||
  - node_js: 6
 | 
			
		||||
    env: TASK=test
 | 
			
		||||
  - node_js: 7
 | 
			
		||||
    env: TASK=test
 | 
			
		||||
  - node_js: 8
 | 
			
		||||
    env: TASK=test
 | 
			
		||||
  - node_js: 9
 | 
			
		||||
    env: TASK=test
 | 
			
		||||
							
								
								
									
										48
									
								
								express-server/node_modules/readdirp/node_modules/string_decoder/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								express-server/node_modules/readdirp/node_modules/string_decoder/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,48 @@
 | 
			
		||||
Node.js is licensed for use as follows:
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
Copyright Node.js contributors. All rights reserved.
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
This license applies to parts of Node.js originating from the
 | 
			
		||||
https://github.com/joyent/node repository:
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
 | 
			
		||||
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.
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										47
									
								
								express-server/node_modules/readdirp/node_modules/string_decoder/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								express-server/node_modules/readdirp/node_modules/string_decoder/README.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,47 @@
 | 
			
		||||
# string_decoder
 | 
			
		||||
 | 
			
		||||
***Node-core v8.9.4 string_decoder for userland***
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
[](https://nodei.co/npm/string_decoder/)
 | 
			
		||||
[](https://nodei.co/npm/string_decoder/)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
npm install --save string_decoder
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
***Node-core string_decoder for userland***
 | 
			
		||||
 | 
			
		||||
This package is a mirror of the string_decoder implementation in Node-core.
 | 
			
		||||
 | 
			
		||||
Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/).
 | 
			
		||||
 | 
			
		||||
As of version 1.0.0 **string_decoder** uses semantic versioning.
 | 
			
		||||
 | 
			
		||||
## Previous versions
 | 
			
		||||
 | 
			
		||||
Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.
 | 
			
		||||
 | 
			
		||||
## Update
 | 
			
		||||
 | 
			
		||||
The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.
 | 
			
		||||
 | 
			
		||||
## Streams Working Group
 | 
			
		||||
 | 
			
		||||
`string_decoder` is maintained by the Streams Working Group, which
 | 
			
		||||
oversees the development and maintenance of the Streams API within
 | 
			
		||||
Node.js. The responsibilities of the Streams Working Group include:
 | 
			
		||||
 | 
			
		||||
* Addressing stream issues on the Node.js issue tracker.
 | 
			
		||||
* Authoring and editing stream documentation within the Node.js project.
 | 
			
		||||
* Reviewing changes to stream subclasses within the Node.js project.
 | 
			
		||||
* Redirecting changes to streams from the Node.js project to this
 | 
			
		||||
  project.
 | 
			
		||||
* Assisting in the implementation of stream providers within Node.js.
 | 
			
		||||
* Recommending versions of `readable-stream` to be included in Node.js.
 | 
			
		||||
* Messaging about the future of streams to give the community advance
 | 
			
		||||
  notice of changes.
 | 
			
		||||
 | 
			
		||||
See [readable-stream](https://github.com/nodejs/readable-stream) for
 | 
			
		||||
more details.
 | 
			
		||||
							
								
								
									
										296
									
								
								express-server/node_modules/readdirp/node_modules/string_decoder/lib/string_decoder.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										296
									
								
								express-server/node_modules/readdirp/node_modules/string_decoder/lib/string_decoder.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,296 @@
 | 
			
		||||
// Copyright Joyent, Inc. and other Node 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.
 | 
			
		||||
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
/*<replacement>*/
 | 
			
		||||
 | 
			
		||||
var Buffer = require('safe-buffer').Buffer;
 | 
			
		||||
/*</replacement>*/
 | 
			
		||||
 | 
			
		||||
var isEncoding = Buffer.isEncoding || function (encoding) {
 | 
			
		||||
  encoding = '' + encoding;
 | 
			
		||||
  switch (encoding && encoding.toLowerCase()) {
 | 
			
		||||
    case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
 | 
			
		||||
      return true;
 | 
			
		||||
    default:
 | 
			
		||||
      return false;
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
function _normalizeEncoding(enc) {
 | 
			
		||||
  if (!enc) return 'utf8';
 | 
			
		||||
  var retried;
 | 
			
		||||
  while (true) {
 | 
			
		||||
    switch (enc) {
 | 
			
		||||
      case 'utf8':
 | 
			
		||||
      case 'utf-8':
 | 
			
		||||
        return 'utf8';
 | 
			
		||||
      case 'ucs2':
 | 
			
		||||
      case 'ucs-2':
 | 
			
		||||
      case 'utf16le':
 | 
			
		||||
      case 'utf-16le':
 | 
			
		||||
        return 'utf16le';
 | 
			
		||||
      case 'latin1':
 | 
			
		||||
      case 'binary':
 | 
			
		||||
        return 'latin1';
 | 
			
		||||
      case 'base64':
 | 
			
		||||
      case 'ascii':
 | 
			
		||||
      case 'hex':
 | 
			
		||||
        return enc;
 | 
			
		||||
      default:
 | 
			
		||||
        if (retried) return; // undefined
 | 
			
		||||
        enc = ('' + enc).toLowerCase();
 | 
			
		||||
        retried = true;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// Do not cache `Buffer.isEncoding` when checking encoding names as some
 | 
			
		||||
// modules monkey-patch it to support additional encodings
 | 
			
		||||
function normalizeEncoding(enc) {
 | 
			
		||||
  var nenc = _normalizeEncoding(enc);
 | 
			
		||||
  if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
 | 
			
		||||
  return nenc || enc;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// StringDecoder provides an interface for efficiently splitting a series of
 | 
			
		||||
// buffers into a series of JS strings without breaking apart multi-byte
 | 
			
		||||
// characters.
 | 
			
		||||
exports.StringDecoder = StringDecoder;
 | 
			
		||||
function StringDecoder(encoding) {
 | 
			
		||||
  this.encoding = normalizeEncoding(encoding);
 | 
			
		||||
  var nb;
 | 
			
		||||
  switch (this.encoding) {
 | 
			
		||||
    case 'utf16le':
 | 
			
		||||
      this.text = utf16Text;
 | 
			
		||||
      this.end = utf16End;
 | 
			
		||||
      nb = 4;
 | 
			
		||||
      break;
 | 
			
		||||
    case 'utf8':
 | 
			
		||||
      this.fillLast = utf8FillLast;
 | 
			
		||||
      nb = 4;
 | 
			
		||||
      break;
 | 
			
		||||
    case 'base64':
 | 
			
		||||
      this.text = base64Text;
 | 
			
		||||
      this.end = base64End;
 | 
			
		||||
      nb = 3;
 | 
			
		||||
      break;
 | 
			
		||||
    default:
 | 
			
		||||
      this.write = simpleWrite;
 | 
			
		||||
      this.end = simpleEnd;
 | 
			
		||||
      return;
 | 
			
		||||
  }
 | 
			
		||||
  this.lastNeed = 0;
 | 
			
		||||
  this.lastTotal = 0;
 | 
			
		||||
  this.lastChar = Buffer.allocUnsafe(nb);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
StringDecoder.prototype.write = function (buf) {
 | 
			
		||||
  if (buf.length === 0) return '';
 | 
			
		||||
  var r;
 | 
			
		||||
  var i;
 | 
			
		||||
  if (this.lastNeed) {
 | 
			
		||||
    r = this.fillLast(buf);
 | 
			
		||||
    if (r === undefined) return '';
 | 
			
		||||
    i = this.lastNeed;
 | 
			
		||||
    this.lastNeed = 0;
 | 
			
		||||
  } else {
 | 
			
		||||
    i = 0;
 | 
			
		||||
  }
 | 
			
		||||
  if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
 | 
			
		||||
  return r || '';
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
StringDecoder.prototype.end = utf8End;
 | 
			
		||||
 | 
			
		||||
// Returns only complete characters in a Buffer
 | 
			
		||||
StringDecoder.prototype.text = utf8Text;
 | 
			
		||||
 | 
			
		||||
// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
 | 
			
		||||
StringDecoder.prototype.fillLast = function (buf) {
 | 
			
		||||
  if (this.lastNeed <= buf.length) {
 | 
			
		||||
    buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
 | 
			
		||||
    return this.lastChar.toString(this.encoding, 0, this.lastTotal);
 | 
			
		||||
  }
 | 
			
		||||
  buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
 | 
			
		||||
  this.lastNeed -= buf.length;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
 | 
			
		||||
// continuation byte. If an invalid byte is detected, -2 is returned.
 | 
			
		||||
function utf8CheckByte(byte) {
 | 
			
		||||
  if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
 | 
			
		||||
  return byte >> 6 === 0x02 ? -1 : -2;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Checks at most 3 bytes at the end of a Buffer in order to detect an
 | 
			
		||||
// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
 | 
			
		||||
// needed to complete the UTF-8 character (if applicable) are returned.
 | 
			
		||||
function utf8CheckIncomplete(self, buf, i) {
 | 
			
		||||
  var j = buf.length - 1;
 | 
			
		||||
  if (j < i) return 0;
 | 
			
		||||
  var nb = utf8CheckByte(buf[j]);
 | 
			
		||||
  if (nb >= 0) {
 | 
			
		||||
    if (nb > 0) self.lastNeed = nb - 1;
 | 
			
		||||
    return nb;
 | 
			
		||||
  }
 | 
			
		||||
  if (--j < i || nb === -2) return 0;
 | 
			
		||||
  nb = utf8CheckByte(buf[j]);
 | 
			
		||||
  if (nb >= 0) {
 | 
			
		||||
    if (nb > 0) self.lastNeed = nb - 2;
 | 
			
		||||
    return nb;
 | 
			
		||||
  }
 | 
			
		||||
  if (--j < i || nb === -2) return 0;
 | 
			
		||||
  nb = utf8CheckByte(buf[j]);
 | 
			
		||||
  if (nb >= 0) {
 | 
			
		||||
    if (nb > 0) {
 | 
			
		||||
      if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
 | 
			
		||||
    }
 | 
			
		||||
    return nb;
 | 
			
		||||
  }
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Validates as many continuation bytes for a multi-byte UTF-8 character as
 | 
			
		||||
// needed or are available. If we see a non-continuation byte where we expect
 | 
			
		||||
// one, we "replace" the validated continuation bytes we've seen so far with
 | 
			
		||||
// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
 | 
			
		||||
// behavior. The continuation byte check is included three times in the case
 | 
			
		||||
// where all of the continuation bytes for a character exist in the same buffer.
 | 
			
		||||
// It is also done this way as a slight performance increase instead of using a
 | 
			
		||||
// loop.
 | 
			
		||||
function utf8CheckExtraBytes(self, buf, p) {
 | 
			
		||||
  if ((buf[0] & 0xC0) !== 0x80) {
 | 
			
		||||
    self.lastNeed = 0;
 | 
			
		||||
    return '\ufffd';
 | 
			
		||||
  }
 | 
			
		||||
  if (self.lastNeed > 1 && buf.length > 1) {
 | 
			
		||||
    if ((buf[1] & 0xC0) !== 0x80) {
 | 
			
		||||
      self.lastNeed = 1;
 | 
			
		||||
      return '\ufffd';
 | 
			
		||||
    }
 | 
			
		||||
    if (self.lastNeed > 2 && buf.length > 2) {
 | 
			
		||||
      if ((buf[2] & 0xC0) !== 0x80) {
 | 
			
		||||
        self.lastNeed = 2;
 | 
			
		||||
        return '\ufffd';
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
 | 
			
		||||
function utf8FillLast(buf) {
 | 
			
		||||
  var p = this.lastTotal - this.lastNeed;
 | 
			
		||||
  var r = utf8CheckExtraBytes(this, buf, p);
 | 
			
		||||
  if (r !== undefined) return r;
 | 
			
		||||
  if (this.lastNeed <= buf.length) {
 | 
			
		||||
    buf.copy(this.lastChar, p, 0, this.lastNeed);
 | 
			
		||||
    return this.lastChar.toString(this.encoding, 0, this.lastTotal);
 | 
			
		||||
  }
 | 
			
		||||
  buf.copy(this.lastChar, p, 0, buf.length);
 | 
			
		||||
  this.lastNeed -= buf.length;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
 | 
			
		||||
// partial character, the character's bytes are buffered until the required
 | 
			
		||||
// number of bytes are available.
 | 
			
		||||
function utf8Text(buf, i) {
 | 
			
		||||
  var total = utf8CheckIncomplete(this, buf, i);
 | 
			
		||||
  if (!this.lastNeed) return buf.toString('utf8', i);
 | 
			
		||||
  this.lastTotal = total;
 | 
			
		||||
  var end = buf.length - (total - this.lastNeed);
 | 
			
		||||
  buf.copy(this.lastChar, 0, end);
 | 
			
		||||
  return buf.toString('utf8', i, end);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// For UTF-8, a replacement character is added when ending on a partial
 | 
			
		||||
// character.
 | 
			
		||||
function utf8End(buf) {
 | 
			
		||||
  var r = buf && buf.length ? this.write(buf) : '';
 | 
			
		||||
  if (this.lastNeed) return r + '\ufffd';
 | 
			
		||||
  return r;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UTF-16LE typically needs two bytes per character, but even if we have an even
 | 
			
		||||
// number of bytes available, we need to check if we end on a leading/high
 | 
			
		||||
// surrogate. In that case, we need to wait for the next two bytes in order to
 | 
			
		||||
// decode the last character properly.
 | 
			
		||||
function utf16Text(buf, i) {
 | 
			
		||||
  if ((buf.length - i) % 2 === 0) {
 | 
			
		||||
    var r = buf.toString('utf16le', i);
 | 
			
		||||
    if (r) {
 | 
			
		||||
      var c = r.charCodeAt(r.length - 1);
 | 
			
		||||
      if (c >= 0xD800 && c <= 0xDBFF) {
 | 
			
		||||
        this.lastNeed = 2;
 | 
			
		||||
        this.lastTotal = 4;
 | 
			
		||||
        this.lastChar[0] = buf[buf.length - 2];
 | 
			
		||||
        this.lastChar[1] = buf[buf.length - 1];
 | 
			
		||||
        return r.slice(0, -1);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    return r;
 | 
			
		||||
  }
 | 
			
		||||
  this.lastNeed = 1;
 | 
			
		||||
  this.lastTotal = 2;
 | 
			
		||||
  this.lastChar[0] = buf[buf.length - 1];
 | 
			
		||||
  return buf.toString('utf16le', i, buf.length - 1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// For UTF-16LE we do not explicitly append special replacement characters if we
 | 
			
		||||
// end on a partial character, we simply let v8 handle that.
 | 
			
		||||
function utf16End(buf) {
 | 
			
		||||
  var r = buf && buf.length ? this.write(buf) : '';
 | 
			
		||||
  if (this.lastNeed) {
 | 
			
		||||
    var end = this.lastTotal - this.lastNeed;
 | 
			
		||||
    return r + this.lastChar.toString('utf16le', 0, end);
 | 
			
		||||
  }
 | 
			
		||||
  return r;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function base64Text(buf, i) {
 | 
			
		||||
  var n = (buf.length - i) % 3;
 | 
			
		||||
  if (n === 0) return buf.toString('base64', i);
 | 
			
		||||
  this.lastNeed = 3 - n;
 | 
			
		||||
  this.lastTotal = 3;
 | 
			
		||||
  if (n === 1) {
 | 
			
		||||
    this.lastChar[0] = buf[buf.length - 1];
 | 
			
		||||
  } else {
 | 
			
		||||
    this.lastChar[0] = buf[buf.length - 2];
 | 
			
		||||
    this.lastChar[1] = buf[buf.length - 1];
 | 
			
		||||
  }
 | 
			
		||||
  return buf.toString('base64', i, buf.length - n);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function base64End(buf) {
 | 
			
		||||
  var r = buf && buf.length ? this.write(buf) : '';
 | 
			
		||||
  if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
 | 
			
		||||
  return r;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
 | 
			
		||||
function simpleWrite(buf) {
 | 
			
		||||
  return buf.toString(this.encoding);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function simpleEnd(buf) {
 | 
			
		||||
  return buf && buf.length ? this.write(buf) : '';
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										59
									
								
								express-server/node_modules/readdirp/node_modules/string_decoder/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								express-server/node_modules/readdirp/node_modules/string_decoder/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,59 @@
 | 
			
		||||
{
 | 
			
		||||
  "_from": "string_decoder@~1.1.1",
 | 
			
		||||
  "_id": "string_decoder@1.1.1",
 | 
			
		||||
  "_inBundle": false,
 | 
			
		||||
  "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
 | 
			
		||||
  "_location": "/readdirp/string_decoder",
 | 
			
		||||
  "_phantomChildren": {},
 | 
			
		||||
  "_requested": {
 | 
			
		||||
    "type": "range",
 | 
			
		||||
    "registry": true,
 | 
			
		||||
    "raw": "string_decoder@~1.1.1",
 | 
			
		||||
    "name": "string_decoder",
 | 
			
		||||
    "escapedName": "string_decoder",
 | 
			
		||||
    "rawSpec": "~1.1.1",
 | 
			
		||||
    "saveSpec": null,
 | 
			
		||||
    "fetchSpec": "~1.1.1"
 | 
			
		||||
  },
 | 
			
		||||
  "_requiredBy": [
 | 
			
		||||
    "/readdirp/readable-stream"
 | 
			
		||||
  ],
 | 
			
		||||
  "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
 | 
			
		||||
  "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8",
 | 
			
		||||
  "_spec": "string_decoder@~1.1.1",
 | 
			
		||||
  "_where": "D:\\5CHITM\\Diplomarbeit\\SmartShopper\\SmartShopper\\express-server\\node_modules\\readdirp\\node_modules\\readable-stream",
 | 
			
		||||
  "bugs": {
 | 
			
		||||
    "url": "https://github.com/nodejs/string_decoder/issues"
 | 
			
		||||
  },
 | 
			
		||||
  "bundleDependencies": false,
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "safe-buffer": "~5.1.0"
 | 
			
		||||
  },
 | 
			
		||||
  "deprecated": false,
 | 
			
		||||
  "description": "The string_decoder module from Node core",
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "babel-polyfill": "^6.23.0",
 | 
			
		||||
    "core-util-is": "^1.0.2",
 | 
			
		||||
    "inherits": "^2.0.3",
 | 
			
		||||
    "tap": "~0.4.8"
 | 
			
		||||
  },
 | 
			
		||||
  "homepage": "https://github.com/nodejs/string_decoder",
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "string",
 | 
			
		||||
    "decoder",
 | 
			
		||||
    "browser",
 | 
			
		||||
    "browserify"
 | 
			
		||||
  ],
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
  "main": "lib/string_decoder.js",
 | 
			
		||||
  "name": "string_decoder",
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
    "url": "git://github.com/nodejs/string_decoder.git"
 | 
			
		||||
  },
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
 | 
			
		||||
    "test": "tap test/parallel/*.js && node test/verify-dependencies"
 | 
			
		||||
  },
 | 
			
		||||
  "version": "1.1.1"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										88
									
								
								express-server/node_modules/readdirp/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								express-server/node_modules/readdirp/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,88 @@
 | 
			
		||||
{
 | 
			
		||||
  "_from": "readdirp@^2.2.1",
 | 
			
		||||
  "_id": "readdirp@2.2.1",
 | 
			
		||||
  "_inBundle": false,
 | 
			
		||||
  "_integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==",
 | 
			
		||||
  "_location": "/readdirp",
 | 
			
		||||
  "_phantomChildren": {
 | 
			
		||||
    "core-util-is": "1.0.2",
 | 
			
		||||
    "inherits": "2.0.3",
 | 
			
		||||
    "process-nextick-args": "2.0.0",
 | 
			
		||||
    "safe-buffer": "5.1.2",
 | 
			
		||||
    "util-deprecate": "1.0.2"
 | 
			
		||||
  },
 | 
			
		||||
  "_requested": {
 | 
			
		||||
    "type": "range",
 | 
			
		||||
    "registry": true,
 | 
			
		||||
    "raw": "readdirp@^2.2.1",
 | 
			
		||||
    "name": "readdirp",
 | 
			
		||||
    "escapedName": "readdirp",
 | 
			
		||||
    "rawSpec": "^2.2.1",
 | 
			
		||||
    "saveSpec": null,
 | 
			
		||||
    "fetchSpec": "^2.2.1"
 | 
			
		||||
  },
 | 
			
		||||
  "_requiredBy": [
 | 
			
		||||
    "/chokidar"
 | 
			
		||||
  ],
 | 
			
		||||
  "_resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz",
 | 
			
		||||
  "_shasum": "0e87622a3325aa33e892285caf8b4e846529a525",
 | 
			
		||||
  "_spec": "readdirp@^2.2.1",
 | 
			
		||||
  "_where": "D:\\5CHITM\\Diplomarbeit\\SmartShopper\\SmartShopper\\express-server\\node_modules\\chokidar",
 | 
			
		||||
  "author": {
 | 
			
		||||
    "name": "Thorsten Lorenz",
 | 
			
		||||
    "email": "thlorenz@gmx.de",
 | 
			
		||||
    "url": "thlorenz.com"
 | 
			
		||||
  },
 | 
			
		||||
  "bugs": {
 | 
			
		||||
    "url": "https://github.com/paulmillr/readdirp/issues"
 | 
			
		||||
  },
 | 
			
		||||
  "bundleDependencies": false,
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "graceful-fs": "^4.1.11",
 | 
			
		||||
    "micromatch": "^3.1.10",
 | 
			
		||||
    "readable-stream": "^2.0.2"
 | 
			
		||||
  },
 | 
			
		||||
  "deprecated": false,
 | 
			
		||||
  "description": "Recursive version of fs.readdir with streaming api.",
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "nave": "^0.5.1",
 | 
			
		||||
    "proxyquire": "^1.7.9",
 | 
			
		||||
    "tap": "1.3.2",
 | 
			
		||||
    "through2": "^2.0.0"
 | 
			
		||||
  },
 | 
			
		||||
  "engines": {
 | 
			
		||||
    "node": ">=0.10"
 | 
			
		||||
  },
 | 
			
		||||
  "files": [
 | 
			
		||||
    "readdirp.js",
 | 
			
		||||
    "stream-api.js"
 | 
			
		||||
  ],
 | 
			
		||||
  "homepage": "https://github.com/paulmillr/readdirp",
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "recursive",
 | 
			
		||||
    "fs",
 | 
			
		||||
    "stream",
 | 
			
		||||
    "streams",
 | 
			
		||||
    "readdir",
 | 
			
		||||
    "filesystem",
 | 
			
		||||
    "find",
 | 
			
		||||
    "filter"
 | 
			
		||||
  ],
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
  "main": "readdirp.js",
 | 
			
		||||
  "name": "readdirp",
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
    "url": "git://github.com/paulmillr/readdirp.git"
 | 
			
		||||
  },
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "test": "npm run test-main",
 | 
			
		||||
    "test-0.10": "nave use 0.10 npm run test-main",
 | 
			
		||||
    "test-0.12": "nave use 0.12 npm run test-main",
 | 
			
		||||
    "test-4": "nave use 4.4 npm run test-main",
 | 
			
		||||
    "test-6": "nave use 6.2 npm run test-main",
 | 
			
		||||
    "test-all": "npm run test-main && npm run test-0.10 && npm run test-0.12 && npm run test-4 && npm run test-6",
 | 
			
		||||
    "test-main": "(cd test && set -e; for t in ./*.js; do node $t; done)"
 | 
			
		||||
  },
 | 
			
		||||
  "version": "2.2.1"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										294
									
								
								express-server/node_modules/readdirp/readdirp.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										294
									
								
								express-server/node_modules/readdirp/readdirp.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,294 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
var fs        =  require('graceful-fs')
 | 
			
		||||
  , path      =  require('path')
 | 
			
		||||
  , micromatch =  require('micromatch').isMatch
 | 
			
		||||
  , toString  =  Object.prototype.toString
 | 
			
		||||
  ;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Standard helpers
 | 
			
		||||
function isFunction (obj) {
 | 
			
		||||
  return toString.call(obj) === '[object Function]';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function isString (obj) {
 | 
			
		||||
  return toString.call(obj) === '[object String]';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function isUndefined (obj) {
 | 
			
		||||
  return obj === void 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Main function which ends up calling readdirRec and reads all files and directories in given root recursively.
 | 
			
		||||
 * @param { Object }   opts     Options to specify root (start directory), filters and recursion depth
 | 
			
		||||
 * @param { function } callback1  When callback2 is given calls back for each processed file - function (fileInfo) { ... },
 | 
			
		||||
 *                                when callback2 is not given, it behaves like explained in callback2
 | 
			
		||||
 * @param { function } callback2  Calls back once all files have been processed with an array of errors and file infos
 | 
			
		||||
 *                                function (err, fileInfos) { ... }
 | 
			
		||||
 */
 | 
			
		||||
function readdir(opts, callback1, callback2) {
 | 
			
		||||
  var stream
 | 
			
		||||
    , handleError
 | 
			
		||||
    , handleFatalError
 | 
			
		||||
    , errors = []
 | 
			
		||||
    , readdirResult = {
 | 
			
		||||
        directories: []
 | 
			
		||||
      , files: []
 | 
			
		||||
    }
 | 
			
		||||
    , fileProcessed
 | 
			
		||||
    , allProcessed
 | 
			
		||||
    , realRoot
 | 
			
		||||
    , aborted = false
 | 
			
		||||
    , paused = false
 | 
			
		||||
    ;
 | 
			
		||||
 | 
			
		||||
  // If no callbacks were given we will use a streaming interface
 | 
			
		||||
  if (isUndefined(callback1)) {
 | 
			
		||||
    var api          =  require('./stream-api')();
 | 
			
		||||
    stream           =  api.stream;
 | 
			
		||||
    callback1        =  api.processEntry;
 | 
			
		||||
    callback2        =  api.done;
 | 
			
		||||
    handleError      =  api.handleError;
 | 
			
		||||
    handleFatalError =  api.handleFatalError;
 | 
			
		||||
 | 
			
		||||
    stream.on('close', function () { aborted = true; });
 | 
			
		||||
    stream.on('pause', function () { paused = true; });
 | 
			
		||||
    stream.on('resume', function () { paused = false; });
 | 
			
		||||
  } else {
 | 
			
		||||
    handleError      =  function (err) { errors.push(err); };
 | 
			
		||||
    handleFatalError =  function (err) {
 | 
			
		||||
      handleError(err);
 | 
			
		||||
      allProcessed(errors, null);
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (isUndefined(opts)){
 | 
			
		||||
    handleFatalError(new Error (
 | 
			
		||||
      'Need to pass at least one argument: opts! \n' +
 | 
			
		||||
      'https://github.com/paulmillr/readdirp#options'
 | 
			
		||||
      )
 | 
			
		||||
    );
 | 
			
		||||
    return stream;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  opts.root            =  opts.root            || '.';
 | 
			
		||||
  opts.fileFilter      =  opts.fileFilter      || function() { return true; };
 | 
			
		||||
  opts.directoryFilter =  opts.directoryFilter || function() { return true; };
 | 
			
		||||
  opts.depth           =  typeof opts.depth === 'undefined' ? 999999999 : opts.depth;
 | 
			
		||||
  opts.entryType       =  opts.entryType       || 'files';
 | 
			
		||||
 | 
			
		||||
  var statfn = opts.lstat === true ? fs.lstat.bind(fs) : fs.stat.bind(fs);
 | 
			
		||||
 | 
			
		||||
  if (isUndefined(callback2)) {
 | 
			
		||||
    fileProcessed = function() { };
 | 
			
		||||
    allProcessed = callback1;
 | 
			
		||||
  } else {
 | 
			
		||||
    fileProcessed = callback1;
 | 
			
		||||
    allProcessed = callback2;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function normalizeFilter (filter) {
 | 
			
		||||
 | 
			
		||||
    if (isUndefined(filter)) return undefined;
 | 
			
		||||
 | 
			
		||||
    function isNegated (filters) {
 | 
			
		||||
 | 
			
		||||
      function negated(f) {
 | 
			
		||||
        return f.indexOf('!') === 0;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      var some = filters.some(negated);
 | 
			
		||||
      if (!some) {
 | 
			
		||||
        return false;
 | 
			
		||||
      } else {
 | 
			
		||||
        if (filters.every(negated)) {
 | 
			
		||||
          return true;
 | 
			
		||||
        } else {
 | 
			
		||||
          // if we detect illegal filters, bail out immediately
 | 
			
		||||
          throw new Error(
 | 
			
		||||
            'Cannot mix negated with non negated glob filters: ' + filters + '\n' +
 | 
			
		||||
            'https://github.com/paulmillr/readdirp#filters'
 | 
			
		||||
          );
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Turn all filters into a function
 | 
			
		||||
    if (isFunction(filter)) {
 | 
			
		||||
 | 
			
		||||
      return filter;
 | 
			
		||||
 | 
			
		||||
    } else if (isString(filter)) {
 | 
			
		||||
 | 
			
		||||
      return function (entryInfo) {
 | 
			
		||||
        return micromatch(entryInfo.name, filter.trim());
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
    } else if (filter && Array.isArray(filter)) {
 | 
			
		||||
 | 
			
		||||
      if (filter) filter = filter.map(function (f) {
 | 
			
		||||
        return f.trim();
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      return isNegated(filter) ?
 | 
			
		||||
        // use AND to concat multiple negated filters
 | 
			
		||||
        function (entryInfo) {
 | 
			
		||||
          return filter.every(function (f) {
 | 
			
		||||
            return micromatch(entryInfo.name, f);
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
        :
 | 
			
		||||
        // use OR to concat multiple inclusive filters
 | 
			
		||||
        function (entryInfo) {
 | 
			
		||||
          return filter.some(function (f) {
 | 
			
		||||
            return micromatch(entryInfo.name, f);
 | 
			
		||||
          });
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function processDir(currentDir, entries, callProcessed) {
 | 
			
		||||
    if (aborted) return;
 | 
			
		||||
    var total = entries.length
 | 
			
		||||
      , processed = 0
 | 
			
		||||
      , entryInfos = []
 | 
			
		||||
      ;
 | 
			
		||||
 | 
			
		||||
    fs.realpath(currentDir, function(err, realCurrentDir) {
 | 
			
		||||
      if (aborted) return;
 | 
			
		||||
      if (err) {
 | 
			
		||||
        handleError(err);
 | 
			
		||||
        callProcessed(entryInfos);
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      var relDir = path.relative(realRoot, realCurrentDir);
 | 
			
		||||
 | 
			
		||||
      if (entries.length === 0) {
 | 
			
		||||
        callProcessed([]);
 | 
			
		||||
      } else {
 | 
			
		||||
        entries.forEach(function (entry) {
 | 
			
		||||
 | 
			
		||||
          var fullPath = path.join(realCurrentDir, entry)
 | 
			
		||||
            , relPath  = path.join(relDir, entry);
 | 
			
		||||
 | 
			
		||||
          statfn(fullPath, function (err, stat) {
 | 
			
		||||
            if (err) {
 | 
			
		||||
              handleError(err);
 | 
			
		||||
            } else {
 | 
			
		||||
              entryInfos.push({
 | 
			
		||||
                  name          :  entry
 | 
			
		||||
                , path          :  relPath   // relative to root
 | 
			
		||||
                , fullPath      :  fullPath
 | 
			
		||||
 | 
			
		||||
                , parentDir     :  relDir    // relative to root
 | 
			
		||||
                , fullParentDir :  realCurrentDir
 | 
			
		||||
 | 
			
		||||
                , stat          :  stat
 | 
			
		||||
              });
 | 
			
		||||
            }
 | 
			
		||||
            processed++;
 | 
			
		||||
            if (processed === total) callProcessed(entryInfos);
 | 
			
		||||
          });
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function readdirRec(currentDir, depth, callCurrentDirProcessed) {
 | 
			
		||||
    var args = arguments;
 | 
			
		||||
    if (aborted) return;
 | 
			
		||||
    if (paused) {
 | 
			
		||||
      setImmediate(function () {
 | 
			
		||||
        readdirRec.apply(null, args);
 | 
			
		||||
      })
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fs.readdir(currentDir, function (err, entries) {
 | 
			
		||||
      if (err) {
 | 
			
		||||
        handleError(err);
 | 
			
		||||
        callCurrentDirProcessed();
 | 
			
		||||
        return;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      processDir(currentDir, entries, function(entryInfos) {
 | 
			
		||||
 | 
			
		||||
        var subdirs = entryInfos
 | 
			
		||||
          .filter(function (ei) { return ei.stat.isDirectory() && opts.directoryFilter(ei); });
 | 
			
		||||
 | 
			
		||||
        subdirs.forEach(function (di) {
 | 
			
		||||
          if(opts.entryType === 'directories' || opts.entryType === 'both' || opts.entryType === 'all') {
 | 
			
		||||
            fileProcessed(di);
 | 
			
		||||
          }
 | 
			
		||||
          readdirResult.directories.push(di);
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        entryInfos
 | 
			
		||||
          .filter(function(ei) {
 | 
			
		||||
            var isCorrectType = opts.entryType === 'all' ?
 | 
			
		||||
              !ei.stat.isDirectory() : ei.stat.isFile() || ei.stat.isSymbolicLink();
 | 
			
		||||
            return isCorrectType && opts.fileFilter(ei);
 | 
			
		||||
          })
 | 
			
		||||
          .forEach(function (fi) {
 | 
			
		||||
            if(opts.entryType === 'files' || opts.entryType === 'both' || opts.entryType === 'all') {
 | 
			
		||||
              fileProcessed(fi);
 | 
			
		||||
            }
 | 
			
		||||
            readdirResult.files.push(fi);
 | 
			
		||||
          });
 | 
			
		||||
 | 
			
		||||
        var pendingSubdirs = subdirs.length;
 | 
			
		||||
 | 
			
		||||
        // Be done if no more subfolders exist or we reached the maximum desired depth
 | 
			
		||||
        if(pendingSubdirs === 0 || depth === opts.depth) {
 | 
			
		||||
          callCurrentDirProcessed();
 | 
			
		||||
        } else {
 | 
			
		||||
          // recurse into subdirs, keeping track of which ones are done
 | 
			
		||||
          // and call back once all are processed
 | 
			
		||||
          subdirs.forEach(function (subdir) {
 | 
			
		||||
            readdirRec(subdir.fullPath, depth + 1, function () {
 | 
			
		||||
              pendingSubdirs = pendingSubdirs - 1;
 | 
			
		||||
              if(pendingSubdirs === 0) {
 | 
			
		||||
                callCurrentDirProcessed();
 | 
			
		||||
              }
 | 
			
		||||
            });
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // Validate and normalize filters
 | 
			
		||||
  try {
 | 
			
		||||
    opts.fileFilter = normalizeFilter(opts.fileFilter);
 | 
			
		||||
    opts.directoryFilter = normalizeFilter(opts.directoryFilter);
 | 
			
		||||
  } catch (err) {
 | 
			
		||||
    // if we detect illegal filters, bail out immediately
 | 
			
		||||
    handleFatalError(err);
 | 
			
		||||
    return stream;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // If filters were valid get on with the show
 | 
			
		||||
  fs.realpath(opts.root, function(err, res) {
 | 
			
		||||
    if (err) {
 | 
			
		||||
      handleFatalError(err);
 | 
			
		||||
      return stream;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    realRoot = res;
 | 
			
		||||
    readdirRec(opts.root, 0, function () {
 | 
			
		||||
      // All errors are collected into the errors array
 | 
			
		||||
      if (errors.length > 0) {
 | 
			
		||||
        allProcessed(errors, readdirResult);
 | 
			
		||||
      } else {
 | 
			
		||||
        allProcessed(null, readdirResult);
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  return stream;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = readdir;
 | 
			
		||||
							
								
								
									
										98
									
								
								express-server/node_modules/readdirp/stream-api.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										98
									
								
								express-server/node_modules/readdirp/stream-api.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,98 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
var stream = require('readable-stream');
 | 
			
		||||
var util = require('util');
 | 
			
		||||
 | 
			
		||||
var Readable = stream.Readable;
 | 
			
		||||
 | 
			
		||||
module.exports = ReaddirpReadable;
 | 
			
		||||
 | 
			
		||||
util.inherits(ReaddirpReadable, Readable);
 | 
			
		||||
 | 
			
		||||
function ReaddirpReadable (opts) {
 | 
			
		||||
  if (!(this instanceof ReaddirpReadable)) return new ReaddirpReadable(opts);
 | 
			
		||||
 | 
			
		||||
  opts = opts || {};
 | 
			
		||||
 | 
			
		||||
  opts.objectMode = true;
 | 
			
		||||
  Readable.call(this, opts);
 | 
			
		||||
 | 
			
		||||
  // backpressure not implemented at this point
 | 
			
		||||
  this.highWaterMark = Infinity;
 | 
			
		||||
 | 
			
		||||
  this._destroyed = false;
 | 
			
		||||
  this._paused = false;
 | 
			
		||||
  this._warnings = [];
 | 
			
		||||
  this._errors = [];
 | 
			
		||||
 | 
			
		||||
  this._pauseResumeErrors();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var proto = ReaddirpReadable.prototype;
 | 
			
		||||
 | 
			
		||||
proto._pauseResumeErrors = function () {
 | 
			
		||||
  var self = this;
 | 
			
		||||
  self.on('pause', function () { self._paused = true });
 | 
			
		||||
  self.on('resume', function () {
 | 
			
		||||
    if (self._destroyed) return;
 | 
			
		||||
    self._paused = false;
 | 
			
		||||
 | 
			
		||||
    self._warnings.forEach(function (err) { self.emit('warn', err) });
 | 
			
		||||
    self._warnings.length = 0;
 | 
			
		||||
 | 
			
		||||
    self._errors.forEach(function (err) { self.emit('error', err) });
 | 
			
		||||
    self._errors.length = 0;
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// called for each entry
 | 
			
		||||
proto._processEntry = function (entry) {
 | 
			
		||||
  if (this._destroyed) return;
 | 
			
		||||
  this.push(entry);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
proto._read = function () { }
 | 
			
		||||
 | 
			
		||||
proto.destroy = function () {
 | 
			
		||||
  // when stream is destroyed it will emit nothing further, not even errors or warnings
 | 
			
		||||
  this.push(null);
 | 
			
		||||
  this.readable = false;
 | 
			
		||||
  this._destroyed = true;
 | 
			
		||||
  this.emit('close');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
proto._done = function () {
 | 
			
		||||
  this.push(null);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// we emit errors and warnings async since we may handle errors like invalid args
 | 
			
		||||
// within the initial event loop before any event listeners subscribed
 | 
			
		||||
proto._handleError = function (err) {
 | 
			
		||||
  var self = this;
 | 
			
		||||
  setImmediate(function () {
 | 
			
		||||
    if (self._paused) return self._warnings.push(err);
 | 
			
		||||
    if (!self._destroyed) self.emit('warn', err);
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
proto._handleFatalError = function (err) {
 | 
			
		||||
  var self = this;
 | 
			
		||||
  setImmediate(function () {
 | 
			
		||||
    if (self._paused) return self._errors.push(err);
 | 
			
		||||
    if (!self._destroyed) self.emit('error', err);
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function createStreamAPI () {
 | 
			
		||||
  var stream = new ReaddirpReadable();
 | 
			
		||||
 | 
			
		||||
  return {
 | 
			
		||||
      stream           :  stream
 | 
			
		||||
    , processEntry     :  stream._processEntry.bind(stream)
 | 
			
		||||
    , done             :  stream._done.bind(stream)
 | 
			
		||||
    , handleError      :  stream._handleError.bind(stream)
 | 
			
		||||
    , handleFatalError :  stream._handleFatalError.bind(stream)
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = createStreamAPI;
 | 
			
		||||
		Reference in New Issue
	
	Block a user