aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser')
-rw-r--r--common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/HISTORY.md51
-rw-r--r--common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/LICENSE23
-rw-r--r--common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/README.md75
-rw-r--r--common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/index.js158
-rw-r--r--common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/package.json98
5 files changed, 405 insertions, 0 deletions
diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/HISTORY.md b/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/HISTORY.md
new file mode 100644
index 00000000..5e01eef4
--- /dev/null
+++ b/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/HISTORY.md
@@ -0,0 +1,51 @@
+1.2.0 / 2016-06-01
+==================
+
+ * Add `combine` option to combine overlapping ranges
+
+1.1.0 / 2016-05-13
+==================
+
+ * Fix incorrectly returning -1 when there is at least one valid range
+ * perf: remove internal function
+
+1.0.3 / 2015-10-29
+==================
+
+ * perf: enable strict mode
+
+1.0.2 / 2014-09-08
+==================
+
+ * Support Node.js 0.6
+
+1.0.1 / 2014-09-07
+==================
+
+ * Move repository to jshttp
+
+1.0.0 / 2013-12-11
+==================
+
+ * Add repository to package.json
+ * Add MIT license
+
+0.0.4 / 2012-06-17
+==================
+
+ * Change ret -1 for unsatisfiable and -2 when invalid
+
+0.0.3 / 2012-06-17
+==================
+
+ * Fix last-byte-pos default to len - 1
+
+0.0.2 / 2012-06-14
+==================
+
+ * Add `.type`
+
+0.0.1 / 2012-06-11
+==================
+
+ * Initial release
diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/LICENSE b/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/LICENSE
new file mode 100644
index 00000000..35999543
--- /dev/null
+++ b/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/LICENSE
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2012-2014 TJ Holowaychuk <tj@vision-media.ca>
+Copyright (c) 2015-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.
diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/README.md b/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/README.md
new file mode 100644
index 00000000..1b243759
--- /dev/null
+++ b/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/README.md
@@ -0,0 +1,75 @@
+# range-parser
+
+[![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]
+
+Range header field parser.
+
+## Installation
+
+```
+$ npm install range-parser
+```
+
+## API
+
+```js
+var parseRange = require('range-parser')
+```
+
+### parseRange(size, header, options)
+
+Parse the given `header` string where `size` is the maximum size of the resource.
+An array of ranges will be returned or negative numbers indicating an error parsing.
+
+ * `-2` signals a malformed header string
+ * `-1` signals an unsatisfiable range
+
+```js
+// parse header from request
+var range = parseRange(size, req.headers.range)
+
+// the type of the range
+if (range.type === 'bytes') {
+ // the ranges
+ range.forEach(function (r) {
+ // do something with r.start and r.end
+ })
+}
+```
+
+#### Options
+
+These properties are accepted in the options object.
+
+##### combine
+
+Specifies if overlapping & adjacent ranges should be combined, defaults to `false`.
+When `true`, ranges will be combined and returned as if they were specified that
+way in the header.
+
+```js
+parseRange(100, 'bytes=50-55,0-10,5-10,56-60', { combine: true })
+// => [
+// { start: 0, end: 10 },
+// { start: 50, end: 60 }
+// ]
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/range-parser.svg
+[npm-url]: https://npmjs.org/package/range-parser
+[node-version-image]: https://img.shields.io/node/v/range-parser.svg
+[node-version-url]: https://nodejs.org/endownload
+[travis-image]: https://img.shields.io/travis/jshttp/range-parser.svg
+[travis-url]: https://travis-ci.org/jshttp/range-parser
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/range-parser.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/range-parser
+[downloads-image]: https://img.shields.io/npm/dm/range-parser.svg
+[downloads-url]: https://npmjs.org/package/range-parser
diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/index.js b/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/index.js
new file mode 100644
index 00000000..83b2eb6b
--- /dev/null
+++ b/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/index.js
@@ -0,0 +1,158 @@
+/*!
+ * range-parser
+ * Copyright(c) 2012-2014 TJ Holowaychuk
+ * Copyright(c) 2015-2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = rangeParser
+
+/**
+ * Parse "Range" header `str` relative to the given file `size`.
+ *
+ * @param {Number} size
+ * @param {String} str
+ * @param {Object} [options]
+ * @return {Array}
+ * @public
+ */
+
+function rangeParser (size, str, options) {
+ var index = str.indexOf('=')
+
+ if (index === -1) {
+ return -2
+ }
+
+ // split the range string
+ var arr = str.slice(index + 1).split(',')
+ var ranges = []
+
+ // add ranges type
+ ranges.type = str.slice(0, index)
+
+ // parse all ranges
+ for (var i = 0; i < arr.length; i++) {
+ var range = arr[i].split('-')
+ var start = parseInt(range[0], 10)
+ var end = parseInt(range[1], 10)
+
+ // -nnn
+ if (isNaN(start)) {
+ start = size - end
+ end = size - 1
+ // nnn-
+ } else if (isNaN(end)) {
+ end = size - 1
+ }
+
+ // limit last-byte-pos to current length
+ if (end > size - 1) {
+ end = size - 1
+ }
+
+ // invalid or unsatisifiable
+ if (isNaN(start) || isNaN(end) || start > end || start < 0) {
+ continue
+ }
+
+ // add range
+ ranges.push({
+ start: start,
+ end: end
+ })
+ }
+
+ if (ranges.length < 1) {
+ // unsatisifiable
+ return -1
+ }
+
+ return options && options.combine
+ ? combineRanges(ranges)
+ : ranges
+}
+
+/**
+ * Combine overlapping & adjacent ranges.
+ * @private
+ */
+
+function combineRanges (ranges) {
+ var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart)
+
+ for (var j = 0, i = 1; i < ordered.length; i++) {
+ var range = ordered[i]
+ var current = ordered[j]
+
+ if (range.start > current.end + 1) {
+ // next range
+ ordered[++j] = range
+ } else if (range.end > current.end) {
+ // extend range
+ current.end = range.end
+ current.index = Math.min(current.index, range.index)
+ }
+ }
+
+ // trim ordered array
+ ordered.length = j + 1
+
+ // generate combined range
+ var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex)
+
+ // copy ranges type
+ combined.type = ranges.type
+
+ return combined
+}
+
+/**
+ * Map function to add index value to ranges.
+ * @private
+ */
+
+function mapWithIndex (range, index) {
+ return {
+ start: range.start,
+ end: range.end,
+ index: index
+ }
+}
+
+/**
+ * Map function to remove index value from ranges.
+ * @private
+ */
+
+function mapWithoutIndex (range) {
+ return {
+ start: range.start,
+ end: range.end
+ }
+}
+
+/**
+ * Sort function to sort ranges by index.
+ * @private
+ */
+
+function sortByRangeIndex (a, b) {
+ return a.index - b.index
+}
+
+/**
+ * Sort function to sort ranges by start position.
+ * @private
+ */
+
+function sortByRangeStart (a, b) {
+ return a.start - b.start
+}
diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/package.json b/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/package.json
new file mode 100644
index 00000000..d7e8deaf
--- /dev/null
+++ b/common/src/main/webapp/usageguide/appserver/node_modules/express/node_modules/range-parser/package.json
@@ -0,0 +1,98 @@
+{
+ "name": "range-parser",
+ "author": {
+ "name": "TJ Holowaychuk",
+ "email": "tj@vision-media.ca",
+ "url": "http://tjholowaychuk.com"
+ },
+ "description": "Range header field string parser",
+ "version": "1.2.0",
+ "contributors": [
+ {
+ "name": "Douglas Christopher Wilson",
+ "email": "doug@somethingdoug.com"
+ },
+ {
+ "name": "James Wyatt Cready",
+ "email": "wyatt.cready@lanetix.com"
+ },
+ {
+ "name": "Jonathan Ong",
+ "email": "me@jongleberry.com",
+ "url": "http://jongleberry.com"
+ }
+ ],
+ "license": "MIT",
+ "keywords": [
+ "range",
+ "parser",
+ "http"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/jshttp/range-parser"
+ },
+ "devDependencies": {
+ "eslint": "2.11.1",
+ "eslint-config-standard": "5.3.1",
+ "eslint-plugin-promise": "1.1.0",
+ "eslint-plugin-standard": "1.3.2",
+ "istanbul": "0.4.3",
+ "mocha": "1.21.5"
+ },
+ "files": [
+ "HISTORY.md",
+ "LICENSE",
+ "index.js"
+ ],
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "scripts": {
+ "lint": "eslint **/*.js",
+ "test": "mocha --reporter spec",
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
+ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
+ },
+ "gitHead": "0665aca31639d799dee1d35fb10970799559ec48",
+ "bugs": {
+ "url": "https://github.com/jshttp/range-parser/issues"
+ },
+ "homepage": "https://github.com/jshttp/range-parser",
+ "_id": "range-parser@1.2.0",
+ "_shasum": "f49be6b487894ddc40dcc94a322f611092e00d5e",
+ "_from": "range-parser@>=1.2.0 <1.3.0",
+ "_npmVersion": "1.4.28",
+ "_npmUser": {
+ "name": "dougwilson",
+ "email": "doug@somethingdoug.com"
+ },
+ "maintainers": [
+ {
+ "name": "dougwilson",
+ "email": "doug@somethingdoug.com"
+ },
+ {
+ "name": "jonathanong",
+ "email": "jonathanrichardong@gmail.com"
+ },
+ {
+ "name": "jongleberry",
+ "email": "jonathanrichardong@gmail.com"
+ },
+ {
+ "name": "tjholowaychuk",
+ "email": "tj@vision-media.ca"
+ }
+ ],
+ "dist": {
+ "shasum": "f49be6b487894ddc40dcc94a322f611092e00d5e",
+ "tarball": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz"
+ },
+ "_npmOperationalInternal": {
+ "host": "packages-16-east.internal.npmjs.com",
+ "tmp": "tmp/range-parser-1.2.0.tgz_1464803293097_0.6830497414339334"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz"
+}