test
305
node_modules/serve-index/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,305 @@
|
||||
1.9.1 / 2017-09-28
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.3.4
|
||||
- deps: mime-types@~2.1.16
|
||||
* deps: debug@2.6.9
|
||||
* deps: http-errors@~1.6.2
|
||||
- deps: depd@1.1.1
|
||||
* deps: mime-types@~2.1.17
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.30.0
|
||||
* deps: parseurl@~1.3.2
|
||||
- perf: reduce overhead for full URLs
|
||||
- perf: unroll the "fast-path" `RegExp`
|
||||
|
||||
1.9.0 / 2017-05-25
|
||||
==================
|
||||
|
||||
* Set `X-Content-Type-Options: nosniff` header
|
||||
* deps: batch@0.6.1
|
||||
* deps: debug@2.6.8
|
||||
- Allow colors in workers
|
||||
- Deprecated `DEBUG_FD` environment variable set to `3` or higher
|
||||
- Fix `DEBUG_MAX_ARRAY_LENGTH`
|
||||
- Fix error when running under React Native
|
||||
- Use same color for same namespace
|
||||
- deps: ms@2.0.0
|
||||
* deps: http-errors@~1.6.1
|
||||
- Make `message` property enumerable for `HttpError`s
|
||||
- deps: inherits@2.0.3
|
||||
- deps: setprototypeof@1.0.3
|
||||
- deps: statuses@'>= 1.3.1 < 2'
|
||||
* deps: mime-types@~2.1.15
|
||||
- Add new mime types
|
||||
- Add `audio/mp3`
|
||||
|
||||
1.8.0 / 2016-06-17
|
||||
==================
|
||||
|
||||
* Make inline file search case-insensitive
|
||||
* deps: accepts@~1.3.3
|
||||
- deps: mime-types@~2.1.11
|
||||
- deps: negotiator@0.6.1
|
||||
- perf: improve header parsing speed
|
||||
* deps: http-errors@~1.5.0
|
||||
- Use `setprototypeof` module to replace `__proto__` setting
|
||||
- deps: inherits@2.0.1
|
||||
- deps: statuses@'>= 1.3.0 < 2'
|
||||
- perf: enable strict mode
|
||||
* deps: mime-types@~2.1.11
|
||||
- Add new mime types
|
||||
- Update primary extension for `audio/mp4`
|
||||
- deps: mime-db@~1.23.0
|
||||
|
||||
1.7.3 / 2016-01-24
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.2.13
|
||||
- deps: mime-types@~2.1.6
|
||||
* deps: batch@0.5.3
|
||||
- Fix invalid dependency for browserify
|
||||
* deps: escape-html@~1.0.3
|
||||
- perf: enable strict mode
|
||||
- perf: optimize string replacement
|
||||
- perf: use faster string coercion
|
||||
* deps: mime-types@~2.1.9
|
||||
- Add new mime types
|
||||
* deps: parseurl@~1.3.1
|
||||
- perf: enable strict mode
|
||||
|
||||
1.7.2 / 2015-07-30
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.2.12
|
||||
- deps: mime-types@~2.1.4
|
||||
* deps: mime-types@~2.1.4
|
||||
- Add new mime types
|
||||
|
||||
1.7.1 / 2015-07-05
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.2.10
|
||||
- deps: mime-types@~2.1.2
|
||||
* deps: mime-types@~2.1.2
|
||||
- Add new mime types
|
||||
|
||||
1.7.0 / 2015-06-15
|
||||
==================
|
||||
|
||||
* Accept `function` value for `template` option
|
||||
* Send non-chunked response for `OPTIONS`
|
||||
* Stat parent directory when necessary
|
||||
* Use `Date.prototype.toLocaleDateString` to format date
|
||||
* deps: accepts@~1.2.9
|
||||
- deps: mime-types@~2.1.1
|
||||
- deps: negotiator@0.5.3
|
||||
- perf: avoid argument reassignment & argument slice
|
||||
- perf: avoid negotiator recursive construction
|
||||
- perf: enable strict mode
|
||||
- perf: remove unnecessary bitwise operator
|
||||
* deps: escape-html@1.0.2
|
||||
* deps: mime-types@~2.1.1
|
||||
- Add new mime types
|
||||
* perf: enable strict mode
|
||||
* perf: remove argument reassignment
|
||||
|
||||
1.6.4 / 2015-05-12
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.2.7
|
||||
- deps: mime-types@~2.0.11
|
||||
- deps: negotiator@0.5.3
|
||||
* deps: debug@~2.2.0
|
||||
- deps: ms@0.7.1
|
||||
* deps: mime-types@~2.0.11
|
||||
- Add new mime types
|
||||
|
||||
1.6.3 / 2015-03-13
|
||||
==================
|
||||
|
||||
* Properly escape file names in HTML
|
||||
* deps: accepts@~1.2.5
|
||||
- deps: mime-types@~2.0.10
|
||||
* deps: debug@~2.1.3
|
||||
- Fix high intensity foreground color for bold
|
||||
- deps: ms@0.7.0
|
||||
* deps: escape-html@1.0.1
|
||||
* deps: mime-types@~2.0.10
|
||||
- Add new mime types
|
||||
|
||||
1.6.2 / 2015-02-16
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.2.4
|
||||
- deps: mime-types@~2.0.9
|
||||
- deps: negotiator@0.5.1
|
||||
* deps: http-errors@~1.3.1
|
||||
- Construct errors using defined constructors from `createError`
|
||||
- Fix error names that are not identifiers
|
||||
- Set a meaningful `name` property on constructed errors
|
||||
* deps: mime-types@~2.0.9
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.7.0
|
||||
|
||||
1.6.1 / 2015-01-31
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.2.3
|
||||
- deps: mime-types@~2.0.8
|
||||
* deps: mime-types@~2.0.8
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.6.0
|
||||
|
||||
1.6.0 / 2015-01-01
|
||||
==================
|
||||
|
||||
* Add link to root directory
|
||||
* deps: accepts@~1.2.2
|
||||
- deps: mime-types@~2.0.7
|
||||
- deps: negotiator@0.5.0
|
||||
* deps: batch@0.5.2
|
||||
* deps: debug@~2.1.1
|
||||
* deps: mime-types@~2.0.7
|
||||
- Add new mime types
|
||||
- Fix missing extensions
|
||||
- Fix various invalid MIME type entries
|
||||
- Remove example template MIME types
|
||||
- deps: mime-db@~1.5.0
|
||||
|
||||
1.5.3 / 2014-12-10
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.1.4
|
||||
- deps: mime-types@~2.0.4
|
||||
* deps: http-errors@~1.2.8
|
||||
- Fix stack trace from exported function
|
||||
* deps: mime-types@~2.0.4
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.3.0
|
||||
|
||||
1.5.2 / 2014-12-03
|
||||
==================
|
||||
|
||||
* Fix icon name background alignment on mobile view
|
||||
|
||||
1.5.1 / 2014-11-22
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.1.3
|
||||
- deps: mime-types@~2.0.3
|
||||
* deps: mime-types@~2.0.3
|
||||
- Add new mime types
|
||||
- deps: mime-db@~1.2.0
|
||||
|
||||
1.5.0 / 2014-10-16
|
||||
==================
|
||||
|
||||
* Create errors with `http-errors`
|
||||
* deps: debug@~2.1.0
|
||||
- Implement `DEBUG_FD` env variable support
|
||||
* deps: mime-types@~2.0.2
|
||||
- deps: mime-db@~1.1.0
|
||||
|
||||
1.4.1 / 2014-10-15
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.1.2
|
||||
- Fix error when media type has invalid parameter
|
||||
- deps: negotiator@0.4.9
|
||||
|
||||
1.4.0 / 2014-10-03
|
||||
==================
|
||||
|
||||
* Add `dir` argument to `filter` function
|
||||
* Support using tokens multiple times
|
||||
|
||||
1.3.1 / 2014-10-01
|
||||
==================
|
||||
|
||||
* Fix incorrect 403 on Windows and Node.js 0.11
|
||||
* deps: accepts@~1.1.1
|
||||
- deps: mime-types@~2.0.2
|
||||
- deps: negotiator@0.4.8
|
||||
|
||||
1.3.0 / 2014-09-20
|
||||
==================
|
||||
|
||||
* Add icon for mkv files
|
||||
* Lookup icon by mime type for greater icon support
|
||||
|
||||
1.2.1 / 2014-09-05
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.1.0
|
||||
* deps: debug@~2.0.0
|
||||
|
||||
1.2.0 / 2014-08-25
|
||||
==================
|
||||
|
||||
* Add `debug` messages
|
||||
* Resolve relative paths at middleware setup
|
||||
|
||||
1.1.6 / 2014-08-10
|
||||
==================
|
||||
|
||||
* Fix URL parsing
|
||||
* deps: parseurl@~1.3.0
|
||||
|
||||
1.1.5 / 2014-07-27
|
||||
==================
|
||||
|
||||
* Fix Content-Length calculation for multi-byte file names
|
||||
* deps: accepts@~1.0.7
|
||||
- deps: negotiator@0.4.7
|
||||
|
||||
1.1.4 / 2014-06-20
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.0.5
|
||||
|
||||
1.1.3 / 2014-06-20
|
||||
==================
|
||||
|
||||
* deps: accepts@~1.0.4
|
||||
- use `mime-types`
|
||||
|
||||
1.1.2 / 2014-06-19
|
||||
==================
|
||||
|
||||
* deps: batch@0.5.1
|
||||
|
||||
1.1.1 / 2014-06-11
|
||||
==================
|
||||
|
||||
* deps: accepts@1.0.3
|
||||
|
||||
1.1.0 / 2014-05-29
|
||||
==================
|
||||
|
||||
* Fix content negotiation when no `Accept` header
|
||||
* Properly support all HTTP methods
|
||||
* Support vanilla node.js http servers
|
||||
* Treat `ENAMETOOLONG` as code 414
|
||||
* Use accepts for negotiation
|
||||
|
||||
1.0.3 / 2014-05-20
|
||||
==================
|
||||
|
||||
* Fix error from non-statable files in HTML view
|
||||
|
||||
1.0.2 / 2014-04-28
|
||||
==================
|
||||
|
||||
* Add `stylesheet` option
|
||||
* deps: negotiator@0.4.3
|
||||
|
||||
1.0.1 / 2014-03-05
|
||||
==================
|
||||
|
||||
* deps: negotiator@0.4.2
|
||||
|
||||
1.0.0 / 2014-03-05
|
||||
==================
|
||||
|
||||
* Genesis from connect
|
||||
25
node_modules/serve-index/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2010 Sencha Inc.
|
||||
Copyright (c) 2011 LearnBoost
|
||||
Copyright (c) 2011 TJ Holowaychuk
|
||||
Copyright (c) 2014-2015 Douglas Christopher Wilson
|
||||
|
||||
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.
|
||||
154
node_modules/serve-index/README.md
generated
vendored
Normal file
@@ -0,0 +1,154 @@
|
||||
# serve-index
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Linux Build][travis-image]][travis-url]
|
||||
[![Windows Build][appveyor-image]][appveyor-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
[![Gratipay][gratipay-image]][gratipay-url]
|
||||
|
||||
Serves pages that contain directory listings for a given path.
|
||||
|
||||
## Install
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```sh
|
||||
$ npm install serve-index
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var serveIndex = require('serve-index')
|
||||
```
|
||||
|
||||
### serveIndex(path, options)
|
||||
|
||||
Returns middlware that serves an index of the directory in the given `path`.
|
||||
|
||||
The `path` is based off the `req.url` value, so a `req.url` of `'/some/dir`
|
||||
with a `path` of `'public'` will look at `'public/some/dir'`. If you are using
|
||||
something like `express`, you can change the URL "base" with `app.use` (see
|
||||
the express example).
|
||||
|
||||
#### Options
|
||||
|
||||
Serve index accepts these properties in the options object.
|
||||
|
||||
##### filter
|
||||
|
||||
Apply this filter function to files. Defaults to `false`. The `filter` function
|
||||
is called for each file, with the signature `filter(filename, index, files, dir)`
|
||||
where `filename` is the name of the file, `index` is the array index, `files` is
|
||||
the array of files and `dir` is the absolute path the file is located (and thus,
|
||||
the directory the listing is for).
|
||||
|
||||
##### hidden
|
||||
|
||||
Display hidden (dot) files. Defaults to `false`.
|
||||
|
||||
##### icons
|
||||
|
||||
Display icons. Defaults to `false`.
|
||||
|
||||
##### stylesheet
|
||||
|
||||
Optional path to a CSS stylesheet. Defaults to a built-in stylesheet.
|
||||
|
||||
##### template
|
||||
|
||||
Optional path to an HTML template or a function that will render a HTML
|
||||
string. Defaults to a built-in template.
|
||||
|
||||
When given a string, the string is used as a file path to load and then the
|
||||
following tokens are replaced in templates:
|
||||
|
||||
* `{directory}` with the name of the directory.
|
||||
* `{files}` with the HTML of an unordered list of file links.
|
||||
* `{linked-path}` with the HTML of a link to the directory.
|
||||
* `{style}` with the specified stylesheet and embedded images.
|
||||
|
||||
When given as a function, the function is called as `template(locals, callback)`
|
||||
and it needs to invoke `callback(error, htmlString)`. The following are the
|
||||
provided locals:
|
||||
|
||||
* `directory` is the directory being displayed (where `/` is the root).
|
||||
* `displayIcons` is a Boolean for if icons should be rendered or not.
|
||||
* `fileList` is a sorted array of files in the directory. The array contains
|
||||
objects with the following properties:
|
||||
- `name` is the relative name for the file.
|
||||
- `stat` is a `fs.Stats` object for the file.
|
||||
* `path` is the full filesystem path to `directory`.
|
||||
* `style` is the default stylesheet or the contents of the `stylesheet` option.
|
||||
* `viewName` is the view name provided by the `view` option.
|
||||
|
||||
##### view
|
||||
|
||||
Display mode. `tiles` and `details` are available. Defaults to `tiles`.
|
||||
|
||||
## Examples
|
||||
|
||||
### Serve directory indexes with vanilla node.js http server
|
||||
|
||||
```js
|
||||
var finalhandler = require('finalhandler')
|
||||
var http = require('http')
|
||||
var serveIndex = require('serve-index')
|
||||
var serveStatic = require('serve-static')
|
||||
|
||||
// Serve directory indexes for public/ftp folder (with icons)
|
||||
var index = serveIndex('public/ftp', {'icons': true})
|
||||
|
||||
// Serve up public/ftp folder files
|
||||
var serve = serveStatic('public/ftp')
|
||||
|
||||
// Create server
|
||||
var server = http.createServer(function onRequest(req, res){
|
||||
var done = finalhandler(req, res)
|
||||
serve(req, res, function onNext(err) {
|
||||
if (err) return done(err)
|
||||
index(req, res, done)
|
||||
})
|
||||
})
|
||||
|
||||
// Listen
|
||||
server.listen(3000)
|
||||
```
|
||||
|
||||
### Serve directory indexes with express
|
||||
|
||||
```js
|
||||
var express = require('express')
|
||||
var serveIndex = require('serve-index')
|
||||
|
||||
var app = express()
|
||||
|
||||
// Serve URLs like /ftp/thing as public/ftp/thing
|
||||
// The express.static serves the file contents
|
||||
// The serveIndex is this module serving the directory
|
||||
app.use('/ftp', express.static('public/ftp'), serveIndex('public/ftp', {'icons': true}))
|
||||
|
||||
// Listen
|
||||
app.listen(3000)
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE). The [Silk](http://www.famfamfam.com/lab/icons/silk/) icons
|
||||
are created by/copyright of [FAMFAMFAM](http://www.famfamfam.com/).
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/serve-index.svg
|
||||
[npm-url]: https://npmjs.org/package/serve-index
|
||||
[travis-image]: https://img.shields.io/travis/expressjs/serve-index/master.svg?label=linux
|
||||
[travis-url]: https://travis-ci.org/expressjs/serve-index
|
||||
[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/serve-index/master.svg?label=windows
|
||||
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-index
|
||||
[coveralls-image]: https://img.shields.io/coveralls/expressjs/serve-index/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/expressjs/serve-index?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/serve-index.svg
|
||||
[downloads-url]: https://npmjs.org/package/serve-index
|
||||
[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg
|
||||
[gratipay-url]: https://www.gratipay.com/dougwilson/
|
||||
646
node_modules/serve-index/index.js
generated
vendored
Normal file
@@ -0,0 +1,646 @@
|
||||
/*!
|
||||
* serve-index
|
||||
* Copyright(c) 2011 Sencha Inc.
|
||||
* Copyright(c) 2011 TJ Holowaychuk
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var accepts = require('accepts');
|
||||
var createError = require('http-errors');
|
||||
var debug = require('debug')('serve-index');
|
||||
var escapeHtml = require('escape-html');
|
||||
var fs = require('fs')
|
||||
, path = require('path')
|
||||
, normalize = path.normalize
|
||||
, sep = path.sep
|
||||
, extname = path.extname
|
||||
, join = path.join;
|
||||
var Batch = require('batch');
|
||||
var mime = require('mime-types');
|
||||
var parseUrl = require('parseurl');
|
||||
var resolve = require('path').resolve;
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = serveIndex;
|
||||
|
||||
/*!
|
||||
* Icon cache.
|
||||
*/
|
||||
|
||||
var cache = {};
|
||||
|
||||
/*!
|
||||
* Default template.
|
||||
*/
|
||||
|
||||
var defaultTemplate = join(__dirname, 'public', 'directory.html');
|
||||
|
||||
/*!
|
||||
* Stylesheet.
|
||||
*/
|
||||
|
||||
var defaultStylesheet = join(__dirname, 'public', 'style.css');
|
||||
|
||||
/**
|
||||
* Media types and the map for content negotiation.
|
||||
*/
|
||||
|
||||
var mediaTypes = [
|
||||
'text/html',
|
||||
'text/plain',
|
||||
'application/json'
|
||||
];
|
||||
|
||||
var mediaType = {
|
||||
'text/html': 'html',
|
||||
'text/plain': 'plain',
|
||||
'application/json': 'json'
|
||||
};
|
||||
|
||||
/**
|
||||
* Serve directory listings with the given `root` path.
|
||||
*
|
||||
* See Readme.md for documentation of options.
|
||||
*
|
||||
* @param {String} root
|
||||
* @param {Object} options
|
||||
* @return {Function} middleware
|
||||
* @public
|
||||
*/
|
||||
|
||||
function serveIndex(root, options) {
|
||||
var opts = options || {};
|
||||
|
||||
// root required
|
||||
if (!root) {
|
||||
throw new TypeError('serveIndex() root path required');
|
||||
}
|
||||
|
||||
// resolve root to absolute and normalize
|
||||
var rootPath = normalize(resolve(root) + sep);
|
||||
|
||||
var filter = opts.filter;
|
||||
var hidden = opts.hidden;
|
||||
var icons = opts.icons;
|
||||
var stylesheet = opts.stylesheet || defaultStylesheet;
|
||||
var template = opts.template || defaultTemplate;
|
||||
var view = opts.view || 'tiles';
|
||||
|
||||
return function (req, res, next) {
|
||||
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
||||
res.statusCode = 'OPTIONS' === req.method ? 200 : 405;
|
||||
res.setHeader('Allow', 'GET, HEAD, OPTIONS');
|
||||
res.setHeader('Content-Length', '0');
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
|
||||
// parse URLs
|
||||
var url = parseUrl(req);
|
||||
var originalUrl = parseUrl.original(req);
|
||||
var dir = decodeURIComponent(url.pathname);
|
||||
var originalDir = decodeURIComponent(originalUrl.pathname);
|
||||
|
||||
// join / normalize from root dir
|
||||
var path = normalize(join(rootPath, dir));
|
||||
|
||||
// null byte(s), bad request
|
||||
if (~path.indexOf('\0')) return next(createError(400));
|
||||
|
||||
// malicious path
|
||||
if ((path + sep).substr(0, rootPath.length) !== rootPath) {
|
||||
debug('malicious path "%s"', path);
|
||||
return next(createError(403));
|
||||
}
|
||||
|
||||
// determine ".." display
|
||||
var showUp = normalize(resolve(path) + sep) !== rootPath;
|
||||
|
||||
// check if we have a directory
|
||||
debug('stat "%s"', path);
|
||||
fs.stat(path, function(err, stat){
|
||||
if (err && err.code === 'ENOENT') {
|
||||
return next();
|
||||
}
|
||||
|
||||
if (err) {
|
||||
err.status = err.code === 'ENAMETOOLONG'
|
||||
? 414
|
||||
: 500;
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if (!stat.isDirectory()) return next();
|
||||
|
||||
// fetch files
|
||||
debug('readdir "%s"', path);
|
||||
fs.readdir(path, function(err, files){
|
||||
if (err) return next(err);
|
||||
if (!hidden) files = removeHidden(files);
|
||||
if (filter) files = files.filter(function(filename, index, list) {
|
||||
return filter(filename, index, list, path);
|
||||
});
|
||||
files.sort();
|
||||
|
||||
// content-negotiation
|
||||
var accept = accepts(req);
|
||||
var type = accept.type(mediaTypes);
|
||||
|
||||
// not acceptable
|
||||
if (!type) return next(createError(406));
|
||||
serveIndex[mediaType[type]](req, res, files, next, originalDir, showUp, icons, path, view, template, stylesheet);
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Respond with text/html.
|
||||
*/
|
||||
|
||||
serveIndex.html = function _html(req, res, files, next, dir, showUp, icons, path, view, template, stylesheet) {
|
||||
var render = typeof template !== 'function'
|
||||
? createHtmlRender(template)
|
||||
: template
|
||||
|
||||
if (showUp) {
|
||||
files.unshift('..');
|
||||
}
|
||||
|
||||
// stat all files
|
||||
stat(path, files, function (err, stats) {
|
||||
if (err) return next(err);
|
||||
|
||||
// combine the stats into the file list
|
||||
var fileList = files.map(function (file, i) {
|
||||
return { name: file, stat: stats[i] };
|
||||
});
|
||||
|
||||
// sort file list
|
||||
fileList.sort(fileSort);
|
||||
|
||||
// read stylesheet
|
||||
fs.readFile(stylesheet, 'utf8', function (err, style) {
|
||||
if (err) return next(err);
|
||||
|
||||
// create locals for rendering
|
||||
var locals = {
|
||||
directory: dir,
|
||||
displayIcons: Boolean(icons),
|
||||
fileList: fileList,
|
||||
path: path,
|
||||
style: style,
|
||||
viewName: view
|
||||
};
|
||||
|
||||
// render html
|
||||
render(locals, function (err, body) {
|
||||
if (err) return next(err);
|
||||
send(res, 'text/html', body)
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Respond with application/json.
|
||||
*/
|
||||
|
||||
serveIndex.json = function _json(req, res, files) {
|
||||
send(res, 'application/json', JSON.stringify(files))
|
||||
};
|
||||
|
||||
/**
|
||||
* Respond with text/plain.
|
||||
*/
|
||||
|
||||
serveIndex.plain = function _plain(req, res, files) {
|
||||
send(res, 'text/plain', (files.join('\n') + '\n'))
|
||||
};
|
||||
|
||||
/**
|
||||
* Map html `files`, returning an html unordered list.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createHtmlFileList(files, dir, useIcons, view) {
|
||||
var html = '<ul id="files" class="view-' + escapeHtml(view) + '">'
|
||||
+ (view == 'details' ? (
|
||||
'<li class="header">'
|
||||
+ '<span class="name">Name</span>'
|
||||
+ '<span class="size">Size</span>'
|
||||
+ '<span class="date">Modified</span>'
|
||||
+ '</li>') : '');
|
||||
|
||||
html += files.map(function (file) {
|
||||
var classes = [];
|
||||
var isDir = file.stat && file.stat.isDirectory();
|
||||
var path = dir.split('/').map(function (c) { return encodeURIComponent(c); });
|
||||
|
||||
if (useIcons) {
|
||||
classes.push('icon');
|
||||
|
||||
if (isDir) {
|
||||
classes.push('icon-directory');
|
||||
} else {
|
||||
var ext = extname(file.name);
|
||||
var icon = iconLookup(file.name);
|
||||
|
||||
classes.push('icon');
|
||||
classes.push('icon-' + ext.substring(1));
|
||||
|
||||
if (classes.indexOf(icon.className) === -1) {
|
||||
classes.push(icon.className);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
path.push(encodeURIComponent(file.name));
|
||||
|
||||
var date = file.stat && file.name !== '..'
|
||||
? file.stat.mtime.toLocaleDateString() + ' ' + file.stat.mtime.toLocaleTimeString()
|
||||
: '';
|
||||
var size = file.stat && !isDir
|
||||
? file.stat.size
|
||||
: '';
|
||||
|
||||
return '<li><a href="'
|
||||
+ escapeHtml(normalizeSlashes(normalize(path.join('/'))))
|
||||
+ '" class="' + escapeHtml(classes.join(' ')) + '"'
|
||||
+ ' title="' + escapeHtml(file.name) + '">'
|
||||
+ '<span class="name">' + escapeHtml(file.name) + '</span>'
|
||||
+ '<span class="size">' + escapeHtml(size) + '</span>'
|
||||
+ '<span class="date">' + escapeHtml(date) + '</span>'
|
||||
+ '</a></li>';
|
||||
}).join('\n');
|
||||
|
||||
html += '</ul>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create function to render html.
|
||||
*/
|
||||
|
||||
function createHtmlRender(template) {
|
||||
return function render(locals, callback) {
|
||||
// read template
|
||||
fs.readFile(template, 'utf8', function (err, str) {
|
||||
if (err) return callback(err);
|
||||
|
||||
var body = str
|
||||
.replace(/\{style\}/g, locals.style.concat(iconStyle(locals.fileList, locals.displayIcons)))
|
||||
.replace(/\{files\}/g, createHtmlFileList(locals.fileList, locals.directory, locals.displayIcons, locals.viewName))
|
||||
.replace(/\{directory\}/g, escapeHtml(locals.directory))
|
||||
.replace(/\{linked-path\}/g, htmlPath(locals.directory));
|
||||
|
||||
callback(null, body);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort function for with directories first.
|
||||
*/
|
||||
|
||||
function fileSort(a, b) {
|
||||
// sort ".." to the top
|
||||
if (a.name === '..' || b.name === '..') {
|
||||
return a.name === b.name ? 0
|
||||
: a.name === '..' ? -1 : 1;
|
||||
}
|
||||
|
||||
return Number(b.stat && b.stat.isDirectory()) - Number(a.stat && a.stat.isDirectory()) ||
|
||||
String(a.name).toLocaleLowerCase().localeCompare(String(b.name).toLocaleLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* Map html `dir`, returning a linked path.
|
||||
*/
|
||||
|
||||
function htmlPath(dir) {
|
||||
var parts = dir.split('/');
|
||||
var crumb = new Array(parts.length);
|
||||
|
||||
for (var i = 0; i < parts.length; i++) {
|
||||
var part = parts[i];
|
||||
|
||||
if (part) {
|
||||
parts[i] = encodeURIComponent(part);
|
||||
crumb[i] = '<a href="' + escapeHtml(parts.slice(0, i + 1).join('/')) + '">' + escapeHtml(part) + '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
return crumb.join(' / ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the icon data for the file name.
|
||||
*/
|
||||
|
||||
function iconLookup(filename) {
|
||||
var ext = extname(filename);
|
||||
|
||||
// try by extension
|
||||
if (icons[ext]) {
|
||||
return {
|
||||
className: 'icon-' + ext.substring(1),
|
||||
fileName: icons[ext]
|
||||
};
|
||||
}
|
||||
|
||||
var mimetype = mime.lookup(ext);
|
||||
|
||||
// default if no mime type
|
||||
if (mimetype === false) {
|
||||
return {
|
||||
className: 'icon-default',
|
||||
fileName: icons.default
|
||||
};
|
||||
}
|
||||
|
||||
// try by mime type
|
||||
if (icons[mimetype]) {
|
||||
return {
|
||||
className: 'icon-' + mimetype.replace('/', '-'),
|
||||
fileName: icons[mimetype]
|
||||
};
|
||||
}
|
||||
|
||||
var suffix = mimetype.split('+')[1];
|
||||
|
||||
if (suffix && icons['+' + suffix]) {
|
||||
return {
|
||||
className: 'icon-' + suffix,
|
||||
fileName: icons['+' + suffix]
|
||||
};
|
||||
}
|
||||
|
||||
var type = mimetype.split('/')[0];
|
||||
|
||||
// try by type only
|
||||
if (icons[type]) {
|
||||
return {
|
||||
className: 'icon-' + type,
|
||||
fileName: icons[type]
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
className: 'icon-default',
|
||||
fileName: icons.default
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Load icon images, return css string.
|
||||
*/
|
||||
|
||||
function iconStyle(files, useIcons) {
|
||||
if (!useIcons) return '';
|
||||
var i;
|
||||
var list = [];
|
||||
var rules = {};
|
||||
var selector;
|
||||
var selectors = {};
|
||||
var style = '';
|
||||
|
||||
for (i = 0; i < files.length; i++) {
|
||||
var file = files[i];
|
||||
|
||||
var isDir = file.stat && file.stat.isDirectory();
|
||||
var icon = isDir
|
||||
? { className: 'icon-directory', fileName: icons.folder }
|
||||
: iconLookup(file.name);
|
||||
var iconName = icon.fileName;
|
||||
|
||||
selector = '#files .' + icon.className + ' .name';
|
||||
|
||||
if (!rules[iconName]) {
|
||||
rules[iconName] = 'background-image: url(data:image/png;base64,' + load(iconName) + ');'
|
||||
selectors[iconName] = [];
|
||||
list.push(iconName);
|
||||
}
|
||||
|
||||
if (selectors[iconName].indexOf(selector) === -1) {
|
||||
selectors[iconName].push(selector);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < list.length; i++) {
|
||||
iconName = list[i];
|
||||
style += selectors[iconName].join(',\n') + ' {\n ' + rules[iconName] + '\n}\n';
|
||||
}
|
||||
|
||||
return style;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and cache the given `icon`.
|
||||
*
|
||||
* @param {String} icon
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function load(icon) {
|
||||
if (cache[icon]) return cache[icon];
|
||||
return cache[icon] = fs.readFileSync(__dirname + '/public/icons/' + icon, 'base64');
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes the path separator from system separator
|
||||
* to URL separator, aka `/`.
|
||||
*
|
||||
* @param {String} path
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function normalizeSlashes(path) {
|
||||
return path.split(sep).join('/');
|
||||
};
|
||||
|
||||
/**
|
||||
* Filter "hidden" `files`, aka files
|
||||
* beginning with a `.`.
|
||||
*
|
||||
* @param {Array} files
|
||||
* @return {Array}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function removeHidden(files) {
|
||||
return files.filter(function(file){
|
||||
return '.' != file[0];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a response.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function send (res, type, body) {
|
||||
// security header for content sniffing
|
||||
res.setHeader('X-Content-Type-Options', 'nosniff')
|
||||
|
||||
// standard headers
|
||||
res.setHeader('Content-Type', type + '; charset=utf-8')
|
||||
res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8'))
|
||||
|
||||
// body
|
||||
res.end(body, 'utf8')
|
||||
}
|
||||
|
||||
/**
|
||||
* Stat all files and return array of stat
|
||||
* in same order.
|
||||
*/
|
||||
|
||||
function stat(dir, files, cb) {
|
||||
var batch = new Batch();
|
||||
|
||||
batch.concurrency(10);
|
||||
|
||||
files.forEach(function(file){
|
||||
batch.push(function(done){
|
||||
fs.stat(join(dir, file), function(err, stat){
|
||||
if (err && err.code !== 'ENOENT') return done(err);
|
||||
|
||||
// pass ENOENT as null stat, not error
|
||||
done(null, stat || null);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
batch.end(cb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Icon map.
|
||||
*/
|
||||
|
||||
var icons = {
|
||||
// base icons
|
||||
'default': 'page_white.png',
|
||||
'folder': 'folder.png',
|
||||
|
||||
// generic mime type icons
|
||||
'image': 'image.png',
|
||||
'text': 'page_white_text.png',
|
||||
'video': 'film.png',
|
||||
|
||||
// generic mime suffix icons
|
||||
'+json': 'page_white_code.png',
|
||||
'+xml': 'page_white_code.png',
|
||||
'+zip': 'box.png',
|
||||
|
||||
// specific mime type icons
|
||||
'application/font-woff': 'font.png',
|
||||
'application/javascript': 'page_white_code_red.png',
|
||||
'application/json': 'page_white_code.png',
|
||||
'application/msword': 'page_white_word.png',
|
||||
'application/pdf': 'page_white_acrobat.png',
|
||||
'application/postscript': 'page_white_vector.png',
|
||||
'application/rtf': 'page_white_word.png',
|
||||
'application/vnd.ms-excel': 'page_white_excel.png',
|
||||
'application/vnd.ms-powerpoint': 'page_white_powerpoint.png',
|
||||
'application/vnd.oasis.opendocument.presentation': 'page_white_powerpoint.png',
|
||||
'application/vnd.oasis.opendocument.spreadsheet': 'page_white_excel.png',
|
||||
'application/vnd.oasis.opendocument.text': 'page_white_word.png',
|
||||
'application/x-7z-compressed': 'box.png',
|
||||
'application/x-sh': 'application_xp_terminal.png',
|
||||
'application/x-font-ttf': 'font.png',
|
||||
'application/x-msaccess': 'page_white_database.png',
|
||||
'application/x-shockwave-flash': 'page_white_flash.png',
|
||||
'application/x-sql': 'page_white_database.png',
|
||||
'application/x-tar': 'box.png',
|
||||
'application/x-xz': 'box.png',
|
||||
'application/xml': 'page_white_code.png',
|
||||
'application/zip': 'box.png',
|
||||
'image/svg+xml': 'page_white_vector.png',
|
||||
'text/css': 'page_white_code.png',
|
||||
'text/html': 'page_white_code.png',
|
||||
'text/less': 'page_white_code.png',
|
||||
|
||||
// other, extension-specific icons
|
||||
'.accdb': 'page_white_database.png',
|
||||
'.apk': 'box.png',
|
||||
'.app': 'application_xp.png',
|
||||
'.as': 'page_white_actionscript.png',
|
||||
'.asp': 'page_white_code.png',
|
||||
'.aspx': 'page_white_code.png',
|
||||
'.bat': 'application_xp_terminal.png',
|
||||
'.bz2': 'box.png',
|
||||
'.c': 'page_white_c.png',
|
||||
'.cab': 'box.png',
|
||||
'.cfm': 'page_white_coldfusion.png',
|
||||
'.clj': 'page_white_code.png',
|
||||
'.cc': 'page_white_cplusplus.png',
|
||||
'.cgi': 'application_xp_terminal.png',
|
||||
'.cpp': 'page_white_cplusplus.png',
|
||||
'.cs': 'page_white_csharp.png',
|
||||
'.db': 'page_white_database.png',
|
||||
'.dbf': 'page_white_database.png',
|
||||
'.deb': 'box.png',
|
||||
'.dll': 'page_white_gear.png',
|
||||
'.dmg': 'drive.png',
|
||||
'.docx': 'page_white_word.png',
|
||||
'.erb': 'page_white_ruby.png',
|
||||
'.exe': 'application_xp.png',
|
||||
'.fnt': 'font.png',
|
||||
'.gam': 'controller.png',
|
||||
'.gz': 'box.png',
|
||||
'.h': 'page_white_h.png',
|
||||
'.ini': 'page_white_gear.png',
|
||||
'.iso': 'cd.png',
|
||||
'.jar': 'box.png',
|
||||
'.java': 'page_white_cup.png',
|
||||
'.jsp': 'page_white_cup.png',
|
||||
'.lua': 'page_white_code.png',
|
||||
'.lz': 'box.png',
|
||||
'.lzma': 'box.png',
|
||||
'.m': 'page_white_code.png',
|
||||
'.map': 'map.png',
|
||||
'.msi': 'box.png',
|
||||
'.mv4': 'film.png',
|
||||
'.otf': 'font.png',
|
||||
'.pdb': 'page_white_database.png',
|
||||
'.php': 'page_white_php.png',
|
||||
'.pl': 'page_white_code.png',
|
||||
'.pkg': 'box.png',
|
||||
'.pptx': 'page_white_powerpoint.png',
|
||||
'.psd': 'page_white_picture.png',
|
||||
'.py': 'page_white_code.png',
|
||||
'.rar': 'box.png',
|
||||
'.rb': 'page_white_ruby.png',
|
||||
'.rm': 'film.png',
|
||||
'.rom': 'controller.png',
|
||||
'.rpm': 'box.png',
|
||||
'.sass': 'page_white_code.png',
|
||||
'.sav': 'controller.png',
|
||||
'.scss': 'page_white_code.png',
|
||||
'.srt': 'page_white_text.png',
|
||||
'.tbz2': 'box.png',
|
||||
'.tgz': 'box.png',
|
||||
'.tlz': 'box.png',
|
||||
'.vb': 'page_white_code.png',
|
||||
'.vbs': 'page_white_code.png',
|
||||
'.xcf': 'page_white_picture.png',
|
||||
'.xlsx': 'page_white_excel.png',
|
||||
'.yaws': 'page_white_code.png'
|
||||
};
|
||||
96
node_modules/serve-index/node_modules/depd/History.md
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
1.1.2 / 2018-01-11
|
||||
==================
|
||||
|
||||
* perf: remove argument reassignment
|
||||
* Support Node.js 0.6 to 9.x
|
||||
|
||||
1.1.1 / 2017-07-27
|
||||
==================
|
||||
|
||||
* Remove unnecessary `Buffer` loading
|
||||
* Support Node.js 0.6 to 8.x
|
||||
|
||||
1.1.0 / 2015-09-14
|
||||
==================
|
||||
|
||||
* Enable strict mode in more places
|
||||
* Support io.js 3.x
|
||||
* Support io.js 2.x
|
||||
* Support web browser loading
|
||||
- Requires bundler like Browserify or webpack
|
||||
|
||||
1.0.1 / 2015-04-07
|
||||
==================
|
||||
|
||||
* Fix `TypeError`s when under `'use strict'` code
|
||||
* Fix useless type name on auto-generated messages
|
||||
* Support io.js 1.x
|
||||
* Support Node.js 0.12
|
||||
|
||||
1.0.0 / 2014-09-17
|
||||
==================
|
||||
|
||||
* No changes
|
||||
|
||||
0.4.5 / 2014-09-09
|
||||
==================
|
||||
|
||||
* Improve call speed to functions using the function wrapper
|
||||
* Support Node.js 0.6
|
||||
|
||||
0.4.4 / 2014-07-27
|
||||
==================
|
||||
|
||||
* Work-around v8 generating empty stack traces
|
||||
|
||||
0.4.3 / 2014-07-26
|
||||
==================
|
||||
|
||||
* Fix exception when global `Error.stackTraceLimit` is too low
|
||||
|
||||
0.4.2 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Correct call site for wrapped functions and properties
|
||||
|
||||
0.4.1 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Improve automatic message generation for function properties
|
||||
|
||||
0.4.0 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Add `TRACE_DEPRECATION` environment variable
|
||||
* Remove non-standard grey color from color output
|
||||
* Support `--no-deprecation` argument
|
||||
* Support `--trace-deprecation` argument
|
||||
* Support `deprecate.property(fn, prop, message)`
|
||||
|
||||
0.3.0 / 2014-06-16
|
||||
==================
|
||||
|
||||
* Add `NO_DEPRECATION` environment variable
|
||||
|
||||
0.2.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Add `deprecate.property(obj, prop, message)`
|
||||
* Remove `supports-color` dependency for node.js 0.8
|
||||
|
||||
0.1.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Add `deprecate.function(fn, message)`
|
||||
* Add `process.on('deprecation', fn)` emitter
|
||||
* Automatically generate message when omitted from `deprecate()`
|
||||
|
||||
0.0.1 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Fix warning for dynamic calls at singe call site
|
||||
|
||||
0.0.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Initial implementation
|
||||
22
node_modules/serve-index/node_modules/depd/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2017 Douglas Christopher Wilson
|
||||
|
||||
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.
|
||||
280
node_modules/serve-index/node_modules/depd/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,280 @@
|
||||
# depd
|
||||
|
||||
[![NPM Version][npm-version-image]][npm-url]
|
||||
[![NPM Downloads][npm-downloads-image]][npm-url]
|
||||
[![Node.js Version][node-image]][node-url]
|
||||
[![Linux Build][travis-image]][travis-url]
|
||||
[![Windows Build][appveyor-image]][appveyor-url]
|
||||
[![Coverage Status][coveralls-image]][coveralls-url]
|
||||
|
||||
Deprecate all the things
|
||||
|
||||
> With great modules comes great responsibility; mark things deprecated!
|
||||
|
||||
## Install
|
||||
|
||||
This module is installed directly using `npm`:
|
||||
|
||||
```sh
|
||||
$ npm install depd
|
||||
```
|
||||
|
||||
This module can also be bundled with systems like
|
||||
[Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/),
|
||||
though by default this module will alter it's API to no longer display or
|
||||
track deprecations.
|
||||
|
||||
## API
|
||||
|
||||
<!-- eslint-disable no-unused-vars -->
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-module')
|
||||
```
|
||||
|
||||
This library allows you to display deprecation messages to your users.
|
||||
This library goes above and beyond with deprecation warnings by
|
||||
introspection of the call stack (but only the bits that it is interested
|
||||
in).
|
||||
|
||||
Instead of just warning on the first invocation of a deprecated
|
||||
function and never again, this module will warn on the first invocation
|
||||
of a deprecated function per unique call site, making it ideal to alert
|
||||
users of all deprecated uses across the code base, rather than just
|
||||
whatever happens to execute first.
|
||||
|
||||
The deprecation warnings from this module also include the file and line
|
||||
information for the call into the module that the deprecated function was
|
||||
in.
|
||||
|
||||
**NOTE** this library has a similar interface to the `debug` module, and
|
||||
this module uses the calling file to get the boundary for the call stacks,
|
||||
so you should always create a new `deprecate` object in each file and not
|
||||
within some central file.
|
||||
|
||||
### depd(namespace)
|
||||
|
||||
Create a new deprecate function that uses the given namespace name in the
|
||||
messages and will display the call site prior to the stack entering the
|
||||
file this function was called from. It is highly suggested you use the
|
||||
name of your module as the namespace.
|
||||
|
||||
### deprecate(message)
|
||||
|
||||
Call this function from deprecated code to display a deprecation message.
|
||||
This message will appear once per unique caller site. Caller site is the
|
||||
first call site in the stack in a different file from the caller of this
|
||||
function.
|
||||
|
||||
If the message is omitted, a message is generated for you based on the site
|
||||
of the `deprecate()` call and will display the name of the function called,
|
||||
similar to the name displayed in a stack trace.
|
||||
|
||||
### deprecate.function(fn, message)
|
||||
|
||||
Call this function to wrap a given function in a deprecation message on any
|
||||
call to the function. An optional message can be supplied to provide a custom
|
||||
message.
|
||||
|
||||
### deprecate.property(obj, prop, message)
|
||||
|
||||
Call this function to wrap a given property on object in a deprecation message
|
||||
on any accessing or setting of the property. An optional message can be supplied
|
||||
to provide a custom message.
|
||||
|
||||
The method must be called on the object where the property belongs (not
|
||||
inherited from the prototype).
|
||||
|
||||
If the property is a data descriptor, it will be converted to an accessor
|
||||
descriptor in order to display the deprecation message.
|
||||
|
||||
### process.on('deprecation', fn)
|
||||
|
||||
This module will allow easy capturing of deprecation errors by emitting the
|
||||
errors as the type "deprecation" on the global `process`. If there are no
|
||||
listeners for this type, the errors are written to STDERR as normal, but if
|
||||
there are any listeners, nothing will be written to STDERR and instead only
|
||||
emitted. From there, you can write the errors in a different format or to a
|
||||
logging source.
|
||||
|
||||
The error represents the deprecation and is emitted only once with the same
|
||||
rules as writing to STDERR. The error has the following properties:
|
||||
|
||||
- `message` - This is the message given by the library
|
||||
- `name` - This is always `'DeprecationError'`
|
||||
- `namespace` - This is the namespace the deprecation came from
|
||||
- `stack` - This is the stack of the call to the deprecated thing
|
||||
|
||||
Example `error.stack` output:
|
||||
|
||||
```
|
||||
DeprecationError: my-cool-module deprecated oldfunction
|
||||
at Object.<anonymous> ([eval]-wrapper:6:22)
|
||||
at Module._compile (module.js:456:26)
|
||||
at evalScript (node.js:532:25)
|
||||
at startup (node.js:80:7)
|
||||
at node.js:902:3
|
||||
```
|
||||
|
||||
### process.env.NO_DEPRECATION
|
||||
|
||||
As a user of modules that are deprecated, the environment variable `NO_DEPRECATION`
|
||||
is provided as a quick solution to silencing deprecation warnings from being
|
||||
output. The format of this is similar to that of `DEBUG`:
|
||||
|
||||
```sh
|
||||
$ NO_DEPRECATION=my-module,othermod node app.js
|
||||
```
|
||||
|
||||
This will suppress deprecations from being output for "my-module" and "othermod".
|
||||
The value is a list of comma-separated namespaces. To suppress every warning
|
||||
across all namespaces, use the value `*` for a namespace.
|
||||
|
||||
Providing the argument `--no-deprecation` to the `node` executable will suppress
|
||||
all deprecations (only available in Node.js 0.8 or higher).
|
||||
|
||||
**NOTE** This will not suppress the deperecations given to any "deprecation"
|
||||
event listeners, just the output to STDERR.
|
||||
|
||||
### process.env.TRACE_DEPRECATION
|
||||
|
||||
As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION`
|
||||
is provided as a solution to getting more detailed location information in deprecation
|
||||
warnings by including the entire stack trace. The format of this is the same as
|
||||
`NO_DEPRECATION`:
|
||||
|
||||
```sh
|
||||
$ TRACE_DEPRECATION=my-module,othermod node app.js
|
||||
```
|
||||
|
||||
This will include stack traces for deprecations being output for "my-module" and
|
||||
"othermod". The value is a list of comma-separated namespaces. To trace every
|
||||
warning across all namespaces, use the value `*` for a namespace.
|
||||
|
||||
Providing the argument `--trace-deprecation` to the `node` executable will trace
|
||||
all deprecations (only available in Node.js 0.8 or higher).
|
||||
|
||||
**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`.
|
||||
|
||||
## Display
|
||||
|
||||

|
||||
|
||||
When a user calls a function in your library that you mark deprecated, they
|
||||
will see the following written to STDERR (in the given colors, similar colors
|
||||
and layout to the `debug` module):
|
||||
|
||||
```
|
||||
bright cyan bright yellow
|
||||
| | reset cyan
|
||||
| | | |
|
||||
▼ ▼ ▼ ▼
|
||||
my-cool-module deprecated oldfunction [eval]-wrapper:6:22
|
||||
▲ ▲ ▲ ▲
|
||||
| | | |
|
||||
namespace | | location of mycoolmod.oldfunction() call
|
||||
| deprecation message
|
||||
the word "deprecated"
|
||||
```
|
||||
|
||||
If the user redirects their STDERR to a file or somewhere that does not support
|
||||
colors, they see (similar layout to the `debug` module):
|
||||
|
||||
```
|
||||
Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22
|
||||
▲ ▲ ▲ ▲ ▲
|
||||
| | | | |
|
||||
timestamp of message namespace | | location of mycoolmod.oldfunction() call
|
||||
| deprecation message
|
||||
the word "deprecated"
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Deprecating all calls to a function
|
||||
|
||||
This will display a deprecated message about "oldfunction" being deprecated
|
||||
from "my-module" on STDERR.
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
// message automatically derived from function name
|
||||
// Object.oldfunction
|
||||
exports.oldfunction = deprecate.function(function oldfunction () {
|
||||
// all calls to function are deprecated
|
||||
})
|
||||
|
||||
// specific message
|
||||
exports.oldfunction = deprecate.function(function () {
|
||||
// all calls to function are deprecated
|
||||
}, 'oldfunction')
|
||||
```
|
||||
|
||||
### Conditionally deprecating a function call
|
||||
|
||||
This will display a deprecated message about "weirdfunction" being deprecated
|
||||
from "my-module" on STDERR when called with less than 2 arguments.
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
exports.weirdfunction = function () {
|
||||
if (arguments.length < 2) {
|
||||
// calls with 0 or 1 args are deprecated
|
||||
deprecate('weirdfunction args < 2')
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
When calling `deprecate` as a function, the warning is counted per call site
|
||||
within your own module, so you can display different deprecations depending
|
||||
on different situations and the users will still get all the warnings:
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
exports.weirdfunction = function () {
|
||||
if (arguments.length < 2) {
|
||||
// calls with 0 or 1 args are deprecated
|
||||
deprecate('weirdfunction args < 2')
|
||||
} else if (typeof arguments[0] !== 'string') {
|
||||
// calls with non-string first argument are deprecated
|
||||
deprecate('weirdfunction non-string first arg')
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Deprecating property access
|
||||
|
||||
This will display a deprecated message about "oldprop" being deprecated
|
||||
from "my-module" on STDERR when accessed. A deprecation will be displayed
|
||||
when setting the value and when getting the value.
|
||||
|
||||
```js
|
||||
var deprecate = require('depd')('my-cool-module')
|
||||
|
||||
exports.oldprop = 'something'
|
||||
|
||||
// message automatically derives from property name
|
||||
deprecate.property(exports, 'oldprop')
|
||||
|
||||
// explicit message
|
||||
deprecate.property(exports, 'oldprop', 'oldprop >= 0.10')
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-version-image]: https://img.shields.io/npm/v/depd.svg
|
||||
[npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg
|
||||
[npm-url]: https://npmjs.org/package/depd
|
||||
[travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd/master.svg?label=linux
|
||||
[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd
|
||||
[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/nodejs-depd/master.svg?label=windows
|
||||
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd
|
||||
[coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd/master.svg
|
||||
[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master
|
||||
[node-image]: https://img.shields.io/node/v/depd.svg
|
||||
[node-url]: https://nodejs.org/en/download/
|
||||
522
node_modules/serve-index/node_modules/depd/index.js
generated
vendored
Normal file
@@ -0,0 +1,522 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var callSiteToString = require('./lib/compat').callSiteToString
|
||||
var eventListenerCount = require('./lib/compat').eventListenerCount
|
||||
var relative = require('path').relative
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = depd
|
||||
|
||||
/**
|
||||
* Get the path to base files on.
|
||||
*/
|
||||
|
||||
var basePath = process.cwd()
|
||||
|
||||
/**
|
||||
* Determine if namespace is contained in the string.
|
||||
*/
|
||||
|
||||
function containsNamespace (str, namespace) {
|
||||
var vals = str.split(/[ ,]+/)
|
||||
var ns = String(namespace).toLowerCase()
|
||||
|
||||
for (var i = 0; i < vals.length; i++) {
|
||||
var val = vals[i]
|
||||
|
||||
// namespace contained
|
||||
if (val && (val === '*' || val.toLowerCase() === ns)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a data descriptor to accessor descriptor.
|
||||
*/
|
||||
|
||||
function convertDataDescriptorToAccessor (obj, prop, message) {
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
var value = descriptor.value
|
||||
|
||||
descriptor.get = function getter () { return value }
|
||||
|
||||
if (descriptor.writable) {
|
||||
descriptor.set = function setter (val) { return (value = val) }
|
||||
}
|
||||
|
||||
delete descriptor.value
|
||||
delete descriptor.writable
|
||||
|
||||
Object.defineProperty(obj, prop, descriptor)
|
||||
|
||||
return descriptor
|
||||
}
|
||||
|
||||
/**
|
||||
* Create arguments string to keep arity.
|
||||
*/
|
||||
|
||||
function createArgumentsString (arity) {
|
||||
var str = ''
|
||||
|
||||
for (var i = 0; i < arity; i++) {
|
||||
str += ', arg' + i
|
||||
}
|
||||
|
||||
return str.substr(2)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create stack string from stack.
|
||||
*/
|
||||
|
||||
function createStackString (stack) {
|
||||
var str = this.name + ': ' + this.namespace
|
||||
|
||||
if (this.message) {
|
||||
str += ' deprecated ' + this.message
|
||||
}
|
||||
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
str += '\n at ' + callSiteToString(stack[i])
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
/**
|
||||
* Create deprecate for namespace in caller.
|
||||
*/
|
||||
|
||||
function depd (namespace) {
|
||||
if (!namespace) {
|
||||
throw new TypeError('argument namespace is required')
|
||||
}
|
||||
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
var file = site[0]
|
||||
|
||||
function deprecate (message) {
|
||||
// call to self as log
|
||||
log.call(deprecate, message)
|
||||
}
|
||||
|
||||
deprecate._file = file
|
||||
deprecate._ignored = isignored(namespace)
|
||||
deprecate._namespace = namespace
|
||||
deprecate._traced = istraced(namespace)
|
||||
deprecate._warned = Object.create(null)
|
||||
|
||||
deprecate.function = wrapfunction
|
||||
deprecate.property = wrapproperty
|
||||
|
||||
return deprecate
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if namespace is ignored.
|
||||
*/
|
||||
|
||||
function isignored (namespace) {
|
||||
/* istanbul ignore next: tested in a child processs */
|
||||
if (process.noDeprecation) {
|
||||
// --no-deprecation support
|
||||
return true
|
||||
}
|
||||
|
||||
var str = process.env.NO_DEPRECATION || ''
|
||||
|
||||
// namespace ignored
|
||||
return containsNamespace(str, namespace)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if namespace is traced.
|
||||
*/
|
||||
|
||||
function istraced (namespace) {
|
||||
/* istanbul ignore next: tested in a child processs */
|
||||
if (process.traceDeprecation) {
|
||||
// --trace-deprecation support
|
||||
return true
|
||||
}
|
||||
|
||||
var str = process.env.TRACE_DEPRECATION || ''
|
||||
|
||||
// namespace traced
|
||||
return containsNamespace(str, namespace)
|
||||
}
|
||||
|
||||
/**
|
||||
* Display deprecation message.
|
||||
*/
|
||||
|
||||
function log (message, site) {
|
||||
var haslisteners = eventListenerCount(process, 'deprecation') !== 0
|
||||
|
||||
// abort early if no destination
|
||||
if (!haslisteners && this._ignored) {
|
||||
return
|
||||
}
|
||||
|
||||
var caller
|
||||
var callFile
|
||||
var callSite
|
||||
var depSite
|
||||
var i = 0
|
||||
var seen = false
|
||||
var stack = getStack()
|
||||
var file = this._file
|
||||
|
||||
if (site) {
|
||||
// provided site
|
||||
depSite = site
|
||||
callSite = callSiteLocation(stack[1])
|
||||
callSite.name = depSite.name
|
||||
file = callSite[0]
|
||||
} else {
|
||||
// get call site
|
||||
i = 2
|
||||
depSite = callSiteLocation(stack[i])
|
||||
callSite = depSite
|
||||
}
|
||||
|
||||
// get caller of deprecated thing in relation to file
|
||||
for (; i < stack.length; i++) {
|
||||
caller = callSiteLocation(stack[i])
|
||||
callFile = caller[0]
|
||||
|
||||
if (callFile === file) {
|
||||
seen = true
|
||||
} else if (callFile === this._file) {
|
||||
file = this._file
|
||||
} else if (seen) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
var key = caller
|
||||
? depSite.join(':') + '__' + caller.join(':')
|
||||
: undefined
|
||||
|
||||
if (key !== undefined && key in this._warned) {
|
||||
// already warned
|
||||
return
|
||||
}
|
||||
|
||||
this._warned[key] = true
|
||||
|
||||
// generate automatic message from call site
|
||||
var msg = message
|
||||
if (!msg) {
|
||||
msg = callSite === depSite || !callSite.name
|
||||
? defaultMessage(depSite)
|
||||
: defaultMessage(callSite)
|
||||
}
|
||||
|
||||
// emit deprecation if listeners exist
|
||||
if (haslisteners) {
|
||||
var err = DeprecationError(this._namespace, msg, stack.slice(i))
|
||||
process.emit('deprecation', err)
|
||||
return
|
||||
}
|
||||
|
||||
// format and write message
|
||||
var format = process.stderr.isTTY
|
||||
? formatColor
|
||||
: formatPlain
|
||||
var output = format.call(this, msg, caller, stack.slice(i))
|
||||
process.stderr.write(output + '\n', 'utf8')
|
||||
}
|
||||
|
||||
/**
|
||||
* Get call site location as array.
|
||||
*/
|
||||
|
||||
function callSiteLocation (callSite) {
|
||||
var file = callSite.getFileName() || '<anonymous>'
|
||||
var line = callSite.getLineNumber()
|
||||
var colm = callSite.getColumnNumber()
|
||||
|
||||
if (callSite.isEval()) {
|
||||
file = callSite.getEvalOrigin() + ', ' + file
|
||||
}
|
||||
|
||||
var site = [file, line, colm]
|
||||
|
||||
site.callSite = callSite
|
||||
site.name = callSite.getFunctionName()
|
||||
|
||||
return site
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a default message from the site.
|
||||
*/
|
||||
|
||||
function defaultMessage (site) {
|
||||
var callSite = site.callSite
|
||||
var funcName = site.name
|
||||
|
||||
// make useful anonymous name
|
||||
if (!funcName) {
|
||||
funcName = '<anonymous@' + formatLocation(site) + '>'
|
||||
}
|
||||
|
||||
var context = callSite.getThis()
|
||||
var typeName = context && callSite.getTypeName()
|
||||
|
||||
// ignore useless type name
|
||||
if (typeName === 'Object') {
|
||||
typeName = undefined
|
||||
}
|
||||
|
||||
// make useful type name
|
||||
if (typeName === 'Function') {
|
||||
typeName = context.name || typeName
|
||||
}
|
||||
|
||||
return typeName && callSite.getMethodName()
|
||||
? typeName + '.' + funcName
|
||||
: funcName
|
||||
}
|
||||
|
||||
/**
|
||||
* Format deprecation message without color.
|
||||
*/
|
||||
|
||||
function formatPlain (msg, caller, stack) {
|
||||
var timestamp = new Date().toUTCString()
|
||||
|
||||
var formatted = timestamp +
|
||||
' ' + this._namespace +
|
||||
' deprecated ' + msg
|
||||
|
||||
// add stack trace
|
||||
if (this._traced) {
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
formatted += '\n at ' + callSiteToString(stack[i])
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
if (caller) {
|
||||
formatted += ' at ' + formatLocation(caller)
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
/**
|
||||
* Format deprecation message with color.
|
||||
*/
|
||||
|
||||
function formatColor (msg, caller, stack) {
|
||||
var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan
|
||||
' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow
|
||||
' \x1b[0m' + msg + '\x1b[39m' // reset
|
||||
|
||||
// add stack trace
|
||||
if (this._traced) {
|
||||
for (var i = 0; i < stack.length; i++) {
|
||||
formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
if (caller) {
|
||||
formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan
|
||||
}
|
||||
|
||||
return formatted
|
||||
}
|
||||
|
||||
/**
|
||||
* Format call site location.
|
||||
*/
|
||||
|
||||
function formatLocation (callSite) {
|
||||
return relative(basePath, callSite[0]) +
|
||||
':' + callSite[1] +
|
||||
':' + callSite[2]
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the stack as array of call sites.
|
||||
*/
|
||||
|
||||
function getStack () {
|
||||
var limit = Error.stackTraceLimit
|
||||
var obj = {}
|
||||
var prep = Error.prepareStackTrace
|
||||
|
||||
Error.prepareStackTrace = prepareObjectStackTrace
|
||||
Error.stackTraceLimit = Math.max(10, limit)
|
||||
|
||||
// capture the stack
|
||||
Error.captureStackTrace(obj)
|
||||
|
||||
// slice this function off the top
|
||||
var stack = obj.stack.slice(1)
|
||||
|
||||
Error.prepareStackTrace = prep
|
||||
Error.stackTraceLimit = limit
|
||||
|
||||
return stack
|
||||
}
|
||||
|
||||
/**
|
||||
* Capture call site stack from v8.
|
||||
*/
|
||||
|
||||
function prepareObjectStackTrace (obj, stack) {
|
||||
return stack
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a wrapped function in a deprecation message.
|
||||
*/
|
||||
|
||||
function wrapfunction (fn, message) {
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('argument fn must be a function')
|
||||
}
|
||||
|
||||
var args = createArgumentsString(fn.length)
|
||||
var deprecate = this // eslint-disable-line no-unused-vars
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
|
||||
site.name = fn.name
|
||||
|
||||
// eslint-disable-next-line no-eval
|
||||
var deprecatedfn = eval('(function (' + args + ') {\n' +
|
||||
'"use strict"\n' +
|
||||
'log.call(deprecate, message, site)\n' +
|
||||
'return fn.apply(this, arguments)\n' +
|
||||
'})')
|
||||
|
||||
return deprecatedfn
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap property in a deprecation message.
|
||||
*/
|
||||
|
||||
function wrapproperty (obj, prop, message) {
|
||||
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
throw new TypeError('argument obj must be object')
|
||||
}
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
|
||||
if (!descriptor) {
|
||||
throw new TypeError('must call property on owner object')
|
||||
}
|
||||
|
||||
if (!descriptor.configurable) {
|
||||
throw new TypeError('property must be configurable')
|
||||
}
|
||||
|
||||
var deprecate = this
|
||||
var stack = getStack()
|
||||
var site = callSiteLocation(stack[1])
|
||||
|
||||
// set site name
|
||||
site.name = prop
|
||||
|
||||
// convert data descriptor
|
||||
if ('value' in descriptor) {
|
||||
descriptor = convertDataDescriptorToAccessor(obj, prop, message)
|
||||
}
|
||||
|
||||
var get = descriptor.get
|
||||
var set = descriptor.set
|
||||
|
||||
// wrap getter
|
||||
if (typeof get === 'function') {
|
||||
descriptor.get = function getter () {
|
||||
log.call(deprecate, message, site)
|
||||
return get.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
|
||||
// wrap setter
|
||||
if (typeof set === 'function') {
|
||||
descriptor.set = function setter () {
|
||||
log.call(deprecate, message, site)
|
||||
return set.apply(this, arguments)
|
||||
}
|
||||
}
|
||||
|
||||
Object.defineProperty(obj, prop, descriptor)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create DeprecationError for deprecation
|
||||
*/
|
||||
|
||||
function DeprecationError (namespace, message, stack) {
|
||||
var error = new Error()
|
||||
var stackString
|
||||
|
||||
Object.defineProperty(error, 'constructor', {
|
||||
value: DeprecationError
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'message', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: message,
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'name', {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
value: 'DeprecationError',
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'namespace', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: namespace,
|
||||
writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(error, 'stack', {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
get: function () {
|
||||
if (stackString !== undefined) {
|
||||
return stackString
|
||||
}
|
||||
|
||||
// prepare stack trace
|
||||
return (stackString = createStackString.call(this, stack))
|
||||
},
|
||||
set: function setter (val) {
|
||||
stackString = val
|
||||
}
|
||||
})
|
||||
|
||||
return error
|
||||
}
|
||||
77
node_modules/serve-index/node_modules/depd/lib/browser/index.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = depd
|
||||
|
||||
/**
|
||||
* Create deprecate for namespace in caller.
|
||||
*/
|
||||
|
||||
function depd (namespace) {
|
||||
if (!namespace) {
|
||||
throw new TypeError('argument namespace is required')
|
||||
}
|
||||
|
||||
function deprecate (message) {
|
||||
// no-op in browser
|
||||
}
|
||||
|
||||
deprecate._file = undefined
|
||||
deprecate._ignored = true
|
||||
deprecate._namespace = namespace
|
||||
deprecate._traced = false
|
||||
deprecate._warned = Object.create(null)
|
||||
|
||||
deprecate.function = wrapfunction
|
||||
deprecate.property = wrapproperty
|
||||
|
||||
return deprecate
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a wrapped function in a deprecation message.
|
||||
*
|
||||
* This is a no-op version of the wrapper, which does nothing but call
|
||||
* validation.
|
||||
*/
|
||||
|
||||
function wrapfunction (fn, message) {
|
||||
if (typeof fn !== 'function') {
|
||||
throw new TypeError('argument fn must be a function')
|
||||
}
|
||||
|
||||
return fn
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap property in a deprecation message.
|
||||
*
|
||||
* This is a no-op version of the wrapper, which does nothing but call
|
||||
* validation.
|
||||
*/
|
||||
|
||||
function wrapproperty (obj, prop, message) {
|
||||
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
||||
throw new TypeError('argument obj must be object')
|
||||
}
|
||||
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
||||
|
||||
if (!descriptor) {
|
||||
throw new TypeError('must call property on owner object')
|
||||
}
|
||||
|
||||
if (!descriptor.configurable) {
|
||||
throw new TypeError('property must be configurable')
|
||||
}
|
||||
}
|
||||
103
node_modules/serve-index/node_modules/depd/lib/compat/callsite-tostring.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2014 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = callSiteToString
|
||||
|
||||
/**
|
||||
* Format a CallSite file location to a string.
|
||||
*/
|
||||
|
||||
function callSiteFileLocation (callSite) {
|
||||
var fileName
|
||||
var fileLocation = ''
|
||||
|
||||
if (callSite.isNative()) {
|
||||
fileLocation = 'native'
|
||||
} else if (callSite.isEval()) {
|
||||
fileName = callSite.getScriptNameOrSourceURL()
|
||||
if (!fileName) {
|
||||
fileLocation = callSite.getEvalOrigin()
|
||||
}
|
||||
} else {
|
||||
fileName = callSite.getFileName()
|
||||
}
|
||||
|
||||
if (fileName) {
|
||||
fileLocation += fileName
|
||||
|
||||
var lineNumber = callSite.getLineNumber()
|
||||
if (lineNumber != null) {
|
||||
fileLocation += ':' + lineNumber
|
||||
|
||||
var columnNumber = callSite.getColumnNumber()
|
||||
if (columnNumber) {
|
||||
fileLocation += ':' + columnNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fileLocation || 'unknown source'
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a CallSite to a string.
|
||||
*/
|
||||
|
||||
function callSiteToString (callSite) {
|
||||
var addSuffix = true
|
||||
var fileLocation = callSiteFileLocation(callSite)
|
||||
var functionName = callSite.getFunctionName()
|
||||
var isConstructor = callSite.isConstructor()
|
||||
var isMethodCall = !(callSite.isToplevel() || isConstructor)
|
||||
var line = ''
|
||||
|
||||
if (isMethodCall) {
|
||||
var methodName = callSite.getMethodName()
|
||||
var typeName = getConstructorName(callSite)
|
||||
|
||||
if (functionName) {
|
||||
if (typeName && functionName.indexOf(typeName) !== 0) {
|
||||
line += typeName + '.'
|
||||
}
|
||||
|
||||
line += functionName
|
||||
|
||||
if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) {
|
||||
line += ' [as ' + methodName + ']'
|
||||
}
|
||||
} else {
|
||||
line += typeName + '.' + (methodName || '<anonymous>')
|
||||
}
|
||||
} else if (isConstructor) {
|
||||
line += 'new ' + (functionName || '<anonymous>')
|
||||
} else if (functionName) {
|
||||
line += functionName
|
||||
} else {
|
||||
addSuffix = false
|
||||
line += fileLocation
|
||||
}
|
||||
|
||||
if (addSuffix) {
|
||||
line += ' (' + fileLocation + ')'
|
||||
}
|
||||
|
||||
return line
|
||||
}
|
||||
|
||||
/**
|
||||
* Get constructor name of reviver.
|
||||
*/
|
||||
|
||||
function getConstructorName (obj) {
|
||||
var receiver = obj.receiver
|
||||
return (receiver.constructor && receiver.constructor.name) || null
|
||||
}
|
||||
22
node_modules/serve-index/node_modules/depd/lib/compat/event-listener-count.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = eventListenerCount
|
||||
|
||||
/**
|
||||
* Get the count of listeners on an event emitter of a specific type.
|
||||
*/
|
||||
|
||||
function eventListenerCount (emitter, type) {
|
||||
return emitter.listeners(type).length
|
||||
}
|
||||
79
node_modules/serve-index/node_modules/depd/lib/compat/index.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/*!
|
||||
* depd
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var EventEmitter = require('events').EventEmitter
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
lazyProperty(module.exports, 'callSiteToString', function callSiteToString () {
|
||||
var limit = Error.stackTraceLimit
|
||||
var obj = {}
|
||||
var prep = Error.prepareStackTrace
|
||||
|
||||
function prepareObjectStackTrace (obj, stack) {
|
||||
return stack
|
||||
}
|
||||
|
||||
Error.prepareStackTrace = prepareObjectStackTrace
|
||||
Error.stackTraceLimit = 2
|
||||
|
||||
// capture the stack
|
||||
Error.captureStackTrace(obj)
|
||||
|
||||
// slice the stack
|
||||
var stack = obj.stack.slice()
|
||||
|
||||
Error.prepareStackTrace = prep
|
||||
Error.stackTraceLimit = limit
|
||||
|
||||
return stack[0].toString ? toString : require('./callsite-tostring')
|
||||
})
|
||||
|
||||
lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () {
|
||||
return EventEmitter.listenerCount || require('./event-listener-count')
|
||||
})
|
||||
|
||||
/**
|
||||
* Define a lazy property.
|
||||
*/
|
||||
|
||||
function lazyProperty (obj, prop, getter) {
|
||||
function get () {
|
||||
var val = getter()
|
||||
|
||||
Object.defineProperty(obj, prop, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value: val
|
||||
})
|
||||
|
||||
return val
|
||||
}
|
||||
|
||||
Object.defineProperty(obj, prop, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: get
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Call toString() on the obj
|
||||
*/
|
||||
|
||||
function toString (obj) {
|
||||
return obj.toString()
|
||||
}
|
||||
41
node_modules/serve-index/node_modules/depd/package.json
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "depd",
|
||||
"description": "Deprecate all the things",
|
||||
"version": "1.1.2",
|
||||
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"deprecate",
|
||||
"deprecated"
|
||||
],
|
||||
"repository": "dougwilson/nodejs-depd",
|
||||
"browser": "lib/browser/index.js",
|
||||
"devDependencies": {
|
||||
"benchmark": "2.1.4",
|
||||
"beautify-benchmark": "0.2.4",
|
||||
"eslint": "3.19.0",
|
||||
"eslint-config-standard": "7.1.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.7",
|
||||
"eslint-plugin-promise": "3.6.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "~1.21.5"
|
||||
},
|
||||
"files": [
|
||||
"lib/",
|
||||
"History.md",
|
||||
"LICENSE",
|
||||
"index.js",
|
||||
"Readme.md"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"scripts": {
|
||||
"bench": "node benchmark/index.js",
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --bail test/",
|
||||
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/"
|
||||
}
|
||||
}
|
||||
132
node_modules/serve-index/node_modules/http-errors/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
2018-03-29 / 1.6.3
|
||||
==================
|
||||
|
||||
* deps: depd@~1.1.2
|
||||
- perf: remove argument reassignment
|
||||
* deps: setprototypeof@1.1.0
|
||||
* deps: statuses@'>= 1.3.1 < 2'
|
||||
|
||||
2017-08-04 / 1.6.2
|
||||
==================
|
||||
|
||||
* deps: depd@1.1.1
|
||||
- Remove unnecessary `Buffer` loading
|
||||
|
||||
2017-02-20 / 1.6.1
|
||||
==================
|
||||
|
||||
* deps: setprototypeof@1.0.3
|
||||
- Fix shim for old browsers
|
||||
|
||||
2017-02-14 / 1.6.0
|
||||
==================
|
||||
|
||||
* Accept custom 4xx and 5xx status codes in factory
|
||||
* Add deprecation message to `"I'mateapot"` export
|
||||
* Deprecate passing status code as anything except first argument in factory
|
||||
* Deprecate using non-error status codes
|
||||
* Make `message` property enumerable for `HttpError`s
|
||||
|
||||
2016-11-16 / 1.5.1
|
||||
==================
|
||||
|
||||
* deps: inherits@2.0.3
|
||||
- Fix issue loading in browser
|
||||
* deps: setprototypeof@1.0.2
|
||||
* deps: statuses@'>= 1.3.1 < 2'
|
||||
|
||||
2016-05-18 / 1.5.0
|
||||
==================
|
||||
|
||||
* Support new code `421 Misdirected Request`
|
||||
* Use `setprototypeof` module to replace `__proto__` setting
|
||||
* deps: statuses@'>= 1.3.0 < 2'
|
||||
- Add `421 Misdirected Request`
|
||||
- perf: enable strict mode
|
||||
* perf: enable strict mode
|
||||
|
||||
2016-01-28 / 1.4.0
|
||||
==================
|
||||
|
||||
* Add `HttpError` export, for `err instanceof createError.HttpError`
|
||||
* deps: inherits@2.0.1
|
||||
* deps: statuses@'>= 1.2.1 < 2'
|
||||
- Fix message for status 451
|
||||
- Remove incorrect nginx status code
|
||||
|
||||
2015-02-02 / 1.3.1
|
||||
==================
|
||||
|
||||
* Fix regression where status can be overwritten in `createError` `props`
|
||||
|
||||
2015-02-01 / 1.3.0
|
||||
==================
|
||||
|
||||
* Construct errors using defined constructors from `createError`
|
||||
* Fix error names that are not identifiers
|
||||
- `createError["I'mateapot"]` is now `createError.ImATeapot`
|
||||
* Set a meaningful `name` property on constructed errors
|
||||
|
||||
2014-12-09 / 1.2.8
|
||||
==================
|
||||
|
||||
* Fix stack trace from exported function
|
||||
* Remove `arguments.callee` usage
|
||||
|
||||
2014-10-14 / 1.2.7
|
||||
==================
|
||||
|
||||
* Remove duplicate line
|
||||
|
||||
2014-10-02 / 1.2.6
|
||||
==================
|
||||
|
||||
* Fix `expose` to be `true` for `ClientError` constructor
|
||||
|
||||
2014-09-28 / 1.2.5
|
||||
==================
|
||||
|
||||
* deps: statuses@1
|
||||
|
||||
2014-09-21 / 1.2.4
|
||||
==================
|
||||
|
||||
* Fix dependency version to work with old `npm`s
|
||||
|
||||
2014-09-21 / 1.2.3
|
||||
==================
|
||||
|
||||
* deps: statuses@~1.1.0
|
||||
|
||||
2014-09-21 / 1.2.2
|
||||
==================
|
||||
|
||||
* Fix publish error
|
||||
|
||||
2014-09-21 / 1.2.1
|
||||
==================
|
||||
|
||||
* Support Node.js 0.6
|
||||
* Use `inherits` instead of `util`
|
||||
|
||||
2014-09-09 / 1.2.0
|
||||
==================
|
||||
|
||||
* Fix the way inheriting functions
|
||||
* Support `expose` being provided in properties argument
|
||||
|
||||
2014-09-08 / 1.1.0
|
||||
==================
|
||||
|
||||
* Default status to 500
|
||||
* Support provided `error` to extend
|
||||
|
||||
2014-09-08 / 1.0.1
|
||||
==================
|
||||
|
||||
* Fix accepting string message
|
||||
|
||||
2014-09-08 / 1.0.0
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
23
node_modules/serve-index/node_modules/http-errors/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Jonathan Ong me@jongleberry.com
|
||||
Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.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.
|
||||
135
node_modules/serve-index/node_modules/http-errors/README.md
generated
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
# http-errors
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Node.js Version][node-version-image]][node-version-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
Create HTTP errors for Express, Koa, Connect, etc. with ease.
|
||||
|
||||
## Install
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```bash
|
||||
$ npm install http-errors
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var createError = require('http-errors')
|
||||
var express = require('express')
|
||||
var app = express()
|
||||
|
||||
app.use(function (req, res, next) {
|
||||
if (!req.user) return next(createError(401, 'Please login to view this page.'))
|
||||
next()
|
||||
})
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
This is the current API, currently extracted from Koa and subject to change.
|
||||
|
||||
All errors inherit from JavaScript `Error` and the exported `createError.HttpError`.
|
||||
|
||||
### Error Properties
|
||||
|
||||
- `expose` - can be used to signal if `message` should be sent to the client,
|
||||
defaulting to `false` when `status` >= 500
|
||||
- `headers` - can be an object of header names to values to be sent to the
|
||||
client, defaulting to `undefined`. When defined, the key names should all
|
||||
be lower-cased
|
||||
- `message` - the traditional error message, which should be kept short and all
|
||||
single line
|
||||
- `status` - the status code of the error, mirroring `statusCode` for general
|
||||
compatibility
|
||||
- `statusCode` - the status code of the error, defaulting to `500`
|
||||
|
||||
### createError([status], [message], [properties])
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-vars -->
|
||||
|
||||
```js
|
||||
var err = createError(404, 'This video does not exist!')
|
||||
```
|
||||
|
||||
- `status: 500` - the status code as a number
|
||||
- `message` - the message of the error, defaulting to node's text for that status code.
|
||||
- `properties` - custom properties to attach to the object
|
||||
|
||||
### new createError\[code || name\](\[msg]\))
|
||||
|
||||
<!-- eslint-disable no-undef, no-unused-vars -->
|
||||
|
||||
```js
|
||||
var err = new createError.NotFound()
|
||||
```
|
||||
|
||||
- `code` - the status code as a number
|
||||
- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`.
|
||||
|
||||
#### List of all constructors
|
||||
|
||||
|Status Code|Constructor Name |
|
||||
|-----------|-----------------------------|
|
||||
|400 |BadRequest |
|
||||
|401 |Unauthorized |
|
||||
|402 |PaymentRequired |
|
||||
|403 |Forbidden |
|
||||
|404 |NotFound |
|
||||
|405 |MethodNotAllowed |
|
||||
|406 |NotAcceptable |
|
||||
|407 |ProxyAuthenticationRequired |
|
||||
|408 |RequestTimeout |
|
||||
|409 |Conflict |
|
||||
|410 |Gone |
|
||||
|411 |LengthRequired |
|
||||
|412 |PreconditionFailed |
|
||||
|413 |PayloadTooLarge |
|
||||
|414 |URITooLong |
|
||||
|415 |UnsupportedMediaType |
|
||||
|416 |RangeNotSatisfiable |
|
||||
|417 |ExpectationFailed |
|
||||
|418 |ImATeapot |
|
||||
|421 |MisdirectedRequest |
|
||||
|422 |UnprocessableEntity |
|
||||
|423 |Locked |
|
||||
|424 |FailedDependency |
|
||||
|425 |UnorderedCollection |
|
||||
|426 |UpgradeRequired |
|
||||
|428 |PreconditionRequired |
|
||||
|429 |TooManyRequests |
|
||||
|431 |RequestHeaderFieldsTooLarge |
|
||||
|451 |UnavailableForLegalReasons |
|
||||
|500 |InternalServerError |
|
||||
|501 |NotImplemented |
|
||||
|502 |BadGateway |
|
||||
|503 |ServiceUnavailable |
|
||||
|504 |GatewayTimeout |
|
||||
|505 |HTTPVersionNotSupported |
|
||||
|506 |VariantAlsoNegotiates |
|
||||
|507 |InsufficientStorage |
|
||||
|508 |LoopDetected |
|
||||
|509 |BandwidthLimitExceeded |
|
||||
|510 |NotExtended |
|
||||
|511 |NetworkAuthenticationRequired|
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/http-errors.svg
|
||||
[npm-url]: https://npmjs.org/package/http-errors
|
||||
[node-version-image]: https://img.shields.io/node/v/http-errors.svg
|
||||
[node-version-url]: https://nodejs.org/en/download/
|
||||
[travis-image]: https://img.shields.io/travis/jshttp/http-errors.svg
|
||||
[travis-url]: https://travis-ci.org/jshttp/http-errors
|
||||
[coveralls-image]: https://img.shields.io/coveralls/jshttp/http-errors.svg
|
||||
[coveralls-url]: https://coveralls.io/r/jshttp/http-errors
|
||||
[downloads-image]: https://img.shields.io/npm/dm/http-errors.svg
|
||||
[downloads-url]: https://npmjs.org/package/http-errors
|
||||
260
node_modules/serve-index/node_modules/http-errors/index.js
generated
vendored
Normal file
@@ -0,0 +1,260 @@
|
||||
/*!
|
||||
* http-errors
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2016 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var deprecate = require('depd')('http-errors')
|
||||
var setPrototypeOf = require('setprototypeof')
|
||||
var statuses = require('statuses')
|
||||
var inherits = require('inherits')
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = createError
|
||||
module.exports.HttpError = createHttpErrorConstructor()
|
||||
|
||||
// Populate exports for all constructors
|
||||
populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError)
|
||||
|
||||
/**
|
||||
* Get the code class of a status code.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function codeClass (status) {
|
||||
return Number(String(status).charAt(0) + '00')
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new HTTP Error.
|
||||
*
|
||||
* @returns {Error}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function createError () {
|
||||
// so much arity going on ~_~
|
||||
var err
|
||||
var msg
|
||||
var status = 500
|
||||
var props = {}
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
var arg = arguments[i]
|
||||
if (arg instanceof Error) {
|
||||
err = arg
|
||||
status = err.status || err.statusCode || status
|
||||
continue
|
||||
}
|
||||
switch (typeof arg) {
|
||||
case 'string':
|
||||
msg = arg
|
||||
break
|
||||
case 'number':
|
||||
status = arg
|
||||
if (i !== 0) {
|
||||
deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)')
|
||||
}
|
||||
break
|
||||
case 'object':
|
||||
props = arg
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof status === 'number' && (status < 400 || status >= 600)) {
|
||||
deprecate('non-error status code; use only 4xx or 5xx status codes')
|
||||
}
|
||||
|
||||
if (typeof status !== 'number' ||
|
||||
(!statuses[status] && (status < 400 || status >= 600))) {
|
||||
status = 500
|
||||
}
|
||||
|
||||
// constructor
|
||||
var HttpError = createError[status] || createError[codeClass(status)]
|
||||
|
||||
if (!err) {
|
||||
// create error
|
||||
err = HttpError
|
||||
? new HttpError(msg)
|
||||
: new Error(msg || statuses[status])
|
||||
Error.captureStackTrace(err, createError)
|
||||
}
|
||||
|
||||
if (!HttpError || !(err instanceof HttpError) || err.status !== status) {
|
||||
// add properties to generic error
|
||||
err.expose = status < 500
|
||||
err.status = err.statusCode = status
|
||||
}
|
||||
|
||||
for (var key in props) {
|
||||
if (key !== 'status' && key !== 'statusCode') {
|
||||
err[key] = props[key]
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
/**
|
||||
* Create HTTP error abstract base class.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createHttpErrorConstructor () {
|
||||
function HttpError () {
|
||||
throw new TypeError('cannot construct abstract class')
|
||||
}
|
||||
|
||||
inherits(HttpError, Error)
|
||||
|
||||
return HttpError
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a constructor for a client error.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createClientErrorConstructor (HttpError, name, code) {
|
||||
var className = name.match(/Error$/) ? name : name + 'Error'
|
||||
|
||||
function ClientError (message) {
|
||||
// create the error object
|
||||
var msg = message != null ? message : statuses[code]
|
||||
var err = new Error(msg)
|
||||
|
||||
// capture a stack trace to the construction point
|
||||
Error.captureStackTrace(err, ClientError)
|
||||
|
||||
// adjust the [[Prototype]]
|
||||
setPrototypeOf(err, ClientError.prototype)
|
||||
|
||||
// redefine the error message
|
||||
Object.defineProperty(err, 'message', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
value: msg,
|
||||
writable: true
|
||||
})
|
||||
|
||||
// redefine the error name
|
||||
Object.defineProperty(err, 'name', {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
value: className,
|
||||
writable: true
|
||||
})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
inherits(ClientError, HttpError)
|
||||
|
||||
ClientError.prototype.status = code
|
||||
ClientError.prototype.statusCode = code
|
||||
ClientError.prototype.expose = true
|
||||
|
||||
return ClientError
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a constructor for a server error.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function createServerErrorConstructor (HttpError, name, code) {
|
||||
var className = name.match(/Error$/) ? name : name + 'Error'
|
||||
|
||||
function ServerError (message) {
|
||||
// create the error object
|
||||
var msg = message != null ? message : statuses[code]
|
||||
var err = new Error(msg)
|
||||
|
||||
// capture a stack trace to the construction point
|
||||
Error.captureStackTrace(err, ServerError)
|
||||
|
||||
// adjust the [[Prototype]]
|
||||
setPrototypeOf(err, ServerError.prototype)
|
||||
|
||||
// redefine the error message
|
||||
Object.defineProperty(err, 'message', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
value: msg,
|
||||
writable: true
|
||||
})
|
||||
|
||||
// redefine the error name
|
||||
Object.defineProperty(err, 'name', {
|
||||
enumerable: false,
|
||||
configurable: true,
|
||||
value: className,
|
||||
writable: true
|
||||
})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
inherits(ServerError, HttpError)
|
||||
|
||||
ServerError.prototype.status = code
|
||||
ServerError.prototype.statusCode = code
|
||||
ServerError.prototype.expose = false
|
||||
|
||||
return ServerError
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the exports object with constructors for every error class.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function populateConstructorExports (exports, codes, HttpError) {
|
||||
codes.forEach(function forEachCode (code) {
|
||||
var CodeError
|
||||
var name = toIdentifier(statuses[code])
|
||||
|
||||
switch (codeClass(code)) {
|
||||
case 400:
|
||||
CodeError = createClientErrorConstructor(HttpError, name, code)
|
||||
break
|
||||
case 500:
|
||||
CodeError = createServerErrorConstructor(HttpError, name, code)
|
||||
break
|
||||
}
|
||||
|
||||
if (CodeError) {
|
||||
// export the constructor
|
||||
exports[code] = CodeError
|
||||
exports[name] = CodeError
|
||||
}
|
||||
})
|
||||
|
||||
// backwards-compatibility
|
||||
exports["I'mateapot"] = deprecate.function(exports.ImATeapot,
|
||||
'"I\'mateapot"; use "ImATeapot" instead')
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a string of words to a JavaScript identifier.
|
||||
* @private
|
||||
*/
|
||||
|
||||
function toIdentifier (str) {
|
||||
return str.split(' ').map(function (token) {
|
||||
return token.slice(0, 1).toUpperCase() + token.slice(1)
|
||||
}).join('').replace(/[^ _0-9a-z]/gi, '')
|
||||
}
|
||||
48
node_modules/serve-index/node_modules/http-errors/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "http-errors",
|
||||
"description": "Create HTTP error objects",
|
||||
"version": "1.6.3",
|
||||
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",
|
||||
"contributors": [
|
||||
"Alan Plum <me@pluma.io>",
|
||||
"Douglas Christopher Wilson <doug@somethingdoug.com>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"repository": "jshttp/http-errors",
|
||||
"dependencies": {
|
||||
"depd": "~1.1.2",
|
||||
"inherits": "2.0.3",
|
||||
"setprototypeof": "1.1.0",
|
||||
"statuses": ">= 1.4.0 < 2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "4.18.1",
|
||||
"eslint-config-standard": "11.0.0",
|
||||
"eslint-plugin-import": "2.9.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.6",
|
||||
"eslint-plugin-node": "6.0.1",
|
||||
"eslint-plugin-promise": "3.6.0",
|
||||
"eslint-plugin-standard": "3.0.1",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "1.21.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --bail",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
|
||||
},
|
||||
"keywords": [
|
||||
"http",
|
||||
"error"
|
||||
],
|
||||
"files": [
|
||||
"index.js",
|
||||
"HISTORY.md",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
]
|
||||
}
|
||||
16
node_modules/serve-index/node_modules/inherits/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
42
node_modules/serve-index/node_modules/inherits/README.md
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
Browser-friendly inheritance fully compatible with standard node.js
|
||||
[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
|
||||
|
||||
This package exports standard `inherits` from node.js `util` module in
|
||||
node environment, but also provides alternative browser-friendly
|
||||
implementation through [browser
|
||||
field](https://gist.github.com/shtylman/4339901). Alternative
|
||||
implementation is a literal copy of standard one located in standalone
|
||||
module to avoid requiring of `util`. It also has a shim for old
|
||||
browsers with no `Object.create` support.
|
||||
|
||||
While keeping you sure you are using standard `inherits`
|
||||
implementation in node.js environment, it allows bundlers such as
|
||||
[browserify](https://github.com/substack/node-browserify) to not
|
||||
include full `util` package to your client code if all you need is
|
||||
just `inherits` function. It worth, because browser shim for `util`
|
||||
package is large and `inherits` is often the single function you need
|
||||
from it.
|
||||
|
||||
It's recommended to use this package instead of
|
||||
`require('util').inherits` for any code that has chances to be used
|
||||
not only in node.js but in browser too.
|
||||
|
||||
## usage
|
||||
|
||||
```js
|
||||
var inherits = require('inherits');
|
||||
// then use exactly as the standard one
|
||||
```
|
||||
|
||||
## note on version ~1.0
|
||||
|
||||
Version ~1.0 had completely different motivation and is not compatible
|
||||
neither with 2.0 nor with standard node.js `inherits`.
|
||||
|
||||
If you are using version ~1.0 and planning to switch to ~2.0, be
|
||||
careful:
|
||||
|
||||
* new version uses `super_` instead of `super` for referencing
|
||||
superclass
|
||||
* new version overwrites current prototype while old one preserves any
|
||||
existing fields on it
|
||||
7
node_modules/serve-index/node_modules/inherits/inherits.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
try {
|
||||
var util = require('util');
|
||||
if (typeof util.inherits !== 'function') throw '';
|
||||
module.exports = util.inherits;
|
||||
} catch (e) {
|
||||
module.exports = require('./inherits_browser.js');
|
||||
}
|
||||
23
node_modules/serve-index/node_modules/inherits/inherits_browser.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
if (typeof Object.create === 'function') {
|
||||
// implementation from standard node.js 'util' module
|
||||
module.exports = function inherits(ctor, superCtor) {
|
||||
ctor.super_ = superCtor
|
||||
ctor.prototype = Object.create(superCtor.prototype, {
|
||||
constructor: {
|
||||
value: ctor,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
});
|
||||
};
|
||||
} else {
|
||||
// old school shim for old browsers
|
||||
module.exports = function inherits(ctor, superCtor) {
|
||||
ctor.super_ = superCtor
|
||||
var TempCtor = function () {}
|
||||
TempCtor.prototype = superCtor.prototype
|
||||
ctor.prototype = new TempCtor()
|
||||
ctor.prototype.constructor = ctor
|
||||
}
|
||||
}
|
||||
29
node_modules/serve-index/node_modules/inherits/package.json
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "inherits",
|
||||
"description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
|
||||
"version": "2.0.3",
|
||||
"keywords": [
|
||||
"inheritance",
|
||||
"class",
|
||||
"klass",
|
||||
"oop",
|
||||
"object-oriented",
|
||||
"inherits",
|
||||
"browser",
|
||||
"browserify"
|
||||
],
|
||||
"main": "./inherits.js",
|
||||
"browser": "./inherits_browser.js",
|
||||
"repository": "git://github.com/isaacs/inherits",
|
||||
"license": "ISC",
|
||||
"scripts": {
|
||||
"test": "node test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tap": "^7.1.0"
|
||||
},
|
||||
"files": [
|
||||
"inherits.js",
|
||||
"inherits_browser.js"
|
||||
]
|
||||
}
|
||||
37
node_modules/serve-index/package.json
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "serve-index",
|
||||
"description": "Serve directory listings",
|
||||
"version": "1.9.1",
|
||||
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"license": "MIT",
|
||||
"repository": "expressjs/serve-index",
|
||||
"dependencies": {
|
||||
"accepts": "~1.3.4",
|
||||
"batch": "0.6.1",
|
||||
"debug": "2.6.9",
|
||||
"escape-html": "~1.0.3",
|
||||
"http-errors": "~1.6.2",
|
||||
"mime-types": "~2.1.17",
|
||||
"parseurl": "~1.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"after": "0.8.2",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "2.5.3",
|
||||
"supertest": "1.1.0"
|
||||
},
|
||||
"files": [
|
||||
"public/",
|
||||
"LICENSE",
|
||||
"HISTORY.md",
|
||||
"index.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha --reporter spec --bail --check-leaks test/",
|
||||
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"
|
||||
}
|
||||
}
|
||||
82
node_modules/serve-index/public/directory.html
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<title>listing directory {directory}</title>
|
||||
<style>{style}</style>
|
||||
<script>
|
||||
function $(id){
|
||||
var el = 'string' == typeof id
|
||||
? document.getElementById(id)
|
||||
: id;
|
||||
|
||||
el.on = function(event, fn){
|
||||
if ('content loaded' == event) {
|
||||
event = window.attachEvent ? "load" : "DOMContentLoaded";
|
||||
}
|
||||
el.addEventListener
|
||||
? el.addEventListener(event, fn, false)
|
||||
: el.attachEvent("on" + event, fn);
|
||||
};
|
||||
|
||||
el.all = function(selector){
|
||||
return $(el.querySelectorAll(selector));
|
||||
};
|
||||
|
||||
el.each = function(fn){
|
||||
for (var i = 0, len = el.length; i < len; ++i) {
|
||||
fn($(el[i]), i);
|
||||
}
|
||||
};
|
||||
|
||||
el.getClasses = function(){
|
||||
return this.getAttribute('class').split(/\s+/);
|
||||
};
|
||||
|
||||
el.addClass = function(name){
|
||||
var classes = this.getAttribute('class');
|
||||
el.setAttribute('class', classes
|
||||
? classes + ' ' + name
|
||||
: name);
|
||||
};
|
||||
|
||||
el.removeClass = function(name){
|
||||
var classes = this.getClasses().filter(function(curr){
|
||||
return curr != name;
|
||||
});
|
||||
this.setAttribute('class', classes.join(' '));
|
||||
};
|
||||
|
||||
return el;
|
||||
}
|
||||
|
||||
function search() {
|
||||
var str = $('search').value.toLowerCase();
|
||||
var links = $('files').all('a');
|
||||
|
||||
links.each(function(link){
|
||||
var text = link.textContent.toLowerCase();
|
||||
|
||||
if ('..' == text) return;
|
||||
if (str.length && ~text.indexOf(str)) {
|
||||
link.addClass('highlight');
|
||||
} else {
|
||||
link.removeClass('highlight');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(window).on('content loaded', function(){
|
||||
$('search').on('keyup', search);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="directory">
|
||||
<input id="search" type="text" placeholder="Search" autocomplete="off" />
|
||||
<div id="wrapper">
|
||||
<h1><a href="/">~</a>{linked-path}</h1>
|
||||
{files}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
node_modules/serve-index/public/icons/application_xp.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 426 B |
BIN
node_modules/serve-index/public/icons/application_xp_terminal.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 507 B |
BIN
node_modules/serve-index/public/icons/box.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 555 B |
BIN
node_modules/serve-index/public/icons/cd.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 673 B |
BIN
node_modules/serve-index/public/icons/controller.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 666 B |
BIN
node_modules/serve-index/public/icons/drive.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 346 B |
BIN
node_modules/serve-index/public/icons/film.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 653 B |
BIN
node_modules/serve-index/public/icons/folder.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 634 B |
BIN
node_modules/serve-index/public/icons/font.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 567 B |
BIN
node_modules/serve-index/public/icons/image.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 516 B |
BIN
node_modules/serve-index/public/icons/map.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 804 B |
BIN
node_modules/serve-index/public/icons/page.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 635 B |
BIN
node_modules/serve-index/public/icons/page_add.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 739 B |
BIN
node_modules/serve-index/public/icons/page_attach.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 794 B |
BIN
node_modules/serve-index/public/icons/page_code.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 818 B |
BIN
node_modules/serve-index/public/icons/page_copy.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 663 B |
BIN
node_modules/serve-index/public/icons/page_delete.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 740 B |
BIN
node_modules/serve-index/public/icons/page_edit.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 807 B |
BIN
node_modules/serve-index/public/icons/page_error.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 793 B |
BIN
node_modules/serve-index/public/icons/page_excel.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 817 B |
BIN
node_modules/serve-index/public/icons/page_find.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 879 B |
BIN
node_modules/serve-index/public/icons/page_gear.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 833 B |
BIN
node_modules/serve-index/public/icons/page_go.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
node_modules/serve-index/public/icons/page_green.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 621 B |
BIN
node_modules/serve-index/public/icons/page_key.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 801 B |
BIN
node_modules/serve-index/public/icons/page_lightning.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 839 B |
BIN
node_modules/serve-index/public/icons/page_link.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 830 B |
BIN
node_modules/serve-index/public/icons/page_paintbrush.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 813 B |
BIN
node_modules/serve-index/public/icons/page_paste.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 703 B |
BIN
node_modules/serve-index/public/icons/page_red.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 641 B |
BIN
node_modules/serve-index/public/icons/page_refresh.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 858 B |
BIN
node_modules/serve-index/public/icons/page_save.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 774 B |
BIN
node_modules/serve-index/public/icons/page_white.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 294 B |
BIN
node_modules/serve-index/public/icons/page_white_acrobat.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 591 B |
BIN
node_modules/serve-index/public/icons/page_white_actionscript.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 664 B |
BIN
node_modules/serve-index/public/icons/page_white_add.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 512 B |
BIN
node_modules/serve-index/public/icons/page_white_c.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 587 B |
BIN
node_modules/serve-index/public/icons/page_white_camera.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 656 B |
BIN
node_modules/serve-index/public/icons/page_white_cd.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 666 B |
BIN
node_modules/serve-index/public/icons/page_white_code.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 603 B |
BIN
node_modules/serve-index/public/icons/page_white_code_red.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 587 B |
BIN
node_modules/serve-index/public/icons/page_white_coldfusion.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 592 B |
BIN
node_modules/serve-index/public/icons/page_white_compressed.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 724 B |
BIN
node_modules/serve-index/public/icons/page_white_copy.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 309 B |
BIN
node_modules/serve-index/public/icons/page_white_cplusplus.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 621 B |
BIN
node_modules/serve-index/public/icons/page_white_csharp.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 700 B |
BIN
node_modules/serve-index/public/icons/page_white_cup.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 639 B |
BIN
node_modules/serve-index/public/icons/page_white_database.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 579 B |
BIN
node_modules/serve-index/public/icons/page_white_delete.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 536 B |
BIN
node_modules/serve-index/public/icons/page_white_dvd.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 638 B |
BIN
node_modules/serve-index/public/icons/page_white_edit.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 618 B |
BIN
node_modules/serve-index/public/icons/page_white_error.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 623 B |
BIN
node_modules/serve-index/public/icons/page_white_excel.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 663 B |
BIN
node_modules/serve-index/public/icons/page_white_find.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 676 B |
BIN
node_modules/serve-index/public/icons/page_white_flash.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 582 B |
BIN
node_modules/serve-index/public/icons/page_white_freehand.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 639 B |
BIN
node_modules/serve-index/public/icons/page_white_gear.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 402 B |
BIN
node_modules/serve-index/public/icons/page_white_get.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 516 B |
BIN
node_modules/serve-index/public/icons/page_white_go.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 612 B |
BIN
node_modules/serve-index/public/icons/page_white_h.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 603 B |
BIN
node_modules/serve-index/public/icons/page_white_horizontal.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 296 B |
BIN
node_modules/serve-index/public/icons/page_white_key.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 616 B |
BIN
node_modules/serve-index/public/icons/page_white_lightning.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 669 B |
BIN
node_modules/serve-index/public/icons/page_white_link.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 614 B |
BIN
node_modules/serve-index/public/icons/page_white_magnify.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 554 B |
BIN
node_modules/serve-index/public/icons/page_white_medal.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 706 B |
BIN
node_modules/serve-index/public/icons/page_white_office.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
node_modules/serve-index/public/icons/page_white_paint.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 688 B |
BIN
node_modules/serve-index/public/icons/page_white_paintbrush.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 618 B |
BIN
node_modules/serve-index/public/icons/page_white_paste.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 620 B |
BIN
node_modules/serve-index/public/icons/page_white_php.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 538 B |
BIN
node_modules/serve-index/public/icons/page_white_picture.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 650 B |
BIN
node_modules/serve-index/public/icons/page_white_powerpoint.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 588 B |
BIN
node_modules/serve-index/public/icons/page_white_put.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 523 B |
BIN
node_modules/serve-index/public/icons/page_white_ruby.png
generated
vendored
Normal file
|
After Width: | Height: | Size: 626 B |