diff options
author | Kat Marchán <kzm@zkat.tech> | 2018-12-12 00:50:24 +0300 |
---|---|---|
committer | Kat Marchán <kzm@zkat.tech> | 2018-12-12 00:53:00 +0300 |
commit | 569491b8042f939dc13986b6adb2a0a260f95b63 (patch) | |
tree | 5126a2468a6149b4f3c0c650c5889adf031a77e0 /node_modules | |
parent | ae936f22ce80614287f2769e9aaa9a155f03cc15 (diff) |
licensee@5.0.0
Diffstat (limited to 'node_modules')
70 files changed, 0 insertions, 8003 deletions
diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp deleted file mode 120000 index 017896ceb..000000000 --- a/node_modules/.bin/mkdirp +++ /dev/null @@ -1 +0,0 @@ -../mkdirp/bin/cmd.js
\ No newline at end of file diff --git a/node_modules/.bin/nopt b/node_modules/.bin/nopt deleted file mode 120000 index 6b6566ea7..000000000 --- a/node_modules/.bin/nopt +++ /dev/null @@ -1 +0,0 @@ -../nopt/bin/nopt.js
\ No newline at end of file diff --git a/node_modules/.bin/opener b/node_modules/.bin/opener deleted file mode 120000 index 891b847f9..000000000 --- a/node_modules/.bin/opener +++ /dev/null @@ -1 +0,0 @@ -../opener/bin/opener-bin.js
\ No newline at end of file diff --git a/node_modules/.bin/rimraf b/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a49d..000000000 --- a/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js
\ No newline at end of file diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver deleted file mode 120000 index 317eb293d..000000000 --- a/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver
\ No newline at end of file diff --git a/node_modules/.bin/which b/node_modules/.bin/which deleted file mode 120000 index f62471c85..000000000 --- a/node_modules/.bin/which +++ /dev/null @@ -1 +0,0 @@ -../which/bin/which
\ No newline at end of file diff --git a/node_modules/.gitignore b/node_modules/.gitignore index ab6f39da1..196f8f120 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -84,7 +84,6 @@ /function-loop /functional-red-black-tree /get-stdin -/get-stream /globals /globby /has diff --git a/node_modules/array-find-index/index.js b/node_modules/array-find-index/index.js deleted file mode 100644 index e2dcd9a09..000000000 --- a/node_modules/array-find-index/index.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; -module.exports = function (arr, predicate, ctx) { - if (typeof Array.prototype.findIndex === 'function') { - return arr.findIndex(predicate, ctx); - } - - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } - - var list = Object(arr); - var len = list.length; - - if (len === 0) { - return -1; - } - - for (var i = 0; i < len; i++) { - if (predicate.call(ctx, list[i], i, list)) { - return i; - } - } - - return -1; -}; diff --git a/node_modules/array-find-index/license b/node_modules/array-find-index/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/array-find-index/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/node_modules/array-find-index/package.json b/node_modules/array-find-index/package.json deleted file mode 100644 index 5c210da93..000000000 --- a/node_modules/array-find-index/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_args": [ - [ - "array-find-index@1.0.2", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_development": true, - "_from": "array-find-index@1.0.2", - "_id": "array-find-index@1.0.2", - "_inBundle": false, - "_integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "_location": "/array-find-index", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "array-find-index@1.0.2", - "name": "array-find-index", - "escapedName": "array-find-index", - "rawSpec": "1.0.2", - "saveSpec": null, - "fetchSpec": "1.0.2" - }, - "_requiredBy": [ - "/spdx-compare" - ], - "_resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "_spec": "1.0.2", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/array-find-index/issues" - }, - "description": "ES2015 `Array#findIndex()` ponyfill", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/array-find-index#readme", - "keywords": [ - "es2015", - "ponyfill", - "polyfill", - "shim", - "find", - "index", - "findindex", - "array" - ], - "license": "MIT", - "name": "array-find-index", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/array-find-index.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.2" -} diff --git a/node_modules/array-find-index/readme.md b/node_modules/array-find-index/readme.md deleted file mode 100644 index 31663411c..000000000 --- a/node_modules/array-find-index/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -# array-find-index [![Build Status](https://travis-ci.org/sindresorhus/array-find-index.svg?branch=master)](https://travis-ci.org/sindresorhus/array-find-index) - -> ES2015 [`Array#findIndex()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) [ponyfill](https://ponyfill.com) - - -## Install - -``` -$ npm install --save array-find-index -``` - - -## Usage - -```js -const arrayFindIndex = require('array-find-index'); - -arrayFindIndex(['rainbow', 'unicorn', 'pony'], x => x === 'unicorn'); -//=> 1 -``` - - -## API - -Same as `Array#findIndex()`, but with the input array as the first argument. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/docopt/.editorconfig b/node_modules/docopt/.editorconfig deleted file mode 100644 index 2ac4f2e33..000000000 --- a/node_modules/docopt/.editorconfig +++ /dev/null @@ -1,11 +0,0 @@ -# editorconfig.org - -root = true - -[package.json] -indent_style = space -indent_size = 2 - -[*.coffee] -indent_style = space -indent_size = 4 diff --git a/node_modules/docopt/.npmignore b/node_modules/docopt/.npmignore deleted file mode 100644 index 5bdd25d69..000000000 --- a/node_modules/docopt/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -language_agnostic_tests -examples diff --git a/node_modules/docopt/.travis.yml b/node_modules/docopt/.travis.yml deleted file mode 100644 index 32c3c455c..000000000 --- a/node_modules/docopt/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -sudo: false -node_js: - - "0.12" - - "0.11" - - "0.10" - - "iojs" -script: - - npm run test - - npm run lint -notifications: - email: false diff --git a/node_modules/docopt/LICENSE-MIT b/node_modules/docopt/LICENSE-MIT deleted file mode 100644 index a063aa7b8..000000000 --- a/node_modules/docopt/LICENSE-MIT +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2012 Vladimir Keleshev, <vladimir@keleshev.com> - Andrew Kassen, <atkassen@berkeley.edu> - -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/node_modules/docopt/README.md b/node_modules/docopt/README.md deleted file mode 100644 index bbcf584db..000000000 --- a/node_modules/docopt/README.md +++ /dev/null @@ -1,99 +0,0 @@ -`docopt` – a command line option parser that will make you smile [![Build Status](https://travis-ci.org/stuartcarnie/docopt.coffee.svg)](https://travis-ci.org/stuartcarnie/docopt.coffee) -=============================================================== - -> [docopt](http://docopt.org) is a language for description of command-line -> interfaces. This is `docopt` implementation in CoffeeScript, that could -> be used for server-side CoffeeScript and JavaScript programs. - -Isn't it awesome how modern command-line arguments parsers generate -help message based on your code?! - -**Hell no!** You know what's awesome? When the option parser *is* generated -based on the help message that you write yourself! This way you don't need to -write this stupid repeatable parser-code, and instead can write a beautiful -help message (the way you want it!), which adds readability to your code. - -Now you can write an awesome, readable, clean, DRY code like *this*: - -```coffeescript -doc = """ -Usage: - quick_example.coffee tcp <host> <port> [--timeout=<seconds>] - quick_example.coffee serial <port> [--baud=9600] [--timeout=<seconds>] - quick_example.coffee -h | --help | --version - -""" -{docopt} = require '../docopt' - -console.log docopt(doc, version: '0.1.1rc') -``` - -Hell yeah! The option parser is generated based on `doc` string above, that you -pass to the `docopt` function. - - - -API `{docopt} = require 'docopt'` ---------------------------------- - -### `options = docopt(doc, {argv: process.argv[2..], help: true, version: null, options_first: false, exit: true})` - -`docopt` takes 1 required argument, and 3 optional keyword arguments: - -* `doc` (required) should be a string with the help message, written according -to rules of the [docopt language](http://docopt.org). Here's a quick example: - - ```bash - Usage: your_program [options] - - -h --help Show this. - -v --verbose Print more text. - --quiet Print less text. - -o FILE Specify output file [default: ./test.txt]. - ``` - -* `argv` is an optional argument vector. It defaults to the arguments passed -to your program (`process.argv[2..]`). You can also supply it with an array -of strings, as with `process.argv`. For example: `['--verbose', '-o', 'hai.txt']`. - -* `help` (default:`true`) specifies whether the parser should automatically -print the help message (supplied as `doc`) in case `-h` or `--help` options -are encountered. After showing the usage-message, the program will terminate. -If you want to handle `-h` or `--help` options manually (the same as other options), -set `help=false`. - -* `version` (default:`null`) is an optional argument that specifies the -version of your program. If supplied, then, if the parser encounters -`--version` option, it will print the supplied version and terminate. -`version` could be any printable object, but most likely a string, -e.g. `'2.1.0rc1'`. - -* `options_first`, by default `false`. If set to `true` will -disallow mixing options and positional argument. I.e. after first -positional argument, all arguments will be interpreted as positional -even if the look like options. This can be used for strict -compatibility with POSIX, or if you want to dispatch your arguments -to other programs. - -* `exit`, by default `true`. If set to `false` will -cause docopt to throw exceptions instead of printing the error to console and terminating the application. -This flag is mainly for testing purposes. - -**Note:** Although `docopt` automatically handles `-h`, `--help` and `--version` options, -you still need to mention them in the options description (`doc`) for your users to -know about them. - -The **return** value is an `Object` with properties (giving long options precedence), -like this: - -```javascript -{'--timeout': '10', - '--baud': '4800', - '--version': false, - '--help': false, - '-h': false, - serial: true, - tcp: false, - '<host>': false, - '<port>': '/dev/ttyr01'} -``` diff --git a/node_modules/docopt/coffeelint.json b/node_modules/docopt/coffeelint.json deleted file mode 100644 index 99eba6981..000000000 --- a/node_modules/docopt/coffeelint.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "arrow_spacing": { - "level": "ignore" - }, - "braces_spacing": { - "level": "ignore", - "spaces": 0 - }, - "camel_case_classes": { - "level": "error" - }, - "coffeescript_error": { - "level": "error" - }, - "colon_assignment_spacing": { - "level": "ignore", - "spacing": { - "left": 0, - "right": 0 - } - }, - "cyclomatic_complexity": { - "value": 10, - "level": "ignore" - }, - "duplicate_key": { - "level": "error" - }, - "empty_constructor_needs_parens": { - "level": "ignore" - }, - "ensure_comprehensions": { - "level": "warn" - }, - "indentation": { - "value": 4, - "level": "error" - }, - "line_endings": { - "level": "ignore", - "value": "unix" - }, - "max_line_length": { - "value": 80, - "level": "ignore", - "limitComments": true - }, - "missing_fat_arrows": { - "level": "ignore" - }, - "newlines_after_classes": { - "value": 3, - "level": "ignore" - }, - "no_backticks": { - "level": "error" - }, - "no_debugger": { - "level": "warn" - }, - "no_empty_functions": { - "level": "ignore" - }, - "no_empty_param_list": { - "level": "ignore" - }, - "no_implicit_braces": { - "level": "ignore", - "strict": true - }, - "no_implicit_parens": { - "strict": true, - "level": "ignore" - }, - "no_interpolation_in_single_quotes": { - "level": "ignore" - }, - "no_plusplus": { - "level": "ignore" - }, - "no_stand_alone_at": { - "level": "ignore" - }, - "no_tabs": { - "level": "error" - }, - "no_throwing_strings": { - "level": "error" - }, - "no_trailing_semicolons": { - "level": "error" - }, - "no_trailing_whitespace": { - "level": "error", - "allowed_in_comments": false, - "allowed_in_empty_lines": true - }, - "no_unnecessary_double_quotes": { - "level": "ignore" - }, - "no_unnecessary_fat_arrows": { - "level": "warn" - }, - "non_empty_constructor_needs_parens": { - "level": "ignore" - }, - "prefer_english_operator": { - "level": "ignore", - "doubleNotLevel": "ignore" - }, - "space_operators": { - "level": "ignore" - }, - "spacing_after_comma": { - "level": "ignore" - }, - "transform_messes_up_line_numbers": { - "level": "warn" - } -} diff --git a/node_modules/docopt/docopt.coffee b/node_modules/docopt/docopt.coffee deleted file mode 100644 index 89aceea17..000000000 --- a/node_modules/docopt/docopt.coffee +++ /dev/null @@ -1,588 +0,0 @@ -print = -> console.log [].join.call arguments, ' ' - -enumerate = (array) -> - i = 0 - ([i++, item] for item in array) - -any = (array) -> - return true in array - -zip = (args...) -> - lengthArray = (arr.length for arr in args) - length = Math.min(lengthArray...) - for i in [0...length] - arr[i] for arr in args - -String::partition = (separator) -> - self = this - if self.indexOf(separator) >= 0 - parts = self.split(separator) - return [parts[0], separator, parts.slice(1).join(separator)] - else - return [String(self), '', ''] - -String::startsWith = (searchString, position) -> - position = position || 0 - return this.lastIndexOf(searchString, position) == position - -String::endsWith = (searchString, position) -> - subjectString = this.toString() - if (position == undefined || position > subjectString.length) - position = subjectString.length - position -= searchString.length - lastIndex = subjectString.indexOf(searchString, position) - return lastIndex != -1 && lastIndex == position - -String::_split = -> - this.trim().split(/\s+/).filter (i) -> i != '' - -String::isUpper = -> - /^[A-Z]+$/g.exec(this) - -Number.isInteger = Number.isInteger || (value) -> - return typeof value == "number" && - isFinite(value) && - Math.floor(value) == value - -class DocoptLanguageError extends Error - constructor: (@message) -> - super @message - -class DocoptExit extends Error - constructor: (@message) -> - super @message - -class Pattern extends Object - - fix: -> - @fix_identities() - @fix_repeating_arguments() - @ - - fix_identities: (uniq=null) -> - """Make pattern-tree tips point to same object if they are equal.""" - - if not @hasOwnProperty 'children' then return @ - if uniq is null - [uniq, flat] = [{}, @flat()] - uniq[k] = k for k in flat - - for [i, c] in enumerate(@children) - if not c.hasOwnProperty 'children' - console.assert(uniq.hasOwnProperty(c)) - @children[i] = uniq[c] - else - c.fix_identities uniq - @ - - fix_repeating_arguments: -> - """Fix elements that should accumulate/increment values.""" - - either = (child.children for child in transform(@).children) - for mycase in either - counts = {} - for c in mycase - counts[c] = (if counts[c] then counts[c] else 0) + 1 - for e in (child for child in mycase when counts[child] > 1) - if e.constructor is Argument or e.constructor is Option and e.argcount - if e.value is null - e.value = [] - else if e.value.constructor isnt Array - e.value = e.value._split() - if e.constructor is Command or e.constructor is Option and e.argcount == 0 - e.value = 0 - @ - - -transform = (pattern) -> - """Expand pattern into an (almost) equivalent one, but with single Either. - - Example: ((-a | -b) (-c | -d)) => (-a -c | -a -d | -b -c | -b -d) - Quirks: [-a] => (-a), (-a...) => (-a -a) - - """ - result = [] - groups = [[pattern]] - while groups.length - children = groups.shift() - parents = [Required, Optional, OptionsShortcut, Either, OneOrMore] - if (any((t in (children.map (c) -> c.constructor)) for t in parents)) - child = (c for c in children when c.constructor in parents)[0] - index = children.indexOf(child) - if index >= 0 - children.splice(index, 1) - if child.constructor is Either - for c in child.children - groups.push([c].concat children) - else if child.constructor is OneOrMore - groups.push((child.children.concat(child.children)).concat children) - else - groups.push(child.children.concat children) - else - result.push(children) - - return new Either(new Required e for e in result) - - -class LeafPattern extends Pattern - """Leaf/terminal node of a pattern tree.""" - - constructor: (@name, @value=null) -> - - toString: -> "#{@.constructor.name}(#{@name}, #{@value})" - - flat: (types=[]) -> - types = if types instanceof Array then types else [types] - if not types.length or @.constructor in types - return [@] - else return [] - - match: (left, collected=null) -> - collected = [] if collected is null - [pos, match] = @.singleMatch left - if match is null - return [false, left, collected] - left_ = left.slice(0, pos).concat(left.slice(pos + 1)) - same_name = (a for a in collected when a.name == @.name) - if Number.isInteger(@value) or @value instanceof Array - if Number.isInteger(@value) - increment = 1 - else - increment = if typeof match.value == 'string' then [match.value] else match.value - if not same_name.length - match.value = increment - return [true, left_, collected.concat(match)] - if Number.isInteger(@value) - same_name[0].value += increment - else - same_name[0].value = [].concat(same_name[0].value, increment) - return [true, left_, collected] - return [true, left_, collected.concat(match)] - - -class BranchPattern extends Pattern - """Branch/inner node of a pattern tree.""" - - constructor: (children) -> - @children = if children instanceof Array then children else [children] - - toString: -> "#{@.constructor.name}(#{(a for a in @children).join(', ')})" - - flat: (types=[]) -> - types = if types instanceof Array then types else [types] - if @.constructor in types then return [@] - return (child.flat(types) for child in @children when child instanceof Pattern).reduce(((pv, cv) -> return [].concat pv, cv), []) - - -class Argument extends LeafPattern - - singleMatch: (left) -> - for [n, pattern] in enumerate(left) - if pattern.constructor is Argument - return [n, new Argument(@name, pattern.value)] - return [null, null] - - @parse: (source) -> - name = /(<\S*?>)/ig.exec(source)[1] - value = /\[default:\s+(.*)\]/ig.exec(source) - return new Argument(name, if value then value[1] else null) - - -class Command extends Argument - - constructor: (@name, @value=false) -> - - singleMatch: (left) -> - for [n, pattern] in enumerate(left) - if pattern.constructor is Argument - if pattern.value == @name - return [n, new Command(@name, true)] - else - break - return [null, null] - -class Option extends LeafPattern - - constructor: (@short=null, @long=null, @argcount=0, value=false) -> - console.assert(@argcount in [0,1]) - @value = if value is false and @argcount > 0 then null else value - @name = @long or @short - - toString: -> "Option(#{@short}, #{@long}, #{@argcount}, #{@value})" - - @parse: (option_description) -> - [short, long, argcount, value] = [null, null, 0, false] - [options, _, description] = option_description.trim().partition(' ') - options = options.replace /,|=/g, ' ' - for s in options._split() # split on spaces - if s.startsWith('--') - long = s - else if s.startsWith('-') - short = s - else - argcount = 1 - if argcount > 0 - matched = /\[default:\s+(.*)\]/ig.exec(description) - value = if matched then matched[1] else null - new Option short, long, argcount, value - - singleMatch: (left) -> - for [n, pattern] in enumerate(left) - if @name == pattern.name - return [n, pattern] - return [null, null] - - -class Required extends BranchPattern - - match: (left, collected=null) -> - collected = [] if collected is null - l = left #copy(left) - c = collected #copy(collected) - for p in @children - [matched, l, c] = p.match(l, c) - if not matched - return [false, left, collected] - [true, l, c] - - -class Optional extends BranchPattern - - match: (left, collected=null) -> - collected = [] if collected is null - #left = copy(left) - for p in @children - [m, left, collected] = p.match(left, collected) - [true, left, collected] - - -class OptionsShortcut extends Optional - """Marker/placeholder for [options] shortcut.""" - - -class OneOrMore extends BranchPattern - - match: (left, collected=null) -> - console.assert(@children.length == 1) - collected = [] if collected is null - l = left #copy(left) - c = collected #copy(collected) - l_ = [] - matched = true - times = 0 - while matched - # could it be that something didn't match but changed l or c? - [matched, l, c] = @children[0].match(l, c) - times += if matched then 1 else 0 - if l_.join(', ') == l.join(', ') then break - l_ = l #copy(l) - if times >= 1 then return [true, l, c] - [false, left, collected] - - -class Either extends BranchPattern - - match: (left, collected=null) -> - collected = [] if collected is null - outcomes = [] - for p in @children - outcome = p.match(left, collected) - if outcome[0] then outcomes.push(outcome) - if outcomes.length > 0 - outcomes.sort((a,b) -> - if a[1].length > b[1].length - 1 - else if a[1].length < b[1].length - -1 - else - 0) - return outcomes[0] - [false, left, collected] - - -# same as Tokens in python -class Tokens extends Array - - constructor: (source, @error=DocoptExit) -> - stream = if source.constructor is String then source._split() else source - @push.apply @, stream - - move: -> if @.length then [].shift.apply(@) else null - - current: -> if @.length then @[0] else null - - @from_pattern: (source) -> - source = source.replace(/([\[\]\(\)\|]|\.\.\.)/g, ' $1 ') - source = (s for s in source.split(/\s+|(\S*<.*?>)/) when s) - return new Tokens source, DocoptLanguageError - - -parse_section = (name, source) -> - matches = source.match new RegExp('^([^\n]*' + name + '[^\n]*\n?(?:[ \t].*?(?:\n|$))*)', 'igm') - if matches - return (s.trim() for s in matches) - return [] - - -parse_shorts = (tokens, options) -> - """shorts ::= '-' ( chars )* [ [ ' ' ] chars ] ;""" - token = tokens.move() - console.assert token.startsWith('-') and not token.startsWith('--') - left = token.replace(/^-+/g, '') - parsed = [] - while left != '' - [short, left] = ['-' + left[0], left[1..]] - similar = (o for o in options when o.short == short) - if similar.length > 1 - throw new tokens.error("#{short} is specified ambiguously #{similar.length} times") - else if similar.length < 1 - o = new Option(short, null, 0) - options.push(o) - if tokens.error is DocoptExit - o = new Option(short, null, 0, true) - else # why copying is necessary here? - o = new Option(short, similar[0].long, similar[0].argcount, similar[0].value) - value = null - if o.argcount != 0 - if left == '' - if tokens.current() in [null, '--'] - throw new tokens.error("#{short} requires argument") - value = tokens.move() - else - value = left - left = '' - if tokens.error is DocoptExit - o.value = if value isnt null then value else true - parsed.push(o) - return parsed - - -parse_long = (tokens, options) -> - """long ::= '--' chars [ ( ' ' | '=' ) chars ] ;""" - [long, eq, value] = tokens.move().partition('=') - console.assert long.startsWith('--') - value = null if (eq == value and value == '') - similar = (o for o in options when o.long == long) - if tokens.error is DocoptExit and similar.length == 0 # if no exact match - similar = (o for o in options when o.long and o.long.startsWith(long)) - if similar.length > 1 # might be simply specified ambiguously 2+ times? - longs = (o.long for o in similar).join(', ') - throw new tokens.error("#{long} is not a unique prefix: #{longs}?") - else if similar.length < 1 - argcount = if (eq == '=') then 1 else 0 - o = new Option(null, long, argcount) - options.push(o) - if tokens.error is DocoptExit - o = new Option(null, long, argcount, if argcount > 0 then value else true) - else - o = new Option(similar[0].short, similar[0].long, similar[0].argcount, similar[0].value) - if o.argcount == 0 - if value isnt null - throw new tokens.error("#{o.long} must not have an argument") - else - if value is null - if tokens.current() in [null, '--'] - throw new tokens.error("#{o.long} requires argument") - value = tokens.move() - if tokens.error is DocoptExit - o.value = if value isnt null then value else true - return [o] - - -parse_pattern = (source, options) -> - tokens = Tokens.from_pattern source - result = parse_expr tokens, options - if tokens.current() isnt null - throw new tokens.error 'unexpected ending: ' + (tokens.join ' ') - new Required result - - -parse_expr = (tokens, options) -> - """expr ::= seq ( '|' seq )* ;""" - seq = parse_seq tokens, options - - if tokens.current() != '|' - return seq - - result = if seq.length > 1 then [new Required seq] else seq - while tokens.current() is '|' - tokens.move() - seq = parse_seq tokens, options - result = result.concat(if seq.length > 1 then [new Required seq] else seq) - - return if result.length > 1 then [new Either result] else result - - -parse_seq = (tokens, options) -> - """seq ::= ( atom [ '...' ] )* ;""" - - result = [] - while tokens.current() not in [null, ']', ')', '|'] - atom = parse_atom tokens, options - if tokens.current() is '...' - atom = [new OneOrMore atom] - tokens.move() - result = result.concat atom - return result - - -parse_atom = (tokens, options) -> - """atom ::= '(' expr ')' | '[' expr ']' | 'options' - | long | shorts | argument | command ; - """ - - token = tokens.current() - result = [] - if token in '([' - tokens.move() - [matching, patternType] = {'(': [')', Required], '[': [']', Optional]}[token] - result = new patternType parse_expr(tokens, options) - if tokens.move() != matching - throw new tokens.error "Unmatched '"+token+"'" - return [result] - else if token is 'options' - tokens.move() - return [new OptionsShortcut] - else if token.startsWith('--') and token != '--' - return parse_long tokens, options - else if token.startsWith('-') and token not in ['-', '--'] - return parse_shorts(tokens, options) - else if token.startsWith('<') and token.endsWith('>') or token.isUpper() - return [new Argument(tokens.move())] - else - [new Command tokens.move()] - - -parse_argv = (tokens, options, options_first=false) -> - """Parse command-line argument vector. - If options_first: - argv ::= [ long | shorts ]* [ argument ]* [ '--' [ argument ]* ] ; - else: - argv ::= [ long | shorts | argument ]* [ '--' [ argument ]* ] ; - """ - parsed = [] - while tokens.current() isnt null - if tokens.current() == '--' - return parsed.concat(new Argument(null, v) for v in tokens) - else if tokens.current().startsWith('--') - parsed = parsed.concat(parse_long(tokens, options)) - else if tokens.current().startsWith('-') and tokens.current() != '-' - parsed = parsed.concat(parse_shorts(tokens, options)) - else if options_first - return parsed.concat(new Argument(null, v) for v in tokens) - else - parsed.push(new Argument(null, tokens.move())) - return parsed - -parse_defaults = (doc) -> - defaults = [] - for s in parse_section('options:', doc) - # FIXME corner case "bla: options: --foo" - [_, _, s] = s.partition(':') # get rid of "options:" - split = ('\n' + s).split(new RegExp('\\n[ \\t]*(-\\S+?)')).slice(1) - odd = (v for v in split by 2) - even = (v for v in split[1..] by 2) - split = (s1 + s2 for [s1, s2] in zip(odd, even)) - options = (Option.parse(s) for s in split when s.startsWith('-')) - defaults.push.apply(defaults, options) - return defaults - -formal_usage = (section) -> - [_, _, section] = section.partition ':' # drop "usage:" - pu = section._split() - return '( ' + ((if s == pu[0] then ') | (' else s) for s in pu[1..]).join(' ') + ' )' - -extras = (help, version, options, doc) -> - if help and any((o.name in ['--help', '-h']) and o.value for o in options) - return doc.replace /^\s*|\s*$/, '' - if version and any((o.name == '--version') and o.value for o in options) - return version - return "" - -class Dict extends Object - - constructor: (pairs) -> - @[key] = value for [key, value] in pairs - - toObject: () -> - dict = {} - dict[name] = @[name] for name in Object.keys(@).sort() - return dict - -docopt = (doc, kwargs={}) -> - allowedargs = ['argv', 'name', 'help', 'version', 'options_first', 'exit'] - throw new Error "unrecognized argument to docopt: " for arg of kwargs \ - when arg not in allowedargs - - argv = if kwargs.argv is undefined \ - then process.argv[2..] else kwargs.argv - name = if kwargs.name is undefined \ - then null else kwargs.name - help = if kwargs.help is undefined \ - then true else kwargs.help - version = if kwargs.version is undefined \ - then null else kwargs.version - options_first = if kwargs.options_first is undefined \ - then false else kwargs.options_first - exit = if kwargs.exit is undefined \ - then true else kwargs.exit - - try - usage_sections = parse_section 'usage:', doc - if usage_sections.length == 0 - throw new DocoptLanguageError '"usage:" (case-insensitive) not found.' - if usage_sections.length > 1 - throw new DocoptLanguageError 'More than one "usage:" (case-insensitive).' - DocoptExit.usage = usage_sections[0] - - options = parse_defaults doc - pattern = parse_pattern formal_usage(DocoptExit.usage), options - - argv = parse_argv new Tokens(argv), options, options_first - pattern_options = pattern.flat(Option) - for options_shortcut in pattern.flat(OptionsShortcut) - doc_options = parse_defaults(doc) - pattern_options_strings = (i.toString() for i in pattern_options) - options_shortcut.children = doc_options.filter((item) -> return item.toString() not in pattern_options_strings) - - output = extras help, version, argv, doc - if output - if exit - print output - process.exit() - else - throw new Error output - [matched, left, collected] = pattern.fix().match argv - if matched and left.length is 0 # better message if left? - return new Dict([a.name, a.value] for a in ([].concat pattern.flat(), collected)).toObject() - throw new DocoptExit DocoptExit.usage - catch e - if (!exit) - throw e - else - print e.message if e.message - process.exit(1) - -module.exports = - docopt : docopt - DocoptLanguageError : DocoptLanguageError - DocoptExit : DocoptExit - Option : Option - Argument : Argument - Command : Command - Required : Required - OptionsShortcut : OptionsShortcut - Either : Either - Optional : Optional - Pattern : Pattern - OneOrMore : OneOrMore - Tokens : Tokens - Dict : Dict - transform : transform - formal_usage : formal_usage - parse_section : parse_section - parse_defaults: parse_defaults - parse_pattern: parse_pattern - parse_long : parse_long - parse_shorts : parse_shorts - parse_argv : parse_argv diff --git a/node_modules/docopt/docopt.js b/node_modules/docopt/docopt.js deleted file mode 100644 index 9f302f9c0..000000000 --- a/node_modules/docopt/docopt.js +++ /dev/null @@ -1,1202 +0,0 @@ -// Generated by CoffeeScript 1.9.1 -(function() { - var Argument, BranchPattern, Command, Dict, DocoptExit, DocoptLanguageError, Either, LeafPattern, OneOrMore, Option, Optional, OptionsShortcut, Pattern, Required, Tokens, any, docopt, enumerate, extras, formal_usage, parse_argv, parse_atom, parse_defaults, parse_expr, parse_long, parse_pattern, parse_section, parse_seq, parse_shorts, print, transform, zip, - indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - slice = [].slice, - extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - hasProp = {}.hasOwnProperty; - - print = function() { - return console.log([].join.call(arguments, ' ')); - }; - - enumerate = function(array) { - var i, item, j, len, results; - i = 0; - results = []; - for (j = 0, len = array.length; j < len; j++) { - item = array[j]; - results.push([i++, item]); - } - return results; - }; - - any = function(array) { - return indexOf.call(array, true) >= 0; - }; - - zip = function() { - var args, arr, i, j, length, lengthArray, ref, results; - args = 1 <= arguments.length ? slice.call(arguments, 0) : []; - lengthArray = (function() { - var j, len, results; - results = []; - for (j = 0, len = args.length; j < len; j++) { - arr = args[j]; - results.push(arr.length); - } - return results; - })(); - length = Math.min.apply(Math, lengthArray); - results = []; - for (i = j = 0, ref = length; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) { - results.push((function() { - var len, q, results1; - results1 = []; - for (q = 0, len = args.length; q < len; q++) { - arr = args[q]; - results1.push(arr[i]); - } - return results1; - })()); - } - return results; - }; - - String.prototype.partition = function(separator) { - var parts, self; - self = this; - if (self.indexOf(separator) >= 0) { - parts = self.split(separator); - return [parts[0], separator, parts.slice(1).join(separator)]; - } else { - return [String(self), '', '']; - } - }; - - String.prototype.startsWith = function(searchString, position) { - position = position || 0; - return this.lastIndexOf(searchString, position) === position; - }; - - String.prototype.endsWith = function(searchString, position) { - var lastIndex, subjectString; - subjectString = this.toString(); - if (position === void 0 || position > subjectString.length) { - position = subjectString.length; - } - position -= searchString.length; - lastIndex = subjectString.indexOf(searchString, position); - return lastIndex !== -1 && lastIndex === position; - }; - - String.prototype._split = function() { - return this.trim().split(/\s+/).filter(function(i) { - return i !== ''; - }); - }; - - String.prototype.isUpper = function() { - return /^[A-Z]+$/g.exec(this); - }; - - Number.isInteger = Number.isInteger || function(value) { - return typeof value === "number" && isFinite(value) && Math.floor(value) === value; - }; - - DocoptLanguageError = (function(superClass) { - extend(DocoptLanguageError, superClass); - - function DocoptLanguageError(message) { - this.message = message; - DocoptLanguageError.__super__.constructor.call(this, this.message); - } - - return DocoptLanguageError; - - })(Error); - - DocoptExit = (function(superClass) { - extend(DocoptExit, superClass); - - function DocoptExit(message) { - this.message = message; - DocoptExit.__super__.constructor.call(this, this.message); - } - - return DocoptExit; - - })(Error); - - Pattern = (function(superClass) { - extend(Pattern, superClass); - - function Pattern() { - return Pattern.__super__.constructor.apply(this, arguments); - } - - Pattern.prototype.fix = function() { - this.fix_identities(); - this.fix_repeating_arguments(); - return this; - }; - - Pattern.prototype.fix_identities = function(uniq) { - var c, flat, i, j, k, len, len1, q, ref, ref1, ref2; - if (uniq == null) { - uniq = null; - } - "Make pattern-tree tips point to same object if they are equal."; - if (!this.hasOwnProperty('children')) { - return this; - } - if (uniq === null) { - ref = [{}, this.flat()], uniq = ref[0], flat = ref[1]; - for (j = 0, len = flat.length; j < len; j++) { - k = flat[j]; - uniq[k] = k; - } - } - ref1 = enumerate(this.children); - for (q = 0, len1 = ref1.length; q < len1; q++) { - ref2 = ref1[q], i = ref2[0], c = ref2[1]; - if (!c.hasOwnProperty('children')) { - console.assert(uniq.hasOwnProperty(c)); - this.children[i] = uniq[c]; - } else { - c.fix_identities(uniq); - } - } - return this; - }; - - Pattern.prototype.fix_repeating_arguments = function() { - "Fix elements that should accumulate/increment values."; - var c, child, counts, e, either, j, len, len1, len2, mycase, q, r, ref; - either = (function() { - var j, len, ref, results; - ref = transform(this).children; - results = []; - for (j = 0, len = ref.length; j < len; j++) { - child = ref[j]; - results.push(child.children); - } - return results; - }).call(this); - for (j = 0, len = either.length; j < len; j++) { - mycase = either[j]; - counts = {}; - for (q = 0, len1 = mycase.length; q < len1; q++) { - c = mycase[q]; - counts[c] = (counts[c] ? counts[c] : 0) + 1; - } - ref = (function() { - var len2, results, u; - results = []; - for (u = 0, len2 = mycase.length; u < len2; u++) { - child = mycase[u]; - if (counts[child] > 1) { - results.push(child); - } - } - return results; - })(); - for (r = 0, len2 = ref.length; r < len2; r++) { - e = ref[r]; - if (e.constructor === Argument || e.constructor === Option && e.argcount) { - if (e.value === null) { - e.value = []; - } else if (e.value.constructor !== Array) { - e.value = e.value._split(); - } - } - if (e.constructor === Command || e.constructor === Option && e.argcount === 0) { - e.value = 0; - } - } - } - return this; - }; - - return Pattern; - - })(Object); - - transform = function(pattern) { - "Expand pattern into an (almost) equivalent one, but with single Either.\n\nExample: ((-a | -b) (-c | -d)) => (-a -c | -a -d | -b -c | -b -d)\nQuirks: [-a] => (-a), (-a...) => (-a -a)\n"; - var c, child, children, e, groups, index, j, len, parents, ref, result, t; - result = []; - groups = [[pattern]]; - while (groups.length) { - children = groups.shift(); - parents = [Required, Optional, OptionsShortcut, Either, OneOrMore]; - if (any((function() { - var j, len, results; - results = []; - for (j = 0, len = parents.length; j < len; j++) { - t = parents[j]; - results.push(indexOf.call(children.map(function(c) { - return c.constructor; - }), t) >= 0); - } - return results; - })())) { - child = ((function() { - var j, len, ref, results; - results = []; - for (j = 0, len = children.length; j < len; j++) { - c = children[j]; - if (ref = c.constructor, indexOf.call(parents, ref) >= 0) { - results.push(c); - } - } - return results; - })())[0]; - index = children.indexOf(child); - if (index >= 0) { - children.splice(index, 1); - } - if (child.constructor === Either) { - ref = child.children; - for (j = 0, len = ref.length; j < len; j++) { - c = ref[j]; - groups.push([c].concat(children)); - } - } else if (child.constructor === OneOrMore) { - groups.push((child.children.concat(child.children)).concat(children)); - } else { - groups.push(child.children.concat(children)); - } - } else { - result.push(children); - } - } - return new Either((function() { - var len1, q, results; - results = []; - for (q = 0, len1 = result.length; q < len1; q++) { - e = result[q]; - results.push(new Required(e)); - } - return results; - })()); - }; - - LeafPattern = (function(superClass) { - "Leaf/terminal node of a pattern tree."; - extend(LeafPattern, superClass); - - function LeafPattern(name1, value1) { - this.name = name1; - this.value = value1 != null ? value1 : null; - } - - LeafPattern.prototype.toString = function() { - return this.constructor.name + "(" + this.name + ", " + this.value + ")"; - }; - - LeafPattern.prototype.flat = function(types) { - var ref; - if (types == null) { - types = []; - } - types = types instanceof Array ? types : [types]; - if (!types.length || (ref = this.constructor, indexOf.call(types, ref) >= 0)) { - return [this]; - } else { - return []; - } - }; - - LeafPattern.prototype.match = function(left, collected) { - var a, increment, left_, match, pos, ref, same_name; - if (collected == null) { - collected = null; - } - if (collected === null) { - collected = []; - } - ref = this.singleMatch(left), pos = ref[0], match = ref[1]; - if (match === null) { - return [false, left, collected]; - } - left_ = left.slice(0, pos).concat(left.slice(pos + 1)); - same_name = (function() { - var j, len, results; - results = []; - for (j = 0, len = collected.length; j < len; j++) { - a = collected[j]; - if (a.name === this.name) { - results.push(a); - } - } - return results; - }).call(this); - if (Number.isInteger(this.value) || this.value instanceof Array) { - if (Number.isInteger(this.value)) { - increment = 1; - } else { - increment = typeof match.value === 'string' ? [match.value] : match.value; - } - if (!same_name.length) { - match.value = increment; - return [true, left_, collected.concat(match)]; - } - if (Number.isInteger(this.value)) { - same_name[0].value += increment; - } else { - same_name[0].value = [].concat(same_name[0].value, increment); - } - return [true, left_, collected]; - } - return [true, left_, collected.concat(match)]; - }; - - return LeafPattern; - - })(Pattern); - - BranchPattern = (function(superClass) { - "Branch/inner node of a pattern tree."; - extend(BranchPattern, superClass); - - function BranchPattern(children) { - this.children = children instanceof Array ? children : [children]; - } - - BranchPattern.prototype.toString = function() { - var a; - return this.constructor.name + "(" + (((function() { - var j, len, ref, results; - ref = this.children; - results = []; - for (j = 0, len = ref.length; j < len; j++) { - a = ref[j]; - results.push(a); - } - return results; - }).call(this)).join(', ')) + ")"; - }; - - BranchPattern.prototype.flat = function(types) { - var child, ref; - if (types == null) { - types = []; - } - types = types instanceof Array ? types : [types]; - if (ref = this.constructor, indexOf.call(types, ref) >= 0) { - return [this]; - } - return ((function() { - var j, len, ref1, results; - ref1 = this.children; - results = []; - for (j = 0, len = ref1.length; j < len; j++) { - child = ref1[j]; - if (child instanceof Pattern) { - results.push(child.flat(types)); - } - } - return results; - }).call(this)).reduce((function(pv, cv) { - return [].concat(pv, cv); - }), []); - }; - - return BranchPattern; - - })(Pattern); - - Argument = (function(superClass) { - extend(Argument, superClass); - - function Argument() { - return Argument.__super__.constructor.apply(this, arguments); - } - - Argument.prototype.singleMatch = function(left) { - var j, len, n, pattern, ref, ref1; - ref = enumerate(left); - for (j = 0, len = ref.length; j < len; j++) { - ref1 = ref[j], n = ref1[0], pattern = ref1[1]; - if (pattern.constructor === Argument) { - return [n, new Argument(this.name, pattern.value)]; - } - } - return [null, null]; - }; - - Argument.parse = function(source) { - var name, value; - name = /(<\S*?>)/ig.exec(source)[1]; - value = /\[default:\s+(.*)\]/ig.exec(source); - return new Argument(name, value ? value[1] : null); - }; - - return Argument; - - })(LeafPattern); - - Command = (function(superClass) { - extend(Command, superClass); - - function Command(name1, value1) { - this.name = name1; - this.value = value1 != null ? value1 : false; - } - - Command.prototype.singleMatch = function(left) { - var j, len, n, pattern, ref, ref1; - ref = enumerate(left); - for (j = 0, len = ref.length; j < len; j++) { - ref1 = ref[j], n = ref1[0], pattern = ref1[1]; - if (pattern.constructor === Argument) { - if (pattern.value === this.name) { - return [n, new Command(this.name, true)]; - } else { - break; - } - } - } - return [null, null]; - }; - - return Command; - - })(Argument); - - Option = (function(superClass) { - extend(Option, superClass); - - function Option(short1, long1, argcount1, value) { - var ref; - this.short = short1 != null ? short1 : null; - this.long = long1 != null ? long1 : null; - this.argcount = argcount1 != null ? argcount1 : 0; - if (value == null) { - value = false; - } - console.assert((ref = this.argcount) === 0 || ref === 1); - this.value = value === false && this.argcount > 0 ? null : value; - this.name = this.long || this.short; - } - - Option.prototype.toString = function() { - return "Option(" + this.short + ", " + this.long + ", " + this.argcount + ", " + this.value + ")"; - }; - - Option.parse = function(option_description) { - var _, argcount, description, j, len, long, matched, options, ref, ref1, ref2, s, short, value; - ref = [null, null, 0, false], short = ref[0], long = ref[1], argcount = ref[2], value = ref[3]; - ref1 = option_description.trim().partition(' '), options = ref1[0], _ = ref1[1], description = ref1[2]; - options = options.replace(/,|=/g, ' '); - ref2 = options._split(); - for (j = 0, len = ref2.length; j < len; j++) { - s = ref2[j]; - if (s.startsWith('--')) { - long = s; - } else if (s.startsWith('-')) { - short = s; - } else { - argcount = 1; - } - } - if (argcount > 0) { - matched = /\[default:\s+(.*)\]/ig.exec(description); - value = matched ? matched[1] : null; - } - return new Option(short, long, argcount, value); - }; - - Option.prototype.singleMatch = function(left) { - var j, len, n, pattern, ref, ref1; - ref = enumerate(left); - for (j = 0, len = ref.length; j < len; j++) { - ref1 = ref[j], n = ref1[0], pattern = ref1[1]; - if (this.name === pattern.name) { - return [n, pattern]; - } - } - return [null, null]; - }; - - return Option; - - })(LeafPattern); - - Required = (function(superClass) { - extend(Required, superClass); - - function Required() { - return Required.__super__.constructor.apply(this, arguments); - } - - Required.prototype.match = function(left, collected) { - var c, j, l, len, matched, p, ref, ref1; - if (collected == null) { - collected = null; - } - if (collected === null) { - collected = []; - } - l = left; - c = collected; - ref = this.children; - for (j = 0, len = ref.length; j < len; j++) { - p = ref[j]; - ref1 = p.match(l, c), matched = ref1[0], l = ref1[1], c = ref1[2]; - if (!matched) { - return [false, left, collected]; - } - } - return [true, l, c]; - }; - - return Required; - - })(BranchPattern); - - Optional = (function(superClass) { - extend(Optional, superClass); - - function Optional() { - return Optional.__super__.constructor.apply(this, arguments); - } - - Optional.prototype.match = function(left, collected) { - var j, len, m, p, ref, ref1; - if (collected == null) { - collected = null; - } - if (collected === null) { - collected = []; - } - ref = this.children; - for (j = 0, len = ref.length; j < len; j++) { - p = ref[j]; - ref1 = p.match(left, collected), m = ref1[0], left = ref1[1], collected = ref1[2]; - } - return [true, left, collected]; - }; - - return Optional; - - })(BranchPattern); - - OptionsShortcut = (function(superClass) { - "Marker/placeholder for [options] shortcut."; - extend(OptionsShortcut, superClass); - - function OptionsShortcut() { - return OptionsShortcut.__super__.constructor.apply(this, arguments); - } - - return OptionsShortcut; - - })(Optional); - - OneOrMore = (function(superClass) { - extend(OneOrMore, superClass); - - function OneOrMore() { - return OneOrMore.__super__.constructor.apply(this, arguments); - } - - OneOrMore.prototype.match = function(left, collected) { - var c, l, l_, matched, ref, times; - if (collected == null) { - collected = null; - } - console.assert(this.children.length === 1); - if (collected === null) { - collected = []; - } - l = left; - c = collected; - l_ = []; - matched = true; - times = 0; - while (matched) { - ref = this.children[0].match(l, c), matched = ref[0], l = ref[1], c = ref[2]; - times += matched ? 1 : 0; - if (l_.join(', ') === l.join(', ')) { - break; - } - l_ = l; - } - if (times >= 1) { - return [true, l, c]; - } - return [false, left, collected]; - }; - - return OneOrMore; - - })(BranchPattern); - - Either = (function(superClass) { - extend(Either, superClass); - - function Either() { - return Either.__super__.constructor.apply(this, arguments); - } - - Either.prototype.match = function(left, collected) { - var j, len, outcome, outcomes, p, ref; - if (collected == null) { - collected = null; - } - if (collected === null) { - collected = []; - } - outcomes = []; - ref = this.children; - for (j = 0, len = ref.length; j < len; j++) { - p = ref[j]; - outcome = p.match(left, collected); - if (outcome[0]) { - outcomes.push(outcome); - } - } - if (outcomes.length > 0) { - outcomes.sort(function(a, b) { - if (a[1].length > b[1].length) { - return 1; - } else if (a[1].length < b[1].length) { - return -1; - } else { - return 0; - } - }); - return outcomes[0]; - } - return [false, left, collected]; - }; - - return Either; - - })(BranchPattern); - - Tokens = (function(superClass) { - extend(Tokens, superClass); - - function Tokens(source, error) { - var stream; - this.error = error != null ? error : DocoptExit; - stream = source.constructor === String ? source._split() : source; - this.push.apply(this, stream); - } - - Tokens.prototype.move = function() { - if (this.length) { - return [].shift.apply(this); - } else { - return null; - } - }; - - Tokens.prototype.current = function() { - if (this.length) { - return this[0]; - } else { - return null; - } - }; - - Tokens.from_pattern = function(source) { - var s; - source = source.replace(/([\[\]\(\)\|]|\.\.\.)/g, ' $1 '); - source = (function() { - var j, len, ref, results; - ref = source.split(/\s+|(\S*<.*?>)/); - results = []; - for (j = 0, len = ref.length; j < len; j++) { - s = ref[j]; - if (s) { - results.push(s); - } - } - return results; - })(); - return new Tokens(source, DocoptLanguageError); - }; - - return Tokens; - - })(Array); - - parse_section = function(name, source) { - var matches, s; - matches = source.match(new RegExp('^([^\n]*' + name + '[^\n]*\n?(?:[ \t].*?(?:\n|$))*)', 'igm')); - if (matches) { - return (function() { - var j, len, results; - results = []; - for (j = 0, len = matches.length; j < len; j++) { - s = matches[j]; - results.push(s.trim()); - } - return results; - })(); - } - return []; - }; - - parse_shorts = function(tokens, options) { - "shorts ::= '-' ( chars )* [ [ ' ' ] chars ] ;"; - var left, o, parsed, ref, ref1, short, similar, token, value; - token = tokens.move(); - console.assert(token.startsWith('-') && !token.startsWith('--')); - left = token.replace(/^-+/g, ''); - parsed = []; - while (left !== '') { - ref = ['-' + left[0], left.slice(1)], short = ref[0], left = ref[1]; - similar = (function() { - var j, len, results; - results = []; - for (j = 0, len = options.length; j < len; j++) { - o = options[j]; - if (o.short === short) { - results.push(o); - } - } - return results; - })(); - if (similar.length > 1) { - throw new tokens.error(short + " is specified ambiguously " + similar.length + " times"); - } else if (similar.length < 1) { - o = new Option(short, null, 0); - options.push(o); - if (tokens.error === DocoptExit) { - o = new Option(short, null, 0, true); - } - } else { - o = new Option(short, similar[0].long, similar[0].argcount, similar[0].value); - value = null; - if (o.argcount !== 0) { - if (left === '') { - if ((ref1 = tokens.current()) === null || ref1 === '--') { - throw new tokens.error(short + " requires argument"); - } - value = tokens.move(); - } else { - value = left; - left = ''; - } - } - if (tokens.error === DocoptExit) { - o.value = value !== null ? value : true; - } - } - parsed.push(o); - } - return parsed; - }; - - parse_long = function(tokens, options) { - "long ::= '--' chars [ ( ' ' | '=' ) chars ] ;"; - var argcount, eq, long, longs, o, ref, ref1, similar, value; - ref = tokens.move().partition('='), long = ref[0], eq = ref[1], value = ref[2]; - console.assert(long.startsWith('--')); - if (eq === value && value === '') { - value = null; - } - similar = (function() { - var j, len, results; - results = []; - for (j = 0, len = options.length; j < len; j++) { - o = options[j]; - if (o.long === long) { - results.push(o); - } - } - return results; - })(); - if (tokens.error === DocoptExit && similar.length === 0) { - similar = (function() { - var j, len, results; - results = []; - for (j = 0, len = options.length; j < len; j++) { - o = options[j]; - if (o.long && o.long.startsWith(long)) { - results.push(o); - } - } - return results; - })(); - } - if (similar.length > 1) { - longs = ((function() { - var j, len, results; - results = []; - for (j = 0, len = similar.length; j < len; j++) { - o = similar[j]; - results.push(o.long); - } - return results; - })()).join(', '); - throw new tokens.error(long + " is not a unique prefix: " + longs + "?"); - } else if (similar.length < 1) { - argcount = eq === '=' ? 1 : 0; - o = new Option(null, long, argcount); - options.push(o); - if (tokens.error === DocoptExit) { - o = new Option(null, long, argcount, argcount > 0 ? value : true); - } - } else { - o = new Option(similar[0].short, similar[0].long, similar[0].argcount, similar[0].value); - if (o.argcount === 0) { - if (value !== null) { - throw new tokens.error(o.long + " must not have an argument"); - } - } else { - if (value === null) { - if ((ref1 = tokens.current()) === null || ref1 === '--') { - throw new tokens.error(o.long + " requires argument"); - } - value = tokens.move(); - } - } - if (tokens.error === DocoptExit) { - o.value = value !== null ? value : true; - } - } - return [o]; - }; - - parse_pattern = function(source, options) { - var result, tokens; - tokens = Tokens.from_pattern(source); - result = parse_expr(tokens, options); - if (tokens.current() !== null) { - throw new tokens.error('unexpected ending: ' + (tokens.join(' '))); - } - return new Required(result); - }; - - parse_expr = function(tokens, options) { - "expr ::= seq ( '|' seq )* ;"; - var result, seq; - seq = parse_seq(tokens, options); - if (tokens.current() !== '|') { - return seq; - } - result = seq.length > 1 ? [new Required(seq)] : seq; - while (tokens.current() === '|') { - tokens.move(); - seq = parse_seq(tokens, options); - result = result.concat(seq.length > 1 ? [new Required(seq)] : seq); - } - if (result.length > 1) { - return [new Either(result)]; - } else { - return result; - } - }; - - parse_seq = function(tokens, options) { - "seq ::= ( atom [ '...' ] )* ;"; - var atom, ref, result; - result = []; - while ((ref = tokens.current()) !== null && ref !== ']' && ref !== ')' && ref !== '|') { - atom = parse_atom(tokens, options); - if (tokens.current() === '...') { - atom = [new OneOrMore(atom)]; - tokens.move(); - } - result = result.concat(atom); - } - return result; - }; - - parse_atom = function(tokens, options) { - "atom ::= '(' expr ')' | '[' expr ']' | 'options'\n| long | shorts | argument | command ;"; - var matching, patternType, ref, result, token; - token = tokens.current(); - result = []; - if (indexOf.call('([', token) >= 0) { - tokens.move(); - ref = { - '(': [')', Required], - '[': [']', Optional] - }[token], matching = ref[0], patternType = ref[1]; - result = new patternType(parse_expr(tokens, options)); - if (tokens.move() !== matching) { - throw new tokens.error("Unmatched '" + token + "'"); - } - return [result]; - } else if (token === 'options') { - tokens.move(); - return [new OptionsShortcut]; - } else if (token.startsWith('--') && token !== '--') { - return parse_long(tokens, options); - } else if (token.startsWith('-') && (token !== '-' && token !== '--')) { - return parse_shorts(tokens, options); - } else if (token.startsWith('<') && token.endsWith('>') || token.isUpper()) { - return [new Argument(tokens.move())]; - } else { - return [new Command(tokens.move())]; - } - }; - - parse_argv = function(tokens, options, options_first) { - var parsed, v; - if (options_first == null) { - options_first = false; - } - "Parse command-line argument vector.\nIf options_first:\n argv ::= [ long | shorts ]* [ argument ]* [ '--' [ argument ]* ] ;\nelse:\n argv ::= [ long | shorts | argument ]* [ '--' [ argument ]* ] ;"; - parsed = []; - while (tokens.current() !== null) { - if (tokens.current() === '--') { - return parsed.concat((function() { - var j, len, results; - results = []; - for (j = 0, len = tokens.length; j < len; j++) { - v = tokens[j]; - results.push(new Argument(null, v)); - } - return results; - })()); - } else if (tokens.current().startsWith('--')) { - parsed = parsed.concat(parse_long(tokens, options)); - } else if (tokens.current().startsWith('-') && tokens.current() !== '-') { - parsed = parsed.concat(parse_shorts(tokens, options)); - } else if (options_first) { - return parsed.concat((function() { - var j, len, results; - results = []; - for (j = 0, len = tokens.length; j < len; j++) { - v = tokens[j]; - results.push(new Argument(null, v)); - } - return results; - })()); - } else { - parsed.push(new Argument(null, tokens.move())); - } - } - return parsed; - }; - - parse_defaults = function(doc) { - var _, defaults, even, j, len, odd, options, ref, ref1, s, s1, s2, split, v; - defaults = []; - ref = parse_section('options:', doc); - for (j = 0, len = ref.length; j < len; j++) { - s = ref[j]; - ref1 = s.partition(':'), _ = ref1[0], _ = ref1[1], s = ref1[2]; - split = ('\n' + s).split(new RegExp('\\n[ \\t]*(-\\S+?)')).slice(1); - odd = (function() { - var len1, q, results; - results = []; - for (q = 0, len1 = split.length; q < len1; q += 2) { - v = split[q]; - results.push(v); - } - return results; - })(); - even = (function() { - var len1, q, ref2, results; - ref2 = split.slice(1); - results = []; - for (q = 0, len1 = ref2.length; q < len1; q += 2) { - v = ref2[q]; - results.push(v); - } - return results; - })(); - split = (function() { - var len1, q, ref2, ref3, results; - ref2 = zip(odd, even); - results = []; - for (q = 0, len1 = ref2.length; q < len1; q++) { - ref3 = ref2[q], s1 = ref3[0], s2 = ref3[1]; - results.push(s1 + s2); - } - return results; - })(); - options = (function() { - var len1, q, results; - results = []; - for (q = 0, len1 = split.length; q < len1; q++) { - s = split[q]; - if (s.startsWith('-')) { - results.push(Option.parse(s)); - } - } - return results; - })(); - defaults.push.apply(defaults, options); - } - return defaults; - }; - - formal_usage = function(section) { - var _, pu, ref, s; - ref = section.partition(':'), _ = ref[0], _ = ref[1], section = ref[2]; - pu = section._split(); - return '( ' + ((function() { - var j, len, ref1, results; - ref1 = pu.slice(1); - results = []; - for (j = 0, len = ref1.length; j < len; j++) { - s = ref1[j]; - results.push(s === pu[0] ? ') | (' : s); - } - return results; - })()).join(' ') + ' )'; - }; - - extras = function(help, version, options, doc) { - var o; - if (help && any((function() { - var j, len, ref, results; - results = []; - for (j = 0, len = options.length; j < len; j++) { - o = options[j]; - results.push(((ref = o.name) === '--help' || ref === '-h') && o.value); - } - return results; - })())) { - return doc.replace(/^\s*|\s*$/, ''); - } - if (version && any((function() { - var j, len, results; - results = []; - for (j = 0, len = options.length; j < len; j++) { - o = options[j]; - results.push((o.name === '--version') && o.value); - } - return results; - })())) { - return version; - } - return ""; - }; - - Dict = (function(superClass) { - extend(Dict, superClass); - - function Dict(pairs) { - var j, key, len, ref, value; - for (j = 0, len = pairs.length; j < len; j++) { - ref = pairs[j], key = ref[0], value = ref[1]; - this[key] = value; - } - } - - Dict.prototype.toObject = function() { - var dict, j, len, name, ref; - dict = {}; - ref = Object.keys(this).sort(); - for (j = 0, len = ref.length; j < len; j++) { - name = ref[j]; - dict[name] = this[name]; - } - return dict; - }; - - return Dict; - - })(Object); - - docopt = function(doc, kwargs) { - var a, allowedargs, arg, argv, collected, doc_options, e, exit, help, i, j, left, len, matched, name, options, options_first, options_shortcut, output, pattern, pattern_options, pattern_options_strings, ref, ref1, usage_sections, version; - if (kwargs == null) { - kwargs = {}; - } - allowedargs = ['argv', 'name', 'help', 'version', 'options_first', 'exit']; - for (arg in kwargs) { - if (indexOf.call(allowedargs, arg) < 0) { - throw new Error("unrecognized argument to docopt: "); - } - } - argv = kwargs.argv === void 0 ? process.argv.slice(2) : kwargs.argv; - name = kwargs.name === void 0 ? null : kwargs.name; - help = kwargs.help === void 0 ? true : kwargs.help; - version = kwargs.version === void 0 ? null : kwargs.version; - options_first = kwargs.options_first === void 0 ? false : kwargs.options_first; - exit = kwargs.exit === void 0 ? true : kwargs.exit; - try { - usage_sections = parse_section('usage:', doc); - if (usage_sections.length === 0) { - throw new DocoptLanguageError('"usage:" (case-insensitive) not found.'); - } - if (usage_sections.length > 1) { - throw new DocoptLanguageError('More than one "usage:" (case-insensitive).'); - } - DocoptExit.usage = usage_sections[0]; - options = parse_defaults(doc); - pattern = parse_pattern(formal_usage(DocoptExit.usage), options); - argv = parse_argv(new Tokens(argv), options, options_first); - pattern_options = pattern.flat(Option); - ref = pattern.flat(OptionsShortcut); - for (j = 0, len = ref.length; j < len; j++) { - options_shortcut = ref[j]; - doc_options = parse_defaults(doc); - pattern_options_strings = (function() { - var len1, q, results; - results = []; - for (q = 0, len1 = pattern_options.length; q < len1; q++) { - i = pattern_options[q]; - results.push(i.toString()); - } - return results; - })(); - options_shortcut.children = doc_options.filter(function(item) { - var ref1; - return ref1 = item.toString(), indexOf.call(pattern_options_strings, ref1) < 0; - }); - } - output = extras(help, version, argv, doc); - if (output) { - if (exit) { - print(output); - process.exit(); - } else { - throw new Error(output); - } - } - ref1 = pattern.fix().match(argv), matched = ref1[0], left = ref1[1], collected = ref1[2]; - if (matched && left.length === 0) { - return new Dict((function() { - var len1, q, ref2, results; - ref2 = [].concat(pattern.flat(), collected); - results = []; - for (q = 0, len1 = ref2.length; q < len1; q++) { - a = ref2[q]; - results.push([a.name, a.value]); - } - return results; - })()).toObject(); - } - throw new DocoptExit(DocoptExit.usage); - } catch (_error) { - e = _error; - if (!exit) { - throw e; - } else { - if (e.message) { - print(e.message); - } - return process.exit(1); - } - } - }; - - module.exports = { - docopt: docopt, - DocoptLanguageError: DocoptLanguageError, - DocoptExit: DocoptExit, - Option: Option, - Argument: Argument, - Command: Command, - Required: Required, - OptionsShortcut: OptionsShortcut, - Either: Either, - Optional: Optional, - Pattern: Pattern, - OneOrMore: OneOrMore, - Tokens: Tokens, - Dict: Dict, - transform: transform, - formal_usage: formal_usage, - parse_section: parse_section, - parse_defaults: parse_defaults, - parse_pattern: parse_pattern, - parse_long: parse_long, - parse_shorts: parse_shorts, - parse_argv: parse_argv - }; - -}).call(this); diff --git a/node_modules/docopt/package.json b/node_modules/docopt/package.json deleted file mode 100644 index e2104dc5c..000000000 --- a/node_modules/docopt/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "_args": [ - [ - "docopt@0.6.2", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_development": true, - "_from": "docopt@0.6.2", - "_id": "docopt@0.6.2", - "_inBundle": false, - "_integrity": "sha1-so6eIiDaXsSffqW7JKR3h0Be6xE=", - "_location": "/docopt", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "docopt@0.6.2", - "name": "docopt", - "escapedName": "docopt", - "rawSpec": "0.6.2", - "saveSpec": null, - "fetchSpec": "0.6.2" - }, - "_requiredBy": [ - "/licensee" - ], - "_resolved": "https://registry.npmjs.org/docopt/-/docopt-0.6.2.tgz", - "_spec": "0.6.2", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Vladimir Keleshev", - "email": "vladimir@keleshev.com" - }, - "bugs": { - "url": "https://github.com/scarnie/docopt.coffee/issues" - }, - "contributors": [ - { - "name": "Andrew Kassen", - "email": "atkassen@berkeley.edu" - }, - { - "name": "Vladimir Keleshev", - "email": "vladimir@keleshev.com" - }, - { - "name": "Stuart Carnie", - "email": "stuart.carnie@gmail.com" - }, - { - "name": "Matthias Rolke", - "email": "mr.amtrack@gmail.com" - } - ], - "description": "a command line option parser that will make you smile", - "devDependencies": { - "chai": "^2.2.0", - "coffee-script": "^1.9.1", - "coffeelint": "^1.9.2", - "mocha": "^2.2.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "homepage": "https://github.com/scarnie/docopt.coffee#readme", - "keywords": [ - "command", - "options", - "argument", - "args", - "cli", - "commandline" - ], - "licenses": "MIT", - "main": "docopt.js", - "name": "docopt", - "repository": { - "type": "git", - "url": "git://github.com/scarnie/docopt.coffee.git" - }, - "scripts": { - "lint": "coffeelint docopt.coffee test/*.coffee", - "prepublish": "coffee -c docopt.coffee", - "test": "mocha --compilers coffee:coffee-script/register" - }, - "version": "0.6.2" -} diff --git a/node_modules/docopt/test/test.coffee b/node_modules/docopt/test/test.coffee deleted file mode 100644 index 12c45e322..000000000 --- a/node_modules/docopt/test/test.coffee +++ /dev/null @@ -1,736 +0,0 @@ -chai = require 'chai' -assert = chai.assert -docopt = require '../docopt.coffee' - -describe "test.coffee", -> - - it "test_pattern_flat", -> - assert.deepEqual( - new docopt.Required([new docopt.OneOrMore([new docopt.Argument('N')]), new docopt.Option('-a'), new docopt.Argument('M')]).flat() - [new docopt.Argument('N'), new docopt.Option('-a'), new docopt.Argument('M')] - ) - assert.deepEqual( - new docopt.Required([new docopt.Optional([new docopt.OptionsShortcut([])]), new docopt.Optional([new docopt.Option('-a', null)])]).flat(docopt.OptionsShortcut) - [new docopt.OptionsShortcut([])] - ) - - - it "test_option", -> - assert.deepEqual new docopt.Option.parse('-h'), new docopt.Option('-h', null) - assert.deepEqual new docopt.Option.parse('--help'), new docopt.Option(null, '--help') - assert.deepEqual new docopt.Option.parse('-h --help'), new docopt.Option('-h', '--help') - assert.deepEqual new docopt.Option.parse('-h, --help'), new docopt.Option('-h', '--help') - - assert.deepEqual new docopt.Option.parse('-h TOPIC'), new docopt.Option('-h', null, 1) - assert.deepEqual new docopt.Option.parse('--help TOPIC'), new docopt.Option(null, '--help', 1) - assert.deepEqual new docopt.Option.parse('-h TOPIC --help TOPIC'), new docopt.Option('-h', '--help', 1) - assert.deepEqual new docopt.Option.parse('-h TOPIC, --help TOPIC'), new docopt.Option('-h', '--help', 1) - assert.deepEqual new docopt.Option.parse('-h TOPIC, --help=TOPIC'), new docopt.Option('-h', '--help', 1) - - assert.deepEqual new docopt.Option.parse('-h Description...'), new docopt.Option('-h', null) - assert.deepEqual new docopt.Option.parse('-h --help Description...'), new docopt.Option('-h', '--help') - assert.deepEqual new docopt.Option.parse('-h TOPIC Description...'), new docopt.Option('-h', null, 1) - - assert.deepEqual new docopt.Option.parse(' -h'), new docopt.Option('-h', null) - - assert.deepEqual( - new docopt.Option.parse('-h TOPIC Descripton... [default: 2]') - new docopt.Option('-h', null, 1, '2') - ) - assert.deepEqual( - new docopt.Option.parse('-h TOPIC Descripton... [default: topic-1]') - new docopt.Option('-h', null, 1, 'topic-1') - ) - assert.deepEqual( - new docopt.Option.parse('--help=TOPIC ... [default: 3.14]') - new docopt.Option(null, '--help', 1, '3.14') - ) - assert.deepEqual( - new docopt.Option.parse('-h, --help=DIR ... [default: ./]') - new docopt.Option('-h', '--help', 1, "./") - ) - assert.deepEqual( - new docopt.Option.parse('-h TOPIC Descripton... [dEfAuLt: 2]') - new docopt.Option('-h', null, 1, '2') - ) - - - it "test_option_name", -> - assert.deepEqual new docopt.Option('-h', null).name, '-h' - assert.deepEqual new docopt.Option('-h', '--help').name, '--help' - assert.deepEqual new docopt.Option(null, '--help').name, '--help' - - - it "test_commands", -> - assert.deepEqual docopt.docopt('Usage: prog add', {argv: 'add', exit: false}), {'add': true} - assert.deepEqual docopt.docopt('Usage: prog [add]', {argv: '', exit: false}), {'add': false} - assert.deepEqual docopt.docopt('Usage: prog [add]', {argv: 'add', exit: false}), {'add': true} - assert.deepEqual docopt.docopt('Usage: prog (add|rm)', {argv: 'add', exit: false}), {'add': true, 'rm': false} - assert.deepEqual docopt.docopt('Usage: prog (add|rm)', {argv: 'rm', exit: false}), {'add': false, 'rm': true} - assert.deepEqual docopt.docopt('Usage: prog a b', {argv: 'a b', exit: false}), {'a': true, 'b': true} - assert.throws( - () -> - docopt.docopt('Usage: prog a b', {argv: 'b a', exit: false}) - , - docopt.DocoptExit - ) - - - it "test_formal_usage", -> - doc = """ - Usage: prog [-hv] ARG - prog N M - - prog is a program.""" - [usage] = docopt.parse_section('usage:', doc) - assert.deepEqual usage, "Usage: prog [-hv] ARG\n prog N M" - assert.deepEqual docopt.formal_usage(usage), "( [-hv] ARG ) | ( N M )" - - - it "test_parse_argv", -> - o = [new docopt.Option('-h'), new docopt.Option('-v', '--verbose'), new docopt.Option('-f', '--file', 1)] - TS = (s) -> new docopt.Tokens(s, docopt.DocoptExit) - assert.deepEqual docopt.parse_argv(TS(''), o), [] - assert.deepEqual docopt.parse_argv(TS('-h'), o), [new docopt.Option('-h', null, 0, true)] - assert.deepEqual( - docopt.parse_argv(TS('-h --verbose'), o) - [new docopt.Option('-h', null, 0, true), new docopt.Option('-v', '--verbose', 0, true)] - ) - assert.deepEqual( - docopt.parse_argv(TS('-h --file f.txt'), o) - [new docopt.Option('-h', null, 0, true), new docopt.Option('-f', '--file', 1, 'f.txt')] - ) - assert.deepEqual( - docopt.parse_argv(TS('-h --file f.txt arg'), o) - [new docopt.Option('-h', null, 0, true), new docopt.Option('-f', '--file', 1, 'f.txt'), new docopt.Argument(null, 'arg')] - ) - assert.deepEqual( - docopt.parse_argv(TS('-h --file f.txt arg arg2'), o) - [new docopt.Option('-h', null, 0, true), new docopt.Option('-f', '--file', 1, 'f.txt'), new docopt.Argument(null, 'arg'), new docopt.Argument(null, 'arg2')] - ) - assert.deepEqual( - docopt.parse_argv(TS('-h arg -- -v'), o) - [new docopt.Option('-h', null, 0, true), new docopt.Argument(null, 'arg'), new docopt.Argument(null, '--'), new docopt.Argument(null, '-v')] - ) - - it "test_parse_pattern", -> - o = [new docopt.Option('-h'), new docopt.Option('-v', '--verbose'), new docopt.Option('-f', '--file', 1)] - assert.deepEqual( - docopt.parse_pattern('[ -h ]', o) - new docopt.Required([new docopt.Optional([new docopt.Option('-h')])]) - ) - assert.deepEqual( - docopt.parse_pattern('[ ARG ... ]', o) - new docopt.Required([new docopt.Optional([new docopt.OneOrMore([new docopt.Argument('ARG')])])]) - ) - assert.deepEqual( - docopt.parse_pattern('[ -h | -v ]', o) - new docopt.Required([new docopt.Optional([new docopt.Either([new docopt.Option('-h'), new docopt.Option('-v', '--verbose')])])]) - ) - assert.deepEqual( - docopt.parse_pattern('( -h | -v [ --file <f> ] )', o), - new docopt.Required([new docopt.Required(new docopt.Either([new docopt.Option('-h'), new docopt.Required([new docopt.Option('-v', '--verbose'), new docopt.Optional([new docopt.Option('-f', '--file', 1, null)])])]))]) - ) - assert.deepEqual( - docopt.parse_pattern('(-h|-v[--file=<f>]N...)', o), - new docopt.Required([new docopt.Required([new docopt.Either([new docopt.Option('-h'), new docopt.Required([new docopt.Option('-v', '--verbose'), new docopt.Optional([new docopt.Option('-f', '--file', 1, null)]), new docopt.OneOrMore([new docopt.Argument('N')])])])])]) - ) - assert.deepEqual( - docopt.parse_pattern('(N [M | (K | L)] | O P)', []), - new docopt.Required([new docopt.Required([new docopt.Either([new docopt.Required([new docopt.Argument('N'), new docopt.Optional([new docopt.Either([new docopt.Argument('M'), new docopt.Required([new docopt.Either([new docopt.Argument('K'), new docopt.Argument('L')])])])])]), new docopt.Required([new docopt.Argument('O'), new docopt.Argument('P')])])])]) - ) - assert.deepEqual( - docopt.parse_pattern('[ -h ] [N]', o), - new docopt.Required([new docopt.Optional([new docopt.Option('-h')]), new docopt.Optional([new docopt.Argument('N')])]) - ) - assert.deepEqual( - docopt.parse_pattern('[options]', o), - new docopt.Required([new docopt.Optional([new docopt.OptionsShortcut()])]) - ) - assert.deepEqual( - docopt.parse_pattern('[options] A', o), - new docopt.Required([new docopt.Optional([new docopt.OptionsShortcut()]), new docopt.Argument('A')]) - ) - assert.deepEqual( - docopt.parse_pattern('-v [options]', o), - new docopt.Required([new docopt.Option('-v', '--verbose'), new docopt.Optional([new docopt.OptionsShortcut()])]) - ) - assert.deepEqual docopt.parse_pattern('ADD', o), new docopt.Required([new docopt.Argument('ADD')]) - assert.deepEqual docopt.parse_pattern('<add>', o), new docopt.Required([new docopt.Argument('<add>')]) - assert.deepEqual docopt.parse_pattern('add', o), new docopt.Required([new docopt.Command('add')]) - - - it "test_option_match", -> - assert.deepEqual new docopt.Option('-a').match([new docopt.Option('-a', null, 0, true)]), [true, [], [new docopt.Option('-a', null, 0, true)]] - assert.deepEqual new docopt.Option('-a').match([new docopt.Option('-x')]), [false, [new docopt.Option('-x')], []] - assert.deepEqual new docopt.Option('-a').match([new docopt.Argument('N')]), [false, [new docopt.Argument('N')], []] - assert.deepEqual( - new docopt.Option('-a').match([new docopt.Option('-x'), new docopt.Option('-a'), new docopt.Argument('N')]), - [true, [new docopt.Option('-x'), new docopt.Argument('N')], [new docopt.Option('-a')]] - ) - assert.deepEqual( - new docopt.Option('-a').match([new docopt.Option('-a', null, 0, true), new docopt.Option('-a')]), - [true, [new docopt.Option('-a')], [new docopt.Option('-a', null, 0, true)]] - ) - - - it "test_argument_match", -> - assert.deepEqual new docopt.Argument('N').match([new docopt.Argument(null, 9)]), [true, [], [new docopt.Argument('N', 9)]] - assert.deepEqual new docopt.Argument('N').match([new docopt.Option('-x')]), [false, [new docopt.Option('-x')], []] - assert.deepEqual( - new docopt.Argument('N').match([new docopt.Option('-x'), new docopt.Option('-a'), new docopt.Argument(null, 5)]) - [true, [new docopt.Option('-x'), new docopt.Option('-a')], [new docopt.Argument('N', 5)]] - ) - assert.deepEqual( - new docopt.Argument('N').match([new docopt.Argument(null, 9), new docopt.Argument(null, 0)]) - [true, [new docopt.Argument(null, 0)], [new docopt.Argument('N', 9)]] - ) - - - it "test_command_match", -> - assert.deepEqual( - new docopt.Command('c').match([new docopt.Argument(null, 'c')]) - [true, [], [new docopt.Command('c', true)]] - ) - assert.deepEqual new docopt.Command('c').match([new docopt.Option('-x')]), [false, [new docopt.Option('-x')], []] - assert.deepEqual( - new docopt.Command('c').match([new docopt.Option('-x'), new docopt.Option('-a'), new docopt.Argument(null, 'c')]) - [true, [new docopt.Option('-x'), new docopt.Option('-a')], [new docopt.Command('c', true)]] - ) - assert.deepEqual( - new docopt.Either([new docopt.Command('add', false), new docopt.Command('rm', false)]).match([new docopt.Argument(null, 'rm')]) - [true, [], [new docopt.Command('rm', true)]] - ) - - - it "test_optional_match", -> - assert.deepEqual( - new docopt.Optional([new docopt.Option('-a')]).match([new docopt.Option('-a')]) - [true, [], [new docopt.Option('-a')]] - ) - assert.deepEqual new docopt.Optional([new docopt.Option('-a')]).match([]), [true, [], []] - assert.deepEqual( - new docopt.Optional([new docopt.Option('-a')]).match([new docopt.Option('-x')]), - [true, [new docopt.Option('-x')], []] - ) - assert.deepEqual( - new docopt.Optional([new docopt.Option('-a'), new docopt.Option('-b')]).match([new docopt.Option('-a')]), - [true, [], [new docopt.Option('-a')]] - ) - assert.deepEqual( - new docopt.Optional([new docopt.Option('-a'), new docopt.Option('-b')]).match([new docopt.Option('-b')]), - [true, [], [new docopt.Option('-b')]] - ) - assert.deepEqual( - new docopt.Optional([new docopt.Option('-a'), new docopt.Option('-b')]).match([new docopt.Option('-x')]), - [true, [new docopt.Option('-x')], []] - ) - assert.deepEqual( - new docopt.Optional([new docopt.Argument('N')]).match([new docopt.Argument(null, 9)]), - [true, [], [new docopt.Argument('N', 9)]] - ) - assert.deepEqual( - new docopt.Optional([new docopt.Option('-a'), new docopt.Option('-b')]).match([new docopt.Option('-b'), new docopt.Option('-x'), new docopt.Option('-a')]), - [true, [new docopt.Option('-x')], [new docopt.Option('-a'), new docopt.Option('-b')]] - ) - - - it "test_required_match", -> - assert.deepEqual( - new docopt.Required([new docopt.Option('-a')]).match([new docopt.Option('-a')]) - [true, [], [new docopt.Option('-a')]] - ) - assert.deepEqual new docopt.Required([new docopt.Option('-a')]).match([]), [false, [], []] - assert.deepEqual( - new docopt.Required([new docopt.Option('-a')]).match([new docopt.Option('-x')]) - [false, [new docopt.Option('-x')], []] - ) - assert.deepEqual( - new docopt.Required([new docopt.Option('-a'), new docopt.Option('-b')]).match([new docopt.Option('-a')]) - [false, [new docopt.Option('-a')], []] - ) - - - it "test_either_match", -> - assert.deepEqual( - new docopt.Either([new docopt.Option('-a'), new docopt.Option('-b')]).match([new docopt.Option('-a')]) - [true, [], [new docopt.Option('-a')]] - ) - assert.deepEqual( - new docopt.Either([new docopt.Option('-a'), new docopt.Option('-b')]).match([new docopt.Option('-a'), new docopt.Option('-b')]), - [true, [new docopt.Option('-b')], [new docopt.Option('-a')]] - ) - assert.deepEqual( - new docopt.Either([new docopt.Option('-a'), new docopt.Option('-b')]).match([new docopt.Option('-x')]), - [false, [new docopt.Option('-x')], []] - ) - assert.deepEqual( - new docopt.Either([new docopt.Option('-a'), new docopt.Option('-b'), new docopt.Option('-c')]).match([new docopt.Option('-x'), new docopt.Option('-b')]), - [true, [new docopt.Option('-x')], [new docopt.Option('-b')]] - ) - assert.deepEqual( - new docopt.Either([new docopt.Argument('M'), new docopt.Required([new docopt.Argument('N'), new docopt.Argument('M')])]).match( [new docopt.Argument(null, 1), new docopt.Argument(null, 2)]), - [true, [], [new docopt.Argument('N', 1), new docopt.Argument('M', 2)]] - ) - - - it "test_one_or_more_match", -> - assert.deepEqual( - new docopt.OneOrMore([new docopt.Argument('N')]).match([new docopt.Argument(null, 9)]) - [true, [], [new docopt.Argument('N', 9)]] - ) - assert.deepEqual new docopt.OneOrMore([new docopt.Argument('N')]).match([]), [false, [], []] - assert.deepEqual( - new docopt.OneOrMore([new docopt.Argument('N')]).match([new docopt.Option('-x')]), - [false, [new docopt.Option('-x')], []] - ) - assert.deepEqual( - new docopt.OneOrMore([new docopt.Argument('N')]).match([new docopt.Argument(null, 9), new docopt.Argument(null, 8)]), - [true, [], [new docopt.Argument('N', 9), new docopt.Argument('N', 8)]] - ) - assert.deepEqual( - new docopt.OneOrMore([new docopt.Argument('N')]).match([new docopt.Argument(null, 9), new docopt.Option('-x'), new docopt.Argument(null, 8)]), - [true, [new docopt.Option('-x')], [new docopt.Argument('N', 9), new docopt.Argument('N', 8)]] - ) - assert.deepEqual( - new docopt.OneOrMore([new docopt.Option('-a')]).match([new docopt.Option('-a'), new docopt.Argument(null, 8), new docopt.Option('-a')]), - [true, [new docopt.Argument(null, 8)], [new docopt.Option('-a'), new docopt.Option('-a')]] - ) - assert.deepEqual( - new docopt.OneOrMore([new docopt.Option('-a')]).match([new docopt.Argument(null, 8), new docopt.Option('-x')]), - [false, [new docopt.Argument(null, 8), new docopt.Option('-x')], []] - ) - assert.deepEqual( - new docopt.OneOrMore([new docopt.Required([new docopt.Option('-a'), new docopt.Argument('N')])]).match([new docopt.Option('-a'), new docopt.Argument(null, 1), new docopt.Option('-x'), new docopt.Option('-a'), new docopt.Argument(null, 2)]), - [true, [new docopt.Option('-x')], [new docopt.Option('-a'), new docopt.Argument('N', 1), new docopt.Option('-a'), new docopt.Argument('N', 2)]] - ) - assert.deepEqual( - new docopt.OneOrMore([new docopt.Optional([new docopt.Argument('N')])]).match([new docopt.Argument(null, 9)]), - [true, [], [new docopt.Argument('N', 9)]] - ) - - - it "test_list_argument_match", -> - assert.deepEqual( - new docopt.Required([new docopt.Argument('N'), new docopt.Argument('N')]).fix().match([new docopt.Argument(null, '1'), new docopt.Argument(null, '2')]) - [true, [], [new docopt.Argument('N', ['1', '2'])]] - ) - assert.deepEqual( - new docopt.OneOrMore([new docopt.Argument('N')]).fix().match([new docopt.Argument(null, '1'), new docopt.Argument(null, '2'), new docopt.Argument(null, '3')]) - [true, [], [new docopt.Argument('N', ['1', '2', '3'])]] - ) - assert.deepEqual( - new docopt.Required([new docopt.Argument('N'), new docopt.OneOrMore([new docopt.Argument('N')])]).fix().match([new docopt.Argument(null, '1'), new docopt.Argument(null, '2'), new docopt.Argument(null, '3')]) - [true, [], [new docopt.Argument('N', ['1', '2', '3'])]] - ) - assert.deepEqual( - new docopt.Required([new docopt.Argument('N'), new docopt.Required([new docopt.Argument('N')])]).fix().match([new docopt.Argument(null, '1'), new docopt.Argument(null, '2')]), - [true, [], [new docopt.Argument('N', ['1', '2'])]] - ) - - - it "test_basic_pattern_matching", -> - # ( -a N [ -x Z ] ) - pattern = new docopt.Required([new docopt.Option('-a'), new docopt.Argument('N'), new docopt.Optional([new docopt.Option('-x'), new docopt.Argument('Z')])]) - # -a N - assert.deepEqual( - pattern.match([new docopt.Option('-a'), new docopt.Argument(null, 9)]), - [true, [], [new docopt.Option('-a'), new docopt.Argument('N', 9)]] - ) - # -a -x N Z - assert.deepEqual( - pattern.match([new docopt.Option('-a'), new docopt.Option('-x'), new docopt.Argument(null, 9), new docopt.Argument(null, 5)]), - [true, [], [new docopt.Option('-a'), new docopt.Argument('N', 9), new docopt.Option('-x'), new docopt.Argument('Z', 5)]] - ) - # -x N Z # BZZ! - assert.deepEqual( - pattern.match([new docopt.Option('-x'), new docopt.Argument(null, 9), new docopt.Argument(null, 5)]), - [false, [new docopt.Option('-x'), new docopt.Argument(null, 9), new docopt.Argument(null, 5)], []] - ) - - - it "test_pattern_either", -> - assert.deepEqual docopt.transform(new docopt.Option('-a')), new docopt.Either([new docopt.Required([new docopt.Option('-a')])]) - assert.deepEqual docopt.transform(new docopt.Argument('A')), new docopt.Either([new docopt.Required([new docopt.Argument('A')])]) - assert.deepEqual( - docopt.transform(new docopt.Required([new docopt.Either([new docopt.Option('-a'), new docopt.Option('-b')]), new docopt.Option('-c')])) - new docopt.Either([new docopt.Required([new docopt.Option('-a'), new docopt.Option('-c')]), new docopt.Required([new docopt.Option('-b'), new docopt.Option('-c')])]) - ) - assert.deepEqual( - docopt.transform(new docopt.Optional([new docopt.Option('-a'), new docopt.Either([new docopt.Option('-b'), new docopt.Option('-c')])])) - new docopt.Either([new docopt.Required([new docopt.Option('-b'), new docopt.Option('-a')]), new docopt.Required([new docopt.Option('-c'), new docopt.Option('-a')])]) - ) - assert.deepEqual( - docopt.transform(new docopt.Either([new docopt.Option('-x'), new docopt.Either([new docopt.Option('-y'), new docopt.Option('-z')])])) - new docopt.Either([new docopt.Required([new docopt.Option('-x')]), new docopt.Required([new docopt.Option('-y')]), new docopt.Required([new docopt.Option('-z')])]) - ) - assert.deepEqual( - docopt.transform(new docopt.OneOrMore([new docopt.Argument('N'), new docopt.Argument('M')])) - new docopt.Either([new docopt.Required([new docopt.Argument('N'), new docopt.Argument('M'), new docopt.Argument('N'), new docopt.Argument('M')])]) - ) - - - it "test_pattern_fix_repeating_arguments", -> - assert.deepEqual new docopt.Option('-a').fix_repeating_arguments(), new docopt.Option('-a') - assert.deepEqual new docopt.Argument('N', null).fix_repeating_arguments(), new docopt.Argument('N', null) - assert.deepEqual( - new docopt.Required([new docopt.Argument('N'), new docopt.Argument('N')]).fix_repeating_arguments() - new docopt.Required([new docopt.Argument('N', []), new docopt.Argument('N', [])]) - ) - assert.deepEqual( - new docopt.Either([new docopt.Argument('N'), new docopt.OneOrMore([new docopt.Argument('N')])]).fix() - new docopt.Either([new docopt.Argument('N', []), new docopt.OneOrMore([new docopt.Argument('N', [])])]) - ) - - - # it "test_set", -> - # assert.deepEqual new docopt.Argument('N'), new docopt.Argument('N') - # assert.deepEqual new Set([new docopt.Argument('N'), new docopt.Argument('N')]), new Set([new docopt.Argument('N')]) - - - it "test_pattern_fix_identities_1", -> - pattern = new docopt.Required([new docopt.Argument('N'), new docopt.Argument('N')]) - assert.deepEqual pattern.children[0], pattern.children[1] - assert.notEqual pattern.children[0], pattern.children[1] - pattern.fix_identities() - assert.equal pattern.children[0], pattern.children[1] - - - it "test_pattern_fix_identities_2", -> - pattern = new docopt.Required([new docopt.Optional([new docopt.Argument('X'), new docopt.Argument('N')]), new docopt.Argument('N')]) - assert.deepEqual pattern.children[0].children[1], pattern.children[1] - assert.notEqual pattern.children[0].children[1], pattern.children[1] - pattern.fix_identities() - assert.equal pattern.children[0].children[1], pattern.children[1] - - - it "test_long_options_error_handling", -> - assert.throws( - () -> - docopt.docopt('Usage: prog', {argv: '--non-existent', exit: false}) - , - docopt.DocoptExit - ) - assert.throws( - () -> - docopt.docopt('Usage: prog [--version --verbose]\nOptions: --version\n --verbose', {argv: '--ver', exit: false}) - , - docopt.DocoptExit - ) - assert.throws( - () -> - docopt.docopt('Usage: prog --long\nOptions: --long ARG', {argv: '', exit: false}) - , - docopt.DocoptLanguageError - ) - assert.throws( - () -> - docopt.docopt('Usage: prog --long ARG\nOptions: --long ARG', {argv: '--long', exit: false}) - , - docopt.DocoptExit - ) - assert.throws( - () -> - docopt.docopt('Usage: prog --long=ARG\nOptions: --long', {argv: '', exit: false}) - , - docopt.DocoptLanguageError - ) - assert.throws( - () -> - docopt.docopt('Usage: prog --long\nOptions: --long', {argv: '--long=ARG', exit: false}) - , - docopt.DocoptExit - ) - - - it "test_short_options_error_handling", -> - assert.throws( - () -> - docopt.docopt('Usage: prog -x\nOptions: -x this\n -x that', {argv: '', exit: false}) - , - docopt.DocoptLanguageError - ) - assert.throws( - () -> - docopt.docopt('Usage: prog', {argv: '-x', exit: false}) - , - docopt.DocoptExit - ) - assert.throws( - () -> - docopt.docopt('Usage: prog -o\nOptions: -o ARG', {argv: '', exit: false}) - , - docopt.DocoptLanguageError - ) - assert.throws( - () -> - docopt.docopt('Usage: prog -o ARG\nOptions: -o ARG', {argv: '-o', exit: false}) - , - docopt.DocoptExit - ) - - - it "test_matching_paren", -> - assert.throws( - () -> - docopt.docopt('Usage: prog [a [b]', {argv: '', exit: false}) - , - docopt.DocoptLanguageError - ) - assert.throws( - () -> - docopt.docopt('Usage: prog [a [b] ] c )', {argv: '', exit: false}) - , - docopt.DocoptLanguageError - ) - - - it "test_allow_double_dash", -> - assert.deepEqual( - docopt.docopt('usage: prog [-o] [--] <arg>\nkptions: -o', {argv: '-- -o', exit: false}), - {'-o': false, '<arg>': '-o', '--': true} - ) - assert.deepEqual( - docopt.docopt('usage: prog [-o] [--] <arg>\nkptions: -o', {argv: '-o 1', exit: false}), - {'-o': true, '<arg>': '1', '--': false} - ) - assert.throws( - () -> - docopt.docopt('usage: prog [-o] <arg>\nOptions:-o', {argv: '-- -o', exit: false}) - , - docopt.DocoptExit # "--" is not allowed; FIXME? - ) - - - it "test_docopt", -> - doc = '''Usage: prog [-v] A - - Options: -v Be verbose.''' - assert.deepEqual docopt.docopt(doc, {argv: 'arg', exit: false}), {'-v': false, 'A': 'arg'} - assert.deepEqual docopt.docopt(doc, {argv: '-v arg', exit: false}), {'-v': true, 'A': 'arg'} - - doc = """Usage: prog [-vqr] [FILE] - prog INPUT OUTPUT - prog --help - - Options: - -v print status messages - -q report only file names - -r show all occurrences of the same error - --help - - """ - assert.deepEqual( - docopt.docopt(doc, {argv: '-v file.py', exit: false}) - {'-v': true, '-q': false, '-r': false, '--help': false, 'FILE': 'file.py', 'INPUT': null, 'OUTPUT': null} - ) - assert.deepEqual( - docopt.docopt(doc, {argv: '-v', exit: false}) - {'-v': true, '-q': false, '-r': false, '--help': false, 'FILE': null, 'INPUT': null, 'OUTPUT': null} - ) - assert.throws( - () -> - docopt.docopt(doc, {argv: '-v input.py output.py', exit: false}) - , - docopt.DocoptExit - ) - assert.throws( - () -> - docopt.docopt(doc, {argv: '--fake', exit: false}) - , - docopt.DocoptExit - ) - assert.throws( - () -> - docopt.docopt(doc, {argv: '--hel', exit: false}) - , - Error - ) - - - it "test_language_errors", -> - assert.throws( - () -> - docopt.docopt('no usage with colon here', {argv: '', exit: false}) - , - docopt.DocoptLanguageError - ) - assert.throws( - () -> - docopt.docopt('usage: here \n\n and again usage: here', {argv: '', exit: false}) - , - docopt.DocoptLanguageError - ) - - - it "test_issue_40", -> - assert.throws( - () -> - docopt.docopt('usage: prog --help-commands | --help', {argv: '--help', exit: false}) - , - Error - ) - assert.deepEqual( - docopt.docopt('usage: prog --aabb | --aa', {argv: '--aa', exit: false}), - {'--aabb': false, '--aa': true} - ) - - - # it "test_issue34_unicode_strings", -> - # try: - # assert.deepEqual docopt.docopt(eval("u'usage: prog [-o <a>]'"), ''), - # {'-o': false, '<a>': null} - # except SyntaxError: - # pass # Python 3 - - - it "test_count_multiple_flags", -> - assert.deepEqual docopt.docopt('usage: prog [-v]', {argv: '-v', exit: false}), {'-v': true} - assert.deepEqual docopt.docopt('usage: prog [-vv]', {argv: '', exit: false}), {'-v': 0} - assert.deepEqual docopt.docopt('usage: prog [-vv]', {argv: '-v', exit: false}), {'-v': 1} - assert.deepEqual docopt.docopt('usage: prog [-vv]', {argv: '-vv', exit: false}), {'-v': 2} - assert.throws( - () -> - docopt.docopt('usage: prog [-vv]', {argv: '-vvv', exit: false}) - , - docopt.DocoptExit - ) - assert.deepEqual docopt.docopt('usage: prog [-v | -vv | -vvv]', {argv: '-vvv', exit: false}), {'-v': 3} - assert.deepEqual docopt.docopt('usage: prog -v...', {argv: '-vvvvvv', exit: false}), {'-v': 6} - assert.deepEqual docopt.docopt('usage: prog [--ver --ver]', {argv: '--ver --ver', exit: false}), {'--ver': 2} - - - it "test_any_options_parameter", -> - assert.throws( - () -> - docopt.docopt('usage: prog [options]', {argv: '-foo --bar --spam=eggs', exit: false}) - , - docopt.DocoptExit - ) - assert.throws( - () -> - docopt.docopt('usage: prog [options]', {argv: '--foo --bar --bar', exit: false}) - , - docopt.DocoptExit - ) - assert.throws( - () -> - docopt.docopt('usage: prog [options]', {argv: '--bar --bar --bar -ffff', exit: false}) - , - docopt.DocoptExit - ) - assert.throws( - () -> - docopt.docopt('usage: prog [options]', {argv: '--long=arg --long=another', exit: false}) - , - docopt.DocoptExit - ) - - - it "test_default_value_for_positional_arguments", -> - doc = """Usage: prog [--data=<data>...]\n - Options:\n\t-d --data=<arg> Input data [default: x] - """ - a = docopt.docopt(doc, {argv: '', exit: false}) - assert.deepEqual a, {'--data': ['x']} - doc = """Usage: prog [--data=<data>...]\n - Options:\n\t-d --data=<arg> Input data [default: x y] - """ - a = docopt.docopt(doc, {argv: '', exit: false}) - assert.deepEqual a, {'--data': ['x', 'y']} - doc = """Usage: prog [--data=<data>...]\n - Options:\n\t-d --data=<arg> Input data [default: x y] - """ - a = docopt.docopt(doc, {argv: '--data=this', exit: false}) - assert.deepEqual a, {'--data': ['this']} - - - it "test_issue_59", -> - assert.deepEqual docopt.docopt('usage: prog --long=<a>', {argv: '--long=', exit: false}), {'--long': ''} - assert.deepEqual docopt.docopt('usage: prog -l <a>\nOptions: -l <a>', {argv: ['-l', ''], exit: false}), {'-l': ''} - - - it "test_options_first", -> - assert.deepEqual( - docopt.docopt('usage: prog [--opt] [<args>...]', {argv: '--opt this that', exit: false}) - {'--opt': true, '<args>': ['this', 'that']} - ) - assert.deepEqual( - docopt.docopt('usage: prog [--opt] [<args>...]', {argv: 'this that --opt', exit: false}) - {'--opt': true, '<args>': ['this', 'that']} - ) - assert.deepEqual( - docopt.docopt('usage: prog [--opt] [<args>...]', {argv: 'this that --opt', exit: false, options_first: true}) - {'--opt': false, '<args>': ['this', 'that', '--opt']} - ) - - - it "test_issue_68_options_shortcut_does_not_include_options_in_usage_pattern", -> - args = docopt.docopt('usage: prog [-ab] [options]\nOptions: -x\n -y', {argv: '-ax', exit: false}) - # Need to use `is` (not `==`) since we want to make sure - # that they are not 1/0, but strictly true/false: - assert.equal args['-a'], true - assert.equal args['-b'], false - assert.equal args['-x'], true - assert.equal args['-y'], false - - - it "test_issue_65_evaluate_argv_when_called_not_when_imported", -> - process.argv = ['node', 'prog', '-a'] - assert.deepEqual docopt.docopt('usage: prog [-ab]', {exit: false}), {'-a': true, '-b': false} - process.argv = ['node', 'prog', '-b'] - assert.deepEqual docopt.docopt('usage: prog [-ab]', {exit: false}), {'-a': false, '-b': true} - - - it "test_issue_71_double_dash_is_not_a_valid_option_argument", -> - assert.throws( - () -> - docopt.docopt('usage: prog [--log=LEVEL] [--] <args>...', {argv: '--log -- 1 2', exit: false}) - , - docopt.DocoptExit - ) - assert.throws( - () -> - docopt.docopt('''usage: prog [-l LEVEL] [--] <args>... - Options: -l LEVEL''', {argv: '-l -- 1 2', exit: false}) - , - docopt.DocoptExit - ) - - usage = '''usage: this - - usage:hai - usage: this that - - usage: foo - bar - - PROGRAM USAGE: - foo - bar - usage: - \ttoo - \ttar - Usage: eggs spam - BAZZ - usage: pit stop''' - - it "test_parse_section", -> - assert.deepEqual docopt.parse_section('usage:', 'foo bar fizz buzz'), [] - assert.deepEqual docopt.parse_section('usage:', 'usage: prog'), ['usage: prog'] - assert.deepEqual docopt.parse_section('usage:', 'usage: -x\n -y'), ['usage: -x\n -y'] - assert.deepEqual docopt.parse_section('usage:', usage), [ - 'usage: this', - 'usage:hai', - 'usage: this that', - 'usage: foo\n bar', - 'PROGRAM USAGE:\n foo\n bar', - 'usage:\n\ttoo\n\ttar', - 'Usage: eggs spam', - 'usage: pit stop', - ] - - - it "test_issue_126_defaults_not_parsed_correctly_when_tabs", -> - section = 'Options:\n\t--foo=<arg> [default: bar]' - assert.deepEqual docopt.parse_defaults(section), [new docopt.Option(null, '--foo', 1, 'bar')] diff --git a/node_modules/docopt/test/testcases.coffee b/node_modules/docopt/test/testcases.coffee deleted file mode 100644 index 05b006d63..000000000 --- a/node_modules/docopt/test/testcases.coffee +++ /dev/null @@ -1,63 +0,0 @@ -assert = require 'assert' -path = require 'path' -fs = require 'fs' -docopt = require '../docopt.coffee' - -partition = (text, delimiter) -> - parts = text.split delimiter - return [parts[0], delimiter, parts[1..].join(delimiter)] - -load_test_cases = () -> - testcases_path = path.resolve './test/testcases.docopt' - if fs.existsSync testcases_path - try - return fs.readFileSync(testcases_path).toString() - catch err - return console.error "Could not read ./test/testcases.docopt file" - else - return console.error "./test/testcases.docopt not exists" - -parse_test = (raw) -> - raw = raw.replace(/#.*/gm, '').trim() - if (raw.indexOf '"""') is 0 - raw = raw[3..] - - tests = [] - for fixture in raw.split('r"""') - name = '' - [doc, _, body] = partition fixture, '"""' - cases = [] - for mycase in body.split('$')[1..] - [argv, _, expect] = partition mycase.trim(), '\n' - expect = JSON.parse(expect) - [prog, _, argv] = partition argv.trim(), ' ' - cases.push([prog, argv, expect]) - tests.push [name, doc, cases] - return tests - -collect = () -> - index = 1 - collected = [] - testcases = load_test_cases() - for [name, doc, cases] in parse_test testcases - name = 'testcases.docopt' - for mycase in cases - collected.push [[name, index], doc, mycase] - index++ - return collected - - -describe 'testcases.coffee', -> - collected = collect() - collected.forEach (c) -> - [test_file, index] = c[0] - doc = c[1] - [prog, argv, expected] = c[2] - it "testcase #{index} `#{[prog, argv].join(' ')}`", -> - try - result = docopt.docopt(doc, {name: prog, argv: argv, exit: false}) - catch e - if e.constructor is docopt.DocoptExit - result = 'user-error' - finally - assert.deepEqual result, expected diff --git a/node_modules/docopt/test/testcases.docopt b/node_modules/docopt/test/testcases.docopt deleted file mode 100644 index efe9a07f6..000000000 --- a/node_modules/docopt/test/testcases.docopt +++ /dev/null @@ -1,957 +0,0 @@ -r"""Usage: prog - -""" -$ prog -{} - -$ prog --xxx -"user-error" - - -r"""Usage: prog [options] - -Options: -a All. - -""" -$ prog -{"-a": false} - -$ prog -a -{"-a": true} - -$ prog -x -"user-error" - - -r"""Usage: prog [options] - -Options: --all All. - -""" -$ prog -{"--all": false} - -$ prog --all -{"--all": true} - -$ prog --xxx -"user-error" - - -r"""Usage: prog [options] - -Options: -v, --verbose Verbose. - -""" -$ prog --verbose -{"--verbose": true} - -$ prog --ver -{"--verbose": true} - -$ prog -v -{"--verbose": true} - - -r"""Usage: prog [options] - -Options: -p PATH - -""" -$ prog -p home/ -{"-p": "home/"} - -$ prog -phome/ -{"-p": "home/"} - -$ prog -p -"user-error" - - -r"""Usage: prog [options] - -Options: --path <path> - -""" -$ prog --path home/ -{"--path": "home/"} - -$ prog --path=home/ -{"--path": "home/"} - -$ prog --pa home/ -{"--path": "home/"} - -$ prog --pa=home/ -{"--path": "home/"} - -$ prog --path -"user-error" - - -r"""Usage: prog [options] - -Options: -p PATH, --path=<path> Path to files. - -""" -$ prog -proot -{"--path": "root"} - - -r"""Usage: prog [options] - -Options: -p --path PATH Path to files. - -""" -$ prog -p root -{"--path": "root"} - -$ prog --path root -{"--path": "root"} - - -r"""Usage: prog [options] - -Options: - -p PATH Path to files [default: ./] - -""" -$ prog -{"-p": "./"} - -$ prog -phome -{"-p": "home"} - - -r"""UsAgE: prog [options] - -OpTiOnS: --path=<files> Path to files - [dEfAuLt: /root] - -""" -$ prog -{"--path": "/root"} - -$ prog --path=home -{"--path": "home"} - - -r"""usage: prog [options] - -options: - -a Add - -r Remote - -m <msg> Message - -""" -$ prog -a -r -m Hello -{"-a": true, - "-r": true, - "-m": "Hello"} - -$ prog -armyourass -{"-a": true, - "-r": true, - "-m": "yourass"} - -$ prog -a -r -{"-a": true, - "-r": true, - "-m": null} - - -r"""Usage: prog [options] - -Options: --version - --verbose - -""" -$ prog --version -{"--version": true, - "--verbose": false} - -$ prog --verbose -{"--version": false, - "--verbose": true} - -$ prog --ver -"user-error" - -$ prog --verb -{"--version": false, - "--verbose": true} - - -r"""usage: prog [-a -r -m <msg>] - -options: - -a Add - -r Remote - -m <msg> Message - -""" -$ prog -armyourass -{"-a": true, - "-r": true, - "-m": "yourass"} - - -r"""usage: prog [-armmsg] - -options: -a Add - -r Remote - -m <msg> Message - -""" -$ prog -a -r -m Hello -{"-a": true, - "-r": true, - "-m": "Hello"} - - -r"""usage: prog -a -b - -options: - -a - -b - -""" -$ prog -a -b -{"-a": true, "-b": true} - -$ prog -b -a -{"-a": true, "-b": true} - -$ prog -a -"user-error" - -$ prog -"user-error" - - -r"""usage: prog (-a -b) - -options: -a - -b - -""" -$ prog -a -b -{"-a": true, "-b": true} - -$ prog -b -a -{"-a": true, "-b": true} - -$ prog -a -"user-error" - -$ prog -"user-error" - - -r"""usage: prog [-a] -b - -options: -a - -b - -""" -$ prog -a -b -{"-a": true, "-b": true} - -$ prog -b -a -{"-a": true, "-b": true} - -$ prog -a -"user-error" - -$ prog -b -{"-a": false, "-b": true} - -$ prog -"user-error" - - -r"""usage: prog [(-a -b)] - -options: -a - -b - -""" -$ prog -a -b -{"-a": true, "-b": true} - -$ prog -b -a -{"-a": true, "-b": true} - -$ prog -a -"user-error" - -$ prog -b -"user-error" - -$ prog -{"-a": false, "-b": false} - - -r"""usage: prog (-a|-b) - -options: -a - -b - -""" -$ prog -a -b -"user-error" - -$ prog -"user-error" - -$ prog -a -{"-a": true, "-b": false} - -$ prog -b -{"-a": false, "-b": true} - - -r"""usage: prog [ -a | -b ] - -options: -a - -b - -""" -$ prog -a -b -"user-error" - -$ prog -{"-a": false, "-b": false} - -$ prog -a -{"-a": true, "-b": false} - -$ prog -b -{"-a": false, "-b": true} - - -r"""usage: prog <arg>""" -$ prog 10 -{"<arg>": "10"} - -$ prog 10 20 -"user-error" - -$ prog -"user-error" - - -r"""usage: prog [<arg>]""" -$ prog 10 -{"<arg>": "10"} - -$ prog 10 20 -"user-error" - -$ prog -{"<arg>": null} - - -r"""usage: prog <kind> <name> <type>""" -$ prog 10 20 40 -{"<kind>": "10", "<name>": "20", "<type>": "40"} - -$ prog 10 20 -"user-error" - -$ prog -"user-error" - - -r"""usage: prog <kind> [<name> <type>]""" -$ prog 10 20 40 -{"<kind>": "10", "<name>": "20", "<type>": "40"} - -$ prog 10 20 -{"<kind>": "10", "<name>": "20", "<type>": null} - -$ prog -"user-error" - - -r"""usage: prog [<kind> | <name> <type>]""" -$ prog 10 20 40 -"user-error" - -$ prog 20 40 -{"<kind>": null, "<name>": "20", "<type>": "40"} - -$ prog -{"<kind>": null, "<name>": null, "<type>": null} - - -r"""usage: prog (<kind> --all | <name>) - -options: - --all - -""" -$ prog 10 --all -{"<kind>": "10", "--all": true, "<name>": null} - -$ prog 10 -{"<kind>": null, "--all": false, "<name>": "10"} - -$ prog -"user-error" - - -r"""usage: prog [<name> <name>]""" -$ prog 10 20 -{"<name>": ["10", "20"]} - -$ prog 10 -{"<name>": ["10"]} - -$ prog -{"<name>": []} - - -r"""usage: prog [(<name> <name>)]""" -$ prog 10 20 -{"<name>": ["10", "20"]} - -$ prog 10 -"user-error" - -$ prog -{"<name>": []} - - -r"""usage: prog NAME...""" -$ prog 10 20 -{"NAME": ["10", "20"]} - -$ prog 10 -{"NAME": ["10"]} - -$ prog -"user-error" - - -r"""usage: prog [NAME]...""" -$ prog 10 20 -{"NAME": ["10", "20"]} - -$ prog 10 -{"NAME": ["10"]} - -$ prog -{"NAME": []} - - -r"""usage: prog [NAME...]""" -$ prog 10 20 -{"NAME": ["10", "20"]} - -$ prog 10 -{"NAME": ["10"]} - -$ prog -{"NAME": []} - - -r"""usage: prog [NAME [NAME ...]]""" -$ prog 10 20 -{"NAME": ["10", "20"]} - -$ prog 10 -{"NAME": ["10"]} - -$ prog -{"NAME": []} - - -r"""usage: prog (NAME | --foo NAME) - -options: --foo - -""" -$ prog 10 -{"NAME": "10", "--foo": false} - -$ prog --foo 10 -{"NAME": "10", "--foo": true} - -$ prog --foo=10 -"user-error" - - -r"""usage: prog (NAME | --foo) [--bar | NAME] - -options: --foo -options: --bar - -""" -$ prog 10 -{"NAME": ["10"], "--foo": false, "--bar": false} - -$ prog 10 20 -{"NAME": ["10", "20"], "--foo": false, "--bar": false} - -$ prog --foo --bar -{"NAME": [], "--foo": true, "--bar": true} - - -r"""Naval Fate. - -Usage: - prog ship new <name>... - prog ship [<name>] move <x> <y> [--speed=<kn>] - prog ship shoot <x> <y> - prog mine (set|remove) <x> <y> [--moored|--drifting] - prog -h | --help - prog --version - -Options: - -h --help Show this screen. - --version Show version. - --speed=<kn> Speed in knots [default: 10]. - --moored Mored (anchored) mine. - --drifting Drifting mine. - -""" -$ prog ship Guardian move 150 300 --speed=20 -{"--drifting": false, - "--help": false, - "--moored": false, - "--speed": "20", - "--version": false, - "<name>": ["Guardian"], - "<x>": "150", - "<y>": "300", - "mine": false, - "move": true, - "new": false, - "remove": false, - "set": false, - "ship": true, - "shoot": false} - - -r"""usage: prog --hello""" -$ prog --hello -{"--hello": true} - - -r"""usage: prog [--hello=<world>]""" -$ prog -{"--hello": null} - -$ prog --hello wrld -{"--hello": "wrld"} - - -r"""usage: prog [-o]""" -$ prog -{"-o": false} - -$ prog -o -{"-o": true} - - -r"""usage: prog [-opr]""" -$ prog -op -{"-o": true, "-p": true, "-r": false} - - -r"""usage: prog --aabb | --aa""" -$ prog --aa -{"--aabb": false, "--aa": true} - -$ prog --a -"user-error" # not a unique prefix - -# -# Counting number of flags -# - -r"""Usage: prog -v""" -$ prog -v -{"-v": true} - - -r"""Usage: prog [-v -v]""" -$ prog -{"-v": 0} - -$ prog -v -{"-v": 1} - -$ prog -vv -{"-v": 2} - - -r"""Usage: prog -v ...""" -$ prog -"user-error" - -$ prog -v -{"-v": 1} - -$ prog -vv -{"-v": 2} - -$ prog -vvvvvv -{"-v": 6} - - -r"""Usage: prog [-v | -vv | -vvv] - -This one is probably most readable user-friednly variant. - -""" -$ prog -{"-v": 0} - -$ prog -v -{"-v": 1} - -$ prog -vv -{"-v": 2} - -$ prog -vvvv -"user-error" - - -r"""usage: prog [--ver --ver]""" -$ prog --ver --ver -{"--ver": 2} - - -# -# Counting commands -# - -r"""usage: prog [go]""" -$ prog go -{"go": true} - - -r"""usage: prog [go go]""" -$ prog -{"go": 0} - -$ prog go -{"go": 1} - -$ prog go go -{"go": 2} - -$ prog go go go -"user-error" - -r"""usage: prog go...""" -$ prog go go go go go -{"go": 5} - -# -# [options] does not include options from usage-pattern -# -r"""usage: prog [options] [-a] - -options: -a - -b -""" -$ prog -a -{"-a": true, "-b": false} - -$ prog -aa -"user-error" - -# -# Test [options] shourtcut -# - -r"""Usage: prog [options] A -Options: - -q Be quiet - -v Be verbose. - -""" -$ prog arg -{"A": "arg", "-v": false, "-q": false} - -$ prog -v arg -{"A": "arg", "-v": true, "-q": false} - -$ prog -q arg -{"A": "arg", "-v": false, "-q": true} - -# -# Test single dash -# - -r"""usage: prog [-]""" - -$ prog - -{"-": true} - -$ prog -{"-": false} - -# -# If argument is repeated, its value should always be a list -# - -r"""usage: prog [NAME [NAME ...]]""" - -$ prog a b -{"NAME": ["a", "b"]} - -$ prog -{"NAME": []} - -# -# Option's argument defaults to null/None -# - -r"""usage: prog [options] -options: - -a Add - -m <msg> Message - -""" -$ prog -a -{"-m": null, "-a": true} - -# -# Test options without description -# - -r"""usage: prog --hello""" -$ prog --hello -{"--hello": true} - -r"""usage: prog [--hello=<world>]""" -$ prog -{"--hello": null} - -$ prog --hello wrld -{"--hello": "wrld"} - -r"""usage: prog [-o]""" -$ prog -{"-o": false} - -$ prog -o -{"-o": true} - -r"""usage: prog [-opr]""" -$ prog -op -{"-o": true, "-p": true, "-r": false} - -r"""usage: git [-v | --verbose]""" -$ prog -v -{"-v": true, "--verbose": false} - -r"""usage: git remote [-v | --verbose]""" -$ prog remote -v -{"remote": true, "-v": true, "--verbose": false} - -# -# Test empty usage pattern -# - -r"""usage: prog""" -$ prog -{} - -r"""usage: prog - prog <a> <b> -""" -$ prog 1 2 -{"<a>": "1", "<b>": "2"} - -$ prog -{"<a>": null, "<b>": null} - -r"""usage: prog <a> <b> - prog -""" -$ prog -{"<a>": null, "<b>": null} - -# -# Option's argument should not capture default value from usage pattern -# - -r"""usage: prog [--file=<f>]""" -$ prog -{"--file": null} - -r"""usage: prog [--file=<f>] - -options: --file <a> - -""" -$ prog -{"--file": null} - -r"""Usage: prog [-a <host:port>] - -Options: -a, --address <host:port> TCP address [default: localhost:6283]. - -""" -$ prog -{"--address": "localhost:6283"} - -# -# If option with argument could be repeated, -# its arguments should be accumulated into a list -# - -r"""usage: prog --long=<arg> ...""" - -$ prog --long one -{"--long": ["one"]} - -$ prog --long one --long two -{"--long": ["one", "two"]} - -# -# Test multiple elements repeated at once -# - -r"""usage: prog (go <direction> --speed=<km/h>)...""" -$ prog go left --speed=5 go right --speed=9 -{"go": 2, "<direction>": ["left", "right"], "--speed": ["5", "9"]} - -# -# Required options should work with option shortcut -# - -r"""usage: prog [options] -a - -options: -a - -""" -$ prog -a -{"-a": true} - -# -# If option could be repeated its defaults should be split into a list -# - -r"""usage: prog [-o <o>]... - -options: -o <o> [default: x] - -""" -$ prog -o this -o that -{"-o": ["this", "that"]} - -$ prog -{"-o": ["x"]} - -r"""usage: prog [-o <o>]... - -options: -o <o> [default: x y] - -""" -$ prog -o this -{"-o": ["this"]} - -$ prog -{"-o": ["x", "y"]} - -# -# Test stacked option's argument -# - -r"""usage: prog -pPATH - -options: -p PATH - -""" -$ prog -pHOME -{"-p": "HOME"} - -# -# Issue 56: Repeated mutually exclusive args give nested lists sometimes -# - -r"""Usage: foo (--xx=x|--yy=y)...""" -$ prog --xx=1 --yy=2 -{"--xx": ["1"], "--yy": ["2"]} - -# -# POSIXly correct tokenization -# - -r"""usage: prog [<input file>]""" -$ prog f.txt -{"<input file>": "f.txt"} - -r"""usage: prog [--input=<file name>]...""" -$ prog --input a.txt --input=b.txt -{"--input": ["a.txt", "b.txt"]} - -# -# Issue 85: `[options]` shourtcut with multiple subcommands -# - -r"""usage: prog good [options] - prog fail [options] - -options: --loglevel=N - -""" -$ prog fail --loglevel 5 -{"--loglevel": "5", "fail": true, "good": false} - -# -# Usage-section syntax -# - -r"""usage:prog --foo""" -$ prog --foo -{"--foo": true} - -r"""PROGRAM USAGE: prog --foo""" -$ prog --foo -{"--foo": true} - -r"""Usage: prog --foo - prog --bar -NOT PART OF SECTION""" -$ prog --foo -{"--foo": true, "--bar": false} - -r"""Usage: - prog --foo - prog --bar - -NOT PART OF SECTION""" -$ prog --foo -{"--foo": true, "--bar": false} - -r"""Usage: - prog --foo - prog --bar -NOT PART OF SECTION""" -$ prog --foo -{"--foo": true, "--bar": false} - -# -# Options-section syntax -# - -r"""Usage: prog [options] - -global options: --foo -local options: --baz - --bar -other options: - --egg - --spam --not-an-option- - -""" -$ prog --baz --egg -{"--foo": false, "--baz": true, "--bar": false, "--egg": true, "--spam": false} diff --git a/node_modules/fs-access/index.js b/node_modules/fs-access/index.js deleted file mode 100644 index 094537a45..000000000 --- a/node_modules/fs-access/index.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; -var fs = require('fs'); -var nullCheck = require('null-check'); - -var access = module.exports = function (pth, mode, cb) { - if (typeof pth !== 'string') { - throw new TypeError('path must be a string'); - } - - if (typeof mode === 'function') { - cb = mode; - mode = access.F_OK; - } else if (typeof cb !== 'function') { - throw new TypeError('callback must be a function'); - } - - if (!nullCheck(pth, cb)) { - return; - } - - mode = mode | 0; - - if (mode === access.F_OK) { - fs.stat(pth, cb); - } -}; - -access.sync = function (pth, mode) { - nullCheck(pth); - - mode = mode === undefined ? access.F_OK : mode | 0; - - if (mode === access.F_OK) { - fs.statSync(pth); - } -}; - -access.F_OK = 0; -access.R_OK = 4; -access.W_OK = 2; -access.X_OK = 1; diff --git a/node_modules/fs-access/license b/node_modules/fs-access/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/fs-access/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/node_modules/fs-access/package.json b/node_modules/fs-access/package.json deleted file mode 100644 index f98df6784..000000000 --- a/node_modules/fs-access/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_args": [ - [ - "fs-access@1.0.1", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_development": true, - "_from": "fs-access@1.0.1", - "_id": "fs-access@1.0.1", - "_inBundle": false, - "_integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", - "_location": "/fs-access", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "fs-access@1.0.1", - "name": "fs-access", - "escapedName": "fs-access", - "rawSpec": "1.0.1", - "saveSpec": null, - "fetchSpec": "1.0.1" - }, - "_requiredBy": [ - "/licensee" - ], - "_resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", - "_spec": "1.0.1", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/fs-access/issues" - }, - "dependencies": { - "null-check": "^1.0.0" - }, - "description": "Node.js 0.12 fs.access() & fs.accessSync() ponyfill", - "devDependencies": { - "os-tmpdir": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/fs-access#readme", - "keywords": [ - "built-in", - "core", - "ponyfill", - "polyfill", - "shim", - "fs", - "access", - "stat", - "mode", - "permission", - "user", - "process", - "check" - ], - "license": "MIT", - "name": "fs-access", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/fs-access.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.1" -} diff --git a/node_modules/fs-access/readme.md b/node_modules/fs-access/readme.md deleted file mode 100644 index 89e96e750..000000000 --- a/node_modules/fs-access/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# fs-access [![Build Status](https://travis-ci.org/sindresorhus/fs-access.svg?branch=master)](https://travis-ci.org/sindresorhus/fs-access) - -> Node.js 0.12 [`fs.access()`](https://nodejs.org/api/fs.html#fs_fs_access_path_mode_callback) & [`fs.accessSync()`](https://nodejs.org/api/fs.html#fs_fs_accesssync_path_mode) [ponyfill](https://ponyfill.com) - - -## Install - -``` -$ npm install --save fs-access -``` - - -## Usage - -```js -var fsAccess = require('fs-access'); - -fsAccess('unicorn.txt', function (err) { - if (err) { - console.error('no access'); - return; - } - - console.log('access'); -}); -``` - -```js -var fsAccess = require('fs-access'); - -try { - fsAccess.sync('unicorn.txt'); - console.log('access'); -} catch (err) { - console.error('no access'); -} -``` - - -## API - -See the [`fs.access()` & `fs.accessSync()` docs](https://nodejs.org/api/fs.html#fs_fs_access_path_mode_callback). - -Mode flags are on the `fsAccess` instance instead of `fs`. - -Only the `F_OK` mode is supported for now. [Help welcome for additional modes.](https://github.com/sindresorhus/fs-access/issues/1) - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/json-parse-errback/LICENSE b/node_modules/json-parse-errback/LICENSE deleted file mode 100644 index 2966484fe..000000000 --- a/node_modules/json-parse-errback/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -SPDX:MIT - -MIT License - -Copyright (c) 2016 Kyle E. Mitchell - -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/node_modules/json-parse-errback/README.md b/node_modules/json-parse-errback/README.md deleted file mode 100644 index bddd4cee6..000000000 --- a/node_modules/json-parse-errback/README.md +++ /dev/null @@ -1,13 +0,0 @@ -```javascript -module.exports = function (input, callback) { - var result - try { - result = JSON.parse(input) - } catch (error) { - return callback(error) - } - callback(null, result) -} -``` - -"That's all, folks!" diff --git a/node_modules/json-parse-errback/index.js b/node_modules/json-parse-errback/index.js deleted file mode 100644 index 2dfd5cb1f..000000000 --- a/node_modules/json-parse-errback/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = function (input, callback) { - var result - try { - result = JSON.parse(input) - } catch (error) { - return callback(error) - } - callback(null, result) -} - - - - diff --git a/node_modules/json-parse-errback/package.json b/node_modules/json-parse-errback/package.json deleted file mode 100644 index 141509a6f..000000000 --- a/node_modules/json-parse-errback/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_args": [ - [ - "json-parse-errback@2.0.1", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_development": true, - "_from": "json-parse-errback@2.0.1", - "_id": "json-parse-errback@2.0.1", - "_inBundle": false, - "_integrity": "sha1-x6nCvjqFWzQvgqv8ibyFk1tYhPo=", - "_location": "/json-parse-errback", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "json-parse-errback@2.0.1", - "name": "json-parse-errback", - "escapedName": "json-parse-errback", - "rawSpec": "2.0.1", - "saveSpec": null, - "fetchSpec": "2.0.1" - }, - "_requiredBy": [ - "/licensee" - ], - "_resolved": "https://registry.npmjs.org/json-parse-errback/-/json-parse-errback-2.0.1.tgz", - "_spec": "2.0.1", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "https://kemitchell.com/" - }, - "bugs": { - "url": "https://github.com/kemitchell/json-parse-errback.js/issues" - }, - "description": "parse(input, function(error, object) { ... })", - "devDependencies": { - "defence-cli": "^1.0.5" - }, - "files": [ - "LICENSE", - "README.md", - "index.js" - ], - "homepage": "https://github.com/kemitchell/json-parse-errback.js#readme", - "license": "MIT", - "name": "json-parse-errback", - "repository": { - "type": "git", - "url": "git+https://github.com/kemitchell/json-parse-errback.js.git" - }, - "scripts": { - "prepublish": "defence < README.md > index.js" - }, - "version": "2.0.1" -} diff --git a/node_modules/licensee/LICENSE b/node_modules/licensee/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/node_modules/licensee/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/node_modules/licensee/README.md b/node_modules/licensee/README.md deleted file mode 100644 index e401e27d6..000000000 --- a/node_modules/licensee/README.md +++ /dev/null @@ -1,132 +0,0 @@ -Check npm package dependency license metadata against rules. - -# Configuration - -Licensee accepts two kinds of configuration: - -1. a rule about permitted licenses -2. a package whitelist of name-and-range pairs - -You can set configuration with command flags or a `.licensee.json` -file at the root of your package, like so: - -```json -{ - "license": "(MIT OR BSD-2-Clause OR BSD-3-Clause OR Apache-2.0)", - "whitelist": { - "optimist": "<=0.6.1" - } -} -``` - -The `license` property is an SPDX license expression that -[spdx-expression-parse][parse] can parse. Any package with [standard -license metadata][metadata] that satisfies the SPDX license expression -according to [spdx-satisfies][satisfies] will not cause an error. - -[parse]: https://www.npmjs.com/package/spdx-expression-parse -[satisfies]: https://www.npmjs.com/package/spdx-satisfies - -The `whitelist` is a map from package name to a [node-semver][semver] -Semantic Versioning range. Packages whose license metadata don't match -the SPDX license expression in `license` but have a name and version -described in `whitelist` will not cause an error. - -[metadata]: https://docs.npmjs.com/files/package.json#license -[semver]: https://www.npmjs.com/package/semver - -# Use - -To install and use `licensee` globally: - -```bash -npm install --global licensee -cd your-package -licensee --init -licensee -``` - -The `licensee` script prints a report about dependencies and their -license terms to standard output. It exits with status `0` when all -packages in `./node_modules` meet the configured licensing criteria -and `1` when one or more do not. - -To install it as a development dependency of your package: - -```bash -cd your-package -npm install --save-dev licensee -``` - -Consider adding `licensee` to your npm scripts: - -```json -{ - "scripts": { - "posttest": "licensee" - } -} -``` - -For output as newline-delimited JSON objects, for further processing: - -```json -{ - "scripts": { - "posttest": "licensee --ndjson" - } -} -``` - -To skip the readout of license information: - -```json -{ - "scripts": { - "posttest": "licensee --quiet" - } -} -``` - -If you want a readout of dependency information, but don't want -your continuous integration going red, you can ignore `licensee`'s -exit code: - -```json -{ - "scripts": { - "posttest": "licensee || true" - } -} -``` - -To save the readout of license information to a file: - -```json -{ - "scripts": { - "posttest": "licensee | tee LICENSES || true" - } -} -``` - -Alternatively, for a readout of just packages without approved licenses: - -```json -{ - "scripts": { - "posttest": "licensee --errors-only" - } -} -``` - -# JavaScript Module - -The package exports an asynchronous function of three arguments: - -1. A configuration object in the same form as `.licensee.json`. - -2. The path of the package to check. - -3. An error-first callback that yields an array of objects, one per - dependency. diff --git a/node_modules/licensee/index.js b/node_modules/licensee/index.js deleted file mode 100644 index fc02d0a26..000000000 --- a/node_modules/licensee/index.js +++ /dev/null @@ -1,212 +0,0 @@ -module.exports = licensee - -var licenseSatisfies = require('spdx-satisfies') -var parseJSON = require('json-parse-errback') -var readPackageTree = require('read-package-tree') -var runParallel = require('run-parallel') -var satisfies = require('semver').satisfies -var simpleConcat = require('simple-concat') -var spawn = require('child_process').spawn -var validSPDX = require('spdx-expression-validate') - -function licensee (configuration, path, callback) { - if (!validConfiguration(configuration)) { - callback(new Error('Invalid configuration')) - } else if (!validSPDX(configuration.license)) { - callback(new Error('Invalid license expression')) - } else { - if (configuration.productionOnly) { - // In order to ignore devDependencies, we need to read: - // - // 1. the dependencies-only dependency graph, from - // `npm ls --json --production` - // - // 2. the structure of `node_modules` and `package.json` - // files within it, with read-package-tree. - // - // `npm ls` calls read-package-tree internally, but does - // lots of npm-specific post-processing to produce the - // dependency tree. Calling read-package-tree twice, at - // the same time, is far from efficient. But it works, - // and doing so helps keep this package small. - runParallel({ - dependencies: readDependencyList, - packages: readFilesystemTree - }, function (error, trees) { - if (error) callback(error) - else withTrees(trees.packages, trees.dependencies) - }) - } else { - // If we are analyzing _all_ installed dependencies, - // and don't care whether they're devDependencies - // or not, just read `node_modules`. We don't need - // the dependency graph. - readFilesystemTree(function (error, packages) { - if (error) callback(error) - else withTrees(packages, false) - }) - } - } - - function withTrees (packages, dependencies) { - callback(null, findIssues( - configuration, packages, dependencies, [] - )) - } - - function readDependencyList (done) { - var child = spawn( - 'npm', ['ls', '--production', '--json'], {cwd: path} - ) - var outputError - var json - simpleConcat(child.stdout, function (error, buffer) { - if (error) outputError = error - else json = buffer - }) - child.once('close', function (code) { - if (code !== 0) { - done(new Error('npm exited with status ' + code)) - } else if (outputError) { - done(outputError) - } else { - parseJSON(json, function (error, graph) { - if (error) return done(error) - if (!graph.hasOwnProperty('dependencies')) { - done(new Error('cannot interpret npm ls --json output')) - } else { - var flattened = {} - flattenDependencyTree(graph.dependencies, flattened) - done(null, flattened) - } - }) - } - }) - } - - function readFilesystemTree (done) { - readPackageTree(path, function (error, tree) { - if (error) return done(error) - done(null, tree.children) - }) - } -} - -var KEY_PREFIX = '.' - -function flattenDependencyTree (graph, object) { - Object.keys(graph).forEach(function (name) { - var node = graph[name] - var version = node.version - var key = KEY_PREFIX + name - if ( - object.hasOwnProperty(key) && - object[key].indexOf(version) === -1 - ) { - object[key].push(version) - } else { - object[key] = [version] - } - if (node.hasOwnProperty('dependencies')) { - flattenDependencyTree(node.dependencies, object) - } - }) -} - -function validConfiguration (configuration) { - return ( - isObject(configuration) && - // Validate `license` property. - configuration.hasOwnProperty('license') && - isString(configuration.license) && - configuration.license.length > 0 && ( - configuration.hasOwnProperty('whitelist') - ? ( - // Validate `whitelist` property. - isObject(configuration.whitelist) && - Object.keys(configuration.whitelist) - .every(function (key) { - return isString(configuration.whitelist[key]) - }) - ) : true - ) - ) -} - -function isObject (argument) { - return typeof argument === 'object' -} - -function isString (argument) { - return typeof argument === 'string' -} - -function findIssues (configuration, children, dependencies, results) { - if (Array.isArray(children)) { - children.forEach(function (child) { - if ( - !configuration.productionOnly || - appearsIn(child, dependencies) - ) { - results.push(resultForPackage(configuration, child)) - findIssues(configuration, child, dependencies, results) - } - if (child.children) { - findIssues(configuration, child.children, dependencies, results) - } - }) - return results - } else return results -} - -function appearsIn (installed, dependencies) { - var name = installed.package.name - var key = KEY_PREFIX + name - var version = installed.package.version - return ( - dependencies.hasOwnProperty(key) && - dependencies[key].indexOf(version) !== -1 - ) -} - -function resultForPackage (configuration, tree) { - var licenseExpression = configuration.license - var whitelist = configuration.whitelist || {} - var result = { - name: tree.package.name, - license: tree.package.license, - author: tree.package.author, - contributors: tree.package.contributors, - repository: tree.package.repository, - homepage: tree.package.homepage, - version: tree.package.version, - parent: tree.parent, - path: tree.path - } - var whitelisted = Object.keys(whitelist).some(function (name) { - return ( - tree.package.name === name && - satisfies(tree.package.version, whitelist[name]) === true - ) - }) - if (whitelisted) { - result.approved = true - result.whitelisted = true - } else { - var matchesRule = ( - licenseExpression && - validSPDX(licenseExpression) && - tree.package.license && - typeof tree.package.license === 'string' && - validSPDX(tree.package.license) && - licenseSatisfies(tree.package.license, licenseExpression) - ) - if (matchesRule) { - result.approved = true - result.rule = true - } else { - result.approved = false - } - } - return result -} diff --git a/node_modules/licensee/licensee b/node_modules/licensee/licensee deleted file mode 100755 index 297798ef0..000000000 --- a/node_modules/licensee/licensee +++ /dev/null @@ -1,242 +0,0 @@ -#!/usr/bin/env node -var access = require('fs-access') -var docopt = require('docopt') -var fs = require('fs') -var path = require('path') -var validSPDX = require('spdx-expression-validate') - -var USAGE = [ - 'Check npm package dependency license metadata against rules.', - '', - 'Usage:', - ' licensee [options]', - ' licensee --license=EXPRESSION [--whitelist=LIST] [options]', - '', - 'Options:', - ' --init Create a .licensee.json file.', - ' --license EXPRESSION Permit licenses matching SPDX expression.', - ' --whitelist LIST Permit comma-delimited name@range.', - ' --errors-only Only show NOT APPROVED packages.', - ' --production Do not check devDependencies.', - ' --ndjson Print newline-delimited JSON objects.', - ' --quiet Quiet mode, only exit(0/1).', - ' -h, --help Print this screen to standard output.', - ' -v, --version Print version to standard output.' -].join('\n') - -var options = docopt.docopt(USAGE, { - version: require('./package.json').version -}) - -var cwd = process.cwd() -var configuration -var configurationPath = path.join(cwd, '.licensee.json') - -if (options['--init']) { - fs.writeFile( - configurationPath, - JSON.stringify({ - license: ( - options['--expression'] || - '(MIT OR BSD-2-Clause OR BSD-3-Clause OR Apache-2.0)' - ), - whitelist: ( - options['--whitelist'] - ? parseWhitelist(options['--whitelist']) - : {optimist: '<=0.6.1'} - ) - }, null, 2) + '\n', - { - encoding: 'utf8', - flag: 'wx' - }, - function (error) { - if (error) { - if (error.code === 'EEXIST') { - die(configurationPath + ' already exists.') - } else { - die('Could not create ' + configurationPath + '.') - } - } else { - process.stdout.write('Created ' + configurationPath + '.\n') - process.exit(0) - } - } - ) -} else if (options['--license'] || options['--whitelist']) { - configuration = { - license: options['--license'] || undefined, - whitelist: options['--whitelist'] - ? parseWhitelist(options['--whitelist']) - : {} - } - checkDependencies() -} else { - access(configurationPath, function (error) { - if (error) { - die( - [ - 'Cannot read ' + configurationPath + '.', - 'Create ' + configurationPath + ' with licensee --init', - 'or configure with --license and --whitelist.', - 'See licensee --help for more information.' - ].join('\n') - ) - } else { - fs.readFile(configurationPath, function (error, data) { - if (error) { - die('Error reading ' + configurationPath) - } else { - try { - configuration = JSON.parse(data) - } catch (error) { - die('Error parsing ' + configurationPath) - } - checkDependencies() - } - }) - } - }) -} - -function checkDependencies () { - configuration.productionOnly = options['--production'] - require('./')(configuration, cwd, function (error, dependencies) { - if (error) { - die(error.message + '\n') - } else { - if (dependencies.length === 0) { - process.exit(0) - } else { - var errorsOnly = !!options['--errors-only'] - var quiet = !!options['--quiet'] - var ndjson = !!options['--ndjson'] - var haveIssue = false - dependencies.forEach(function (dependency) { - if (!dependency.approved) { - haveIssue = true - } - if (!quiet) { - if (errorsOnly) { - if (!dependency.approved) { - print(dependency, ndjson) - } - } else { - print(dependency, ndjson) - } - } - }) - process.exit(haveIssue ? 1 : 0) - } - } - }) -} - -function print (dependency, ndjson) { - if (ndjson) { - process.stdout.write(toJSON(dependency) + '\n') - } else { - process.stdout.write(toText(dependency) + '\n') - } -} - -function toText (result) { - return ( - result.name + '@' + result.version + '\n' + - ( - result.approved - ? ( - ' Approved by ' + - (result.whitelisted ? 'whitelist' : 'rule') + '\n' - ) - : ' NOT APPROVED\n' - ) + - ' Terms: ' + displayLicense(result.license) + '\n' + - ' Repository: ' + formatRepo(result.repository) + '\n' + - ' Homepage: ' + formatRepo(result.homepage) + '\n' + - ' Author: ' + formatPerson(result.author) + '\n' + - ' Contributors:' + formatPeople(result.contributors) + '\n' - ) -} - -function toJSON (dependency) { - var returned = {} - Object.keys(dependency).forEach(function (key) { - if (key !== 'parent') { - returned[key] = dependency[key] - } - }) - return JSON.stringify(returned) -} - -function displayLicense (license) { - if (typeof license === 'string') { - if (validSPDX(license)) { - return license - } else { - return 'Invalid SPDX expression "' + license + '"' - } - } else if (Array.isArray(license)) { - return JSON.stringify(license) - } else { - return 'Invalid license metadata' - } -} - -function formatPeople (people) { - if (Array.isArray(people)) { - return '\n' + people - .map(function (person) { - return ' ' + formatPerson(person) - }) - .join('\n') - } else if (typeof people === 'string') { - return ' ' + people - } else { - return ' None listed' - } -} - -function formatPerson (person) { - if (!person) { - return 'None listed' - } else if (typeof person === 'string') { - return person - } else { - return ( - person.name + - (person.email ? ' <' + person.email + '>' : '') + - (person.url ? ' (' + person.url + ')' : '') - ) - } -} - -function formatRepo (repo) { - if (repo) { - if (typeof repo === 'string') { - return repo - } else if (repo.hasOwnProperty('url')) { - return repo.url - } - } else { - return 'None listed' - } -} - -function die (message) { - process.stderr.write(message + '\n') - process.exit(1) -} - -function parseWhitelist (string) { - return string - .split(',') - .map(function (string) { - return string.trim() - }) - .reduce(function (whitelist, string) { - var split = string.split('@') - whitelist[split[0]] = split[1] - return whitelist - }, {}) -} diff --git a/node_modules/licensee/package.json b/node_modules/licensee/package.json deleted file mode 100644 index 8319cbe87..000000000 --- a/node_modules/licensee/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_args": [ - [ - "licensee@5.0.0", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_development": true, - "_from": "licensee@5.0.0", - "_id": "licensee@5.0.0", - "_inBundle": false, - "_integrity": "sha512-g243BLsJYWWyNhwDEMewc2f6Ebyy1yiJmMDgO8MCQtLOXA8JO4O2/kbJ1QwwWdlmrwDgYECdl9CJBrKsr4ZezA==", - "_location": "/licensee", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "licensee@5.0.0", - "name": "licensee", - "escapedName": "licensee", - "rawSpec": "5.0.0", - "saveSpec": null, - "fetchSpec": "5.0.0" - }, - "_requiredBy": [ - "#DEV:/" - ], - "_resolved": "https://registry.npmjs.org/licensee/-/licensee-5.0.0.tgz", - "_spec": "5.0.0", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "https://kemitchell.com/" - }, - "bin": { - "licensee": "./licensee" - }, - "bugs": { - "url": "https://github.com/jslicense/licensee.js/issues" - }, - "contributors": [ - { - "name": "Jakob Krigovsky", - "email": "jakob@krigovsky.com" - } - ], - "dependencies": { - "docopt": "^0.6.2", - "fs-access": "^1.0.0", - "json-parse-errback": "^2.0.1", - "read-package-tree": "^5.2.1", - "run-parallel": "^1.1.9", - "semver": "^5.5.0", - "simple-concat": "^1.0.0", - "spdx-expression-validate": "^1.0.1", - "spdx-satisfies": "^4.0.0" - }, - "description": "check dependency licenses against rules", - "devDependencies": { - "spawn-sync": "^1.0.15", - "standard": "^11.0.1", - "tap": "^12.0.1" - }, - "files": [ - "LICENSE", - "NOTICE", - "index.js", - "licensee" - ], - "homepage": "https://github.com/jslicense/licensee.js#readme", - "license": "Apache-2.0", - "name": "licensee", - "repository": { - "type": "git", - "url": "git+https://github.com/jslicense/licensee.js.git" - }, - "scripts": { - "style": "standard", - "test": "tap tests/**/test.js" - }, - "version": "5.0.0" -} diff --git a/node_modules/null-check/index.js b/node_modules/null-check/index.js deleted file mode 100644 index 6befbeb3f..000000000 --- a/node_modules/null-check/index.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; -module.exports = function (pth, cb) { - if (String(pth).indexOf('\u0000') !== -1) { - var err = new Error('Path must be a string without null bytes.'); - err.code = 'ENOENT'; - - if (typeof cb !== 'function') { - throw err; - } - - process.nextTick(function () { - cb(err); - }); - - return false; - } - - return true; -} diff --git a/node_modules/null-check/license b/node_modules/null-check/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/null-check/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/node_modules/null-check/package.json b/node_modules/null-check/package.json deleted file mode 100644 index e269dca66..000000000 --- a/node_modules/null-check/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_args": [ - [ - "null-check@1.0.0", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_development": true, - "_from": "null-check@1.0.0", - "_id": "null-check@1.0.0", - "_inBundle": false, - "_integrity": "sha1-l33/1xdgErnsMNKjnbXPcqBDnt0=", - "_location": "/null-check", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "null-check@1.0.0", - "name": "null-check", - "escapedName": "null-check", - "rawSpec": "1.0.0", - "saveSpec": null, - "fetchSpec": "1.0.0" - }, - "_requiredBy": [ - "/fs-access" - ], - "_resolved": "https://registry.npmjs.org/null-check/-/null-check-1.0.0.tgz", - "_spec": "1.0.0", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/null-check/issues" - }, - "description": "Ensure a path doesn't contain null bytes", - "devDependencies": { - "ava": "0.0.4" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/null-check#readme", - "keywords": [ - "built-in", - "core", - "ponyfill", - "polyfill", - "shim", - "fs", - "path", - "null", - "bytes", - "check" - ], - "license": "MIT", - "name": "null-check", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/null-check.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.0" -} diff --git a/node_modules/null-check/readme.md b/node_modules/null-check/readme.md deleted file mode 100644 index dfb55a310..000000000 --- a/node_modules/null-check/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# null-check [![Build Status](https://travis-ci.org/sindresorhus/null-check.svg?branch=master)](https://travis-ci.org/sindresorhus/null-check) - -> Ensure a path doesn't contain [null bytes](http://en.wikipedia.org/wiki/Null_character) - -The same check as done in all the core [`fs` methods](https://github.com/iojs/io.js/blob/18d457bd3408557a48b453f13b2b99e1ab5e7159/lib/fs.js#L88-L102). - - -## Install - -``` -$ npm install --save null-check -``` - - -## Usage - -```js -var nullCheck = require('null-check'); - -nullCheck('unicorn.png\u0000', function (err) { - console.log(err); - //=> { [Error: Path must be a string without null bytes.] code: 'ENOENT' } -}); -//=> false - -// the method is sync without a callback -nullCheck('unicorn.png'); -//=> true -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/simple-concat/.travis.yml b/node_modules/simple-concat/.travis.yml deleted file mode 100644 index f178ec0d8..000000000 --- a/node_modules/simple-concat/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 'node' diff --git a/node_modules/simple-concat/LICENSE b/node_modules/simple-concat/LICENSE deleted file mode 100644 index c7e685275..000000000 --- a/node_modules/simple-concat/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Feross Aboukhadijeh - -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/node_modules/simple-concat/README.md b/node_modules/simple-concat/README.md deleted file mode 100644 index 572e99c7c..000000000 --- a/node_modules/simple-concat/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# simple-concat [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] - -[travis-image]: https://img.shields.io/travis/feross/simple-concat/master.svg -[travis-url]: https://travis-ci.org/feross/simple-concat -[npm-image]: https://img.shields.io/npm/v/simple-concat.svg -[npm-url]: https://npmjs.org/package/simple-concat -[downloads-image]: https://img.shields.io/npm/dm/simple-concat.svg -[downloads-url]: https://npmjs.org/package/simple-concat - -### Super-minimalist version of `concat-stream`. Less than 15 lines! - -## install - -``` -npm install simple-concat -``` - -## usage - -This example is longer than the implementation. - -```js -var s = new stream.PassThrough() -concat(s, function (err, buf) { - if (err) throw err - console.error(buf) -}) -s.write('abc') -setTimeout(function () { - s.write('123') -}, 10) -setTimeout(function () { - s.write('456') -}, 20) -setTimeout(function () { - s.end('789') -}, 30) -``` - -## license - -MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org). diff --git a/node_modules/simple-concat/index.js b/node_modules/simple-concat/index.js deleted file mode 100644 index c2d88600c..000000000 --- a/node_modules/simple-concat/index.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = function (stream, cb) { - var chunks = [] - stream.on('data', function (chunk) { - chunks.push(chunk) - }) - stream.once('end', function () { - if (cb) cb(null, Buffer.concat(chunks)) - cb = null - }) - stream.once('error', function (err) { - if (cb) cb(err) - cb = null - }) -} diff --git a/node_modules/simple-concat/package.json b/node_modules/simple-concat/package.json deleted file mode 100644 index 81f0174e2..000000000 --- a/node_modules/simple-concat/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_args": [ - [ - "simple-concat@1.0.0", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_development": true, - "_from": "simple-concat@1.0.0", - "_id": "simple-concat@1.0.0", - "_inBundle": false, - "_integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", - "_location": "/simple-concat", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "simple-concat@1.0.0", - "name": "simple-concat", - "escapedName": "simple-concat", - "rawSpec": "1.0.0", - "saveSpec": null, - "fetchSpec": "1.0.0" - }, - "_requiredBy": [ - "/licensee" - ], - "_resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", - "_spec": "1.0.0", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Feross Aboukhadijeh", - "email": "feross@feross.org", - "url": "http://feross.org/" - }, - "bugs": { - "url": "https://github.com/feross/simple-concat/issues" - }, - "dependencies": {}, - "description": "Super-minimalist version of `concat-stream`. Less than 15 lines!", - "devDependencies": { - "standard": "^6.0.8", - "tape": "^4.0.0" - }, - "homepage": "https://github.com/feross/simple-concat", - "keywords": [ - "concat", - "concat-stream", - "concat stream" - ], - "license": "MIT", - "main": "index.js", - "name": "simple-concat", - "repository": { - "type": "git", - "url": "git://github.com/feross/simple-concat.git" - }, - "scripts": { - "test": "standard && tape test/*.js" - }, - "version": "1.0.0" -} diff --git a/node_modules/simple-concat/test/basic.js b/node_modules/simple-concat/test/basic.js deleted file mode 100644 index f781294a3..000000000 --- a/node_modules/simple-concat/test/basic.js +++ /dev/null @@ -1,41 +0,0 @@ -var concat = require('../') -var stream = require('stream') -var test = require('tape') - -test('basic', function (t) { - t.plan(2) - var s = new stream.PassThrough() - concat(s, function (err, buf) { - t.error(err) - t.deepEqual(buf, new Buffer('abc123456789')) - }) - s.write('abc') - setTimeout(function () { - s.write('123') - }, 10) - setTimeout(function () { - s.write('456') - }, 20) - setTimeout(function () { - s.end('789') - }, 30) -}) - -test('error', function (t) { - t.plan(2) - var s = new stream.PassThrough() - concat(s, function (err, buf) { - t.ok(err, 'got expected error') - t.ok(!buf) - }) - s.write('abc') - setTimeout(function () { - s.write('123') - }, 10) - setTimeout(function () { - s.write('456') - }, 20) - setTimeout(function () { - s.emit('error', new Error('error')) - }, 30) -}) diff --git a/node_modules/spdx-compare/LICENSE.md b/node_modules/spdx-compare/LICENSE.md deleted file mode 100644 index 6c2555895..000000000 --- a/node_modules/spdx-compare/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License - -Copyright (c) 2015 Kyle E. Mitchell - -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/node_modules/spdx-compare/README.md b/node_modules/spdx-compare/README.md deleted file mode 100644 index 20d79c9bf..000000000 --- a/node_modules/spdx-compare/README.md +++ /dev/null @@ -1,20 +0,0 @@ -```javascript -var assert = require('assert') -var compare = require('spdx-compare') - -assert(compare.gt('GPL-3.0', 'GPL-2.0')) -assert(compare.gt('GPL-3.0-only', 'GPL-2.0-only')) -assert(compare.gt('GPL-2.0-or-later', 'GPL-2.0-only')) -assert(compare.eq('GPL-3.0-or-later', 'GPL-3.0-only')) -assert(compare.lt('MPL-1.0', 'MPL-2.0')) - -assert(compare.gt('LPPL-1.3a', 'LPPL-1.0')) -assert(compare.gt('LPPL-1.3c', 'LPPL-1.3a')) -assert(!compare.gt('MIT', 'ISC')) -assert(!compare.gt('OSL-1.0', 'OPL-1.0')) -assert(compare.gt('AGPL-3.0', 'AGPL-1.0')) - -assert.throws(function () { - compare.gt('(MIT OR ISC)', 'GPL-3.0') -}, '"(MIT OR ISC)" is not a simple license identifier') -``` diff --git a/node_modules/spdx-compare/index.js b/node_modules/spdx-compare/index.js deleted file mode 100644 index 7b33349f8..000000000 --- a/node_modules/spdx-compare/index.js +++ /dev/null @@ -1,60 +0,0 @@ -var arrayFindIndex = require('array-find-index') -var parse = require('spdx-expression-parse') - -var ranges = require('spdx-ranges') - -var notALicenseIdentifier = ' is not a simple license identifier' - -var rangeComparison = function (comparison) { - return function (first, second) { - var firstAST = parse(first) - if (!firstAST.hasOwnProperty('license')) { - throw new Error('"' + first + '"' + notALicenseIdentifier) - } - var secondAST = parse(second) - if (!secondAST.hasOwnProperty('license')) { - throw new Error('"' + second + '"' + notALicenseIdentifier) - } - return ranges.some(function (range) { - var firstLicense = firstAST.license - var indexOfFirst = arrayFindIndex(range, function (element) { - return ( - element === firstLicense || - ( - Array.isArray(element) && - element.indexOf(firstLicense) !== -1 - ) - ) - }) - if (indexOfFirst < 0) { - return false - } - var secondLicense = secondAST.license - var indexOfSecond = arrayFindIndex(range, function (element) { - return ( - element === secondLicense || - ( - Array.isArray(element) && - element.indexOf(secondLicense) !== -1 - ) - ) - }) - if (indexOfSecond < 0) { - return false - } - return comparison(indexOfFirst, indexOfSecond) - }) - } -} - -exports.gt = rangeComparison(function (first, second) { - return first > second -}) - -exports.lt = rangeComparison(function (first, second) { - return first < second -}) - -exports.eq = rangeComparison(function (first, second) { - return first === second -}) diff --git a/node_modules/spdx-compare/package.json b/node_modules/spdx-compare/package.json deleted file mode 100644 index 82f0291cf..000000000 --- a/node_modules/spdx-compare/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_args": [ - [ - "spdx-compare@1.0.0", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_development": true, - "_from": "spdx-compare@1.0.0", - "_id": "spdx-compare@1.0.0", - "_inBundle": false, - "_integrity": "sha512-C1mDZOX0hnu0ep9dfmuoi03+eOdDoz2yvK79RxbcrVEG1NO1Ph35yW102DHWKN4pk80nwCgeMmSY5L25VE4D9A==", - "_location": "/spdx-compare", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "spdx-compare@1.0.0", - "name": "spdx-compare", - "escapedName": "spdx-compare", - "rawSpec": "1.0.0", - "saveSpec": null, - "fetchSpec": "1.0.0" - }, - "_requiredBy": [ - "/spdx-satisfies" - ], - "_resolved": "https://registry.npmjs.org/spdx-compare/-/spdx-compare-1.0.0.tgz", - "_spec": "1.0.0", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "https://kemitchell.com" - }, - "bugs": { - "url": "https://github.com/kemitchell/spdx-compare.js/issues" - }, - "dependencies": { - "array-find-index": "^1.0.2", - "spdx-expression-parse": "^3.0.0", - "spdx-ranges": "^2.0.0" - }, - "description": "compare SPDX license expressions", - "devDependencies": { - "defence-cli": "^2.0.1" - }, - "homepage": "https://github.com/kemitchell/spdx-compare.js#readme", - "keywords": [ - "SPDX", - "law", - "legal", - "license", - "metadata", - "package", - "package.json", - "standards" - ], - "license": "MIT", - "name": "spdx-compare", - "repository": { - "type": "git", - "url": "git+https://github.com/kemitchell/spdx-compare.js.git" - }, - "scripts": { - "test": "defence -i javascript README.md | sed 's!spdx-compare!./!' | node" - }, - "version": "1.0.0" -} diff --git a/node_modules/spdx-compare/test.log b/node_modules/spdx-compare/test.log deleted file mode 100644 index 66ec4ccee..000000000 --- a/node_modules/spdx-compare/test.log +++ /dev/null @@ -1,4 +0,0 @@ - -> spdx-compare@0.1.2 test /home/kyle/spdx-compare.js -> defence -i javascript README.md | sed 's!spdx-compare!./!' | node - diff --git a/node_modules/spdx-expression-validate/LICENSE b/node_modules/spdx-expression-validate/LICENSE deleted file mode 100644 index d3791f13c..000000000 --- a/node_modules/spdx-expression-validate/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License - -Copyright (c) 2015 Kyle E. Mitchell - -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/node_modules/spdx-expression-validate/README.md b/node_modules/spdx-expression-validate/README.md deleted file mode 100644 index 489816777..000000000 --- a/node_modules/spdx-expression-validate/README.md +++ /dev/null @@ -1,44 +0,0 @@ -```javascript -var assert = require('assert') -var valid = require('spdx-expression-validate') -``` - -# Simple License Expressions -```javascript -assert(!valid('Invalid-Identifier')) -assert(valid('GPL-2.0')) -assert(valid('GPL-2.0+')) -assert(valid('LicenseRef-23')) -assert(valid('LicenseRef-MIT-Style-1')) -assert(valid('DocumentRef-spdx-tool-1.2:LicenseRef-MIT-Style-2')) -``` - -# Composite License Expressions - -## Disjunctive `OR` Operator -```javascript -assert(valid('(LGPL-2.1 OR MIT)')) -assert(valid('(LGPL-2.1 OR MIT OR BSD-3-Clause)')) -``` - -## Conjunctive `AND` Operator -```javascript -assert(valid('(LGPL-2.1 AND MIT)')) -assert(valid('(LGPL-2.1 AND MIT AND BSD-2-Clause)')) -``` - -## Exception `WITH` Operator -```javascript -assert(valid('(GPL-2.0+ WITH Bison-exception-2.2)')) -``` - -# Strict Whitespace Rules -```javascript -assert(!valid('MIT ')) -assert(!valid(' MIT')) -assert(!valid('MIT AND BSD-3-Clause')) -``` - ---- - -[The Software Package Data Exchange (SPDX) specification](http://spdx.org) is the work of the [Linux Foundation](http://www.linuxfoundation.org) and its contributors, and is licensed under the terms of [the Creative Commons Attribution License 3.0 Unported (SPDX: "CC-BY-3.0")](http://spdx.org/licenses/CC-BY-3.0). "SPDX" is a United States federally registered trademark of the Linux Foundation. diff --git a/node_modules/spdx-expression-validate/index.js b/node_modules/spdx-expression-validate/index.js deleted file mode 100644 index e01ec5df6..000000000 --- a/node_modules/spdx-expression-validate/index.js +++ /dev/null @@ -1,20 +0,0 @@ -var parse = require('spdx-expression-parse') - -var containsRepeatedSpace = /\s{2,}/ - -module.exports = function spdxExpressionValidate (argument) { - var fatString = ( - argument.trim() !== argument || - containsRepeatedSpace.test(argument) - ) - if (fatString) { - return false - } else { - try { - parse(argument) - return true - } catch (e) { - return false - } - } -} diff --git a/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/AUTHORS b/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/AUTHORS deleted file mode 100644 index 155f0f66c..000000000 --- a/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -C. Scott Ananian <cscott@cscott.net> (http://cscott.net) -Kyle E. Mitchell <kyle@kemitchell.com> (https://kemitchell.com) -Shinnosuke Watanabe <snnskwtnb@gmail.com> diff --git a/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/LICENSE b/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/LICENSE deleted file mode 100644 index 831618eab..000000000 --- a/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License - -Copyright (c) 2015 Kyle E. Mitchell & other authors listed in AUTHORS - -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/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/README.md b/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/README.md deleted file mode 100644 index 9928cdccf..000000000 --- a/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/README.md +++ /dev/null @@ -1,83 +0,0 @@ -This package parses SPDX license expression strings describing license terms, like [package.json license strings](https://docs.npmjs.com/files/package.json#license), into consistently structured ECMAScript objects. The npm command-line interface depends on this package, as do many automatic license-audit tools. - -In a nutshell: - -```javascript -var parse = require('spdx-expression-parse') -var assert = require('assert') - -assert.deepEqual( - // Licensed under the terms of the Two-Clause BSD License. - parse('BSD-2-Clause'), - {license: 'BSD-2-Clause'} -) - -assert.throws(function () { - // An invalid SPDX license expression. - // Should be `Apache-2.0`. - parse('Apache 2') -}) - -assert.deepEqual( - // Dual licensed under LGPL 2.1 or a combination of the Three-Clause - // BSD License and the MIT License. - parse('(LGPL-2.1 OR BSD-3-Clause AND MIT)'), - { - left: {license: 'LGPL-2.1'}, - conjunction: 'or', - right: { - left: {license: 'BSD-3-Clause'}, - conjunction: 'and', - right: {license: 'MIT'} - } - } -) -``` - -The syntax comes from the [Software Package Data eXchange (SPDX)](https://spdx.org/), a standard from the [Linux Foundation](https://www.linuxfoundation.org) for shareable data about software package license terms. SPDX aims to make sharing and auditing license data easy, especially for users of open-source software. - -The bulk of the SPDX standard describes syntax and semantics of XML metadata files. This package implements two lightweight, plain-text components of that larger standard: - -1. The [license list](https://spdx.org/licenses), a mapping from specific string identifiers, like `Apache-2.0`, to standard form license texts and bolt-on license exceptions. The [spdx-license-ids](https://www.npmjs.com/package/spdx-exceptions) and [spdx-exceptions](https://www.npmjs.com/package/spdx-license-ids) packages implement the license list. They are development dependencies of this package. - - Any license identifier from the license list is a valid license expression: - - ```javascript - require('spdx-license-ids').forEach(function (id) { - assert.deepEqual(parse(id), {license: id}) - }) - ``` - - So is any license identifier `WITH` a standardized license exception: - - ```javascript - require('spdx-license-ids').forEach(function (id) { - require('spdx-exceptions').forEach(function (e) { - assert.deepEqual( - parse(id + ' WITH ' + e), - {license: id, exception: e} - ) - }) - }) - ``` - -2. The license expression language, for describing simple and complex license terms, like `MIT` for MIT-licensed and `(GPL-2.0 OR Apache-2.0)` for dual-licensing under GPL 2.0 and Apache 2.0. This package implements the license expression language. - - ```javascript - assert.deepEqual( - // Licensed under a combination of the MIT License and a combination - // of LGPL 2.1 (or a later version) and the Three-Clause BSD License. - parse('(MIT AND (LGPL-2.1+ AND BSD-3-Clause))'), - { - left: {license: 'MIT'}, - conjunction: 'and', - right: { - left: {license: 'LGPL-2.1', plus: true}, - conjunction: 'and', - right: {license: 'BSD-3-Clause'} - } - } - ) - ``` - -The Linux Foundation and its contributors license the SPDX standard under the terms of [the Creative Commons Attribution License 3.0 Unported (SPDX: "CC-BY-3.0")](http://spdx.org/licenses/CC-BY-3.0). "SPDX" is a United States federally registered trademark of the Linux Foundation. The authors of this package license their work under the terms of the MIT License. diff --git a/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/index.js b/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/index.js deleted file mode 100644 index 56a9b50c6..000000000 --- a/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/index.js +++ /dev/null @@ -1,5 +0,0 @@ -var parser = require('./parser').parser - -module.exports = function (argument) { - return parser.parse(argument) -} diff --git a/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/package.json b/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/package.json deleted file mode 100644 index 64926dc22..000000000 --- a/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "_args": [ - [ - "spdx-expression-parse@1.0.4", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_development": true, - "_from": "spdx-expression-parse@1.0.4", - "_id": "spdx-expression-parse@1.0.4", - "_inBundle": false, - "_integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", - "_location": "/spdx-expression-validate/spdx-expression-parse", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "spdx-expression-parse@1.0.4", - "name": "spdx-expression-parse", - "escapedName": "spdx-expression-parse", - "rawSpec": "1.0.4", - "saveSpec": null, - "fetchSpec": "1.0.4" - }, - "_requiredBy": [ - "/spdx-expression-validate" - ], - "_resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", - "_spec": "1.0.4", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "http://kemitchell.com" - }, - "bugs": { - "url": "https://github.com/kemitchell/spdx-expression-parse.js/issues" - }, - "contributors": [ - { - "name": "C. Scott Ananian", - "email": "cscott@cscott.net", - "url": "http://cscott.net" - }, - { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "https://kemitchell.com" - }, - { - "name": "Shinnosuke Watanabe", - "email": "snnskwtnb@gmail.com" - } - ], - "description": "parse SPDX license expressions", - "devDependencies": { - "defence-cli": "^1.0.1", - "jison": "^0.4.15", - "replace-require-self": "^1.0.0", - "spdx-exceptions": "^1.0.4", - "spdx-license-ids": "^1.0.0", - "standard": "^8.0.0" - }, - "files": [ - "AUTHORS", - "index.js", - "parser.js" - ], - "homepage": "https://github.com/kemitchell/spdx-expression-parse.js#readme", - "keywords": [ - "SPDX", - "law", - "legal", - "license", - "metadata", - "package", - "package.json", - "standards" - ], - "license": "(MIT AND CC-BY-3.0)", - "name": "spdx-expression-parse", - "repository": { - "type": "git", - "url": "git+https://github.com/kemitchell/spdx-expression-parse.js.git" - }, - "scripts": { - "lint": "standard", - "prepublish": "node generate-parser.js > parser.js", - "pretest": "npm run prepublish", - "test": "defence -i javascript README.md | replace-require-self | node" - }, - "version": "1.0.4" -} diff --git a/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/parser.js b/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/parser.js deleted file mode 100644 index a5e2edbaa..000000000 --- a/node_modules/spdx-expression-validate/node_modules/spdx-expression-parse/parser.js +++ /dev/null @@ -1,1357 +0,0 @@ -/* parser generated by jison 0.4.17 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var spdxparse = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,5],$V1=[1,6],$V2=[1,7],$V3=[1,4],$V4=[1,9],$V5=[1,10],$V6=[5,14,15,17],$V7=[5,12,14,15,17]; -var parser = {trace: function trace() { }, -yy: {}, -symbols_: {"error":2,"start":3,"expression":4,"EOS":5,"simpleExpression":6,"LICENSE":7,"PLUS":8,"LICENSEREF":9,"DOCUMENTREF":10,"COLON":11,"WITH":12,"EXCEPTION":13,"AND":14,"OR":15,"OPEN":16,"CLOSE":17,"$accept":0,"$end":1}, -terminals_: {2:"error",5:"EOS",7:"LICENSE",8:"PLUS",9:"LICENSEREF",10:"DOCUMENTREF",11:"COLON",12:"WITH",13:"EXCEPTION",14:"AND",15:"OR",16:"OPEN",17:"CLOSE"}, -productions_: [0,[3,2],[6,1],[6,2],[6,1],[6,3],[4,1],[4,3],[4,3],[4,3],[4,3]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 1: -return this.$ = $$[$0-1] -break; -case 2: case 4: case 5: -this.$ = {license: yytext} -break; -case 3: -this.$ = {license: $$[$0-1], plus: true} -break; -case 6: -this.$ = $$[$0] -break; -case 7: -this.$ = {exception: $$[$0]} -this.$.license = $$[$0-2].license -if ($$[$0-2].hasOwnProperty('plus')) { - this.$.plus = $$[$0-2].plus -} -break; -case 8: -this.$ = {conjunction: 'and', left: $$[$0-2], right: $$[$0]} -break; -case 9: -this.$ = {conjunction: 'or', left: $$[$0-2], right: $$[$0]} -break; -case 10: -this.$ = $$[$0-1] -break; -} -}, -table: [{3:1,4:2,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{1:[3]},{5:[1,8],14:$V4,15:$V5},o($V6,[2,6],{12:[1,11]}),{4:12,6:3,7:$V0,9:$V1,10:$V2,16:$V3},o($V7,[2,2],{8:[1,13]}),o($V7,[2,4]),{11:[1,14]},{1:[2,1]},{4:15,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{4:16,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{13:[1,17]},{14:$V4,15:$V5,17:[1,18]},o($V7,[2,3]),{9:[1,19]},o($V6,[2,8]),o([5,15,17],[2,9],{14:$V4}),o($V6,[2,7]),o($V6,[2,10]),o($V7,[2,5])], -defaultActions: {8:[2,1]}, -parseError: function parseError(str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - function _parseError (msg, hash) { - this.message = msg; - this.hash = hash; - } - _parseError.prototype = Error; - - throw new _parseError(str, hash); - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - _token_stack: - var lex = function () { - var token; - token = lexer.lex() || EOF; - if (typeof token !== 'number') { - token = self.symbols_[token] || token; - } - return token; - }; - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function (match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin(condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState(condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0:return 5 -break; -case 1:/* skip whitespace */ -break; -case 2:return 8 -break; -case 3:return 16 -break; -case 4:return 17 -break; -case 5:return 11 -break; -case 6:return 10 -break; -case 7:return 9 -break; -case 8:return 14 -break; -case 9:return 15 -break; -case 10:return 12 -break; -case 11:return 7 -break; -case 12:return 7 -break; -case 13:return 7 -break; -case 14:return 7 -break; -case 15:return 7 -break; -case 16:return 7 -break; -case 17:return 7 -break; -case 18:return 7 -break; -case 19:return 7 -break; -case 20:return 7 -break; -case 21:return 7 -break; -case 22:return 7 -break; -case 23:return 7 -break; -case 24:return 13 -break; -case 25:return 13 -break; -case 26:return 13 -break; -case 27:return 13 -break; -case 28:return 13 -break; -case 29:return 13 -break; -case 30:return 13 -break; -case 31:return 13 -break; -case 32:return 7 -break; -case 33:return 13 -break; -case 34:return 7 -break; -case 35:return 13 -break; -case 36:return 7 -break; -case 37:return 13 -break; -case 38:return 13 -break; -case 39:return 7 -break; -case 40:return 13 -break; -case 41:return 13 -break; -case 42:return 13 -break; -case 43:return 13 -break; -case 44:return 13 -break; -case 45:return 7 -break; -case 46:return 13 -break; -case 47:return 7 -break; -case 48:return 7 -break; -case 49:return 7 -break; -case 50:return 7 -break; -case 51:return 7 -break; -case 52:return 7 -break; -case 53:return 7 -break; -case 54:return 7 -break; -case 55:return 7 -break; -case 56:return 7 -break; -case 57:return 7 -break; -case 58:return 7 -break; -case 59:return 7 -break; -case 60:return 7 -break; -case 61:return 7 -break; -case 62:return 7 -break; -case 63:return 13 -break; -case 64:return 7 -break; -case 65:return 7 -break; -case 66:return 13 -break; -case 67:return 7 -break; -case 68:return 7 -break; -case 69:return 7 -break; -case 70:return 7 -break; -case 71:return 7 -break; -case 72:return 7 -break; -case 73:return 13 -break; -case 74:return 7 -break; -case 75:return 13 -break; -case 76:return 7 -break; -case 77:return 7 -break; -case 78:return 7 -break; -case 79:return 7 -break; -case 80:return 7 -break; -case 81:return 7 -break; -case 82:return 7 -break; -case 83:return 7 -break; -case 84:return 7 -break; -case 85:return 7 -break; -case 86:return 7 -break; -case 87:return 7 -break; -case 88:return 7 -break; -case 89:return 7 -break; -case 90:return 7 -break; -case 91:return 7 -break; -case 92:return 7 -break; -case 93:return 7 -break; -case 94:return 7 -break; -case 95:return 7 -break; -case 96:return 7 -break; -case 97:return 7 -break; -case 98:return 7 -break; -case 99:return 7 -break; -case 100:return 7 -break; -case 101:return 7 -break; -case 102:return 7 -break; -case 103:return 7 -break; -case 104:return 7 -break; -case 105:return 7 -break; -case 106:return 7 -break; -case 107:return 7 -break; -case 108:return 7 -break; -case 109:return 7 -break; -case 110:return 7 -break; -case 111:return 7 -break; -case 112:return 7 -break; -case 113:return 7 -break; -case 114:return 7 -break; -case 115:return 7 -break; -case 116:return 7 -break; -case 117:return 7 -break; -case 118:return 7 -break; -case 119:return 7 -break; -case 120:return 7 -break; -case 121:return 7 -break; -case 122:return 7 -break; -case 123:return 7 -break; -case 124:return 7 -break; -case 125:return 7 -break; -case 126:return 7 -break; -case 127:return 7 -break; -case 128:return 7 -break; -case 129:return 7 -break; -case 130:return 7 -break; -case 131:return 7 -break; -case 132:return 7 -break; -case 133:return 7 -break; -case 134:return 7 -break; -case 135:return 7 -break; -case 136:return 7 -break; -case 137:return 7 -break; -case 138:return 7 -break; -case 139:return 7 -break; -case 140:return 7 -break; -case 141:return 7 -break; -case 142:return 7 -break; -case 143:return 7 -break; -case 144:return 7 -break; -case 145:return 7 -break; -case 146:return 7 -break; -case 147:return 7 -break; -case 148:return 7 -break; -case 149:return 7 -break; -case 150:return 7 -break; -case 151:return 7 -break; -case 152:return 7 -break; -case 153:return 7 -break; -case 154:return 7 -break; -case 155:return 7 -break; -case 156:return 7 -break; -case 157:return 7 -break; -case 158:return 7 -break; -case 159:return 7 -break; -case 160:return 7 -break; -case 161:return 7 -break; -case 162:return 7 -break; -case 163:return 7 -break; -case 164:return 7 -break; -case 165:return 7 -break; -case 166:return 7 -break; -case 167:return 7 -break; -case 168:return 7 -break; -case 169:return 7 -break; -case 170:return 7 -break; -case 171:return 7 -break; -case 172:return 7 -break; -case 173:return 7 -break; -case 174:return 7 -break; -case 175:return 7 -break; -case 176:return 7 -break; -case 177:return 7 -break; -case 178:return 7 -break; -case 179:return 7 -break; -case 180:return 7 -break; -case 181:return 7 -break; -case 182:return 7 -break; -case 183:return 7 -break; -case 184:return 7 -break; -case 185:return 7 -break; -case 186:return 7 -break; -case 187:return 7 -break; -case 188:return 7 -break; -case 189:return 7 -break; -case 190:return 7 -break; -case 191:return 7 -break; -case 192:return 7 -break; -case 193:return 7 -break; -case 194:return 7 -break; -case 195:return 7 -break; -case 196:return 7 -break; -case 197:return 7 -break; -case 198:return 7 -break; -case 199:return 7 -break; -case 200:return 7 -break; -case 201:return 7 -break; -case 202:return 7 -break; -case 203:return 7 -break; -case 204:return 7 -break; -case 205:return 7 -break; -case 206:return 7 -break; -case 207:return 7 -break; -case 208:return 7 -break; -case 209:return 7 -break; -case 210:return 7 -break; -case 211:return 7 -break; -case 212:return 7 -break; -case 213:return 7 -break; -case 214:return 7 -break; -case 215:return 7 -break; -case 216:return 7 -break; -case 217:return 7 -break; -case 218:return 7 -break; -case 219:return 7 -break; -case 220:return 7 -break; -case 221:return 7 -break; -case 222:return 7 -break; -case 223:return 7 -break; -case 224:return 7 -break; -case 225:return 7 -break; -case 226:return 7 -break; -case 227:return 7 -break; -case 228:return 7 -break; -case 229:return 7 -break; -case 230:return 7 -break; -case 231:return 7 -break; -case 232:return 7 -break; -case 233:return 7 -break; -case 234:return 7 -break; -case 235:return 7 -break; -case 236:return 7 -break; -case 237:return 7 -break; -case 238:return 7 -break; -case 239:return 7 -break; -case 240:return 7 -break; -case 241:return 7 -break; -case 242:return 7 -break; -case 243:return 7 -break; -case 244:return 7 -break; -case 245:return 7 -break; -case 246:return 7 -break; -case 247:return 7 -break; -case 248:return 7 -break; -case 249:return 7 -break; -case 250:return 7 -break; -case 251:return 7 -break; -case 252:return 7 -break; -case 253:return 7 -break; -case 254:return 7 -break; -case 255:return 7 -break; -case 256:return 7 -break; -case 257:return 7 -break; -case 258:return 7 -break; -case 259:return 7 -break; -case 260:return 7 -break; -case 261:return 7 -break; -case 262:return 7 -break; -case 263:return 7 -break; -case 264:return 7 -break; -case 265:return 7 -break; -case 266:return 7 -break; -case 267:return 7 -break; -case 268:return 7 -break; -case 269:return 7 -break; -case 270:return 7 -break; -case 271:return 7 -break; -case 272:return 7 -break; -case 273:return 7 -break; -case 274:return 7 -break; -case 275:return 7 -break; -case 276:return 7 -break; -case 277:return 7 -break; -case 278:return 7 -break; -case 279:return 7 -break; -case 280:return 7 -break; -case 281:return 7 -break; -case 282:return 7 -break; -case 283:return 7 -break; -case 284:return 7 -break; -case 285:return 7 -break; -case 286:return 7 -break; -case 287:return 7 -break; -case 288:return 7 -break; -case 289:return 7 -break; -case 290:return 7 -break; -case 291:return 7 -break; -case 292:return 7 -break; -case 293:return 7 -break; -case 294:return 7 -break; -case 295:return 7 -break; -case 296:return 7 -break; -case 297:return 7 -break; -case 298:return 7 -break; -case 299:return 7 -break; -case 300:return 7 -break; -case 301:return 7 -break; -case 302:return 7 -break; -case 303:return 7 -break; -case 304:return 7 -break; -case 305:return 7 -break; -case 306:return 7 -break; -case 307:return 7 -break; -case 308:return 7 -break; -case 309:return 7 -break; -case 310:return 7 -break; -case 311:return 7 -break; -case 312:return 7 -break; -case 313:return 7 -break; -case 314:return 7 -break; -case 315:return 7 -break; -case 316:return 7 -break; -case 317:return 7 -break; -case 318:return 7 -break; -case 319:return 7 -break; -case 320:return 7 -break; -case 321:return 7 -break; -case 322:return 7 -break; -case 323:return 7 -break; -case 324:return 7 -break; -case 325:return 7 -break; -case 326:return 7 -break; -case 327:return 7 -break; -case 328:return 7 -break; -case 329:return 7 -break; -case 330:return 7 -break; -case 331:return 7 -break; -case 332:return 7 -break; -case 333:return 7 -break; -case 334:return 7 -break; -case 335:return 7 -break; -case 336:return 7 -break; -case 337:return 7 -break; -case 338:return 7 -break; -case 339:return 7 -break; -case 340:return 7 -break; -case 341:return 7 -break; -case 342:return 7 -break; -case 343:return 7 -break; -case 344:return 7 -break; -case 345:return 7 -break; -case 346:return 7 -break; -case 347:return 7 -break; -case 348:return 7 -break; -case 349:return 7 -break; -case 350:return 7 -break; -case 351:return 7 -break; -case 352:return 7 -break; -case 353:return 7 -break; -case 354:return 7 -break; -case 355:return 7 -break; -case 356:return 7 -break; -case 357:return 7 -break; -case 358:return 7 -break; -case 359:return 7 -break; -case 360:return 7 -break; -case 361:return 7 -break; -case 362:return 7 -break; -case 363:return 7 -break; -case 364:return 7 -break; -} -}, -rules: [/^(?:$)/,/^(?:\s+)/,/^(?:\+)/,/^(?:\()/,/^(?:\))/,/^(?::)/,/^(?:DocumentRef-([0-9A-Za-z-+.]+))/,/^(?:LicenseRef-([0-9A-Za-z-+.]+))/,/^(?:AND)/,/^(?:OR)/,/^(?:WITH)/,/^(?:BSD-3-Clause-No-Nuclear-License-2014)/,/^(?:BSD-3-Clause-No-Nuclear-Warranty)/,/^(?:GPL-2\.0-with-classpath-exception)/,/^(?:GPL-3\.0-with-autoconf-exception)/,/^(?:GPL-2\.0-with-autoconf-exception)/,/^(?:BSD-3-Clause-No-Nuclear-License)/,/^(?:MPL-2\.0-no-copyleft-exception)/,/^(?:GPL-2\.0-with-bison-exception)/,/^(?:GPL-2\.0-with-font-exception)/,/^(?:GPL-2\.0-with-GCC-exception)/,/^(?:CNRI-Python-GPL-Compatible)/,/^(?:GPL-3\.0-with-GCC-exception)/,/^(?:BSD-3-Clause-Attribution)/,/^(?:Classpath-exception-2\.0)/,/^(?:WxWindows-exception-3\.1)/,/^(?:freertos-exception-2\.0)/,/^(?:Autoconf-exception-3\.0)/,/^(?:i2p-gpl-java-exception)/,/^(?:gnu-javamail-exception)/,/^(?:Nokia-Qt-exception-1\.1)/,/^(?:Autoconf-exception-2\.0)/,/^(?:BSD-2-Clause-FreeBSD)/,/^(?:u-boot-exception-2\.0)/,/^(?:zlib-acknowledgement)/,/^(?:Bison-exception-2\.2)/,/^(?:BSD-2-Clause-NetBSD)/,/^(?:CLISP-exception-2\.0)/,/^(?:eCos-exception-2\.0)/,/^(?:BSD-3-Clause-Clear)/,/^(?:Font-exception-2\.0)/,/^(?:FLTK-exception-2\.0)/,/^(?:GCC-exception-2\.0)/,/^(?:Qwt-exception-1\.0)/,/^(?:Libtool-exception)/,/^(?:BSD-3-Clause-LBNL)/,/^(?:GCC-exception-3\.1)/,/^(?:Artistic-1\.0-Perl)/,/^(?:Artistic-1\.0-cl8)/,/^(?:CC-BY-NC-SA-2\.5)/,/^(?:MIT-advertising)/,/^(?:BSD-Source-Code)/,/^(?:CC-BY-NC-SA-4\.0)/,/^(?:LiLiQ-Rplus-1\.1)/,/^(?:CC-BY-NC-SA-3\.0)/,/^(?:BSD-4-Clause-UC)/,/^(?:CC-BY-NC-SA-2\.0)/,/^(?:CC-BY-NC-SA-1\.0)/,/^(?:CC-BY-NC-ND-4\.0)/,/^(?:CC-BY-NC-ND-3\.0)/,/^(?:CC-BY-NC-ND-2\.5)/,/^(?:CC-BY-NC-ND-2\.0)/,/^(?:CC-BY-NC-ND-1\.0)/,/^(?:LZMA-exception)/,/^(?:BitTorrent-1\.1)/,/^(?:CrystalStacker)/,/^(?:FLTK-exception)/,/^(?:SugarCRM-1\.1\.3)/,/^(?:BSD-Protection)/,/^(?:BitTorrent-1\.0)/,/^(?:HaskellReport)/,/^(?:Interbase-1\.0)/,/^(?:StandardML-NJ)/,/^(?:mif-exception)/,/^(?:Frameworx-1\.0)/,/^(?:389-exception)/,/^(?:CC-BY-NC-2\.0)/,/^(?:CC-BY-NC-2\.5)/,/^(?:CC-BY-NC-3\.0)/,/^(?:CC-BY-NC-4\.0)/,/^(?:W3C-19980720)/,/^(?:CC-BY-SA-1\.0)/,/^(?:CC-BY-SA-2\.0)/,/^(?:CC-BY-SA-2\.5)/,/^(?:CC-BY-ND-2\.0)/,/^(?:CC-BY-SA-4\.0)/,/^(?:CC-BY-SA-3\.0)/,/^(?:Artistic-1\.0)/,/^(?:Artistic-2\.0)/,/^(?:CC-BY-ND-2\.5)/,/^(?:CC-BY-ND-3\.0)/,/^(?:CC-BY-ND-4\.0)/,/^(?:CC-BY-ND-1\.0)/,/^(?:BSD-4-Clause)/,/^(?:BSD-3-Clause)/,/^(?:BSD-2-Clause)/,/^(?:CC-BY-NC-1\.0)/,/^(?:bzip2-1\.0\.6)/,/^(?:Unicode-TOU)/,/^(?:CNRI-Jython)/,/^(?:ImageMagick)/,/^(?:Adobe-Glyph)/,/^(?:CUA-OPL-1\.0)/,/^(?:OLDAP-2\.2\.2)/,/^(?:LiLiQ-R-1\.1)/,/^(?:bzip2-1\.0\.5)/,/^(?:LiLiQ-P-1\.1)/,/^(?:OLDAP-2\.0\.1)/,/^(?:OLDAP-2\.2\.1)/,/^(?:CNRI-Python)/,/^(?:XFree86-1\.1)/,/^(?:OSET-PL-2\.1)/,/^(?:Apache-2\.0)/,/^(?:Watcom-1\.0)/,/^(?:PostgreSQL)/,/^(?:Python-2\.0)/,/^(?:RHeCos-1\.1)/,/^(?:EUDatagrid)/,/^(?:Spencer-99)/,/^(?:Intel-ACPI)/,/^(?:CECILL-1\.0)/,/^(?:CECILL-1\.1)/,/^(?:JasPer-2\.0)/,/^(?:CECILL-2\.0)/,/^(?:CECILL-2\.1)/,/^(?:gSOAP-1\.3b)/,/^(?:Spencer-94)/,/^(?:Apache-1\.1)/,/^(?:Spencer-86)/,/^(?:Apache-1\.0)/,/^(?:ClArtistic)/,/^(?:TORQUE-1\.1)/,/^(?:CATOSL-1\.1)/,/^(?:Adobe-2006)/,/^(?:Zimbra-1\.4)/,/^(?:Zimbra-1\.3)/,/^(?:Condor-1\.1)/,/^(?:CC-BY-3\.0)/,/^(?:CC-BY-2\.5)/,/^(?:OLDAP-2\.4)/,/^(?:SGI-B-1\.1)/,/^(?:SISSL-1\.2)/,/^(?:SGI-B-1\.0)/,/^(?:OLDAP-2\.3)/,/^(?:CC-BY-4\.0)/,/^(?:Crossword)/,/^(?:SimPL-2\.0)/,/^(?:OLDAP-2\.2)/,/^(?:OLDAP-2\.1)/,/^(?:ErlPL-1\.1)/,/^(?:LPPL-1\.3a)/,/^(?:LPPL-1\.3c)/,/^(?:OLDAP-2\.0)/,/^(?:Leptonica)/,/^(?:CPOL-1\.02)/,/^(?:OLDAP-1\.4)/,/^(?:OLDAP-1\.3)/,/^(?:CC-BY-2\.0)/,/^(?:Unlicense)/,/^(?:OLDAP-2\.8)/,/^(?:OLDAP-1\.2)/,/^(?:MakeIndex)/,/^(?:OLDAP-2\.7)/,/^(?:OLDAP-1\.1)/,/^(?:Sleepycat)/,/^(?:D-FSL-1\.0)/,/^(?:CC-BY-1\.0)/,/^(?:OLDAP-2\.6)/,/^(?:WXwindows)/,/^(?:NPOSL-3\.0)/,/^(?:FreeImage)/,/^(?:SGI-B-2\.0)/,/^(?:OLDAP-2\.5)/,/^(?:Beerware)/,/^(?:Newsletr)/,/^(?:NBPL-1\.0)/,/^(?:NASA-1\.3)/,/^(?:NLOD-1\.0)/,/^(?:AGPL-1\.0)/,/^(?:OCLC-2\.0)/,/^(?:ODbL-1\.0)/,/^(?:PDDL-1\.0)/,/^(?:Motosoto)/,/^(?:Afmparse)/,/^(?:ANTLR-PD)/,/^(?:LPL-1\.02)/,/^(?:Abstyles)/,/^(?:eCos-2\.0)/,/^(?:APSL-1\.0)/,/^(?:LPPL-1\.2)/,/^(?:LPPL-1\.1)/,/^(?:LPPL-1\.0)/,/^(?:APSL-1\.1)/,/^(?:APSL-2\.0)/,/^(?:Info-ZIP)/,/^(?:Zend-2\.0)/,/^(?:IBM-pibs)/,/^(?:LGPL-2\.0)/,/^(?:LGPL-3\.0)/,/^(?:LGPL-2\.1)/,/^(?:GFDL-1\.3)/,/^(?:PHP-3\.01)/,/^(?:GFDL-1\.2)/,/^(?:GFDL-1\.1)/,/^(?:AGPL-3\.0)/,/^(?:Giftware)/,/^(?:EUPL-1\.1)/,/^(?:RPSL-1\.0)/,/^(?:EUPL-1\.0)/,/^(?:MIT-enna)/,/^(?:CECILL-B)/,/^(?:diffmark)/,/^(?:CECILL-C)/,/^(?:CDDL-1\.0)/,/^(?:Sendmail)/,/^(?:CDDL-1\.1)/,/^(?:CPAL-1\.0)/,/^(?:APSL-1\.2)/,/^(?:NPL-1\.1)/,/^(?:AFL-1\.2)/,/^(?:Caldera)/,/^(?:AFL-2\.0)/,/^(?:FSFULLR)/,/^(?:AFL-2\.1)/,/^(?:VSL-1\.0)/,/^(?:VOSTROM)/,/^(?:UPL-1\.0)/,/^(?:Dotseqn)/,/^(?:CPL-1\.0)/,/^(?:dvipdfm)/,/^(?:EPL-1\.0)/,/^(?:OCCT-PL)/,/^(?:ECL-1\.0)/,/^(?:Latex2e)/,/^(?:ECL-2\.0)/,/^(?:GPL-1\.0)/,/^(?:GPL-2\.0)/,/^(?:GPL-3\.0)/,/^(?:AFL-3\.0)/,/^(?:LAL-1\.2)/,/^(?:LAL-1\.3)/,/^(?:EFL-1\.0)/,/^(?:EFL-2\.0)/,/^(?:gnuplot)/,/^(?:Aladdin)/,/^(?:LPL-1\.0)/,/^(?:libtiff)/,/^(?:Entessa)/,/^(?:AMDPLPA)/,/^(?:IPL-1\.0)/,/^(?:OPL-1\.0)/,/^(?:OSL-1\.0)/,/^(?:OSL-1\.1)/,/^(?:OSL-2\.0)/,/^(?:OSL-2\.1)/,/^(?:OSL-3\.0)/,/^(?:OpenSSL)/,/^(?:ZPL-2\.1)/,/^(?:PHP-3\.0)/,/^(?:ZPL-2\.0)/,/^(?:ZPL-1\.1)/,/^(?:CC0-1\.0)/,/^(?:SPL-1\.0)/,/^(?:psutils)/,/^(?:MPL-1\.0)/,/^(?:QPL-1\.0)/,/^(?:MPL-1\.1)/,/^(?:MPL-2\.0)/,/^(?:APL-1\.0)/,/^(?:RPL-1\.1)/,/^(?:RPL-1\.5)/,/^(?:MIT-CMU)/,/^(?:Multics)/,/^(?:Eurosym)/,/^(?:BSL-1\.0)/,/^(?:MIT-feh)/,/^(?:Saxpath)/,/^(?:Borceux)/,/^(?:OFL-1\.1)/,/^(?:OFL-1\.0)/,/^(?:AFL-1\.1)/,/^(?:YPL-1\.1)/,/^(?:YPL-1\.0)/,/^(?:NPL-1\.0)/,/^(?:iMatix)/,/^(?:mpich2)/,/^(?:APAFML)/,/^(?:Bahyph)/,/^(?:RSA-MD)/,/^(?:psfrag)/,/^(?:Plexus)/,/^(?:eGenix)/,/^(?:Glulxe)/,/^(?:SAX-PD)/,/^(?:Imlib2)/,/^(?:Wsuipa)/,/^(?:LGPLLR)/,/^(?:Libpng)/,/^(?:xinetd)/,/^(?:MITNFA)/,/^(?:NetCDF)/,/^(?:Naumen)/,/^(?:SMPPL)/,/^(?:Nunit)/,/^(?:FSFUL)/,/^(?:GL2PS)/,/^(?:SMLNJ)/,/^(?:Rdisc)/,/^(?:Noweb)/,/^(?:Nokia)/,/^(?:SISSL)/,/^(?:Qhull)/,/^(?:Intel)/,/^(?:Glide)/,/^(?:Xerox)/,/^(?:AMPAS)/,/^(?:WTFPL)/,/^(?:MS-PL)/,/^(?:XSkat)/,/^(?:MS-RL)/,/^(?:MirOS)/,/^(?:RSCPL)/,/^(?:TMate)/,/^(?:OGTSL)/,/^(?:FSFAP)/,/^(?:NCSA)/,/^(?:Zlib)/,/^(?:SCEA)/,/^(?:SNIA)/,/^(?:NGPL)/,/^(?:NOSL)/,/^(?:ADSL)/,/^(?:MTLL)/,/^(?:NLPL)/,/^(?:Ruby)/,/^(?:JSON)/,/^(?:Barr)/,/^(?:0BSD)/,/^(?:Xnet)/,/^(?:Cube)/,/^(?:curl)/,/^(?:DSDP)/,/^(?:Fair)/,/^(?:HPND)/,/^(?:TOSL)/,/^(?:IJG)/,/^(?:SWL)/,/^(?:Vim)/,/^(?:FTL)/,/^(?:ICU)/,/^(?:OML)/,/^(?:NRL)/,/^(?:DOC)/,/^(?:TCL)/,/^(?:W3C)/,/^(?:NTP)/,/^(?:IPA)/,/^(?:ISC)/,/^(?:X11)/,/^(?:AAL)/,/^(?:AML)/,/^(?:xpp)/,/^(?:Zed)/,/^(?:MIT)/,/^(?:Mup)/], -conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (typeof require !== 'undefined' && typeof exports !== 'undefined') { -exports.parser = spdxparse; -exports.Parser = spdxparse.Parser; -exports.parse = function () { return spdxparse.parse.apply(spdxparse, arguments); }; -exports.main = function commonjsMain(args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if (typeof module !== 'undefined' && require.main === module) { - exports.main(process.argv.slice(1)); -} -} diff --git a/node_modules/spdx-expression-validate/package.json b/node_modules/spdx-expression-validate/package.json deleted file mode 100644 index 530b3f515..000000000 --- a/node_modules/spdx-expression-validate/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "_args": [ - [ - "spdx-expression-validate@1.0.2", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_development": true, - "_from": "spdx-expression-validate@1.0.2", - "_id": "spdx-expression-validate@1.0.2", - "_inBundle": false, - "_integrity": "sha1-Wk5NdhbtHJuIFQNmtCF/dnwn6eM=", - "_location": "/spdx-expression-validate", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "spdx-expression-validate@1.0.2", - "name": "spdx-expression-validate", - "escapedName": "spdx-expression-validate", - "rawSpec": "1.0.2", - "saveSpec": null, - "fetchSpec": "1.0.2" - }, - "_requiredBy": [ - "/licensee" - ], - "_resolved": "https://registry.npmjs.org/spdx-expression-validate/-/spdx-expression-validate-1.0.2.tgz", - "_spec": "1.0.2", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "http://kemitchell.com" - }, - "bugs": { - "url": "https://github.com/kemitchell/spdx-expression-validate.js/issues" - }, - "dependencies": { - "spdx-expression-parse": "^1.0.0" - }, - "description": "validate SPDX license expressions", - "devDependencies": { - "defence-cli": "^1.0.1", - "replace-require-self": "^1.0.0", - "standard": "^8.3.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/kemitchell/spdx.js", - "keywords": [ - "SPDX", - "law", - "legal", - "license", - "metadata", - "package", - "package.json", - "standards" - ], - "license": "(MIT AND CC-BY-3.0)", - "name": "spdx-expression-validate", - "repository": { - "type": "git", - "url": "git+https://github.com/kemitchell/spdx-expression-validate.js.git" - }, - "scripts": { - "lint": "standard", - "test": "defence -i javascript README.md | replace-require-self | node" - }, - "version": "1.0.2" -} diff --git a/node_modules/spdx-ranges/LICENSE.md b/node_modules/spdx-ranges/LICENSE.md deleted file mode 100644 index 6c2555895..000000000 --- a/node_modules/spdx-ranges/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License - -Copyright (c) 2015 Kyle E. Mitchell - -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/node_modules/spdx-ranges/README.md b/node_modules/spdx-ranges/README.md deleted file mode 100644 index 46c95af1d..000000000 --- a/node_modules/spdx-ranges/README.md +++ /dev/null @@ -1,38 +0,0 @@ -```javascript -var assert = require('assert') -var ranges = require('spdx-ranges') - -assert( - Array.isArray(ranges), - 'module is an Array' -) - -assert( - ranges.length > 0, - 'the Array has elements' -) - -assert( - ranges.every(function (e) { - return Array.isArray(e) - }), - 'each Array element is an Array' -) - -assert( - ranges.every(function (range) { - return range.every(function (element) { - return ( - typeof element === 'string' || - ( - Array.isArray(element) && - element.every(function (element) { - return typeof element === 'string' - }) - ) - ) - }) - }), - 'elements of Array-elements are strings or Arrays of Strings' -) -``` diff --git a/node_modules/spdx-ranges/index.json b/node_modules/spdx-ranges/index.json deleted file mode 100644 index 5593f89bf..000000000 --- a/node_modules/spdx-ranges/index.json +++ /dev/null @@ -1,233 +0,0 @@ -[ - [ - "AFL-1.1", - "AFL-1.2", - "AFL-2.0", - "AFL-2.1", - "AFL-3.0" - ], - [ - "AGPL-1.0", - [ - "AGPL-3.0", - "AGPL-3.0-only" - ] - ], - [ - "Apache-1.0", - "Apache-1.1", - "Apache-2.0" - ], - [ - "APSL-1.0", - "APSL-1.1", - "APSL-1.2", - "APSL-2.0" - ], - [ - "Artistic-1.0", - "Artistic-2.0" - ], - [ - "BitTorrent-1.0", - "BitTorrent-1.1" - ], - [ - "CC-BY-1.0", - "CC-BY-2.0", - "CC-BY-2.5", - "CC-BY-3.0", - "CC-BY-4.0" - ], - [ - "CC-BY-NC-1.0", - "CC-BY-NC-2.0", - "CC-BY-NC-2.5", - "CC-BY-NC-3.0", - "CC-BY-NC-4.0" - ], - [ - "CC-BY-NC-ND-1.0", - "CC-BY-NC-ND-2.0", - "CC-BY-NC-ND-2.5", - "CC-BY-NC-ND-3.0", - "CC-BY-NC-ND-4.0" - ], - [ - "CC-BY-NC-SA-1.0", - "CC-BY-NC-SA-2.0", - "CC-BY-NC-SA-2.5", - "CC-BY-NC-SA-3.0", - "CC-BY-NC-SA-4.0" - ], - [ - "CC-BY-ND-1.0", - "CC-BY-ND-2.0", - "CC-BY-ND-2.5", - "CC-BY-ND-3.0", - "CC-BY-ND-4.0" - ], - [ - "CC-BY-SA-1.0", - "CC-BY-SA-2.0", - "CC-BY-SA-2.5", - "CC-BY-SA-3.0", - "CC-BY-SA-4.0" - ], - [ - "CDDL-1.0", - "CDDL-1.1" - ], - [ - "CECILL-1.0", - "CECILL-1.1", - "CECILL-2.0" - ], - [ - "ECL-1.0", - "ECL-2.0" - ], - [ - "EFL-1.0", - "EFL-2.0" - ], - [ - "EUPL-1.0", - "EUPL-1.1" - ], - [ - [ - "GFDL-1.1", - "GFDL-1.1-only" - ], - [ - "GFDL-1.2", - "GFDL-1.2-only" - ], - [ - "GFDL-1.1-or-later", - "GFDL-1.2-or-later", - "GFDL-1.3", - "GFDL-1.3-only", - "GFDL-1.3-or-later" - ] - ], - [ - [ - "GPL-1.0", - "GPL-1.0-only" - ], - [ - "GPL-2.0", - "GPL-2.0-only" - ], - [ - "GPL-1.0-or-later", - "GPL-2.0-or-later", - "GPL-3.0", - "GPL-3.0-only", - "GPL-3.0-or-later" - ] - ], - [ - [ - "LGPL-2.0", - "LGPL-2.0-only" - ], - [ - "LGPL-2.1", - "LGPL-2.1-only" - ], - [ - "LGPL-2.0-or-later", - "LGPL-2.1-or-later", - "LGPL-3.0", - "LGPL-3.0-only", - "LGPL-3.0-or-later" - ] - ], - [ - "LPL-1.0", - "LPL-1.02" - ], - [ - "LPPL-1.0", - "LPPL-1.1", - "LPPL-1.2", - "LPPL-1.3a", - "LPPL-1.3c" - ], - [ - "MPL-1.0", - "MPL-1.1", - "MPL-2.0" - ], - [ - "MPL-1.0", - "MPL-1.1", - "MPL-2.0-no-copyleft-exception" - ], - [ - "NPL-1.0", - "NPL-1.1" - ], - [ - "OFL-1.0", - "OFL-1.1" - ], - [ - "OLDAP-1.1", - "OLDAP-1.2", - "OLDAP-1.3", - "OLDAP-1.4", - "OLDAP-2.0", - "OLDAP-2.0.1", - "OLDAP-2.1", - "OLDAP-2.2", - "OLDAP-2.2.1", - "OLDAP-2.2.2", - "OLDAP-2.3", - "OLDAP-2.4", - "OLDAP-2.5", - "OLDAP-2.6", - "OLDAP-2.7", - "OLDAP-2.8" - ], - [ - "OSL-1.0", - "OSL-1.1", - "OSL-2.0", - "OSL-2.1", - "OSL-3.0" - ], - [ - "PHP-3.0", - "PHP-3.01" - ], - [ - "RPL-1.1", - "RPL-1.5" - ], - [ - "SGI-B-1.0", - "SGI-B-1.1", - "SGI-B-2.0" - ], - [ - "YPL-1.0", - "YPL-1.1" - ], - [ - "ZPL-1.1", - "ZPL-2.0", - "ZPL-2.1" - ], - [ - "Zimbra-1.3", - "Zimbra-1.4" - ], - [ - "bzip2-1.0.5", - "bzip2-1.0.6" - ] -] diff --git a/node_modules/spdx-ranges/package.json b/node_modules/spdx-ranges/package.json deleted file mode 100644 index 6dd46a69a..000000000 --- a/node_modules/spdx-ranges/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_args": [ - [ - "spdx-ranges@2.0.0", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_development": true, - "_from": "spdx-ranges@2.0.0", - "_id": "spdx-ranges@2.0.0", - "_inBundle": false, - "_integrity": "sha512-AUUXLfqkwD7GlzZkXv8ePPCpPjeVWI9xJCfysL8re/uKb6H10umMnC7bFRsHmLJan4fslUtekAgpHlSgLc/7mA==", - "_location": "/spdx-ranges", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "spdx-ranges@2.0.0", - "name": "spdx-ranges", - "escapedName": "spdx-ranges", - "rawSpec": "2.0.0", - "saveSpec": null, - "fetchSpec": "2.0.0" - }, - "_requiredBy": [ - "/spdx-compare", - "/spdx-satisfies" - ], - "_resolved": "https://registry.npmjs.org/spdx-ranges/-/spdx-ranges-2.0.0.tgz", - "_spec": "2.0.0", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "The Linux Foundation" - }, - "bugs": { - "url": "https://github.com/kemitchell/spdx-ranges.js/issues" - }, - "contributors": [ - { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "https://kemitchell.com/" - } - ], - "description": "list of SPDX standard license ranges", - "devDependencies": { - "defence-cli": "^1.0.1" - }, - "homepage": "https://github.com/kemitchell/spdx-ranges.js#readme", - "license": "CC-BY-3.0", - "name": "spdx-ranges", - "repository": { - "type": "git", - "url": "git+https://github.com/kemitchell/spdx-ranges.js.git" - }, - "scripts": { - "test": "defence -i javascript README.md | sed 's!spdx-ranges!./!' | node" - }, - "version": "2.0.0" -} diff --git a/node_modules/spdx-ranges/test.log b/node_modules/spdx-ranges/test.log deleted file mode 100644 index 90608d1cb..000000000 --- a/node_modules/spdx-ranges/test.log +++ /dev/null @@ -1,4 +0,0 @@ - -> spdx-ranges@1.0.1 test /home/kyle/spdx-ranges.js -> defence -i javascript README.md | sed 's!spdx-ranges!./!' | node - diff --git a/node_modules/spdx-satisfies/LICENSE.md b/node_modules/spdx-satisfies/LICENSE.md deleted file mode 100644 index 6c2555895..000000000 --- a/node_modules/spdx-satisfies/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License - -Copyright (c) 2015 Kyle E. Mitchell - -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/node_modules/spdx-satisfies/README.md b/node_modules/spdx-satisfies/README.md deleted file mode 100644 index 2d175ea8a..000000000 --- a/node_modules/spdx-satisfies/README.md +++ /dev/null @@ -1,31 +0,0 @@ -```javascript -var assert = require('assert') -var satisfies = require('spdx-satisfies') - -assert(satisfies('MIT', 'MIT')) - -assert(satisfies('MIT', '(ISC OR MIT)')) -assert(satisfies('Zlib', '(ISC OR (MIT OR Zlib))')) -assert(!satisfies('GPL-3.0', '(ISC OR MIT)')) - -assert(satisfies('GPL-2.0', 'GPL-2.0+')) -assert(satisfies('GPL-3.0', 'GPL-2.0+')) -assert(satisfies('GPL-1.0+', 'GPL-2.0+')) -assert(!satisfies('GPL-1.0', 'GPL-2.0+')) -assert(satisfies('GPL-2.0-only', 'GPL-2.0-only')) -assert(satisfies('GPL-3.0-only', 'GPL-2.0+')) - -assert(!satisfies( - 'GPL-2.0', - 'GPL-2.0+ WITH Bison-exception-2.2' -)) - -assert(satisfies( - 'GPL-3.0 WITH Bison-exception-2.2', - 'GPL-2.0+ WITH Bison-exception-2.2' -)) - -assert(satisfies('(MIT OR GPL-2.0)', '(ISC OR MIT)')) -assert(satisfies('(MIT AND GPL-2.0)', '(MIT OR GPL-2.0)')) -assert(!satisfies('(MIT AND GPL-2.0)', '(ISC OR GPL-2.0)')) -``` diff --git a/node_modules/spdx-satisfies/index.js b/node_modules/spdx-satisfies/index.js deleted file mode 100644 index 2eb22a6b3..000000000 --- a/node_modules/spdx-satisfies/index.js +++ /dev/null @@ -1,112 +0,0 @@ -var compare = require('spdx-compare') -var parse = require('spdx-expression-parse') -var ranges = require('spdx-ranges') - -var rangesAreCompatible = function (first, second) { - return ( - first.license === second.license || - ranges.some(function (range) { - return ( - licenseInRange(first.license, range) && - licenseInRange(second.license, range) - ) - }) - ) -} - -function licenseInRange (license, range) { - return ( - range.indexOf(license) !== -1 || - range.some(function (element) { - return ( - Array.isArray(element) && - element.indexOf(license) !== -1 - ) - }) - ) -} - -var identifierInRange = function (identifier, range) { - return ( - identifier.license === range.license || - compare.gt(identifier.license, range.license) || - compare.eq(identifier.license, range.license) - ) -} - -var licensesAreCompatible = function (first, second) { - if (first.exception !== second.exception) { - return false - } else if (second.hasOwnProperty('license')) { - if (second.hasOwnProperty('plus')) { - if (first.hasOwnProperty('plus')) { - // first+, second+ - return rangesAreCompatible(first, second) - } else { - // first, second+ - return identifierInRange(first, second) - } - } else { - if (first.hasOwnProperty('plus')) { - // first+, second - return identifierInRange(second, first) - } else { - // first, second - return first.license === second.license - } - } - } -} - -var recurseLeftAndRight = function (first, second) { - var firstConjunction = first.conjunction - if (firstConjunction === 'and') { - return ( - recurse(first.left, second) && - recurse(first.right, second) - ) - } else if (firstConjunction === 'or') { - return ( - recurse(first.left, second) || - recurse(first.right, second) - ) - } -} - -var recurse = function (first, second) { - if (first.hasOwnProperty('conjunction')) { - return recurseLeftAndRight(first, second) - } else if (second.hasOwnProperty('conjunction')) { - return recurseLeftAndRight(second, first) - } else { - return licensesAreCompatible(first, second) - } -} - -function normalizeGPLIdentifiers (argument) { - var license = argument.license - if (license) { - if (endsWith(license, '-or-later')) { - argument.license = license.replace('-or-later', '') - argument.plus = true - } else if (endsWith(license, '-only')) { - argument.license = license.replace('-or-later', '') - delete argument.plus - } - } else { - argument.left = normalizeGPLIdentifiers(argument.left) - argument.right = normalizeGPLIdentifiers(argument.right) - } - return argument -} - -function endsWith (string, substring) { - return string.indexOf(substring) === string.length - 1 -} - -module.exports = function (first, second) { - return recurse( - normalizeGPLIdentifiers(parse(first)), - normalizeGPLIdentifiers(parse(second)) - ) -} diff --git a/node_modules/spdx-satisfies/package.json b/node_modules/spdx-satisfies/package.json deleted file mode 100644 index 3354a86bc..000000000 --- a/node_modules/spdx-satisfies/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "_args": [ - [ - "spdx-satisfies@4.0.0", - "/Users/zkat/Documents/code/work/npm" - ] - ], - "_development": true, - "_from": "spdx-satisfies@4.0.0", - "_id": "spdx-satisfies@4.0.0", - "_inBundle": false, - "_integrity": "sha512-OcARj6U1OuVv98SVrRqgrR30sVocONtoPpnX8Xz4vXNrFVedqtbgkA+0KmQoXIQ2xjfltPPRVIMeNzKEFLWWKQ==", - "_location": "/spdx-satisfies", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "spdx-satisfies@4.0.0", - "name": "spdx-satisfies", - "escapedName": "spdx-satisfies", - "rawSpec": "4.0.0", - "saveSpec": null, - "fetchSpec": "4.0.0" - }, - "_requiredBy": [ - "/licensee" - ], - "_resolved": "https://registry.npmjs.org/spdx-satisfies/-/spdx-satisfies-4.0.0.tgz", - "_spec": "4.0.0", - "_where": "/Users/zkat/Documents/code/work/npm", - "author": { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "https://kemitchell.com" - }, - "bugs": { - "url": "https://github.com/kemitchell/spdx-satisfies.js/issues" - }, - "dependencies": { - "spdx-compare": "^1.0.0", - "spdx-expression-parse": "^3.0.0", - "spdx-ranges": "^2.0.0" - }, - "description": "test whether SPDX expressions satisfy licensing criteria", - "devDependencies": { - "defence-cli": "^2.0.1", - "replace-require-self": "^1.1.1", - "standard": "^11.0.0" - }, - "homepage": "https://github.com/kemitchell/spdx-satisfies.js#readme", - "keywords": [ - "SPDX", - "law", - "legal", - "license", - "metadata", - "package", - "package.json", - "standards" - ], - "license": "MIT", - "name": "spdx-satisfies", - "repository": { - "type": "git", - "url": "git+https://github.com/kemitchell/spdx-satisfies.js.git" - }, - "scripts": { - "lint": "standard", - "test": "defence -i javascript README.md | replace-require-self | node" - }, - "version": "4.0.0" -} |