From 8aea7a11d73009de462bfc16bb238b85ce3f8f7f Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Fri, 29 Jun 2018 17:16:52 -0400 Subject: [PATCH] Update tap and add package-lock.json --- .../deep-is/.npmignore => .gitignore | 0 node_modules/.bin/tap | 1 - node_modules/tap/.npmignore | 0 node_modules/tap/AUTHORS | 11 - node_modules/tap/LICENSE | 23 - node_modules/tap/README.md | 86 - node_modules/tap/bin/tap-http.js | 19 - node_modules/tap/bin/tap-reader.js | 33 - node_modules/tap/bin/tap.js | 147 - node_modules/tap/coverage-example/lib/bar.js | 15 - node_modules/tap/coverage-example/lib/foo.js | 15 - .../tap/coverage-example/test/bar.test.js | 20 - .../tap/coverage-example/test/baz.test.js | 29 - .../tap/coverage-example/test/foo.test.js | 20 - node_modules/tap/example/lib/math.js | 1 - node_modules/tap/example/test/test-example.js | 237 - node_modules/tap/lib/main.js | 16 - node_modules/tap/lib/tap-assert.js | 466 -- node_modules/tap/lib/tap-browser-harness.js | 63 - node_modules/tap/lib/tap-consumer.js | 246 - node_modules/tap/lib/tap-cov-html.js | 78 - node_modules/tap/lib/tap-global-harness.js | 80 - node_modules/tap/lib/tap-harness.js | 226 - node_modules/tap/lib/tap-producer.js | 131 - node_modules/tap/lib/tap-results.js | 72 - node_modules/tap/lib/tap-runner.js | 502 -- node_modules/tap/lib/tap-test.js | 110 - node_modules/tap/node_modules/.bin/mkdirp | 1 - node_modules/tap/node_modules/.bin/nopt | 1 - .../tap/node_modules/buffer-equal/.travis.yml | 4 - .../node_modules/buffer-equal/README.markdown | 62 - .../node_modules/buffer-equal/example/eq.js | 14 - .../tap/node_modules/buffer-equal/index.js | 14 - .../node_modules/buffer-equal/package.json | 57 - .../tap/node_modules/buffer-equal/test/eq.js | 35 - .../tap/node_modules/deep-equal/.travis.yml | 4 - .../tap/node_modules/deep-equal/LICENSE | 18 - .../node_modules/deep-equal/example/cmp.js | 11 - .../tap/node_modules/deep-equal/index.js | 94 - .../deep-equal/lib/is_arguments.js | 20 - .../tap/node_modules/deep-equal/lib/keys.js | 9 - .../tap/node_modules/deep-equal/package.json | 84 - .../node_modules/deep-equal/readme.markdown | 61 - .../tap/node_modules/deep-equal/test/cmp.js | 89 - .../tap/node_modules/difflet/.travis.yml | 4 - .../tap/node_modules/difflet/README.markdown | 116 - .../node_modules/difflet/example/cmp_array.js | 6 - .../difflet/example/cmp_object.js | 6 - .../node_modules/difflet/example/colors.js | 18 - .../difflet/example/comma_first.js | 12 - .../tap/node_modules/difflet/example/diff.js | 15 - .../tap/node_modules/difflet/example/html.js | 34 - .../node_modules/difflet/example/string.js | 4 - .../tap/node_modules/difflet/index.js | 377 -- .../node_modules/charm/README.markdown | 216 - .../difflet/node_modules/charm/example/256.js | 17 - .../node_modules/charm/example/column.js | 11 - .../node_modules/charm/example/cursor.js | 22 - .../node_modules/charm/example/http_spin.js | 36 - .../node_modules/charm/example/lucky.js | 24 - .../node_modules/charm/example/position.js | 7 - .../node_modules/charm/example/progress.js | 18 - .../node_modules/charm/example/resize.js | 62 - .../node_modules/charm/example/spin.js | 23 - .../difflet/node_modules/charm/index.js | 305 -- .../difflet/node_modules/charm/lib/encode.js | 18 - .../difflet/node_modules/charm/package.json | 58 - .../difflet/node_modules/deep-is/.travis.yml | 6 - .../difflet/node_modules/deep-is/LICENSE | 22 - .../node_modules/deep-is/README.markdown | 70 - .../node_modules/deep-is/example/cmp.js | 11 - .../difflet/node_modules/deep-is/index.js | 102 - .../difflet/node_modules/deep-is/package.json | 86 - .../difflet/node_modules/deep-is/test/NaN.js | 16 - .../difflet/node_modules/deep-is/test/cmp.js | 23 - .../node_modules/deep-is/test/neg-vs-pos-0.js | 15 - .../difflet/node_modules/traverse/.npmignore | 1 - .../difflet/node_modules/traverse/.travis.yml | 3 - .../difflet/node_modules/traverse/LICENSE | 24 - .../node_modules/traverse/examples/json.js | 16 - .../node_modules/traverse/examples/leaves.js | 15 - .../traverse/examples/negative.js | 8 - .../node_modules/traverse/examples/scrub.js | 10 - .../traverse/examples/stringify.js | 38 - .../difflet/node_modules/traverse/index.js | 314 -- .../node_modules/traverse/package.json | 84 - .../node_modules/traverse/readme.markdown | 209 - .../node_modules/traverse/test/circular.js | 117 - .../node_modules/traverse/test/date.js | 37 - .../node_modules/traverse/test/equal.js | 240 - .../node_modules/traverse/test/error.js | 11 - .../difflet/node_modules/traverse/test/has.js | 15 - .../node_modules/traverse/test/instance.js | 17 - .../node_modules/traverse/test/interface.js | 43 - .../node_modules/traverse/test/json.js | 49 - .../node_modules/traverse/test/keys.js | 31 - .../node_modules/traverse/test/leaves.js | 22 - .../traverse/test/lib/deep_equal.js | 96 - .../node_modules/traverse/test/mutability.js | 300 - .../node_modules/traverse/test/negative.js | 21 - .../difflet/node_modules/traverse/test/obj.js | 11 - .../node_modules/traverse/test/siblings.js | 37 - .../node_modules/traverse/test/stop.js | 44 - .../node_modules/traverse/test/stringify.js | 36 - .../node_modules/traverse/test/subexpr.js | 36 - .../node_modules/traverse/test/super_deep.js | 56 - .../node_modules/traverse/testling/leaves.js | 22 - .../tap/node_modules/difflet/package.json | 66 - .../node_modules/difflet/test/diffing-NaN.js | 17 - .../tap/node_modules/difflet/test/html.js | 80 - node_modules/tap/node_modules/glob/LICENSE | 15 - node_modules/tap/node_modules/glob/README.md | 369 -- node_modules/tap/node_modules/glob/common.js | 237 - node_modules/tap/node_modules/glob/glob.js | 740 --- .../glob/node_modules/inflight/.eslintrc | 17 - .../glob/node_modules/inflight/LICENSE | 15 - .../glob/node_modules/inflight/README.md | 37 - .../glob/node_modules/inflight/inflight.js | 44 - .../inflight/node_modules/wrappy/LICENSE | 15 - .../inflight/node_modules/wrappy/README.md | 36 - .../inflight/node_modules/wrappy/package.json | 36 - .../node_modules/wrappy/test/basic.js | 51 - .../inflight/node_modules/wrappy/wrappy.js | 33 - .../glob/node_modules/inflight/package.json | 36 - .../glob/node_modules/inflight/test.js | 97 - .../glob/node_modules/minimatch/LICENSE | 23 - .../glob/node_modules/minimatch/README.md | 216 - .../glob/node_modules/minimatch/browser.js | 1113 ---- .../glob/node_modules/minimatch/minimatch.js | 867 --- .../node_modules/brace-expansion/.npmignore | 2 - .../node_modules/brace-expansion/.travis.yml | 3 - .../node_modules/brace-expansion/README.md | 121 - .../node_modules/brace-expansion/example.js | 8 - .../node_modules/brace-expansion/index.js | 191 - .../node_modules/balanced-match/.npmignore | 2 - .../node_modules/balanced-match/.travis.yml | 4 - .../node_modules/balanced-match/Makefile | 6 - .../node_modules/balanced-match/README.md | 80 - .../node_modules/balanced-match/example.js | 5 - .../node_modules/balanced-match/index.js | 38 - .../node_modules/balanced-match/package.json | 56 - .../balanced-match/test/balanced.js | 56 - .../node_modules/concat-map/.travis.yml | 4 - .../node_modules/concat-map/LICENSE | 18 - .../node_modules/concat-map/README.markdown | 62 - .../node_modules/concat-map/example/map.js | 6 - .../node_modules/concat-map/index.js | 13 - .../node_modules/concat-map/package.json | 69 - .../node_modules/concat-map/test/map.js | 39 - .../node_modules/brace-expansion/package.json | 54 - .../brace-expansion/test/bash-comparison.js | 32 - .../brace-expansion/test/bash-results.txt | 1075 ---- .../brace-expansion/test/cases.txt | 182 - .../brace-expansion/test/dollar.js | 9 - .../brace-expansion/test/empty-option.js | 10 - .../brace-expansion/test/generate.sh | 24 - .../test/negative-increment.js | 15 - .../brace-expansion/test/nested.js | 16 - .../brace-expansion/test/order.js | 10 - .../node_modules/brace-expansion/test/pad.js | 13 - .../brace-expansion/test/same-type.js | 7 - .../brace-expansion/test/sequence.js | 50 - .../glob/node_modules/minimatch/package.json | 66 - .../glob/node_modules/once/LICENSE | 27 - .../glob/node_modules/once/README.md | 51 - .../once/node_modules/wrappy/LICENSE | 15 - .../once/node_modules/wrappy/README.md | 36 - .../once/node_modules/wrappy/package.json | 36 - .../once/node_modules/wrappy/test/basic.js | 51 - .../once/node_modules/wrappy/wrappy.js | 33 - .../glob/node_modules/once/once.js | 21 - .../glob/node_modules/once/package.json | 44 - .../glob/node_modules/once/test/once.js | 23 - .../tap/node_modules/glob/package.json | 55 - node_modules/tap/node_modules/glob/sync.js | 457 -- .../tap/node_modules/inherits/LICENSE | 16 - .../tap/node_modules/inherits/README.md | 42 - .../tap/node_modules/inherits/inherits.js | 1 - .../node_modules/inherits/inherits_browser.js | 23 - .../tap/node_modules/inherits/package.json | 35 - .../tap/node_modules/inherits/test.js | 25 - .../tap/node_modules/mkdirp/.npmignore | 2 - .../tap/node_modules/mkdirp/.travis.yml | 5 - node_modules/tap/node_modules/mkdirp/LICENSE | 21 - .../tap/node_modules/mkdirp/bin/cmd.js | 33 - .../tap/node_modules/mkdirp/bin/usage.txt | 12 - .../tap/node_modules/mkdirp/examples/pow.js | 6 - node_modules/tap/node_modules/mkdirp/index.js | 97 - .../mkdirp/node_modules/minimist/.travis.yml | 4 - .../mkdirp/node_modules/minimist/LICENSE | 18 - .../node_modules/minimist/example/parse.js | 2 - .../mkdirp/node_modules/minimist/index.js | 187 - .../mkdirp/node_modules/minimist/package.json | 67 - .../node_modules/minimist/readme.markdown | 73 - .../mkdirp/node_modules/minimist/test/dash.js | 24 - .../minimist/test/default_bool.js | 20 - .../node_modules/minimist/test/dotted.js | 16 - .../mkdirp/node_modules/minimist/test/long.js | 31 - .../node_modules/minimist/test/parse.js | 318 -- .../minimist/test/parse_modified.js | 9 - .../node_modules/minimist/test/short.js | 67 - .../node_modules/minimist/test/whitespace.js | 8 - .../tap/node_modules/mkdirp/package.json | 43 - .../tap/node_modules/mkdirp/readme.markdown | 100 - .../tap/node_modules/mkdirp/test/chmod.js | 38 - .../tap/node_modules/mkdirp/test/clobber.js | 37 - .../tap/node_modules/mkdirp/test/mkdirp.js | 26 - .../tap/node_modules/mkdirp/test/opts_fs.js | 27 - .../node_modules/mkdirp/test/opts_fs_sync.js | 25 - .../tap/node_modules/mkdirp/test/perm.js | 30 - .../tap/node_modules/mkdirp/test/perm_sync.js | 34 - .../tap/node_modules/mkdirp/test/race.js | 40 - .../tap/node_modules/mkdirp/test/rel.js | 30 - .../tap/node_modules/mkdirp/test/return.js | 25 - .../node_modules/mkdirp/test/return_sync.js | 24 - .../tap/node_modules/mkdirp/test/root.js | 18 - .../tap/node_modules/mkdirp/test/sync.js | 30 - .../tap/node_modules/mkdirp/test/umask.js | 26 - .../node_modules/mkdirp/test/umask_sync.js | 30 - node_modules/tap/node_modules/nopt/.npmignore | 1 - node_modules/tap/node_modules/nopt/LICENSE | 23 - node_modules/tap/node_modules/nopt/README.md | 209 - .../tap/node_modules/nopt/bin/nopt.js | 54 - .../node_modules/nopt/examples/my-program.js | 30 - .../tap/node_modules/nopt/lib/nopt.js | 414 -- .../nopt/node_modules/abbrev/CONTRIBUTING.md | 3 - .../nopt/node_modules/abbrev/LICENSE | 23 - .../nopt/node_modules/abbrev/README.md | 23 - .../nopt/node_modules/abbrev/abbrev.js | 62 - .../nopt/node_modules/abbrev/package.json | 31 - .../nopt/node_modules/abbrev/test.js | 47 - .../tap/node_modules/nopt/package.json | 41 - .../tap/node_modules/nopt/test/basic.js | 251 - .../node_modules/runforcover/README.markdown | 56 - .../tap/node_modules/runforcover/index.js | 127 - .../node_modules/bunker/.npmignore | 1 - .../node_modules/bunker/.travis.yml | 4 - .../node_modules/bunker/README.markdown | 82 - .../node_modules/bunker/example/prof.js | 51 - .../node_modules/bunker/example/tiny.js | 18 - .../node_modules/bunker/example/top/run.js | 31 - .../node_modules/bunker/example/top/src.js | 18 - .../runforcover/node_modules/bunker/index.js | 116 - .../bunker/node_modules/burrito/.npmignore | 1 - .../bunker/node_modules/burrito/.travis.yml | 4 - .../node_modules/burrito/README.markdown | 187 - .../node_modules/burrito/example/microwave.js | 8 - .../node_modules/burrito/example/web/bs.js | 4832 ----------------- .../burrito/example/web/index.html | 14 - .../node_modules/burrito/example/web/main.js | 17 - .../burrito/example/web/server.js | 12 - .../node_modules/burrito/example/wrap.js | 7 - .../bunker/node_modules/burrito/index.js | 208 - .../burrito/node_modules/.bin/uglifyjs | 1 - .../burrito/node_modules/traverse/.npmignore | 1 - .../burrito/node_modules/traverse/LICENSE | 24 - .../node_modules/traverse/README.markdown | 237 - .../node_modules/traverse/examples/json.js | 16 - .../node_modules/traverse/examples/leaves.js | 15 - .../traverse/examples/negative.js | 8 - .../node_modules/traverse/examples/scrub.js | 10 - .../traverse/examples/stringify.js | 38 - .../burrito/node_modules/traverse/index.js | 267 - .../burrito/node_modules/traverse/main.js | 10 - .../node_modules/traverse/package.json | 54 - .../node_modules/traverse/test/circular.js | 115 - .../node_modules/traverse/test/date.js | 35 - .../node_modules/traverse/test/equal.js | 220 - .../node_modules/traverse/test/instance.js | 17 - .../node_modules/traverse/test/interface.js | 42 - .../node_modules/traverse/test/json.js | 47 - .../node_modules/traverse/test/keys.js | 29 - .../node_modules/traverse/test/leaves.js | 21 - .../traverse/test/lib/deep_equal.js | 92 - .../node_modules/traverse/test/mutability.js | 252 - .../node_modules/traverse/test/negative.js | 20 - .../burrito/node_modules/traverse/test/obj.js | 15 - .../node_modules/traverse/test/siblings.js | 35 - .../node_modules/traverse/test/stop.js | 41 - .../node_modules/traverse/test/stringify.js | 36 - .../node_modules/traverse/test/subexpr.js | 34 - .../node_modules/traverse/test/super_deep.js | 55 - .../burrito/node_modules/uglify-js/.npmignore | 4 - .../node_modules/uglify-js/README.html | 1026 ---- .../burrito/node_modules/uglify-js/README.org | 571 -- .../node_modules/uglify-js/bin/uglifyjs | 317 -- .../node_modules/uglify-js/docstyle.css | 75 - .../node_modules/uglify-js/lib/object-ast.js | 75 - .../node_modules/uglify-js/lib/parse-js.js | 1339 ----- .../node_modules/uglify-js/lib/process.js | 2001 ------- .../uglify-js/lib/squeeze-more.js | 51 - .../node_modules/uglify-js/package.json | 59 - .../node_modules/uglify-js/test/beautify.js | 28 - .../node_modules/uglify-js/test/testparser.js | 403 -- .../test/unit/compress/expected/array1.js | 1 - .../test/unit/compress/expected/array2.js | 1 - .../test/unit/compress/expected/array3.js | 1 - .../test/unit/compress/expected/array4.js | 1 - .../test/unit/compress/expected/assignment.js | 1 - .../unit/compress/expected/concatstring.js | 1 - .../test/unit/compress/expected/const.js | 1 - .../unit/compress/expected/empty-blocks.js | 1 - .../unit/compress/expected/forstatement.js | 1 - .../test/unit/compress/expected/if.js | 1 - .../test/unit/compress/expected/ifreturn.js | 1 - .../test/unit/compress/expected/ifreturn2.js | 1 - .../test/unit/compress/expected/issue10.js | 1 - .../test/unit/compress/expected/issue11.js | 1 - .../test/unit/compress/expected/issue13.js | 1 - .../test/unit/compress/expected/issue14.js | 1 - .../test/unit/compress/expected/issue16.js | 1 - .../test/unit/compress/expected/issue17.js | 1 - .../test/unit/compress/expected/issue20.js | 1 - .../test/unit/compress/expected/issue21.js | 1 - .../test/unit/compress/expected/issue25.js | 1 - .../test/unit/compress/expected/issue27.js | 1 - .../test/unit/compress/expected/issue28.js | 1 - .../test/unit/compress/expected/issue29.js | 1 - .../test/unit/compress/expected/issue30.js | 1 - .../test/unit/compress/expected/issue34.js | 1 - .../test/unit/compress/expected/issue4.js | 1 - .../test/unit/compress/expected/issue48.js | 1 - .../test/unit/compress/expected/issue50.js | 1 - .../test/unit/compress/expected/issue53.js | 1 - .../test/unit/compress/expected/issue54.1.js | 1 - .../test/unit/compress/expected/issue68.js | 1 - .../test/unit/compress/expected/issue69.js | 1 - .../test/unit/compress/expected/issue9.js | 1 - .../test/unit/compress/expected/mangle.js | 1 - .../unit/compress/expected/null_string.js | 1 - .../unit/compress/expected/strict-equals.js | 1 - .../test/unit/compress/expected/var.js | 1 - .../test/unit/compress/expected/whitespace.js | 1 - .../test/unit/compress/expected/with.js | 1 - .../test/unit/compress/test/array1.js | 3 - .../test/unit/compress/test/array2.js | 4 - .../test/unit/compress/test/array3.js | 4 - .../test/unit/compress/test/array4.js | 6 - .../test/unit/compress/test/assignment.js | 20 - .../test/unit/compress/test/concatstring.js | 3 - .../test/unit/compress/test/const.js | 5 - .../test/unit/compress/test/empty-blocks.js | 4 - .../test/unit/compress/test/forstatement.js | 10 - .../uglify-js/test/unit/compress/test/if.js | 6 - .../test/unit/compress/test/ifreturn.js | 9 - .../test/unit/compress/test/ifreturn2.js | 16 - .../test/unit/compress/test/issue10.js | 1 - .../test/unit/compress/test/issue11.js | 3 - .../test/unit/compress/test/issue13.js | 1 - .../test/unit/compress/test/issue14.js | 1 - .../test/unit/compress/test/issue16.js | 1 - .../test/unit/compress/test/issue17.js | 4 - .../test/unit/compress/test/issue20.js | 1 - .../test/unit/compress/test/issue21.js | 6 - .../test/unit/compress/test/issue25.js | 7 - .../test/unit/compress/test/issue27.js | 1 - .../test/unit/compress/test/issue28.js | 3 - .../test/unit/compress/test/issue29.js | 1 - .../test/unit/compress/test/issue30.js | 3 - .../test/unit/compress/test/issue34.js | 3 - .../test/unit/compress/test/issue4.js | 3 - .../test/unit/compress/test/issue48.js | 1 - .../test/unit/compress/test/issue50.js | 9 - .../test/unit/compress/test/issue53.js | 1 - .../test/unit/compress/test/issue54.1.js | 3 - .../test/unit/compress/test/issue68.js | 5 - .../test/unit/compress/test/issue69.js | 1 - .../test/unit/compress/test/issue9.js | 4 - .../test/unit/compress/test/mangle.js | 5 - .../test/unit/compress/test/null_string.js | 1 - .../test/unit/compress/test/strict-equals.js | 3 - .../uglify-js/test/unit/compress/test/var.js | 3 - .../test/unit/compress/test/whitespace.js | 21 - .../uglify-js/test/unit/compress/test/with.js | 2 - .../uglify-js/test/unit/scripts.js | 55 - .../node_modules/uglify-js/tmp/hoist.js | 33 - .../node_modules/uglify-js/tmp/instrument.js | 97 - .../node_modules/uglify-js/tmp/instrument2.js | 138 - .../node_modules/uglify-js/tmp/test.js | 30 - .../node_modules/uglify-js/uglify-js.js | 17 - .../bunker/node_modules/burrito/package.json | 71 - .../bunker/node_modules/burrito/test/ast.js | 31 - .../bunker/node_modules/burrito/test/err.js | 52 - .../bunker/node_modules/burrito/test/fail.js | 9 - .../node_modules/burrito/test/fail/src.js | 60 - .../bunker/node_modules/burrito/test/label.js | 92 - .../node_modules/burrito/test/microwave.js | 34 - .../node_modules/burrito/test/parent.js | 27 - .../bunker/node_modules/burrito/test/wrap.js | 159 - .../node_modules/bunker/package.json | 68 - .../node_modules/bunker/test/cover.js | 36 - .../node_modules/bunker/test/return.js | 29 - .../node_modules/bunker/test/src/cover.js | 6 - .../tap/node_modules/runforcover/package.json | 65 - .../node_modules/runforcover/test/index.js | 1 - .../runforcover/test/interface.js | 50 - .../runforcover/test/src/coverage.js | 7 - node_modules/tap/node_modules/slide/LICENSE | 15 - node_modules/tap/node_modules/slide/README.md | 143 - node_modules/tap/node_modules/slide/index.js | 1 - .../slide/lib/async-map-ordered.js | 65 - .../tap/node_modules/slide/lib/async-map.js | 54 - .../tap/node_modules/slide/lib/bind-actor.js | 16 - .../tap/node_modules/slide/lib/chain.js | 20 - .../tap/node_modules/slide/lib/slide.js | 3 - .../tap/node_modules/slide/package.json | 55 - node_modules/tap/node_modules/yamlish/LICENSE | 19 - .../tap/node_modules/yamlish/README.md | 20 - .../tap/node_modules/yamlish/package.json | 54 - .../tap/node_modules/yamlish/yamlish.js | 260 - node_modules/tap/package.json | 84 - node_modules/tap/test-disabled/bailout.js | 36 - node_modules/tap/test-disabled/foo.js | 1 - node_modules/tap/test-disabled/t.js | 16 - node_modules/tap/test/buffer_compare.js | 11 - node_modules/tap/test/common.js | 32 - node_modules/tap/test/debug-test.js | 17 - node_modules/tap/test/deep-strict.js | 43 - node_modules/tap/test/deep.js | 43 - node_modules/tap/test/end-exception/t.js | 12 - node_modules/tap/test/executed.sh | 4 - node_modules/tap/test/exit-code.js | 69 - node_modules/tap/test/expose-gc-test.js | 53 - .../tap/test/fixtures/fail-correct-exit.js | 4 - node_modules/tap/test/fixtures/fail-exit.js | 4 - .../tap/test/fixtures/fail-zero-exit.js | 4 - node_modules/tap/test/fixtures/success.js | 3 - .../test/fixtures/todo-skip-descriptions.js | 4 - .../tap/test/fixtures/trivial-success.js | 1 - node_modules/tap/test/independent-timeouts.js | 16 - node_modules/tap/test/isolated-conf-test.js | 16 - node_modules/tap/test/meta-test.js | 73 - node_modules/tap/test/nested-async.js | 36 - node_modules/tap/test/nested-test.js | 22 - node_modules/tap/test/non-tap-output.js | 12 - node_modules/tap/test/not-executed.sh | 5 - .../tap/test/output-childtest-description.js | 50 - node_modules/tap/test/result-trap.js | 20 - node_modules/tap/test/segv.js | 70 - .../tap/test/simple-harness-test-with-plan.js | 16 - node_modules/tap/test/simple-harness-test.js | 13 - .../tap/test/test-assert-todo-skip.js | 13 - node_modules/tap/test/test-directives.js | 48 - node_modules/tap/test/test-skip.js | 5 - node_modules/tap/test/test-test.js | 91 - node_modules/tap/test/timeout.js | 33 - node_modules/tap/test/trivial-success.js | 0 node_modules/tap/test/undefined_indented.js | 27 - node_modules/tap/test/valid-command.js | 37 - package-lock.json | 3591 ++++++++++++ package.json | 4 +- 451 files changed, 3593 insertions(+), 33956 deletions(-) rename node_modules/tap/node_modules/difflet/node_modules/deep-is/.npmignore => .gitignore (100%) delete mode 120000 node_modules/.bin/tap delete mode 100644 node_modules/tap/.npmignore delete mode 100644 node_modules/tap/AUTHORS delete mode 100644 node_modules/tap/LICENSE delete mode 100644 node_modules/tap/README.md delete mode 100644 node_modules/tap/bin/tap-http.js delete mode 100755 node_modules/tap/bin/tap-reader.js delete mode 100755 node_modules/tap/bin/tap.js delete mode 100644 node_modules/tap/coverage-example/lib/bar.js delete mode 100644 node_modules/tap/coverage-example/lib/foo.js delete mode 100644 node_modules/tap/coverage-example/test/bar.test.js delete mode 100644 node_modules/tap/coverage-example/test/baz.test.js delete mode 100644 node_modules/tap/coverage-example/test/foo.test.js delete mode 100644 node_modules/tap/example/lib/math.js delete mode 100644 node_modules/tap/example/test/test-example.js delete mode 100644 node_modules/tap/lib/main.js delete mode 100644 node_modules/tap/lib/tap-assert.js delete mode 100644 node_modules/tap/lib/tap-browser-harness.js delete mode 100644 node_modules/tap/lib/tap-consumer.js delete mode 100644 node_modules/tap/lib/tap-cov-html.js delete mode 100644 node_modules/tap/lib/tap-global-harness.js delete mode 100644 node_modules/tap/lib/tap-harness.js delete mode 100644 node_modules/tap/lib/tap-producer.js delete mode 100644 node_modules/tap/lib/tap-results.js delete mode 100644 node_modules/tap/lib/tap-runner.js delete mode 100644 node_modules/tap/lib/tap-test.js delete mode 120000 node_modules/tap/node_modules/.bin/mkdirp delete mode 120000 node_modules/tap/node_modules/.bin/nopt delete mode 100644 node_modules/tap/node_modules/buffer-equal/.travis.yml delete mode 100644 node_modules/tap/node_modules/buffer-equal/README.markdown delete mode 100644 node_modules/tap/node_modules/buffer-equal/example/eq.js delete mode 100644 node_modules/tap/node_modules/buffer-equal/index.js delete mode 100644 node_modules/tap/node_modules/buffer-equal/package.json delete mode 100644 node_modules/tap/node_modules/buffer-equal/test/eq.js delete mode 100644 node_modules/tap/node_modules/deep-equal/.travis.yml delete mode 100644 node_modules/tap/node_modules/deep-equal/LICENSE delete mode 100644 node_modules/tap/node_modules/deep-equal/example/cmp.js delete mode 100644 node_modules/tap/node_modules/deep-equal/index.js delete mode 100644 node_modules/tap/node_modules/deep-equal/lib/is_arguments.js delete mode 100644 node_modules/tap/node_modules/deep-equal/lib/keys.js delete mode 100644 node_modules/tap/node_modules/deep-equal/package.json delete mode 100644 node_modules/tap/node_modules/deep-equal/readme.markdown delete mode 100644 node_modules/tap/node_modules/deep-equal/test/cmp.js delete mode 100644 node_modules/tap/node_modules/difflet/.travis.yml delete mode 100644 node_modules/tap/node_modules/difflet/README.markdown delete mode 100644 node_modules/tap/node_modules/difflet/example/cmp_array.js delete mode 100644 node_modules/tap/node_modules/difflet/example/cmp_object.js delete mode 100644 node_modules/tap/node_modules/difflet/example/colors.js delete mode 100644 node_modules/tap/node_modules/difflet/example/comma_first.js delete mode 100644 node_modules/tap/node_modules/difflet/example/diff.js delete mode 100644 node_modules/tap/node_modules/difflet/example/html.js delete mode 100644 node_modules/tap/node_modules/difflet/example/string.js delete mode 100644 node_modules/tap/node_modules/difflet/index.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/README.markdown delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/example/256.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/example/column.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/example/cursor.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/example/http_spin.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/example/lucky.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/example/position.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/example/progress.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/example/resize.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/example/spin.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/index.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/lib/encode.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/charm/package.json delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/deep-is/.travis.yml delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/deep-is/LICENSE delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/deep-is/README.markdown delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/deep-is/example/cmp.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/deep-is/index.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/deep-is/package.json delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/deep-is/test/NaN.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/deep-is/test/cmp.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/deep-is/test/neg-vs-pos-0.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/.npmignore delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/.travis.yml delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/LICENSE delete mode 100755 node_modules/tap/node_modules/difflet/node_modules/traverse/examples/json.js delete mode 100755 node_modules/tap/node_modules/difflet/node_modules/traverse/examples/leaves.js delete mode 100755 node_modules/tap/node_modules/difflet/node_modules/traverse/examples/negative.js delete mode 100755 node_modules/tap/node_modules/difflet/node_modules/traverse/examples/scrub.js delete mode 100755 node_modules/tap/node_modules/difflet/node_modules/traverse/examples/stringify.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/index.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/package.json delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/readme.markdown delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/circular.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/date.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/equal.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/error.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/has.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/instance.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/interface.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/json.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/keys.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/leaves.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/lib/deep_equal.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/mutability.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/negative.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/obj.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/siblings.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/stop.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/stringify.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/subexpr.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/test/super_deep.js delete mode 100644 node_modules/tap/node_modules/difflet/node_modules/traverse/testling/leaves.js delete mode 100644 node_modules/tap/node_modules/difflet/package.json delete mode 100644 node_modules/tap/node_modules/difflet/test/diffing-NaN.js delete mode 100644 node_modules/tap/node_modules/difflet/test/html.js delete mode 100644 node_modules/tap/node_modules/glob/LICENSE delete mode 100644 node_modules/tap/node_modules/glob/README.md delete mode 100644 node_modules/tap/node_modules/glob/common.js delete mode 100644 node_modules/tap/node_modules/glob/glob.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/inflight/.eslintrc delete mode 100644 node_modules/tap/node_modules/glob/node_modules/inflight/LICENSE delete mode 100644 node_modules/tap/node_modules/glob/node_modules/inflight/README.md delete mode 100644 node_modules/tap/node_modules/glob/node_modules/inflight/inflight.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE delete mode 100644 node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md delete mode 100644 node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json delete mode 100644 node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/inflight/package.json delete mode 100644 node_modules/tap/node_modules/glob/node_modules/inflight/test.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/LICENSE delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/README.md delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/browser.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/minimatch.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/minimatch/package.json delete mode 100644 node_modules/tap/node_modules/glob/node_modules/once/LICENSE delete mode 100644 node_modules/tap/node_modules/glob/node_modules/once/README.md delete mode 100644 node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE delete mode 100644 node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/README.md delete mode 100644 node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/package.json delete mode 100644 node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/once/once.js delete mode 100644 node_modules/tap/node_modules/glob/node_modules/once/package.json delete mode 100644 node_modules/tap/node_modules/glob/node_modules/once/test/once.js delete mode 100644 node_modules/tap/node_modules/glob/package.json delete mode 100644 node_modules/tap/node_modules/glob/sync.js delete mode 100644 node_modules/tap/node_modules/inherits/LICENSE delete mode 100644 node_modules/tap/node_modules/inherits/README.md delete mode 100644 node_modules/tap/node_modules/inherits/inherits.js delete mode 100644 node_modules/tap/node_modules/inherits/inherits_browser.js delete mode 100644 node_modules/tap/node_modules/inherits/package.json delete mode 100644 node_modules/tap/node_modules/inherits/test.js delete mode 100644 node_modules/tap/node_modules/mkdirp/.npmignore delete mode 100644 node_modules/tap/node_modules/mkdirp/.travis.yml delete mode 100644 node_modules/tap/node_modules/mkdirp/LICENSE delete mode 100755 node_modules/tap/node_modules/mkdirp/bin/cmd.js delete mode 100644 node_modules/tap/node_modules/mkdirp/bin/usage.txt delete mode 100644 node_modules/tap/node_modules/mkdirp/examples/pow.js delete mode 100644 node_modules/tap/node_modules/mkdirp/index.js delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/.travis.yml delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/LICENSE delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/example/parse.js delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/index.js delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/package.json delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/readme.markdown delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/dash.js delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/default_bool.js delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/dotted.js delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/long.js delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/parse.js delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/short.js delete mode 100644 node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/whitespace.js delete mode 100644 node_modules/tap/node_modules/mkdirp/package.json delete mode 100644 node_modules/tap/node_modules/mkdirp/readme.markdown delete mode 100644 node_modules/tap/node_modules/mkdirp/test/chmod.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/clobber.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/mkdirp.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/opts_fs.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/opts_fs_sync.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/perm.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/perm_sync.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/race.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/rel.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/return.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/return_sync.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/root.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/sync.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/umask.js delete mode 100644 node_modules/tap/node_modules/mkdirp/test/umask_sync.js delete mode 100644 node_modules/tap/node_modules/nopt/.npmignore delete mode 100644 node_modules/tap/node_modules/nopt/LICENSE delete mode 100644 node_modules/tap/node_modules/nopt/README.md delete mode 100755 node_modules/tap/node_modules/nopt/bin/nopt.js delete mode 100755 node_modules/tap/node_modules/nopt/examples/my-program.js delete mode 100644 node_modules/tap/node_modules/nopt/lib/nopt.js delete mode 100644 node_modules/tap/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md delete mode 100644 node_modules/tap/node_modules/nopt/node_modules/abbrev/LICENSE delete mode 100644 node_modules/tap/node_modules/nopt/node_modules/abbrev/README.md delete mode 100644 node_modules/tap/node_modules/nopt/node_modules/abbrev/abbrev.js delete mode 100644 node_modules/tap/node_modules/nopt/node_modules/abbrev/package.json delete mode 100644 node_modules/tap/node_modules/nopt/node_modules/abbrev/test.js delete mode 100644 node_modules/tap/node_modules/nopt/package.json delete mode 100644 node_modules/tap/node_modules/nopt/test/basic.js delete mode 100644 node_modules/tap/node_modules/runforcover/README.markdown delete mode 100644 node_modules/tap/node_modules/runforcover/index.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/.npmignore delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/.travis.yml delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/README.markdown delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/example/prof.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/example/tiny.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/example/top/run.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/example/top/src.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/index.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/.npmignore delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/.travis.yml delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/README.markdown delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/microwave.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/bs.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/index.html delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/main.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/server.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/wrap.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/index.js delete mode 120000 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/.bin/uglifyjs delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/.npmignore delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/LICENSE delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/README.markdown delete mode 100755 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/json.js delete mode 100755 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/leaves.js delete mode 100755 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/negative.js delete mode 100755 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/scrub.js delete mode 100755 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/stringify.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/index.js delete mode 100755 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/main.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/package.json delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/circular.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/date.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/equal.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/instance.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/interface.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/json.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/keys.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/leaves.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/lib/deep_equal.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/mutability.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/negative.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/obj.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/siblings.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stop.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stringify.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/subexpr.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/super_deep.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/.npmignore delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.html delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.org delete mode 100755 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/bin/uglifyjs delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/docstyle.css delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/lib/object-ast.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/lib/parse-js.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/lib/process.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/lib/squeeze-more.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/package.json delete mode 100755 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/beautify.js delete mode 100755 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/testparser.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/array1.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/array2.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/array3.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/array4.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/assignment.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/concatstring.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/const.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/forstatement.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/if.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue10.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue11.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue13.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue14.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue16.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue17.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue20.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue21.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue25.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue27.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue28.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue29.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue30.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue34.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue4.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue48.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue50.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue53.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue68.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue69.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue9.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/mangle.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/null_string.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/var.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/whitespace.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/with.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/array1.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/array2.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/array3.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/array4.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/assignment.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/concatstring.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/const.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/forstatement.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/if.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/ifreturn.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue10.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue11.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue13.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue14.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue16.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue17.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue20.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue21.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue25.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue27.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue28.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue29.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue30.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue34.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue4.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue48.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue50.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue53.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue54.1.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue68.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue69.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue9.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/mangle.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/null_string.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/strict-equals.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/var.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/whitespace.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/with.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/scripts.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/hoist.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/instrument.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/instrument2.js delete mode 100755 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/test.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/uglify-js.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/package.json delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/test/ast.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/test/err.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/test/fail.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/test/fail/src.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/test/label.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/test/microwave.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/test/parent.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/test/wrap.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/package.json delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/test/cover.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/test/return.js delete mode 100644 node_modules/tap/node_modules/runforcover/node_modules/bunker/test/src/cover.js delete mode 100644 node_modules/tap/node_modules/runforcover/package.json delete mode 100644 node_modules/tap/node_modules/runforcover/test/index.js delete mode 100644 node_modules/tap/node_modules/runforcover/test/interface.js delete mode 100644 node_modules/tap/node_modules/runforcover/test/src/coverage.js delete mode 100644 node_modules/tap/node_modules/slide/LICENSE delete mode 100644 node_modules/tap/node_modules/slide/README.md delete mode 100644 node_modules/tap/node_modules/slide/index.js delete mode 100644 node_modules/tap/node_modules/slide/lib/async-map-ordered.js delete mode 100644 node_modules/tap/node_modules/slide/lib/async-map.js delete mode 100644 node_modules/tap/node_modules/slide/lib/bind-actor.js delete mode 100644 node_modules/tap/node_modules/slide/lib/chain.js delete mode 100644 node_modules/tap/node_modules/slide/lib/slide.js delete mode 100644 node_modules/tap/node_modules/slide/package.json delete mode 100644 node_modules/tap/node_modules/yamlish/LICENSE delete mode 100644 node_modules/tap/node_modules/yamlish/README.md delete mode 100644 node_modules/tap/node_modules/yamlish/package.json delete mode 100644 node_modules/tap/node_modules/yamlish/yamlish.js delete mode 100644 node_modules/tap/package.json delete mode 100644 node_modules/tap/test-disabled/bailout.js delete mode 100644 node_modules/tap/test-disabled/foo.js delete mode 100644 node_modules/tap/test-disabled/t.js delete mode 100644 node_modules/tap/test/buffer_compare.js delete mode 100644 node_modules/tap/test/common.js delete mode 100644 node_modules/tap/test/debug-test.js delete mode 100644 node_modules/tap/test/deep-strict.js delete mode 100644 node_modules/tap/test/deep.js delete mode 100644 node_modules/tap/test/end-exception/t.js delete mode 100755 node_modules/tap/test/executed.sh delete mode 100644 node_modules/tap/test/exit-code.js delete mode 100644 node_modules/tap/test/expose-gc-test.js delete mode 100644 node_modules/tap/test/fixtures/fail-correct-exit.js delete mode 100644 node_modules/tap/test/fixtures/fail-exit.js delete mode 100644 node_modules/tap/test/fixtures/fail-zero-exit.js delete mode 100644 node_modules/tap/test/fixtures/success.js delete mode 100644 node_modules/tap/test/fixtures/todo-skip-descriptions.js delete mode 100644 node_modules/tap/test/fixtures/trivial-success.js delete mode 100644 node_modules/tap/test/independent-timeouts.js delete mode 100644 node_modules/tap/test/isolated-conf-test.js delete mode 100644 node_modules/tap/test/meta-test.js delete mode 100644 node_modules/tap/test/nested-async.js delete mode 100644 node_modules/tap/test/nested-test.js delete mode 100644 node_modules/tap/test/non-tap-output.js delete mode 100644 node_modules/tap/test/not-executed.sh delete mode 100644 node_modules/tap/test/output-childtest-description.js delete mode 100644 node_modules/tap/test/result-trap.js delete mode 100644 node_modules/tap/test/segv.js delete mode 100644 node_modules/tap/test/simple-harness-test-with-plan.js delete mode 100644 node_modules/tap/test/simple-harness-test.js delete mode 100644 node_modules/tap/test/test-assert-todo-skip.js delete mode 100644 node_modules/tap/test/test-directives.js delete mode 100644 node_modules/tap/test/test-skip.js delete mode 100644 node_modules/tap/test/test-test.js delete mode 100644 node_modules/tap/test/timeout.js delete mode 100644 node_modules/tap/test/trivial-success.js delete mode 100644 node_modules/tap/test/undefined_indented.js delete mode 100644 node_modules/tap/test/valid-command.js create mode 100644 package-lock.json diff --git a/node_modules/tap/node_modules/difflet/node_modules/deep-is/.npmignore b/.gitignore similarity index 100% rename from node_modules/tap/node_modules/difflet/node_modules/deep-is/.npmignore rename to .gitignore diff --git a/node_modules/.bin/tap b/node_modules/.bin/tap deleted file mode 120000 index 999914bf..00000000 --- a/node_modules/.bin/tap +++ /dev/null @@ -1 +0,0 @@ -../tap/bin/tap.js \ No newline at end of file diff --git a/node_modules/tap/.npmignore b/node_modules/tap/.npmignore deleted file mode 100644 index e69de29b..00000000 diff --git a/node_modules/tap/AUTHORS b/node_modules/tap/AUTHORS deleted file mode 100644 index b7f6eb23..00000000 --- a/node_modules/tap/AUTHORS +++ /dev/null @@ -1,11 +0,0 @@ -# contributors sorted by whether or not they're me -Isaac Z. Schlueter -baudehlo -James Halliday -Jason Smith (air) -Pedro P. Candel -Stein Martin Hustad -Trent Mick -Corey Richardson -Raynos -Siddharth Mahendraker diff --git a/node_modules/tap/LICENSE b/node_modules/tap/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/node_modules/tap/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/tap/README.md b/node_modules/tap/README.md deleted file mode 100644 index bed39553..00000000 --- a/node_modules/tap/README.md +++ /dev/null @@ -1,86 +0,0 @@ -This is a mix-and-match set of utilities that you can use to write test -harnesses and frameworks that communicate with one another using the -Test Anything Protocol. - -If you don't yet know what TAP is, [you better ask -somebody](http://testanything.org/). - -Default Usage: - -1. Make a directory. Maybe call it 'test'. That'd be nice and obvious. -2. Put a bunch of test scripts in there. If they're node programs, then - they should be ".js". Anything else is assumed to be some kind of shell - script, which should have a shebang line. -3. `npm install tap` -4. Update package.json scripts.test to include `tap ./test` [example - gist](https://gist.github.com/4469613) -5. `npm test` - -The output will be TAP-compliant. - -For extra special bonus points, you can do something like this: - - var test = require("tap").test - test("make sure the thingie is a thing", function (t) { - t.equal(thingie, "thing", "thingie should be thing") - t.deepEqual(array, ["foo", "bar"], "array has foo and bar elements") - t.strictDeepEqual(object, {foo: 42, bar: "thingie"}, "object has foo (Number) and bar (String) property") - t.type(thingie, "string", "type of thingie is string") - t.ok(true, "this is always true") - t.notOk(false, "this is never true") - t.test("a child test", function (t) { - t.equal(this, superEasy, "right!?") - t.similar(7, 2, "ever notice 7 is kinda like 2?", {todo: true}) - t.test("so skippable", {skip: true}, function (t) { - t.plan(1) // only one test in this block - t.ok(true, "but when the flag changes, it'll pass") - // no need to end, since we had a plan. - }) - t.end() - }) - t.ok(99, "can also skip individual assertions", {skip: true}) - // end lets it know it's over. - t.end() - }) - test("another one", function (t) { - t.plan(1) - t.ok(true, "It's ok to plan, and also end. Watch.") - t.end() // but it must match the plan! - }) - -Node-tap is actually a collection of several modules, any of which may be -mixed and matched however you please. - -If you don't like this test framework, and think you can do much much -better, *I strongly encourage you to do so!* If you use this library, -however, at least to output TAP-compliant results when `process.env.TAP` -is set, then the data coming out of your framework will be much more -consumable by machines. - -You can also use this to build programs that *consume* the TAP data, so -this is very useful for CI systems and such. - -* tap-assert: A collection of assert functions that return TAP result - objects. -* tap-consumer: A stream interface for consuming TAP data. -* tap-producer: A class that produces a TAP stream by taking in result - objects. -* tap-results: A class for keeping track of TAP result objects as they - pass by, counting up skips, passes, fails, and so on. -* tap-runner: A program that runs through a directory running all the - tests in it. (Tests which may or may not be TAP-outputting tests. But - it's better if they are.) -* tap-test: A class for actually running tests. -* tap-harness: A class that runs tests. (Tests are also Harnesses, - which is how sub-tests run.) -* tap-global-harness: A default harness that provides the top-level - support for running TAP tests. - -## Experimental Code Coverage with runforcover & bunker: - -``` -TAP_COV=1 tap ./test [--cover=./lib,foo.js] [--coverage-dir=./coverage] -``` - -This feature is experimental, and will most likely change somewhat -before being finalized. Feedback welcome. diff --git a/node_modules/tap/bin/tap-http.js b/node_modules/tap/bin/tap-http.js deleted file mode 100644 index 296910f9..00000000 --- a/node_modules/tap/bin/tap-http.js +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env node - -// just an example, really -// Run with `node tap-http.js path/to/tests/` - -var argv = process.argv.slice(2) - , path = require("path") - , Runner = require("../lib/tap-runner") - - , http = require("http") - , server = http.createServer(function (req, res) { - // it'd be nice to return a non-200 if the tests fail, but we don't - // know the status until it's done, so that would mean not being able - // to pipe the output - res.writeHead(200, {'content-type': 'text/plain'}) - new Runner(argv, null).pipe(res) - }) - -server.listen(1337) diff --git a/node_modules/tap/bin/tap-reader.js b/node_modules/tap/bin/tap-reader.js deleted file mode 100755 index b196cc2a..00000000 --- a/node_modules/tap/bin/tap-reader.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env node - -// read a tap stream from stdin. - -var TapConsumer = require("../lib/tap-consumer") - , TapProducer = require("../lib/tap-producer") - -var tc = new TapConsumer - , tp = new TapProducer - -//process.stdin.pipe(tc) -process.stdin.on("data", function (c) { - c = c + "" - // console.error(JSON.stringify(c).substr(0, 100)) - tc.write(c) -}) -process.stdin.on("end", function () { tc.end() }) -process.stdin.resume() -//tc.pipe(tp) -tc.on("data", function (c) { - tp.write(c) -}) -tc.on("end", function () { tp.end() }) - -tp.on("data", function (c) { - console.error(["output write", c]) - process.stdout.write(c) -}) - -tp.on("end", function (er, total, ok) { - if (er) throw er - process.exit(total - ok) -}) diff --git a/node_modules/tap/bin/tap.js b/node_modules/tap/bin/tap.js deleted file mode 100755 index c666040e..00000000 --- a/node_modules/tap/bin/tap.js +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env node - -var argv = process.argv.slice(2) - , path = require("path") - , Runner = require("../lib/tap-runner") - - , nopt = require("nopt") - - , knownOpts = - { cover: [path, false] - , "cover-dir": path - , stderr: Boolean - , stdout: Boolean - , diag: Boolean - , version: Boolean - , tap: Boolean - , timeout: Number - , gc: Boolean - , debug: Boolean - , "debug-brk": Boolean - , strict: Boolean - , harmony: Boolean - } - - , shorthands = - // debugging 1: show stderr - { d: ["--stderr"] - // debugging 2: show stderr and tap - , dd: ["--stderr", "--tap"] - // debugging 3: show stderr, tap, AND always show diagnostics. - , ddd: ["--stderr", "--tap", "--diag"] - , "expose-gc": ["--gc"] - , g: ["--gc"] - , e: ["--stderr"] - , t: ["--timeout"] - , o: ["--tap"] - , c: ["--cover"] - , v: ["--version"] - , "?": ["--help"] - , h: ["--help"] - } - - , defaults = - { cover: "./lib" - , "cover-dir": "./coverage" - , stderr: process.env.TAP_STDERR !== '0' - , tap: process.env.TAP - , diag: process.env.TAP_DIAG - , timeout: +process.env.TAP_TIMEOUT || 30 - , gc: false - , debug: false - , "debug-brk": false - , strict: false - , harmony: false - , version: false - , help: false } - - , options = nopt(knownOpts, shorthands) - -if (options.version) { - console.log(require("../package.json").version) - process.exit(0) -} - -if (options.help) { - console.log(function(){/* - -Usage: - tap - - Run the files as tap tests, parse the output, and report the results - -Options: - - --stderr Print standard error output of tests to standard error. - --tap Print raw tap output. - --diag Print diagnostic output for passed tests, as well as failed. - (Implies --tap) - --gc Expose the garbage collector to tests. - --timeout Maximum time to wait for a subtest, in seconds. Default: 30 - --debug Pass the '--debug' flag to node for debugging - --debug-brk Pass the '--debug-brk' flag to node for debugging - --strict Enforce strict mode when running tests. - --harmony Enable harmony features for tests. - --version Print the version of node tap. - --help Print this help. - -Please report bugs! https://github.com/isaacs/node-tap/issues - -*/}.toString().split(/\n/).slice(1, -1).join("\n")) - process.exit(0) -} - - -Object.keys(defaults).forEach(function (k) { - if (!options.hasOwnProperty(k)) options[k] = defaults[k] -}) - -// other tests that might rely on these -if (options.diag) process.env.TAP_DIAG = true -if (options.tap) process.env.TAP = true -if (options.timeout) process.env.TAP_TIMEOUT = options.timeout - -var r = new Runner(options) - , TapProducer = require("../lib/tap-producer") - -if (options.tap || options.diag) { - r.pipe(process.stdout) -} else { - r.on("file", function (file, results, details) { - var s = (details.ok ? "" : "not ") + "ok "+results.name - , n = details.pass + "/" + details.testsTotal - , dots = new Array(Math.max(1, 60 - s.length - n.length)).join(".") - console.log("%s %s %s", s, dots, n) - if (details.ok) { - if (details.skip) { - console.log(" skipped: %s", details.skip) - } - if (details.todo) { - console.log(" todo: %s", details.todo) - } - } else { - // console.error(details) - console.log(" Command: %s", results.command) - console.log(" " + TapProducer.encode(details.list) - .split(/\n/).join("\n ")) - } - }) - r.on("end", function () { - //console.log(r) - var s = "total" - , n = r.results.pass + "/" + r.results.testsTotal - , dots = new Array(60 - s.length - n.length).join(".") - , ok = r.results.ok ? "ok" : "not ok" - console.log("%s %s %s\n\n%s", s, dots, n, ok) - if (r.doCoverage) { - console.error( "\nCoverage: %s\n" - , path.resolve(r.coverageOutDir, "index.html") ) - } - }) -} - - - -r.on("end", function () { - process.exit(r.results.ok ? 0 : 1) -}) diff --git a/node_modules/tap/coverage-example/lib/bar.js b/node_modules/tap/coverage-example/lib/bar.js deleted file mode 100644 index e7cb7add..00000000 --- a/node_modules/tap/coverage-example/lib/bar.js +++ /dev/null @@ -1,15 +0,0 @@ -var Bar = module.exports = function(str) { - this.bar = str; - this.str = str; -}; - -Bar.prototype.foo = function() { - var self = this; - return self.bar; -}; - -Bar.prototype.baz = function() { - var self = this; - return self.str; -}; - diff --git a/node_modules/tap/coverage-example/lib/foo.js b/node_modules/tap/coverage-example/lib/foo.js deleted file mode 100644 index cb9ee8f3..00000000 --- a/node_modules/tap/coverage-example/lib/foo.js +++ /dev/null @@ -1,15 +0,0 @@ -var Foo = module.exports = function(str) { - this.foo = str; - this.str = str; -}; - -Foo.prototype.bar = function() { - var self = this; - return self.foo; -}; - -Foo.prototype.baz = function() { - var self = this; - return self.str; -}; - diff --git a/node_modules/tap/coverage-example/test/bar.test.js b/node_modules/tap/coverage-example/test/bar.test.js deleted file mode 100644 index 91e4bc21..00000000 --- a/node_modules/tap/coverage-example/test/bar.test.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tap').test, - Bar = require('../lib/bar'), - bar; - -test('setup', function(t) { - bar = new Bar('baz'); - t.ok(bar); - t.end(); -}); - -test('bar', function(t) { - t.equal('baz', bar.foo()); - t.end(); -}); - -test('teardown', function(t) { - t.ok(true); - t.end(); -}); - diff --git a/node_modules/tap/coverage-example/test/baz.test.js b/node_modules/tap/coverage-example/test/baz.test.js deleted file mode 100644 index fae22d86..00000000 --- a/node_modules/tap/coverage-example/test/baz.test.js +++ /dev/null @@ -1,29 +0,0 @@ -var test = require('tap').test, - Foo = require('../lib/foo'), - Bar = require('../lib/bar'), - foo, bar; - -test('setup', function(t) { - foo = new Foo('baz'); - t.ok(foo); - bar = new Bar('baz'); - t.ok(bar); - t.end(); -}); - -test('baz from Foo', function(t) { - t.equal('baz', foo.baz()); - t.end(); -}); - -test('baz from Bar', function(t) { - t.equal('baz', bar.baz()); - t.end(); -}); - - -test('teardown', function(t) { - t.ok(true); - t.end(); -}); - diff --git a/node_modules/tap/coverage-example/test/foo.test.js b/node_modules/tap/coverage-example/test/foo.test.js deleted file mode 100644 index 2aed8fda..00000000 --- a/node_modules/tap/coverage-example/test/foo.test.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tap').test, - Foo = require('../lib/foo'), - foo; - -test('setup', function(t) { - foo = new Foo('baz'); - t.ok(foo); - t.end(); -}); - -test('bar', function(t) { - t.equal('baz', foo.bar()); - t.end(); -}); - -test('teardown', function(t) { - t.ok(true); - t.end(); -}); - diff --git a/node_modules/tap/example/lib/math.js b/node_modules/tap/example/lib/math.js deleted file mode 100644 index f7986260..00000000 --- a/node_modules/tap/example/lib/math.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = Math diff --git a/node_modules/tap/example/test/test-example.js b/node_modules/tap/example/test/test-example.js deleted file mode 100644 index cd2549b2..00000000 --- a/node_modules/tap/example/test/test-example.js +++ /dev/null @@ -1,237 +0,0 @@ -var tap = require("tap") - , test = tap.test - , plan = tap.plan - , math - -test("load sut", function (t) { - math = require("../lib/math") - t.ok(math, "object loaded") - t.end() -}) - -test("validate constants", function (t) { - t.equal(math.LN10, 2.302585092994046, "ln 10") - t.equal(math.PI, 3.141592653589793, "pi") - t.equal(math.E, 2.718281828459045, "e") - t.equal(math.LOG10E, 0.4342944819032518, "log 10 e") - t.equal(math.SQRT2, 1.4142135623730951, "sqrt 2") - t.equal(math.SQRT1_2, 0.7071067811865476, "sqrt 1/2") - t.equal(math.LN2, 0.6931471805599453, "ln2") - t.end() -}) - -test("using this", function (t) { - // this also works. - this.equal(t, this, "call in scope of test obj") - this.end() -}) - -// test setTimeout, just a trivial example. -test("setTimeout", function (t) { - var start = Date.now() - setTimeout(function () { - t.ok(Date.now() >= start + 50, "timeout fired after delay") - t.end() - }, 50) -}) - -// another way to do the same, using a plan. -// this is more robust, but annoying when you have a long list -// of tests for something. For async stuff, it's generally better, -// since there's a higher risk of the control flowing off to lala land. -test("setTimeout planned", function (t) { - t.plan(1) - var start = Date.now() - setTimeout(function () { - t.ok(Date.now() >= start + 50, "timeout fired after delay") - }, 50) -}) - -// plans also are good for cases where things may fire in a non-deterministic -// order, since it won't be as obvious when everything is done. -test("setTimeout parallel", function (t) { - t.plan(2) - var start = Date.now() - setTimeout(function A () { - t.ok(Date.now() >= start + 50, "timeout A fired after delay") - }, 50) - setTimeout(function B () { - t.ok(Date.now() >= start + 50, "timeout B fired after delay") - }, 50) -}) - -// something slightly less hello worldy -test("async test", function (t) { - t.plan(4) - var fs = require("fs") - t.ok(fs, "fs library should load") - var rs = fs.createReadStream(__filename) - t.ok(rs, "read stream should start fine.") - rs.on("open", function (fd) { - t.type(fd, "number", "file descriptor should be a number") - t.equal(fd, rs.fd, "fd should match stream fd") - }) -}) - -// you can bail out of the entire everything if something is just -// Not Right (db not installed, etc.) -test("tarp", function (parent) { - if (7 === 5) { - parent.bailout("math is broken") - } - // bailout bubbles up a bit like "error" events - // if unhandled, then the parent will bail, as well. - parent.test("child bailouts", function (child) { - child.on("bailout", function (s) { - parent.fail("children shouldn't bail.") - }) - child.bailout("try to bail out, but instead just fail a test") - }) - - parent.test("child bailout 2", function (child) { - child.bailout("this one will bail out") - }) -}) - -// tests marked "todo" can fail without counting against the overall score -// never ever ever write tests to "verify" incorrect behavior! -test("unfinished test", function (t) { - t.equal(math.cos(math.PI), -1, "cos(PI)") - t.equal(math.sin(math.PI), 0, "sin(PI)") - t.equal(math.face, "your face", "math.face should be your face # TODO") - t.end() -}) - -// tests can have children. -test("http server", function (t) { - // one test plus 4 children. - t.plan(5) - - var http = require("http") - , PORT = 12346 - - t.ok(http, "http module should load") - var server - - t.test("set up server", function (t) { - t.plan(2) - server = http.createServer(function (req, res) { - t.comment("Request: "+req.url) - res.writeHead(200, {}) - res.end(req.method + " " + req.url) - }) - t.ok(server, "createServer should create a server") - server.listen(PORT, t.cb("listen should fire callback")) - }) - - // set the "parallel" flag on this one. - // That signals the harness to proceed immediately to the next test, - // and run them in parallel. - // Default behavior is to wait for each test to complete before proceeding - // to the next one. - // The first not-parallel test encountered will cause it to wait for that - // test, as well as all the parallel tests before it. - // A, B', C', D', E (where ' means "parallel") - // Runs A, and then B, C, and D in parallel, and then E. - t.test("testing POST", {parallel: true}, function (t) { - t.plan(1) - http.request("POST", { method: "POST" - , host: "localhost" - , path: "/foo" - , port: PORT }).on("response", function (res) { - t.bufferStream(res, function (s) { t.equal(s, "POST /foo") }) - }).end() - }) - - t.test("testing GET", {parallel: true}, function (t) { - t.plan(1) - http.request("POST", { method: "GET" - , host: "localhost" - , path: "/foo" - , port: PORT }).on("response", function (res) { - t.bufferStream(res, function (s) { t.equal(s, "GET /foo") }) - }).end() - }) - - // wrap in a test so that if this throws, it'll log as a failed test. - t.test("teardown", function (t) { - server.close() - t.end() - }) -}) - -// yo dawg! -test("meta-tests", function (t) { - t.plan(5) - - // t.fails() wraps a child test and succeeds if it fails. - t.fails(t.test("this should fail", function (t) { - t.ok(false, "assert false") - t.end() - })) - - // t.timesOut() wraps a child test and succeeds if it times out. - // if t.end() is called, or if a plan is completed, then it fails. - // set the timeout really low so that it will not take forever. - t.timesOut(t.test("this should timeout", { timeout: 1 }, function (t) { - t.ok(true, "assert true") - // t.end() never called. - })) - - // t.incomplete() wraps a child test and succeeds if it ends before - // the plan is finished. - t.incomplete(t.test("this should be incomplete", function (t) { - t.plan(100) - t.ok(true, "assert true") - // calling end prematurely. - t.end() - })) - - // t.bailsOut() wraps a child test and succeeds if it calls bailout() - t.bailsOut(t.test("this should bailout", function (t) { - t.bailout("oh noes, bailing out!") - })) - - // low-level analysis of subtests - t.test("verifying test success/failure expectations", function (t) { - t.once("end", function () { - var res = t.results - , is = t.equal - // hijack! - t.clear() - is(res.ok, false, "ok") - - is(res.bailedOut, false, "bailed out") - - is(res.skip, 2, "skips") - is(res.skipPass, 1, "skip that passed") - is(res.skipFail, 1, "skip that failed") - - is(res.todo, 2, "todos") - is(res.todoPass, 1, "todo that passed") - is(res.todoFail, 1, "todo that failed") - - is(res.failTotal, 3, "failures total") - is(res.fail, 1, "relevant failure") - - is(res.passTotal, 3, "passes total") - is(res.pass, 1, "relevant pass") - - is(res.testsTotal, 6, "total tests") - is(res.tests, 2, "should be 2 relevant tests") - - t.end() - }) - - // run the metatest. - // *this* is the actual SUT in this case. - t.ok(false, "failing todo #todo") - // can also set #todo or #skip explicitly - t.ok(true, "succeeding todo", {todo: true}) - t.ok(false, "failing skip #skip", {skip: true}) - t.ok(true, "suceeding skip #skip") - t.ok(false, "failing test") - t.ok(true, "succeeding test") - t.end() - }) -}) diff --git a/node_modules/tap/lib/main.js b/node_modules/tap/lib/main.js deleted file mode 100644 index a9a520ab..00000000 --- a/node_modules/tap/lib/main.js +++ /dev/null @@ -1,16 +0,0 @@ - -var GlobalHarness = require("./tap-global-harness") - -// this lets you do stuff like: -// var test = require("tap").test -// test(...) -// to run stuff in the global harness. -exports = module.exports = new GlobalHarness() - -exports.createProducer = exports.Producer = require("./tap-producer") -exports.createConsumer = exports.Consumer = require("./tap-consumer") -exports.yamlish = require("yamlish") -exports.createTest = exports.Test = require("./tap-test") -exports.createHarness = exports.Harness = require("./tap-harness") -exports.createRunner = exports.Runner = require("./tap-runner") -exports.assert = require("./tap-assert") diff --git a/node_modules/tap/lib/tap-assert.js b/node_modules/tap/lib/tap-assert.js deleted file mode 100644 index 98389616..00000000 --- a/node_modules/tap/lib/tap-assert.js +++ /dev/null @@ -1,466 +0,0 @@ -// an assert module that returns tappable data for each assertion. -var difflet = require('difflet') - , deepEqual = require('deep-equal') - , bufferEqual = require('buffer-equal') - , Buffer = require('buffer').Buffer - -module.exports = assert - -var syns = {} - , id = 1 - -function assert (ok, message, extra) { - if (extra && extra.skip) return assert.skip(message, extra) - - //console.error("assert %j", [ok, message, extra]) - //if (extra && extra.skip) return assert.skip(message, extra) - //console.error("assert", [ok, message, extra]) - ok = !!ok - var res = { id : id ++, ok: ok } - - var caller = getCaller(extra && extra.error) - if (extra && extra.error) { - res.type = extra.error.name - res.message = extra.error.message - res.code = extra.error.code - || extra.error.type - res.errno = extra.error.errno - delete extra.error - } - if (caller.file) { - res.file = caller.file - res.line = +caller.line - res.column = +caller.column - } - res.stack = caller.stack - - res.name = message || "(unnamed assert)" - - if (extra) Object.keys(extra).forEach(function (k) { - if (!res.hasOwnProperty(k)) res[k] = extra[k] - }) - - // strings and objects are hard to diff by eye - if (!ok && - res.hasOwnProperty("found") && - res.hasOwnProperty("wanted") && - res.found !== res.wanted) { - if (typeof res.wanted !== typeof res.found || - typeof res.wanted === "object" && (!res.found || !res.wanted)) { - res.type = { found: typeof found - , wanted: typeof wanted } - } else if (typeof res.wanted === "string") { - res.diff = diffString(res.found, res.wanted) - } else if (typeof res.wanted === "object") { - res.diff = diffObject(res.found, res.wanted) - } - } - - //console.error("assert return", res) - - return res -} -assert.ok = assert -syns.ok = [ "true", "assert" ] - - -function notOk (ok, message, extra) { - return assert(!ok, message, extra) -} -assert.notOk = notOk -syns.notOk = [ "false", "notok" ] - -function error (er, message, extra) { - if (!er) { - // just like notOk(er) - return assert(!er, message, extra) - } - message = message || er.message - extra = extra || {} - extra.error = er - return assert.fail(message, extra) -} -assert.error = error -syns.error = [ "ifError", "ifErr", "iferror" ] - - -function pass (message, extra) { - return assert(true, message, extra) -} -assert.pass = pass - -function fail (message, extra) { - //console.error("assert.fail", [message, extra]) - //if (extra && extra.skip) return assert.skip(message, extra) - return assert(false, message, extra) -} -assert.fail = fail - -function skip (message, extra) { - //console.error("assert.skip", message, extra) - if (!extra) extra = {} - return { id: id ++, skip: true, name: message || "", - explanation: extra.explanation || "" } -} -assert.skip = skip - -function throws (fn, wanted, message, extra) { - if (typeof wanted === "string") { - extra = message - message = wanted - wanted = null - } - - if (extra && extra.skip) return assert.skip(message, extra) - - var found = null - try { - fn() - } catch (e) { - found = { name: e.name, message: e.message } - } - - extra = extra || {} - - extra.found = found - if (wanted) { - wanted = { name: wanted.name, message: wanted.message } - extra.wanted = wanted - } - - if (!message) { - message = "Expected to throw" - if (wanted) message += ": "+wanted.name + " " + wanted.message - } - - return (wanted) ? assert.similar(found, wanted, message, extra) - : assert.ok(found, message, extra) -} -assert.throws = throws - - -function doesNotThrow (fn, message, extra) { - if (extra && extra.skip) return assert.skip(message, extra) - var found = null - try { - fn() - } catch (e) { - found = {name: e.name, message: e.message} - } - message = message || "Should not throw" - - return assert.equal(found, null, message, extra) -} -assert.doesNotThrow = doesNotThrow - - -function equal (a, b, message, extra) { - if (extra && extra.skip) return assert.skip(message, extra) - extra = extra || {} - message = message || "should be equal" - extra.found = a - extra.wanted = b - return assert(a === b, message, extra) -} -assert.equal = equal -syns.equal = ["equals" - ,"isEqual" - ,"is" - ,"strictEqual" - ,"strictEquals"] - - -function equivalent (a, b, message, extra) { - if (extra && extra.skip) return assert.skip(message, extra) - var extra = extra || {} - message = message || "should be equivalent" - extra.found = a - extra.wanted = b - - if (Buffer.isBuffer(a) && Buffer.isBuffer(b)) { - return assert(bufferEqual(a, b), message, extra) - } else { - return assert(deepEqual(a, b), message, extra) - } -} -assert.equivalent = equivalent -syns.equivalent = ["isEquivalent" - ,"looseEqual" - ,"looseEquals" - ,"isDeeply" - ,"same" - ,"deepEqual" - ,"deepEquals"] - -function strictDeepEqual (a, b, message, extra) { - if (extra && extra.skip) return assert.skip(message, extra) - var extra = extra || {} - message = message || "should be strictly equal" - extra.found = a - extra.wanted = b - - if (Buffer.isBuffer(a) && Buffer.isBuffer(b)) { - return assert(bufferEqual(a, b), message, extra) - } else { - return assert(deepEqual(a, b, {strict: true}), message, extra) - } -} -assert.strictDeepEqual = strictDeepEqual -syns.strictDeepEqual = ["isStrictEquivalent" - ,"isStrictly" - ,"exactSame" - ,"strictDeepEqual" - ,"strictDeepEquals"] - - -function inequal (a, b, message, extra) { - if (extra && extra.skip) return assert.skip(message, extra) - extra = extra || {} - message = message || "should not be equal" - extra.found = a - extra.doNotWant = b - return assert(a !== b, message, extra) -} -assert.inequal = inequal -syns.inequal = ["notEqual" - ,"notEquals" - ,"notStrictEqual" - ,"notStrictEquals" - ,"isNotEqual" - ,"isNot" - ,"not" - ,"doesNotEqual" - ,"isInequal"] - - -function inequivalent (a, b, message, extra) { - if (extra && extra.skip) return assert.skip(message, extra) - extra = extra || {} - message = message || "should not be equivalent" - extra.found = a - extra.doNotWant = b - - if (Buffer.isBuffer(a) && Buffer.isBuffer(b)) { - return assert(!bufferEqual(a, b), message, extra) - } else { - return assert(!deepEqual(a, b), message, extra) - } -} -assert.inequivalent = inequivalent -syns.inequivalent = ["notEquivalent" - ,"notDeepEqual" - ,"notDeeply" - ,"notSame" - ,"isNotDeepEqual" - ,"isNotDeeply" - ,"isNotEquivalent" - ,"isInequivalent"] - -function similar (a, b, message, extra, flip) { - if (extra && extra.skip) return assert.skip(message, extra) - // test that a has all the fields in b - message = message || "should be similar" - - if (typeof a === "string" && - (Object.prototype.toString.call(b) === "[object RegExp]")) { - extra = extra || {} - extra.pattern = b - extra.string = a - var ok = a.match(b) - extra.match = ok - if (flip) ok = !ok - return assert.ok(ok, message, extra) - } - - var isObj = assert(a && typeof a === "object", message, extra) - if (!isObj.ok) { - // not an object - if (a == b) isObj.ok = true - if (flip) isObj.ok = !isObj.ok - return isObj - } - - var eq = flip ? inequivalent : equivalent - return eq(selectFields(a, b), b, message, extra) -} -assert.similar = similar -syns.similar = ["isSimilar" - ,"has" - ,"hasFields" - ,"like" - ,"isLike"] - -function dissimilar (a, b, message, extra) { - if (extra && extra.skip) return assert.skip(message, extra) - message = message || "should be dissimilar" - return similar(a, b, message, extra, true) -} -assert.dissimilar = dissimilar -syns.dissimilar = ["unsimilar" - ,"notSimilar" - ,"unlike" - ,"isUnlike" - ,"notLike" - ,"isNotLike" - ,"doesNotHave" - ,"isNotSimilar" - ,"isDissimilar"] - -function type (thing, t, message, extra) { - if (extra && extra.skip) return assert.skip(message, extra) - var name = t - if (typeof name === "function") name = name.name || "(anonymous ctor)" - //console.error("name=%s", name) - message = message || "type is "+name - var type = typeof thing - //console.error("type=%s", type) - if (!thing && type === "object") type = "null" - if (type === "object" && t !== "object") { - if (typeof t === "function") { - //console.error("it is a function!") - extra = extra || {} - extra.found = Object.getPrototypeOf(thing).constructor.name - extra.wanted = name - //console.error(thing instanceof t, name) - return assert.ok(thing instanceof t, message, extra) - } - - //console.error("check prototype chain") - // check against classnames or objects in prototype chain, as well. - // type(new Error("asdf"), "Error") - // type(Object.create(foo), foo) - var p = thing - while (p = Object.getPrototypeOf(p)) { - if (p === t || p.constructor && p.constructor.name === t) { - type = name - break - } - } - } - //console.error(type, name, type === name) - return assert.equal(type, name, message, extra) -} -assert.type = type -syns.type = ["isa"] - -// synonyms are helpful. -Object.keys(syns).forEach(function (c) { - syns[c].forEach(function (s) { - Object.defineProperty(assert, s, { value: assert[c], enumerable: false }) - }) -}) - -// helpers below - -function selectFields (a, b) { - // get the values in A of the fields in B - var ret = Array.isArray(b) ? [] : {} - Object.keys(b).forEach(function (k) { - if (!a.hasOwnProperty(k)) return - var v = b[k] - , av = a[k] - if (v && av && typeof v === "object" && typeof av === "object" - && !(v instanceof Date) - && !(v instanceof RegExp) - && !(v instanceof String) - && !(v instanceof Boolean) - && !(v instanceof Number) - && !(Array.isArray(v))) { - ret[k] = selectFields(av, v) - } else ret[k] = av - }) - return ret -} - -function sortObject (obj) { - if (typeof obj !== 'object' || Array.isArray(obj) || obj === null) { - return obj - } - - return Object.keys(obj).sort().reduce(function (acc, key) { - acc[key] = sortObject(obj[key]) - return acc - }, {}) -} - -function stringify (a) { - return JSON.stringify(sortObject(a), (function () { - var seen = [] - , keys = [] - return function (key, val) { - var s = seen.indexOf(val) - if (s !== -1) { - return "[Circular: "+keys[s]+"]" - } - if (val && typeof val === "object" || typeof val === "function") { - seen.push(val) - keys.push(val["!"] || val.name || key || "") - if (typeof val === "function") { - return val.toString().split(/\n/)[0] - } else if (typeof val.toUTCString === "function") { - return val.toUTCString() - } - } - return val - }})()) -} - -function diffString (f, w) { - if (w === f) return null - var p = 0 - , l = w.length - while (p < l && w.charAt(p) === f.charAt(p)) p ++ - w = stringify(w).substr(1).replace(/"$/, "") - f = stringify(f).substr(1).replace(/"$/, "") - return diff(f, w, p) -} - -function diffObject (f, w) { - return difflet({ indent : 2, comment : true }).compare(w, f) -} - -function diff (f, w, p) { - if (w === f) return null - var i = p || 0 // it's going to be at least p. JSON can only be bigger. - , l = w.length - while (i < l && w.charAt(i) === f.charAt(i)) i ++ - var pos = Math.max(0, i - 20) - w = w.substr(pos, 40) - f = f.substr(pos, 40) - var pointer = i - pos - return "FOUND: "+f+"\n" - + "WANTED: "+w+"\n" - + (new Array(pointer + 9).join(" ")) - + "^ (at position = "+p+")" -} - -function getCaller (er) { - // get the first file/line that isn't this file. - if (!er) er = new Error - var stack = er.stack || "" - stack = stack.split(/\n/) - for (var i = 1, l = stack.length; i < l; i ++) { - var s = stack[i].match(/\(([^):]+):([0-9]+):([0-9]+)\)$/) - if (!s) continue - var file = s[1] - , line = +s[2] - , col = +s[3] - if (file.indexOf(__dirname) === 0) continue - if (file.match(/tap-test\/test.js$/)) continue - else break - } - var res = {} - if (file && file !== __filename && !file.match(/tap-test\/test.js$/)) { - res.file = file - res.line = line - res.column = col - } - - res.stack = stack.slice(1).map(function (s) { - return s.replace(/^\s*at\s*/, "") - }) - - return res -} - - diff --git a/node_modules/tap/lib/tap-browser-harness.js b/node_modules/tap/lib/tap-browser-harness.js deleted file mode 100644 index 9eaa0e42..00000000 --- a/node_modules/tap/lib/tap-browser-harness.js +++ /dev/null @@ -1,63 +0,0 @@ -// this is just a harness that pipes to stdout. -// It's the default one. -module.exports = BrowserHarness - -var BrowserHarness = global.TAP_Browser_Harness - , inherits = require("inherits") - , Results = require("./tap-results") - , Harness = require("./tap-harness") - , Test = require("./tap-test") - -inherits(BrowserHarness, Harness) -function BrowserHarness (outPipe) { - //console.error("calling BrowserHarness") - if (browserHarness) return browserHarness - if (!(this instanceof BrowserHarness)) { - return browserHarness = new BrowserHarness - } - browserHarness = global.TAP_Browser_Harness = this - Harness.call(this, Test) - - if (outPipe) this.output.pipe(outPipe) - - this.test = this.test.bind(this) - - this.plan = this.plan.bind(this) - - var output = this.output - this.on("childEnd", function (child) { - //console.error("childEnd in global harness") - //console.error(child.results) - // write out the stuff for this child. - //console.error("child.conf", child.conf) - - // maybe write some other stuff about the number of tests in this - // thing, etc. I dunno. - //console.error("child results", child.results) - this.results.list.forEach(function (res) { - //delete res.error - //console.error("child resuilt", res) - output.write(res) - }) - //console.error("wrote child results") - this.results.list.length = 0 - }) - - var streamEnded = false - this.on("end", function () { - //console.error("global ending the stream") - if (!streamEnded) { - this.results.list.forEach(function (res) { - output.write(res) - }) - this.results.list.length = 0 - output.end() - streamEnded = true - } - }) - - // TODO: handle global errors - // process.on("unhandledException", function (e) { - // this.bailout("unhandled exception: " + e.message) - // }) -} diff --git a/node_modules/tap/lib/tap-consumer.js b/node_modules/tap/lib/tap-consumer.js deleted file mode 100644 index 0b991a56..00000000 --- a/node_modules/tap/lib/tap-consumer.js +++ /dev/null @@ -1,246 +0,0 @@ -module.exports = TapConsumer - -// pipe a stream into this that's emitting tap-formatted data, -// and it'll emit "data" events with test objects or comment strings -// and an "end" event with the final results. - -var yamlish = require("yamlish") - , Results = require("./tap-results") - , inherits = require("inherits") - -TapConsumer.decode = TapConsumer.parse = function (str) { - var tc = new TapConsumer - , list = [] - tc.on("data", function (res) { - list.push(res) - }) - tc.end(str) - tc.results.list = list - return tc.results -} - -var Stream = require("stream").Stream -inherits(TapConsumer, Stream) -function TapConsumer () { - if (!(this instanceof TapConsumer)) { - return new TapConsumer - } - - Stream.call(this) - this.results = new Results - this.readable = this.writable = true - - this.on("data", function (res) { - if (typeof res === "object") this.results.add(res) - }) - - this._plan = null - this._buffer = "" - this._indent = [] - this._current = null - this._actualCount = 0 - this._passed = [] - this._failed = [] - //console.error("TapConsumer ctor done") -} - -TapConsumer.prototype.bailedOut = false - -TapConsumer.prototype.write = function (chunk) { - if (!this.writable) this.emit("error", new Error("not writable")) - if (this.bailedOut) return true - - this._buffer = this._buffer + chunk - // split it up into lines. - var lines = this._buffer.split(/\r?\n/) - // ignore the last line, since it might be incomplete. - this._buffer = lines.pop() - - for (var i = 0, l = lines.length; i < l; i ++) { - //console.error([i, lines[i]]) - // see if it's indented. - var line = lines[i] - , spaces = (this._indent.length && !line.trim()) - || line.match(/^\s/) - // at this level, only interested in fully undented stuff. - if (spaces) { - var c = i - while (c < l && (!lines[c].trim() || lines[c].match(/^\s/))) { - this._indent.push(lines[c++]) - } - //console.error(c-i, "indented", this._indent, this._current) - i = c - 1 - continue - } - // some kind of line. summary, ok, notok, comment, or garbage. - // this also finishes parsing any of the indented lines from before - this._parseLine(line) - } - return true -} - -TapConsumer.prototype.end = function () { - // finish up any hanging indented sections or final buffer - if (this._buffer.match(/^\s/)) this._indent.push(this.buffer) - else this._parseLine(this._buffer) - - if (!this.bailedOut && - this._plan !== null && - this.results.testsTotal !== this._plan) { - while (this._actualCount < this._plan) { - this.emit("data", {ok: false, name:"MISSING TEST", - id:this._actualCount ++ }) - } - } - - this._parseLine("") - this._buffer = "" - this.writable = false - this.emit("end", null, this._actualCount, this._passed) -} - -TapConsumer.prototype._parseLine = function (line) { - if (this.bailedOut) return - //console.error("_parseLine", [line]) - // if there are any indented lines, and there is a - // current object already, then they belong to it. - // if there is not a current object, then they're garbage. - if (this._current && this._indent.length) { - this._parseIndented() - } - this._indent.length = 0 - if (this._current) { - if (this._current.ok) this._passed.push(this._current.id) - else this._failed.push(this._current.id) - this.emit("data", this._current) - } - this._current = null - line = line.trim() - if (!line) return - // try to see what kind of line this is. - - var bo - if (bo = line.match(/^bail out!\s*(.*)$/i)) { - this.bailedOut = true - // this.emit("error", new Error(line)) - this.emit("bailout", bo[1]) - return - } - - if (line.match(/^#/)) { // just a comment - line = line.replace(/^#+/, "").trim() - // console.error("outputting comment", [line]) - if (line) this.emit("data", line) - return - } - - var plan = line.match(/^([0-9]+)\.\.([0-9]+)(?:\s+#(.*))?$/) - if (plan) { - var start = +(plan[1]) - , end = +(plan[2]) - , comment = plan[3] - - // TODO: maybe do something else with this? - // it might be something like: "1..0 #Skip because of reasons" - this._plan = end - this.emit("plan", end, comment) - // plan must come before or after all tests. - if (this._actualCount !== 0) { - this._sawPlan = true - } - return - } - - if (line.match(/^(not )?ok(?:\s+([0-9]+))?/)) { - this._parseResultLine(line) - return - } - - // garbage. emit as a comment. - //console.error("emitting", [line.trim()]) - if (line.trim()) this.emit("data", line.trim()) -} - -TapConsumer.prototype._parseDirective = function (line) { - line = line.trim() - if (line.match(/^TODO\b/i)) { - return { todo:true, explanation: line.replace(/^TODO\s*/i, "") } - } else if (line.match(/^SKIP\b/i)) { - return { skip:true, explanation: line.replace(/^SKIP\s*/i, "") } - } -} - -TapConsumer.prototype._parseResultLine = function (line) { - this._actualCount ++ - if (this._sawPlan) { - this.emit("data", {ok: false, name:"plan in the middle of tests" - ,id:this._actualCount ++}) - } - var parsed = line.match(/^(not )?ok(?: ([0-9]+))?(?:(?: - )?(.*))?$/) - , ok = !parsed[1] - , id = +(parsed[2] || this._actualCount) - , rest = parsed[3] || "" - , name - , res = { id:id, ok:ok } - - // split on un-escaped # characters - - //console.log("# "+JSON.stringify([name, rest])) - rest = rest.replace(/([^\\])((?:\\\\)*)#/g, "$1\n$2").split("\n") - name = rest.shift() - rest = rest.filter(function (r) { return r.trim() }).join("#") - //console.log("# "+JSON.stringify([name, rest])) - - // now, let's see if there's a directive in there. - var dir = this._parseDirective(rest.trim()) - if (!dir) name += rest ? "#" + rest : "" - else { - res.ok = true - if (dir.skip) res.skip = true - else if (dir.todo) res.todo = true - if (dir.explanation) res.explanation = dir.explanation - } - res.name = name - - //console.error(line, [ok, id, name]) - this._current = res -} - -TapConsumer.prototype._parseIndented = function () { - // pull yamlish block out - var ind = this._indent - , ys - , ye - , yind - , diag - //console.error(ind, this._indent) - for (var i = 0, l = ind.length; i < l; i ++) { - var line = ind[i] - if (line === undefined) continue - var lt = line.trim() - - if (!ys) { - ys = line.match(/^(\s*)---(.*)$/) - if (ys) { - yind = ys[1] - diag = [ys[2]] - //console.error([line,ys, diag]) - continue - } else if (lt) this.emit("data", lt) - } else if (ys && !ye) { - if (line === yind + "...") ye = true - else { - diag.push(line.substr(yind.length)) - } - } else if (ys && ye && lt) this.emit("data", lt) - } - if (diag) { - //console.error('about to parse', diag) - diag = yamlish.decode(diag.join("\n")) - //console.error('parsed', diag) - Object.keys(diag).forEach(function (k) { - //console.error(this._current, k) - if (!this._current.hasOwnProperty(k)) this._current[k] = diag[k] - }, this) - } -} diff --git a/node_modules/tap/lib/tap-cov-html.js b/node_modules/tap/lib/tap-cov-html.js deleted file mode 100644 index 3c1c1925..00000000 --- a/node_modules/tap/lib/tap-cov-html.js +++ /dev/null @@ -1,78 +0,0 @@ -var fs = require('fs'), - path = require('path'), - asyncMap = require("slide").asyncMap, - util = require('util'); - -var CovHtml = module.exports = function(cov_stats, cov_dir, cb) { - var index = []; - - asyncMap( - Object.keys(cov_stats), - function(f, cb) { - var st = cov_stats[f], - missing_lines = st.missing.map(function(l) { - return l.number; - }), - out = '\n\n\n ' + - '\n ' + - - f + ' (' + st.loc + ')\n' + - '\n' + - '\n\n' + - '

' + f + ' (' + st.loc + ')' + '

' + - '

Run: ' + (st.missing.length ? st.loc - st.missing.length : st.loc) + ', Missing: ' + - st.missing.length + ', Percentage: ' + st.percentage + '

' + - '

Source:

\n' + - '
    \n' + - st.lines.map(function(line) { - var number = line.number, - color = (missing_lines.indexOf(number) !== -1) ? '#fcc' : '#cfc'; - return '
  1. ' + line.source.replace(/'; - }).join('\n') + - '
\n' + - '

Data

\n'+ - '
' + util.inspect(st, true, Infinity, false).replace(/\n';
-
-      fs.writeFile(
-        cov_dir + '/' + 
-        f.replace(process.cwd() + '/', '').replace(/\//g, '+') + '.html',
-        out,
-        'utf8',
-        function(err) {
-          if (err) {
-            throw err;
-          }
-          index.push(f);
-          cb();
-        });
-    },
-    function(err) {
-      if (err) {
-        throw err;
-      }
-      var out = '\n\n\n  ' +
-          '\n  Coverage Index\n\n' +
-          '\n

Code Coverage Information

\n
    ' + - index.map(function(fname) { - return '
  • ' + fname + '
  • '; - }).join('\n') + '
\n\n'; - - fs.writeFile(cov_dir + '/index.html', out, 'utf8', function(err) { - if (err) { - throw err; - } - cb(); - }); - } - ); -}; - - diff --git a/node_modules/tap/lib/tap-global-harness.js b/node_modules/tap/lib/tap-global-harness.js deleted file mode 100644 index 3b041312..00000000 --- a/node_modules/tap/lib/tap-global-harness.js +++ /dev/null @@ -1,80 +0,0 @@ -// this is just a harness that pipes to stdout. -// It's the default one. -module.exports = GlobalHarness - -var globalHarness = global.TAP_Global_Harness - , inherits = require("inherits") - , Results = require("./tap-results") - , Harness = require("./tap-harness") - , Test = require("./tap-test") - -inherits(GlobalHarness, Harness) -function GlobalHarness () { - //console.error("calling GlobalHarness") - if (globalHarness) return globalHarness - if (!(this instanceof GlobalHarness)) { - return globalHarness = new GlobalHarness - } - - globalHarness = global.TAP_Global_Harness = this - Harness.call(this, Test) - - this.output.pipe(process.stdout) - //this.output.on("data", function () { - // process.nextTick(process.stdout.flush.bind(process.stdout)) - //}) - - this.test = this.test.bind(this) - - this.plan = this.plan.bind(this) - - var output = this.output - this.on("childEnd", function (child) { - //console.error("childEnd in global harness") - //console.error(child.results) - // write out the stuff for this child. - //console.error("child.conf", child.conf) - - // maybe write some other stuff about the number of tests in this - // thing, etc. I dunno. - //console.error("child results", child.results) - this.results.list.forEach(function (res) { - //delete res.error - //console.error("child resuilt", res) - output.write(res) - }) - //console.error("wrote child results") - this.results.list.length = 0 - }) - - var streamEnded = false - this.on("end", function () { - //console.error("global ending the stream") - if (!streamEnded) { - this.results.list.forEach(function (res) { - output.write(res) - }) - this.results.list.length = 0 - output.end() - streamEnded = true - - // If we had fails, then make sure that the exit code - // reflects that failure. - var exitCode - if (!this.results.ok) - exitCode = process.exitCode = 1 - if (exitCode !== 0) { - process.on('exit', function (code) { - if (code === 0) - process.exit(exitCode) - }) - } - } - }) - - //this.on("end", this.output.end.bind(this.output)) - - process.on("unhandledException", function (e) { - this.bailout("unhandled exception: " + e.message) - }) -} diff --git a/node_modules/tap/lib/tap-harness.js b/node_modules/tap/lib/tap-harness.js deleted file mode 100644 index 1de0ca6a..00000000 --- a/node_modules/tap/lib/tap-harness.js +++ /dev/null @@ -1,226 +0,0 @@ -// a thing that runs tests. -// Every "test" is also a harness. If they do not have a harness, -// then they are attached to the defaut "global harness", -// which writes its results to stdout. - - -// TODO: -// - Bailout should stop running any tests. -// - "skip" in the test config obj should skip it. - -module.exports = Harness -var EE = require("events").EventEmitter -require("inherits")(Harness, EE) - -var Results = require("./tap-results") - , TapProducer = require("./tap-producer") - , assert = require("./tap-assert") - -function Harness (Test) { - if (!(this instanceof Harness)) return new Harness(Test) - - //console.error("Test in "+this.constructor.name, Test) - - this._Test = Test - this._plan = null - this._children = [] - this._processing = false - - this._testCount = 0 - this._planSum = 0 - - this.results = new Results() - // emit result events on the harness. - //this.results.on("result", function (res) { - // console.error("proxying result ev from res to harness") - // this.emit("result", res) - //}.bind(this)) - var me = this - this.results.on("result", this.emit.bind(this, "result")) - - var p = this.process.bind(this) - this.process = function () { - this._processing = true - process.nextTick(p) - } - - this.output = new TapProducer() - EE.call(this) -} - -// this function actually only gets called bound to -// the Harness object, and on process.nextTick. Even if -// passed as an event handler, everything *else* will -// happen before it gets called. -Harness.prototype.process = function () { - //console.error("harness process") - // "end" can emit multiple times, so only actually move on - // to the next test if the current one is actually over. - // TODO: multiple in-process tests, if all are marked "async" - if (this._current) { - if (!this._current._ended) return - // handle the current one before moving onto the next. - this.childEnd(this._current) - } - var skip = true - while (skip) { - //console.error("checking for skips") - var current = this._current = this._children.shift() - if (current) { - skip = current.conf.skip - if (skip) { - //console.error("add a failure for the skipping") - this.results.add(assert.fail(current.conf.name - ,{skip:true, diag:false})) - } - } else skip = false - } - - // keep processing through skipped tests, instead of running them. - if (current && this._bailedOut) { - return this.process() - } - - //console.error("got current?", !!current) - if (current) { - current.on("end", this.process) - current.emit("ready") - //console.error("emitted ready") - //console.error("_plan", this._plan, this.constructor.name) - } else if (!this._plan || (this._plan && this._plan === this._testCount)) { - //console.error("Harness process: no more left. ending") - if (this._endNice) { - this._endNice() - } else { - this.end() - } - } else { - this._processing = false; - } -} - -Harness.prototype.end = function () { - if (this._children.length) { - return this.process() - } - //console.error("harness end", this.constructor.name) - if (this._bailedOut) return - - // can't call .end() more than once. - if (this._ended) { - //console.error("adding failure for end calling") - this.results.add(assert.fail("end called more than once")) - } - - // see if the plan is completed properly, if there was one. - if (this._plan !== null) { - var total = this._testCount - if (total !== this._plan) { - this.results.add(assert.equal(total, this._plan, "test count != plan")) - } - this._plan = total - } - - //console.error("setting ended true", this.constructor.name) - this._ended = true - this.emit("end") -} - -Harness.prototype.plan = function (p) { - //console.error("setting plan", new Error().stack) - if (this._plan !== null) { - //console.error("about to add failure for calling plan") - return this.results.add(assert.fail("plan set multiple times")) - } - this._plan = p - if (p === 0 || this.results.testsTotal) { - this.end() - } -} - -Harness.prototype.childEnd = function (child) { - //console.error("childEnd") - this._testCount ++ - this._planSum += child._plan - //console.error("adding set of child.results") - - this.results.add(child.conf.name || "(unnamed test)") - this.results.addSet(child.results) - this.emit("childEnd", child) - // was this planned? - if (this._plan === this._testCount) { - //console.error("plan", [this._plan, this._testCount]) - return this.end() - } -} - -function copyObj(o) { - var copied = {} - Object.keys(o).forEach(function (k) { copied[k] = o[k] }) - return copied -} - -Harness.prototype.test = function test (name, conf, cb) { - if (this._bailedOut) return - - if (typeof conf === "function") cb = conf, conf = null - if (typeof name === "object") conf = name, name = null - if (typeof name === "function") cb = name, name = null - - conf = (conf ? copyObj(conf) : {}) - name = name || "" - - //console.error("making test", [name, conf, cb]) - - // timeout: value in milliseconds. Defaults to 30s - // Set to Infinity to have no timeout. - if (isNaN(conf.timeout)) conf.timeout = 30000 - var t = new this._Test(this, name, conf) - var self = this - if (cb) { - //console.error("attaching cb to ready event") - t.on("ready", function () { - if (!isNaN(conf.timeout) && isFinite(conf.timeout)) { - var timer = setTimeout(this.timeout.bind(this), conf.timeout) - var clear = function () { - clearTimeout(timer) - } - t.on("end", clear) - t.on("bailout", function (message) { - self.bailout(message) - clear() - }) - } - }) - t.on("ready", cb.bind(t, t)) - // proxy the child results to this object. - //t.on("result", function (res) { - // console.error("in harness, proxying result up") - // t.results.add(res) - //}) - } - return t -} - -Harness.prototype.bailout = function (message) { - // console.error("Harness bailout", this.constructor.name) - message = message || "" - //console.error("adding bailout message result") - this.results.add({bailout: message}) - // console.error(">>> results after bailout" , this.results) - this._bailedOut = true - this.emit("bailout", message) - this.output.end({bailout: message}) -} - -Harness.prototype.add = function (child) { - //console.error("adding child") - this._children.push(child) - if (!this._processing) this.process() -} - -// the tearDown function is *always* guaranteed to happen. -// Even if there's a bailout. -Harness.prototype.tearDown = function (fn) { - this.on("end", fn) -} diff --git a/node_modules/tap/lib/tap-producer.js b/node_modules/tap/lib/tap-producer.js deleted file mode 100644 index b70d0ce4..00000000 --- a/node_modules/tap/lib/tap-producer.js +++ /dev/null @@ -1,131 +0,0 @@ -module.exports = TapProducer - -var Results = require("./tap-results") - , inherits = require("inherits") - , yamlish = require("yamlish") - -TapProducer.encode = function (result, diag) { - var tp = new TapProducer(diag) - , out = "" - tp.on("data", function (c) { out += c }) - if (Array.isArray(result)) { - result.forEach(tp.write, tp) - } else tp.write(result) - tp.end() - return out -} - -var Stream = require("stream").Stream -inherits(TapProducer, Stream) -function TapProducer (diag) { - Stream.call(this) - this.diag = diag - this.count = 0 - this.readable = this.writable = true - this.results = new Results -} - -TapProducer.prototype.trailer = true - -TapProducer.prototype.write = function (res) { - // console.error("TapProducer.write", res) - if (typeof res === "function") throw new Error("wtf?") - if (!this.writable) this.emit("error", new Error("not writable")) - - if (!this._didHead) { - this.emit("data", "TAP version 13\n") - this._didHead = true - } - - var diag = res.diag - if (diag === undefined) diag = this.diag - - this.emit("data", encodeResult(res, this.count + 1, diag)) - - if (typeof res === "string") return true - - if (res.bailout) { - var bo = "bail out!" - if (typeof res.bailout === "string") bo += " " + res.bailout - this.emit("data", bo) - return - } - this.results.add(res, false) - - this.count ++ -} - -TapProducer.prototype.end = function (res) { - if (res) this.write(res) - // console.error("TapProducer end", res, this.results) - this.emit("data", "\n1.."+this.results.testsTotal+"\n") - if (this.trailer && typeof this.trailer !== "string") { - // summary trailer. - var trailer = "tests "+this.results.testsTotal + "\n" - if (this.results.pass) { - trailer += "pass " + this.results.pass + "\n" - } - if (this.results.fail) { - trailer += "fail " + this.results.fail + "\n" - } - if (this.results.skip) { - trailer += "skip "+this.results.skip + "\n" - } - if (this.results.todo) { - trailer += "todo "+this.results.todo + "\n" - } - if (this.results.bailedOut) { - trailer += "bailed out" + "\n" - } - - if (this.results.testsTotal === this.results.pass) { - trailer += "\nok\n" - } - this.trailer = trailer - } - if (this.trailer) this.write(this.trailer) - this.writable = false - this.emit("end", null, this.count, this.ok) -} - -function encodeResult (res, count, diag) { - // console.error(res, count, diag) - if (typeof res === "string") { - res = res.split(/\r?\n/).map(function (l) { - if (!l.trim()) return l.trim() - return "# " + l - }).join("\n") - if (res.substr(-1) !== "\n") res += "\n" - return res - } - - if (res.bailout) return "" - - - if (!!process.env.TAP_NODIAG) diag = false - else if (!!process.env.TAP_DIAG) diag = true - else if (diag === undefined) diag = !res.ok - - var output = "" - res.name = res.name && ("" + res.name).trim() - output += ( !res.ok ? "not " : "") + "ok " + count - + ( !res.name ? "" - : " " + res.name.replace(/[\r\n]/g, " ") ) - + ( res.skip ? " # SKIP " + ( res.explanation || "" ) - : res.todo ? " # TODO " + ( res.explanation || "" ) - : "" ) - + "\n" - - if (!diag) return output - var d = {} - , dc = 0 - Object.keys(res).filter(function (k) { - return k !== "ok" && k !== "name" && k !== "id" - }).forEach(function (k) { - dc ++ - d[k] = res[k] - }) - //console.error(d, "about to encode") - if (dc > 0) output += " ---"+yamlish.encode(d)+"\n ...\n" - return output -} diff --git a/node_modules/tap/lib/tap-results.js b/node_modules/tap/lib/tap-results.js deleted file mode 100644 index 3243cd70..00000000 --- a/node_modules/tap/lib/tap-results.js +++ /dev/null @@ -1,72 +0,0 @@ -// A class for counting up results in a test harness. - -module.exports = Results - -var inherits = require("inherits") - , EventEmitter = require("events").EventEmitter - -inherits(Results, EventEmitter) - -function Results (r) { - //console.error("result constructor", r) - this.ok = true - this.addSet(r) -} - -Results.prototype.addSet = function (r) { - //console.error("add set of results", r) - r = r || {ok: true} - ; [ "todo" - , "todoPass" - , "todoFail" - , "skip" - , "skipPass" - , "skipFail" - , "pass" - , "passTotal" - , "fail" - , "failTotal" - , "tests" - , "testsTotal" ].forEach(function (k) { - this[k] = (this[k] || 0) + (r[k] || 0) - //console.error([k, this[k]]) - }, this) - - this.ok = this.ok && r.ok && true - this.bailedOut = this.bailedOut || r.bailedOut || false - this.list = (this.list || []).concat(r.list || []) - this.emit("set", this.list) - //console.error("after addSet", this) -} - -Results.prototype.add = function (r, addToList) { - if (typeof r === 'object') { - var pf = r.ok ? "pass" : "fail" - , PF = r.ok ? "Pass" : "Fail" - - this.testsTotal ++ - this[pf + "Total"] ++ - - if (r.skip) { - this["skip" + PF] ++ - this.skip ++ - } else if (r.todo) { - this["todo" + PF] ++ - this.todo ++ - } else { - this.tests ++ - this[pf] ++ - } - - if (r.bailout || typeof r.bailout === "string") { - // console.error("Bailing out in result") - this.bailedOut = true - } - this.ok = !!(this.ok && (r.ok || r.skip || r.todo)) - } - - if (addToList === false) return - this.list = this.list || [] - this.list.push(r) - this.emit("result", r) -} diff --git a/node_modules/tap/lib/tap-runner.js b/node_modules/tap/lib/tap-runner.js deleted file mode 100644 index d3689f0d..00000000 --- a/node_modules/tap/lib/tap-runner.js +++ /dev/null @@ -1,502 +0,0 @@ -var fs = require("fs") - , child_process = require("child_process") - , path = require("path") - , chain = require("slide").chain - , asyncMap = require("slide").asyncMap - , TapProducer = require("./tap-producer.js") - , TapConsumer = require("./tap-consumer.js") - , assert = require("./tap-assert.js") - , inherits = require("inherits") - , util = require("util") - , CovHtml = require("./tap-cov-html.js") - , glob = require("glob") - - // XXX Clean up the coverage options - , doCoverage = process.env.TAP_COV - || process.env.npm_package_config_coverage - || process.env.npm_config_coverage - -module.exports = Runner - -inherits(Runner, TapProducer) - -function Runner (options, cb) { - this.options = options - - var diag = this.options.diag - var dir = this.options.argv.remain - TapProducer.call(this, diag) - - this.doCoverage = doCoverage - // An array of full paths to files to obtain coverage - this.coverageFiles = [] - // The source of these files - this.coverageFilesSource = {} - // Where to write coverage information - this.coverageOutDir = this.options["coverage-dir"] - // Temporary test files bunkerified we'll remove later - this.f2delete = [] - // Raw coverage stats, as read from JSON files - this.rawCovStats = [] - // Processed coverage information, per file to cover: - this.covStats = {} - - if (dir) { - var filesToCover = this.options.cover - - if (doCoverage) { - var mkdirp = require("mkdirp") - this.coverageOutDir = path.resolve(this.coverageOutDir) - this.getFilesToCover(filesToCover) - var self = this - return mkdirp(this.coverageOutDir, '0755', function (er) { - if (er) return self.emit("error", er) - self.run(dir, cb) - }) - } - - this.run(dir, cb) - } -} - - -Runner.prototype.run = function() { - var self = this - , args = Array.prototype.slice.call(arguments) - , cb = args.pop() || finish - - function finish (er) { - if (er) { - self.emit("error", er) - } - - if (!doCoverage) return self.end() - - // Cleanup temporary test files with coverage: - self.f2delete.forEach(function(f) { - fs.unlinkSync(f) - }) - self.getFilesToCoverSource(function(err, data) { - if (err) { - self.emit("error", err) - } - self.getPerFileCovInfo(function(err, data) { - if (err) { - self.emit("error", err) - } - self.mergeCovStats(function(err, data) { - if (err) { - self.emit("error", err) - } - CovHtml(self.covStats, self.coverageOutDir, function() { - self.end() - }) - }) - }) - }) - } - - if (Array.isArray(args[0])) { - args = args[0] - } - self.runFiles(args, "", cb) -} - -Runner.prototype.runDir = function (dir, cb) { - var self = this - fs.readdir(dir, function (er, files) { - if (er) { - self.write(assert.fail("failed to readdir " + dir, { error: er })) - self.end() - return - } - files = files.sort(function(a, b) { - return a > b ? 1 : -1 - }) - files = files.filter(function(f) { - return !f.match(/^\./) - }) - files = files.map(function(file) { - return path.resolve(dir, file) - }) - - self.runFiles(files, path.resolve(dir), cb) - }) -} - - -// glob the filenames so that test/*.js works on windows -Runner.prototype.runFiles = function (files, dir, cb) { - var self = this - var globRes = [] - chain(files.map(function (f) { - return function (cb) { - glob(f, function (er, files) { - if (er) - return cb(er) - globRes.push.apply(globRes, files) - cb() - }) - } - }), function (er) { - if (er) - return cb(er) - runFiles(self, globRes, dir, cb) - }) -} - -// set some default options for node debugging tests -function setOptionsForDebug(self) { - // Note: we automatically increase the default timeout here. Yes - // the user can specify --timeout to increase, but by default, - // 30 seconds is not a long time to debug your test. - self.options.timeout = 1000000; - - // Note: we automatically turn on stderr so user can see the 'debugger listening on port' message. - // Without this it looks like tap has hung.. - self.options.stderr = true; -} - -function runFiles(self, files, dir, cb) { - chain(files.map(function(f) { - return function (cb) { - if (self._bailedOut) return - var relDir = dir || path.dirname(f) - , fileName = relDir === "." ? f : f.substr(relDir.length + 1) - - self.write(fileName) - fs.lstat(f, function(er, st) { - if (er) { - self.write(assert.fail("failed to stat " + f, {error: er})) - return cb() - } - - var cmd = f, args = [], env = {} - - if (path.extname(f) === ".js") { - cmd = process.execPath - if (self.options.gc) { - args.push("--expose-gc") - } - if (self.options.debug) { - args.push("--debug") - setOptionsForDebug(self) - } - if (self.options["debug-brk"]) { - args.push("--debug-brk") - setOptionsForDebug(self) - } - if (self.options.strict) { - args.push("--use-strict") - } - if (self.options.harmony) { - args.push("--harmony") - } - args.push(fileName) - } else if (path.extname(f) === ".coffee") { - cmd = "coffee" - args.push(fileName) - } else { - // Check if file is executable - if ((st.mode & parseInt('0100', 8)) && process.getuid) { - if (process.getuid() != st.uid) { - return cb() - } - } else if ((st.mode & parseInt('0010', 8)) && process.getgid) { - if (process.getgid() != st.gid) { - return cb() - } - } else if ((st.mode & parseInt('0001', 8)) == 0) { - return cb() - } - cmd = path.resolve(cmd) - } - - if (st.isDirectory()) { - return self.runDir(f, cb) - } - - if (doCoverage && path.extname(f) === ".js") { - var foriginal = fs.readFileSync(f, "utf8") - , fcontents = self.coverHeader() + foriginal + self.coverFooter() - , tmpBaseName = path.basename(f, path.extname(f)) - + ".with-coverage." + process.pid + path.extname(f) - , tmpFname = path.resolve(path.dirname(f), tmpBaseName) - - fs.writeFileSync(tmpFname, fcontents, "utf8") - args.splice(-1, 1, tmpFname) - } - - for (var i in process.env) { - env[i] = process.env[i] - } - env.TAP = 1 - - var cp = child_process.spawn(cmd, args, { env: env, cwd: relDir }) - , out = "" - , err = "" - , tc = new TapConsumer() - , childTests = [f] - - var timeout = setTimeout(function () { - if (!cp._ended) { - cp._timedOut = true - cp.kill() - } - }, self.options.timeout * 1000) - - tc.on("data", function(c) { - self.emit("result", c) - self.write(c) - }) - - tc.on("bailout", function (message) { - clearTimeout(timeout) - console.log("# " + f.substr(process.cwd().length + 1)) - process.stderr.write(err) - process.stdout.write(out + "\n") - self._bailedOut = true - cp._ended = true - cp.kill() - }) - - cp.stdout.pipe(tc) - cp.stdout.on("data", function (c) { out += c }) - cp.stderr.on("data", function (c) { - if (self.options.stderr) process.stderr.write(c) - err += c - }) - - cp.on("close", function (code, signal) { - if (cp._ended) return - cp._ended = true - var ok = !cp._timedOut && code === 0 - clearTimeout(timeout) - //childTests.forEach(function (c) { self.write(c) }) - var res = { name: path.dirname(f).replace(process.cwd() + "/", "") - + "/" + fileName - , ok: ok - , exit: code } - - if (cp._timedOut) - res.timedOut = cp._timedOut - if (signal) - res.signal = signal - - if (err) { - res.stderr = err - if (tc.results.ok && - tc.results.tests === 0 && - !self.options.stderr) { - // perhaps a compilation error or something else failed. - // no need if stderr is set, since it will have been - // output already anyway. - console.error(err) - } - } - - // tc.results.ok = tc.results.ok && ok - tc.results.add(res) - res.command = '"'+[cmd].concat(args).join(" ")+'"' - self.emit("result", res) - self.emit("file", f, res, tc.results) - self.write(res) - self.write("\n") - if (doCoverage) { - self.f2delete.push(tmpFname) - } - cb() - }) - }) - } - }), cb) - - return self -} - - -// Get an array of full paths to files we are interested into obtain -// code coverage. -Runner.prototype.getFilesToCover = function(filesToCover) { - var self = this - filesToCover = filesToCover.split(",").map(function(f) { - return path.resolve(f) - }).filter(function(f) { - var existsSync = fs.existsSync || path.existsSync; - return existsSync(f) - }) - - function recursive(f) { - if (path.extname(f) === "") { - // Is a directory: - fs.readdirSync(f).forEach(function(p) { - recursive(f + "/" + p) - }) - } else { - self.coverageFiles.push(f) - } - } - filesToCover.forEach(function(f) { - recursive(f) - }) -} - -// Prepend to every test file to run. Note tap.test at the very top due it -// "plays" with include paths. -Runner.prototype.coverHeader = function() { - // semi here since we're injecting it before the first line, - // and don't want to mess up line numbers in the test files. - return "var ___TAP_COVERAGE = require(" - + JSON.stringify(require.resolve("runforcover")) - + ").cover(/.*/g);" -} - -// Append at the end of every test file to run. Actually, the stuff which gets -// the coverage information. -// Maybe it would be better to move into a separate file template so editing -// could be easier. -Runner.prototype.coverFooter = function() { - var self = this - // This needs to be a string with proper interpolations: - return [ "" - , "var ___TAP = require(" + JSON.stringify(require.resolve("./main.js")) + ")" - , "if (typeof ___TAP._plan === 'number') ___TAP._plan ++" - , "___TAP.test(" + JSON.stringify("___coverage") + ", function(t) {" - , " var covFiles = " + JSON.stringify(self.coverageFiles) - , " , covDir = " + JSON.stringify(self.coverageOutDir) - , " , path = require('path')" - , " , fs = require('fs')" - , " , testFnBase = path.basename(__filename, '.js') + '.json'" - , " , testFn = path.resolve(covDir, testFnBase)" - , "" - , " function asyncForEach(arr, fn, callback) {" - , " if (!arr.length) {" - , " return callback()" - , " }" - , " var completed = 0" - , " arr.forEach(function(i) {" - , " fn(i, function (err) {" - , " if (err) {" - , " callback(err)" - , " callback = function () {}" - , " } else {" - , " completed += 1" - , " if (completed === arr.length) {" - , " callback()" - , " }" - , " }" - , " })" - , " })" - , " }" - , "" - , " ___TAP_COVERAGE(function(coverageData) {" - , " var outObj = {}" - , " asyncForEach(covFiles, function(f, cb) {" - , " if (coverageData[f]) {" - , " var stats = coverageData[f].stats()" - , " , stObj = stats" - , " stObj.lines = stats.lines.map(function (l) {" - , " return { number: l.lineno, source: l.source() }" - , " })" - , " outObj[f] = stObj" - , " }" - , " cb()" - , " }, function(err) {" - , " ___TAP_COVERAGE.release()" - , " fs.writeFileSync(testFn, JSON.stringify(outObj))" - , " t.end()" - , " })" - , " })" - , "})" ].join("\n") -} - - -Runner.prototype.getFilesToCoverSource = function(cb) { - var self = this - asyncMap(self.coverageFiles, function(f, cb) { - fs.readFile(f, "utf8", function(err, data) { - var lc = 0 - if (err) { - cb(err) - } - self.coverageFilesSource[f] = data.split("\n").map(function(l) { - lc += 1 - return { number: lc, source: l } - }) - cb() - }) - }, cb) -} - -Runner.prototype.getPerFileCovInfo = function(cb) { - var self = this - , covPath = path.resolve(self.coverageOutDir) - - fs.readdir(covPath, function(err, files) { - if (err) { - self.emit("error", err) - } - var covFiles = files.filter(function(f) { - return path.extname(f) === ".json" - }) - asyncMap(covFiles, function(f, cb) { - fs.readFile(path.resolve(covPath, f), "utf8", function(err, data) { - if (err) { - cb(err) - } - self.rawCovStats.push(JSON.parse(data)) - cb() - }) - }, function(f, cb) { - fs.unlink(path.resolve(covPath, f), cb) - }, cb) - }) -} - -Runner.prototype.mergeCovStats = function(cb) { - var self = this - self.rawCovStats.forEach(function(st) { - Object.keys(st).forEach(function(i) { - // If this is the first time we reach this file, just add the info: - if (!self.covStats[i]) { - self.covStats[i] = { - missing: st[i].lines - } - } else { - // If we already added info for this file before, we need to remove - // from self.covStats any line not duplicated again (since it has - // run on such case) - self.covStats[i].missing = self.covStats[i].missing.filter( - function(l) { - return (st[i].lines.indexOf(l)) - }) - } - }) - }) - - // This is due to a bug into - // chrisdickinson/node-bunker/blob/feature/add-coverage-interface - // which is using array indexes for line numbers instead of the right number - Object.keys(self.covStats).forEach(function(f) { - self.covStats[f].missing = self.covStats[f].missing.map(function(line) { - return { number: line.number, source: line.source } - }) - }) - - Object.keys(self.coverageFilesSource).forEach(function(f) { - if (!self.covStats[f]) { - self.covStats[f] = { missing: self.coverageFilesSource[f] - , percentage: 0 - } - } - self.covStats[f].lines = self.coverageFilesSource[f] - self.covStats[f].loc = self.coverageFilesSource[f].length - - if (!self.covStats[f].percentage) { - self.covStats[f].percentage = - 1 - (self.covStats[f].missing.length / self.covStats[f].loc) - } - - }) - cb() -} diff --git a/node_modules/tap/lib/tap-test.js b/node_modules/tap/lib/tap-test.js deleted file mode 100644 index ec733218..00000000 --- a/node_modules/tap/lib/tap-test.js +++ /dev/null @@ -1,110 +0,0 @@ -// This is a very simple test framework that leverages the tap framework -// to run tests and output tap-parseable results. - -module.exports = Test - -var assert = require("./tap-assert") - , inherits = require("inherits") - , Results = require("./tap-results") - , Harness = require("./tap-harness") - -// tests are also test harnesses -inherits(Test, Harness) - -function Test (harness, name, conf) { - //console.error("test ctor") - if (!(this instanceof Test)) return new Test(harness, name, conf) - - Harness.call(this, Test) - - conf.name = name || conf.name || "(anonymous)" - this.conf = conf - - this.harness = harness - this.harness.add(this) -} - -// it's taking too long! -Test.prototype.timeout = function () { - // detect false alarms - if (this._ended) return - this.fail("Timeout!") - this.end() -} - -Test.prototype.clear = function () { - this._started = false - this._ended = false - this._plan = null - this._bailedOut = false - this._testCount = 0 - this.results = new Results() -} - -// this gets called if a test throws ever -Test.prototype.threw = function (ex) { - //console.error("threw!", ex.stack) - this.fail(ex.name + ": " + ex.message, { error: ex, thrown: true }) - // may emit further failing tests if the plan is not completed - //console.error("end, because it threw") - if (!this._ended) this.end() -} - -Test.prototype.comment = function (m) { - if (typeof m !== "string") { - return this.fail("Test.comment argument must be a string") - } - this.result("\n" + m.trim()) -} - -Test.prototype.result = function (res) { - this.results.add(res) - this._testCount ++ - this.emit("result", res) - if (this._plan === this._testCount) { - process.nextTick(this._endNice.bind(this)) - } -} - -Test.prototype._endNice = function () { - if (!this._ended) this.end() -} - -// parasitic -// Who says you can't do multiple inheritance in js? -Object.getOwnPropertyNames(assert).forEach(function (k) { - if (k === "prototype" || k === "name") return - var d = Object.getOwnPropertyDescriptor(assert, k) - , v = d.value - if (!v) return - d.value = assertParasite(v) - Object.defineProperty(Test.prototype, k, d) -}) - -function assertParasite (fn) { return function _testAssert () { - //console.error("_testAssert", fn.name, arguments) - if (this._bailedOut) return - var res = fn.apply(assert, arguments) - this.result(res) - return res -}} - -// a few tweaks on the EE emit function, because -// we want to catch all thrown errors and bubble up "bailout" -Test.prototype.emit = (function (em) { return function (t) { - // bailouts bubble until handled - if (t === "bailout" && - this.listeners(t).length === 0 && - this.harness) { - return this.harness.bailout(arguments[1]) - } - - if (t === "error") return em.apply(this, arguments) - try { - em.apply(this, arguments) - } catch (ex) { - // any exceptions in a test are a failure - //console.error("caught!", ex.stack) - this.threw(ex) - } -}})(Harness.prototype.emit) diff --git a/node_modules/tap/node_modules/.bin/mkdirp b/node_modules/tap/node_modules/.bin/mkdirp deleted file mode 120000 index 017896ce..00000000 --- a/node_modules/tap/node_modules/.bin/mkdirp +++ /dev/null @@ -1 +0,0 @@ -../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/node_modules/tap/node_modules/.bin/nopt b/node_modules/tap/node_modules/.bin/nopt deleted file mode 120000 index 6b6566ea..00000000 --- a/node_modules/tap/node_modules/.bin/nopt +++ /dev/null @@ -1 +0,0 @@ -../nopt/bin/nopt.js \ No newline at end of file diff --git a/node_modules/tap/node_modules/buffer-equal/.travis.yml b/node_modules/tap/node_modules/buffer-equal/.travis.yml deleted file mode 100644 index dad2273c..00000000 --- a/node_modules/tap/node_modules/buffer-equal/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - "0.10" diff --git a/node_modules/tap/node_modules/buffer-equal/README.markdown b/node_modules/tap/node_modules/buffer-equal/README.markdown deleted file mode 100644 index 8c062fd0..00000000 --- a/node_modules/tap/node_modules/buffer-equal/README.markdown +++ /dev/null @@ -1,62 +0,0 @@ -buffer-equal -============ - -Return whether two buffers are equal. - -[![build status](https://secure.travis-ci.org/substack/node-buffer-equal.png)](http://travis-ci.org/substack/node-buffer-equal) - -example -======= - -``` js -var bufferEqual = require('buffer-equal'); - -console.dir(bufferEqual( - new Buffer([253,254,255]), - new Buffer([253,254,255]) -)); -console.dir(bufferEqual( - new Buffer('abc'), - new Buffer('abcd') -)); -console.dir(bufferEqual( - new Buffer('abc'), - 'abc' -)); -``` - -output: - -``` -true -false -undefined -``` - -methods -======= - -``` js -var bufferEqual = require('buffer-equal') -``` - -bufferEqual(a, b) ------------------ - -Return whether the two buffers `a` and `b` are equal. - -If `a` or `b` is not a buffer, return `undefined`. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install buffer-equal -``` - -license -======= - -MIT diff --git a/node_modules/tap/node_modules/buffer-equal/example/eq.js b/node_modules/tap/node_modules/buffer-equal/example/eq.js deleted file mode 100644 index 1eb05095..00000000 --- a/node_modules/tap/node_modules/buffer-equal/example/eq.js +++ /dev/null @@ -1,14 +0,0 @@ -var bufferEqual = require('../'); - -console.dir(bufferEqual( - new Buffer([253,254,255]), - new Buffer([253,254,255]) -)); -console.dir(bufferEqual( - new Buffer('abc'), - new Buffer('abcd') -)); -console.dir(bufferEqual( - new Buffer('abc'), - 'abc' -)); diff --git a/node_modules/tap/node_modules/buffer-equal/index.js b/node_modules/tap/node_modules/buffer-equal/index.js deleted file mode 100644 index e640d4e2..00000000 --- a/node_modules/tap/node_modules/buffer-equal/index.js +++ /dev/null @@ -1,14 +0,0 @@ -var Buffer = require('buffer').Buffer; // for use with browserify - -module.exports = function (a, b) { - if (!Buffer.isBuffer(a)) return undefined; - if (!Buffer.isBuffer(b)) return undefined; - if (typeof a.equals === 'function') return a.equals(b); - if (a.length !== b.length) return false; - - for (var i = 0; i < a.length; i++) { - if (a[i] !== b[i]) return false; - } - - return true; -}; diff --git a/node_modules/tap/node_modules/buffer-equal/package.json b/node_modules/tap/node_modules/buffer-equal/package.json deleted file mode 100644 index 1af63e53..00000000 --- a/node_modules/tap/node_modules/buffer-equal/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "buffer-equal", - "description": "return whether two buffers are equal", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-buffer-equal.git" - }, - "main": "index.js", - "keywords": [ - "buffer", - "equal" - ], - "directories": { - "example": "example", - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "0.2.4" - }, - "engines": { - "node": ">=0.4.0" - }, - "license": "MIT", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/node-buffer-equal/issues" - }, - "homepage": "https://github.com/substack/node-buffer-equal", - "_id": "buffer-equal@0.0.1", - "dist": { - "shasum": "91bc74b11ea405bc916bc6aa908faafa5b4aac4b", - "tarball": "http://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz" - }, - "_from": "buffer-equal@>=0.0.0 <0.1.0", - "_npmVersion": "1.4.3", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "_shasum": "91bc74b11ea405bc916bc6aa908faafa5b4aac4b", - "_resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/tap/node_modules/buffer-equal/test/eq.js b/node_modules/tap/node_modules/buffer-equal/test/eq.js deleted file mode 100644 index 3d340062..00000000 --- a/node_modules/tap/node_modules/buffer-equal/test/eq.js +++ /dev/null @@ -1,35 +0,0 @@ -var bufferEqual = require('../'); -var test = require('tap').test; - -test('equal', function (t) { - var eq = bufferEqual( - new Buffer([253,254,255]), - new Buffer([253,254,255]) - ); - t.strictEqual(eq, true); - t.end(); -}); - -test('not equal', function (t) { - var eq = bufferEqual( - new Buffer('abc'), - new Buffer('abcd') - ); - t.strictEqual(eq, false); - t.end(); -}); - -test('not equal not buffer', function (t) { - var eq = bufferEqual( - new Buffer('abc'), - 'abc' - ); - t.strictEqual(eq, undefined); - t.end(); -}); - -test('equal not buffer', function (t) { - var eq = bufferEqual('abc', 'abc'); - t.strictEqual(eq, undefined); - t.end(); -}); diff --git a/node_modules/tap/node_modules/deep-equal/.travis.yml b/node_modules/tap/node_modules/deep-equal/.travis.yml deleted file mode 100644 index f1d0f13c..00000000 --- a/node_modules/tap/node_modules/deep-equal/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/node_modules/tap/node_modules/deep-equal/LICENSE b/node_modules/tap/node_modules/deep-equal/LICENSE deleted file mode 100644 index ee27ba4b..00000000 --- a/node_modules/tap/node_modules/deep-equal/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -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/tap/node_modules/deep-equal/example/cmp.js b/node_modules/tap/node_modules/deep-equal/example/cmp.js deleted file mode 100644 index 67014b88..00000000 --- a/node_modules/tap/node_modules/deep-equal/example/cmp.js +++ /dev/null @@ -1,11 +0,0 @@ -var equal = require('../'); -console.dir([ - equal( - { a : [ 2, 3 ], b : [ 4 ] }, - { a : [ 2, 3 ], b : [ 4 ] } - ), - equal( - { x : 5, y : [6] }, - { x : 5, y : 6 } - ) -]); diff --git a/node_modules/tap/node_modules/deep-equal/index.js b/node_modules/tap/node_modules/deep-equal/index.js deleted file mode 100644 index dbc11f2d..00000000 --- a/node_modules/tap/node_modules/deep-equal/index.js +++ /dev/null @@ -1,94 +0,0 @@ -var pSlice = Array.prototype.slice; -var objectKeys = require('./lib/keys.js'); -var isArguments = require('./lib/is_arguments.js'); - -var deepEqual = module.exports = function (actual, expected, opts) { - if (!opts) opts = {}; - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return opts.strict ? actual === expected : actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected, opts); - } -} - -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -function isBuffer (x) { - if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; - if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { - return false; - } - if (x.length > 0 && typeof x[0] !== 'number') return false; - return true; -} - -function objEquiv(a, b, opts) { - var i, key; - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return deepEqual(a, b, opts); - } - if (isBuffer(a)) { - if (!isBuffer(b)) { - return false; - } - if (a.length !== b.length) return false; - for (i = 0; i < a.length; i++) { - if (a[i] !== b[i]) return false; - } - return true; - } - try { - var ka = objectKeys(a), - kb = objectKeys(b); - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!deepEqual(a[key], b[key], opts)) return false; - } - return typeof a === typeof b; -} diff --git a/node_modules/tap/node_modules/deep-equal/lib/is_arguments.js b/node_modules/tap/node_modules/deep-equal/lib/is_arguments.js deleted file mode 100644 index 1ff150fc..00000000 --- a/node_modules/tap/node_modules/deep-equal/lib/is_arguments.js +++ /dev/null @@ -1,20 +0,0 @@ -var supportsArgumentsClass = (function(){ - return Object.prototype.toString.call(arguments) -})() == '[object Arguments]'; - -exports = module.exports = supportsArgumentsClass ? supported : unsupported; - -exports.supported = supported; -function supported(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -}; - -exports.unsupported = unsupported; -function unsupported(object){ - return object && - typeof object == 'object' && - typeof object.length == 'number' && - Object.prototype.hasOwnProperty.call(object, 'callee') && - !Object.prototype.propertyIsEnumerable.call(object, 'callee') || - false; -}; diff --git a/node_modules/tap/node_modules/deep-equal/lib/keys.js b/node_modules/tap/node_modules/deep-equal/lib/keys.js deleted file mode 100644 index 13af263f..00000000 --- a/node_modules/tap/node_modules/deep-equal/lib/keys.js +++ /dev/null @@ -1,9 +0,0 @@ -exports = module.exports = typeof Object.keys === 'function' - ? Object.keys : shim; - -exports.shim = shim; -function shim (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -} diff --git a/node_modules/tap/node_modules/deep-equal/package.json b/node_modules/tap/node_modules/deep-equal/package.json deleted file mode 100644 index 38592c16..00000000 --- a/node_modules/tap/node_modules/deep-equal/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "deep-equal", - "version": "1.0.0", - "description": "node's assert.deepEqual algorithm", - "main": "index.js", - "directories": { - "lib": ".", - "example": "example", - "test": "test" - }, - "scripts": { - "test": "tape test/*.js" - }, - "devDependencies": { - "tape": "^3.5.0" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/substack/node-deep-equal.git" - }, - "keywords": [ - "equality", - "equal", - "compare" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": { - "ie": [ - 6, - 7, - 8, - 9 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "chrome": [ - 10, - 22 - ], - "safari": [ - 5.1 - ], - "opera": [ - 12 - ] - } - }, - "gitHead": "39c740ebdafed9443912a4ef1493b18693934daf", - "bugs": { - "url": "https://github.com/substack/node-deep-equal/issues" - }, - "homepage": "https://github.com/substack/node-deep-equal", - "_id": "deep-equal@1.0.0", - "_shasum": "d4564f07d2f0ab3e46110bec16592abd7dc2e326", - "_from": "deep-equal@>=1.0.0 <2.0.0", - "_npmVersion": "2.3.0", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "dist": { - "shasum": "d4564f07d2f0ab3e46110bec16592abd7dc2e326", - "tarball": "http://registry.npmjs.org/deep-equal/-/deep-equal-1.0.0.tgz" - }, - "_resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/tap/node_modules/deep-equal/readme.markdown b/node_modules/tap/node_modules/deep-equal/readme.markdown deleted file mode 100644 index f489c2a3..00000000 --- a/node_modules/tap/node_modules/deep-equal/readme.markdown +++ /dev/null @@ -1,61 +0,0 @@ -# deep-equal - -Node's `assert.deepEqual() algorithm` as a standalone module. - -This module is around [5 times faster](https://gist.github.com/2790507) -than wrapping `assert.deepEqual()` in a `try/catch`. - -[![browser support](https://ci.testling.com/substack/node-deep-equal.png)](https://ci.testling.com/substack/node-deep-equal) - -[![build status](https://secure.travis-ci.org/substack/node-deep-equal.png)](https://travis-ci.org/substack/node-deep-equal) - -# example - -``` js -var equal = require('deep-equal'); -console.dir([ - equal( - { a : [ 2, 3 ], b : [ 4 ] }, - { a : [ 2, 3 ], b : [ 4 ] } - ), - equal( - { x : 5, y : [6] }, - { x : 5, y : 6 } - ) -]); -``` - -# methods - -``` js -var deepEqual = require('deep-equal') -``` - -## deepEqual(a, b, opts) - -Compare objects `a` and `b`, returning whether they are equal according to a -recursive equality algorithm. - -If `opts.strict` is `true`, use strict equality (`===`) to compare leaf nodes. -The default is to use coercive equality (`==`) because that's how -`assert.deepEqual()` works by default. - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install deep-equal -``` - -# test - -With [npm](http://npmjs.org) do: - -``` -npm test -``` - -# license - -MIT. Derived largely from node's assert module. diff --git a/node_modules/tap/node_modules/deep-equal/test/cmp.js b/node_modules/tap/node_modules/deep-equal/test/cmp.js deleted file mode 100644 index d141256c..00000000 --- a/node_modules/tap/node_modules/deep-equal/test/cmp.js +++ /dev/null @@ -1,89 +0,0 @@ -var test = require('tape'); -var equal = require('../'); -var isArguments = require('../lib/is_arguments.js'); -var objectKeys = require('../lib/keys.js'); - -test('equal', function (t) { - t.ok(equal( - { a : [ 2, 3 ], b : [ 4 ] }, - { a : [ 2, 3 ], b : [ 4 ] } - )); - t.end(); -}); - -test('not equal', function (t) { - t.notOk(equal( - { x : 5, y : [6] }, - { x : 5, y : 6 } - )); - t.end(); -}); - -test('nested nulls', function (t) { - t.ok(equal([ null, null, null ], [ null, null, null ])); - t.end(); -}); - -test('strict equal', function (t) { - t.notOk(equal( - [ { a: 3 }, { b: 4 } ], - [ { a: '3' }, { b: '4' } ], - { strict: true } - )); - t.end(); -}); - -test('non-objects', function (t) { - t.ok(equal(3, 3)); - t.ok(equal('beep', 'beep')); - t.ok(equal('3', 3)); - t.notOk(equal('3', 3, { strict: true })); - t.notOk(equal('3', [3])); - t.end(); -}); - -test('arguments class', function (t) { - t.ok(equal( - (function(){return arguments})(1,2,3), - (function(){return arguments})(1,2,3), - "compares arguments" - )); - t.notOk(equal( - (function(){return arguments})(1,2,3), - [1,2,3], - "differenciates array and arguments" - )); - t.end(); -}); - -test('test the arguments shim', function (t) { - t.ok(isArguments.supported((function(){return arguments})())); - t.notOk(isArguments.supported([1,2,3])); - - t.ok(isArguments.unsupported((function(){return arguments})())); - t.notOk(isArguments.unsupported([1,2,3])); - - t.end(); -}); - -test('test the keys shim', function (t) { - t.deepEqual(objectKeys.shim({ a: 1, b : 2 }), [ 'a', 'b' ]); - t.end(); -}); - -test('dates', function (t) { - var d0 = new Date(1387585278000); - var d1 = new Date('Fri Dec 20 2013 16:21:18 GMT-0800 (PST)'); - t.ok(equal(d0, d1)); - t.end(); -}); - -test('buffers', function (t) { - t.ok(equal(Buffer('xyz'), Buffer('xyz'))); - t.end(); -}); - -test('booleans and arrays', function (t) { - t.notOk(equal(true, [])); - t.end(); -}) diff --git a/node_modules/tap/node_modules/difflet/.travis.yml b/node_modules/tap/node_modules/difflet/.travis.yml deleted file mode 100644 index 09d3ef37..00000000 --- a/node_modules/tap/node_modules/difflet/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.10 diff --git a/node_modules/tap/node_modules/difflet/README.markdown b/node_modules/tap/node_modules/difflet/README.markdown deleted file mode 100644 index 9ad43031..00000000 --- a/node_modules/tap/node_modules/difflet/README.markdown +++ /dev/null @@ -1,116 +0,0 @@ -difflet -======= - -Create colorful diffs for javascript objects. - -example -======= - -string.js ---------- - -``` js -var difflet = require('difflet'); - -var s = difflet.compare({ a : 2, c : 5 }, { a : 3, b : 4 }); -process.stdout.write(s); -``` - -output: - -![colorful output](http://substack.net/images/screenshots/difflet_string.png) - -colors.js ---------- - -``` js -var diff = require('difflet')({ indent : 2 }); - -var prev = { - yy : 6, - zz : 5, - a : [1,2,3], - fn : 'beep', - c : { x : 7, z : 3 } -}; - -var next = { - a : [ 1, 2, "z", /beep/, new Buffer(3) ], - fn : function qqq () {}, - b : [5,6,7], - c : { x : 8, y : 5 } -}; - -diff(prev, next).pipe(process.stdout); -``` - -output: - -![colorful output](http://substack.net/images/screenshots/difflet_colors.png) - -green for inserts, blue for updates, red for deletes - -methods -======= - -var difflet = require('difflet') - -var diff = difflet(opts={}) ---------------------------- - -Create a difflet from optional options `opts`. - -With `opts.start(type, stream)` and `opts.stop(type, stream)`, -you can write custom handlers for all the types of differences: -`'inserted'`, `'updated'`, and `'deleted'`. -By default green is used for insertions, blue for updates, and red for -deletions. - -If `opts.indent` is set, output will span multiple lines and `opts.indent` -spaces will be used for leading whitespace. - -If `opts.comma === 'first'` then commas will be placed at the start of lines. - -Setting `opts.comment` to `true` will turn on comments with the previous -contents like this: - -![object comments](http://substack.net/images/screenshots/difflet_object_comments.png) - -diff(prev, next) ----------------- - -Return a stream with the colorful changes between objects `prev` and `next`. - -diff.compare(prev, next) ------------------------- - -Return a string with the colorful changes between `prev` and `next`. - -difflet.compare(prev, next) ---------------------------- - -Return a string with the colorful changes between `prev` and `next` with the -default options. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install difflet -``` - -test -==== - -With [npm](http://npmjs.org) do: - -``` -npm test -``` - -license -======= - -MIT/X11 diff --git a/node_modules/tap/node_modules/difflet/example/cmp_array.js b/node_modules/tap/node_modules/difflet/example/cmp_array.js deleted file mode 100644 index bc5733fa..00000000 --- a/node_modules/tap/node_modules/difflet/example/cmp_array.js +++ /dev/null @@ -1,6 +0,0 @@ -var difflet = require('../'); -var s = difflet({ indent : 2, comment : true }).compare( - [ 1, [2,3,{a:4}], 3 ], - [ 1, [[5],6,7], 4 ] -); -process.stdout.write(s); diff --git a/node_modules/tap/node_modules/difflet/example/cmp_object.js b/node_modules/tap/node_modules/difflet/example/cmp_object.js deleted file mode 100644 index 5e00e2c0..00000000 --- a/node_modules/tap/node_modules/difflet/example/cmp_object.js +++ /dev/null @@ -1,6 +0,0 @@ -var difflet = require('../'); -var s = difflet({ indent : 2, comment : true }).compare( - { z : [6,7], a : 'abcdefgh', b : [ 31, 'xxt' ] }, - { x : 5, a : 'abdcefg', b : [ 51, 'xxs' ] } -); -console.log(s); diff --git a/node_modules/tap/node_modules/difflet/example/colors.js b/node_modules/tap/node_modules/difflet/example/colors.js deleted file mode 100644 index 332bbae3..00000000 --- a/node_modules/tap/node_modules/difflet/example/colors.js +++ /dev/null @@ -1,18 +0,0 @@ -var diff = require('../')({ indent : 2 }); - -var prev = { - yy : 6, - zz : 5, - a : [1,2,3], - fn : 'beep', - c : { x : 7, z : 3 } -}; - -var next = { - a : [ 1, 2, "z", /beep/, new Buffer(3) ], - fn : function qqq () {}, - b : [5,6,7], - c : { x : 8, y : 5 } -}; - -diff(prev, next).pipe(process.stdout); diff --git a/node_modules/tap/node_modules/difflet/example/comma_first.js b/node_modules/tap/node_modules/difflet/example/comma_first.js deleted file mode 100644 index 67ece234..00000000 --- a/node_modules/tap/node_modules/difflet/example/comma_first.js +++ /dev/null @@ -1,12 +0,0 @@ -var diff = require('../')({ - indent : 2, - comma : 'first', -}); - -var prev = { yy : 6, zz : 5, a : [1,2,3] }; -var next = { - a : [ 1, 2, 3, [4], "z", /beep/, new Buffer(3) ], - fn : 8, - b : [5,6,7] -}; -diff(prev, next).pipe(process.stdout); diff --git a/node_modules/tap/node_modules/difflet/example/diff.js b/node_modules/tap/node_modules/difflet/example/diff.js deleted file mode 100644 index 08f6e7ae..00000000 --- a/node_modules/tap/node_modules/difflet/example/diff.js +++ /dev/null @@ -1,15 +0,0 @@ -var difflet = require('../'); -var a = { - x : 4, - z : 8, - xs : [ 5, 2, 1, { 0 : 'c' } ], -}; - -var b = { - x : 4, - y : 5, - xs : [ 5, 2, 2, { c : 5 } ], -}; - -var s = difflet({ comment : true, indent : 2 }).compare(a, b); -console.log(s); diff --git a/node_modules/tap/node_modules/difflet/example/html.js b/node_modules/tap/node_modules/difflet/example/html.js deleted file mode 100644 index 9ff4a293..00000000 --- a/node_modules/tap/node_modules/difflet/example/html.js +++ /dev/null @@ -1,34 +0,0 @@ -var difflet = require('../'); -var ent = require('ent'); - -var tags = { - inserted : '', - updated : '', - deleted : '', -}; -var diff = difflet({ - start : function (t, s) { - s.write(tags[t]); - }, - stop : function (t, s) { - s.write(''); - }, - write : function (buf) { - stream.write(ent.encode(buf)) - }, -}); - -var prev = { - yy : 6, - zz : 5, - a : [1,2,3], - fn : function qq () {} -}; -var next = { - a : [ 1, 2, 3, [4], "z", /beep/, new Buffer([0,1,2]) ], - fn : 'I <3 robots', - b : [5,6,7] -}; - -var stream = diff(prev, next); -stream.pipe(process.stdout, { end : false }); diff --git a/node_modules/tap/node_modules/difflet/example/string.js b/node_modules/tap/node_modules/difflet/example/string.js deleted file mode 100644 index 6cff6cb4..00000000 --- a/node_modules/tap/node_modules/difflet/example/string.js +++ /dev/null @@ -1,4 +0,0 @@ -var difflet = require('../'); - -var s = difflet.compare({ a : 2, c : 5 }, { a : 3, b : 4 }); -process.stdout.write(s); diff --git a/node_modules/tap/node_modules/difflet/index.js b/node_modules/tap/node_modules/difflet/index.js deleted file mode 100644 index 278e6b95..00000000 --- a/node_modules/tap/node_modules/difflet/index.js +++ /dev/null @@ -1,377 +0,0 @@ -var traverse = require('traverse'); -var Stream = require('stream').Stream; -var charm = require('charm'); -var deepEqual = require('deep-is'); - -var exports = module.exports = function (opts_) { - var fn = difflet.bind(null, opts_); - fn.compare = function (prev, next) { - var opts = Object.keys(opts_ || {}).reduce(function (acc, key) { - acc[key] = opts_[key]; - return acc; - }, {}); - var s = opts.stream = new Stream; - var data = ''; - s.write = function (buf) { data += buf }; - s.end = function () {}; - s.readable = true; - s.writable = true; - - difflet(opts, prev, next); - return data; - }; - return fn; -}; - -exports.compare = function (prev, next) { - return exports({}).compare(prev, next); -}; - -function difflet (opts, prev, next) { - var stream = opts.stream || new Stream; - if (!opts.stream) { - stream.readable = true; - stream.writable = true; - stream.write = function (buf) { this.emit('data', buf) }; - stream.end = function () { this.emit('end') }; - } - - if (!opts) opts = {}; - if (opts.start === undefined && opts.stop === undefined) { - var c = charm(stream); - opts.start = function (type) { - c.foreground({ - inserted : 'green', - updated : 'blue', - deleted : 'red', - comment : 'cyan', - }[type]); - c.display('bright'); - }; - opts.stop = function (type) { - c.display('reset'); - }; - } - var write = function (buf) { - if (opts.write) opts.write(buf, stream) - else stream.write(buf) - }; - - var commaFirst = opts.comma === 'first'; - - var stringify = function (node, params) { - return stringifier.call(this, true, node, params || opts); - }; - var plainStringify = function (node, params) { - return stringifier.call(this, false, node, params || opts); - }; - - var levels = 0; - function set (type) { - if (levels === 0) opts.start(type, stream); - levels ++; - } - - function unset (type) { - if (--levels === 0) opts.stop(type, stream); - } - - function stringifier (insertable, node, opts) { - var indent = opts.indent; - - if (insertable) { - var prevNode = traverse.get(prev, this.path || []); - } - var inserted = insertable && prevNode === undefined; - - var indentx; - try { - indentx = indent ? Array( - ((this.path || []).length + 1) * indent + 1 - ).join(' ') : ''; - } catch (e) { - // at times we get an invalid Array size here and need to prevent crashing - indentx = ''; - } - if (commaFirst) indentx = indentx.slice(indent); - - if (Array.isArray(node)) { - var updated = (prevNode || traverse.has(prev, this.path)) - && !Array.isArray(prevNode); - if (updated) { - set('updated'); - } - - if (opts.comment && !Array.isArray(prevNode)) { - indent = 0; - } - - this.before(function () { - if (inserted) set('inserted'); - if (indent && commaFirst) { - if ((this.path || []).length === 0 - || Array.isArray(this.parent.node)) { - write('[ '); - } - else write('\n' + indentx + '[ '); - } - else if (indent) { - write('[\n' + indentx); - } - else { - write('['); - } - }); - - this.post(function (child) { - if (!child.isLast && !(indent && commaFirst)) { - write(','); - } - - var prev = prevNode && prevNode[child.key]; - if (indent && opts.comment && child.node !== prev - && (typeof child.node !== 'object' || typeof prev !== 'object') - ) { - set('comment'); - write(' // != '); - traverse(prev).forEach(function (x) { - plainStringify.call(this, x, { indent : 0 }); - }); - unset('comment'); - } - - if (!child.isLast) { - if (indent && commaFirst) { - write('\n' + indentx + ', '); - } - else if (indent) { - write('\n' + indentx); - } - } - }); - - this.after(function () { - if (indent && commaFirst) write('\n' + indentx); - else if (indent) write('\n' + indentx.slice(indent)); - - write(']'); - if (updated) unset('updated'); - if (inserted) unset('inserted'); - }); - } - else if (isRegExp(node)) { - this.block(); - - if (inserted) { - set('inserted'); - write(node.toString()); - unset('inserted'); - } - else if (insertable && prevNode !== node) { - set('updated'); - write(node.toString()); - unset('updated'); - } - else write(node.toString()); - } - else if (typeof node === 'object' - && node && typeof node.inspect === 'function') { - this.block(); - if (inserted) { - set('inserted'); - write(node.inspect()); - unset('inserted'); - } - else if (!(prevNode && typeof prevNode.inspect === 'function' - && prevNode.inspect() === node.inspect())) { - set('updated'); - write(node.inspect()); - unset('updated'); - } - else write(node.inspect()); - } - else if (typeof node == 'object' && node !== null) { - var insertedKey = false; - var deleted = insertable && typeof prevNode === 'object' && prevNode - ? Object.keys(prevNode).filter(function (key) { - return !Object.hasOwnProperty.call(node, key); - }) - : [] - ; - - this.before(function () { - if (inserted) set('inserted'); - write(indent && commaFirst && !this.isRoot - ? '\n' + indentx + '{ ' - : '{' - ); - }); - - this.pre(function (x, key) { - if (insertable) { - var obj = traverse.get(prev, this.path.concat(key)); - if (obj === undefined) { - insertedKey = true; - set('inserted'); - } - } - - if (indent && !commaFirst) write('\n' + indentx); - - plainStringify(key); - write(indent ? ' : ' : ':'); - }); - - this.post(function (child) { - if (!child.isLast && !(indent && commaFirst)) { - write(','); - } - - if (child.isLast && deleted.length) { - if (insertedKey) unset('inserted'); - insertedKey = false; - } - else if (insertedKey) { - unset('inserted'); - insertedKey = false; - } - - var prev = prevNode && prevNode[child.key]; - if (indent && opts.comment && child.node !== prev - && (typeof child.node !== 'object' || typeof prev !== 'object') - ) { - set('comment'); - write(' // != '); - traverse(prev).forEach(function (x) { - plainStringify.call(this, x, { indent : 0 }); - }); - unset('comment'); - } - - if (child.isLast && deleted.length) { - if (insertedKey) unset('inserted'); - insertedKey = false; - - if (indent && commaFirst) { - write('\n' + indentx + ', ') - } - else if (opts.comment && indent) { - write('\n' + indentx); - } - else if (indent) { - write(',\n' + indentx); - } - else write(','); - } - else { - if (!child.isLast) { - if (indent && commaFirst) { - write('\n' + indentx + ', '); - } - } - } - }); - - this.after(function () { - if (inserted) unset('inserted'); - - if (deleted.length) { - if (indent && !commaFirst - && Object.keys(node).length === 0) { - write('\n' + indentx); - } - - set('deleted'); - deleted.forEach(function (key, ix) { - if (indent && opts.comment) { - unset('deleted'); - set('comment'); - write('// '); - unset('comment'); - set('deleted'); - } - - plainStringify(key); - write(indent ? ' : ' : ':'); - traverse(prevNode[key]).forEach(function (x) { - plainStringify.call(this, x, { indent : 0 }); - }); - - var last = ix === deleted.length - 1; - if (insertable && !last) { - if (indent && commaFirst) { - write('\n' + indentx + ', '); - } - else if (indent) { - write(',\n' + indentx); - } - else write(','); - } - }); - unset('deleted'); - } - - if (commaFirst && indent) { - write(indentx.slice(indent) + ' }'); - } - else if (indent) { - write('\n' + indentx.slice(indent) + '}'); - } - else write('}'); - }); - } - else { - var changed = false; - - if (inserted) set('inserted'); - else if (insertable && !deepEqual(prevNode, node)) { - changed = true; - set('updated'); - } - - if (typeof node === 'string') { - write('"' + node.toString().replace(/"/g, '\\"') + '"'); - } - else if (isRegExp(node)) { - write(node.toString()); - } - else if (typeof node === 'function') { - write(node.name - ? '[Function: ' + node.name + ']' - : '[Function]' - ); - } - else if (node === undefined) { - write('undefined'); - } - else if (node === null) { - write('null'); - } - else { - write(node.toString()); - } - - if (inserted) unset('inserted'); - else if (changed) unset('updated'); - } - } - - if (opts.stream) { - traverse(next).forEach(stringify); - } - else process.nextTick(function () { - traverse(next).forEach(stringify); - stream.emit('end'); - }); - - return stream; -} - -function isRegExp (node) { - return node instanceof RegExp || (node - && typeof node.test === 'function' - && typeof node.exec === 'function' - && typeof node.compile === 'function' - && node.constructor && node.constructor.name === 'RegExp' - ); -} diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/README.markdown b/node_modules/tap/node_modules/difflet/node_modules/charm/README.markdown deleted file mode 100644 index a0648ff0..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/README.markdown +++ /dev/null @@ -1,216 +0,0 @@ -charm -===== - -Use -[ansi terminal characters](http://www.termsys.demon.co.uk/vtansi.htm) -to write colors and cursor positions. - -![me lucky charms](http://substack.net/images/charms.png) - -example -======= - -lucky ------ - -````javascript -var charm = require('charm')(); -charm.pipe(process.stdout); -charm.reset(); - -var colors = [ 'red', 'cyan', 'yellow', 'green', 'blue' ]; -var text = 'Always after me lucky charms.'; - -var offset = 0; -var iv = setInterval(function () { - var y = 0, dy = 1; - for (var i = 0; i < 40; i++) { - var color = colors[(i + offset) % colors.length]; - var c = text[(i + offset) % text.length]; - charm - .move(1, dy) - .foreground(color) - .write(c) - ; - y += dy; - if (y <= 0 || y >= 5) dy *= -1; - } - charm.position(0, 1); - offset ++; -}, 150); -```` - -events -====== - -Charm objects pass along the data events from their input stream except for -events generated from querying the terminal device. - -Because charm puts stdin into raw mode, charm emits two special events: "^C" and -"^D" when the user types those combos. It's super convenient with these events -to do: - -````javascript -charm.on('^C', process.exit) -```` - -The above is set on all `charm` streams. If you want to add your own handling for these -special events simply: - -````javascript -charm.removeAllListeners('^C') -charm.on('^C', function () { - // Don't exit. Do some mad science instead. -}) -```` - -methods -======= - -var charm = require('charm')(param or stream, ...) --------------------------------------------------- - -Create a new readable/writable `charm` stream. - -You can pass in readable or writable streams as parameters and they will be -piped to or from accordingly. You can also pass `process` in which case -`process.stdin` and `process.stdout` will be used. - -You can `pipe()` to and from the `charm` object you get back. - -charm.reset() -------------- - -Reset the entire screen, like the /usr/bin/reset command. - -charm.destroy(), charm.end() ----------------------------- - -Emit an `"end"` event downstream. - -charm.write(msg) ----------------- - -Pass along `msg` to the output stream. - -charm.position(x, y) --------------------- - -Set the cursor position to the absolute coordinates `x, y`. - -charm.position(cb) ------------------- - -Query the absolute cursor position from the input stream through the output -stream (the shell does this automatically) and get the response back as -`cb(x, y)`. - -charm.move(x, y) ----------------- - -Move the cursor position by the relative coordinates `x, y`. - -charm.up(y) ------------ - -Move the cursor up by `y` rows. - -charm.down(y) -------------- - -Move the cursor down by `y` rows. - -charm.left(x) -------------- - -Move the cursor left by `x` columns. - -charm.right(x) --------------- - -Move the cursor right by `x` columns. - -charm.push(withAttributes=false) --------------------------------- - -Push the cursor state and optionally the attribute state. - -charm.pop(withAttributes=false) -------------------------------- - -Pop the cursor state and optionally the attribute state. - -charm.erase(s) --------------- - -Erase a region defined by the string `s`. - -`s` can be: - -* end - erase from the cursor to the end of the line -* start - erase from the cursor to the start of the line -* line - erase the current line -* down - erase everything below the current line -* up - erase everything above the current line -* screen - erase the entire screen - -charm.display(attr) -------------------- - -Set the display mode with the string `attr`. - -`attr` can be: - -* reset -* bright -* dim -* underscore -* blink -* reverse -* hidden - -charm.foreground(color) ------------------------ - -Set the foreground color with the string `color`, which can be: - -* red -* yellow -* green -* blue -* cyan -* magenta -* black -* white - -or `color` can be an integer from 0 to 255, inclusive. - -charm.background(color) ------------------------ - -Set the background color with the string `color`, which can be: - -* red -* yellow -* green -* blue -* cyan -* magenta -* black -* white - -or `color` can be an integer from 0 to 255, inclusive. - -charm.cursor(visible) ---------------------- - -Set the cursor visibility with a boolean `visible`. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install charm -``` diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/example/256.js b/node_modules/tap/node_modules/difflet/node_modules/charm/example/256.js deleted file mode 100644 index 68513867..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/example/256.js +++ /dev/null @@ -1,17 +0,0 @@ -var charm = require('../')(process); - -function exit () { - charm.display('reset'); - process.exit(); -} -charm.on('^C', exit); - -var ix = 0; -var iv = setInterval(function () { - charm.background(ix++).write(' '); - if (ix === 256) { - clearInterval(iv); - charm.write('\n'); - exit(); - } -}, 10); diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/example/column.js b/node_modules/tap/node_modules/difflet/node_modules/charm/example/column.js deleted file mode 100644 index 2647e71c..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/example/column.js +++ /dev/null @@ -1,11 +0,0 @@ -var charm = require('../')(); -charm.pipe(process.stdout); - -charm - .column(16) - .write('beep') - .down() - .column(32) - .write('boop\n') - .end() -; diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/example/cursor.js b/node_modules/tap/node_modules/difflet/node_modules/charm/example/cursor.js deleted file mode 100644 index 0c565b06..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/example/cursor.js +++ /dev/null @@ -1,22 +0,0 @@ -var charm = require('../')(process); - -charm.position(5, 10); - -charm.position(function (x, y) { - console.dir([ x, y ]); - - charm.move(7,2); - charm.push(); - process.stdout.write('lul'); - - charm.left(3).up(1).foreground('magenta'); - process.stdout.write('v'); - charm.left(1).up(1).display('reset'); - process.stdout.write('|'); - - charm.down(3); - charm.pop().background('blue'); - process.stdout.write('popped\npow'); - charm.display('reset').erase('line'); - charm.destroy(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/example/http_spin.js b/node_modules/tap/node_modules/difflet/node_modules/charm/example/http_spin.js deleted file mode 100644 index 727e3e83..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/example/http_spin.js +++ /dev/null @@ -1,36 +0,0 @@ -var http = require('http'); -var charmer = require('../'); - -http.createServer(function (req, res) { - res.setHeader('content-type', 'text/ansi'); - - var charm = charmer(); - charm.pipe(res); - charm.reset(); - - var radius = 10; - var theta = 0; - var points = []; - - var iv = setInterval(function () { - var x = 2 + (radius + Math.cos(theta) * radius) * 2; - var y = 2 + radius + Math.sin(theta) * radius; - - points.unshift([ x, y ]); - var colors = [ 'red', 'yellow', 'green', 'cyan', 'blue', 'magenta' ]; - - points.forEach(function (p, i) { - charm.position(p[0], p[1]); - var c = colors[Math.floor(i / 12)]; - charm.background(c).write(' ') - }); - points = points.slice(0, 12 * colors.length - 1); - - theta += Math.PI / 40; - }, 50); - - req.connection.on('end', function () { - clearInterval(iv); - charm.end(); - }); -}).listen(8081); diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/example/lucky.js b/node_modules/tap/node_modules/difflet/node_modules/charm/example/lucky.js deleted file mode 100644 index 01fe8017..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/example/lucky.js +++ /dev/null @@ -1,24 +0,0 @@ -var charm = require('../')(); -charm.pipe(process.stdout); -charm.reset(); - -var colors = [ 'red', 'cyan', 'yellow', 'green', 'blue' ]; -var text = 'Always after me lucky charms.'; - -var offset = 0; -var iv = setInterval(function () { - var y = 0, dy = 1; - for (var i = 0; i < 40; i++) { - var color = colors[(i + offset) % colors.length]; - var c = text[(i + offset) % text.length]; - charm - .move(1, dy) - .foreground(color) - .write(c) - ; - y += dy; - if (y <= 0 || y >= 5) dy *= -1; - } - charm.position(0, 1); - offset ++; -}, 150); diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/example/position.js b/node_modules/tap/node_modules/difflet/node_modules/charm/example/position.js deleted file mode 100644 index 2c5ae9b7..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/example/position.js +++ /dev/null @@ -1,7 +0,0 @@ -var charm = require('charm')(process); - -charm.on('^C', process.exit); - -charm.position(function (x, y) { - console.log('(%d, %d)', x, y); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/example/progress.js b/node_modules/tap/node_modules/difflet/node_modules/charm/example/progress.js deleted file mode 100644 index 9da3c134..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/example/progress.js +++ /dev/null @@ -1,18 +0,0 @@ -var charm = require('../')(); -charm.pipe(process.stdout); - -charm.write('Progress: 0 %'); -var i = 0; - -var iv = setInterval(function () { - charm.left(i.toString().length + 2); - i ++; - charm.write(i + ' %'); - if (i === 100) { - charm.end('\nDone!\n'); - clearInterval(iv); - } -}, 25); - -charm.on('^C',process.exit); - diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/example/resize.js b/node_modules/tap/node_modules/difflet/node_modules/charm/example/resize.js deleted file mode 100644 index bda80b6e..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/example/resize.js +++ /dev/null @@ -1,62 +0,0 @@ -var c = require('../')(); -c.pipe(process.stdout); -c.on('^C', process.exit); - -var queue = (function () { - var tasks = []; - var pending = false; - - return { - abort : function () { - tasks = []; - next(); - }, - push : function (t) { - tasks.push(t); - if (!pending) next(); - } - }; - - function next () { - pending = true; - process.nextTick(function () { - if (tasks.length === 0) return; - var t = tasks.shift(); - t(); - pending = false; - next(); - }); - } -})(); - -process.stdout.on('resize', draw); -draw(); -setInterval(function () {}, 1e8); - -function draw () { - var cols = process.stdout.columns; - var rows = process.stdout.rows; - queue.abort(); - - queue.push(function () { - c.reset(); - c.background('blue'); - c.position(1, 1); - c.write(Array(cols + 1).join(' ')); - }); - - for (var y = 1; y < rows; y++) { - queue.push(function () { - c.position(1, y); - c.write(' '); - c.position(cols, y); - c.write(' '); - }); - } - - queue.push(function () { - c.position(1, rows); - c.write(Array(cols + 1).join(' ')); - c.display('reset'); - }); -} diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/example/spin.js b/node_modules/tap/node_modules/difflet/node_modules/charm/example/spin.js deleted file mode 100644 index fd3e23a0..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/example/spin.js +++ /dev/null @@ -1,23 +0,0 @@ -var charm = require('../')(process); -charm.reset(); - -var radius = 10; -var theta = 0; -var points = []; - -var iv = setInterval(function () { - var x = 2 + (radius + Math.cos(theta) * radius) * 2; - var y = 2 + radius + Math.sin(theta) * radius; - - points.unshift([ x, y ]); - var colors = [ 'red', 'yellow', 'green', 'cyan', 'blue', 'magenta' ]; - - points.forEach(function (p, i) { - charm.position(p[0], p[1]); - var c = colors[Math.floor(i / 12)]; - charm.background(c).write(' ') - }); - points = points.slice(0, 12 * colors.length - 1); - - theta += Math.PI / 40; -}, 50); diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/index.js b/node_modules/tap/node_modules/difflet/node_modules/charm/index.js deleted file mode 100644 index e1e7bdce..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/index.js +++ /dev/null @@ -1,305 +0,0 @@ -var tty = require('tty'); -var encode = require('./lib/encode'); -var Stream = require('stream').Stream; - -var exports = module.exports = function () { - var input = null; - function setInput (s) { - if (input) throw new Error('multiple inputs specified') - else input = s - } - - var output = null; - function setOutput (s) { - if (output) throw new Error('multiple outputs specified') - else output = s - } - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; - if (arg.readable) setInput(arg) - else if (arg.stdin || arg.input) setInput(arg.stdin || arg.input) - - if (arg.writable) setOutput(arg) - else if (arg.stdout || arg.output) setOutput(arg.stdout || arg.output) - - } - - if (input && typeof input.fd === 'number' && tty.isatty(input.fd)) { - if (process.stdin.setRawMode) { - process.stdin.setRawMode(true); - } - else tty.setRawMode(true); - } - - var charm = new Charm; - if (input) { - input.pipe(charm); - } - - if (output) { - charm.pipe(output); - } - - charm.once('^C', process.exit); - charm.once('end', function () { - if (input) { - if (typeof input.fd === 'number' && tty.isatty(input.fd)) { - if (process.stdin.setRawMode) { - process.stdin.setRawMode(false); - } - else tty.setRawMode(false); - } - input.destroy(); - } - }); - - return charm; -}; - -var Charm = exports.Charm = function Charm () { - this.writable = true; - this.readable = true; - this.pending = []; -} - -Charm.prototype = new Stream; - -Charm.prototype.write = function (buf) { - var self = this; - - if (self.pending.length) { - var codes = extractCodes(buf); - var matched = false; - - for (var i = 0; i < codes.length; i++) { - for (var j = 0; j < self.pending.length; j++) { - var cb = self.pending[j]; - if (cb(codes[i])) { - matched = true; - self.pending.splice(j, 1); - break; - } - } - } - - if (matched) return; - } - - if (buf.length === 1) { - if (buf[0] === 3) self.emit('^C'); - if (buf[0] === 4) self.emit('^D'); - } - - self.emit('data', buf); - - return self; -}; - - -Charm.prototype.destroy = function () { - this.end(); -}; - -Charm.prototype.end = function (buf) { - if (buf) this.write(buf); - this.emit('end'); -}; - -Charm.prototype.reset = function (cb) { - this.write(encode('c')); - return this; -}; - -Charm.prototype.position = function (x, y) { - // get/set absolute coordinates - if (typeof x === 'function') { - var cb = x; - this.pending.push(function (buf) { - if (buf[0] === 27 && buf[1] === encode.ord('[') - && buf[buf.length-1] === encode.ord('R')) { - var pos = buf.toString() - .slice(2,-1) - .split(';') - .map(Number) - ; - cb(pos[1], pos[0]); - return true; - } - }); - this.write(encode('[6n')); - } - else { - this.write(encode( - '[' + Math.floor(y) + ';' + Math.floor(x) + 'f' - )); - } - return this; -}; - -Charm.prototype.move = function (x, y) { - // set relative coordinates - var bufs = []; - - if (y < 0) this.up(-y) - else if (y > 0) this.down(y) - - if (x > 0) this.right(x) - else if (x < 0) this.left(-x) - - return this; -}; - -Charm.prototype.up = function (y) { - if (y === undefined) y = 1; - this.write(encode('[' + Math.floor(y) + 'A')); - return this; -}; - -Charm.prototype.down = function (y) { - if (y === undefined) y = 1; - this.write(encode('[' + Math.floor(y) + 'B')); - return this; -}; - -Charm.prototype.right = function (x) { - if (x === undefined) x = 1; - this.write(encode('[' + Math.floor(x) + 'C')); - return this; -}; - -Charm.prototype.left = function (x) { - if (x === undefined) x = 1; - this.write(encode('[' + Math.floor(x) + 'D')); - return this; -}; - -Charm.prototype.column = function (x) { - this.write(encode('[' + Math.floor(x) + 'G')); - return this; -}; - -Charm.prototype.push = function (withAttributes) { - this.write(encode(withAttributes ? '7' : '[s')); - return this; -}; - -Charm.prototype.pop = function (withAttributes) { - this.write(encode(withAttributes ? '8' : '[u')); - return this; -}; - -Charm.prototype.erase = function (s) { - if (s === 'end' || s === '$') { - this.write(encode('[K')); - } - else if (s === 'start' || s === '^') { - this.write(encode('[1K')); - } - else if (s === 'line') { - this.write(encode('[2K')); - } - else if (s === 'down') { - this.write(encode('[J')); - } - else if (s === 'up') { - this.write(encode('[1J')); - } - else if (s === 'screen') { - this.write(encode('[1J')); - } - else { - this.emit('error', new Error('Unknown erase type: ' + s)); - } - return this; -}; - -Charm.prototype.display = function (attr) { - var c = { - reset : 0, - bright : 1, - dim : 2, - underscore : 4, - blink : 5, - reverse : 7, - hidden : 8 - }[attr]; - if (c === undefined) { - this.emit('error', new Error('Unknown attribute: ' + attr)); - } - this.write(encode('[' + c + 'm')); - return this; -}; - -Charm.prototype.foreground = function (color) { - if (typeof color === 'number') { - if (color < 0 || color >= 256) { - this.emit('error', new Error('Color out of range: ' + color)); - } - this.write(encode('[38;5;' + color + 'm')); - } - else { - var c = { - black : 30, - red : 31, - green : 32, - yellow : 33, - blue : 34, - magenta : 35, - cyan : 36, - white : 37 - }[color.toLowerCase()]; - - if (!c) this.emit('error', new Error('Unknown color: ' + color)); - this.write(encode('[' + c + 'm')); - } - return this; -}; - -Charm.prototype.background = function (color) { - if (typeof color === 'number') { - if (color < 0 || color >= 256) { - this.emit('error', new Error('Color out of range: ' + color)); - } - this.write(encode('[48;5;' + color + 'm')); - } - else { - var c = { - black : 40, - red : 41, - green : 42, - yellow : 43, - blue : 44, - magenta : 45, - cyan : 46, - white : 47 - }[color.toLowerCase()]; - - if (!c) this.emit('error', new Error('Unknown color: ' + color)); - this.write(encode('[' + c + 'm')); - } - return this; -}; - -Charm.prototype.cursor = function (visible) { - this.write(encode(visible ? '[?25h' : '[?25l')); - return this; -}; - -var extractCodes = exports.extractCodes = function (buf) { - var codes = []; - var start = -1; - - for (var i = 0; i < buf.length; i++) { - if (buf[i] === 27) { - if (start >= 0) codes.push(buf.slice(start, i)); - start = i; - } - else if (start >= 0 && i === buf.length - 1) { - codes.push(buf.slice(start)); - } - } - - return codes; -} diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/lib/encode.js b/node_modules/tap/node_modules/difflet/node_modules/charm/lib/encode.js deleted file mode 100644 index 3b6417a4..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/lib/encode.js +++ /dev/null @@ -1,18 +0,0 @@ -var encode = module.exports = function (xs) { - function bytes (s) { - if (typeof s === 'string') { - return s.split('').map(ord); - } - else if (Array.isArray(s)) { - return s.reduce(function (acc, c) { - return acc.concat(bytes(c)); - }, []); - } - } - - return new Buffer([ 0x1b ].concat(bytes(xs))); -}; - -var ord = encode.ord = function ord (c) { - return c.charCodeAt(0) -}; diff --git a/node_modules/tap/node_modules/difflet/node_modules/charm/package.json b/node_modules/tap/node_modules/difflet/node_modules/charm/package.json deleted file mode 100644 index 6113f751..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/charm/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "charm", - "version": "0.1.2", - "description": "ansi control sequences for terminal cursor hopping and colors", - "main": "index.js", - "directories": { - "lib": ".", - "example": "example", - "test": "test" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/substack/node-charm.git" - }, - "keywords": [ - "terminal", - "ansi", - "cursor", - "color", - "console", - "control", - "escape", - "sequence" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT/X11", - "engine": { - "node": ">=0.4" - }, - "_id": "charm@0.1.2", - "dist": { - "shasum": "06c21eed1a1b06aeb67553cdc53e23274bac2296", - "tarball": "http://registry.npmjs.org/charm/-/charm-0.1.2.tgz" - }, - "_from": "charm@>=0.1.0 <0.2.0", - "_npmVersion": "1.2.2", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "_shasum": "06c21eed1a1b06aeb67553cdc53e23274bac2296", - "_resolved": "https://registry.npmjs.org/charm/-/charm-0.1.2.tgz", - "bugs": { - "url": "https://github.com/substack/node-charm/issues" - }, - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/substack/node-charm#readme" -} diff --git a/node_modules/tap/node_modules/difflet/node_modules/deep-is/.travis.yml b/node_modules/tap/node_modules/difflet/node_modules/deep-is/.travis.yml deleted file mode 100644 index d523c5f5..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/deep-is/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 - - 0.8 - - 0.10 diff --git a/node_modules/tap/node_modules/difflet/node_modules/deep-is/LICENSE b/node_modules/tap/node_modules/difflet/node_modules/deep-is/LICENSE deleted file mode 100644 index c38f8407..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/deep-is/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012, 2013 Thorsten Lorenz -Copyright (c) 2012 James Halliday -Copyright (c) 2009 Thomas Robinson <280north.com> - -This software is released under the MIT license: - -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/tap/node_modules/difflet/node_modules/deep-is/README.markdown b/node_modules/tap/node_modules/difflet/node_modules/deep-is/README.markdown deleted file mode 100644 index eb69a83b..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/deep-is/README.markdown +++ /dev/null @@ -1,70 +0,0 @@ -deep-is -========== - -Node's `assert.deepEqual() algorithm` as a standalone module. Exactly like -[deep-equal](https://github.com/substack/node-deep-equal) except for the fact that `deepEqual(NaN, NaN) === true`. - -This module is around [5 times faster](https://gist.github.com/2790507) -than wrapping `assert.deepEqual()` in a `try/catch`. - -[![browser support](http://ci.testling.com/thlorenz/deep-is.png)](http://ci.testling.com/thlorenz/deep-is) - -[![build status](https://secure.travis-ci.org/thlorenz/deep-is.png)](http://travis-ci.org/thlorenz/deep-is) - -example -======= - -``` js -var equal = require('deep-is'); -console.dir([ - equal( - { a : [ 2, 3 ], b : [ 4 ] }, - { a : [ 2, 3 ], b : [ 4 ] } - ), - equal( - { x : 5, y : [6] }, - { x : 5, y : 6 } - ) -]); -``` - -methods -======= - -var deepIs = require('deep-is') - -deepIs(a, b) ---------------- - -Compare objects `a` and `b`, returning whether they are equal according to a -recursive equality algorithm. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install deep-is -``` - -test -==== - -With [npm](http://npmjs.org) do: - -``` -npm test -``` - -license -======= - -Copyright (c) 2012, 2013 Thorsten Lorenz -Copyright (c) 2012 James Halliday - -Derived largely from node's assert module, which has the copyright statement: - -Copyright (c) 2009 Thomas Robinson <280north.com> - -Released under the MIT license, see LICENSE for details. diff --git a/node_modules/tap/node_modules/difflet/node_modules/deep-is/example/cmp.js b/node_modules/tap/node_modules/difflet/node_modules/deep-is/example/cmp.js deleted file mode 100644 index 67014b88..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/deep-is/example/cmp.js +++ /dev/null @@ -1,11 +0,0 @@ -var equal = require('../'); -console.dir([ - equal( - { a : [ 2, 3 ], b : [ 4 ] }, - { a : [ 2, 3 ], b : [ 4 ] } - ), - equal( - { x : 5, y : [6] }, - { x : 5, y : 6 } - ) -]); diff --git a/node_modules/tap/node_modules/difflet/node_modules/deep-is/index.js b/node_modules/tap/node_modules/difflet/node_modules/deep-is/index.js deleted file mode 100644 index 506fe279..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/deep-is/index.js +++ /dev/null @@ -1,102 +0,0 @@ -var pSlice = Array.prototype.slice; -var Object_keys = typeof Object.keys === 'function' - ? Object.keys - : function (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; - } -; - -var deepEqual = module.exports = function (actual, expected) { - // enforce Object.is +0 !== -0 - if (actual === 0 && expected === 0) { - return areZerosEqual(actual, expected); - - // 7.1. All identical values are equivalent, as determined by ===. - } else if (actual === expected) { - return true; - - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - } else if (isNumberNaN(actual)) { - return isNumberNaN(expected); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } -}; - -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function isNumberNaN(value) { - // NaN === NaN -> false - return typeof value == 'number' && value !== value; -} - -function areZerosEqual(zeroA, zeroB) { - // (1 / +0|0) -> Infinity, but (1 / -0) -> -Infinity and (Infinity !== -Infinity) - return (1 / zeroA) === (1 / zeroB); -} - -function objEquiv(a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return deepEqual(a, b); - } - try { - var ka = Object_keys(a), - kb = Object_keys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!deepEqual(a[key], b[key])) return false; - } - return true; -} diff --git a/node_modules/tap/node_modules/difflet/node_modules/deep-is/package.json b/node_modules/tap/node_modules/difflet/node_modules/deep-is/package.json deleted file mode 100644 index 62ace0a2..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/deep-is/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "deep-is", - "version": "0.1.3", - "description": "node's assert.deepEqual algorithm except for NaN being equal to NaN", - "main": "index.js", - "directories": { - "lib": ".", - "example": "example", - "test": "test" - }, - "scripts": { - "test": "tape test/*.js" - }, - "devDependencies": { - "tape": "~1.0.2" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/thlorenz/deep-is.git" - }, - "keywords": [ - "equality", - "equal", - "compare" - ], - "author": { - "name": "Thorsten Lorenz", - "email": "thlorenz@gmx.de", - "url": "http://thlorenz.com" - }, - "license": { - "type": "MIT", - "url": "https://github.com/thlorenz/deep-is/blob/master/LICENSE" - }, - "testling": { - "files": "test/*.js", - "browsers": { - "ie": [ - 6, - 7, - 8, - 9 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "chrome": [ - 10, - 22 - ], - "safari": [ - 5.1 - ], - "opera": [ - 12 - ] - } - }, - "gitHead": "f126057628423458636dec9df3d621843b9ac55e", - "bugs": { - "url": "https://github.com/thlorenz/deep-is/issues" - }, - "homepage": "https://github.com/thlorenz/deep-is", - "_id": "deep-is@0.1.3", - "_shasum": "b369d6fb5dbc13eecf524f91b070feedc357cf34", - "_from": "deep-is@>=0.1.0 <0.2.0", - "_npmVersion": "1.4.14", - "_npmUser": { - "name": "thlorenz", - "email": "thlorenz@gmx.de" - }, - "maintainers": [ - { - "name": "thlorenz", - "email": "thlorenz@gmx.de" - } - ], - "dist": { - "shasum": "b369d6fb5dbc13eecf524f91b070feedc357cf34", - "tarball": "http://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz" - }, - "_resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/tap/node_modules/difflet/node_modules/deep-is/test/NaN.js b/node_modules/tap/node_modules/difflet/node_modules/deep-is/test/NaN.js deleted file mode 100644 index ddaa5a77..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/deep-is/test/NaN.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tape'); -var equal = require('../'); - -test('NaN and 0 values', function (t) { - t.ok(equal(NaN, NaN)); - t.notOk(equal(0, NaN)); - t.ok(equal(0, 0)); - t.notOk(equal(0, 1)); - t.end(); -}); - - -test('nested NaN values', function (t) { - t.ok(equal([ NaN, 1, NaN ], [ NaN, 1, NaN ])); - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/deep-is/test/cmp.js b/node_modules/tap/node_modules/difflet/node_modules/deep-is/test/cmp.js deleted file mode 100644 index 30710134..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/deep-is/test/cmp.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require('tape'); -var equal = require('../'); - -test('equal', function (t) { - t.ok(equal( - { a : [ 2, 3 ], b : [ 4 ] }, - { a : [ 2, 3 ], b : [ 4 ] } - )); - t.end(); -}); - -test('not equal', function (t) { - t.notOk(equal( - { x : 5, y : [6] }, - { x : 5, y : 6 } - )); - t.end(); -}); - -test('nested nulls', function (t) { - t.ok(equal([ null, null, null ], [ null, null, null ])); - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/deep-is/test/neg-vs-pos-0.js b/node_modules/tap/node_modules/difflet/node_modules/deep-is/test/neg-vs-pos-0.js deleted file mode 100644 index ac26130e..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/deep-is/test/neg-vs-pos-0.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var equal = require('../'); - -test('0 values', function (t) { - t.ok(equal( 0, 0), ' 0 === 0'); - t.ok(equal( 0, +0), ' 0 === +0'); - t.ok(equal(+0, +0), '+0 === +0'); - t.ok(equal(-0, -0), '-0 === -0'); - - t.notOk(equal(-0, 0), '-0 !== 0'); - t.notOk(equal(-0, +0), '-0 !== +0'); - - t.end(); -}); - diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/.npmignore b/node_modules/tap/node_modules/difflet/node_modules/traverse/.npmignore deleted file mode 100644 index 3c3629e6..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/.travis.yml b/node_modules/tap/node_modules/difflet/node_modules/traverse/.travis.yml deleted file mode 100644 index 2d26206d..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/LICENSE b/node_modules/tap/node_modules/difflet/node_modules/traverse/LICENSE deleted file mode 100644 index 7b75500c..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: -http://www.opensource.org/licenses/mit-license.php - -Copyright 2010 James Halliday (mail@substack.net) - -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/tap/node_modules/difflet/node_modules/traverse/examples/json.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/json.js deleted file mode 100755 index 50d612e3..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/json.js +++ /dev/null @@ -1,16 +0,0 @@ -var traverse = require('traverse'); - -var id = 54; -var callbacks = {}; -var obj = { moo : function () {}, foo : [2,3,4, function () {}] }; - -var scrubbed = traverse(obj).map(function (x) { - if (typeof x === 'function') { - callbacks[id] = { id : id, f : x, path : this.path }; - this.update('[Function]'); - id++; - } -}); - -console.dir(scrubbed); -console.dir(callbacks); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/leaves.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/leaves.js deleted file mode 100755 index c1b310b9..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/leaves.js +++ /dev/null @@ -1,15 +0,0 @@ -var traverse = require('traverse'); - -var obj = { - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 }, -}; - -var leaves = traverse(obj).reduce(function (acc, x) { - if (this.isLeaf) acc.push(x); - return acc; -}, []); - -console.dir(leaves); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/negative.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/negative.js deleted file mode 100755 index 78608a05..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/negative.js +++ /dev/null @@ -1,8 +0,0 @@ -var traverse = require('traverse'); -var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - -traverse(obj).forEach(function (x) { - if (x < 0) this.update(x + 128); -}); - -console.dir(obj); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/scrub.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/scrub.js deleted file mode 100755 index 5d15b916..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/scrub.js +++ /dev/null @@ -1,10 +0,0 @@ -// scrub out circular references -var traverse = require('traverse'); - -var obj = { a : 1, b : 2, c : [ 3, 4 ] }; -obj.c.push(obj); - -var scrubbed = traverse(obj).map(function (x) { - if (this.circular) this.remove() -}); -console.dir(scrubbed); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/stringify.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/stringify.js deleted file mode 100755 index 167b68b2..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/examples/stringify.js +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env node -var traverse = require('traverse'); - -var obj = [ 'five', 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - -var s = ''; -traverse(obj).forEach(function to_s (node) { - if (Array.isArray(node)) { - this.before(function () { s += '[' }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += ']' }); - } - else if (typeof node == 'object') { - this.before(function () { s += '{' }); - this.pre(function (x, key) { - to_s(key); - s += ':'; - }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += '}' }); - } - else if (typeof node == 'string') { - s += '"' + node.toString().replace(/"/g, '\\"') + '"'; - } - else if (typeof node == 'function') { - s += 'null'; - } - else { - s += node.toString(); - } -}); - -console.log('JSON.stringify: ' + JSON.stringify(obj)); -console.log('this stringify: ' + s); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/index.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/index.js deleted file mode 100644 index 2f2cf673..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/index.js +++ /dev/null @@ -1,314 +0,0 @@ -var traverse = module.exports = function (obj) { - return new Traverse(obj); -}; - -function Traverse (obj) { - this.value = obj; -} - -Traverse.prototype.get = function (ps) { - var node = this.value; - for (var i = 0; i < ps.length; i ++) { - var key = ps[i]; - if (!node || !hasOwnProperty.call(node, key)) { - node = undefined; - break; - } - node = node[key]; - } - return node; -}; - -Traverse.prototype.has = function (ps) { - var node = this.value; - for (var i = 0; i < ps.length; i ++) { - var key = ps[i]; - if (!node || !hasOwnProperty.call(node, key)) { - return false; - } - node = node[key]; - } - return true; -}; - -Traverse.prototype.set = function (ps, value) { - var node = this.value; - for (var i = 0; i < ps.length - 1; i ++) { - var key = ps[i]; - if (!hasOwnProperty.call(node, key)) node[key] = {}; - node = node[key]; - } - node[ps[i]] = value; - return value; -}; - -Traverse.prototype.map = function (cb) { - return walk(this.value, cb, true); -}; - -Traverse.prototype.forEach = function (cb) { - this.value = walk(this.value, cb, false); - return this.value; -}; - -Traverse.prototype.reduce = function (cb, init) { - var skip = arguments.length === 1; - var acc = skip ? this.value : init; - this.forEach(function (x) { - if (!this.isRoot || !skip) { - acc = cb.call(this, acc, x); - } - }); - return acc; -}; - -Traverse.prototype.paths = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.path); - }); - return acc; -}; - -Traverse.prototype.nodes = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.node); - }); - return acc; -}; - -Traverse.prototype.clone = function () { - var parents = [], nodes = []; - - return (function clone (src) { - for (var i = 0; i < parents.length; i++) { - if (parents[i] === src) { - return nodes[i]; - } - } - - if (typeof src === 'object' && src !== null) { - var dst = copy(src); - - parents.push(src); - nodes.push(dst); - - forEach(objectKeys(src), function (key) { - dst[key] = clone(src[key]); - }); - - parents.pop(); - nodes.pop(); - return dst; - } - else { - return src; - } - })(this.value); -}; - -function walk (root, cb, immutable) { - var path = []; - var parents = []; - var alive = true; - - return (function walker (node_) { - var node = immutable ? copy(node_) : node_; - var modifiers = {}; - - var keepGoing = true; - - var state = { - node : node, - node_ : node_, - path : [].concat(path), - parent : parents[parents.length - 1], - parents : parents, - key : path.slice(-1)[0], - isRoot : path.length === 0, - level : path.length, - circular : null, - update : function (x, stopHere) { - if (!state.isRoot) { - state.parent.node[state.key] = x; - } - state.node = x; - if (stopHere) keepGoing = false; - }, - 'delete' : function (stopHere) { - delete state.parent.node[state.key]; - if (stopHere) keepGoing = false; - }, - remove : function (stopHere) { - if (isArray(state.parent.node)) { - state.parent.node.splice(state.key, 1); - } - else { - delete state.parent.node[state.key]; - } - if (stopHere) keepGoing = false; - }, - keys : null, - before : function (f) { modifiers.before = f }, - after : function (f) { modifiers.after = f }, - pre : function (f) { modifiers.pre = f }, - post : function (f) { modifiers.post = f }, - stop : function () { alive = false }, - block : function () { keepGoing = false } - }; - - if (!alive) return state; - - function updateState() { - if (typeof state.node === 'object' && state.node !== null) { - if (!state.keys || state.node_ !== state.node) { - state.keys = objectKeys(state.node) - } - - state.isLeaf = state.keys.length == 0; - - for (var i = 0; i < parents.length; i++) { - if (parents[i].node_ === node_) { - state.circular = parents[i]; - break; - } - } - } - else { - state.isLeaf = true; - state.keys = null; - } - - state.notLeaf = !state.isLeaf; - state.notRoot = !state.isRoot; - } - - updateState(); - - // use return values to update if defined - var ret = cb.call(state, state.node); - if (ret !== undefined && state.update) state.update(ret); - - if (modifiers.before) modifiers.before.call(state, state.node); - - if (!keepGoing) return state; - - if (typeof state.node == 'object' - && state.node !== null && !state.circular) { - parents.push(state); - - updateState(); - - forEach(state.keys, function (key, i) { - path.push(key); - - if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); - - var child = walker(state.node[key]); - if (immutable && hasOwnProperty.call(state.node, key)) { - state.node[key] = child.node; - } - - child.isLast = i == state.keys.length - 1; - child.isFirst = i == 0; - - if (modifiers.post) modifiers.post.call(state, child); - - path.pop(); - }); - parents.pop(); - } - - if (modifiers.after) modifiers.after.call(state, state.node); - - return state; - })(root).node; -} - -function copy (src) { - if (typeof src === 'object' && src !== null) { - var dst; - - if (isArray(src)) { - dst = []; - } - else if (isDate(src)) { - dst = new Date(src.getTime ? src.getTime() : src); - } - else if (isRegExp(src)) { - dst = new RegExp(src); - } - else if (isError(src)) { - dst = { message: src.message }; - } - else if (isBoolean(src)) { - dst = new Boolean(src); - } - else if (isNumber(src)) { - dst = new Number(src); - } - else if (isString(src)) { - dst = new String(src); - } - else if (Object.create && Object.getPrototypeOf) { - dst = Object.create(Object.getPrototypeOf(src)); - } - else if (src.constructor === Object) { - dst = {}; - } - else { - var proto = - (src.constructor && src.constructor.prototype) - || src.__proto__ - || {} - ; - var T = function () {}; - T.prototype = proto; - dst = new T; - } - - forEach(objectKeys(src), function (key) { - dst[key] = src[key]; - }); - return dst; - } - else return src; -} - -var objectKeys = Object.keys || function keys (obj) { - var res = []; - for (var key in obj) res.push(key) - return res; -}; - -function toS (obj) { return Object.prototype.toString.call(obj) } -function isDate (obj) { return toS(obj) === '[object Date]' } -function isRegExp (obj) { return toS(obj) === '[object RegExp]' } -function isError (obj) { return toS(obj) === '[object Error]' } -function isBoolean (obj) { return toS(obj) === '[object Boolean]' } -function isNumber (obj) { return toS(obj) === '[object Number]' } -function isString (obj) { return toS(obj) === '[object String]' } - -var isArray = Array.isArray || function isArray (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - -var forEach = function (xs, fn) { - if (xs.forEach) return xs.forEach(fn) - else for (var i = 0; i < xs.length; i++) { - fn(xs[i], i, xs); - } -}; - -forEach(objectKeys(Traverse.prototype), function (key) { - traverse[key] = function (obj) { - var args = [].slice.call(arguments, 1); - var t = new Traverse(obj); - return t[key].apply(t, args); - }; -}); - -var hasOwnProperty = Object.hasOwnProperty || function (obj, key) { - return key in obj; -}; diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/package.json b/node_modules/tap/node_modules/difflet/node_modules/traverse/package.json deleted file mode 100644 index be786deb..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "traverse", - "version": "0.6.6", - "description": "traverse and transform objects by visiting every node on a recursive walk", - "main": "index.js", - "directories": { - "example": "example", - "test": "test" - }, - "devDependencies": { - "tape": "~1.0.4" - }, - "scripts": { - "test": "tape test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": { - "iexplore": [ - "6.0", - "7.0", - "8.0", - "9.0" - ], - "chrome": [ - "10.0", - "20.0" - ], - "firefox": [ - "10.0", - "15.0" - ], - "safari": [ - "5.1" - ], - "opera": [ - "12.0" - ] - } - }, - "repository": { - "type": "git", - "url": "git://github.com/substack/js-traverse.git" - }, - "homepage": "https://github.com/substack/js-traverse", - "keywords": [ - "traverse", - "walk", - "recursive", - "map", - "forEach", - "deep", - "clone" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/substack/js-traverse/issues" - }, - "_id": "traverse@0.6.6", - "dist": { - "shasum": "cbdf560fd7b9af632502fed40f918c157ea97137", - "tarball": "http://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz" - }, - "_from": "traverse@>=0.6.0 <0.7.0", - "_npmVersion": "1.3.7", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "_shasum": "cbdf560fd7b9af632502fed40f918c157ea97137", - "_resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/readme.markdown b/node_modules/tap/node_modules/difflet/node_modules/traverse/readme.markdown deleted file mode 100644 index fbfd06e2..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/readme.markdown +++ /dev/null @@ -1,209 +0,0 @@ -# traverse - -Traverse and transform objects by visiting every node on a recursive walk. - -[![browser support](http://ci.testling.com/substack/js-traverse.png)](http://ci.testling.com/substack/js-traverse) - -[![build status](https://secure.travis-ci.org/substack/js-traverse.png)](http://travis-ci.org/substack/js-traverse) - -# examples - -## transform negative numbers in-place - -negative.js - -````javascript -var traverse = require('traverse'); -var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - -traverse(obj).forEach(function (x) { - if (x < 0) this.update(x + 128); -}); - -console.dir(obj); -```` - -Output: - - [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ] - -## collect leaf nodes - -leaves.js - -````javascript -var traverse = require('traverse'); - -var obj = { - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 }, -}; - -var leaves = traverse(obj).reduce(function (acc, x) { - if (this.isLeaf) acc.push(x); - return acc; -}, []); - -console.dir(leaves); -```` - -Output: - - [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] - -## scrub circular references - -scrub.js: - -````javascript -var traverse = require('traverse'); - -var obj = { a : 1, b : 2, c : [ 3, 4 ] }; -obj.c.push(obj); - -var scrubbed = traverse(obj).map(function (x) { - if (this.circular) this.remove() -}); -console.dir(scrubbed); -```` - -output: - - { a: 1, b: 2, c: [ 3, 4 ] } - -# methods - -Each method that takes an `fn` uses the context documented below in the context -section. - -## .map(fn) - -Execute `fn` for each node in the object and return a new object with the -results of the walk. To update nodes in the result use `this.update(value)`. - -## .forEach(fn) - -Execute `fn` for each node in the object but unlike `.map()`, when -`this.update()` is called it updates the object in-place. - -## .reduce(fn, acc) - -For each node in the object, perform a -[left-fold](http://en.wikipedia.org/wiki/Fold_(higher-order_function)) -with the return value of `fn(acc, node)`. - -If `acc` isn't specified, `acc` is set to the root object for the first step -and the root element is skipped. - -## .paths() - -Return an `Array` of every possible non-cyclic path in the object. -Paths are `Array`s of string keys. - -## .nodes() - -Return an `Array` of every node in the object. - -## .clone() - -Create a deep clone of the object. - -## .get(path) - -Get the element at the array `path`. - -## .set(path, value) - -Set the element at the array `path` to `value`. - -## .has(path) - -Return whether the element at the array `path` exists. - -# context - -Each method that takes a callback has a context (its `this` object) with these -attributes: - -## this.node - -The present node on the recursive walk - -## this.path - -An array of string keys from the root to the present node - -## this.parent - -The context of the node's parent. -This is `undefined` for the root node. - -## this.key - -The name of the key of the present node in its parent. -This is `undefined` for the root node. - -## this.isRoot, this.notRoot - -Whether the present node is the root node - -## this.isLeaf, this.notLeaf - -Whether or not the present node is a leaf node (has no children) - -## this.level - -Depth of the node within the traversal - -## this.circular - -If the node equals one of its parents, the `circular` attribute is set to the -context of that parent and the traversal progresses no deeper. - -## this.update(value, stopHere=false) - -Set a new value for the present node. - -All the elements in `value` will be recursively traversed unless `stopHere` is -true. - -## this.remove(stopHere=false) - -Remove the current element from the output. If the node is in an Array it will -be spliced off. Otherwise it will be deleted from its parent. - -## this.delete(stopHere=false) - -Delete the current element from its parent in the output. Calls `delete` even on -Arrays. - -## this.before(fn) - -Call this function before any of the children are traversed. - -You can assign into `this.keys` here to traverse in a custom order. - -## this.after(fn) - -Call this function after any of the children are traversed. - -## this.pre(fn) - -Call this function before each of the children are traversed. - -## this.post(fn) - -Call this function after each of the children are traversed. - - -# install - -Using [npm](http://npmjs.org) do: - - $ npm install traverse - -# license - -MIT diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/circular.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/circular.js deleted file mode 100644 index f56506a2..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/circular.js +++ /dev/null @@ -1,117 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); -var deepEqual = require('./lib/deep_equal'); -var util = require('util'); - -test('circular', function (t) { - t.plan(1); - - var obj = { x : 3 }; - obj.y = obj; - traverse(obj).forEach(function (x) { - if (this.path.join('') == 'y') { - t.equal( - util.inspect(this.circular.node), - util.inspect(obj) - ); - } - }); -}); - -test('deepCirc', function (t) { - t.plan(2); - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - - var times = 0; - traverse(obj).forEach(function (x) { - if (this.circular) { - t.same(this.circular.path, []); - t.same(this.path, [ 'y', 2 ]); - } - }); -}); - -test('doubleCirc', function (t) { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - var circs = []; - traverse(obj).forEach(function (x) { - if (this.circular) { - circs.push({ circ : this.circular, self : this, node : x }); - } - }); - - t.same(circs[0].self.path, [ 'x', 3, 2 ]); - t.same(circs[0].circ.path, []); - - t.same(circs[1].self.path, [ 'y', 2 ]); - t.same(circs[1].circ.path, []); - - t.same(circs.length, 2); - t.end(); -}); - -test('circDubForEach', function (t) { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - traverse(obj).forEach(function (x) { - if (this.circular) this.update('...'); - }); - - t.same(obj, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] }); - t.end(); -}); - -test('circDubMap', function (t) { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - var c = traverse(obj).map(function (x) { - if (this.circular) { - this.update('...'); - } - }); - - t.same(c, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] }); - t.end(); -}); - -test('circClone', function (t) { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - var clone = traverse.clone(obj); - t.ok(obj !== clone); - - t.ok(clone.y[2] === clone); - t.ok(clone.y[2] !== obj); - t.ok(clone.x[3][2] === clone); - t.ok(clone.x[3][2] !== obj); - t.same(clone.x.slice(0,3), [1,2,3]); - t.same(clone.y.slice(0,2), [4,5]); - t.end(); -}); - -test('circMapScrub', function (t) { - var obj = { a : 1, b : 2 }; - obj.c = obj; - - var scrubbed = traverse(obj).map(function (node) { - if (this.circular) this.remove(); - }); - t.same( - Object.keys(scrubbed).sort(), - [ 'a', 'b' ] - ); - t.ok(deepEqual(scrubbed, { a : 1, b : 2 })); - - t.equal(obj.c, obj); - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/date.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/date.js deleted file mode 100644 index 54db4b0a..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/date.js +++ /dev/null @@ -1,37 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); - -test('dateEach', function (t) { - var obj = { x : new Date, y : 10, z : 5 }; - - var counts = {}; - - traverse(obj).forEach(function (node) { - var t = (node instanceof Date && 'Date') || typeof node; - counts[t] = (counts[t] || 0) + 1; - }); - - t.same(counts, { - object : 1, - Date : 1, - number : 2, - }); - t.end(); -}); - -test('dateMap', function (t) { - var obj = { x : new Date, y : 10, z : 5 }; - - var res = traverse(obj).map(function (node) { - if (typeof node === 'number') this.update(node + 100); - }); - - t.ok(obj.x !== res.x); - t.same(res, { - x : obj.x, - y : 110, - z : 105, - }); - t.end(); -}); - diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/equal.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/equal.js deleted file mode 100644 index fd0463cc..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/equal.js +++ /dev/null @@ -1,240 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); -var deepEqual = require('./lib/deep_equal'); - -test('deepDates', function (t) { - t.plan(2); - - t.ok( - deepEqual( - { d : new Date, x : [ 1, 2, 3 ] }, - { d : new Date, x : [ 1, 2, 3 ] } - ), - 'dates should be equal' - ); - - var d0 = new Date; - setTimeout(function () { - t.ok( - !deepEqual( - { d : d0, x : [ 1, 2, 3 ], }, - { d : new Date, x : [ 1, 2, 3 ] } - ), - 'microseconds should count in date equality' - ); - }, 5); -}); - -test('deepCircular', function (t) { - var a = [1]; - a.push(a); // a = [ 1, *a ] - - var b = [1]; - b.push(a); // b = [ 1, [ 1, *a ] ] - - t.ok( - !deepEqual(a, b), - 'circular ref mount points count towards equality' - ); - - var c = [1]; - c.push(c); // c = [ 1, *c ] - t.ok( - deepEqual(a, c), - 'circular refs are structurally the same here' - ); - - var d = [1]; - d.push(a); // c = [ 1, [ 1, *d ] ] - t.ok( - deepEqual(b, d), - 'non-root circular ref structural comparison' - ); - - t.end(); -}); - -test('deepInstances', function (t) { - t.ok( - !deepEqual([ new Boolean(false) ], [ false ]), - 'boolean instances are not real booleans' - ); - - t.ok( - !deepEqual([ new String('x') ], [ 'x' ]), - 'string instances are not real strings' - ); - - t.ok( - !deepEqual([ new Number(4) ], [ 4 ]), - 'number instances are not real numbers' - ); - - t.ok( - deepEqual([ new RegExp('x') ], [ /x/ ]), - 'regexp instances are real regexps' - ); - - t.ok( - !deepEqual([ new RegExp(/./) ], [ /../ ]), - 'these regexps aren\'t the same' - ); - - t.ok( - !deepEqual( - [ function (x) { return x * 2 } ], - [ function (x) { return x * 2 } ] - ), - 'functions with the same .toString() aren\'t necessarily the same' - ); - - var f = function (x) { return x * 2 }; - t.ok( - deepEqual([ f ], [ f ]), - 'these functions are actually equal' - ); - - t.end(); -}); - -test('deepEqual', function (t) { - t.ok( - !deepEqual([ 1, 2, 3 ], { 0 : 1, 1 : 2, 2 : 3 }), - 'arrays are not objects' - ); - t.end(); -}); - -test('falsy', function (t) { - t.ok( - !deepEqual([ undefined ], [ null ]), - 'null is not undefined!' - ); - - t.ok( - !deepEqual([ null ], [ undefined ]), - 'undefined is not null!' - ); - - t.ok( - !deepEqual( - { a : 1, b : 2, c : [ 3, undefined, 5 ] }, - { a : 1, b : 2, c : [ 3, null, 5 ] } - ), - 'undefined is not null, however deeply!' - ); - - t.ok( - !deepEqual( - { a : 1, b : 2, c : [ 3, undefined, 5 ] }, - { a : 1, b : 2, c : [ 3, null, 5 ] } - ), - 'null is not undefined, however deeply!' - ); - - t.ok( - !deepEqual( - { a : 1, b : 2, c : [ 3, undefined, 5 ] }, - { a : 1, b : 2, c : [ 3, null, 5 ] } - ), - 'null is not undefined, however deeply!' - ); - - t.end(); -}); - -test('deletedArrayEqual', function (t) { - var xs = [ 1, 2, 3, 4 ]; - delete xs[2]; - - var ys = Object.create(Array.prototype); - ys[0] = 1; - ys[1] = 2; - ys[3] = 4; - - t.ok( - deepEqual(xs, ys), - 'arrays with deleted elements are only equal to' - + ' arrays with similarly deleted elements' - ); - - t.ok( - !deepEqual(xs, [ 1, 2, undefined, 4 ]), - 'deleted array elements cannot be undefined' - ); - - t.ok( - !deepEqual(xs, [ 1, 2, null, 4 ]), - 'deleted array elements cannot be null' - ); - - t.end(); -}); - -test('deletedObjectEqual', function (t) { - var obj = { a : 1, b : 2, c : 3 }; - delete obj.c; - - t.ok( - deepEqual(obj, { a : 1, b : 2 }), - 'deleted object elements should not show up' - ); - - t.ok( - !deepEqual(obj, { a : 1, b : 2, c : undefined }), - 'deleted object elements are not undefined' - ); - - t.ok( - !deepEqual(obj, { a : 1, b : 2, c : null }), - 'deleted object elements are not null' - ); - - t.end(); -}); - -test('emptyKeyEqual', function (t) { - t.ok(!deepEqual( - { a : 1 }, { a : 1, '' : 55 } - )); - - t.end(); -}); - -test('deepArguments', function (t) { - t.ok( - !deepEqual( - [ 4, 5, 6 ], - (function () { return arguments })(4, 5, 6) - ), - 'arguments are not arrays' - ); - - t.ok( - deepEqual( - (function () { return arguments })(4, 5, 6), - (function () { return arguments })(4, 5, 6) - ), - 'arguments should equal' - ); - - t.end(); -}); - -test('deepUn', function (t) { - t.ok(!deepEqual({ a : 1, b : 2 }, undefined)); - t.ok(!deepEqual({ a : 1, b : 2 }, {})); - t.ok(!deepEqual(undefined, { a : 1, b : 2 })); - t.ok(!deepEqual({}, { a : 1, b : 2 })); - t.ok(deepEqual(undefined, undefined)); - t.ok(deepEqual(null, null)); - t.ok(!deepEqual(undefined, null)); - - t.end(); -}); - -test('deepLevels', function (t) { - var xs = [ 1, 2, [ 3, 4, [ 5, 6 ] ] ]; - t.ok(!deepEqual(xs, [])); - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/error.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/error.js deleted file mode 100644 index 447c7257..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/error.js +++ /dev/null @@ -1,11 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); - -test('traverse an Error', function (t) { - var obj = new Error("test"); - var results = traverse(obj).map(function (node) {}); - t.same(results, { message: 'test' }); - - t.end(); -}); - diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/has.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/has.js deleted file mode 100644 index 94a50c6a..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/has.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); - -test('has', function (t) { - var obj = { a : 2, b : [ 4, 5, { c : 6 } ] }; - - t.equal(traverse(obj).has([ 'b', 2, 'c' ]), true) - t.equal(traverse(obj).has([ 'b', 2, 'c', 0 ]), false) - t.equal(traverse(obj).has([ 'b', 2, 'd' ]), false) - t.equal(traverse(obj).has([]), true) - t.equal(traverse(obj).has([ 'a' ]), true) - t.equal(traverse(obj).has([ 'a', 2 ]), false) - - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/instance.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/instance.js deleted file mode 100644 index 112f4772..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/instance.js +++ /dev/null @@ -1,17 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); -var EventEmitter = require('events').EventEmitter; - -test('check instanceof on node elems', function (t) { - var counts = { emitter : 0 }; - - traverse([ new EventEmitter, 3, 4, { ev : new EventEmitter }]) - .forEach(function (node) { - if (node instanceof EventEmitter) counts.emitter ++; - }) - ; - - t.equal(counts.emitter, 2); - - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/interface.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/interface.js deleted file mode 100644 index f454c27f..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/interface.js +++ /dev/null @@ -1,43 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); - -test('interface map', function (t) { - var obj = { a : [ 5,6,7 ], b : { c : [8] } }; - - t.same( - traverse.paths(obj) - .sort() - .map(function (path) { return path.join('/') }) - .slice(1) - .join(' ') - , - 'a a/0 a/1 a/2 b b/c b/c/0' - ); - - t.same( - traverse.nodes(obj), - [ - { a: [ 5, 6, 7 ], b: { c: [ 8 ] } }, - [ 5, 6, 7 ], 5, 6, 7, - { c: [ 8 ] }, [ 8 ], 8 - ] - ); - - t.same( - traverse.map(obj, function (node) { - if (typeof node == 'number') { - return node + 1000; - } - else if (Array.isArray(node)) { - return node.join(' '); - } - }), - { a: '5 6 7', b: { c: '8' } } - ); - - var nodes = 0; - traverse.forEach(obj, function (node) { nodes ++ }); - t.same(nodes, 8); - - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/json.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/json.js deleted file mode 100644 index 46d55e69..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/json.js +++ /dev/null @@ -1,49 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); - -test('json test', function (t) { - var id = 54; - var callbacks = {}; - var obj = { moo : function () {}, foo : [2,3,4, function () {}] }; - - var scrubbed = traverse(obj).map(function (x) { - if (typeof x === 'function') { - callbacks[id] = { id : id, f : x, path : this.path }; - this.update('[Function]'); - id++; - } - }); - - t.equal( - scrubbed.moo, '[Function]', - 'obj.moo replaced with "[Function]"' - ); - - t.equal( - scrubbed.foo[3], '[Function]', - 'obj.foo[3] replaced with "[Function]"' - ); - - t.same(scrubbed, { - moo : '[Function]', - foo : [ 2, 3, 4, "[Function]" ] - }, 'Full JSON string matches'); - - t.same( - typeof obj.moo, 'function', - 'Original obj.moo still a function' - ); - - t.same( - typeof obj.foo[3], 'function', - 'Original obj.foo[3] still a function' - ); - - t.same(callbacks, { - 54: { id: 54, f : obj.moo, path: [ 'moo' ] }, - 55: { id: 55, f : obj.foo[3], path: [ 'foo', '3' ] }, - }, 'Check the generated callbacks list'); - - t.end(); -}); - diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/keys.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/keys.js deleted file mode 100644 index 96611408..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/keys.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); - -test('sort test', function (t) { - var acc = []; - traverse({ - a: 30, - b: 22, - id: 9 - }).forEach(function (node) { - if ((! Array.isArray(node)) && typeof node === 'object') { - this.before(function(node) { - this.keys = Object.keys(node); - this.keys.sort(function(a, b) { - a = [a === "id" ? 0 : 1, a]; - b = [b === "id" ? 0 : 1, b]; - return a < b ? -1 : a > b ? 1 : 0; - }); - }); - } - if (this.isLeaf) acc.push(node); - }); - - t.equal( - acc.join(' '), - '9 30 22', - 'Traversal in a custom order' - ); - - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/leaves.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/leaves.js deleted file mode 100644 index c04ad5f8..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/leaves.js +++ /dev/null @@ -1,22 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); - -test('leaves test', function (t) { - var acc = []; - traverse({ - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 } - }).forEach(function (x) { - if (this.isLeaf) acc.push(x); - }); - - t.equal( - acc.join(' '), - '1 2 3 4 5 6 7 8 9', - 'Traversal in the right(?) order' - ); - - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/lib/deep_equal.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/lib/deep_equal.js deleted file mode 100644 index c75b04c2..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/lib/deep_equal.js +++ /dev/null @@ -1,96 +0,0 @@ -var traverse = require('../../'); - -module.exports = function (a, b) { - if (arguments.length !== 2) { - throw new Error( - 'deepEqual requires exactly two objects to compare against' - ); - } - - var equal = true; - var node = b; - - traverse(a).forEach(function (y) { - var notEqual = (function () { - equal = false; - //this.stop(); - return undefined; - }).bind(this); - - //if (node === undefined || node === null) return notEqual(); - - if (!this.isRoot) { - /* - if (!Object.hasOwnProperty.call(node, this.key)) { - return notEqual(); - } - */ - if (typeof node !== 'object') return notEqual(); - node = node[this.key]; - } - - var x = node; - - this.post(function () { - node = x; - }); - - var toS = function (o) { - return Object.prototype.toString.call(o); - }; - - if (this.circular) { - if (traverse(b).get(this.circular.path) !== x) notEqual(); - } - else if (typeof x !== typeof y) { - notEqual(); - } - else if (x === null || y === null || x === undefined || y === undefined) { - if (x !== y) notEqual(); - } - else if (x.__proto__ !== y.__proto__) { - notEqual(); - } - else if (x === y) { - // nop - } - else if (typeof x === 'function') { - if (x instanceof RegExp) { - // both regexps on account of the __proto__ check - if (x.toString() != y.toString()) notEqual(); - } - else if (x !== y) notEqual(); - } - else if (typeof x === 'object') { - if (toS(y) === '[object Arguments]' - || toS(x) === '[object Arguments]') { - if (toS(x) !== toS(y)) { - notEqual(); - } - } - else if (toS(y) === '[object RegExp]' - || toS(x) === '[object RegExp]') { - if (!x || !y || x.toString() !== y.toString()) notEqual(); - } - else if (x instanceof Date || y instanceof Date) { - if (!(x instanceof Date) || !(y instanceof Date) - || x.getTime() !== y.getTime()) { - notEqual(); - } - } - else { - var kx = Object.keys(x); - var ky = Object.keys(y); - if (kx.length !== ky.length) return notEqual(); - for (var i = 0; i < kx.length; i++) { - var k = kx[i]; - if (!Object.hasOwnProperty.call(y, k)) { - notEqual(); - } - } - } - } - }); - - return equal; -}; diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/mutability.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/mutability.js deleted file mode 100644 index 3ab90dad..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/mutability.js +++ /dev/null @@ -1,300 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); -var deepEqual = require('./lib/deep_equal'); - -test('mutate', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = traverse(obj).forEach(function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - t.same(obj, res); - t.same(obj, { a : 1, b : 20, c : [ 3, 40 ] }); - t.end(); -}); - -test('mutateT', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = traverse.forEach(obj, function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - t.same(obj, res); - t.same(obj, { a : 1, b : 20, c : [ 3, 40 ] }); - t.end(); -}); - -test('map', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = traverse(obj).map(function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - t.same(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - t.same(res, { a : 1, b : 20, c : [ 3, 40 ] }); - t.end(); -}); - -test('mapT', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = traverse.map(obj, function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - t.same(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - t.same(res, { a : 1, b : 20, c : [ 3, 40 ] }); - t.end(); -}); - -test('clone', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = traverse(obj).clone(); - t.same(obj, res); - t.ok(obj !== res); - obj.a ++; - t.same(res.a, 1); - obj.c.push(5); - t.same(res.c, [ 3, 4 ]); - t.end(); -}); - -test('cloneT', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = traverse.clone(obj); - t.same(obj, res); - t.ok(obj !== res); - obj.a ++; - t.same(res.a, 1); - obj.c.push(5); - t.same(res.c, [ 3, 4 ]); - t.end(); -}); - -test('reduce', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = traverse(obj).reduce(function (acc, x) { - if (this.isLeaf) acc.push(x); - return acc; - }, []); - t.same(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - t.same(res, [ 1, 2, 3, 4 ]); - t.end(); -}); - -test('reduceInit', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = traverse(obj).reduce(function (acc, x) { - if (this.isRoot) assert.fail('got root'); - return acc; - }); - t.same(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - t.same(res, obj); - t.end(); -}); - -test('remove', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - traverse(obj).forEach(function (x) { - if (this.isLeaf && x % 2 == 0) this.remove(); - }); - - t.same(obj, { a : 1, c : [ 3 ] }); - t.end(); -}); - -exports.removeNoStop = function() { - var obj = { a : 1, b : 2, c : { d: 3, e: 4 }, f: 5 }; - - var keys = []; - traverse(obj).forEach(function (x) { - keys.push(this.key) - if (this.key == 'c') this.remove(); - }); - - t.same(keys, [undefined, 'a', 'b', 'c', 'd', 'e', 'f']) - t.end(); -} - -exports.removeStop = function() { - var obj = { a : 1, b : 2, c : { d: 3, e: 4 }, f: 5 }; - - var keys = []; - traverse(obj).forEach(function (x) { - keys.push(this.key) - if (this.key == 'c') this.remove(true); - }); - - t.same(keys, [undefined, 'a', 'b', 'c', 'f']) - t.end(); -} - -test('removeMap', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = traverse(obj).map(function (x) { - if (this.isLeaf && x % 2 == 0) this.remove(); - }); - - t.same(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - t.same(res, { a : 1, c : [ 3 ] }); - t.end(); -}); - -test('delete', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - traverse(obj).forEach(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - t.ok(!deepEqual( - obj, { a : 1, c : [ 3, undefined ] } - )); - - t.ok(deepEqual( - obj, { a : 1, c : [ 3 ] } - )); - - t.ok(!deepEqual( - obj, { a : 1, c : [ 3, null ] } - )); - t.end(); -}); - -test('deleteNoStop', function (t) { - var obj = { a : 1, b : 2, c : { d: 3, e: 4 } }; - - var keys = []; - traverse(obj).forEach(function (x) { - keys.push(this.key) - if (this.key == 'c') this.delete(); - }); - - t.same(keys, [undefined, 'a', 'b', 'c', 'd', 'e']) - t.end(); -}); - -test('deleteStop', function (t) { - var obj = { a : 1, b : 2, c : { d: 3, e: 4 } }; - - var keys = []; - traverse(obj).forEach(function (x) { - keys.push(this.key) - if (this.key == 'c') this.delete(true); - }); - - t.same(keys, [undefined, 'a', 'b', 'c']) - t.end(); -}); - -test('deleteRedux', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] }; - traverse(obj).forEach(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - t.ok(!deepEqual( - obj, { a : 1, c : [ 3, undefined, 5 ] } - )); - - t.ok(deepEqual( - obj, { a : 1, c : [ 3 ,, 5 ] } - )); - - t.ok(!deepEqual( - obj, { a : 1, c : [ 3, null, 5 ] } - )); - - t.ok(!deepEqual( - obj, { a : 1, c : [ 3, 5 ] } - )); - - t.end(); -}); - -test('deleteMap', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = traverse(obj).map(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - t.ok(deepEqual( - obj, - { a : 1, b : 2, c : [ 3, 4 ] } - )); - - var xs = [ 3, 4 ]; - delete xs[1]; - - t.ok(deepEqual( - res, { a : 1, c : xs } - )); - - t.ok(deepEqual( - res, { a : 1, c : [ 3, ] } - )); - - t.ok(deepEqual( - res, { a : 1, c : [ 3 ] } - )); - - t.end(); -}); - -test('deleteMapRedux', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] }; - var res = traverse(obj).map(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - t.ok(deepEqual( - obj, - { a : 1, b : 2, c : [ 3, 4, 5 ] } - )); - - var xs = [ 3, 4, 5 ]; - delete xs[1]; - - t.ok(deepEqual( - res, { a : 1, c : xs } - )); - - t.ok(!deepEqual( - res, { a : 1, c : [ 3, 5 ] } - )); - - t.ok(deepEqual( - res, { a : 1, c : [ 3 ,, 5 ] } - )); - - t.end(); -}); - -test('objectToString', function (t) { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = traverse(obj).forEach(function (x) { - if (typeof x === 'object' && !this.isRoot) { - this.update(JSON.stringify(x)); - } - }); - t.same(obj, res); - t.same(obj, { a : 1, b : 2, c : "[3,4]" }); - t.end(); -}); - -test('stringToObject', function (t) { - var obj = { a : 1, b : 2, c : "[3,4]" }; - var res = traverse(obj).forEach(function (x) { - if (typeof x === 'string') { - this.update(JSON.parse(x)); - } - else if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - t.deepEqual(obj, res); - t.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] }); - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/negative.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/negative.js deleted file mode 100644 index 91566c80..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/negative.js +++ /dev/null @@ -1,21 +0,0 @@ -var traverse = require('../'); -var test = require('tape'); - -test('negative update test', function (t) { - var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - var fixed = traverse.map(obj, function (x) { - if (x < 0) this.update(x + 128); - }); - - t.same(fixed, - [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ], - 'Negative values += 128' - ); - - t.same(obj, - [ 5, 6, -3, [ 7, 8, -2, 1 ], { f: 10, g: -13 } ], - 'Original references not modified' - ); - - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/obj.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/obj.js deleted file mode 100644 index 8bcf58ae..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/obj.js +++ /dev/null @@ -1,11 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); - -test('traverse an object with nested functions', function (t) { - t.plan(1); - - function Cons (x) { - t.equal(x, 10) - }; - traverse(new Cons(10)); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/siblings.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/siblings.js deleted file mode 100644 index c59e5577..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/siblings.js +++ /dev/null @@ -1,37 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); - -test('siblings', function (t) { - var obj = { a : 1, b : 2, c : [ 4, 5, 6 ] }; - - var res = traverse(obj).reduce(function (acc, x) { - var p = '/' + this.path.join('/'); - if (this.parent) { - acc[p] = { - siblings : this.parent.keys, - key : this.key, - index : this.parent.keys.indexOf(this.key) - }; - } - else { - acc[p] = { - siblings : [], - key : this.key, - index : -1 - } - } - return acc; - }, {}); - - t.same(res, { - '/' : { siblings : [], key : undefined, index : -1 }, - '/a' : { siblings : [ 'a', 'b', 'c' ], key : 'a', index : 0 }, - '/b' : { siblings : [ 'a', 'b', 'c' ], key : 'b', index : 1 }, - '/c' : { siblings : [ 'a', 'b', 'c' ], key : 'c', index : 2 }, - '/c/0' : { siblings : [ '0', '1', '2' ], key : '0', index : 0 }, - '/c/1' : { siblings : [ '0', '1', '2' ], key : '1', index : 1 }, - '/c/2' : { siblings : [ '0', '1', '2' ], key : '2', index : 2 } - }); - - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/stop.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/stop.js deleted file mode 100644 index 9ce15b06..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/stop.js +++ /dev/null @@ -1,44 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); - -test('stop', function (t) { - var visits = 0; - traverse('abcdefghij'.split('')).forEach(function (node) { - if (typeof node === 'string') { - visits ++; - if (node === 'e') this.stop() - } - }); - - t.equal(visits, 5); - t.end(); -}); - -test('stopMap', function (t) { - var s = traverse('abcdefghij'.split('')).map(function (node) { - if (typeof node === 'string') { - if (node === 'e') this.stop() - return node.toUpperCase(); - } - }).join(''); - - t.equal(s, 'ABCDEfghij'); - t.end(); -}); - -test('stopReduce', function (t) { - var obj = { - a : [ 4, 5 ], - b : [ 6, [ 7, 8, 9 ] ] - }; - var xs = traverse(obj).reduce(function (acc, node) { - if (this.isLeaf) { - if (node === 7) this.stop(); - else acc.push(node) - } - return acc; - }, []); - - t.same(xs, [ 4, 5, 6 ]); - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/stringify.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/stringify.js deleted file mode 100644 index f1680d8c..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/stringify.js +++ /dev/null @@ -1,36 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); - -test('stringify', function (t) { - var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - - var s = ''; - traverse(obj).forEach(function (node) { - if (Array.isArray(node)) { - this.before(function () { s += '[' }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += ']' }); - } - else if (typeof node == 'object') { - this.before(function () { s += '{' }); - this.pre(function (x, key) { - s += '"' + key + '"' + ':'; - }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += '}' }); - } - else if (typeof node == 'function') { - s += 'null'; - } - else { - s += node.toString(); - } - }); - - t.equal(s, JSON.stringify(obj)); - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/subexpr.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/subexpr.js deleted file mode 100644 index 76826088..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/subexpr.js +++ /dev/null @@ -1,36 +0,0 @@ -var traverse = require('../'); -var test = require('tape'); - -test('subexpr', function (t) { - var obj = [ 'a', 4, 'b', 5, 'c', 6 ]; - var r = traverse(obj).map(function (x) { - if (typeof x === 'number') { - this.update([ x - 0.1, x, x + 0.1 ], true); - } - }); - - t.same(obj, [ 'a', 4, 'b', 5, 'c', 6 ]); - t.same(r, [ - 'a', [ 3.9, 4, 4.1 ], - 'b', [ 4.9, 5, 5.1 ], - 'c', [ 5.9, 6, 6.1 ], - ]); - t.end(); -}); - -test('block', function (t) { - var obj = [ [ 1 ], [ 2 ], [ 3 ] ]; - var r = traverse(obj).map(function (x) { - if (Array.isArray(x) && !this.isRoot) { - if (x[0] === 5) this.block() - else this.update([ [ x[0] + 1 ] ]) - } - }); - - t.same(r, [ - [ [ [ [ [ 5 ] ] ] ] ], - [ [ [ [ 5 ] ] ] ], - [ [ [ 5 ] ] ], - ]); - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/super_deep.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/test/super_deep.js deleted file mode 100644 index 1eb9e26e..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/test/super_deep.js +++ /dev/null @@ -1,56 +0,0 @@ -var test = require('tape'); -var traverse = require('../'); -var deepEqual = require('./lib/deep_equal'); - -test('super_deep', function (t) { - var util = require('util'); - var a0 = make(); - var a1 = make(); - t.ok(deepEqual(a0, a1)); - - a0.c.d.moo = true; - t.ok(!deepEqual(a0, a1)); - - a1.c.d.moo = true; - t.ok(deepEqual(a0, a1)); - - // TODO: this one - //a0.c.a = a1; - //t.ok(!deepEqual(a0, a1)); - t.end(); -}); - -function make () { - var a = { self : 'a' }; - var b = { self : 'b' }; - var c = { self : 'c' }; - var d = { self : 'd' }; - var e = { self : 'e' }; - - a.a = a; - a.b = b; - a.c = c; - - b.a = a; - b.b = b; - b.c = c; - - c.a = a; - c.b = b; - c.c = c; - c.d = d; - - d.a = a; - d.b = b; - d.c = c; - d.d = d; - d.e = e; - - e.a = a; - e.b = b; - e.c = c; - e.d = d; - e.e = e; - - return a; -} diff --git a/node_modules/tap/node_modules/difflet/node_modules/traverse/testling/leaves.js b/node_modules/tap/node_modules/difflet/node_modules/traverse/testling/leaves.js deleted file mode 100644 index 29968dd1..00000000 --- a/node_modules/tap/node_modules/difflet/node_modules/traverse/testling/leaves.js +++ /dev/null @@ -1,22 +0,0 @@ -var traverse = require('./'); -var test = require('testling'); - -test('leaves', function (t) { - var obj = { - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 } - }; - - var acc = []; - traverse(obj).forEach(function (x) { - if (this.isLeaf) acc.push(x); - }); - - t.deepEqual( - acc, [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], - 'traversal in the proper order' - ); - t.end(); -}); diff --git a/node_modules/tap/node_modules/difflet/package.json b/node_modules/tap/node_modules/difflet/package.json deleted file mode 100644 index aadcdce0..00000000 --- a/node_modules/tap/node_modules/difflet/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "difflet", - "description": "colorful diffs for javascript objects", - "version": "0.2.6", - "repository": { - "type": "git", - "url": "git://github.com/substack/difflet.git" - }, - "main": "index.js", - "keywords": [ - "diff", - "object", - "compare" - ], - "directories": { - "lib": ".", - "example": "example", - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": { - "traverse": "0.6.x", - "charm": "0.1.x", - "deep-is": "0.1.x" - }, - "devDependencies": { - "tap": "0.1.x", - "ent": "0.0.x" - }, - "engines": { - "node": ">=0.4.0" - }, - "license": "MIT", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "readme": "difflet\n=======\n\nCreate colorful diffs for javascript objects.\n\nexample\n=======\n\nstring.js\n---------\n\n``` js\nvar difflet = require('difflet');\n\nvar s = difflet.compare({ a : 2, c : 5 }, { a : 3, b : 4 });\nprocess.stdout.write(s);\n```\n\noutput:\n\n![colorful output](http://substack.net/images/screenshots/difflet_string.png)\n\ncolors.js\n---------\n\n``` js\nvar diff = require('difflet')({ indent : 2 });\n\nvar prev = {\n yy : 6,\n zz : 5,\n a : [1,2,3],\n fn : 'beep',\n c : { x : 7, z : 3 }\n};\n\nvar next = {\n a : [ 1, 2, \"z\", /beep/, new Buffer(3) ],\n fn : function qqq () {},\n b : [5,6,7],\n c : { x : 8, y : 5 }\n};\n\ndiff(prev, next).pipe(process.stdout);\n```\n\noutput:\n\n![colorful output](http://substack.net/images/screenshots/difflet_colors.png)\n\ngreen for inserts, blue for updates, red for deletes\n\nmethods\n=======\n\nvar difflet = require('difflet')\n\nvar diff = difflet(opts={})\n---------------------------\n\nCreate a difflet from optional options `opts`.\n\nWith `opts.start(type, stream)` and `opts.stop(type, stream)`,\nyou can write custom handlers for all the types of differences:\n`'inserted'`, `'updated'`, and `'deleted'`.\nBy default green is used for insertions, blue for updates, and red for\ndeletions.\n\nIf `opts.indent` is set, output will span multiple lines and `opts.indent`\nspaces will be used for leading whitespace.\n\nIf `opts.comma === 'first'` then commas will be placed at the start of lines.\n\nSetting `opts.comment` to `true` will turn on comments with the previous\ncontents like this:\n\n![object comments](http://substack.net/images/screenshots/difflet_object_comments.png)\n\ndiff(prev, next)\n----------------\n\nReturn a stream with the colorful changes between objects `prev` and `next`.\n\ndiff.compare(prev, next)\n------------------------\n\nReturn a string with the colorful changes between `prev` and `next`.\n\ndifflet.compare(prev, next)\n---------------------------\n\nReturn a string with the colorful changes between `prev` and `next` with the\ndefault options.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install difflet\n```\n\ntest\n====\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm test\n```\n\nlicense\n=======\n\nMIT/X11\n", - "readmeFilename": "README.markdown", - "bugs": { - "url": "https://github.com/substack/difflet/issues" - }, - "_id": "difflet@0.2.6", - "dist": { - "shasum": "ab23b31f5649b6faa8e3d2acbd334467365ca6fa", - "tarball": "http://registry.npmjs.org/difflet/-/difflet-0.2.6.tgz" - }, - "_from": "difflet@>=0.2.0 <0.3.0", - "_npmVersion": "1.3.0", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "_shasum": "ab23b31f5649b6faa8e3d2acbd334467365ca6fa", - "_resolved": "https://registry.npmjs.org/difflet/-/difflet-0.2.6.tgz", - "homepage": "https://github.com/substack/difflet#readme" -} diff --git a/node_modules/tap/node_modules/difflet/test/diffing-NaN.js b/node_modules/tap/node_modules/difflet/test/diffing-NaN.js deleted file mode 100644 index d29e6e19..00000000 --- a/node_modules/tap/node_modules/difflet/test/diffing-NaN.js +++ /dev/null @@ -1,17 +0,0 @@ -var difflet = require('../'); -var diff = difflet(); -var test = require('tap').test; - -test('diffing NaN against NaN', function (t) { - t.plan(1); - var d = diff.compare(NaN, NaN); - - t.equal(d, 'NaN'); -}); - -test('diffing { o: NaN } against { o: NaN }', function (t) { - t.plan(1); - var d = diff.compare({ o: NaN }, { o: NaN }); - - t.equal(d, '{"o":NaN}'); -}); diff --git a/node_modules/tap/node_modules/difflet/test/html.js b/node_modules/tap/node_modules/difflet/test/html.js deleted file mode 100644 index 26d2ed41..00000000 --- a/node_modules/tap/node_modules/difflet/test/html.js +++ /dev/null @@ -1,80 +0,0 @@ -var difflet = require('../'); -var test = require('tap').test; -var ent = require('ent'); - -var tags = { - inserted : 'g', - updated : 'b', - deleted : 'r', -}; - -test('html output', function (t) { - t.plan(1); - var diff = difflet({ - start : function (t, s) { - s.write('<' + tags[t] + '>'); - }, - stop : function (t, s) { - s.write(''); - }, - write : function (buf, s) { - s.write(ent.encode(buf)); - } - }); - - var stream = diff( - { yy : 6, zz : 5, a : [1,2,3], fn : function qqq () {} }, - { - a : [ 1, 2, 3, [4], "z", /beep/, new Buffer([0,1,2]) ], - fn : function rrr () {}, - b : [5,6,7] - } - ); - - var data = '' - stream.on('data', function (buf) { data += buf }); - stream.on('end', function () { - t.equal(data, - '{"a":[1,2,3,[4],"z",' - + '/beep/,<Buffer 00 01 02>],' - + '"fn":[Function: rrr],' - + '"b":[5,6,7],"yy":6,' - + '"zz":5}' - ); - t.end(); - }); -}); - -test('compare html output', function (t) { - t.plan(1); - - var diff = difflet({ - start : function (t, s) { - s.write('<' + tags[t] + '>'); - }, - stop : function (t, s) { - s.write(''); - }, - write : function (buf, s) { - s.write(ent.encode(buf)); - } - }); - - var data = diff.compare( - { yy : 6, zz : 5, a : [1,2,3], fn : function qqq () {} }, - { - a : [ 1, 2, 3, [4], "z", /beep/, new Buffer([0,1,2]) ], - fn : function rrr () {}, - b : [5,6,7] - } - ); - - t.equal(data, - '{"a":[1,2,3,[4],"z",' - + '/beep/,<Buffer 00 01 02>],' - + '"fn":[Function: rrr],' - + '"b":[5,6,7],"yy":6,' - + '"zz":5}' - ); - t.end(); -}); diff --git a/node_modules/tap/node_modules/glob/LICENSE b/node_modules/tap/node_modules/glob/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/node_modules/tap/node_modules/glob/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/tap/node_modules/glob/README.md b/node_modules/tap/node_modules/glob/README.md deleted file mode 100644 index 258257ec..00000000 --- a/node_modules/tap/node_modules/glob/README.md +++ /dev/null @@ -1,369 +0,0 @@ -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Dependency Status](https://david-dm.org/isaacs/node-glob.svg)](https://david-dm.org/isaacs/node-glob) [![devDependency Status](https://david-dm.org/isaacs/node-glob/dev-status.svg)](https://david-dm.org/isaacs/node-glob#info=devDependencies) [![optionalDependency Status](https://david-dm.org/isaacs/node-glob/optional-status.svg)](https://david-dm.org/isaacs/node-glob#info=optionalDependencies) - -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -![](oh-my-glob.gif) - -## Usage - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Glob Primer - -"Globs" are the patterns you type when you do stuff like `ls *.js` on -the command line, or put `build/*` in a `.gitignore` file. - -Before parsing the path part patterns, braced sections are expanded -into a set. Braced sections start with `{` and end with `}`, with any -number of comma-delimited sections within. Braced sections may contain -slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. - -The following characters have special magic meaning when used in a -path portion: - -* `*` Matches 0 or more characters in a single path portion -* `?` Matches 1 character -* `[...]` Matches a range of characters, similar to a RegExp range. - If the first character of the range is `!` or `^` then it matches - any character not in the range. -* `!(pattern|pattern|pattern)` Matches anything that does not match - any of the patterns provided. -* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the - patterns provided. -* `+(pattern|pattern|pattern)` Matches one or more occurrences of the - patterns provided. -* `*(a|b|c)` Matches zero or more occurrences of the patterns provided -* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns - provided -* `**` If a "globstar" is alone in a path portion, then it matches - zero or more directories and subdirectories searching for matches. - It does not crawl symlinked directories. - -### Dots - -If a file or directory path portion has a `.` as the first character, -then it will not match any glob pattern unless that pattern's -corresponding path part also has a `.` as its first character. - -For example, the pattern `a/.*/c` would match the file at `a/.b/c`. -However the pattern `a/*/c` would not, because `*` does not start with -a dot character. - -You can make glob treat dots as normal characters by setting -`dot:true` in the options. - -### Basename Matching - -If you set `matchBase:true` in the options, and the pattern has no -slashes in it, then it will seek for any file anywhere in the tree -with a matching basename. For example, `*.js` would match -`test/simple/basic.js`. - -### Negation - -The intent for negation would be for a pattern starting with `!` to -match everything that *doesn't* match the supplied pattern. However, -the implementation is weird, and for the time being, this should be -avoided. The behavior will change or be deprecated in version 5. - -### Empty Sets - -If no matching files are found, then an empty array is returned. This -differs from the shell, where the pattern itself is returned. For -example: - - $ echo a*s*d*f - a*s*d*f - -To get the bash-style behavior, set the `nonull:true` in the options. - -### See Also: - -* `man sh` -* `man bash` (Search for "Pattern Matching") -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob.hasMagic(pattern, [options]) - -Returns `true` if there are any special characters in the pattern, and -`false` otherwise. - -Note that the options affect the results. If `noext:true` is set in -the options object, then `+(a|b)` will not be considered a magic -pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` -then that is considered magical, unless `nobrace:true` is set in the -options. - -## glob(pattern, [options], cb) - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* `cb` {Function} - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* return: {Array} filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instantiating the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` {String} pattern to search for -* `options` {Object} -* `cb` {Function} Called when an error occurs, or matches are found - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `statCache` Collection of all the stat results the glob search - performed. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `'DIR'` - Path exists, and is not a directory - * `'FILE'` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` -* `statCache` Cache of `fs.stat` results, to prevent statting the same - path multiple times. -* `symlinks` A record of which paths are symbolic links, which is - relevant in resolving `**` patterns. -* `realpathCache` An optional object which is passed to `fs.realpath` - to minimize unnecessary syscalls. It is stored on the instantiated - Glob object, and may be re-used. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the matched. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `pause` Temporarily stop the search -* `resume` Resume the search -* `abort` Stop the search forever - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the Glob object, as well. - -If you are running many `glob` operations, you can pass a Glob object -as the `options` argument to a subsequent operation to shortcut some -`stat` and `readdir` calls. At the very least, you may pass in shared -`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that -parallel glob operations will be sped up by sharing information about -the filesystem. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. -* `silent` When an unusual error is encountered when attempting to - read a directory, a warning will be printed to stderr. Set the - `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered when attempting to - read a directory, the process will just continue on in search of - other matches. Set the `strict` option to raise an error in these - cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary - to set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `symlinks` A cache of known symbolic links. You may pass in a - previously generated `symlinks` object to save `lstat` calls when - resolving `**` matches. -* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. Set this - flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `debug` Set to enable debug logging in minimatch and glob. -* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. -* `noglobstar` Do not match `**` against multiple filenames. (Ie, - treat it as a normal `*` instead.) -* `noext` Do not match `+(a|b)` "extglob" patterns. -* `nocase` Perform a case-insensitive match. Note: on - case-insensitive filesystems, non-magic patterns will match by - default, since `stat` and `readdir` will not raise errors. -* `matchBase` Perform a basename-only match if the pattern does not - contain any slash characters. That is, `*.js` would be treated as - equivalent to `**/*.js`, matching all js files in all directories. -* `nonegate` Suppress `negate` behavior. (See below.) -* `nocomment` Suppress `comment` behavior. (See below.) -* `nonull` Return the pattern when no matches are found. -* `nodir` Do not match directories, only files. (Note: to match - *only* directories, simply put a `/` at the end of the pattern.) -* `ignore` Add a pattern or an array of patterns to exclude matches. -* `follow` Follow symlinked directories when expanding `**` patterns. - Note that this can result in a lot of duplicate references in the - presence of cyclic links. -* `realpath` Set to true to call `fs.realpath` on all of the results. - In the case of a symlink that cannot be resolved, the full absolute - path to the matched entry is returned (though it will usually be a - broken symlink) - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.3, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -Note that symlinked directories are not crawled as part of a `**`, -though their contents may match against subsequent portions of the -pattern. This prevents infinite loops and duplicates and the like. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. - -## Contributing - -Any change to behavior (including bugfixes) must come with a test. - -Patches that fail tests or reduce performance will be rejected. - -``` -# to run tests -npm test - -# to re-generate test fixtures -npm run test-regen - -# to benchmark against bash/zsh -npm run bench - -# to profile javascript -npm run prof -``` diff --git a/node_modules/tap/node_modules/glob/common.js b/node_modules/tap/node_modules/glob/common.js deleted file mode 100644 index cd7c8244..00000000 --- a/node_modules/tap/node_modules/glob/common.js +++ /dev/null @@ -1,237 +0,0 @@ -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.isAbsolute = process.platform === "win32" ? absWin : absUnix -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var path = require("path") -var minimatch = require("minimatch") -var Minimatch = minimatch.Minimatch - -function absWin (p) { - if (absUnix(p)) return true - // pull off the device/UNC bit from a windows path. - // from node's lib/path.js - var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ - var result = splitDeviceRe.exec(p) - var device = result[1] || '' - var isUnc = device && device.charAt(1) !== ':' - var isAbsolute = !!result[2] || isUnc // UNC paths are always absolute - - return isAbsolute -} - -function absUnix (p) { - return p.charAt(0) === "/" || p === "" -} - -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} - -function alphasort (a, b) { - return a.localeCompare(b) -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { nonegate: true }) - } - - return { - matcher: new Minimatch(pattern, { nonegate: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = options.cwd - self.changedCwd = path.resolve(options.cwd) !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - self.nomount = !!options.nomount - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - return !(/\/$/.test(e)) - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (exports.isAbsolute(f)) { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else if (self.realpath) { - abs = path.resolve(f) - } - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} diff --git a/node_modules/tap/node_modules/glob/glob.js b/node_modules/tap/node_modules/glob/glob.js deleted file mode 100644 index eac0693c..00000000 --- a/node_modules/tap/node_modules/glob/glob.js +++ /dev/null @@ -1,740 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var globSync = require('./sync.js') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var isAbsolute = common.isAbsolute -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') -var childrenIgnored = common.childrenIgnored - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -glob.hasMagic = function (pattern, options_) { - var options = util._extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - var n = this.minimatch.set.length - this._processing = 0 - this.matches = new Array(n) - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - - function done () { - --self._processing - if (self._processing <= 0) - self._finish() - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - fs.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (this.matches[index][e]) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = this._makeAbs(e) - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - if (this.mark) - e = this._mark(e) - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er) - return cb() - - var isSym = lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) return this.emit('error', er) - if (!this.silent) console.error('glob error', er) - break - } - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && !stat.isDirectory()) - return cb(null, false, stat) - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c !== 'DIR') - return cb() - - return cb(null, c, stat) -} diff --git a/node_modules/tap/node_modules/glob/node_modules/inflight/.eslintrc b/node_modules/tap/node_modules/glob/node_modules/inflight/.eslintrc deleted file mode 100644 index b7a1550e..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/inflight/.eslintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "env" : { - "node" : true - }, - "rules" : { - "semi": [2, "never"], - "strict": 0, - "quotes": [1, "single", "avoid-escape"], - "no-use-before-define": 0, - "curly": 0, - "no-underscore-dangle": 0, - "no-lonely-if": 1, - "no-unused-vars": [2, {"vars" : "all", "args" : "after-used"}], - "no-mixed-requires": 0, - "space-infix-ops": 0 - } -} diff --git a/node_modules/tap/node_modules/glob/node_modules/inflight/LICENSE b/node_modules/tap/node_modules/glob/node_modules/inflight/LICENSE deleted file mode 100644 index 05eeeb88..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/inflight/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/tap/node_modules/glob/node_modules/inflight/README.md b/node_modules/tap/node_modules/glob/node_modules/inflight/README.md deleted file mode 100644 index 6dc89291..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/inflight/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# inflight - -Add callbacks to requests in flight to avoid async duplication - -## USAGE - -```javascript -var inflight = require('inflight') - -// some request that does some stuff -function req(key, callback) { - // key is any random string. like a url or filename or whatever. - // - // will return either a falsey value, indicating that the - // request for this key is already in flight, or a new callback - // which when called will call all callbacks passed to inflightk - // with the same key - callback = inflight(key, callback) - - // If we got a falsey value back, then there's already a req going - if (!callback) return - - // this is where you'd fetch the url or whatever - // callback is also once()-ified, so it can safely be assigned - // to multiple events etc. First call wins. - setTimeout(function() { - callback(null, key) - }, 100) -} - -// only assigns a single setTimeout -// when it dings, all cbs get called -req('foo', cb1) -req('foo', cb2) -req('foo', cb3) -req('foo', cb4) -``` diff --git a/node_modules/tap/node_modules/glob/node_modules/inflight/inflight.js b/node_modules/tap/node_modules/glob/node_modules/inflight/inflight.js deleted file mode 100644 index 8bc96cbd..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/inflight/inflight.js +++ /dev/null @@ -1,44 +0,0 @@ -var wrappy = require('wrappy') -var reqs = Object.create(null) -var once = require('once') - -module.exports = wrappy(inflight) - -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) - } -} - -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] - } - }) -} - -function slice (args) { - var length = args.length - var array = [] - - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} diff --git a/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE b/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md b/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md deleted file mode 100644 index 98eab252..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# wrappy - -Callback wrapping utility - -## USAGE - -```javascript -var wrappy = require("wrappy") - -// var wrapper = wrappy(wrapperFunction) - -// make sure a cb is called only once -// See also: http://npm.im/once for this specific use case -var once = wrappy(function (cb) { - var called = false - return function () { - if (called) return - called = true - return cb.apply(this, arguments) - } -}) - -function printBoo () { - console.log('boo') -} -// has some rando property -printBoo.iAmBooPrinter = true - -var onlyPrintOnce = once(printBoo) - -onlyPrintOnce() // prints 'boo' -onlyPrintOnce() // does nothing - -// random property is retained! -assert.equal(onlyPrintOnce.iAmBooPrinter, true) -``` diff --git a/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json b/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json deleted file mode 100644 index 2b8e311c..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "wrappy", - "version": "1.0.1", - "description": "Callback wrapping utility", - "main": "wrappy.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "^0.4.12" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/npm/wrappy.git" - }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/wrappy/issues" - }, - "homepage": "https://github.com/npm/wrappy", - "readme": "# wrappy\n\nCallback wrapping utility\n\n## USAGE\n\n```javascript\nvar wrappy = require(\"wrappy\")\n\n// var wrapper = wrappy(wrapperFunction)\n\n// make sure a cb is called only once\n// See also: http://npm.im/once for this specific use case\nvar once = wrappy(function (cb) {\n var called = false\n return function () {\n if (called) return\n called = true\n return cb.apply(this, arguments)\n }\n})\n\nfunction printBoo () {\n console.log('boo')\n}\n// has some rando property\nprintBoo.iAmBooPrinter = true\n\nvar onlyPrintOnce = once(printBoo)\n\nonlyPrintOnce() // prints 'boo'\nonlyPrintOnce() // does nothing\n\n// random property is retained!\nassert.equal(onlyPrintOnce.iAmBooPrinter, true)\n```\n", - "readmeFilename": "README.md", - "_id": "wrappy@1.0.1", - "_shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739", - "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", - "_from": "wrappy@>=1.0.0 <2.0.0" -} diff --git a/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js b/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js deleted file mode 100644 index 5ed0fcdf..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +++ /dev/null @@ -1,51 +0,0 @@ -var test = require('tap').test -var wrappy = require('../wrappy.js') - -test('basic', function (t) { - function onceifier (cb) { - var called = false - return function () { - if (called) return - called = true - return cb.apply(this, arguments) - } - } - onceifier.iAmOnce = {} - var once = wrappy(onceifier) - t.equal(once.iAmOnce, onceifier.iAmOnce) - - var called = 0 - function boo () { - t.equal(called, 0) - called++ - } - // has some rando property - boo.iAmBoo = true - - var onlyPrintOnce = once(boo) - - onlyPrintOnce() // prints 'boo' - onlyPrintOnce() // does nothing - t.equal(called, 1) - - // random property is retained! - t.equal(onlyPrintOnce.iAmBoo, true) - - var logs = [] - var logwrap = wrappy(function (msg, cb) { - logs.push(msg + ' wrapping cb') - return function () { - logs.push(msg + ' before cb') - var ret = cb.apply(this, arguments) - logs.push(msg + ' after cb') - } - }) - - var c = logwrap('foo', function () { - t.same(logs, [ 'foo wrapping cb', 'foo before cb' ]) - }) - c() - t.same(logs, [ 'foo wrapping cb', 'foo before cb', 'foo after cb' ]) - - t.end() -}) diff --git a/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js b/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js deleted file mode 100644 index bb7e7d6f..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js +++ /dev/null @@ -1,33 +0,0 @@ -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) - - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') - - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) - - return wrapper - - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) - } - return ret - } -} diff --git a/node_modules/tap/node_modules/glob/node_modules/inflight/package.json b/node_modules/tap/node_modules/glob/node_modules/inflight/package.json deleted file mode 100644 index 20386c8a..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/inflight/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "inflight", - "version": "1.0.4", - "description": "Add callbacks to requests in flight to avoid async duplication", - "main": "inflight.js", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - }, - "devDependencies": { - "tap": "^0.4.10" - }, - "scripts": { - "test": "tap test.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/inflight.git" - }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/inflight/issues" - }, - "homepage": "https://github.com/isaacs/inflight", - "license": "ISC", - "readme": "# inflight\n\nAdd callbacks to requests in flight to avoid async duplication\n\n## USAGE\n\n```javascript\nvar inflight = require('inflight')\n\n// some request that does some stuff\nfunction req(key, callback) {\n // key is any random string. like a url or filename or whatever.\n //\n // will return either a falsey value, indicating that the\n // request for this key is already in flight, or a new callback\n // which when called will call all callbacks passed to inflightk\n // with the same key\n callback = inflight(key, callback)\n\n // If we got a falsey value back, then there's already a req going\n if (!callback) return\n\n // this is where you'd fetch the url or whatever\n // callback is also once()-ified, so it can safely be assigned\n // to multiple events etc. First call wins.\n setTimeout(function() {\n callback(null, key)\n }, 100)\n}\n\n// only assigns a single setTimeout\n// when it dings, all cbs get called\nreq('foo', cb1)\nreq('foo', cb2)\nreq('foo', cb3)\nreq('foo', cb4)\n```\n", - "readmeFilename": "README.md", - "_id": "inflight@1.0.4", - "_shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a", - "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", - "_from": "inflight@>=1.0.4 <2.0.0" -} diff --git a/node_modules/tap/node_modules/glob/node_modules/inflight/test.js b/node_modules/tap/node_modules/glob/node_modules/inflight/test.js deleted file mode 100644 index 2bb75b38..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/inflight/test.js +++ /dev/null @@ -1,97 +0,0 @@ -var test = require('tap').test -var inf = require('./inflight.js') - - -function req (key, cb) { - cb = inf(key, cb) - if (cb) setTimeout(function () { - cb(key) - cb(key) - }) - return cb -} - -test('basic', function (t) { - var calleda = false - var a = req('key', function (k) { - t.notOk(calleda) - calleda = true - t.equal(k, 'key') - if (calledb) t.end() - }) - t.ok(a, 'first returned cb function') - - var calledb = false - var b = req('key', function (k) { - t.notOk(calledb) - calledb = true - t.equal(k, 'key') - if (calleda) t.end() - }) - - t.notOk(b, 'second should get falsey inflight response') -}) - -test('timing', function (t) { - var expect = [ - 'method one', - 'start one', - 'end one', - 'two', - 'tick', - 'three' - ] - var i = 0 - - function log (m) { - t.equal(m, expect[i], m + ' === ' + expect[i]) - ++i - if (i === expect.length) - t.end() - } - - function method (name, cb) { - log('method ' + name) - process.nextTick(cb) - } - - var one = inf('foo', function () { - log('start one') - var three = inf('foo', function () { - log('three') - }) - if (three) method('three', three) - log('end one') - }) - - method('one', one) - - var two = inf('foo', function () { - log('two') - }) - if (two) method('one', two) - - process.nextTick(log.bind(null, 'tick')) -}) - -test('parameters', function (t) { - t.plan(8) - - var a = inf('key', function (first, second, third) { - t.equal(first, 1) - t.equal(second, 2) - t.equal(third, 3) - }) - t.ok(a, 'first returned cb function') - - var b = inf('key', function (first, second, third) { - t.equal(first, 1) - t.equal(second, 2) - t.equal(third, 3) - }) - t.notOk(b, 'second should get falsey inflight response') - - setTimeout(function () { - a(1, 2, 3) - }) -}) diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/LICENSE b/node_modules/tap/node_modules/glob/node_modules/minimatch/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/README.md b/node_modules/tap/node_modules/glob/node_modules/minimatch/README.md deleted file mode 100644 index d458bc2e..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/README.md +++ /dev/null @@ -1,216 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Minimatch Class - -Create a minimatch object by instanting the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself if this option is set. When not set, an empty list -is returned if there are no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/browser.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/browser.js deleted file mode 100644 index 967b45c0..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/browser.js +++ /dev/null @@ -1,1113 +0,0 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var plType - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - plType = stateChar - patternListStack.push({ type: plType, start: i - 1, reStart: re.length }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - re += ')' - plType = patternListStack.pop().type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case '!': - re += '[^/]*?)' - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway - } - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (var pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) re = '(?=.)' + re - - if (addPatternStart) re = patternStart + re - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} - -},{"brace-expansion":2,"path":undefined}],2:[function(require,module,exports){ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - var expansions = expand(escapeBraces(str)); - return expansions.filter(identity).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = /^(.*,)+(.+)?$/.test(m.body); - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0]).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - expansions.push([pre, N[j], post[k]].join('')) - } - } - - return expansions; -} - - -},{"balanced-match":3,"concat-map":4}],3:[function(require,module,exports){ -module.exports = balanced; -function balanced(a, b, str) { - var bal = 0; - var m = {}; - var ended = false; - - for (var i = 0; i < str.length; i++) { - if (a == str.substr(i, a.length)) { - if (!('start' in m)) m.start = i; - bal++; - } - else if (b == str.substr(i, b.length) && 'start' in m) { - ended = true; - bal--; - if (!bal) { - m.end = i; - m.pre = str.substr(0, m.start); - m.body = (m.end - m.start > 1) - ? str.substring(m.start + a.length, m.end) - : ''; - m.post = str.slice(m.end + b.length); - return m; - } - } - } - - // if we opened more than we closed, find the one we closed - if (bal && ended) { - var start = m.start + a.length; - m = balanced(a, b, str.substr(start)); - if (m) { - m.start += start; - m.end += start; - m.pre = str.slice(0, start) + m.pre; - } - return m; - } -} - -},{}],4:[function(require,module,exports){ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (Array.isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -},{}]},{},[1]); diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/minimatch.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/minimatch.js deleted file mode 100644 index 5e13d6d5..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,867 +0,0 @@ -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = require('path') -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var plType - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - plType = stateChar - patternListStack.push({ type: plType, start: i - 1, reStart: re.length }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - re += ')' - plType = patternListStack.pop().type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case '!': - re += '[^/]*?)' - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway - } - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (var pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) re = '(?=.)' + re - - if (addPatternStart) re = patternStart + re - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore deleted file mode 100644 index 249bc20e..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -*.sw* diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml deleted file mode 100644 index 6e5919de..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md deleted file mode 100644 index 62bc7bae..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js deleted file mode 100644 index 60ecfc74..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +++ /dev/null @@ -1,8 +0,0 @@ -var expand = require('./'); - -console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); -console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); -console.log(expand('http://www.letters.com/file{a..z..2}.txt')); -console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); -console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); - diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js deleted file mode 100644 index a23104e9..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,191 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = /^(.*,)+(.+)?$/.test(m.body); - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore deleted file mode 100644 index fd4f2b06..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -.DS_Store diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml deleted file mode 100644 index cc4dba29..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile deleted file mode 100644 index fa5da71a..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +++ /dev/null @@ -1,6 +0,0 @@ - -test: - @node_modules/.bin/tape test/*.js - -.PHONY: test - diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md deleted file mode 100644 index 2aff0ebf..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js deleted file mode 100644 index c02ad348..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +++ /dev/null @@ -1,5 +0,0 @@ -var balanced = require('./'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); - diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js deleted file mode 100644 index d165ae81..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = balanced; -function balanced(a, b, str) { - var bal = 0; - var m = {}; - var ended = false; - - for (var i = 0; i < str.length; i++) { - if (a == str.substr(i, a.length)) { - if (!('start' in m)) m.start = i; - bal++; - } - else if (b == str.substr(i, b.length) && 'start' in m) { - ended = true; - bal--; - if (!bal) { - m.end = i; - m.pre = str.substr(0, m.start); - m.body = (m.end - m.start > 1) - ? str.substring(m.start + a.length, m.end) - : ''; - m.post = str.slice(m.end + b.length); - return m; - } - } - } - - // if we opened more than we closed, find the one we closed - if (bal && ended) { - var start = m.start + a.length; - m = balanced(a, b, str.substr(start)); - if (m) { - m.start += start; - m.end += start; - m.pre = str.slice(0, start) + m.pre; - } - return m; - } -} diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json deleted file mode 100644 index 35332a3c..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "0.2.0", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "make test" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~1.1.1" - }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "readme": "# balanced-match\n\nMatch balanced string pairs, like `{` and `}` or `` and ``.\n\n[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match)\n[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)\n\n[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match)\n\n## Example\n\nGet the first matching pair of braces:\n\n```js\nvar balanced = require('balanced-match');\n\nconsole.log(balanced('{', '}', 'pre{in{nested}}post'));\nconsole.log(balanced('{', '}', 'pre{first}between{second}post'));\n```\n\nThe matches are:\n\n```bash\n$ node example.js\n{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }\n{ start: 3,\n end: 9,\n pre: 'pre',\n body: 'first',\n post: 'between{second}post' }\n```\n\n## API\n\n### var m = balanced(a, b, str)\n\nFor the first non-nested matching pair of `a` and `b` in `str`, return an\nobject with those keys:\n\n* **start** the index of the first match of `a`\n* **end** the index of the matching `b`\n* **pre** the preamble, `a` and `b` not included\n* **body** the match, `a` and `b` not included\n* **post** the postscript, `a` and `b` not included\n\nIf there's no match, `undefined` will be returned.\n\nIf the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`.\n\n## Installation\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install balanced-match\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/juliangruber/balanced-match/issues" - }, - "_id": "balanced-match@0.2.0", - "_shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz", - "_from": "balanced-match@>=0.2.0 <0.3.0" -} diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js deleted file mode 100644 index 36bfd399..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +++ /dev/null @@ -1,56 +0,0 @@ -var test = require('tape'); -var balanced = require('..'); - -test('balanced', function(t) { - t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { - start: 3, - end: 12, - pre: 'pre', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { - start: 8, - end: 11, - pre: '{{{{{{{{', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { - start: 8, - end: 11, - pre: 'pre{body', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { - start: 4, - end: 13, - pre: 'pre}', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'body', - post: 'between{body2}post' - }); - t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 3, - end: 19, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 7, - end: 23, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.end(); -}); diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml deleted file mode 100644 index f1d0f13c..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE deleted file mode 100644 index ee27ba4b..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -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/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown deleted file mode 100644 index 408f70a1..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +++ /dev/null @@ -1,62 +0,0 @@ -concat-map -========== - -Concatenative mapdashery. - -[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) - -[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) - -example -======= - -``` js -var concatMap = require('concat-map'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); -``` - -*** - -``` -[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] -``` - -methods -======= - -``` js -var concatMap = require('concat-map') -``` - -concatMap(xs, fn) ------------------ - -Return an array of concatenated elements by calling `fn(x, i)` for each element -`x` and each index `i` in the array `xs`. - -When `fn(x, i)` returns an array, its result will be concatenated with the -result array. If `fn(x, i)` returns anything else, that value will be pushed -onto the end of the result array. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install concat-map -``` - -license -======= - -MIT - -notes -===== - -This module was written while sitting high above the ground in a tree. diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js deleted file mode 100644 index 33656217..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +++ /dev/null @@ -1,6 +0,0 @@ -var concatMap = require('../'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js deleted file mode 100644 index b29a7812..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json deleted file mode 100644 index 325a5625..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "concat-map", - "description": "concatenative mapdashery", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-concat-map.git" - }, - "main": "index.js", - "keywords": [ - "concat", - "concatMap", - "map", - "functional", - "higher-order" - ], - "directories": { - "example": "example", - "test": "test" - }, - "scripts": { - "test": "tape test/*.js" - }, - "devDependencies": { - "tape": "~2.4.0" - }, - "license": "MIT", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "testling": { - "files": "test/*.js", - "browsers": { - "ie": [ - 6, - 7, - 8, - 9 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "chrome": [ - 10, - 22 - ], - "safari": [ - 5.1 - ], - "opera": [ - 12 - ] - } - }, - "readme": "concat-map\n==========\n\nConcatenative mapdashery.\n\n[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map)\n\n[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map)\n\nexample\n=======\n\n``` js\nvar concatMap = require('concat-map');\nvar xs = [ 1, 2, 3, 4, 5, 6 ];\nvar ys = concatMap(xs, function (x) {\n return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];\n});\nconsole.dir(ys);\n```\n\n***\n\n```\n[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]\n```\n\nmethods\n=======\n\n``` js\nvar concatMap = require('concat-map')\n```\n\nconcatMap(xs, fn)\n-----------------\n\nReturn an array of concatenated elements by calling `fn(x, i)` for each element\n`x` and each index `i` in the array `xs`.\n\nWhen `fn(x, i)` returns an array, its result will be concatenated with the\nresult array. If `fn(x, i)` returns anything else, that value will be pushed\nonto the end of the result array.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install concat-map\n```\n\nlicense\n=======\n\nMIT\n\nnotes\n=====\n\nThis module was written while sitting high above the ground in a tree.\n", - "readmeFilename": "README.markdown", - "bugs": { - "url": "https://github.com/substack/node-concat-map/issues" - }, - "homepage": "https://github.com/substack/node-concat-map", - "_id": "concat-map@0.0.1", - "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "_from": "concat-map@0.0.1" -} diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js deleted file mode 100644 index fdbd7022..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +++ /dev/null @@ -1,39 +0,0 @@ -var concatMap = require('../'); -var test = require('tape'); - -test('empty or not', function (t) { - var xs = [ 1, 2, 3, 4, 5, 6 ]; - var ixes = []; - var ys = concatMap(xs, function (x, ix) { - ixes.push(ix); - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; - }); - t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); - t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); - t.end(); -}); - -test('always something', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('scalars', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : x; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('undefs', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function () {}); - t.same(ys, [ undefined, undefined, undefined, undefined ]); - t.end(); -}); diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json deleted file mode 100644 index ba78e62a..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.0", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "main": "index.js", - "scripts": { - "test": "tape test/*.js", - "gentest": "bash test/generate.sh" - }, - "dependencies": { - "balanced-match": "^0.2.0", - "concat-map": "0.0.1" - }, - "devDependencies": { - "tape": "^3.0.3" - }, - "keywords": [], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "readme": "# brace-expansion\n\n[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), \nas known from sh/bash, in JavaScript.\n\n[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion)\n\n[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion)\n\n## Example\n\n```js\nvar expand = require('brace-expansion');\n\nexpand('file-{a,b,c}.jpg')\n// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']\n\nexpand('-v{,,}')\n// => ['-v', '-v', '-v']\n\nexpand('file{0..2}.jpg')\n// => ['file0.jpg', 'file1.jpg', 'file2.jpg']\n\nexpand('file-{a..c}.jpg')\n// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']\n\nexpand('file{2..0}.jpg')\n// => ['file2.jpg', 'file1.jpg', 'file0.jpg']\n\nexpand('file{0..4..2}.jpg')\n// => ['file0.jpg', 'file2.jpg', 'file4.jpg']\n\nexpand('file-{a..e..2}.jpg')\n// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']\n\nexpand('file{00..10..5}.jpg')\n// => ['file00.jpg', 'file05.jpg', 'file10.jpg']\n\nexpand('{{A..C},{a..c}}')\n// => ['A', 'B', 'C', 'a', 'b', 'c']\n\nexpand('ppp{,config,oe{,conf}}')\n// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']\n```\n\n## API\n\n```js\nvar expand = require('brace-expansion');\n```\n\n### var expanded = expand(str)\n\nReturn an array of all possible and valid expansions of `str`. If none are\nfound, `[str]` is returned.\n\nValid expansions are:\n\n```js\n/^(.*,)+(.+)?$/\n// {a,b,...}\n```\n\nA comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.\n\n```js\n/^-?\\d+\\.\\.-?\\d+(\\.\\.-?\\d+)?$/\n// {x..y[..incr]}\n```\n\nA numeric sequence from `x` to `y` inclusive, with optional increment.\nIf `x` or `y` start with a leading `0`, all the numbers will be padded\nto have equal length. Negative numbers and backwards iteration work too.\n\n```js\n/^-?\\d+\\.\\.-?\\d+(\\.\\.-?\\d+)?$/\n// {x..y[..incr]}\n```\n\nAn alphabetic sequence from `x` to `y` inclusive, with optional increment.\n`x` and `y` must be exactly one character, and if given, `incr` must be a\nnumber.\n\nFor compatibility reasons, the string `${` is not eligible for brace expansion.\n\n## Installation\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install brace-expansion\n```\n\n## Contributors\n\n- [Julian Gruber](https://github.com/juliangruber)\n- [Isaac Z. Schlueter](https://github.com/isaacs)\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/juliangruber/brace-expansion/issues" - }, - "_id": "brace-expansion@1.1.0", - "_shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz", - "_from": "brace-expansion@>=1.0.0 <2.0.0" -} diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js deleted file mode 100644 index 5fe2b8ad..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +++ /dev/null @@ -1,32 +0,0 @@ -var test = require('tape'); -var expand = require('..'); -var fs = require('fs'); -var resfile = __dirname + '/bash-results.txt'; -var cases = fs.readFileSync(resfile, 'utf8').split('><><><><'); - -// throw away the EOF marker -cases.pop() - -test('matches bash expansions', function(t) { - cases.forEach(function(testcase) { - var set = testcase.split('\n'); - var pattern = set.shift(); - var actual = expand(pattern); - - // If it expands to the empty string, then it's actually - // just nothing, but Bash is a singly typed language, so - // "nothing" is the same as "". - if (set.length === 1 && set[0] === '') { - set = [] - } else { - // otherwise, strip off the [] that were added so that - // "" expansions would be preserved properly. - set = set.map(function (s) { - return s.replace(/^\[|\]$/g, '') - }) - } - - t.same(actual, set, pattern); - }); - t.end(); -}) diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt deleted file mode 100644 index 958148d2..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +++ /dev/null @@ -1,1075 +0,0 @@ -A{b,{d,e},{f,g}}Z -[AbZ] -[AdZ] -[AeZ] -[AfZ] -[AgZ]><><><><><><><\{a,b}{{a,b},a,b} -[{a,b}a] -[{a,b}b] -[{a,b}a] -[{a,b}b]><><><><{{a,b} -[{a] -[{b]><><><><{a,b}} -[a}] -[b}]><><><><{,} -><><><><><><><{,}b -[b] -[b]><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><{-01..5} -[-01] -[000] -[001] -[002] -[003] -[004] -[005]><><><><{-05..100..5} -[-05] -[000] -[005] -[010] -[015] -[020] -[025] -[030] -[035] -[040] -[045] -[050] -[055] -[060] -[065] -[070] -[075] -[080] -[085] -[090] -[095] -[100]><><><><{-05..100} -[-05] -[-04] -[-03] -[-02] -[-01] -[000] -[001] -[002] -[003] -[004] -[005] -[006] -[007] -[008] -[009] -[010] -[011] -[012] -[013] -[014] -[015] -[016] -[017] -[018] -[019] -[020] -[021] -[022] -[023] -[024] -[025] -[026] -[027] -[028] -[029] -[030] -[031] -[032] -[033] -[034] -[035] -[036] -[037] -[038] -[039] -[040] -[041] -[042] -[043] -[044] -[045] -[046] -[047] -[048] -[049] -[050] -[051] -[052] -[053] -[054] -[055] -[056] -[057] -[058] -[059] -[060] -[061] -[062] -[063] -[064] -[065] -[066] -[067] -[068] -[069] -[070] -[071] -[072] -[073] -[074] -[075] -[076] -[077] -[078] -[079] -[080] -[081] -[082] -[083] -[084] -[085] -[086] -[087] -[088] -[089] -[090] -[091] -[092] -[093] -[094] -[095] -[096] -[097] -[098] -[099] -[100]><><><><{0..5..2} -[0] -[2] -[4]><><><><{0001..05..2} -[0001] -[0003] -[0005]><><><><{0001..-5..2} -[0001] -[-001] -[-003] -[-005]><><><><{0001..-5..-2} -[0001] -[-001] -[-003] -[-005]><><><><{0001..5..-2} -[0001] -[0003] -[0005]><><><><{01..5} -[01] -[02] -[03] -[04] -[05]><><><><{1..05} -[01] -[02] -[03] -[04] -[05]><><><><{1..05..3} -[01] -[04]><><><><{05..100} -[005] -[006] -[007] -[008] -[009] -[010] -[011] -[012] -[013] -[014] -[015] -[016] -[017] -[018] -[019] -[020] -[021] -[022] -[023] -[024] -[025] -[026] -[027] -[028] -[029] -[030] -[031] -[032] -[033] -[034] -[035] -[036] -[037] -[038] -[039] -[040] -[041] -[042] -[043] -[044] -[045] -[046] -[047] -[048] -[049] -[050] -[051] -[052] -[053] -[054] -[055] -[056] -[057] -[058] -[059] -[060] -[061] -[062] -[063] -[064] -[065] -[066] -[067] -[068] -[069] -[070] -[071] -[072] -[073] -[074] -[075] -[076] -[077] -[078] -[079] -[080] -[081] -[082] -[083] -[084] -[085] -[086] -[087] -[088] -[089] -[090] -[091] -[092] -[093] -[094] -[095] -[096] -[097] -[098] -[099] -[100]><><><><{0a..0z} -[{0a..0z}]><><><><{a,b\}c,d} -[a] -[b}c] -[d]><><><><{a,b{c,d} -[{a,bc] -[{a,bd]><><><><{a,b}c,d} -[ac,d}] -[bc,d}]><><><><{a..F} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F]><><><><{A..f} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a] -[b] -[c] -[d] -[e] -[f]><><><><{a..Z} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z]><><><><{A..z} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a] -[b] -[c] -[d] -[e] -[f] -[g] -[h] -[i] -[j] -[k] -[l] -[m] -[n] -[o] -[p] -[q] -[r] -[s] -[t] -[u] -[v] -[w] -[x] -[y] -[z]><><><><{z..A} -[z] -[y] -[x] -[w] -[v] -[u] -[t] -[s] -[r] -[q] -[p] -[o] -[n] -[m] -[l] -[k] -[j] -[i] -[h] -[g] -[f] -[e] -[d] -[c] -[b] -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F] -[E] -[D] -[C] -[B] -[A]><><><><{Z..a} -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a]><><><><{a..F..2} -[a] -[_] -[]] -[[] -[Y] -[W] -[U] -[S] -[Q] -[O] -[M] -[K] -[I] -[G]><><><><{A..f..02} -[A] -[C] -[E] -[G] -[I] -[K] -[M] -[O] -[Q] -[S] -[U] -[W] -[Y] -[[] -[]] -[_] -[a] -[c] -[e]><><><><{a..Z..5} -[a] -[]><><><><><><><{A..z..10} -[A] -[K] -[U] -[_] -[i] -[s]><><><><{z..A..-2} -[z] -[x] -[v] -[t] -[r] -[p] -[n] -[l] -[j] -[h] -[f] -[d] -[b] -[`] -[^] -[] -[Z] -[X] -[V] -[T] -[R] -[P] -[N] -[L] -[J] -[H] -[F] -[D] -[B]><><><><{Z..a..20} -[Z]><><><><{a{,b} -[{a] -[{ab]><><><><{a},b} -[a}] -[b]><><><><{x,y{,}g} -[x] -[yg] -[yg]><><><><{x,y{}g} -[x] -[y{}g]><><><><{{a,b} -[{a] -[{b]><><><><{{a,b},c} -[a] -[b] -[c]><><><><{{a,b}c} -[{ac}] -[{bc}]><><><><{{a,b},} -[a] -[b]><><><><><><><{{a,b},}c -[ac] -[bc] -[c]><><><><{{a,b}.} -[{a.}] -[{b.}]><><><><{{a,b}} -[{a}] -[{b}]><><><><><><>< -><><><><{-10..00} -[-10] -[-09] -[-08] -[-07] -[-06] -[-05] -[-04] -[-03] -[-02] -[-01] -[000]><><><><{a,\\{a,b}c} -[a] -[\ac] -[\bc]><><><><{a,\{a,b}c} -[ac}] -[{ac}] -[bc}]><><><><><><><{-10.\.00} -[{-10..00}]><><><><><><><><><><{l,n,m}xyz -[lxyz] -[nxyz] -[mxyz]><><><><{abc\,def} -[{abc,def}]><><><><{abc} -[{abc}]><><><><{x\,y,\{abc\},trie} -[x,y] -[{abc}] -[trie]><><><><{} -[{}]><><><><} -[}]><><><><{ -[{]><><><><><><><{1..10} -[1] -[2] -[3] -[4] -[5] -[6] -[7] -[8] -[9] -[10]><><><><{0..10,braces} -[0..10] -[braces]><><><><{{0..10},braces} -[0] -[1] -[2] -[3] -[4] -[5] -[6] -[7] -[8] -[9] -[10] -[braces]><><><><><><><{3..3} -[3]><><><><><><><{10..1} -[10] -[9] -[8] -[7] -[6] -[5] -[4] -[3] -[2] -[1]><><><><{10..1}y -[10y] -[9y] -[8y] -[7y] -[6y] -[5y] -[4y] -[3y] -[2y] -[1y]><><><><><><><{a..f} -[a] -[b] -[c] -[d] -[e] -[f]><><><><{f..a} -[f] -[e] -[d] -[c] -[b] -[a]><><><><{a..A} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F] -[E] -[D] -[C] -[B] -[A]><><><><{A..a} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a]><><><><{f..f} -[f]><><><><{1..f} -[{1..f}]><><><><{f..1} -[{f..1}]><><><><{-1..-10} -[-1] -[-2] -[-3] -[-4] -[-5] -[-6] -[-7] -[-8] -[-9] -[-10]><><><><{-20..0} -[-20] -[-19] -[-18] -[-17] -[-16] -[-15] -[-14] -[-13] -[-12] -[-11] -[-10] -[-9] -[-8] -[-7] -[-6] -[-5] -[-4] -[-3] -[-2] -[-1] -[0]><><><><><><><><><><{klklkl}{1,2,3} -[{klklkl}1] -[{klklkl}2] -[{klklkl}3]><><><><{1..10..2} -[1] -[3] -[5] -[7] -[9]><><><><{-1..-10..2} -[-1] -[-3] -[-5] -[-7] -[-9]><><><><{-1..-10..-2} -[-1] -[-3] -[-5] -[-7] -[-9]><><><><{10..1..-2} -[10] -[8] -[6] -[4] -[2]><><><><{10..1..2} -[10] -[8] -[6] -[4] -[2]><><><><{1..20..2} -[1] -[3] -[5] -[7] -[9] -[11] -[13] -[15] -[17] -[19]><><><><{1..20..20} -[1]><><><><{100..0..5} -[100] -[95] -[90] -[85] -[80] -[75] -[70] -[65] -[60] -[55] -[50] -[45] -[40] -[35] -[30] -[25] -[20] -[15] -[10] -[5] -[0]><><><><{100..0..-5} -[100] -[95] -[90] -[85] -[80] -[75] -[70] -[65] -[60] -[55] -[50] -[45] -[40] -[35] -[30] -[25] -[20] -[15] -[10] -[5] -[0]><><><><{a..z} -[a] -[b] -[c] -[d] -[e] -[f] -[g] -[h] -[i] -[j] -[k] -[l] -[m] -[n] -[o] -[p] -[q] -[r] -[s] -[t] -[u] -[v] -[w] -[x] -[y] -[z]><><><><{a..z..2} -[a] -[c] -[e] -[g] -[i] -[k] -[m] -[o] -[q] -[s] -[u] -[w] -[y]><><><><{z..a..-2} -[z] -[x] -[v] -[t] -[r] -[p] -[n] -[l] -[j] -[h] -[f] -[d] -[b]><><><><{2147483645..2147483649} -[2147483645] -[2147483646] -[2147483647] -[2147483648] -[2147483649]><><><><{10..0..2} -[10] -[8] -[6] -[4] -[2] -[0]><><><><{10..0..-2} -[10] -[8] -[6] -[4] -[2] -[0]><><><><{-50..-0..5} -[-50] -[-45] -[-40] -[-35] -[-30] -[-25] -[-20] -[-15] -[-10] -[-5] -[0]><><><><{1..10.f} -[{1..10.f}]><><><><{1..ff} -[{1..ff}]><><><><{1..10..ff} -[{1..10..ff}]><><><><{1.20..2} -[{1.20..2}]><><><><{1..20..f2} -[{1..20..f2}]><><><><{1..20..2f} -[{1..20..2f}]><><><><{1..2f..2} -[{1..2f..2}]><><><><{1..ff..2} -[{1..ff..2}]><><><><{1..ff} -[{1..ff}]><><><><{1..f} -[{1..f}]><><><><{1..0f} -[{1..0f}]><><><><{1..10f} -[{1..10f}]><><><><{1..10.f} -[{1..10.f}]><><><><{1..10.f} -[{1..10.f}]><><><>< \ No newline at end of file diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt deleted file mode 100644 index e5161c3d..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +++ /dev/null @@ -1,182 +0,0 @@ -# skip quotes for now -# "{x,x}" -# {"x,x"} -# {x","x} -# '{a,b}{{a,b},a,b}' -A{b,{d,e},{f,g}}Z -PRE-{a,b}{{a,b},a,b}-POST -\\{a,b}{{a,b},a,b} -{{a,b} -{a,b}} -{,} -a{,} -{,}b -a{,}b -a{b}c -a{1..5}b -a{01..5}b -a{-01..5}b -a{-01..5..3}b -a{001..9}b -a{b,c{d,e},{f,g}h}x{y,z -a{b,c{d,e},{f,g}h}x{y,z\\} -a{b,c{d,e},{f,g}h}x{y,z} -a{b{c{d,e}f{x,y{{g}h -a{b{c{d,e}f{x,y{}g}h -a{b{c{d,e}f{x,y}}g}h -a{b{c{d,e}f}g}h -a{{x,y},z}b -f{x,y{g,z}}h -f{x,y{{g,z}}h -f{x,y{{g,z}}h} -f{x,y{{g}h -f{x,y{{g}}h -f{x,y{}g}h -z{a,b{,c}d -z{a,b},c}d -{-01..5} -{-05..100..5} -{-05..100} -{0..5..2} -{0001..05..2} -{0001..-5..2} -{0001..-5..-2} -{0001..5..-2} -{01..5} -{1..05} -{1..05..3} -{05..100} -{0a..0z} -{a,b\\}c,d} -{a,b{c,d} -{a,b}c,d} -{a..F} -{A..f} -{a..Z} -{A..z} -{z..A} -{Z..a} -{a..F..2} -{A..f..02} -{a..Z..5} -d{a..Z..5}b -{A..z..10} -{z..A..-2} -{Z..a..20} -{a{,b} -{a},b} -{x,y{,}g} -{x,y{}g} -{{a,b} -{{a,b},c} -{{a,b}c} -{{a,b},} -X{{a,b},}X -{{a,b},}c -{{a,b}.} -{{a,b}} -X{a..#}X -# this next one is an empty string - -{-10..00} -# Need to escape slashes in here for reasons i guess. -{a,\\\\{a,b}c} -{a,\\{a,b}c} -a,\\{b,c} -{-10.\\.00} -#### bash tests/braces.tests -# Note that some tests are edited out because some features of -# bash are intentionally not supported in this brace expander. -ff{c,b,a} -f{d,e,f}g -{l,n,m}xyz -{abc\\,def} -{abc} -{x\\,y,\\{abc\\},trie} -# not impementing back-ticks obviously -# XXXX\\{`echo a b c | tr ' ' ','`\\} -{} -# We only ever have to worry about parsing a single argument, -# not a command line, so spaces have a different meaning than bash. -# { } -} -{ -abcd{efgh -# spaces -# foo {1,2} bar -# not impementing back-ticks obviously -# `zecho foo {1,2} bar` -# $(zecho foo {1,2} bar) -# ${var} is not a variable here, like it is in bash. omit. -# foo{bar,${var}.} -# foo{bar,${var}} -# isaacs: skip quotes for now -# "${var}"{x,y} -# $var{x,y} -# ${var}{x,y} -# new sequence brace operators -{1..10} -# this doesn't work yet -{0..10,braces} -# but this does -{{0..10},braces} -x{{0..10},braces}y -{3..3} -x{3..3}y -{10..1} -{10..1}y -x{10..1}y -{a..f} -{f..a} -{a..A} -{A..a} -{f..f} -# mixes are incorrectly-formed brace expansions -{1..f} -{f..1} -# spaces -# 0{1..9} {10..20} -# do negative numbers work? -{-1..-10} -{-20..0} -# weirdly-formed brace expansions -- fixed in post-bash-3.1 -a-{b{d,e}}-c -a-{bdef-{g,i}-c -# isaacs: skip quotes for now -# {"klklkl"}{1,2,3} -# isaacs: this is a valid test, though -{klklkl}{1,2,3} -# {"x,x"} -{1..10..2} -{-1..-10..2} -{-1..-10..-2} -{10..1..-2} -{10..1..2} -{1..20..2} -{1..20..20} -{100..0..5} -{100..0..-5} -{a..z} -{a..z..2} -{z..a..-2} -# make sure brace expansion handles ints > 2**31 - 1 using intmax_t -{2147483645..2147483649} -# unwanted zero-padding -- fixed post-bash-4.0 -{10..0..2} -{10..0..-2} -{-50..-0..5} -# bad -{1..10.f} -{1..ff} -{1..10..ff} -{1.20..2} -{1..20..f2} -{1..20..2f} -{1..2f..2} -{1..ff..2} -{1..ff} -{1..f} -{1..0f} -{1..10f} -{1..10.f} -{1..10.f} diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js deleted file mode 100644 index 3fcc185a..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('ignores ${', function(t) { - t.deepEqual(expand('${1..3}'), ['${1..3}']); - t.deepEqual(expand('${a,b}${c,d}'), ['${a,b}${c,d}']); - t.deepEqual(expand('x${a,b}x${c,d}x'), ['x${a,b}x${c,d}x']); - t.end(); -}); diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js deleted file mode 100644 index e429121e..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('empty option', function(t) { - t.deepEqual(expand('-v{,,,,}'), [ - '-v', '-v', '-v', '-v', '-v' - ]); - t.end(); -}); - diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh deleted file mode 100644 index e040e664..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Bash 4.3 because of arbitrary need to pick a single standard. - -if [ "${BASH_VERSINFO[0]}" != "4" ] || [ "${BASH_VERSINFO[1]}" != "3" ]; then - echo "this script requires bash 4.3" >&2 - exit 1 -fi - -CDPATH= cd "$(dirname "$0")" - -js='require("./")(process.argv[1]).join(" ")' - -cat cases.txt | \ - while read case; do - if [ "${case:0:1}" = "#" ]; then - continue; - fi; - b="$($BASH -c 'for c in '"$case"'; do echo ["$c"]; done')" - echo "$case" - echo -n "$b><><><><"; - done > bash-results.txt diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js deleted file mode 100644 index 8d434c23..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('negative increment', function(t) { - t.deepEqual(expand('{3..1}'), ['3', '2', '1']); - t.deepEqual(expand('{10..8}'), ['10', '9', '8']); - t.deepEqual(expand('{10..08}'), ['10', '09', '08']); - t.deepEqual(expand('{c..a}'), ['c', 'b', 'a']); - - t.deepEqual(expand('{4..0..2}'), ['4', '2', '0']); - t.deepEqual(expand('{4..0..-2}'), ['4', '2', '0']); - t.deepEqual(expand('{e..a..2}'), ['e', 'c', 'a']); - - t.end(); -}); diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js deleted file mode 100644 index 0862dc51..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('nested', function(t) { - t.deepEqual(expand('{a,b{1..3},c}'), [ - 'a', 'b1', 'b2', 'b3', 'c' - ]); - t.deepEqual(expand('{{A..Z},{a..z}}'), - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('') - ); - t.deepEqual(expand('ppp{,config,oe{,conf}}'), [ - 'ppp', 'pppconfig', 'pppoe', 'pppoeconf' - ]); - t.end(); -}); - diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js deleted file mode 100644 index c00ad155..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('order', function(t) { - t.deepEqual(expand('a{d,c,b}e'), [ - 'ade', 'ace', 'abe' - ]); - t.end(); -}); - diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js deleted file mode 100644 index e4158775..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +++ /dev/null @@ -1,13 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('pad', function(t) { - t.deepEqual(expand('{9..11}'), [ - '9', '10', '11' - ]); - t.deepEqual(expand('{09..11}'), [ - '09', '10', '11' - ]); - t.end(); -}); - diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js deleted file mode 100644 index 3038fba7..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +++ /dev/null @@ -1,7 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('x and y of same type', function(t) { - t.deepEqual(expand('{a..9}'), ['{a..9}']); - t.end(); -}); diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js b/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js deleted file mode 100644 index f73a9579..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +++ /dev/null @@ -1,50 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('numeric sequences', function(t) { - t.deepEqual(expand('a{1..2}b{2..3}c'), [ - 'a1b2c', 'a1b3c', 'a2b2c', 'a2b3c' - ]); - t.deepEqual(expand('{1..2}{2..3}'), [ - '12', '13', '22', '23' - ]); - t.end(); -}); - -test('numeric sequences with step count', function(t) { - t.deepEqual(expand('{0..8..2}'), [ - '0', '2', '4', '6', '8' - ]); - t.deepEqual(expand('{1..8..2}'), [ - '1', '3', '5', '7' - ]); - t.end(); -}); - -test('numeric sequence with negative x / y', function(t) { - t.deepEqual(expand('{3..-2}'), [ - '3', '2', '1', '0', '-1', '-2' - ]); - t.end(); -}); - -test('alphabetic sequences', function(t) { - t.deepEqual(expand('1{a..b}2{b..c}3'), [ - '1a2b3', '1a2c3', '1b2b3', '1b2c3' - ]); - t.deepEqual(expand('{a..b}{b..c}'), [ - 'ab', 'ac', 'bb', 'bc' - ]); - t.end(); -}); - -test('alphabetic sequences with step count', function(t) { - t.deepEqual(expand('{a..k..2}'), [ - 'a', 'c', 'e', 'g', 'i', 'k' - ]); - t.deepEqual(expand('{b..k..2}'), [ - 'b', 'd', 'f', 'h', 'j' - ]); - t.end(); -}); - diff --git a/node_modules/tap/node_modules/glob/node_modules/minimatch/package.json b/node_modules/tap/node_modules/glob/node_modules/minimatch/package.json deleted file mode 100644 index b438bdb9..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/minimatch/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "2.0.7", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "pretest": "standard minimatch.js test/*.js", - "test": "tap test/*.js", - "prepublish": "browserify -o browser.js -e minimatch.js --bare" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "brace-expansion": "^1.0.0" - }, - "devDependencies": { - "browserify": "^9.0.3", - "standard": "^3.7.2", - "tap": "" - }, - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" - }, - "files": [ - "minimatch.js", - "browser.js" - ], - "gitHead": "4bd6dc22c248c7ea07cc49d63181fe6f6aafae9c", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "homepage": "https://github.com/isaacs/minimatch", - "_id": "minimatch@2.0.7", - "_shasum": "d23652ab10e663e7d914602e920e21f9f66492be", - "_from": "minimatch@>=2.0.1 <3.0.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "1.7.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "d23652ab10e663e7d914602e920e21f9f66492be", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.7.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.7.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/tap/node_modules/glob/node_modules/once/LICENSE b/node_modules/tap/node_modules/glob/node_modules/once/LICENSE deleted file mode 100644 index 0c44ae71..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/once/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/tap/node_modules/glob/node_modules/once/README.md b/node_modules/tap/node_modules/glob/node_modules/once/README.md deleted file mode 100644 index a2981ea0..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/once/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# once - -Only call a function once. - -## usage - -```javascript -var once = require('once') - -function load (file, cb) { - cb = once(cb) - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Or add to the Function.prototype in a responsible way: - -```javascript -// only has to be done once -require('once').proto() - -function load (file, cb) { - cb = cb.once() - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Ironically, the prototype feature makes this module twice as -complicated as necessary. - -To check whether you function has been called, use `fn.called`. Once the -function is called for the first time the return value of the original -function is saved in `fn.value` and subsequent calls will continue to -return this value. - -```javascript -var once = require('once') - -function load (cb) { - cb = once(cb) - var stream = createStream() - stream.once('data', cb) - stream.once('end', function () { - if (!cb.called) cb(new Error('not found')) - }) -} -``` diff --git a/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE b/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE deleted file mode 100644 index 19129e31..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/README.md b/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/README.md deleted file mode 100644 index 98eab252..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# wrappy - -Callback wrapping utility - -## USAGE - -```javascript -var wrappy = require("wrappy") - -// var wrapper = wrappy(wrapperFunction) - -// make sure a cb is called only once -// See also: http://npm.im/once for this specific use case -var once = wrappy(function (cb) { - var called = false - return function () { - if (called) return - called = true - return cb.apply(this, arguments) - } -}) - -function printBoo () { - console.log('boo') -} -// has some rando property -printBoo.iAmBooPrinter = true - -var onlyPrintOnce = once(printBoo) - -onlyPrintOnce() // prints 'boo' -onlyPrintOnce() // does nothing - -// random property is retained! -assert.equal(onlyPrintOnce.iAmBooPrinter, true) -``` diff --git a/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/package.json b/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/package.json deleted file mode 100644 index 2b8e311c..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "wrappy", - "version": "1.0.1", - "description": "Callback wrapping utility", - "main": "wrappy.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "^0.4.12" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/npm/wrappy.git" - }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/wrappy/issues" - }, - "homepage": "https://github.com/npm/wrappy", - "readme": "# wrappy\n\nCallback wrapping utility\n\n## USAGE\n\n```javascript\nvar wrappy = require(\"wrappy\")\n\n// var wrapper = wrappy(wrapperFunction)\n\n// make sure a cb is called only once\n// See also: http://npm.im/once for this specific use case\nvar once = wrappy(function (cb) {\n var called = false\n return function () {\n if (called) return\n called = true\n return cb.apply(this, arguments)\n }\n})\n\nfunction printBoo () {\n console.log('boo')\n}\n// has some rando property\nprintBoo.iAmBooPrinter = true\n\nvar onlyPrintOnce = once(printBoo)\n\nonlyPrintOnce() // prints 'boo'\nonlyPrintOnce() // does nothing\n\n// random property is retained!\nassert.equal(onlyPrintOnce.iAmBooPrinter, true)\n```\n", - "readmeFilename": "README.md", - "_id": "wrappy@1.0.1", - "_shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739", - "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", - "_from": "wrappy@>=1.0.0 <2.0.0" -} diff --git a/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js b/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js deleted file mode 100644 index 5ed0fcdf..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +++ /dev/null @@ -1,51 +0,0 @@ -var test = require('tap').test -var wrappy = require('../wrappy.js') - -test('basic', function (t) { - function onceifier (cb) { - var called = false - return function () { - if (called) return - called = true - return cb.apply(this, arguments) - } - } - onceifier.iAmOnce = {} - var once = wrappy(onceifier) - t.equal(once.iAmOnce, onceifier.iAmOnce) - - var called = 0 - function boo () { - t.equal(called, 0) - called++ - } - // has some rando property - boo.iAmBoo = true - - var onlyPrintOnce = once(boo) - - onlyPrintOnce() // prints 'boo' - onlyPrintOnce() // does nothing - t.equal(called, 1) - - // random property is retained! - t.equal(onlyPrintOnce.iAmBoo, true) - - var logs = [] - var logwrap = wrappy(function (msg, cb) { - logs.push(msg + ' wrapping cb') - return function () { - logs.push(msg + ' before cb') - var ret = cb.apply(this, arguments) - logs.push(msg + ' after cb') - } - }) - - var c = logwrap('foo', function () { - t.same(logs, [ 'foo wrapping cb', 'foo before cb' ]) - }) - c() - t.same(logs, [ 'foo wrapping cb', 'foo before cb', 'foo after cb' ]) - - t.end() -}) diff --git a/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js b/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js deleted file mode 100644 index bb7e7d6f..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +++ /dev/null @@ -1,33 +0,0 @@ -// Returns a wrapper function that returns a wrapped callback -// The wrapper function should do some stuff, and return a -// presumably different callback function. -// This makes sure that own properties are retained, so that -// decorations and such are not lost along the way. -module.exports = wrappy -function wrappy (fn, cb) { - if (fn && cb) return wrappy(fn)(cb) - - if (typeof fn !== 'function') - throw new TypeError('need wrapper function') - - Object.keys(fn).forEach(function (k) { - wrapper[k] = fn[k] - }) - - return wrapper - - function wrapper() { - var args = new Array(arguments.length) - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i] - } - var ret = fn.apply(this, args) - var cb = args[args.length-1] - if (typeof ret === 'function' && ret !== cb) { - Object.keys(cb).forEach(function (k) { - ret[k] = cb[k] - }) - } - return ret - } -} diff --git a/node_modules/tap/node_modules/glob/node_modules/once/once.js b/node_modules/tap/node_modules/glob/node_modules/once/once.js deleted file mode 100644 index 2e1e721b..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/once/once.js +++ /dev/null @@ -1,21 +0,0 @@ -var wrappy = require('wrappy') -module.exports = wrappy(once) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} diff --git a/node_modules/tap/node_modules/glob/node_modules/once/package.json b/node_modules/tap/node_modules/glob/node_modules/once/package.json deleted file mode 100644 index cb08d64c..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/once/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "once", - "version": "1.3.1", - "description": "Run a function exactly one time", - "main": "once.js", - "directories": { - "test": "test" - }, - "dependencies": { - "wrappy": "1" - }, - "devDependencies": { - "tap": "~0.3.0" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once.git" - }, - "keywords": [ - "once", - "function", - "one", - "single" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "readme": "# once\n\nOnly call a function once.\n\n## usage\n\n```javascript\nvar once = require('once')\n\nfunction load (file, cb) {\n cb = once(cb)\n loader.load('file')\n loader.once('load', cb)\n loader.once('error', cb)\n}\n```\n\nOr add to the Function.prototype in a responsible way:\n\n```javascript\n// only has to be done once\nrequire('once').proto()\n\nfunction load (file, cb) {\n cb = cb.once()\n loader.load('file')\n loader.once('load', cb)\n loader.once('error', cb)\n}\n```\n\nIronically, the prototype feature makes this module twice as\ncomplicated as necessary.\n\nTo check whether you function has been called, use `fn.called`. Once the\nfunction is called for the first time the return value of the original\nfunction is saved in `fn.value` and subsequent calls will continue to\nreturn this value.\n\n```javascript\nvar once = require('once')\n\nfunction load (cb) {\n cb = once(cb)\n var stream = createStream()\n stream.once('data', cb)\n stream.once('end', function () {\n if (!cb.called) cb(new Error('not found'))\n })\n}\n```\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/once/issues" - }, - "homepage": "https://github.com/isaacs/once", - "_id": "once@1.3.1", - "_shasum": "f3f3e4da5b7d27b5c732969ee3e67e729457b31f", - "_resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz", - "_from": "once@>=1.3.0 <2.0.0" -} diff --git a/node_modules/tap/node_modules/glob/node_modules/once/test/once.js b/node_modules/tap/node_modules/glob/node_modules/once/test/once.js deleted file mode 100644 index c618360d..00000000 --- a/node_modules/tap/node_modules/glob/node_modules/once/test/once.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require('tap').test -var once = require('../once.js') - -test('once', function (t) { - var f = 0 - function fn (g) { - t.equal(f, 0) - f ++ - return f + g + this - } - fn.ownProperty = {} - var foo = once(fn) - t.equal(fn.ownProperty, foo.ownProperty) - t.notOk(foo.called) - for (var i = 0; i < 1E3; i++) { - t.same(f, i === 0 ? 0 : 1) - var g = foo.call(1, 1) - t.ok(foo.called) - t.same(g, 3) - t.same(f, 1) - } - t.end() -}) diff --git a/node_modules/tap/node_modules/glob/package.json b/node_modules/tap/node_modules/glob/package.json deleted file mode 100644 index a40ec586..00000000 --- a/node_modules/tap/node_modules/glob/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "glob", - "description": "a little globber", - "version": "4.5.3", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "main": "glob.js", - "files": [ - "glob.js", - "sync.js", - "common.js" - ], - "engines": { - "node": "*" - }, - "dependencies": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^2.0.1", - "once": "^1.3.0" - }, - "devDependencies": { - "mkdirp": "0", - "rimraf": "^2.2.8", - "tap": "^0.5.0", - "tick": "0.0.6" - }, - "scripts": { - "prepublish": "npm run benchclean", - "profclean": "rm -f v8.log profile.txt", - "test": "npm run profclean && tap test/*.js", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", - "bench": "bash benchmark.sh", - "prof": "bash prof.sh && cat profile.txt", - "benchclean": "bash benchclean.sh" - }, - "license": "ISC", - "readme": "[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Dependency Status](https://david-dm.org/isaacs/node-glob.svg)](https://david-dm.org/isaacs/node-glob) [![devDependency Status](https://david-dm.org/isaacs/node-glob/dev-status.svg)](https://david-dm.org/isaacs/node-glob#info=devDependencies) [![optionalDependency Status](https://david-dm.org/isaacs/node-glob/optional-status.svg)](https://david-dm.org/isaacs/node-glob#info=optionalDependencies)\n\n# Glob\n\nMatch files using the patterns the shell uses, like stars and stuff.\n\nThis is a glob implementation in JavaScript. It uses the `minimatch`\nlibrary to do its matching.\n\n![](oh-my-glob.gif)\n\n## Usage\n\n```javascript\nvar glob = require(\"glob\")\n\n// options is optional\nglob(\"**/*.js\", options, function (er, files) {\n // files is an array of filenames.\n // If the `nonull` option is set, and nothing\n // was found, then files is [\"**/*.js\"]\n // er is an error object or null.\n})\n```\n\n## Glob Primer\n\n\"Globs\" are the patterns you type when you do stuff like `ls *.js` on\nthe command line, or put `build/*` in a `.gitignore` file.\n\nBefore parsing the path part patterns, braced sections are expanded\ninto a set. Braced sections start with `{` and end with `}`, with any\nnumber of comma-delimited sections within. Braced sections may contain\nslash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.\n\nThe following characters have special magic meaning when used in a\npath portion:\n\n* `*` Matches 0 or more characters in a single path portion\n* `?` Matches 1 character\n* `[...]` Matches a range of characters, similar to a RegExp range.\n If the first character of the range is `!` or `^` then it matches\n any character not in the range.\n* `!(pattern|pattern|pattern)` Matches anything that does not match\n any of the patterns provided.\n* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the\n patterns provided.\n* `+(pattern|pattern|pattern)` Matches one or more occurrences of the\n patterns provided.\n* `*(a|b|c)` Matches zero or more occurrences of the patterns provided\n* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns\n provided\n* `**` If a \"globstar\" is alone in a path portion, then it matches\n zero or more directories and subdirectories searching for matches.\n It does not crawl symlinked directories.\n\n### Dots\n\nIf a file or directory path portion has a `.` as the first character,\nthen it will not match any glob pattern unless that pattern's\ncorresponding path part also has a `.` as its first character.\n\nFor example, the pattern `a/.*/c` would match the file at `a/.b/c`.\nHowever the pattern `a/*/c` would not, because `*` does not start with\na dot character.\n\nYou can make glob treat dots as normal characters by setting\n`dot:true` in the options.\n\n### Basename Matching\n\nIf you set `matchBase:true` in the options, and the pattern has no\nslashes in it, then it will seek for any file anywhere in the tree\nwith a matching basename. For example, `*.js` would match\n`test/simple/basic.js`.\n\n### Negation\n\nThe intent for negation would be for a pattern starting with `!` to\nmatch everything that *doesn't* match the supplied pattern. However,\nthe implementation is weird, and for the time being, this should be\navoided. The behavior will change or be deprecated in version 5.\n\n### Empty Sets\n\nIf no matching files are found, then an empty array is returned. This\ndiffers from the shell, where the pattern itself is returned. For\nexample:\n\n $ echo a*s*d*f\n a*s*d*f\n\nTo get the bash-style behavior, set the `nonull:true` in the options.\n\n### See Also:\n\n* `man sh`\n* `man bash` (Search for \"Pattern Matching\")\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob.hasMagic(pattern, [options])\n\nReturns `true` if there are any special characters in the pattern, and\n`false` otherwise.\n\nNote that the options affect the results. If `noext:true` is set in\nthe options object, then `+(a|b)` will not be considered a magic\npattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`\nthen that is considered magical, unless `nobrace:true` is set in the\noptions.\n\n## glob(pattern, [options], cb)\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* `cb` {Function}\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nPerform an asynchronous glob search.\n\n## glob.sync(pattern, [options])\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* return: {Array} filenames found matching the pattern\n\nPerform a synchronous glob search.\n\n## Class: glob.Glob\n\nCreate a Glob object by instantiating the `glob.Glob` class.\n\n```javascript\nvar Glob = require(\"glob\").Glob\nvar mg = new Glob(pattern, options, cb)\n```\n\nIt's an EventEmitter, and starts walking the filesystem to find matches\nimmediately.\n\n### new glob.Glob(pattern, [options], [cb])\n\n* `pattern` {String} pattern to search for\n* `options` {Object}\n* `cb` {Function} Called when an error occurs, or matches are found\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nNote that if the `sync` flag is set in the options, then matches will\nbe immediately available on the `g.found` member.\n\n### Properties\n\n* `minimatch` The minimatch object that the glob uses.\n* `options` The options object passed in.\n* `aborted` Boolean which is set to true when calling `abort()`. There\n is no way at this time to continue a glob search after aborting, but\n you can re-use the statCache to avoid having to duplicate syscalls.\n* `statCache` Collection of all the stat results the glob search\n performed.\n* `cache` Convenience object. Each field has the following possible\n values:\n * `false` - Path does not exist\n * `true` - Path exists\n * `'DIR'` - Path exists, and is not a directory\n * `'FILE'` - Path exists, and is a directory\n * `[file, entries, ...]` - Path exists, is a directory, and the\n array value is the results of `fs.readdir`\n* `statCache` Cache of `fs.stat` results, to prevent statting the same\n path multiple times.\n* `symlinks` A record of which paths are symbolic links, which is\n relevant in resolving `**` patterns.\n* `realpathCache` An optional object which is passed to `fs.realpath`\n to minimize unnecessary syscalls. It is stored on the instantiated\n Glob object, and may be re-used.\n\n### Events\n\n* `end` When the matching is finished, this is emitted with all the\n matches found. If the `nonull` option is set, and no match was found,\n then the `matches` list contains the original pattern. The matches\n are sorted, unless the `nosort` flag is set.\n* `match` Every time a match is found, this is emitted with the matched.\n* `error` Emitted when an unexpected error is encountered, or whenever\n any fs error occurs if `options.strict` is set.\n* `abort` When `abort()` is called, this event is raised.\n\n### Methods\n\n* `pause` Temporarily stop the search\n* `resume` Resume the search\n* `abort` Stop the search forever\n\n### Options\n\nAll the options that can be passed to Minimatch can also be passed to\nGlob to change pattern matching behavior. Also, some have been added,\nor have glob-specific ramifications.\n\nAll options are false by default, unless otherwise noted.\n\nAll options are added to the Glob object, as well.\n\nIf you are running many `glob` operations, you can pass a Glob object\nas the `options` argument to a subsequent operation to shortcut some\n`stat` and `readdir` calls. At the very least, you may pass in shared\n`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that\nparallel glob operations will be sped up by sharing information about\nthe filesystem.\n\n* `cwd` The current working directory in which to search. Defaults\n to `process.cwd()`.\n* `root` The place where patterns starting with `/` will be mounted\n onto. Defaults to `path.resolve(options.cwd, \"/\")` (`/` on Unix\n systems, and `C:\\` or some such on Windows.)\n* `dot` Include `.dot` files in normal matches and `globstar` matches.\n Note that an explicit dot in a portion of the pattern will always\n match dot files.\n* `nomount` By default, a pattern starting with a forward-slash will be\n \"mounted\" onto the root setting, so that a valid filesystem path is\n returned. Set this flag to disable that behavior.\n* `mark` Add a `/` character to directory matches. Note that this\n requires additional stat calls.\n* `nosort` Don't sort the results.\n* `stat` Set to true to stat *all* results. This reduces performance\n somewhat, and is completely unnecessary, unless `readdir` is presumed\n to be an untrustworthy indicator of file existence.\n* `silent` When an unusual error is encountered when attempting to\n read a directory, a warning will be printed to stderr. Set the\n `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered when attempting to\n read a directory, the process will just continue on in search of\n other matches. Set the `strict` option to raise an error in these\n cases.\n* `cache` See `cache` property above. Pass in a previously generated\n cache object to save some fs calls.\n* `statCache` A cache of results of filesystem information, to prevent\n unnecessary stat calls. While it should not normally be necessary\n to set this, you may pass the statCache from one glob() call to the\n options object of another, if you know that the filesystem will not\n change between calls. (See \"Race Conditions\" below.)\n* `symlinks` A cache of known symbolic links. You may pass in a\n previously generated `symlinks` object to save `lstat` calls when\n resolving `**` matches.\n* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.\n* `nounique` In some cases, brace-expanded patterns can result in the\n same file showing up multiple times in the result set. By default,\n this implementation prevents duplicates in the result set. Set this\n flag to disable that behavior.\n* `nonull` Set to never return an empty set, instead returning a set\n containing the pattern itself. This is the default in glob(3).\n* `debug` Set to enable debug logging in minimatch and glob.\n* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.\n* `noglobstar` Do not match `**` against multiple filenames. (Ie,\n treat it as a normal `*` instead.)\n* `noext` Do not match `+(a|b)` \"extglob\" patterns.\n* `nocase` Perform a case-insensitive match. Note: on\n case-insensitive filesystems, non-magic patterns will match by\n default, since `stat` and `readdir` will not raise errors.\n* `matchBase` Perform a basename-only match if the pattern does not\n contain any slash characters. That is, `*.js` would be treated as\n equivalent to `**/*.js`, matching all js files in all directories.\n* `nonegate` Suppress `negate` behavior. (See below.)\n* `nocomment` Suppress `comment` behavior. (See below.)\n* `nonull` Return the pattern when no matches are found.\n* `nodir` Do not match directories, only files. (Note: to match\n *only* directories, simply put a `/` at the end of the pattern.)\n* `ignore` Add a pattern or an array of patterns to exclude matches.\n* `follow` Follow symlinked directories when expanding `**` patterns.\n Note that this can result in a lot of duplicate references in the\n presence of cyclic links.\n* `realpath` Set to true to call `fs.realpath` on all of the results.\n In the case of a symlink that cannot be resolved, the full absolute\n path to the matched entry is returned (though it will usually be a\n broken symlink)\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between node-glob and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.3, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nNote that symlinked directories are not crawled as part of a `**`,\nthough their contents may match against subsequent portions of the\npattern. This prevents infinite loops and duplicates and the like.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen glob returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`glob.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n## Windows\n\n**Please only use forward-slashes in glob expressions.**\n\nThough windows uses either `/` or `\\` as its path separator, only `/`\ncharacters are used by this glob implementation. You must use\nforward-slashes **only** in glob expressions. Back-slashes will always\nbe interpreted as escape characters, not path separators.\n\nResults from absolute patterns such as `/foo/*` are mounted onto the\nroot setting using `path.join`. On windows, this will by default result\nin `/foo/*` matching `C:\\foo\\bar.txt`.\n\n## Race Conditions\n\nGlob searching, by its very nature, is susceptible to race conditions,\nsince it relies on directory walking and such.\n\nAs a result, it is possible that a file that exists when glob looks for\nit may have been deleted or modified by the time it returns the result.\n\nAs part of its internal implementation, this program caches all stat\nand readdir calls that it makes, in order to cut down on system\noverhead. However, this also makes it even more susceptible to races,\nespecially if the cache or statCache objects are reused between glob\ncalls.\n\nUsers are thus advised not to use a glob result as a guarantee of\nfilesystem state in the face of rapid changes. For the vast majority\nof operations, this is never a problem.\n\n## Contributing\n\nAny change to behavior (including bugfixes) must come with a test.\n\nPatches that fail tests or reduce performance will be rejected.\n\n```\n# to run tests\nnpm test\n\n# to re-generate test fixtures\nnpm run test-regen\n\n# to benchmark against bash/zsh\nnpm run bench\n\n# to profile javascript\nnpm run prof\n```\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" - }, - "homepage": "https://github.com/isaacs/node-glob", - "_id": "glob@4.5.3", - "_shasum": "c6cb73d3226c1efef04de3c56d012f03377ee15f", - "_resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", - "_from": "glob@>=4.3.5 <5.0.0" -} diff --git a/node_modules/tap/node_modules/glob/sync.js b/node_modules/tap/node_modules/glob/sync.js deleted file mode 100644 index f4f5e36d..00000000 --- a/node_modules/tap/node_modules/glob/sync.js +++ /dev/null @@ -1,457 +0,0 @@ -module.exports = globSync -globSync.GlobSync = GlobSync - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var Glob = require('./glob.js').Glob -var util = require('util') -var path = require('path') -var assert = require('assert') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var isAbsolute = common.isAbsolute -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = fs.realpathSync(p, this.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this.matches[index][e] = true - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - var abs = this._makeAbs(e) - if (this.mark) - e = this._mark(e) - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[this._makeAbs(e)] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - // lstat failed, doesn't exist - return null - } - - var isSym = lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) throw er - if (!this.silent) console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this.matches[index][prefix] = true -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - return false - } - - if (lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c !== 'DIR') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} diff --git a/node_modules/tap/node_modules/inherits/LICENSE b/node_modules/tap/node_modules/inherits/LICENSE deleted file mode 100644 index dea3013d..00000000 --- a/node_modules/tap/node_modules/inherits/LICENSE +++ /dev/null @@ -1,16 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - diff --git a/node_modules/tap/node_modules/inherits/README.md b/node_modules/tap/node_modules/inherits/README.md deleted file mode 100644 index b1c56658..00000000 --- a/node_modules/tap/node_modules/inherits/README.md +++ /dev/null @@ -1,42 +0,0 @@ -Browser-friendly inheritance fully compatible with standard node.js -[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). - -This package exports standard `inherits` from node.js `util` module in -node environment, but also provides alternative browser-friendly -implementation through [browser -field](https://gist.github.com/shtylman/4339901). Alternative -implementation is a literal copy of standard one located in standalone -module to avoid requiring of `util`. It also has a shim for old -browsers with no `Object.create` support. - -While keeping you sure you are using standard `inherits` -implementation in node.js environment, it allows bundlers such as -[browserify](https://github.com/substack/node-browserify) to not -include full `util` package to your client code if all you need is -just `inherits` function. It worth, because browser shim for `util` -package is large and `inherits` is often the single function you need -from it. - -It's recommended to use this package instead of -`require('util').inherits` for any code that has chances to be used -not only in node.js but in browser too. - -## usage - -```js -var inherits = require('inherits'); -// then use exactly as the standard one -``` - -## note on version ~1.0 - -Version ~1.0 had completely different motivation and is not compatible -neither with 2.0 nor with standard node.js `inherits`. - -If you are using version ~1.0 and planning to switch to ~2.0, be -careful: - -* new version uses `super_` instead of `super` for referencing - superclass -* new version overwrites current prototype while old one preserves any - existing fields on it diff --git a/node_modules/tap/node_modules/inherits/inherits.js b/node_modules/tap/node_modules/inherits/inherits.js deleted file mode 100644 index 29f5e24f..00000000 --- a/node_modules/tap/node_modules/inherits/inherits.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('util').inherits diff --git a/node_modules/tap/node_modules/inherits/inherits_browser.js b/node_modules/tap/node_modules/inherits/inherits_browser.js deleted file mode 100644 index c1e78a75..00000000 --- a/node_modules/tap/node_modules/inherits/inherits_browser.js +++ /dev/null @@ -1,23 +0,0 @@ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } -} diff --git a/node_modules/tap/node_modules/inherits/package.json b/node_modules/tap/node_modules/inherits/package.json deleted file mode 100644 index 22f46864..00000000 --- a/node_modules/tap/node_modules/inherits/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "inherits", - "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "version": "2.0.1", - "keywords": [ - "inheritance", - "class", - "klass", - "oop", - "object-oriented", - "inherits", - "browser", - "browserify" - ], - "main": "./inherits.js", - "browser": "./inherits_browser.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/inherits.git" - }, - "license": "ISC", - "scripts": { - "test": "node test" - }, - "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/inherits/issues" - }, - "homepage": "https://github.com/isaacs/inherits", - "_id": "inherits@2.0.1", - "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", - "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "_from": "inherits@*" -} diff --git a/node_modules/tap/node_modules/inherits/test.js b/node_modules/tap/node_modules/inherits/test.js deleted file mode 100644 index fc53012d..00000000 --- a/node_modules/tap/node_modules/inherits/test.js +++ /dev/null @@ -1,25 +0,0 @@ -var inherits = require('./inherits.js') -var assert = require('assert') - -function test(c) { - assert(c.constructor === Child) - assert(c.constructor.super_ === Parent) - assert(Object.getPrototypeOf(c) === Child.prototype) - assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) - assert(c instanceof Child) - assert(c instanceof Parent) -} - -function Child() { - Parent.call(this) - test(this) -} - -function Parent() {} - -inherits(Child, Parent) - -var c = new Child -test(c) - -console.log('ok') diff --git a/node_modules/tap/node_modules/mkdirp/.npmignore b/node_modules/tap/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c347..00000000 --- a/node_modules/tap/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/tap/node_modules/mkdirp/.travis.yml b/node_modules/tap/node_modules/mkdirp/.travis.yml deleted file mode 100644 index c693a939..00000000 --- a/node_modules/tap/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - "0.10" diff --git a/node_modules/tap/node_modules/mkdirp/LICENSE b/node_modules/tap/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1aeb..00000000 --- a/node_modules/tap/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -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/tap/node_modules/mkdirp/bin/cmd.js b/node_modules/tap/node_modules/mkdirp/bin/cmd.js deleted file mode 100755 index d95de15a..00000000 --- a/node_modules/tap/node_modules/mkdirp/bin/cmd.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env node - -var mkdirp = require('../'); -var minimist = require('minimist'); -var fs = require('fs'); - -var argv = minimist(process.argv.slice(2), { - alias: { m: 'mode', h: 'help' }, - string: [ 'mode' ] -}); -if (argv.help) { - fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout); - return; -} - -var paths = argv._.slice(); -var mode = argv.mode ? parseInt(argv.mode, 8) : undefined; - -(function next () { - if (paths.length === 0) return; - var p = paths.shift(); - - if (mode === undefined) mkdirp(p, cb) - else mkdirp(p, mode, cb) - - function cb (err) { - if (err) { - console.error(err.message); - process.exit(1); - } - else next(); - } -})(); diff --git a/node_modules/tap/node_modules/mkdirp/bin/usage.txt b/node_modules/tap/node_modules/mkdirp/bin/usage.txt deleted file mode 100644 index f952aa2c..00000000 --- a/node_modules/tap/node_modules/mkdirp/bin/usage.txt +++ /dev/null @@ -1,12 +0,0 @@ -usage: mkdirp [DIR1,DIR2..] {OPTIONS} - - Create each supplied directory including any necessary parent directories that - don't yet exist. - - If the directory already exists, do nothing. - -OPTIONS are: - - -m, --mode If a directory needs to be created, set the mode as an octal - permission string. - diff --git a/node_modules/tap/node_modules/mkdirp/examples/pow.js b/node_modules/tap/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e6924212..00000000 --- a/node_modules/tap/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/tap/node_modules/mkdirp/index.js b/node_modules/tap/node_modules/mkdirp/index.js deleted file mode 100644 index a1742b20..00000000 --- a/node_modules/tap/node_modules/mkdirp/index.js +++ /dev/null @@ -1,97 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, opts, f, made) { - if (typeof opts === 'function') { - f = opts; - opts = {}; - } - else if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - p = path.resolve(p); - - xfs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), opts, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, opts, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - xfs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, opts, made) { - if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - p = path.resolve(p); - - try { - xfs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), opts, made); - sync(p, opts, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = xfs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/.travis.yml b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/.travis.yml deleted file mode 100644 index cc4dba29..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/LICENSE b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/LICENSE deleted file mode 100644 index ee27ba4b..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -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/tap/node_modules/mkdirp/node_modules/minimist/example/parse.js b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/example/parse.js deleted file mode 100644 index abff3e8e..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/example/parse.js +++ /dev/null @@ -1,2 +0,0 @@ -var argv = require('../')(process.argv.slice(2)); -console.dir(argv); diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/index.js b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/index.js deleted file mode 100644 index 584f551a..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/index.js +++ /dev/null @@ -1,187 +0,0 @@ -module.exports = function (args, opts) { - if (!opts) opts = {}; - - var flags = { bools : {}, strings : {} }; - - [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - }); - - [].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - }); - - var aliases = {}; - Object.keys(opts.alias || {}).forEach(function (key) { - aliases[key] = [].concat(opts.alias[key]); - aliases[key].forEach(function (x) { - aliases[x] = [key].concat(aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - - var defaults = opts['default'] || {}; - - var argv = { _ : [] }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] === undefined ? false : defaults[key]); - }); - - var notFlags = []; - - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--')+1); - args = args.slice(0, args.indexOf('--')); - } - - function setArg (key, val) { - var value = !flags.strings[key] && isNumber(val) - ? Number(val) : val - ; - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), value); - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (/^--.+=/.test(arg)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - setArg(m[1], m[2]); - } - else if (/^--no-.+/.test(arg)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false); - } - else if (/^--.+/.test(arg)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !/^-/.test(next) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true'); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true); - } - } - else if (/^-[^-]+/.test(arg)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - var next = arg.slice(j+2); - - if (next === '-') { - setArg(letters[j], next) - continue; - } - - if (/[A-Za-z]/.test(letters[j]) - && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next); - broken = true; - break; - } - - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2)); - broken = true; - break; - } - else { - setArg(letters[j], flags.strings[letters[j]] ? '' : true); - } - } - - var key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, args[i+1]); - i++; - } - else if (args[i+1] && /true|false/.test(args[i+1])) { - setArg(key, args[i+1] === 'true'); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true); - } - } - } - else { - argv._.push( - flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) - ); - } - } - - Object.keys(defaults).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) { - setKey(argv, key.split('.'), defaults[key]); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), defaults[key]); - }); - } - }); - - notFlags.forEach(function(key) { - argv._.push(key); - }); - - return argv; -}; - -function hasKey (obj, keys) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - o = (o[key] || {}); - }); - - var key = keys[keys.length - 1]; - return key in o; -} - -function setKey (obj, keys, value) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - if (o[key] === undefined) o[key] = {}; - o = o[key]; - }); - - var key = keys[keys.length - 1]; - if (o[key] === undefined || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } -} - -function isNumber (x) { - if (typeof x === 'number') return true; - if (/^0x[0-9a-f]+$/i.test(x)) return true; - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} - -function longest (xs) { - return Math.max.apply(null, xs.map(function (x) { return x.length })); -} diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/package.json b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/package.json deleted file mode 100644 index 09e9ec44..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "minimist", - "version": "0.0.8", - "description": "parse argument options", - "main": "index.js", - "devDependencies": { - "tape": "~1.0.4", - "tap": "~0.4.0" - }, - "scripts": { - "test": "tap test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "ff/5", - "firefox/latest", - "chrome/10", - "chrome/latest", - "safari/5.1", - "safari/latest", - "opera/12" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/substack/minimist.git" - }, - "homepage": "https://github.com/substack/minimist", - "keywords": [ - "argv", - "getopt", - "parser", - "optimist" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/substack/minimist/issues" - }, - "_id": "minimist@0.0.8", - "dist": { - "shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", - "tarball": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" - }, - "_from": "minimist@0.0.8", - "_npmVersion": "1.4.3", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, - "_shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", - "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/readme.markdown b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/readme.markdown deleted file mode 100644 index c2563532..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/readme.markdown +++ /dev/null @@ -1,73 +0,0 @@ -# minimist - -parse argument options - -This module is the guts of optimist's argument parser without all the -fanciful decoration. - -[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) - -[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) - -# example - -``` js -var argv = require('minimist')(process.argv.slice(2)); -console.dir(argv); -``` - -``` -$ node example/parse.js -a beep -b boop -{ _: [], a: 'beep', b: 'boop' } -``` - -``` -$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz -{ _: [ 'foo', 'bar', 'baz' ], - x: 3, - y: 4, - n: 5, - a: true, - b: true, - c: true, - beep: 'boop' } -``` - -# methods - -``` js -var parseArgs = require('minimist') -``` - -## var argv = parseArgs(args, opts={}) - -Return an argument object `argv` populated with the array arguments from `args`. - -`argv._` contains all the arguments that didn't have an option associated with -them. - -Numeric-looking arguments will be returned as numbers unless `opts.string` or -`opts.boolean` is set for that argument name. - -Any arguments after `'--'` will not be parsed and will end up in `argv._`. - -options can be: - -* `opts.string` - a string or array of strings argument names to always treat as -strings -* `opts.boolean` - a string or array of strings to always treat as booleans -* `opts.alias` - an object mapping string names to strings or arrays of string -argument names to use as aliases -* `opts.default` - an object mapping string argument names to default values - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install minimist -``` - -# license - -MIT diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/dash.js b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/dash.js deleted file mode 100644 index 8b034b99..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/dash.js +++ /dev/null @@ -1,24 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('-', function (t) { - t.plan(5); - t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); - t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); - t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); - t.deepEqual( - parse([ '-b', '-' ], { boolean: 'b' }), - { b: true, _: [ '-' ] } - ); - t.deepEqual( - parse([ '-s', '-' ], { string: 's' }), - { s: '-', _: [] } - ); -}); - -test('-a -- b', function (t) { - t.plan(3); - t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/default_bool.js b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/default_bool.js deleted file mode 100644 index f0041ee4..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/default_bool.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('boolean default true', function (t) { - var argv = parse([], { - boolean: 'sometrue', - default: { sometrue: true } - }); - t.equal(argv.sometrue, true); - t.end(); -}); - -test('boolean default false', function (t) { - var argv = parse([], { - boolean: 'somefalse', - default: { somefalse: false } - }); - t.equal(argv.somefalse, false); - t.end(); -}); diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/dotted.js b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/dotted.js deleted file mode 100644 index ef0ae349..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/dotted.js +++ /dev/null @@ -1,16 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('dotted alias', function (t) { - var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 22); - t.equal(argv.aa.bb, 22); - t.end(); -}); - -test('dotted default', function (t) { - var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 11); - t.equal(argv.aa.bb, 11); - t.end(); -}); diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/long.js b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/long.js deleted file mode 100644 index 5d3a1e09..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/long.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('long opts', function (t) { - t.deepEqual( - parse([ '--bool' ]), - { bool : true, _ : [] }, - 'long boolean' - ); - t.deepEqual( - parse([ '--pow', 'xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture sp' - ); - t.deepEqual( - parse([ '--pow=xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture eq' - ); - t.deepEqual( - parse([ '--host', 'localhost', '--port', '555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures sp' - ); - t.deepEqual( - parse([ '--host=localhost', '--port=555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures eq' - ); - t.end(); -}); diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/parse.js b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/parse.js deleted file mode 100644 index 8a906466..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/parse.js +++ /dev/null @@ -1,318 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse args', function (t) { - t.deepEqual( - parse([ '--no-moo' ]), - { moo : false, _ : [] }, - 'no' - ); - t.deepEqual( - parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), - { v : ['a','b','c'], _ : [] }, - 'multi' - ); - t.end(); -}); - -test('comprehensive', function (t) { - t.deepEqual( - parse([ - '--name=meowmers', 'bare', '-cats', 'woo', - '-h', 'awesome', '--multi=quux', - '--key', 'value', - '-b', '--bool', '--no-meep', '--multi=baz', - '--', '--not-a-flag', 'eek' - ]), - { - c : true, - a : true, - t : true, - s : 'woo', - h : 'awesome', - b : true, - bool : true, - key : 'value', - multi : [ 'quux', 'baz' ], - meep : false, - name : 'meowmers', - _ : [ 'bare', '--not-a-flag', 'eek' ] - } - ); - t.end(); -}); - -test('nums', function (t) { - var argv = parse([ - '-x', '1234', - '-y', '5.67', - '-z', '1e7', - '-w', '10f', - '--hex', '0xdeadbeef', - '789' - ]); - t.deepEqual(argv, { - x : 1234, - y : 5.67, - z : 1e7, - w : '10f', - hex : 0xdeadbeef, - _ : [ 789 ] - }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv.y, 'number'); - t.deepEqual(typeof argv.z, 'number'); - t.deepEqual(typeof argv.w, 'string'); - t.deepEqual(typeof argv.hex, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); - -test('flag boolean', function (t) { - var argv = parse([ '-t', 'moo' ], { boolean: 't' }); - t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean value', function (t) { - var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { - boolean: [ 't', 'verbose' ], - default: { verbose: true } - }); - - t.deepEqual(argv, { - verbose: false, - t: true, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean default false', function (t) { - var argv = parse(['moo'], { - boolean: ['t', 'verbose'], - default: { verbose: false, t: false } - }); - - t.deepEqual(argv, { - verbose: false, - t: false, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); - -}); - -test('boolean groups', function (t) { - var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { - boolean: ['x','y','z'] - }); - - t.deepEqual(argv, { - x : true, - y : false, - z : true, - _ : [ 'one', 'two', 'three' ] - }); - - t.deepEqual(typeof argv.x, 'boolean'); - t.deepEqual(typeof argv.y, 'boolean'); - t.deepEqual(typeof argv.z, 'boolean'); - t.end(); -}); - -test('newlines in params' , function (t) { - var args = parse([ '-s', "X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - - // reproduce in bash: - // VALUE="new - // line" - // node program.js --s="$VALUE" - args = parse([ "--s=X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - t.end(); -}); - -test('strings' , function (t) { - var s = parse([ '-s', '0001234' ], { string: 's' }).s; - t.equal(s, '0001234'); - t.equal(typeof s, 'string'); - - var x = parse([ '-x', '56' ], { string: 'x' }).x; - t.equal(x, '56'); - t.equal(typeof x, 'string'); - t.end(); -}); - -test('stringArgs', function (t) { - var s = parse([ ' ', ' ' ], { string: '_' })._; - t.same(s.length, 2); - t.same(typeof s[0], 'string'); - t.same(s[0], ' '); - t.same(typeof s[1], 'string'); - t.same(s[1], ' '); - t.end(); -}); - -test('empty strings', function(t) { - var s = parse([ '-s' ], { string: 's' }).s; - t.equal(s, ''); - t.equal(typeof s, 'string'); - - var str = parse([ '--str' ], { string: 'str' }).str; - t.equal(str, ''); - t.equal(typeof str, 'string'); - - var letters = parse([ '-art' ], { - string: [ 'a', 't' ] - }); - - t.equal(letters.a, ''); - t.equal(letters.r, true); - t.equal(letters.t, ''); - - t.end(); -}); - - -test('slashBreak', function (t) { - t.same( - parse([ '-I/foo/bar/baz' ]), - { I : '/foo/bar/baz', _ : [] } - ); - t.same( - parse([ '-xyz/foo/bar/baz' ]), - { x : true, y : true, z : '/foo/bar/baz', _ : [] } - ); - t.end(); -}); - -test('alias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: 'zoom' } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.f, 11); - t.end(); -}); - -test('multiAlias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: [ 'zm', 'zoom' ] } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.z, argv.zm); - t.equal(argv.f, 11); - t.end(); -}); - -test('nested dotted objects', function (t) { - var argv = parse([ - '--foo.bar', '3', '--foo.baz', '4', - '--foo.quux.quibble', '5', '--foo.quux.o_O', - '--beep.boop' - ]); - - t.same(argv.foo, { - bar : 3, - baz : 4, - quux : { - quibble : 5, - o_O : true - } - }); - t.same(argv.beep, { boop : true }); - t.end(); -}); - -test('boolean and alias with chainable api', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = parse(aliased, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var propertyArgv = parse(regular, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - alias: { 'h': 'herp' }, - boolean: 'herp' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias using explicit true', function (t) { - var aliased = [ '-h', 'true' ]; - var regular = [ '--herp', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -// regression, see https://github.com/substack/node-optimist/issues/71 -test('boolean and --x=true', function(t) { - var parsed = parse(['--boool', '--other=true'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'true'); - - parsed = parse(['--boool', '--other=false'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'false'); - t.end(); -}); diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js deleted file mode 100644 index 21851b03..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js +++ /dev/null @@ -1,9 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse with modifier functions' , function (t) { - t.plan(1); - - var argv = parse([ '-b', '123' ], { boolean: 'b' }); - t.deepEqual(argv, { b: true, _: ['123'] }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/short.js b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/short.js deleted file mode 100644 index d513a1c2..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/short.js +++ /dev/null @@ -1,67 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('numeric short args', function (t) { - t.plan(2); - t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); - t.deepEqual( - parse([ '-123', '456' ]), - { 1: true, 2: true, 3: 456, _: [] } - ); -}); - -test('short', function (t) { - t.deepEqual( - parse([ '-b' ]), - { b : true, _ : [] }, - 'short boolean' - ); - t.deepEqual( - parse([ 'foo', 'bar', 'baz' ]), - { _ : [ 'foo', 'bar', 'baz' ] }, - 'bare' - ); - t.deepEqual( - parse([ '-cats' ]), - { c : true, a : true, t : true, s : true, _ : [] }, - 'group' - ); - t.deepEqual( - parse([ '-cats', 'meow' ]), - { c : true, a : true, t : true, s : 'meow', _ : [] }, - 'short group next' - ); - t.deepEqual( - parse([ '-h', 'localhost' ]), - { h : 'localhost', _ : [] }, - 'short capture' - ); - t.deepEqual( - parse([ '-h', 'localhost', '-p', '555' ]), - { h : 'localhost', p : 555, _ : [] }, - 'short captures' - ); - t.end(); -}); - -test('mixed short bool and capture', function (t) { - t.same( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); - -test('short and long', function (t) { - t.deepEqual( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); diff --git a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/whitespace.js b/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/whitespace.js deleted file mode 100644 index 8a52a58c..00000000 --- a/node_modules/tap/node_modules/mkdirp/node_modules/minimist/test/whitespace.js +++ /dev/null @@ -1,8 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('whitespace should be whitespace' , function (t) { - t.plan(1); - var x = parse([ '-x', '\t' ]).x; - t.equal(x, '\t'); -}); diff --git a/node_modules/tap/node_modules/mkdirp/package.json b/node_modules/tap/node_modules/mkdirp/package.json deleted file mode 100644 index 1c71c54a..00000000 --- a/node_modules/tap/node_modules/mkdirp/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.5.0", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": { - "minimist": "0.0.8" - }, - "devDependencies": { - "tap": "~0.4.0", - "mock-fs": "~2.2.0" - }, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "license": "MIT", - "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, opts, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `opts.mode`. If `opts` is a non-object, it will be treated as\nthe `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and\n`opts.fs.stat(path, cb)`.\n\n## mkdirp.sync(dir, opts)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `opts.mode`. If `opts` is a non-object, it will be\ntreated as the `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and\n`opts.fs.statSync(path)`.\n\n# usage\n\nThis package also ships with a `mkdirp` command.\n\n```\nusage: mkdirp [DIR1,DIR2..] {OPTIONS}\n\n Create each supplied directory including any necessary parent directories that\n don't yet exist.\n \n If the directory already exists, do nothing.\n\nOPTIONS are:\n\n -m, --mode If a directory needs to be created, set the mode as an octal\n permission string.\n\n```\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\nto get the library, or\n\n```\nnpm install -g mkdirp\n```\n\nto get the command.\n\n# license\n\nMIT\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "homepage": "https://github.com/substack/node-mkdirp", - "_id": "mkdirp@0.5.0", - "_shasum": "1d73076a6df986cd9344e15e71fcc05a4c9abf12", - "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", - "_from": "mkdirp@>=0.5.0 <0.6.0" -} diff --git a/node_modules/tap/node_modules/mkdirp/readme.markdown b/node_modules/tap/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 3cc13153..00000000 --- a/node_modules/tap/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,100 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, opts, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `opts.mode`. If `opts` is a non-object, it will be treated as -the `opts.mode`. - -If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -You can optionally pass in an alternate `fs` implementation by passing in -`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and -`opts.fs.stat(path, cb)`. - -## mkdirp.sync(dir, opts) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `opts.mode`. If `opts` is a non-object, it will be -treated as the `opts.mode`. - -If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -You can optionally pass in an alternate `fs` implementation by passing in -`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and -`opts.fs.statSync(path)`. - -# usage - -This package also ships with a `mkdirp` command. - -``` -usage: mkdirp [DIR1,DIR2..] {OPTIONS} - - Create each supplied directory including any necessary parent directories that - don't yet exist. - - If the directory already exists, do nothing. - -OPTIONS are: - - -m, --mode If a directory needs to be created, set the mode as an octal - permission string. - -``` - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -to get the library, or - -``` -npm install -g mkdirp -``` - -to get the command. - -# license - -MIT diff --git a/node_modules/tap/node_modules/mkdirp/test/chmod.js b/node_modules/tap/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8e..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/clobber.js b/node_modules/tap/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb70998..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/mkdirp.js b/node_modules/tap/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index 3b624ddb..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,26 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; - -test('woo', function (t) { - t.plan(5); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }) - }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/opts_fs.js b/node_modules/tap/node_modules/mkdirp/test/opts_fs.js deleted file mode 100644 index f1fbeca1..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/opts_fs.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var test = require('tap').test; -var mockfs = require('mock-fs'); - -test('opts.fs', function (t) { - t.plan(5); - - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/beep/boop/' + [x,y,z].join('/'); - var xfs = mockfs.fs(); - - mkdirp(file, { fs: xfs, mode: 0755 }, function (err) { - t.ifError(err); - xfs.exists(file, function (ex) { - t.ok(ex, 'created file'); - xfs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); - }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/opts_fs_sync.js b/node_modules/tap/node_modules/mkdirp/test/opts_fs_sync.js deleted file mode 100644 index 224b5064..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/opts_fs_sync.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var test = require('tap').test; -var mockfs = require('mock-fs'); - -test('opts.fs sync', function (t) { - t.plan(4); - - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/beep/boop/' + [x,y,z].join('/'); - var xfs = mockfs.fs(); - - mkdirp.sync(file, { fs: xfs, mode: 0755 }); - xfs.exists(file, function (ex) { - t.ok(ex, 'created file'); - xfs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/perm.js b/node_modules/tap/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 2c975905..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,30 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(5); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/perm_sync.js b/node_modules/tap/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index 327e54b2..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,34 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(4); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); - -test('sync root perm', function (t) { - t.plan(3); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/race.js b/node_modules/tap/node_modules/mkdirp/test/race.js deleted file mode 100644 index 7c295f41..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,40 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; - -test('race', function (t) { - t.plan(6); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - }); - }) - }); - } -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/rel.js b/node_modules/tap/node_modules/mkdirp/test/rel.js deleted file mode 100644 index d1f175c2..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,30 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; - -test('rel', function (t) { - t.plan(5); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }) - }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/return.js b/node_modules/tap/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e56..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/return_sync.js b/node_modules/tap/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d35..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/root.js b/node_modules/tap/node_modules/mkdirp/test/root.js deleted file mode 100644 index 97ad7a2f..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/root.js +++ /dev/null @@ -1,18 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkdirp(file, 0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/sync.js b/node_modules/tap/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 88fa4324..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,30 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; - -test('sync', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, 0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/umask.js b/node_modules/tap/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 82c393a0..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,26 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(5); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }) - }); -}); diff --git a/node_modules/tap/node_modules/mkdirp/test/umask_sync.js b/node_modules/tap/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index e537fbe4..00000000 --- a/node_modules/tap/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,30 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); diff --git a/node_modules/tap/node_modules/nopt/.npmignore b/node_modules/tap/node_modules/nopt/.npmignore deleted file mode 100644 index 3c3629e6..00000000 --- a/node_modules/tap/node_modules/nopt/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/tap/node_modules/nopt/LICENSE b/node_modules/tap/node_modules/nopt/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/node_modules/tap/node_modules/nopt/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/tap/node_modules/nopt/README.md b/node_modules/tap/node_modules/nopt/README.md deleted file mode 100644 index 5aba088b..00000000 --- a/node_modules/tap/node_modules/nopt/README.md +++ /dev/null @@ -1,209 +0,0 @@ -If you want to write an option parser, and have it be good, there are -two ways to do it. The Right Way, and the Wrong Way. - -The Wrong Way is to sit down and write an option parser. We've all done -that. - -The Right Way is to write some complex configurable program with so many -options that you go half-insane just trying to manage them all, and put -it off with duct-tape solutions until you see exactly to the core of the -problem, and finally snap and write an awesome option parser. - -If you want to write an option parser, don't write an option parser. -Write a package manager, or a source control system, or a service -restarter, or an operating system. You probably won't end up with a -good one of those, but if you don't give up, and you are relentless and -diligent enough in your procrastination, you may just end up with a very -nice option parser. - -## USAGE - - // my-program.js - var nopt = require("nopt") - , Stream = require("stream").Stream - , path = require("path") - , knownOpts = { "foo" : [String, null] - , "bar" : [Stream, Number] - , "baz" : path - , "bloo" : [ "big", "medium", "small" ] - , "flag" : Boolean - , "pick" : Boolean - , "many" : [String, Array] - } - , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] - , "b7" : ["--bar", "7"] - , "m" : ["--bloo", "medium"] - , "p" : ["--pick"] - , "f" : ["--flag"] - } - // everything is optional. - // knownOpts and shorthands default to {} - // arg list defaults to process.argv - // slice defaults to 2 - , parsed = nopt(knownOpts, shortHands, process.argv, 2) - console.log(parsed) - -This would give you support for any of the following: - -```bash -$ node my-program.js --foo "blerp" --no-flag -{ "foo" : "blerp", "flag" : false } - -$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag -{ bar: 7, foo: "Mr. Hand", flag: true } - -$ node my-program.js --foo "blerp" -f -----p -{ foo: "blerp", flag: true, pick: true } - -$ node my-program.js -fp --foofoo -{ foo: "Mr. Foo", flag: true, pick: true } - -$ node my-program.js --foofoo -- -fp # -- stops the flag parsing. -{ foo: "Mr. Foo", argv: { remain: ["-fp"] } } - -$ node my-program.js --blatzk -fp # unknown opts are ok. -{ blatzk: true, flag: true, pick: true } - -$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value -{ blatzk: 1000, flag: true, pick: true } - -$ node my-program.js --no-blatzk -fp # unless they start with "no-" -{ blatzk: false, flag: true, pick: true } - -$ node my-program.js --baz b/a/z # known paths are resolved. -{ baz: "/Users/isaacs/b/a/z" } - -# if Array is one of the types, then it can take many -# values, and will always be an array. The other types provided -# specify what types are allowed in the list. - -$ node my-program.js --many 1 --many null --many foo -{ many: ["1", "null", "foo"] } - -$ node my-program.js --many foo -{ many: ["foo"] } -``` - -Read the tests at the bottom of `lib/nopt.js` for more examples of -what this puppy can do. - -## Types - -The following types are supported, and defined on `nopt.typeDefs` - -* String: A normal string. No parsing is done. -* path: A file system path. Gets resolved against cwd if not absolute. -* url: A url. If it doesn't parse, it isn't accepted. -* Number: Must be numeric. -* Date: Must parse as a date. If it does, and `Date` is one of the options, - then it will return a Date object, not a string. -* Boolean: Must be either `true` or `false`. If an option is a boolean, - then it does not need a value, and its presence will imply `true` as - the value. To negate boolean flags, do `--no-whatever` or `--whatever - false` -* NaN: Means that the option is strictly not allowed. Any value will - fail. -* Stream: An object matching the "Stream" class in node. Valuable - for use when validating programmatically. (npm uses this to let you - supply any WriteStream on the `outfd` and `logfd` config options.) -* Array: If `Array` is specified as one of the types, then the value - will be parsed as a list of options. This means that multiple values - can be specified, and that the value will always be an array. - -If a type is an array of values not on this list, then those are -considered valid values. For instance, in the example above, the -`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`, -and any other value will be rejected. - -When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be -interpreted as their JavaScript equivalents. - -You can also mix types and values, or multiple types, in a list. For -instance `{ blah: [Number, null] }` would allow a value to be set to -either a Number or null. When types are ordered, this implies a -preference, and the first type that can be used to properly interpret -the value will be used. - -To define a new type, add it to `nopt.typeDefs`. Each item in that -hash is an object with a `type` member and a `validate` method. The -`type` member is an object that matches what goes in the type list. The -`validate` method is a function that gets called with `validate(data, -key, val)`. Validate methods should assign `data[key]` to the valid -value of `val` if it can be handled properly, or return boolean -`false` if it cannot. - -You can also call `nopt.clean(data, types, typeDefs)` to clean up a -config object and remove its invalid properties. - -## Error Handling - -By default, nopt outputs a warning to standard error when invalid -options are found. You can change this behavior by assigning a method -to `nopt.invalidHandler`. This method will be called with -the offending `nopt.invalidHandler(key, val, types)`. - -If no `nopt.invalidHandler` is assigned, then it will console.error -its whining. If it is assigned to boolean `false` then the warning is -suppressed. - -## Abbreviations - -Yes, they are supported. If you define options like this: - -```javascript -{ "foolhardyelephants" : Boolean -, "pileofmonkeys" : Boolean } -``` - -Then this will work: - -```bash -node program.js --foolhar --pil -node program.js --no-f --pileofmon -# etc. -``` - -## Shorthands - -Shorthands are a hash of shorter option names to a snippet of args that -they expand to. - -If multiple one-character shorthands are all combined, and the -combination does not unambiguously match any other option or shorthand, -then they will be broken up into their constituent parts. For example: - -```json -{ "s" : ["--loglevel", "silent"] -, "g" : "--global" -, "f" : "--force" -, "p" : "--parseable" -, "l" : "--long" -} -``` - -```bash -npm ls -sgflp -# just like doing this: -npm ls --loglevel silent --global --force --long --parseable -``` - -## The Rest of the args - -The config object returned by nopt is given a special member called -`argv`, which is an object with the following fields: - -* `remain`: The remaining args after all the parsing has occurred. -* `original`: The args as they originally appeared. -* `cooked`: The args after flags and shorthands are expanded. - -## Slicing - -Node programs are called with more or less the exact argv as it appears -in C land, after the v8 and node-specific options have been plucked off. -As such, `argv[0]` is always `node` and `argv[1]` is always the -JavaScript program being run. - -That's usually not very useful to you. So they're sliced off by -default. If you want them, then you can pass in `0` as the last -argument, or any other number that you'd like to slice off the start of -the list. diff --git a/node_modules/tap/node_modules/nopt/bin/nopt.js b/node_modules/tap/node_modules/nopt/bin/nopt.js deleted file mode 100755 index 3232d4c5..00000000 --- a/node_modules/tap/node_modules/nopt/bin/nopt.js +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env node -var nopt = require("../lib/nopt") - , path = require("path") - , types = { num: Number - , bool: Boolean - , help: Boolean - , list: Array - , "num-list": [Number, Array] - , "str-list": [String, Array] - , "bool-list": [Boolean, Array] - , str: String - , clear: Boolean - , config: Boolean - , length: Number - , file: path - } - , shorthands = { s: [ "--str", "astring" ] - , b: [ "--bool" ] - , nb: [ "--no-bool" ] - , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] - , "?": ["--help"] - , h: ["--help"] - , H: ["--help"] - , n: [ "--num", "125" ] - , c: ["--config"] - , l: ["--length"] - , f: ["--file"] - } - , parsed = nopt( types - , shorthands - , process.argv - , 2 ) - -console.log("parsed", parsed) - -if (parsed.help) { - console.log("") - console.log("nopt cli tester") - console.log("") - console.log("types") - console.log(Object.keys(types).map(function M (t) { - var type = types[t] - if (Array.isArray(type)) { - return [t, type.map(function (type) { return type.name })] - } - return [t, type && type.name] - }).reduce(function (s, i) { - s[i[0]] = i[1] - return s - }, {})) - console.log("") - console.log("shorthands") - console.log(shorthands) -} diff --git a/node_modules/tap/node_modules/nopt/examples/my-program.js b/node_modules/tap/node_modules/nopt/examples/my-program.js deleted file mode 100755 index 142447e1..00000000 --- a/node_modules/tap/node_modules/nopt/examples/my-program.js +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env node - -//process.env.DEBUG_NOPT = 1 - -// my-program.js -var nopt = require("../lib/nopt") - , Stream = require("stream").Stream - , path = require("path") - , knownOpts = { "foo" : [String, null] - , "bar" : [Stream, Number] - , "baz" : path - , "bloo" : [ "big", "medium", "small" ] - , "flag" : Boolean - , "pick" : Boolean - } - , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] - , "b7" : ["--bar", "7"] - , "m" : ["--bloo", "medium"] - , "p" : ["--pick"] - , "f" : ["--flag", "true"] - , "g" : ["--flag"] - , "s" : "--flag" - } - // everything is optional. - // knownOpts and shorthands default to {} - // arg list defaults to process.argv - // slice defaults to 2 - , parsed = nopt(knownOpts, shortHands, process.argv, 2) - -console.log("parsed =\n"+ require("util").inspect(parsed)) diff --git a/node_modules/tap/node_modules/nopt/lib/nopt.js b/node_modules/tap/node_modules/nopt/lib/nopt.js deleted file mode 100644 index 5309a00f..00000000 --- a/node_modules/tap/node_modules/nopt/lib/nopt.js +++ /dev/null @@ -1,414 +0,0 @@ -// info about each config option. - -var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG - ? function () { console.error.apply(console, arguments) } - : function () {} - -var url = require("url") - , path = require("path") - , Stream = require("stream").Stream - , abbrev = require("abbrev") - -module.exports = exports = nopt -exports.clean = clean - -exports.typeDefs = - { String : { type: String, validate: validateString } - , Boolean : { type: Boolean, validate: validateBoolean } - , url : { type: url, validate: validateUrl } - , Number : { type: Number, validate: validateNumber } - , path : { type: path, validate: validatePath } - , Stream : { type: Stream, validate: validateStream } - , Date : { type: Date, validate: validateDate } - } - -function nopt (types, shorthands, args, slice) { - args = args || process.argv - types = types || {} - shorthands = shorthands || {} - if (typeof slice !== "number") slice = 2 - - debug(types, shorthands, args, slice) - - args = args.slice(slice) - var data = {} - , key - , remain = [] - , cooked = args - , original = args.slice(0) - - parse(args, data, remain, types, shorthands) - // now data is full - clean(data, types, exports.typeDefs) - data.argv = {remain:remain,cooked:cooked,original:original} - Object.defineProperty(data.argv, 'toString', { value: function () { - return this.original.map(JSON.stringify).join(" ") - }, enumerable: false }) - return data -} - -function clean (data, types, typeDefs) { - typeDefs = typeDefs || exports.typeDefs - var remove = {} - , typeDefault = [false, true, null, String, Array] - - Object.keys(data).forEach(function (k) { - if (k === "argv") return - var val = data[k] - , isArray = Array.isArray(val) - , type = types[k] - if (!isArray) val = [val] - if (!type) type = typeDefault - if (type === Array) type = typeDefault.concat(Array) - if (!Array.isArray(type)) type = [type] - - debug("val=%j", val) - debug("types=", type) - val = val.map(function (val) { - // if it's an unknown value, then parse false/true/null/numbers/dates - if (typeof val === "string") { - debug("string %j", val) - val = val.trim() - if ((val === "null" && ~type.indexOf(null)) - || (val === "true" && - (~type.indexOf(true) || ~type.indexOf(Boolean))) - || (val === "false" && - (~type.indexOf(false) || ~type.indexOf(Boolean)))) { - val = JSON.parse(val) - debug("jsonable %j", val) - } else if (~type.indexOf(Number) && !isNaN(val)) { - debug("convert to number", val) - val = +val - } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { - debug("convert to date", val) - val = new Date(val) - } - } - - if (!types.hasOwnProperty(k)) { - return val - } - - // allow `--no-blah` to set 'blah' to null if null is allowed - if (val === false && ~type.indexOf(null) && - !(~type.indexOf(false) || ~type.indexOf(Boolean))) { - val = null - } - - var d = {} - d[k] = val - debug("prevalidated val", d, val, types[k]) - if (!validate(d, k, val, types[k], typeDefs)) { - if (exports.invalidHandler) { - exports.invalidHandler(k, val, types[k], data) - } else if (exports.invalidHandler !== false) { - debug("invalid: "+k+"="+val, types[k]) - } - return remove - } - debug("validated val", d, val, types[k]) - return d[k] - }).filter(function (val) { return val !== remove }) - - if (!val.length) delete data[k] - else if (isArray) { - debug(isArray, data[k], val) - data[k] = val - } else data[k] = val[0] - - debug("k=%s val=%j", k, val, data[k]) - }) -} - -function validateString (data, k, val) { - data[k] = String(val) -} - -function validatePath (data, k, val) { - if (val === true) return false - if (val === null) return true - - val = String(val) - var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\// - if (val.match(homePattern) && process.env.HOME) { - val = path.resolve(process.env.HOME, val.substr(2)) - } - data[k] = path.resolve(String(val)) - return true -} - -function validateNumber (data, k, val) { - debug("validate Number %j %j %j", k, val, isNaN(val)) - if (isNaN(val)) return false - data[k] = +val -} - -function validateDate (data, k, val) { - debug("validate Date %j %j %j", k, val, Date.parse(val)) - var s = Date.parse(val) - if (isNaN(s)) return false - data[k] = new Date(val) -} - -function validateBoolean (data, k, val) { - if (val instanceof Boolean) val = val.valueOf() - else if (typeof val === "string") { - if (!isNaN(val)) val = !!(+val) - else if (val === "null" || val === "false") val = false - else val = true - } else val = !!val - data[k] = val -} - -function validateUrl (data, k, val) { - val = url.parse(String(val)) - if (!val.host) return false - data[k] = val.href -} - -function validateStream (data, k, val) { - if (!(val instanceof Stream)) return false - data[k] = val -} - -function validate (data, k, val, type, typeDefs) { - // arrays are lists of types. - if (Array.isArray(type)) { - for (var i = 0, l = type.length; i < l; i ++) { - if (type[i] === Array) continue - if (validate(data, k, val, type[i], typeDefs)) return true - } - delete data[k] - return false - } - - // an array of anything? - if (type === Array) return true - - // NaN is poisonous. Means that something is not allowed. - if (type !== type) { - debug("Poison NaN", k, val, type) - delete data[k] - return false - } - - // explicit list of values - if (val === type) { - debug("Explicitly allowed %j", val) - // if (isArray) (data[k] = data[k] || []).push(val) - // else data[k] = val - data[k] = val - return true - } - - // now go through the list of typeDefs, validate against each one. - var ok = false - , types = Object.keys(typeDefs) - for (var i = 0, l = types.length; i < l; i ++) { - debug("test type %j %j %j", k, val, types[i]) - var t = typeDefs[types[i]] - if (t && type === t.type) { - var d = {} - ok = false !== t.validate(d, k, val) - val = d[k] - if (ok) { - // if (isArray) (data[k] = data[k] || []).push(val) - // else data[k] = val - data[k] = val - break - } - } - } - debug("OK? %j (%j %j %j)", ok, k, val, types[i]) - - if (!ok) delete data[k] - return ok -} - -function parse (args, data, remain, types, shorthands) { - debug("parse", args, data, remain) - - var key = null - , abbrevs = abbrev(Object.keys(types)) - , shortAbbr = abbrev(Object.keys(shorthands)) - - for (var i = 0; i < args.length; i ++) { - var arg = args[i] - debug("arg", arg) - - if (arg.match(/^-{2,}$/)) { - // done with keys. - // the rest are args. - remain.push.apply(remain, args.slice(i + 1)) - args[i] = "--" - break - } - var hadEq = false - if (arg.charAt(0) === "-" && arg.length > 1) { - if (arg.indexOf("=") !== -1) { - hadEq = true - var v = arg.split("=") - arg = v.shift() - v = v.join("=") - args.splice.apply(args, [i, 1].concat([arg, v])) - } - - // see if it's a shorthand - // if so, splice and back up to re-parse it. - var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) - debug("arg=%j shRes=%j", arg, shRes) - if (shRes) { - debug(arg, shRes) - args.splice.apply(args, [i, 1].concat(shRes)) - if (arg !== shRes[0]) { - i -- - continue - } - } - arg = arg.replace(/^-+/, "") - var no = null - while (arg.toLowerCase().indexOf("no-") === 0) { - no = !no - arg = arg.substr(3) - } - - if (abbrevs[arg]) arg = abbrevs[arg] - - var isArray = types[arg] === Array || - Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1 - - // allow unknown things to be arrays if specified multiple times. - if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) { - if (!Array.isArray(data[arg])) - data[arg] = [data[arg]] - isArray = true - } - - var val - , la = args[i + 1] - - var isBool = typeof no === 'boolean' || - types[arg] === Boolean || - Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 || - (typeof types[arg] === 'undefined' && !hadEq) || - (la === "false" && - (types[arg] === null || - Array.isArray(types[arg]) && ~types[arg].indexOf(null))) - - if (isBool) { - // just set and move along - val = !no - // however, also support --bool true or --bool false - if (la === "true" || la === "false") { - val = JSON.parse(la) - la = null - if (no) val = !val - i ++ - } - - // also support "foo":[Boolean, "bar"] and "--foo bar" - if (Array.isArray(types[arg]) && la) { - if (~types[arg].indexOf(la)) { - // an explicit type - val = la - i ++ - } else if ( la === "null" && ~types[arg].indexOf(null) ) { - // null allowed - val = null - i ++ - } else if ( !la.match(/^-{2,}[^-]/) && - !isNaN(la) && - ~types[arg].indexOf(Number) ) { - // number - val = +la - i ++ - } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) { - // string - val = la - i ++ - } - } - - if (isArray) (data[arg] = data[arg] || []).push(val) - else data[arg] = val - - continue - } - - if (types[arg] === String && la === undefined) - la = "" - - if (la && la.match(/^-{2,}$/)) { - la = undefined - i -- - } - - val = la === undefined ? true : la - if (isArray) (data[arg] = data[arg] || []).push(val) - else data[arg] = val - - i ++ - continue - } - remain.push(arg) - } -} - -function resolveShort (arg, shorthands, shortAbbr, abbrevs) { - // handle single-char shorthands glommed together, like - // npm ls -glp, but only if there is one dash, and only if - // all of the chars are single-char shorthands, and it's - // not a match to some other abbrev. - arg = arg.replace(/^-+/, '') - - // if it's an exact known option, then don't go any further - if (abbrevs[arg] === arg) - return null - - // if it's an exact known shortopt, same deal - if (shorthands[arg]) { - // make it an array, if it's a list of words - if (shorthands[arg] && !Array.isArray(shorthands[arg])) - shorthands[arg] = shorthands[arg].split(/\s+/) - - return shorthands[arg] - } - - // first check to see if this arg is a set of single-char shorthands - var singles = shorthands.___singles - if (!singles) { - singles = Object.keys(shorthands).filter(function (s) { - return s.length === 1 - }).reduce(function (l,r) { - l[r] = true - return l - }, {}) - shorthands.___singles = singles - debug('shorthand singles', singles) - } - - var chrs = arg.split("").filter(function (c) { - return singles[c] - }) - - if (chrs.join("") === arg) return chrs.map(function (c) { - return shorthands[c] - }).reduce(function (l, r) { - return l.concat(r) - }, []) - - - // if it's an arg abbrev, and not a literal shorthand, then prefer the arg - if (abbrevs[arg] && !shorthands[arg]) - return null - - // if it's an abbr for a shorthand, then use that - if (shortAbbr[arg]) - arg = shortAbbr[arg] - - // make it an array, if it's a list of words - if (shorthands[arg] && !Array.isArray(shorthands[arg])) - shorthands[arg] = shorthands[arg].split(/\s+/) - - return shorthands[arg] -} diff --git a/node_modules/tap/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md b/node_modules/tap/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md deleted file mode 100644 index 2f302612..00000000 --- a/node_modules/tap/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md +++ /dev/null @@ -1,3 +0,0 @@ - To get started, sign the - Contributor License Agreement. diff --git a/node_modules/tap/node_modules/nopt/node_modules/abbrev/LICENSE b/node_modules/tap/node_modules/nopt/node_modules/abbrev/LICENSE deleted file mode 100644 index 05a40109..00000000 --- a/node_modules/tap/node_modules/nopt/node_modules/abbrev/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/tap/node_modules/nopt/node_modules/abbrev/README.md b/node_modules/tap/node_modules/nopt/node_modules/abbrev/README.md deleted file mode 100644 index 99746fe6..00000000 --- a/node_modules/tap/node_modules/nopt/node_modules/abbrev/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# abbrev-js - -Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). - -Usage: - - var abbrev = require("abbrev"); - abbrev("foo", "fool", "folding", "flop"); - - // returns: - { fl: 'flop' - , flo: 'flop' - , flop: 'flop' - , fol: 'folding' - , fold: 'folding' - , foldi: 'folding' - , foldin: 'folding' - , folding: 'folding' - , foo: 'foo' - , fool: 'fool' - } - -This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/node_modules/tap/node_modules/nopt/node_modules/abbrev/abbrev.js b/node_modules/tap/node_modules/nopt/node_modules/abbrev/abbrev.js deleted file mode 100644 index 69cfeac5..00000000 --- a/node_modules/tap/node_modules/nopt/node_modules/abbrev/abbrev.js +++ /dev/null @@ -1,62 +0,0 @@ - -module.exports = exports = abbrev.abbrev = abbrev - -abbrev.monkeyPatch = monkeyPatch - -function monkeyPatch () { - Object.defineProperty(Array.prototype, 'abbrev', { - value: function () { return abbrev(this) }, - enumerable: false, configurable: true, writable: true - }) - - Object.defineProperty(Object.prototype, 'abbrev', { - value: function () { return abbrev(Object.keys(this)) }, - enumerable: false, configurable: true, writable: true - }) -} - -function abbrev (list) { - if (arguments.length !== 1 || !Array.isArray(list)) { - list = Array.prototype.slice.call(arguments, 0) - } - for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { - args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) - } - - // sort them lexicographically, so that they're next to their nearest kin - args = args.sort(lexSort) - - // walk through each, seeing how much it has in common with the next and previous - var abbrevs = {} - , prev = "" - for (var i = 0, l = args.length ; i < l ; i ++) { - var current = args[i] - , next = args[i + 1] || "" - , nextMatches = true - , prevMatches = true - if (current === next) continue - for (var j = 0, cl = current.length ; j < cl ; j ++) { - var curChar = current.charAt(j) - nextMatches = nextMatches && curChar === next.charAt(j) - prevMatches = prevMatches && curChar === prev.charAt(j) - if (!nextMatches && !prevMatches) { - j ++ - break - } - } - prev = current - if (j === cl) { - abbrevs[current] = current - continue - } - for (var a = current.substr(0, j) ; j <= cl ; j ++) { - abbrevs[a] = current - a += current.charAt(j) - } - } - return abbrevs -} - -function lexSort (a, b) { - return a === b ? 0 : a > b ? 1 : -1 -} diff --git a/node_modules/tap/node_modules/nopt/node_modules/abbrev/package.json b/node_modules/tap/node_modules/nopt/node_modules/abbrev/package.json deleted file mode 100644 index 3ecf9957..00000000 --- a/node_modules/tap/node_modules/nopt/node_modules/abbrev/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "abbrev", - "version": "1.0.5", - "description": "Like ruby's abbrev module, but in js", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "main": "abbrev.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/isaacs/abbrev-js.git" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/abbrev-js/raw/master/LICENSE" - }, - "readme": "# abbrev-js\n\nJust like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).\n\nUsage:\n\n var abbrev = require(\"abbrev\");\n abbrev(\"foo\", \"fool\", \"folding\", \"flop\");\n \n // returns:\n { fl: 'flop'\n , flo: 'flop'\n , flop: 'flop'\n , fol: 'folding'\n , fold: 'folding'\n , foldi: 'folding'\n , foldin: 'folding'\n , folding: 'folding'\n , foo: 'foo'\n , fool: 'fool'\n }\n\nThis is handy for command-line scripts, or other cases where you want to be able to accept shorthands.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/abbrev-js/issues" - }, - "homepage": "https://github.com/isaacs/abbrev-js", - "_id": "abbrev@1.0.5", - "_shasum": "5d8257bd9ebe435e698b2fa431afde4fe7b10b03", - "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz", - "_from": "abbrev@>=1.0.0 <2.0.0" -} diff --git a/node_modules/tap/node_modules/nopt/node_modules/abbrev/test.js b/node_modules/tap/node_modules/nopt/node_modules/abbrev/test.js deleted file mode 100644 index d5a7303e..00000000 --- a/node_modules/tap/node_modules/nopt/node_modules/abbrev/test.js +++ /dev/null @@ -1,47 +0,0 @@ -var abbrev = require('./abbrev.js') -var assert = require("assert") -var util = require("util") - -console.log("TAP Version 13") -var count = 0 - -function test (list, expect) { - count++ - var actual = abbrev(list) - assert.deepEqual(actual, expect, - "abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+ - "actual: "+util.inspect(actual)) - actual = abbrev.apply(exports, list) - assert.deepEqual(abbrev.apply(exports, list), expect, - "abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+ - "actual: "+util.inspect(actual)) - console.log('ok - ' + list.join(' ')) -} - -test([ "ruby", "ruby", "rules", "rules", "rules" ], -{ rub: 'ruby' -, ruby: 'ruby' -, rul: 'rules' -, rule: 'rules' -, rules: 'rules' -}) -test(["fool", "foom", "pool", "pope"], -{ fool: 'fool' -, foom: 'foom' -, poo: 'pool' -, pool: 'pool' -, pop: 'pope' -, pope: 'pope' -}) -test(["a", "ab", "abc", "abcd", "abcde", "acde"], -{ a: 'a' -, ab: 'ab' -, abc: 'abc' -, abcd: 'abcd' -, abcde: 'abcde' -, ac: 'acde' -, acd: 'acde' -, acde: 'acde' -}) - -console.log("0..%d", count) diff --git a/node_modules/tap/node_modules/nopt/package.json b/node_modules/tap/node_modules/nopt/package.json deleted file mode 100644 index b9a6e7f2..00000000 --- a/node_modules/tap/node_modules/nopt/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "nopt", - "version": "3.0.1", - "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "main": "lib/nopt.js", - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/isaacs/nopt.git" - }, - "bin": { - "nopt": "./bin/nopt.js" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/nopt/raw/master/LICENSE" - }, - "dependencies": { - "abbrev": "1" - }, - "devDependencies": { - "tap": "~0.4.8" - }, - "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk -fp # unknown opts are ok.\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/nopt/issues" - }, - "homepage": "https://github.com/isaacs/nopt", - "_id": "nopt@3.0.1", - "_shasum": "bce5c42446a3291f47622a370abbf158fbbacbfd", - "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.1.tgz", - "_from": "nopt@>=3.0.1 <4.0.0" -} diff --git a/node_modules/tap/node_modules/nopt/test/basic.js b/node_modules/tap/node_modules/nopt/test/basic.js deleted file mode 100644 index 2f9088cf..00000000 --- a/node_modules/tap/node_modules/nopt/test/basic.js +++ /dev/null @@ -1,251 +0,0 @@ -var nopt = require("../") - , test = require('tap').test - - -test("passing a string results in a string", function (t) { - var parsed = nopt({ key: String }, {}, ["--key", "myvalue"], 0) - t.same(parsed.key, "myvalue") - t.end() -}) - -// https://github.com/npm/nopt/issues/31 -test("Empty String results in empty string, not true", function (t) { - var parsed = nopt({ empty: String }, {}, ["--empty"], 0) - t.same(parsed.empty, "") - t.end() -}) - -test("~ path is resolved to $HOME", function (t) { - var path = require("path") - if (!process.env.HOME) process.env.HOME = "/tmp" - var parsed = nopt({key: path}, {}, ["--key=~/val"], 0) - t.same(parsed.key, path.resolve(process.env.HOME, "val")) - t.end() -}) - -// https://github.com/npm/nopt/issues/24 -test("Unknown options are not parsed as numbers", function (t) { - var parsed = nopt({"parse-me": Number}, null, ['--leave-as-is=1.20', '--parse-me=1.20'], 0) - t.equal(parsed['leave-as-is'], '1.20') - t.equal(parsed['parse-me'], 1.2) - t.end() -}); - -test("other tests", function (t) { - - var util = require("util") - , Stream = require("stream") - , path = require("path") - , url = require("url") - - , shorthands = - { s : ["--loglevel", "silent"] - , d : ["--loglevel", "info"] - , dd : ["--loglevel", "verbose"] - , ddd : ["--loglevel", "silly"] - , noreg : ["--no-registry"] - , reg : ["--registry"] - , "no-reg" : ["--no-registry"] - , silent : ["--loglevel", "silent"] - , verbose : ["--loglevel", "verbose"] - , h : ["--usage"] - , H : ["--usage"] - , "?" : ["--usage"] - , help : ["--usage"] - , v : ["--version"] - , f : ["--force"] - , desc : ["--description"] - , "no-desc" : ["--no-description"] - , "local" : ["--no-global"] - , l : ["--long"] - , p : ["--parseable"] - , porcelain : ["--parseable"] - , g : ["--global"] - } - - , types = - { aoa: Array - , nullstream: [null, Stream] - , date: Date - , str: String - , browser : String - , cache : path - , color : ["always", Boolean] - , depth : Number - , description : Boolean - , dev : Boolean - , editor : path - , force : Boolean - , global : Boolean - , globalconfig : path - , group : [String, Number] - , gzipbin : String - , logfd : [Number, Stream] - , loglevel : ["silent","win","error","warn","info","verbose","silly"] - , long : Boolean - , "node-version" : [false, String] - , npaturl : url - , npat : Boolean - , "onload-script" : [false, String] - , outfd : [Number, Stream] - , parseable : Boolean - , pre: Boolean - , prefix: path - , proxy : url - , "rebuild-bundle" : Boolean - , registry : url - , searchopts : String - , searchexclude: [null, String] - , shell : path - , t: [Array, String] - , tag : String - , tar : String - , tmp : path - , "unsafe-perm" : Boolean - , usage : Boolean - , user : String - , username : String - , userconfig : path - , version : Boolean - , viewer: path - , _exit : Boolean - , path: path - } - - ; [["-v", {version:true}, []] - ,["---v", {version:true}, []] - ,["ls -s --no-reg connect -d", - {loglevel:"info",registry:null},["ls","connect"]] - ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]] - ,["ls --registry blargle", {}, ["ls"]] - ,["--no-registry", {registry:null}, []] - ,["--no-color true", {color:false}, []] - ,["--no-color false", {color:true}, []] - ,["--no-color", {color:false}, []] - ,["--color false", {color:false}, []] - ,["--color --logfd 7", {logfd:7,color:true}, []] - ,["--color=true", {color:true}, []] - ,["--logfd=10", {logfd:10}, []] - ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]] - ,["--tmp=tmp -tar=gtar", - {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]] - ,["--logfd x", {}, []] - ,["a -true -- -no-false", {true:true},["a","-no-false"]] - ,["a -no-false", {false:false},["a"]] - ,["a -no-no-true", {true:true}, ["a"]] - ,["a -no-no-no-false", {false:false}, ["a"]] - ,["---NO-no-No-no-no-no-nO-no-no"+ - "-No-no-no-no-no-no-no-no-no"+ - "-no-no-no-no-NO-NO-no-no-no-no-no-no"+ - "-no-body-can-do-the-boogaloo-like-I-do" - ,{"body-can-do-the-boogaloo-like-I-do":false}, []] - ,["we are -no-strangers-to-love "+ - "--you-know=the-rules --and=so-do-i "+ - "---im-thinking-of=a-full-commitment "+ - "--no-you-would-get-this-from-any-other-guy "+ - "--no-gonna-give-you-up "+ - "-no-gonna-let-you-down=true "+ - "--no-no-gonna-run-around false "+ - "--desert-you=false "+ - "--make-you-cry false "+ - "--no-tell-a-lie "+ - "--no-no-and-hurt-you false" - ,{"strangers-to-love":false - ,"you-know":"the-rules" - ,"and":"so-do-i" - ,"you-would-get-this-from-any-other-guy":false - ,"gonna-give-you-up":false - ,"gonna-let-you-down":false - ,"gonna-run-around":false - ,"desert-you":false - ,"make-you-cry":false - ,"tell-a-lie":false - ,"and-hurt-you":false - },["we", "are"]] - ,["-t one -t two -t three" - ,{t: ["one", "two", "three"]} - ,[]] - ,["-t one -t null -t three four five null" - ,{t: ["one", "null", "three"]} - ,["four", "five", "null"]] - ,["-t foo" - ,{t:["foo"]} - ,[]] - ,["--no-t" - ,{t:["false"]} - ,[]] - ,["-no-no-t" - ,{t:["true"]} - ,[]] - ,["-aoa one -aoa null -aoa 100" - ,{aoa:["one", null, '100']} - ,[]] - ,["-str 100" - ,{str:"100"} - ,[]] - ,["--color always" - ,{color:"always"} - ,[]] - ,["--no-nullstream" - ,{nullstream:null} - ,[]] - ,["--nullstream false" - ,{nullstream:null} - ,[]] - ,["--notadate=2011-01-25" - ,{notadate: "2011-01-25"} - ,[]] - ,["--date 2011-01-25" - ,{date: new Date("2011-01-25")} - ,[]] - ,["-cl 1" - ,{config: true, length: 1} - ,[] - ,{config: Boolean, length: Number, clear: Boolean} - ,{c: "--config", l: "--length"}] - ,["--acount bla" - ,{"acount":true} - ,["bla"] - ,{account: Boolean, credentials: Boolean, options: String} - ,{a:"--account", c:"--credentials",o:"--options"}] - ,["--clear" - ,{clear:true} - ,[] - ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean} - ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}] - ,["--file -" - ,{"file":"-"} - ,[] - ,{file:String} - ,{}] - ,["--file -" - ,{"file":true} - ,["-"] - ,{file:Boolean} - ,{}] - ,["--path" - ,{"path":null} - ,[]] - ,["--path ." - ,{"path":process.cwd()} - ,[]] - ].forEach(function (test) { - var argv = test[0].split(/\s+/) - , opts = test[1] - , rem = test[2] - , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0) - , parsed = actual.argv - delete actual.argv - for (var i in opts) { - var e = JSON.stringify(opts[i]) - , a = JSON.stringify(actual[i] === undefined ? null : actual[i]) - if (e && typeof e === "object") { - t.deepEqual(e, a) - } else { - t.equal(e, a) - } - } - t.deepEqual(rem, parsed.remain) - }) - t.end() -}) diff --git a/node_modules/tap/node_modules/runforcover/README.markdown b/node_modules/tap/node_modules/runforcover/README.markdown deleted file mode 100644 index 1e56ebd6..00000000 --- a/node_modules/tap/node_modules/runforcover/README.markdown +++ /dev/null @@ -1,56 +0,0 @@ -runforcover -====== - -Runforcover is a require-hook library that uses node-bunker to provide code coverage data -for your unit test library, whatever it might be. - -methods -======= -var runforcover = require('runforcover'); - -var coverage = runforcover.cover([RegExp | path]); -------- - -Attach runforcover to the global `require` object and patch `require.extensions['.js']` to -provide coverage metadata for all files required after this point. Returns a function -object that can be called to obtain a object keying files to `CoverageData` objects, with -a method for releasing control back to vanilla `require`. Usage: - -````javascript - -var coverage = runforcover.cover(/.*/g); - -require('some/library'); - -coverage(function(coverageData) { - // coverageData is an object keyed by filename. - var stats = coverageData['/full/path/to/file.js'].stats() - - // the percentage of lines run versus total lines in file - console.log(stats.percentage); - - // the number of missing lines - console.log(stats.missing); - - // the number of lines run (seen) - console.log(stats.seen); - - // an array of line objects representing 'missed' lines - stats.lines; - - stats.lines.forEach(function(line) { - // the line number of the line: - console.log(line.number); - - // returns a string containing the source data for the line: - console.log(line.source()); - }); - - // return control back to the original require function - coverage.release(); -}); -```` - -license -======= -new BSD. diff --git a/node_modules/tap/node_modules/runforcover/index.js b/node_modules/tap/node_modules/runforcover/index.js deleted file mode 100644 index b5318ac6..00000000 --- a/node_modules/tap/node_modules/runforcover/index.js +++ /dev/null @@ -1,127 +0,0 @@ -var bunker = require('bunker'), - Module = require('module').Module, - path = require('path'), - fs = require('fs'), - vm = require('vm'); - -function CoverageData (filename, bunker) { - this.bunker = bunker; - this.filename = filename; - this.nodes = {}; -}; - -CoverageData.prototype.visit = function(node) { - ++(this.nodes[node.id] = this.nodes[node.id] || {node:node, count:0}).count; -}; - -CoverageData.prototype.missing = function() { - var nodes = this.nodes, - missing = this.bunker.nodes.filter(function(node) { - return !nodes[node.id]; - }); - - return missing; -}; - -CoverageData.prototype.stats = function() { - var missing = this.missing(), - filedata = fs.readFileSync(this.filename, 'utf8').split('\n'); - - var seenLines = [], - lines = - missing.sort(function(lhs, rhs) { - return lhs.node[0].start.line < rhs.node[0].start.line ? -1 : - lhs.node[0].start.line > rhs.node[0].start.line ? 1 : - 0; - }).filter(function(node) { - - var okay = (seenLines.indexOf(node.node[0].start.line) < 0); - if(okay) - seenLines.push(node.node[0].start.line); - return okay; - - }).map(function(node, idx, all) { - return { - lineno:node.node[0].start.line + 1, - source:function() { return filedata[node.node[0].start.line]; } - }; - }); - - return { - percentage:(filedata.length-seenLines.length)/filedata.length, - lines:lines, - missing:seenLines.length, - seen:(filedata.length-seenLines.length) - }; -}; - -module.exports.createEnvironment = function(module, filename) { - var req = function(path) { - return Module._load(path, module); - }; - req.resolve = function(request) { - return Module._resolveFilename(request, module)[1]; - } - req.paths = Module._paths; - req.main = process.mainModule; - req.extensions = Module._extensions; - req.registerExtension = function() { - throw new Error('require.registerExtension() removed. Use ' + - 'require.extensions instead.'); - } - require.cache = Module._cache; - - var ctxt = {}; - for(var k in global) - ctxt[k] = global[k]; - - ctxt.require = req; - ctxt.exports = module.exports; - ctxt.__filename = filename; - ctxt.__dirname = path.dirname(filename); - ctxt.process = process; - ctxt.console = console; - ctxt.module = module; - ctxt.global = ctxt; - - return ctxt; -}; - -module.exports.cover = function(fileRegex) { - var originalRequire = require.extensions['.js'], - coverageData = {}, - match = fileRegex instanceof RegExp ? - fileRegex : new RegExp( - fileRegex ? fileRegex.replace(/\//g, '\\/').replace(/\./g, '\\.') : '.*' - , 'g'), - target = this; - - require.extensions['.js'] = function(module, filename) { - if(!match.test(filename)) return originalRequire(module, filename); - - var context = target.createEnvironment(module, filename), - data = fs.readFileSync(filename, 'utf8'), - bunkerized = bunker(data), - coverage = coverageData[filename] = new CoverageData(filename, bunkerized); - - bunkerized.on('node', coverage.visit.bind(coverage)); - bunkerized.assign(context); - - var wrapper = '(function(ctxt) { with(ctxt) { return '+Module.wrap(bunkerized.compile())+'; } })', - compiledWrapper = vm.runInThisContext(wrapper, filename, true)(context); - - var args = [context.exports, context.require, module, filename, context.__dirname]; - return compiledWrapper.apply(module.exports, args); - }; - - var retval = function(ready) { - ready(coverageData); - }; - - retval.release = function() { - require.extensions['.js'] = originalRequire; - }; - - return retval; -}; - diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/.npmignore b/node_modules/tap/node_modules/runforcover/node_modules/bunker/.npmignore deleted file mode 100644 index 3c3629e6..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/.travis.yml b/node_modules/tap/node_modules/runforcover/node_modules/bunker/.travis.yml deleted file mode 100644 index f1d0f13c..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/README.markdown b/node_modules/tap/node_modules/runforcover/node_modules/bunker/README.markdown deleted file mode 100644 index 0d0c387b..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/README.markdown +++ /dev/null @@ -1,82 +0,0 @@ -bunker -====== - -Bunker is a module to calculate code coverage using native javascript -[burrito](https://github.com/substack/node-burrito) AST trickery. - -[![build status](https://secure.travis-ci.org/substack/node-bunker.png)](http://travis-ci.org/substack/node-bunker) - -![code coverage](http://substack.net/images/code_coverage.png) - -examples -======== - -tiny ----- - -````javascript -var bunker = require('bunker'); -var b = bunker('var x = 0; for (var i = 0; i < 30; i++) { x++ }'); - -var counts = {}; - -b.on('node', function (node) { - if (!counts[node.id]) { - counts[node.id] = { times : 0, node : node }; - } - counts[node.id].times ++; -}); - -b.run(); - -Object.keys(counts).forEach(function (key) { - var count = counts[key]; - console.log(count.times + ' : ' + count.node.source()); -}); -```` - -output: - - $ node example/tiny.js - 1 : var x=0; - 31 : i<30 - 30 : i++ - 30 : x++; - 30 : x++ - -methods -======= - -var bunker = require('bunker'); - -var b = bunker(src) -------------------- - -Create a new bunker code coverageifier with some source `src`. - -The bunker object `b` is an `EventEmitter` that emits `'node'` events with two -parameters: - -* `node` - the [burrito](https://github.com/substack/node-burrito) node object -* `stack` - the stack, [stackedy](https://github.com/substack/node-stackedy) style - -b.include(src) --------------- - -Include some source into the bunker. - -b.compile() ------------ - -Return the source wrapped with burrito. - -b.assign(context={}) --------------------- - -Assign the statement-tracking functions into `context`. - -b.run(context={}) ------------------ - -Run the source using `vm.runInNewContext()` with some `context`. -The statement-tracking functions will be added to `context` by `assign()`. diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/example/prof.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/example/prof.js deleted file mode 100644 index 5cac4ccc..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/example/prof.js +++ /dev/null @@ -1,51 +0,0 @@ -var bunker = require('bunker'); -var b = bunker('(' + function () { - function beep () { - var x = 0; - for (var i = 0; i < 1000; i++) { - for (var j = 0; j < 100; j++) { - x += j; - } - } - return x; - } - - beep(); - -} + ')()'); - -var counts = {}; - -b.on('node', function (node) { - if (!counts[node.id]) { - counts[node.id] = { times : 0, node : node, elapsed : 0 }; - } - counts[node.id].times ++; - - var now = Date.now(); - - if (last.id !== undefined) { - counts[last.id].elapsed += last. - } - - if (node.name === 'call') { - var start = now; - - last.id = node.id; - counts[node.id].elapsed += Date.now() - start; - } - else { - counts[node.id].elapsed += now - last; - last = now; - } -}); - -b.run(); - -Object.keys(counts).forEach(function (key) { - var count = counts[key]; - console.log( - [ count.times, count.node.source(), count.elapsed ] - .join(' : ') - ); -}); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/example/tiny.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/example/tiny.js deleted file mode 100644 index aa5b034a..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/example/tiny.js +++ /dev/null @@ -1,18 +0,0 @@ -var bunker = require('bunker'); -var b = bunker('var x = 0; for (var i = 0; i < 30; i++) { x++ }'); - -var counts = {}; - -b.on('node', function (node) { - if (!counts[node.id]) { - counts[node.id] = { times : 0, node : node }; - } - counts[node.id].times ++; -}); - -b.run(); - -Object.keys(counts).forEach(function (key) { - var count = counts[key]; - console.log(count.times + ' : ' + count.node.source()); -}); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/example/top/run.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/example/top/run.js deleted file mode 100644 index d9eaa105..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/example/top/run.js +++ /dev/null @@ -1,31 +0,0 @@ -var bunker = require('bunker'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/src.js', 'utf8'); - -var counts = {}; - -var b = bunker(src); -b.on('node', function (node) { - if (!counts[node.id]) { - counts[node.id] = { times : 0, node : node }; - } - counts[node.id].times ++; -}); - -b.run({ - setInterval : setInterval, - clearInterval : clearInterval, - end : function () { - Object.keys(counts) - .sort(function (a, b) { - return counts[b].times - counts[a].times - }) - .forEach(function (key) { - var count = counts[key]; - console.log( - count.times + ' : ' + count.node.source() - ); - }) - ; - } -}); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/example/top/src.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/example/top/src.js deleted file mode 100644 index 0c92e481..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/example/top/src.js +++ /dev/null @@ -1,18 +0,0 @@ -function boop () { - for (var i = 0; i < 30; i++) { - nop(); - } -} - -function nop () { - return undefined; -} - -var times = 0; -var iv = setInterval(function () { - if (++times === 10) { - clearInterval(iv); - end(); - } - else boop() -}, 100); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/index.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/index.js deleted file mode 100644 index ed5d437f..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/index.js +++ /dev/null @@ -1,116 +0,0 @@ -var burrito = require('burrito'); -var vm = require('vm'); -var EventEmitter = require('events').EventEmitter; - -module.exports = function (src) { - var b = new Bunker(); - if (src) b.include(src); - return b; -}; - -function Bunker () { - this.sources = []; - this.nodes = []; - - this.names = { - call : burrito.generateName(6), - expr : burrito.generateName(6), - stat : burrito.generateName(6), - return : burrito.generateName(6) - }; -} - -Bunker.prototype = new EventEmitter; - -Bunker.prototype.include = function (src) { - this.sources.push(src); - this.source = null; - return this; -}; - -Bunker.prototype.compile = function () { - var src = this.sources.join('\n'); - var nodes = this.nodes; - var names = this.names; - - return burrito(src, function (node) { - var i = nodes.length; - - if (node.name === 'call') { - nodes.push(node); - node.wrap(names.call + '(' + i + ')(%s)'); - } - else if (node.name === 'stat' || node.name === 'throw' - || node.name === 'var') { - nodes.push(node); - node.wrap('{' + names.stat + '(' + i + ');%s}'); - } - else if (node.name === 'return') { - nodes.push(node); - // We need to wrap the new source in a function definition - // so that UglifyJS will allow the presence of return - var stat = names.stat + '(' + i + ');'; - var wrapped = 'function ' + names.return + '() {' - + stat + node.source() - +'}' - ; - var parsed = burrito.parse(wrapped); - // Remove the function definition from the AST - parsed[1] = parsed[1][0][3]; - node.state.update(parsed, true); - } - else if (node.name === 'binary') { - nodes.push(node); - node.wrap(names.expr + '(' + i + ')(%s)'); - } - else if (node.name === 'unary-postfix' || node.name === 'unary-prefix') { - nodes.push(node); - node.wrap(names.expr + '(' + i + ')(%s)'); - } - - if (i !== nodes.length) { - node.id = i; - } - }); -}; - -Bunker.prototype.assign = function (context) { - if (!context) context = {}; - - var self = this; - var stack = []; - - context[self.names.call] = function (i) { - var node = self.nodes[i]; - stack.unshift(node); - self.emit('node', node, stack); - - return function (expr) { - stack.shift(); - return expr; - }; - }; - - context[self.names.expr] = function (i) { - var node = self.nodes[i]; - self.emit('node', node, stack); - - return function (expr) { - return expr; - }; - }; - - context[self.names.stat] = function (i) { - var node = self.nodes[i]; - self.emit('node', node, stack); - }; - - return context; -}; - -Bunker.prototype.run = function (context) { - var src = this.compile(); - vm.runInNewContext(src, this.assign(context)); - - return this; -}; diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/.npmignore b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/.npmignore deleted file mode 100644 index 3c3629e6..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/.travis.yml b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/.travis.yml deleted file mode 100644 index f1d0f13c..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/README.markdown b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/README.markdown deleted file mode 100644 index 7c9097c8..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/README.markdown +++ /dev/null @@ -1,187 +0,0 @@ -burrito -======= - -Burrito makes it easy to do crazy stuff with the javascript AST. - -This is super useful if you want to roll your own stack traces or build a code -coverage tool. - -[![build status](https://secure.travis-ci.org/substack/node-burrito.png)](http://travis-ci.org/substack/node-burrito) - -![node.wrap("burrito")](http://substack.net/images/burrito.png) - -examples -======== - -microwave ---------- - -examples/microwave.js - -````javascript -var burrito = require('burrito'); - -var res = burrito.microwave('Math.sin(2)', function (node) { - if (node.name === 'num') node.wrap('Math.PI / %s'); -}); - -console.log(res); // sin(pi / 2) == 1 -```` - -output: - - 1 - -wrap ----- - -examples/wrap.js - -````javascript -var burrito = require('burrito'); - -var src = burrito('f() && g(h())\nfoo()', function (node) { - if (node.name === 'call') node.wrap('qqq(%s)'); -}); - -console.log(src); -```` - -output: - - qqq(f()) && qqq(g(qqq(h()))); - - qqq(foo()); - -methods -======= - - var burrito = require('burrito'); - -burrito(code, cb) ------------------ - -Given some source `code` and a function `trace`, walk the ast by expression. - -The `cb` gets called with a node object described below. - -If `code` is an Array then it is assumbed to be an AST which you can generate -yourself with `burrito.parse()`. The AST must be annotated, so make sure to -`burrito.parse(src, false, true)`. - -burrito.microwave(code, context={}, cb) ---------------------------------------- - -Like `burrito()` except the result is run using -`vm.runInNewContext(res, context)`. - -node object -=========== - -node.name ---------- - -Name is a string that contains the type of the expression as named by uglify. - -node.wrap(s) ------------- - -Wrap the current expression in `s`. - -If `s` is a string, `"%s"` will be replaced with the stringified current -expression. - -If `s` is a function, it is called with the stringified current expression and -should return a new stringified expression. - -If the `node.name === "binary"`, you get the subterms "%a" and "%b" to play with -too. These subterms are applied if `s` is a function too: `s(expr, a, b)`. - -Protip: to insert multiple statements you can use javascript's lesser-known block -syntax that it gets from C: - -````javascript -if (node.name === 'stat') node.wrap('{ foo(); %s }') -```` - -node.node ---------- - -raw ast data generated by uglify - -node.value ----------- - -`node.node.slice(1)` to skip the annotations - -node.start ----------- - -The start location of the expression, like this: - -````javascript -{ type: 'name', - value: 'b', - line: 0, - col: 3, - pos: 3, - nlb: false, - comments_before: [] } -```` - -node.end --------- - -The end location of the expression, formatted the same as `node.start`. - -node.state ----------- - -The state of the traversal using traverse. - -node.source() -------------- - -Returns a stringified version of the expression. - -node.parent() -------------- - -Returns the parent `node` or `null` if the node is the root element. - -node.label() ------------- - -Return the label of the present node or `null` if there is no label. - -Labels are returned for "call", "var", "defun", and "function" nodes. - -Returns an array for "var" nodes since `var` statements can -contain multiple labels in assignment. - -install -======= - -With [npm](http://npmjs.org) you can just: - - npm install burrito - -in the browser -============== - -Burrito works in browser with -[browserify](https://github.com/substack/node-browserify). - -It has been tested against: - -* Internet Explorer 5.5, 6.0, 7.0, 8.0, 9.0 -* Firefox 3.5 -* Chrome 6.0 -* Opera 10.6 -* Safari 5.0 - -kudos -===== - -Heavily inspired by (and previously mostly lifted outright from) isaacs's nifty -tmp/instrument.js thingy from uglify-js. diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/microwave.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/microwave.js deleted file mode 100644 index c6fcf45b..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/microwave.js +++ /dev/null @@ -1,8 +0,0 @@ -var burrito = require('burrito'); - -var res = burrito.microwave('Math.sin(2)', function (node) { - console.dir(node); - if (node.name === 'num') node.wrap('Math.PI / %s'); -}); - -console.log(res); // sin(pi / 2) == 1 diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/bs.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/bs.js deleted file mode 100644 index 3583c7f6..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/bs.js +++ /dev/null @@ -1,4832 +0,0 @@ -var require = function (file, cwd) { - var resolved = require.resolve(file, cwd || '/'); - var mod = require.modules[resolved]; - if (!mod) throw new Error( - 'Failed to resolve module ' + file + ', tried ' + resolved - ); - var res = mod._cached ? mod._cached : mod(); - return res; -} -var __require = require; - -require.paths = []; -require.modules = {}; -require.extensions = [".js",".coffee"]; - -require.resolve = (function () { - var core = { - 'assert': true, - 'events': true, - 'fs': true, - 'path': true, - 'vm': true - }; - - return function (x, cwd) { - if (!cwd) cwd = '/'; - - if (core[x]) return x; - var path = require.modules.path(); - var y = cwd || '.'; - - if (x.match(/^(?:\.\.?\/|\/)/)) { - var m = loadAsFileSync(path.resolve(y, x)) - || loadAsDirectorySync(path.resolve(y, x)); - if (m) return m; - } - - var n = loadNodeModulesSync(x, y); - if (n) return n; - - throw new Error("Cannot find module '" + x + "'"); - - function loadAsFileSync (x) { - if (require.modules[x]) { - return x; - } - - for (var i = 0; i < require.extensions.length; i++) { - var ext = require.extensions[i]; - if (require.modules[x + ext]) return x + ext; - } - } - - function loadAsDirectorySync (x) { - x = x.replace(/\/+$/, ''); - var pkgfile = x + '/package.json'; - if (require.modules[pkgfile]) { - var pkg = require.modules[pkgfile](); - var b = pkg.browserify; - if (typeof b === 'object' && b.main) { - var m = loadAsFileSync(path.resolve(x, b.main)); - if (m) return m; - } - else if (typeof b === 'string') { - var m = loadAsFileSync(path.resolve(x, b)); - if (m) return m; - } - else if (pkg.main) { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - } - } - - return loadAsFileSync(x + '/index'); - } - - function loadNodeModulesSync (x, start) { - var dirs = nodeModulesPathsSync(start); - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var m = loadAsFileSync(dir + '/' + x); - if (m) return m; - var n = loadAsDirectorySync(dir + '/' + x); - if (n) return n; - } - - var m = loadAsFileSync(x); - if (m) return m; - } - - function nodeModulesPathsSync (start) { - var parts; - if (start === '/') parts = [ '' ]; - else parts = path.normalize(start).split('/'); - - var dirs = []; - for (var i = parts.length - 1; i >= 0; i--) { - if (parts[i] === 'node_modules') continue; - var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; - dirs.push(dir); - } - - return dirs; - } - }; -})(); - -require.alias = function (from, to) { - var path = require.modules.path(); - var res = null; - try { - res = require.resolve(from + '/package.json', '/'); - } - catch (err) { - res = require.resolve(from, '/'); - } - var basedir = path.dirname(res); - - var keys = Object_keys(require.modules); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key.slice(0, basedir.length + 1) === basedir + '/') { - var f = key.slice(basedir.length); - require.modules[to + f] = require.modules[basedir + f]; - } - else if (key === basedir) { - require.modules[to] = require.modules[basedir]; - } - } -}; - -var Object_keys = Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key) - return res; -}; - -if (typeof process === 'undefined') process = {}; - -if (!process.nextTick) process.nextTick = function (fn) { - setTimeout(fn, 0); -}; - -if (!process.title) process.title = 'browser'; - -if (!process.binding) process.binding = function (name) { - if (name === 'evals') return require('vm') - else throw new Error('No such module') -}; - -if (!process.cwd) process.cwd = function () { return '.' }; - -require.modules["path"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "."; - var __filename = "path"; - - var require = function (file) { - return __require(file, "."); - }; - - require.resolve = function (file) { - return __require.resolve(name, "."); - }; - - require.modules = __require.modules; - __require.modules["path"]._cached = module.exports; - - (function () { - function filter (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - if (fn(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// resolves . and .. elements in a path array with directory names there -// must be no slashes, empty elements, or device names (c:\) in the array -// (so also no leading and trailing slashes - it does not distinguish -// relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length; i >= 0; i--) { - var last = parts[i]; - if (last == '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// Regex to split a filename into [*, dir, basename, ext] -// posix version -var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { -var resolvedPath = '', - resolvedAbsolute = false; - -for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) - ? arguments[i] - : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string' || !path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; -} - -// At this point the path should be resolved to a full absolute path, but -// handle relative paths to be safe (might happen when process.cwd() fails) - -// Normalize the path -resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { -var isAbsolute = path.charAt(0) === '/', - trailingSlash = path.slice(-1) === '/'; - -// Normalize the path -path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - return p && typeof p === 'string'; - }).join('/')); -}; - - -exports.dirname = function(path) { - var dir = splitPathRe.exec(path)[1] || ''; - var isWindows = false; - if (!dir) { - // No dirname - return '.'; - } else if (dir.length === 1 || - (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) { - // It is just a slash or a drive letter with a slash - return dir; - } else { - // It is a full dirname, strip trailing slash - return dir.substring(0, dir.length - 1); - } -}; - - -exports.basename = function(path, ext) { - var f = splitPathRe.exec(path)[2] || ''; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPathRe.exec(path)[3] || ''; -}; -; - }).call(module.exports); - - __require.modules["path"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/package.json"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito"; - var __filename = "/node_modules/burrito/package.json"; - - var require = function (file) { - return __require(file, "/node_modules/burrito"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/package.json"]._cached = module.exports; - - (function () { - module.exports = {"name":"burrito","description":"Wrap up expressions with a trace function while walking the AST with rice and beans on the side","version":"0.2.8","repository":{"type":"git","url":"git://github.com/substack/node-burrito.git"},"main":"./index.js","keywords":["trace","ast","walk","syntax","source","tree","uglify"],"directories":{"lib":".","example":"example","test":"test"},"scripts":{"test":"expresso"},"dependencies":{"traverse":">=0.5.1 <0.6","uglify-js":"1.0.4"},"devDependencies":{"expresso":"=0.7.x"},"engines":{"node":">=0.4.0"},"license":"BSD","author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"}}; - }).call(module.exports); - - __require.modules["/node_modules/burrito/package.json"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/uglify-js/package.json"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/uglify-js"; - var __filename = "/node_modules/burrito/node_modules/uglify-js/package.json"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/uglify-js"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/uglify-js"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/uglify-js/package.json"]._cached = module.exports; - - (function () { - module.exports = {"name":"uglify-js","author":{"name":"Mihai Bazon","email":"mihai.bazon@gmail.com","url":"http://mihai.bazon.net/blog"},"version":"1.0.4","main":"./uglify-js.js","bin":{"uglifyjs":"./bin/uglifyjs"},"repository":{"type":"git","url":"git@github.com:mishoo/UglifyJS.git"}}; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/uglify-js/package.json"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/uglify-js/uglify-js.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/uglify-js"; - var __filename = "/node_modules/burrito/node_modules/uglify-js/uglify-js.js"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/uglify-js"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/uglify-js"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/uglify-js/uglify-js.js"]._cached = module.exports; - - (function () { - //convienence function(src, [options]); -function uglify(orig_code, options){ - options || (options = {}); - var jsp = uglify.parser; - var pro = uglify.uglify; - - var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST - ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names - ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations - var final_code = pro.gen_code(ast, options.gen_options); // compressed code here - return final_code; -}; - -uglify.parser = require("./lib/parse-js"); -uglify.uglify = require("./lib/process"); - -module.exports = uglify; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/uglify-js/uglify-js.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/uglify-js/lib/parse-js.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/uglify-js/lib"; - var __filename = "/node_modules/burrito/node_modules/uglify-js/lib/parse-js.js"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/uglify-js/lib"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/uglify-js/lib"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/uglify-js/lib/parse-js.js"]._cached = module.exports; - - (function () { - /*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - - This version is suitable for Node.js. With minimal changes (the - exports stuff) it should work on any JS platform. - - This file contains the tokenizer/parser. It is a port to JavaScript - of parse-js [1], a JavaScript parser library written in Common Lisp - by Marijn Haverbeke. Thank you Marijn! - - [1] http://marijn.haverbeke.nl/parse-js/ - - Exported functions: - - - tokenizer(code) -- returns a function. Call the returned - function to fetch the next token. - - - parse(code) -- returns an AST of the given JavaScript code. - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2010 (c) Mihai Bazon - Based on parse-js (http://marijn.haverbeke.nl/parse-js/). - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -/* -----[ Tokenizer (constants) ]----- */ - -var KEYWORDS = array_to_hash([ - "break", - "case", - "catch", - "const", - "continue", - "default", - "delete", - "do", - "else", - "finally", - "for", - "function", - "if", - "in", - "instanceof", - "new", - "return", - "switch", - "throw", - "try", - "typeof", - "var", - "void", - "while", - "with" -]); - -var RESERVED_WORDS = array_to_hash([ - "abstract", - "boolean", - "byte", - "char", - "class", - "debugger", - "double", - "enum", - "export", - "extends", - "final", - "float", - "goto", - "implements", - "import", - "int", - "interface", - "long", - "native", - "package", - "private", - "protected", - "public", - "short", - "static", - "super", - "synchronized", - "throws", - "transient", - "volatile" -]); - -var KEYWORDS_BEFORE_EXPRESSION = array_to_hash([ - "return", - "new", - "delete", - "throw", - "else", - "case" -]); - -var KEYWORDS_ATOM = array_to_hash([ - "false", - "null", - "true", - "undefined" -]); - -var OPERATOR_CHARS = array_to_hash(characters("+-*&%=<>!?|~^")); - -var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; -var RE_OCT_NUMBER = /^0[0-7]+$/; -var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; - -var OPERATORS = array_to_hash([ - "in", - "instanceof", - "typeof", - "new", - "void", - "delete", - "++", - "--", - "+", - "-", - "!", - "~", - "&", - "|", - "^", - "*", - "/", - "%", - ">>", - "<<", - ">>>", - "<", - ">", - "<=", - ">=", - "==", - "===", - "!=", - "!==", - "?", - "=", - "+=", - "-=", - "/=", - "*=", - "%=", - ">>=", - "<<=", - ">>>=", - "|=", - "^=", - "&=", - "&&", - "||" -]); - -var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\v\u200b")); - -var PUNC_BEFORE_EXPRESSION = array_to_hash(characters("[{}(,.;:")); - -var PUNC_CHARS = array_to_hash(characters("[]{}(),;:")); - -var REGEXP_MODIFIERS = array_to_hash(characters("gmsiy")); - -/* -----[ Tokenizer ]----- */ - -// regexps adapted from http://xregexp.com/plugins/#unicode -var UNICODE = { - letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), - non_spacing_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"), - space_combining_mark: new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"), - connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]") -}; - -function is_letter(ch) { - return UNICODE.letter.test(ch); -}; - -function is_digit(ch) { - ch = ch.charCodeAt(0); - return ch >= 48 && ch <= 57; //XXX: find out if "UnicodeDigit" means something else than 0..9 -}; - -function is_alphanumeric_char(ch) { - return is_digit(ch) || is_letter(ch); -}; - -function is_unicode_combining_mark(ch) { - return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch); -}; - -function is_unicode_connector_punctuation(ch) { - return UNICODE.connector_punctuation.test(ch); -}; - -function is_identifier_start(ch) { - return ch == "$" || ch == "_" || is_letter(ch); -}; - -function is_identifier_char(ch) { - return is_identifier_start(ch) - || is_unicode_combining_mark(ch) - || is_digit(ch) - || is_unicode_connector_punctuation(ch) - || ch == "\u200c" // zero-width non-joiner - || ch == "\u200d" // zero-width joiner (in my ECMA-262 PDF, this is also 200c) - ; -}; - -function parse_js_number(num) { - if (RE_HEX_NUMBER.test(num)) { - return parseInt(num.substr(2), 16); - } else if (RE_OCT_NUMBER.test(num)) { - return parseInt(num.substr(1), 8); - } else if (RE_DEC_NUMBER.test(num)) { - return parseFloat(num); - } -}; - -function JS_Parse_Error(message, line, col, pos) { - this.message = message; - this.line = line; - this.col = col; - this.pos = pos; - try { - ({})(); - } catch(ex) { - this.stack = ex.stack; - }; -}; - -JS_Parse_Error.prototype.toString = function() { - return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack; -}; - -function js_error(message, line, col, pos) { - throw new JS_Parse_Error(message, line, col, pos); -}; - -function is_token(token, type, val) { - return token.type == type && (val == null || token.value == val); -}; - -var EX_EOF = {}; - -function tokenizer($TEXT) { - - var S = { - text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/^\uFEFF/, ''), - pos : 0, - tokpos : 0, - line : 0, - tokline : 0, - col : 0, - tokcol : 0, - newline_before : false, - regex_allowed : false, - comments_before : [] - }; - - function peek() { return S.text.charAt(S.pos); }; - - function next(signal_eof) { - var ch = S.text.charAt(S.pos++); - if (signal_eof && !ch) - throw EX_EOF; - if (ch == "\n") { - S.newline_before = true; - ++S.line; - S.col = 0; - } else { - ++S.col; - } - return ch; - }; - - function eof() { - return !S.peek(); - }; - - function find(what, signal_eof) { - var pos = S.text.indexOf(what, S.pos); - if (signal_eof && pos == -1) throw EX_EOF; - return pos; - }; - - function start_token() { - S.tokline = S.line; - S.tokcol = S.col; - S.tokpos = S.pos; - }; - - function token(type, value, is_comment) { - S.regex_allowed = ((type == "operator" && !HOP(UNARY_POSTFIX, value)) || - (type == "keyword" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) || - (type == "punc" && HOP(PUNC_BEFORE_EXPRESSION, value))); - var ret = { - type : type, - value : value, - line : S.tokline, - col : S.tokcol, - pos : S.tokpos, - nlb : S.newline_before - }; - if (!is_comment) { - ret.comments_before = S.comments_before; - S.comments_before = []; - } - S.newline_before = false; - return ret; - }; - - function skip_whitespace() { - while (HOP(WHITESPACE_CHARS, peek())) - next(); - }; - - function read_while(pred) { - var ret = "", ch = peek(), i = 0; - while (ch && pred(ch, i++)) { - ret += next(); - ch = peek(); - } - return ret; - }; - - function parse_error(err) { - js_error(err, S.tokline, S.tokcol, S.tokpos); - }; - - function read_num(prefix) { - var has_e = false, after_e = false, has_x = false, has_dot = prefix == "."; - var num = read_while(function(ch, i){ - if (ch == "x" || ch == "X") { - if (has_x) return false; - return has_x = true; - } - if (!has_x && (ch == "E" || ch == "e")) { - if (has_e) return false; - return has_e = after_e = true; - } - if (ch == "-") { - if (after_e || (i == 0 && !prefix)) return true; - return false; - } - if (ch == "+") return after_e; - after_e = false; - if (ch == ".") { - if (!has_dot && !has_x) - return has_dot = true; - return false; - } - return is_alphanumeric_char(ch); - }); - if (prefix) - num = prefix + num; - var valid = parse_js_number(num); - if (!isNaN(valid)) { - return token("num", valid); - } else { - parse_error("Invalid syntax: " + num); - } - }; - - function read_escaped_char() { - var ch = next(true); - switch (ch) { - case "n" : return "\n"; - case "r" : return "\r"; - case "t" : return "\t"; - case "b" : return "\b"; - case "v" : return "\v"; - case "f" : return "\f"; - case "0" : return "\0"; - case "x" : return String.fromCharCode(hex_bytes(2)); - case "u" : return String.fromCharCode(hex_bytes(4)); - default : return ch; - } - }; - - function hex_bytes(n) { - var num = 0; - for (; n > 0; --n) { - var digit = parseInt(next(true), 16); - if (isNaN(digit)) - parse_error("Invalid hex-character pattern in string"); - num = (num << 4) | digit; - } - return num; - }; - - function read_string() { - return with_eof_error("Unterminated string constant", function(){ - var quote = next(), ret = ""; - for (;;) { - var ch = next(true); - if (ch == "\\") ch = read_escaped_char(); - else if (ch == quote) break; - ret += ch; - } - return token("string", ret); - }); - }; - - function read_line_comment() { - next(); - var i = find("\n"), ret; - if (i == -1) { - ret = S.text.substr(S.pos); - S.pos = S.text.length; - } else { - ret = S.text.substring(S.pos, i); - S.pos = i; - } - return token("comment1", ret, true); - }; - - function read_multiline_comment() { - next(); - return with_eof_error("Unterminated multiline comment", function(){ - var i = find("*/", true), - text = S.text.substring(S.pos, i), - tok = token("comment2", text, true); - S.pos = i + 2; - S.line += text.split("\n").length - 1; - S.newline_before = text.indexOf("\n") >= 0; - - // https://github.com/mishoo/UglifyJS/issues/#issue/100 - if (/^@cc_on/i.test(text)) { - warn("WARNING: at line " + S.line); - warn("*** Found \"conditional comment\": " + text); - warn("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer."); - } - - return tok; - }); - }; - - function read_name() { - var backslash = false, name = "", ch; - while ((ch = peek()) != null) { - if (!backslash) { - if (ch == "\\") backslash = true, next(); - else if (is_identifier_char(ch)) name += next(); - else break; - } - else { - if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX"); - ch = read_escaped_char(); - if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier"); - name += ch; - backslash = false; - } - } - return name; - }; - - function read_regexp() { - return with_eof_error("Unterminated regular expression", function(){ - var prev_backslash = false, regexp = "", ch, in_class = false; - while ((ch = next(true))) if (prev_backslash) { - regexp += "\\" + ch; - prev_backslash = false; - } else if (ch == "[") { - in_class = true; - regexp += ch; - } else if (ch == "]" && in_class) { - in_class = false; - regexp += ch; - } else if (ch == "/" && !in_class) { - break; - } else if (ch == "\\") { - prev_backslash = true; - } else { - regexp += ch; - } - var mods = read_name(); - return token("regexp", [ regexp, mods ]); - }); - }; - - function read_operator(prefix) { - function grow(op) { - if (!peek()) return op; - var bigger = op + peek(); - if (HOP(OPERATORS, bigger)) { - next(); - return grow(bigger); - } else { - return op; - } - }; - return token("operator", grow(prefix || next())); - }; - - function handle_slash() { - next(); - var regex_allowed = S.regex_allowed; - switch (peek()) { - case "/": - S.comments_before.push(read_line_comment()); - S.regex_allowed = regex_allowed; - return next_token(); - case "*": - S.comments_before.push(read_multiline_comment()); - S.regex_allowed = regex_allowed; - return next_token(); - } - return S.regex_allowed ? read_regexp() : read_operator("/"); - }; - - function handle_dot() { - next(); - return is_digit(peek()) - ? read_num(".") - : token("punc", "."); - }; - - function read_word() { - var word = read_name(); - return !HOP(KEYWORDS, word) - ? token("name", word) - : HOP(OPERATORS, word) - ? token("operator", word) - : HOP(KEYWORDS_ATOM, word) - ? token("atom", word) - : token("keyword", word); - }; - - function with_eof_error(eof_error, cont) { - try { - return cont(); - } catch(ex) { - if (ex === EX_EOF) parse_error(eof_error); - else throw ex; - } - }; - - function next_token(force_regexp) { - if (force_regexp) - return read_regexp(); - skip_whitespace(); - start_token(); - var ch = peek(); - if (!ch) return token("eof"); - if (is_digit(ch)) return read_num(); - if (ch == '"' || ch == "'") return read_string(); - if (HOP(PUNC_CHARS, ch)) return token("punc", next()); - if (ch == ".") return handle_dot(); - if (ch == "/") return handle_slash(); - if (HOP(OPERATOR_CHARS, ch)) return read_operator(); - if (ch == "\\" || is_identifier_start(ch)) return read_word(); - parse_error("Unexpected character '" + ch + "'"); - }; - - next_token.context = function(nc) { - if (nc) S = nc; - return S; - }; - - return next_token; - -}; - -/* -----[ Parser (constants) ]----- */ - -var UNARY_PREFIX = array_to_hash([ - "typeof", - "void", - "delete", - "--", - "++", - "!", - "~", - "-", - "+" -]); - -var UNARY_POSTFIX = array_to_hash([ "--", "++" ]); - -var ASSIGNMENT = (function(a, ret, i){ - while (i < a.length) { - ret[a[i]] = a[i].substr(0, a[i].length - 1); - i++; - } - return ret; -})( - ["+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&="], - { "=": true }, - 0 -); - -var PRECEDENCE = (function(a, ret){ - for (var i = 0, n = 1; i < a.length; ++i, ++n) { - var b = a[i]; - for (var j = 0; j < b.length; ++j) { - ret[b[j]] = n; - } - } - return ret; -})( - [ - ["||"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"] - ], - {} -); - -var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]); - -var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]); - -/* -----[ Parser ]----- */ - -function NodeWithToken(str, start, end) { - this.name = str; - this.start = start; - this.end = end; -}; - -NodeWithToken.prototype.toString = function() { return this.name; }; - -function parse($TEXT, exigent_mode, embed_tokens) { - - var S = { - input : typeof $TEXT == "string" ? tokenizer($TEXT, true) : $TEXT, - token : null, - prev : null, - peeked : null, - in_function : 0, - in_loop : 0, - labels : [] - }; - - S.token = next(); - - function is(type, value) { - return is_token(S.token, type, value); - }; - - function peek() { return S.peeked || (S.peeked = S.input()); }; - - function next() { - S.prev = S.token; - if (S.peeked) { - S.token = S.peeked; - S.peeked = null; - } else { - S.token = S.input(); - } - return S.token; - }; - - function prev() { - return S.prev; - }; - - function croak(msg, line, col, pos) { - var ctx = S.input.context(); - js_error(msg, - line != null ? line : ctx.tokline, - col != null ? col : ctx.tokcol, - pos != null ? pos : ctx.tokpos); - }; - - function token_error(token, msg) { - croak(msg, token.line, token.col); - }; - - function unexpected(token) { - if (token == null) - token = S.token; - token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); - }; - - function expect_token(type, val) { - if (is(type, val)) { - return next(); - } - token_error(S.token, "Unexpected token " + S.token.type + ", expected " + type); - }; - - function expect(punc) { return expect_token("punc", punc); }; - - function can_insert_semicolon() { - return !exigent_mode && ( - S.token.nlb || is("eof") || is("punc", "}") - ); - }; - - function semicolon() { - if (is("punc", ";")) next(); - else if (!can_insert_semicolon()) unexpected(); - }; - - function as() { - return slice(arguments); - }; - - function parenthesised() { - expect("("); - var ex = expression(); - expect(")"); - return ex; - }; - - function add_tokens(str, start, end) { - return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end); - }; - - function maybe_embed_tokens(parser) { - if (embed_tokens) return function() { - var start = S.token; - var ast = parser.apply(this, arguments); - ast[0] = add_tokens(ast[0], start, prev()); - return ast; - }; - else return parser; - }; - - var statement = maybe_embed_tokens(function() { - if (is("operator", "/")) { - S.peeked = null; - S.token = S.input(true); // force regexp - } - switch (S.token.type) { - case "num": - case "string": - case "regexp": - case "operator": - case "atom": - return simple_statement(); - - case "name": - return is_token(peek(), "punc", ":") - ? labeled_statement(prog1(S.token.value, next, next)) - : simple_statement(); - - case "punc": - switch (S.token.value) { - case "{": - return as("block", block_()); - case "[": - case "(": - return simple_statement(); - case ";": - next(); - return as("block"); - default: - unexpected(); - } - - case "keyword": - switch (prog1(S.token.value, next)) { - case "break": - return break_cont("break"); - - case "continue": - return break_cont("continue"); - - case "debugger": - semicolon(); - return as("debugger"); - - case "do": - return (function(body){ - expect_token("keyword", "while"); - return as("do", prog1(parenthesised, semicolon), body); - })(in_loop(statement)); - - case "for": - return for_(); - - case "function": - return function_(true); - - case "if": - return if_(); - - case "return": - if (S.in_function == 0) - croak("'return' outside of function"); - return as("return", - is("punc", ";") - ? (next(), null) - : can_insert_semicolon() - ? null - : prog1(expression, semicolon)); - - case "switch": - return as("switch", parenthesised(), switch_block_()); - - case "throw": - return as("throw", prog1(expression, semicolon)); - - case "try": - return try_(); - - case "var": - return prog1(var_, semicolon); - - case "const": - return prog1(const_, semicolon); - - case "while": - return as("while", parenthesised(), in_loop(statement)); - - case "with": - return as("with", parenthesised(), statement()); - - default: - unexpected(); - } - } - }); - - function labeled_statement(label) { - S.labels.push(label); - var start = S.token, stat = statement(); - if (exigent_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0])) - unexpected(start); - S.labels.pop(); - return as("label", label, stat); - }; - - function simple_statement() { - return as("stat", prog1(expression, semicolon)); - }; - - function break_cont(type) { - var name; - if (!can_insert_semicolon()) { - name = is("name") ? S.token.value : null; - } - if (name != null) { - next(); - if (!member(name, S.labels)) - croak("Label " + name + " without matching loop or statement"); - } - else if (S.in_loop == 0) - croak(type + " not inside a loop or switch"); - semicolon(); - return as(type, name); - }; - - function for_() { - expect("("); - var init = null; - if (!is("punc", ";")) { - init = is("keyword", "var") - ? (next(), var_(true)) - : expression(true, true); - if (is("operator", "in")) - return for_in(init); - } - return regular_for(init); - }; - - function regular_for(init) { - expect(";"); - var test = is("punc", ";") ? null : expression(); - expect(";"); - var step = is("punc", ")") ? null : expression(); - expect(")"); - return as("for", init, test, step, in_loop(statement)); - }; - - function for_in(init) { - var lhs = init[0] == "var" ? as("name", init[1][0]) : init; - next(); - var obj = expression(); - expect(")"); - return as("for-in", init, lhs, obj, in_loop(statement)); - }; - - var function_ = maybe_embed_tokens(function(in_statement) { - var name = is("name") ? prog1(S.token.value, next) : null; - if (in_statement && !name) - unexpected(); - expect("("); - return as(in_statement ? "defun" : "function", - name, - // arguments - (function(first, a){ - while (!is("punc", ")")) { - if (first) first = false; else expect(","); - if (!is("name")) unexpected(); - a.push(S.token.value); - next(); - } - next(); - return a; - })(true, []), - // body - (function(){ - ++S.in_function; - var loop = S.in_loop; - S.in_loop = 0; - var a = block_(); - --S.in_function; - S.in_loop = loop; - return a; - })()); - }); - - function if_() { - var cond = parenthesised(), body = statement(), belse; - if (is("keyword", "else")) { - next(); - belse = statement(); - } - return as("if", cond, body, belse); - }; - - function block_() { - expect("{"); - var a = []; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - a.push(statement()); - } - next(); - return a; - }; - - var switch_block_ = curry(in_loop, function(){ - expect("{"); - var a = [], cur = null; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - if (is("keyword", "case")) { - next(); - cur = []; - a.push([ expression(), cur ]); - expect(":"); - } - else if (is("keyword", "default")) { - next(); - expect(":"); - cur = []; - a.push([ null, cur ]); - } - else { - if (!cur) unexpected(); - cur.push(statement()); - } - } - next(); - return a; - }); - - function try_() { - var body = block_(), bcatch, bfinally; - if (is("keyword", "catch")) { - next(); - expect("("); - if (!is("name")) - croak("Name expected"); - var name = S.token.value; - next(); - expect(")"); - bcatch = [ name, block_() ]; - } - if (is("keyword", "finally")) { - next(); - bfinally = block_(); - } - if (!bcatch && !bfinally) - croak("Missing catch/finally blocks"); - return as("try", body, bcatch, bfinally); - }; - - function vardefs(no_in) { - var a = []; - for (;;) { - if (!is("name")) - unexpected(); - var name = S.token.value; - next(); - if (is("operator", "=")) { - next(); - a.push([ name, expression(false, no_in) ]); - } else { - a.push([ name ]); - } - if (!is("punc", ",")) - break; - next(); - } - return a; - }; - - function var_(no_in) { - return as("var", vardefs(no_in)); - }; - - function const_() { - return as("const", vardefs()); - }; - - function new_() { - var newexp = expr_atom(false), args; - if (is("punc", "(")) { - next(); - args = expr_list(")"); - } else { - args = []; - } - return subscripts(as("new", newexp, args), true); - }; - - var expr_atom = maybe_embed_tokens(function(allow_calls) { - if (is("operator", "new")) { - next(); - return new_(); - } - if (is("operator") && HOP(UNARY_PREFIX, S.token.value)) { - return make_unary("unary-prefix", - prog1(S.token.value, next), - expr_atom(allow_calls)); - } - if (is("punc")) { - switch (S.token.value) { - case "(": - next(); - return subscripts(prog1(expression, curry(expect, ")")), allow_calls); - case "[": - next(); - return subscripts(array_(), allow_calls); - case "{": - next(); - return subscripts(object_(), allow_calls); - } - unexpected(); - } - if (is("keyword", "function")) { - next(); - return subscripts(function_(false), allow_calls); - } - if (HOP(ATOMIC_START_TOKEN, S.token.type)) { - var atom = S.token.type == "regexp" - ? as("regexp", S.token.value[0], S.token.value[1]) - : as(S.token.type, S.token.value); - return subscripts(prog1(atom, next), allow_calls); - } - unexpected(); - }); - - function expr_list(closing, allow_trailing_comma, allow_empty) { - var first = true, a = []; - while (!is("punc", closing)) { - if (first) first = false; else expect(","); - if (allow_trailing_comma && is("punc", closing)) break; - if (is("punc", ",") && allow_empty) { - a.push([ "atom", "undefined" ]); - } else { - a.push(expression(false)); - } - } - next(); - return a; - }; - - function array_() { - return as("array", expr_list("]", !exigent_mode, true)); - }; - - function object_() { - var first = true, a = []; - while (!is("punc", "}")) { - if (first) first = false; else expect(","); - if (!exigent_mode && is("punc", "}")) - // allow trailing comma - break; - var type = S.token.type; - var name = as_property_name(); - if (type == "name" && (name == "get" || name == "set") && !is("punc", ":")) { - a.push([ as_name(), function_(false), name ]); - } else { - expect(":"); - a.push([ name, expression(false) ]); - } - } - next(); - return as("object", a); - }; - - function as_property_name() { - switch (S.token.type) { - case "num": - case "string": - return prog1(S.token.value, next); - } - return as_name(); - }; - - function as_name() { - switch (S.token.type) { - case "name": - case "operator": - case "keyword": - case "atom": - return prog1(S.token.value, next); - default: - unexpected(); - } - }; - - function subscripts(expr, allow_calls) { - if (is("punc", ".")) { - next(); - return subscripts(as("dot", expr, as_name()), allow_calls); - } - if (is("punc", "[")) { - next(); - return subscripts(as("sub", expr, prog1(expression, curry(expect, "]"))), allow_calls); - } - if (allow_calls && is("punc", "(")) { - next(); - return subscripts(as("call", expr, expr_list(")")), true); - } - if (allow_calls && is("operator") && HOP(UNARY_POSTFIX, S.token.value)) { - return prog1(curry(make_unary, "unary-postfix", S.token.value, expr), - next); - } - return expr; - }; - - function make_unary(tag, op, expr) { - if ((op == "++" || op == "--") && !is_assignable(expr)) - croak("Invalid use of " + op + " operator"); - return as(tag, op, expr); - }; - - function expr_op(left, min_prec, no_in) { - var op = is("operator") ? S.token.value : null; - if (op && op == "in" && no_in) op = null; - var prec = op != null ? PRECEDENCE[op] : null; - if (prec != null && prec > min_prec) { - next(); - var right = expr_op(expr_atom(true), prec, no_in); - return expr_op(as("binary", op, left, right), min_prec, no_in); - } - return left; - }; - - function expr_ops(no_in) { - return expr_op(expr_atom(true), 0, no_in); - }; - - function maybe_conditional(no_in) { - var expr = expr_ops(no_in); - if (is("operator", "?")) { - next(); - var yes = expression(false); - expect(":"); - return as("conditional", expr, yes, expression(false, no_in)); - } - return expr; - }; - - function is_assignable(expr) { - if (!exigent_mode) return true; - switch (expr[0]) { - case "dot": - case "sub": - case "new": - case "call": - return true; - case "name": - return expr[1] != "this"; - } - }; - - function maybe_assign(no_in) { - var left = maybe_conditional(no_in), val = S.token.value; - if (is("operator") && HOP(ASSIGNMENT, val)) { - if (is_assignable(left)) { - next(); - return as("assign", ASSIGNMENT[val], left, maybe_assign(no_in)); - } - croak("Invalid assignment"); - } - return left; - }; - - var expression = maybe_embed_tokens(function(commas, no_in) { - if (arguments.length == 0) - commas = true; - var expr = maybe_assign(no_in); - if (commas && is("punc", ",")) { - next(); - return as("seq", expr, expression(true, no_in)); - } - return expr; - }); - - function in_loop(cont) { - try { - ++S.in_loop; - return cont(); - } finally { - --S.in_loop; - } - }; - - return as("toplevel", (function(a){ - while (!is("eof")) - a.push(statement()); - return a; - })([])); - -}; - -/* -----[ Utilities ]----- */ - -function curry(f) { - var args = slice(arguments, 1); - return function() { return f.apply(this, args.concat(slice(arguments))); }; -}; - -function prog1(ret) { - if (ret instanceof Function) - ret = ret(); - for (var i = 1, n = arguments.length; --n > 0; ++i) - arguments[i](); - return ret; -}; - -function array_to_hash(a) { - var ret = {}; - for (var i = 0; i < a.length; ++i) - ret[a[i]] = true; - return ret; -}; - -function slice(a, start) { - return Array.prototype.slice.call(a, start == null ? 0 : start); -}; - -function characters(str) { - return str.split(""); -}; - -function member(name, array) { - for (var i = array.length; --i >= 0;) - if (array[i] === name) - return true; - return false; -}; - -function HOP(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -}; - -var warn = function() {}; - -/* -----[ Exports ]----- */ - -exports.tokenizer = tokenizer; -exports.parse = parse; -exports.slice = slice; -exports.curry = curry; -exports.member = member; -exports.array_to_hash = array_to_hash; -exports.PRECEDENCE = PRECEDENCE; -exports.KEYWORDS_ATOM = KEYWORDS_ATOM; -exports.RESERVED_WORDS = RESERVED_WORDS; -exports.KEYWORDS = KEYWORDS; -exports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN; -exports.OPERATORS = OPERATORS; -exports.is_alphanumeric_char = is_alphanumeric_char; -exports.set_logger = function(logger) { - warn = logger; -}; -; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/uglify-js/lib/parse-js.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/uglify-js/lib/process.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/uglify-js/lib"; - var __filename = "/node_modules/burrito/node_modules/uglify-js/lib/process.js"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/uglify-js/lib"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/uglify-js/lib"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/uglify-js/lib/process.js"]._cached = module.exports; - - (function () { - /*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - - This version is suitable for Node.js. With minimal changes (the - exports stuff) it should work on any JS platform. - - This file implements some AST processors. They work on data built - by parse-js. - - Exported functions: - - - ast_mangle(ast, options) -- mangles the variable/function names - in the AST. Returns an AST. - - - ast_squeeze(ast) -- employs various optimizations to make the - final generated code even smaller. Returns an AST. - - - gen_code(ast, options) -- generates JS code from the AST. Pass - true (or an object, see the code for some options) as second - argument to get "pretty" (indented) code. - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2010 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -var jsp = require("./parse-js"), - slice = jsp.slice, - member = jsp.member, - PRECEDENCE = jsp.PRECEDENCE, - OPERATORS = jsp.OPERATORS; - -/* -----[ helper for AST traversal ]----- */ - -function ast_walker(ast) { - function _vardefs(defs) { - return [ this[0], MAP(defs, function(def){ - var a = [ def[0] ]; - if (def.length > 1) - a[1] = walk(def[1]); - return a; - }) ]; - }; - function _block(statements) { - var out = [ this[0] ]; - if (statements != null) - out.push(MAP(statements, walk)); - return out; - }; - var walkers = { - "string": function(str) { - return [ this[0], str ]; - }, - "num": function(num) { - return [ this[0], num ]; - }, - "name": function(name) { - return [ this[0], name ]; - }, - "toplevel": function(statements) { - return [ this[0], MAP(statements, walk) ]; - }, - "block": _block, - "splice": _block, - "var": _vardefs, - "const": _vardefs, - "try": function(t, c, f) { - return [ - this[0], - MAP(t, walk), - c != null ? [ c[0], MAP(c[1], walk) ] : null, - f != null ? MAP(f, walk) : null - ]; - }, - "throw": function(expr) { - return [ this[0], walk(expr) ]; - }, - "new": function(ctor, args) { - return [ this[0], walk(ctor), MAP(args, walk) ]; - }, - "switch": function(expr, body) { - return [ this[0], walk(expr), MAP(body, function(branch){ - return [ branch[0] ? walk(branch[0]) : null, - MAP(branch[1], walk) ]; - }) ]; - }, - "break": function(label) { - return [ this[0], label ]; - }, - "continue": function(label) { - return [ this[0], label ]; - }, - "conditional": function(cond, t, e) { - return [ this[0], walk(cond), walk(t), walk(e) ]; - }, - "assign": function(op, lvalue, rvalue) { - return [ this[0], op, walk(lvalue), walk(rvalue) ]; - }, - "dot": function(expr) { - return [ this[0], walk(expr) ].concat(slice(arguments, 1)); - }, - "call": function(expr, args) { - return [ this[0], walk(expr), MAP(args, walk) ]; - }, - "function": function(name, args, body) { - return [ this[0], name, args.slice(), MAP(body, walk) ]; - }, - "defun": function(name, args, body) { - return [ this[0], name, args.slice(), MAP(body, walk) ]; - }, - "if": function(conditional, t, e) { - return [ this[0], walk(conditional), walk(t), walk(e) ]; - }, - "for": function(init, cond, step, block) { - return [ this[0], walk(init), walk(cond), walk(step), walk(block) ]; - }, - "for-in": function(vvar, key, hash, block) { - return [ this[0], walk(vvar), walk(key), walk(hash), walk(block) ]; - }, - "while": function(cond, block) { - return [ this[0], walk(cond), walk(block) ]; - }, - "do": function(cond, block) { - return [ this[0], walk(cond), walk(block) ]; - }, - "return": function(expr) { - return [ this[0], walk(expr) ]; - }, - "binary": function(op, left, right) { - return [ this[0], op, walk(left), walk(right) ]; - }, - "unary-prefix": function(op, expr) { - return [ this[0], op, walk(expr) ]; - }, - "unary-postfix": function(op, expr) { - return [ this[0], op, walk(expr) ]; - }, - "sub": function(expr, subscript) { - return [ this[0], walk(expr), walk(subscript) ]; - }, - "object": function(props) { - return [ this[0], MAP(props, function(p){ - return p.length == 2 - ? [ p[0], walk(p[1]) ] - : [ p[0], walk(p[1]), p[2] ]; // get/set-ter - }) ]; - }, - "regexp": function(rx, mods) { - return [ this[0], rx, mods ]; - }, - "array": function(elements) { - return [ this[0], MAP(elements, walk) ]; - }, - "stat": function(stat) { - return [ this[0], walk(stat) ]; - }, - "seq": function() { - return [ this[0] ].concat(MAP(slice(arguments), walk)); - }, - "label": function(name, block) { - return [ this[0], name, walk(block) ]; - }, - "with": function(expr, block) { - return [ this[0], walk(expr), walk(block) ]; - }, - "atom": function(name) { - return [ this[0], name ]; - } - }; - - var user = {}; - var stack = []; - function walk(ast) { - if (ast == null) - return null; - try { - stack.push(ast); - var type = ast[0]; - var gen = user[type]; - if (gen) { - var ret = gen.apply(ast, ast.slice(1)); - if (ret != null) - return ret; - } - gen = walkers[type]; - return gen.apply(ast, ast.slice(1)); - } finally { - stack.pop(); - } - }; - - function with_walkers(walkers, cont){ - var save = {}, i; - for (i in walkers) if (HOP(walkers, i)) { - save[i] = user[i]; - user[i] = walkers[i]; - } - var ret = cont(); - for (i in save) if (HOP(save, i)) { - if (!save[i]) delete user[i]; - else user[i] = save[i]; - } - return ret; - }; - - return { - walk: walk, - with_walkers: with_walkers, - parent: function() { - return stack[stack.length - 2]; // last one is current node - }, - stack: function() { - return stack; - } - }; -}; - -/* -----[ Scope and mangling ]----- */ - -function Scope(parent) { - this.names = {}; // names defined in this scope - this.mangled = {}; // mangled names (orig.name => mangled) - this.rev_mangled = {}; // reverse lookup (mangled => orig.name) - this.cname = -1; // current mangled name - this.refs = {}; // names referenced from this scope - this.uses_with = false; // will become TRUE if with() is detected in this or any subscopes - this.uses_eval = false; // will become TRUE if eval() is detected in this or any subscopes - this.parent = parent; // parent scope - this.children = []; // sub-scopes - if (parent) { - this.level = parent.level + 1; - parent.children.push(this); - } else { - this.level = 0; - } -}; - -var base54 = (function(){ - var DIGITS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_"; - return function(num) { - var ret = ""; - do { - ret = DIGITS.charAt(num % 54) + ret; - num = Math.floor(num / 54); - } while (num > 0); - return ret; - }; -})(); - -Scope.prototype = { - has: function(name) { - for (var s = this; s; s = s.parent) - if (HOP(s.names, name)) - return s; - }, - has_mangled: function(mname) { - for (var s = this; s; s = s.parent) - if (HOP(s.rev_mangled, mname)) - return s; - }, - toJSON: function() { - return { - names: this.names, - uses_eval: this.uses_eval, - uses_with: this.uses_with - }; - }, - - next_mangled: function() { - // we must be careful that the new mangled name: - // - // 1. doesn't shadow a mangled name from a parent - // scope, unless we don't reference the original - // name from this scope OR from any sub-scopes! - // This will get slow. - // - // 2. doesn't shadow an original name from a parent - // scope, in the event that the name is not mangled - // in the parent scope and we reference that name - // here OR IN ANY SUBSCOPES! - // - // 3. doesn't shadow a name that is referenced but not - // defined (possibly global defined elsewhere). - for (;;) { - var m = base54(++this.cname), prior; - - // case 1. - prior = this.has_mangled(m); - if (prior && this.refs[prior.rev_mangled[m]] === prior) - continue; - - // case 2. - prior = this.has(m); - if (prior && prior !== this && this.refs[m] === prior && !prior.has_mangled(m)) - continue; - - // case 3. - if (HOP(this.refs, m) && this.refs[m] == null) - continue; - - // I got "do" once. :-/ - if (!is_identifier(m)) - continue; - - return m; - } - }, - set_mangle: function(name, m) { - this.rev_mangled[m] = name; - return this.mangled[name] = m; - }, - get_mangled: function(name, newMangle) { - if (this.uses_eval || this.uses_with) return name; // no mangle if eval or with is in use - var s = this.has(name); - if (!s) return name; // not in visible scope, no mangle - if (HOP(s.mangled, name)) return s.mangled[name]; // already mangled in this scope - if (!newMangle) return name; // not found and no mangling requested - return s.set_mangle(name, s.next_mangled()); - }, - define: function(name) { - if (name != null) - return this.names[name] = name; - } -}; - -function ast_add_scope(ast) { - - var current_scope = null; - var w = ast_walker(), walk = w.walk; - var having_eval = []; - - function with_new_scope(cont) { - current_scope = new Scope(current_scope); - var ret = current_scope.body = cont(); - ret.scope = current_scope; - current_scope = current_scope.parent; - return ret; - }; - - function define(name) { - return current_scope.define(name); - }; - - function reference(name) { - current_scope.refs[name] = true; - }; - - function _lambda(name, args, body) { - var is_defun = this[0] == "defun"; - return [ this[0], is_defun ? define(name) : name, args, with_new_scope(function(){ - if (!is_defun) define(name); - MAP(args, define); - return MAP(body, walk); - })]; - }; - - return with_new_scope(function(){ - // process AST - var ret = w.with_walkers({ - "function": _lambda, - "defun": _lambda, - "with": function(expr, block) { - for (var s = current_scope; s; s = s.parent) - s.uses_with = true; - }, - "var": function(defs) { - MAP(defs, function(d){ define(d[0]) }); - }, - "const": function(defs) { - MAP(defs, function(d){ define(d[0]) }); - }, - "try": function(t, c, f) { - if (c != null) return [ - this[0], - MAP(t, walk), - [ define(c[0]), MAP(c[1], walk) ], - f != null ? MAP(f, walk) : null - ]; - }, - "name": function(name) { - if (name == "eval") - having_eval.push(current_scope); - reference(name); - } - }, function(){ - return walk(ast); - }); - - // the reason why we need an additional pass here is - // that names can be used prior to their definition. - - // scopes where eval was detected and their parents - // are marked with uses_eval, unless they define the - // "eval" name. - MAP(having_eval, function(scope){ - if (!scope.has("eval")) while (scope) { - scope.uses_eval = true; - scope = scope.parent; - } - }); - - // for referenced names it might be useful to know - // their origin scope. current_scope here is the - // toplevel one. - function fixrefs(scope, i) { - // do children first; order shouldn't matter - for (i = scope.children.length; --i >= 0;) - fixrefs(scope.children[i]); - for (i in scope.refs) if (HOP(scope.refs, i)) { - // find origin scope and propagate the reference to origin - for (var origin = scope.has(i), s = scope; s; s = s.parent) { - s.refs[i] = origin; - if (s === origin) break; - } - } - }; - fixrefs(current_scope); - - return ret; - }); - -}; - -/* -----[ mangle names ]----- */ - -function ast_mangle(ast, options) { - var w = ast_walker(), walk = w.walk, scope; - options = options || {}; - - function get_mangled(name, newMangle) { - if (!options.toplevel && !scope.parent) return name; // don't mangle toplevel - if (options.except && member(name, options.except)) - return name; - return scope.get_mangled(name, newMangle); - }; - - function get_define(name) { - if (options.defines) { - // we always lookup a defined symbol for the current scope FIRST, so declared - // vars trump a DEFINE symbol, but if no such var is found, then match a DEFINE value - if (!scope.has(name)) { - if (HOP(options.defines, name)) { - return options.defines[name]; - } - } - return null; - } - }; - - function _lambda(name, args, body) { - var is_defun = this[0] == "defun", extra; - if (name) { - if (is_defun) name = get_mangled(name); - else { - extra = {}; - name = extra[name] = scope.next_mangled(); - } - } - body = with_scope(body.scope, function(){ - args = MAP(args, function(name){ return get_mangled(name) }); - return MAP(body, walk); - }, extra); - return [ this[0], name, args, body ]; - }; - - function with_scope(s, cont, extra) { - var _scope = scope; - scope = s; - if (extra) for (var i in extra) if (HOP(extra, i)) { - s.set_mangle(i, extra[i]); - } - for (var i in s.names) if (HOP(s.names, i)) { - get_mangled(i, true); - } - var ret = cont(); - ret.scope = s; - scope = _scope; - return ret; - }; - - function _vardefs(defs) { - return [ this[0], MAP(defs, function(d){ - return [ get_mangled(d[0]), walk(d[1]) ]; - }) ]; - }; - - return w.with_walkers({ - "function": _lambda, - "defun": function() { - // move function declarations to the top when - // they are not in some block. - var ast = _lambda.apply(this, arguments); - switch (w.parent()[0]) { - case "toplevel": - case "function": - case "defun": - return MAP.at_top(ast); - } - return ast; - }, - "var": _vardefs, - "const": _vardefs, - "name": function(name) { - return get_define(name) || [ this[0], get_mangled(name) ]; - }, - "try": function(t, c, f) { - return [ this[0], - MAP(t, walk), - c != null ? [ get_mangled(c[0]), MAP(c[1], walk) ] : null, - f != null ? MAP(f, walk) : null ]; - }, - "toplevel": function(body) { - var self = this; - return with_scope(self.scope, function(){ - return [ self[0], MAP(body, walk) ]; - }); - } - }, function() { - return walk(ast_add_scope(ast)); - }); -}; - -/* -----[ - - compress foo["bar"] into foo.bar, - - remove block brackets {} where possible - - join consecutive var declarations - - various optimizations for IFs: - - if (cond) foo(); else bar(); ==> cond?foo():bar(); - - if (cond) foo(); ==> cond&&foo(); - - if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); // also for throw - - if (foo) return bar(); else something(); ==> {if(foo)return bar();something()} - ]----- */ - -var warn = function(){}; - -function best_of(ast1, ast2) { - return gen_code(ast1).length > gen_code(ast2[0] == "stat" ? ast2[1] : ast2).length ? ast2 : ast1; -}; - -function last_stat(b) { - if (b[0] == "block" && b[1] && b[1].length > 0) - return b[1][b[1].length - 1]; - return b; -} - -function aborts(t) { - if (t) { - t = last_stat(t); - if (t[0] == "return" || t[0] == "break" || t[0] == "continue" || t[0] == "throw") - return true; - } -}; - -function boolean_expr(expr) { - return ( (expr[0] == "unary-prefix" - && member(expr[1], [ "!", "delete" ])) || - - (expr[0] == "binary" - && member(expr[1], [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ])) || - - (expr[0] == "binary" - && member(expr[1], [ "&&", "||" ]) - && boolean_expr(expr[2]) - && boolean_expr(expr[3])) || - - (expr[0] == "conditional" - && boolean_expr(expr[2]) - && boolean_expr(expr[3])) || - - (expr[0] == "assign" - && expr[1] === true - && boolean_expr(expr[3])) || - - (expr[0] == "seq" - && boolean_expr(expr[expr.length - 1])) - ); -}; - -function make_conditional(c, t, e) { - var make_real_conditional = function() { - if (c[0] == "unary-prefix" && c[1] == "!") { - return e ? [ "conditional", c[2], e, t ] : [ "binary", "||", c[2], t ]; - } else { - return e ? [ "conditional", c, t, e ] : [ "binary", "&&", c, t ]; - } - }; - // shortcut the conditional if the expression has a constant value - return when_constant(c, function(ast, val){ - warn_unreachable(val ? e : t); - return (val ? t : e); - }, make_real_conditional); -}; - -function empty(b) { - return !b || (b[0] == "block" && (!b[1] || b[1].length == 0)); -}; - -function is_string(node) { - return (node[0] == "string" || - node[0] == "unary-prefix" && node[1] == "typeof" || - node[0] == "binary" && node[1] == "+" && - (is_string(node[2]) || is_string(node[3]))); -}; - -var when_constant = (function(){ - - var $NOT_CONSTANT = {}; - - // this can only evaluate constant expressions. If it finds anything - // not constant, it throws $NOT_CONSTANT. - function evaluate(expr) { - switch (expr[0]) { - case "string": - case "num": - return expr[1]; - case "name": - case "atom": - switch (expr[1]) { - case "true": return true; - case "false": return false; - } - break; - case "unary-prefix": - switch (expr[1]) { - case "!": return !evaluate(expr[2]); - case "typeof": return typeof evaluate(expr[2]); - case "~": return ~evaluate(expr[2]); - case "-": return -evaluate(expr[2]); - case "+": return +evaluate(expr[2]); - } - break; - case "binary": - var left = expr[2], right = expr[3]; - switch (expr[1]) { - case "&&" : return evaluate(left) && evaluate(right); - case "||" : return evaluate(left) || evaluate(right); - case "|" : return evaluate(left) | evaluate(right); - case "&" : return evaluate(left) & evaluate(right); - case "^" : return evaluate(left) ^ evaluate(right); - case "+" : return evaluate(left) + evaluate(right); - case "*" : return evaluate(left) * evaluate(right); - case "/" : return evaluate(left) / evaluate(right); - case "-" : return evaluate(left) - evaluate(right); - case "<<" : return evaluate(left) << evaluate(right); - case ">>" : return evaluate(left) >> evaluate(right); - case ">>>" : return evaluate(left) >>> evaluate(right); - case "==" : return evaluate(left) == evaluate(right); - case "===" : return evaluate(left) === evaluate(right); - case "!=" : return evaluate(left) != evaluate(right); - case "!==" : return evaluate(left) !== evaluate(right); - case "<" : return evaluate(left) < evaluate(right); - case "<=" : return evaluate(left) <= evaluate(right); - case ">" : return evaluate(left) > evaluate(right); - case ">=" : return evaluate(left) >= evaluate(right); - case "in" : return evaluate(left) in evaluate(right); - case "instanceof" : return evaluate(left) instanceof evaluate(right); - } - } - throw $NOT_CONSTANT; - }; - - return function(expr, yes, no) { - try { - var val = evaluate(expr), ast; - switch (typeof val) { - case "string": ast = [ "string", val ]; break; - case "number": ast = [ "num", val ]; break; - case "boolean": ast = [ "name", String(val) ]; break; - default: throw new Error("Can't handle constant of type: " + (typeof val)); - } - return yes.call(expr, ast, val); - } catch(ex) { - if (ex === $NOT_CONSTANT) { - if (expr[0] == "binary" - && (expr[1] == "===" || expr[1] == "!==") - && ((is_string(expr[2]) && is_string(expr[3])) - || (boolean_expr(expr[2]) && boolean_expr(expr[3])))) { - expr[1] = expr[1].substr(0, 2); - } - else if (no && expr[0] == "binary" - && (expr[1] == "||" || expr[1] == "&&")) { - // the whole expression is not constant but the lval may be... - try { - var lval = evaluate(expr[2]); - expr = ((expr[1] == "&&" && (lval ? expr[3] : lval)) || - (expr[1] == "||" && (lval ? lval : expr[3])) || - expr); - } catch(ex2) { - // IGNORE... lval is not constant - } - } - return no ? no.call(expr, expr) : null; - } - else throw ex; - } - }; - -})(); - -function warn_unreachable(ast) { - if (!empty(ast)) - warn("Dropping unreachable code: " + gen_code(ast, true)); -}; - -function prepare_ifs(ast) { - var w = ast_walker(), walk = w.walk; - // In this first pass, we rewrite ifs which abort with no else with an - // if-else. For example: - // - // if (x) { - // blah(); - // return y; - // } - // foobar(); - // - // is rewritten into: - // - // if (x) { - // blah(); - // return y; - // } else { - // foobar(); - // } - function redo_if(statements) { - statements = MAP(statements, walk); - - for (var i = 0; i < statements.length; ++i) { - var fi = statements[i]; - if (fi[0] != "if") continue; - - if (fi[3] && walk(fi[3])) continue; - - var t = walk(fi[2]); - if (!aborts(t)) continue; - - var conditional = walk(fi[1]); - - var e_body = statements.slice(i + 1); - var e; - if (e_body.length == 1) e = e_body[0]; - else e = [ "block", e_body ]; - - var ret = statements.slice(0, i).concat([ [ - fi[0], // "if" - conditional, // conditional - t, // then - e // else - ] ]); - - return redo_if(ret); - } - - return statements; - }; - - function redo_if_lambda(name, args, body) { - body = redo_if(body); - return [ this[0], name, args.slice(), body ]; - }; - - function redo_if_block(statements) { - var out = [ this[0] ]; - if (statements != null) - out.push(redo_if(statements)); - return out; - }; - - return w.with_walkers({ - "defun": redo_if_lambda, - "function": redo_if_lambda, - "block": redo_if_block, - "splice": redo_if_block, - "toplevel": function(statements) { - return [ this[0], redo_if(statements) ]; - }, - "try": function(t, c, f) { - return [ - this[0], - redo_if(t), - c != null ? [ c[0], redo_if(c[1]) ] : null, - f != null ? redo_if(f) : null - ]; - }, - "with": function(expr, block) { - return [ this[0], walk(expr), redo_if(block) ]; - } - }, function() { - return walk(ast); - }); -}; - -function ast_squeeze(ast, options) { - options = defaults(options, { - make_seqs : true, - dead_code : true, - keep_comps : true, - no_warnings : false - }); - - var w = ast_walker(), walk = w.walk, scope; - - function negate(c) { - var not_c = [ "unary-prefix", "!", c ]; - switch (c[0]) { - case "unary-prefix": - return c[1] == "!" && boolean_expr(c[2]) ? c[2] : not_c; - case "seq": - c = slice(c); - c[c.length - 1] = negate(c[c.length - 1]); - return c; - case "conditional": - return best_of(not_c, [ "conditional", c[1], negate(c[2]), negate(c[3]) ]); - case "binary": - var op = c[1], left = c[2], right = c[3]; - if (!options.keep_comps) switch (op) { - case "<=" : return [ "binary", ">", left, right ]; - case "<" : return [ "binary", ">=", left, right ]; - case ">=" : return [ "binary", "<", left, right ]; - case ">" : return [ "binary", "<=", left, right ]; - } - switch (op) { - case "==" : return [ "binary", "!=", left, right ]; - case "!=" : return [ "binary", "==", left, right ]; - case "===" : return [ "binary", "!==", left, right ]; - case "!==" : return [ "binary", "===", left, right ]; - case "&&" : return best_of(not_c, [ "binary", "||", negate(left), negate(right) ]); - case "||" : return best_of(not_c, [ "binary", "&&", negate(left), negate(right) ]); - } - break; - } - return not_c; - }; - - function with_scope(s, cont) { - var _scope = scope; - scope = s; - var ret = cont(); - ret.scope = s; - scope = _scope; - return ret; - }; - - function rmblock(block) { - if (block != null && block[0] == "block" && block[1]) { - if (block[1].length == 1) - block = block[1][0]; - else if (block[1].length == 0) - block = [ "block" ]; - } - return block; - }; - - function _lambda(name, args, body) { - var is_defun = this[0] == "defun"; - body = with_scope(body.scope, function(){ - var ret = tighten(MAP(body, walk), "lambda"); - if (!is_defun && name && !HOP(scope.refs, name)) - name = null; - return ret; - }); - return [ this[0], name, args, body ]; - }; - - // we get here for blocks that have been already transformed. - // this function does a few things: - // 1. discard useless blocks - // 2. join consecutive var declarations - // 3. remove obviously dead code - // 4. transform consecutive statements using the comma operator - // 5. if block_type == "lambda" and it detects constructs like if(foo) return ... - rewrite like if (!foo) { ... } - function tighten(statements, block_type) { - statements = statements.reduce(function(a, stat){ - if (stat[0] == "block") { - if (stat[1]) { - a.push.apply(a, stat[1]); - } - } else { - a.push(stat); - } - return a; - }, []); - - statements = (function(a, prev){ - statements.forEach(function(cur){ - if (prev && ((cur[0] == "var" && prev[0] == "var") || - (cur[0] == "const" && prev[0] == "const"))) { - prev[1] = prev[1].concat(cur[1]); - } else { - a.push(cur); - prev = cur; - } - }); - return a; - })([]); - - if (options.dead_code) statements = (function(a, has_quit){ - statements.forEach(function(st){ - if (has_quit) { - if (member(st[0], [ "function", "defun" , "var", "const" ])) { - a.push(st); - } - else if (!options.no_warnings) - warn_unreachable(st); - } - else { - a.push(st); - if (member(st[0], [ "return", "throw", "break", "continue" ])) - has_quit = true; - } - }); - return a; - })([]); - - if (options.make_seqs) statements = (function(a, prev) { - statements.forEach(function(cur){ - if (prev && prev[0] == "stat" && cur[0] == "stat") { - prev[1] = [ "seq", prev[1], cur[1] ]; - } else { - a.push(cur); - prev = cur; - } - }); - return a; - })([]); - - if (block_type == "lambda") statements = (function(i, a, stat){ - while (i < statements.length) { - stat = statements[i++]; - if (stat[0] == "if" && !stat[3]) { - if (stat[2][0] == "return" && stat[2][1] == null) { - a.push(make_if(negate(stat[1]), [ "block", statements.slice(i) ])); - break; - } - var last = last_stat(stat[2]); - if (last[0] == "return" && last[1] == null) { - a.push(make_if(stat[1], [ "block", stat[2][1].slice(0, -1) ], [ "block", statements.slice(i) ])); - break; - } - } - a.push(stat); - } - return a; - })(0, []); - - return statements; - }; - - function make_if(c, t, e) { - return when_constant(c, function(ast, val){ - if (val) { - warn_unreachable(e); - return t; - } else { - warn_unreachable(t); - return e; - } - }, function() { - return make_real_if(c, t, e); - }); - }; - - function make_real_if(c, t, e) { - c = walk(c); - t = walk(t); - e = walk(e); - - if (empty(t)) { - c = negate(c); - t = e; - e = null; - } else if (empty(e)) { - e = null; - } else { - // if we have both else and then, maybe it makes sense to switch them? - (function(){ - var a = gen_code(c); - var n = negate(c); - var b = gen_code(n); - if (b.length < a.length) { - var tmp = t; - t = e; - e = tmp; - c = n; - } - })(); - } - if (empty(e) && empty(t)) - return [ "stat", c ]; - var ret = [ "if", c, t, e ]; - if (t[0] == "if" && empty(t[3]) && empty(e)) { - ret = best_of(ret, walk([ "if", [ "binary", "&&", c, t[1] ], t[2] ])); - } - else if (t[0] == "stat") { - if (e) { - if (e[0] == "stat") { - ret = best_of(ret, [ "stat", make_conditional(c, t[1], e[1]) ]); - } - } - else { - ret = best_of(ret, [ "stat", make_conditional(c, t[1]) ]); - } - } - else if (e && t[0] == e[0] && (t[0] == "return" || t[0] == "throw") && t[1] && e[1]) { - ret = best_of(ret, [ t[0], make_conditional(c, t[1], e[1] ) ]); - } - else if (e && aborts(t)) { - ret = [ [ "if", c, t ] ]; - if (e[0] == "block") { - if (e[1]) ret = ret.concat(e[1]); - } - else { - ret.push(e); - } - ret = walk([ "block", ret ]); - } - else if (t && aborts(e)) { - ret = [ [ "if", negate(c), e ] ]; - if (t[0] == "block") { - if (t[1]) ret = ret.concat(t[1]); - } else { - ret.push(t); - } - ret = walk([ "block", ret ]); - } - return ret; - }; - - function _do_while(cond, body) { - return when_constant(cond, function(cond, val){ - if (!val) { - warn_unreachable(body); - return [ "block" ]; - } else { - return [ "for", null, null, null, walk(body) ]; - } - }); - }; - - ast = prepare_ifs(ast); - ast = ast_add_scope(ast); - - return w.with_walkers({ - "sub": function(expr, subscript) { - if (subscript[0] == "string") { - var name = subscript[1]; - if (is_identifier(name)) - return [ "dot", walk(expr), name ]; - else if (/^[1-9][0-9]*$/.test(name) || name === "0") - return [ "sub", walk(expr), [ "num", parseInt(name, 10) ] ]; - } - }, - "if": make_if, - "toplevel": function(body) { - return [ "toplevel", with_scope(this.scope, function(){ - return tighten(MAP(body, walk)); - }) ]; - }, - "switch": function(expr, body) { - var last = body.length - 1; - return [ "switch", walk(expr), MAP(body, function(branch, i){ - var block = tighten(MAP(branch[1], walk)); - if (i == last && block.length > 0) { - var node = block[block.length - 1]; - if (node[0] == "break" && !node[1]) - block.pop(); - } - return [ branch[0] ? walk(branch[0]) : null, block ]; - }) ]; - }, - "function": _lambda, - "defun": _lambda, - "block": function(body) { - if (body) return rmblock([ "block", tighten(MAP(body, walk)) ]); - }, - "binary": function(op, left, right) { - return when_constant([ "binary", op, walk(left), walk(right) ], function yes(c){ - return best_of(walk(c), this); - }, function no() { - return this; - }); - }, - "conditional": function(c, t, e) { - return make_conditional(walk(c), walk(t), walk(e)); - }, - "try": function(t, c, f) { - return [ - "try", - tighten(MAP(t, walk)), - c != null ? [ c[0], tighten(MAP(c[1], walk)) ] : null, - f != null ? tighten(MAP(f, walk)) : null - ]; - }, - "unary-prefix": function(op, expr) { - expr = walk(expr); - var ret = [ "unary-prefix", op, expr ]; - if (op == "!") - ret = best_of(ret, negate(expr)); - return when_constant(ret, function(ast, val){ - return walk(ast); // it's either true or false, so minifies to !0 or !1 - }, function() { return ret }); - }, - "name": function(name) { - switch (name) { - case "true": return [ "unary-prefix", "!", [ "num", 0 ]]; - case "false": return [ "unary-prefix", "!", [ "num", 1 ]]; - } - }, - "new": function(ctor, args) { - if (ctor[0] == "name" && ctor[1] == "Array" && !scope.has("Array")) { - if (args.length != 1) { - return [ "array", args ]; - } else { - return [ "call", [ "name", "Array" ], args ]; - } - } - }, - "call": function(expr, args) { - if (expr[0] == "name" && expr[1] == "Array" && args.length != 1 && !scope.has("Array")) { - return [ "array", args ]; - } - }, - "while": _do_while - }, function() { - return walk(ast); - }); -}; - -/* -----[ re-generate code from the AST ]----- */ - -var DOT_CALL_NO_PARENS = jsp.array_to_hash([ - "name", - "array", - "object", - "string", - "dot", - "sub", - "call", - "regexp" -]); - -function make_string(str, ascii_only) { - var dq = 0, sq = 0; - str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029]/g, function(s){ - switch (s) { - case "\\": return "\\\\"; - case "\b": return "\\b"; - case "\f": return "\\f"; - case "\n": return "\\n"; - case "\r": return "\\r"; - case "\t": return "\\t"; - case "\u2028": return "\\u2028"; - case "\u2029": return "\\u2029"; - case '"': ++dq; return '"'; - case "'": ++sq; return "'"; - } - return s; - }); - if (ascii_only) str = to_ascii(str); - if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'"; - else return '"' + str.replace(/\x22/g, '\\"') + '"'; -}; - -function to_ascii(str) { - return str.replace(/[\u0080-\uffff]/g, function(ch) { - var code = ch.charCodeAt(0).toString(16); - while (code.length < 4) code = "0" + code; - return "\\u" + code; - }); -}; - -var SPLICE_NEEDS_BRACKETS = jsp.array_to_hash([ "if", "while", "do", "for", "for-in", "with" ]); - -function gen_code(ast, options) { - options = defaults(options, { - indent_start : 0, - indent_level : 4, - quote_keys : false, - space_colon : false, - beautify : false, - ascii_only : false - }); - var beautify = !!options.beautify; - var indentation = 0, - newline = beautify ? "\n" : "", - space = beautify ? " " : ""; - - function encode_string(str) { - return make_string(str, options.ascii_only); - }; - - function make_name(name) { - name = name.toString(); - if (options.ascii_only) - name = to_ascii(name); - return name; - }; - - function indent(line) { - if (line == null) - line = ""; - if (beautify) - line = repeat_string(" ", options.indent_start + indentation * options.indent_level) + line; - return line; - }; - - function with_indent(cont, incr) { - if (incr == null) incr = 1; - indentation += incr; - try { return cont.apply(null, slice(arguments, 1)); } - finally { indentation -= incr; } - }; - - function add_spaces(a) { - if (beautify) - return a.join(" "); - var b = []; - for (var i = 0; i < a.length; ++i) { - var next = a[i + 1]; - b.push(a[i]); - if (next && - ((/[a-z0-9_\x24]$/i.test(a[i].toString()) && /^[a-z0-9_\x24]/i.test(next.toString())) || - (/[\+\-]$/.test(a[i].toString()) && /^[\+\-]/.test(next.toString())))) { - b.push(" "); - } - } - return b.join(""); - }; - - function add_commas(a) { - return a.join("," + space); - }; - - function parenthesize(expr) { - var gen = make(expr); - for (var i = 1; i < arguments.length; ++i) { - var el = arguments[i]; - if ((el instanceof Function && el(expr)) || expr[0] == el) - return "(" + gen + ")"; - } - return gen; - }; - - function best_of(a) { - if (a.length == 1) { - return a[0]; - } - if (a.length == 2) { - var b = a[1]; - a = a[0]; - return a.length <= b.length ? a : b; - } - return best_of([ a[0], best_of(a.slice(1)) ]); - }; - - function needs_parens(expr) { - if (expr[0] == "function" || expr[0] == "object") { - // dot/call on a literal function requires the - // function literal itself to be parenthesized - // only if it's the first "thing" in a - // statement. This means that the parent is - // "stat", but it could also be a "seq" and - // we're the first in this "seq" and the - // parent is "stat", and so on. Messy stuff, - // but it worths the trouble. - var a = slice($stack), self = a.pop(), p = a.pop(); - while (p) { - if (p[0] == "stat") return true; - if (((p[0] == "seq" || p[0] == "call" || p[0] == "dot" || p[0] == "sub" || p[0] == "conditional") && p[1] === self) || - ((p[0] == "binary" || p[0] == "assign" || p[0] == "unary-postfix") && p[2] === self)) { - self = p; - p = a.pop(); - } else { - return false; - } - } - } - return !HOP(DOT_CALL_NO_PARENS, expr[0]); - }; - - function make_num(num) { - var str = num.toString(10), a = [ str.replace(/^0\./, ".") ], m; - if (Math.floor(num) === num) { - a.push("0x" + num.toString(16).toLowerCase(), // probably pointless - "0" + num.toString(8)); // same. - if ((m = /^(.*?)(0+)$/.exec(num))) { - a.push(m[1] + "e" + m[2].length); - } - } else if ((m = /^0?\.(0+)(.*)$/.exec(num))) { - a.push(m[2] + "e-" + (m[1].length + m[2].length), - str.substr(str.indexOf("."))); - } - return best_of(a); - }; - - var generators = { - "string": encode_string, - "num": make_num, - "name": make_name, - "toplevel": function(statements) { - return make_block_statements(statements) - .join(newline + newline); - }, - "splice": function(statements) { - var parent = $stack[$stack.length - 2][0]; - if (HOP(SPLICE_NEEDS_BRACKETS, parent)) { - // we need block brackets in this case - return make_block.apply(this, arguments); - } else { - return MAP(make_block_statements(statements, true), - function(line, i) { - // the first line is already indented - return i > 0 ? indent(line) : line; - }).join(newline); - } - }, - "block": make_block, - "var": function(defs) { - return "var " + add_commas(MAP(defs, make_1vardef)) + ";"; - }, - "const": function(defs) { - return "const " + add_commas(MAP(defs, make_1vardef)) + ";"; - }, - "try": function(tr, ca, fi) { - var out = [ "try", make_block(tr) ]; - if (ca) out.push("catch", "(" + ca[0] + ")", make_block(ca[1])); - if (fi) out.push("finally", make_block(fi)); - return add_spaces(out); - }, - "throw": function(expr) { - return add_spaces([ "throw", make(expr) ]) + ";"; - }, - "new": function(ctor, args) { - args = args.length > 0 ? "(" + add_commas(MAP(args, make)) + ")" : ""; - return add_spaces([ "new", parenthesize(ctor, "seq", "binary", "conditional", "assign", function(expr){ - var w = ast_walker(), has_call = {}; - try { - w.with_walkers({ - "call": function() { throw has_call }, - "function": function() { return this } - }, function(){ - w.walk(expr); - }); - } catch(ex) { - if (ex === has_call) - return true; - throw ex; - } - }) + args ]); - }, - "switch": function(expr, body) { - return add_spaces([ "switch", "(" + make(expr) + ")", make_switch_block(body) ]); - }, - "break": function(label) { - var out = "break"; - if (label != null) - out += " " + make_name(label); - return out + ";"; - }, - "continue": function(label) { - var out = "continue"; - if (label != null) - out += " " + make_name(label); - return out + ";"; - }, - "conditional": function(co, th, el) { - return add_spaces([ parenthesize(co, "assign", "seq", "conditional"), "?", - parenthesize(th, "seq"), ":", - parenthesize(el, "seq") ]); - }, - "assign": function(op, lvalue, rvalue) { - if (op && op !== true) op += "="; - else op = "="; - return add_spaces([ make(lvalue), op, parenthesize(rvalue, "seq") ]); - }, - "dot": function(expr) { - var out = make(expr), i = 1; - if (expr[0] == "num") { - if (!/\./.test(expr[1])) - out += "."; - } else if (needs_parens(expr)) - out = "(" + out + ")"; - while (i < arguments.length) - out += "." + make_name(arguments[i++]); - return out; - }, - "call": function(func, args) { - var f = make(func); - if (needs_parens(func)) - f = "(" + f + ")"; - return f + "(" + add_commas(MAP(args, function(expr){ - return parenthesize(expr, "seq"); - })) + ")"; - }, - "function": make_function, - "defun": make_function, - "if": function(co, th, el) { - var out = [ "if", "(" + make(co) + ")", el ? make_then(th) : make(th) ]; - if (el) { - out.push("else", make(el)); - } - return add_spaces(out); - }, - "for": function(init, cond, step, block) { - var out = [ "for" ]; - init = (init != null ? make(init) : "").replace(/;*\s*$/, ";" + space); - cond = (cond != null ? make(cond) : "").replace(/;*\s*$/, ";" + space); - step = (step != null ? make(step) : "").replace(/;*\s*$/, ""); - var args = init + cond + step; - if (args == "; ; ") args = ";;"; - out.push("(" + args + ")", make(block)); - return add_spaces(out); - }, - "for-in": function(vvar, key, hash, block) { - return add_spaces([ "for", "(" + - (vvar ? make(vvar).replace(/;+$/, "") : make(key)), - "in", - make(hash) + ")", make(block) ]); - }, - "while": function(condition, block) { - return add_spaces([ "while", "(" + make(condition) + ")", make(block) ]); - }, - "do": function(condition, block) { - return add_spaces([ "do", make(block), "while", "(" + make(condition) + ")" ]) + ";"; - }, - "return": function(expr) { - var out = [ "return" ]; - if (expr != null) out.push(make(expr)); - return add_spaces(out) + ";"; - }, - "binary": function(operator, lvalue, rvalue) { - var left = make(lvalue), right = make(rvalue); - // XXX: I'm pretty sure other cases will bite here. - // we need to be smarter. - // adding parens all the time is the safest bet. - if (member(lvalue[0], [ "assign", "conditional", "seq" ]) || - lvalue[0] == "binary" && PRECEDENCE[operator] > PRECEDENCE[lvalue[1]]) { - left = "(" + left + ")"; - } - if (member(rvalue[0], [ "assign", "conditional", "seq" ]) || - rvalue[0] == "binary" && PRECEDENCE[operator] >= PRECEDENCE[rvalue[1]] && - !(rvalue[1] == operator && member(operator, [ "&&", "||", "*" ]))) { - right = "(" + right + ")"; - } - return add_spaces([ left, operator, right ]); - }, - "unary-prefix": function(operator, expr) { - var val = make(expr); - if (!(expr[0] == "num" || (expr[0] == "unary-prefix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr))) - val = "(" + val + ")"; - return operator + (jsp.is_alphanumeric_char(operator.charAt(0)) ? " " : "") + val; - }, - "unary-postfix": function(operator, expr) { - var val = make(expr); - if (!(expr[0] == "num" || (expr[0] == "unary-postfix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr))) - val = "(" + val + ")"; - return val + operator; - }, - "sub": function(expr, subscript) { - var hash = make(expr); - if (needs_parens(expr)) - hash = "(" + hash + ")"; - return hash + "[" + make(subscript) + "]"; - }, - "object": function(props) { - if (props.length == 0) - return "{}"; - return "{" + newline + with_indent(function(){ - return MAP(props, function(p){ - if (p.length == 3) { - // getter/setter. The name is in p[0], the arg.list in p[1][2], the - // body in p[1][3] and type ("get" / "set") in p[2]. - return indent(make_function(p[0], p[1][2], p[1][3], p[2])); - } - var key = p[0], val = make(p[1]); - if (options.quote_keys) { - key = encode_string(key); - } else if ((typeof key == "number" || !beautify && +key + "" == key) - && parseFloat(key) >= 0) { - key = make_num(+key); - } else if (!is_identifier(key)) { - key = encode_string(key); - } - return indent(add_spaces(beautify && options.space_colon - ? [ key, ":", val ] - : [ key + ":", val ])); - }).join("," + newline); - }) + newline + indent("}"); - }, - "regexp": function(rx, mods) { - return "/" + rx + "/" + mods; - }, - "array": function(elements) { - if (elements.length == 0) return "[]"; - return add_spaces([ "[", add_commas(MAP(elements, function(el){ - if (!beautify && el[0] == "atom" && el[1] == "undefined") return ""; - return parenthesize(el, "seq"); - })), "]" ]); - }, - "stat": function(stmt) { - return make(stmt).replace(/;*\s*$/, ";"); - }, - "seq": function() { - return add_commas(MAP(slice(arguments), make)); - }, - "label": function(name, block) { - return add_spaces([ make_name(name), ":", make(block) ]); - }, - "with": function(expr, block) { - return add_spaces([ "with", "(" + make(expr) + ")", make(block) ]); - }, - "atom": function(name) { - return make_name(name); - } - }; - - // The squeezer replaces "block"-s that contain only a single - // statement with the statement itself; technically, the AST - // is correct, but this can create problems when we output an - // IF having an ELSE clause where the THEN clause ends in an - // IF *without* an ELSE block (then the outer ELSE would refer - // to the inner IF). This function checks for this case and - // adds the block brackets if needed. - function make_then(th) { - if (th[0] == "do") { - // https://github.com/mishoo/UglifyJS/issues/#issue/57 - // IE croaks with "syntax error" on code like this: - // if (foo) do ... while(cond); else ... - // we need block brackets around do/while - return make([ "block", [ th ]]); - } - var b = th; - while (true) { - var type = b[0]; - if (type == "if") { - if (!b[3]) - // no else, we must add the block - return make([ "block", [ th ]]); - b = b[3]; - } - else if (type == "while" || type == "do") b = b[2]; - else if (type == "for" || type == "for-in") b = b[4]; - else break; - } - return make(th); - }; - - function make_function(name, args, body, keyword) { - var out = keyword || "function"; - if (name) { - out += " " + make_name(name); - } - out += "(" + add_commas(MAP(args, make_name)) + ")"; - return add_spaces([ out, make_block(body) ]); - }; - - function make_block_statements(statements, noindent) { - for (var a = [], last = statements.length - 1, i = 0; i <= last; ++i) { - var stat = statements[i]; - var code = make(stat); - if (code != ";") { - if (!beautify && i == last) { - if ((stat[0] == "while" && empty(stat[2])) || - (member(stat[0], [ "for", "for-in"] ) && empty(stat[4])) || - (stat[0] == "if" && empty(stat[2]) && !stat[3]) || - (stat[0] == "if" && stat[3] && empty(stat[3]))) { - code = code.replace(/;*\s*$/, ";"); - } else { - code = code.replace(/;+\s*$/, ""); - } - } - a.push(code); - } - } - return noindent ? a : MAP(a, indent); - }; - - function make_switch_block(body) { - var n = body.length; - if (n == 0) return "{}"; - return "{" + newline + MAP(body, function(branch, i){ - var has_body = branch[1].length > 0, code = with_indent(function(){ - return indent(branch[0] - ? add_spaces([ "case", make(branch[0]) + ":" ]) - : "default:"); - }, 0.5) + (has_body ? newline + with_indent(function(){ - return make_block_statements(branch[1]).join(newline); - }) : ""); - if (!beautify && has_body && i < n - 1) - code += ";"; - return code; - }).join(newline) + newline + indent("}"); - }; - - function make_block(statements) { - if (!statements) return ";"; - if (statements.length == 0) return "{}"; - return "{" + newline + with_indent(function(){ - return make_block_statements(statements).join(newline); - }) + newline + indent("}"); - }; - - function make_1vardef(def) { - var name = def[0], val = def[1]; - if (val != null) - name = add_spaces([ make_name(name), "=", parenthesize(val, "seq") ]); - return name; - }; - - var $stack = []; - - function make(node) { - var type = node[0]; - var gen = generators[type]; - if (!gen) - throw new Error("Can't find generator for \"" + type + "\""); - $stack.push(node); - var ret = gen.apply(type, node.slice(1)); - $stack.pop(); - return ret; - }; - - return make(ast); -}; - -function split_lines(code, max_line_length) { - var splits = [ 0 ]; - jsp.parse(function(){ - var next_token = jsp.tokenizer(code); - var last_split = 0; - var prev_token; - function current_length(tok) { - return tok.pos - last_split; - }; - function split_here(tok) { - last_split = tok.pos; - splits.push(last_split); - }; - function custom(){ - var tok = next_token.apply(this, arguments); - out: { - if (prev_token) { - if (prev_token.type == "keyword") break out; - } - if (current_length(tok) > max_line_length) { - switch (tok.type) { - case "keyword": - case "atom": - case "name": - case "punc": - split_here(tok); - break out; - } - } - } - prev_token = tok; - return tok; - }; - custom.context = function() { - return next_token.context.apply(this, arguments); - }; - return custom; - }()); - return splits.map(function(pos, i){ - return code.substring(pos, splits[i + 1] || code.length); - }).join("\n"); -}; - -/* -----[ Utilities ]----- */ - -function repeat_string(str, i) { - if (i <= 0) return ""; - if (i == 1) return str; - var d = repeat_string(str, i >> 1); - d += d; - if (i & 1) d += str; - return d; -}; - -function defaults(args, defs) { - var ret = {}; - if (args === true) - args = {}; - for (var i in defs) if (HOP(defs, i)) { - ret[i] = (args && HOP(args, i)) ? args[i] : defs[i]; - } - return ret; -}; - -function is_identifier(name) { - return /^[a-z_$][a-z0-9_$]*$/i.test(name) - && name != "this" - && !HOP(jsp.KEYWORDS_ATOM, name) - && !HOP(jsp.RESERVED_WORDS, name) - && !HOP(jsp.KEYWORDS, name); -}; - -function HOP(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -}; - -// some utilities - -var MAP; - -(function(){ - MAP = function(a, f, o) { - var ret = []; - for (var i = 0; i < a.length; ++i) { - var val = f.call(o, a[i], i); - if (val instanceof AtTop) ret.unshift(val.v); - else ret.push(val); - } - return ret; - }; - MAP.at_top = function(val) { return new AtTop(val) }; - function AtTop(val) { this.v = val }; -})(); - -/* -----[ Exports ]----- */ - -exports.ast_walker = ast_walker; -exports.ast_mangle = ast_mangle; -exports.ast_squeeze = ast_squeeze; -exports.gen_code = gen_code; -exports.ast_add_scope = ast_add_scope; -exports.set_logger = function(logger) { warn = logger }; -exports.make_string = make_string; -exports.split_lines = split_lines; -exports.MAP = MAP; - -// keep this last! -exports.ast_squeeze_more = require("./squeeze-more").ast_squeeze_more; -; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/uglify-js/lib/process.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/uglify-js/lib/squeeze-more.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/uglify-js/lib"; - var __filename = "/node_modules/burrito/node_modules/uglify-js/lib/squeeze-more.js"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/uglify-js/lib"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/uglify-js/lib"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/uglify-js/lib/squeeze-more.js"]._cached = module.exports; - - (function () { - var jsp = require("./parse-js"), - pro = require("./process"), - slice = jsp.slice, - member = jsp.member, - PRECEDENCE = jsp.PRECEDENCE, - OPERATORS = jsp.OPERATORS; - -function ast_squeeze_more(ast) { - var w = pro.ast_walker(), walk = w.walk; - return w.with_walkers({ - "call": function(expr, args) { - if (expr[0] == "dot" && expr[2] == "toString" && args.length == 0) { - // foo.toString() ==> foo+"" - return [ "binary", "+", expr[1], [ "string", "" ]]; - } - } - }, function() { - return walk(ast); - }); -}; - -exports.ast_squeeze_more = ast_squeeze_more; -; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/uglify-js/lib/squeeze-more.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/traverse/package.json"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/traverse"; - var __filename = "/node_modules/burrito/node_modules/traverse/package.json"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/traverse"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/traverse"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/traverse/package.json"]._cached = module.exports; - - (function () { - module.exports = {"name":"traverse","version":"0.5.0","description":"Traverse and transform objects by visiting every node on a recursive walk","author":"James Halliday","license":"MIT/X11","main":"./index","repository":{"type":"git","url":"http://github.com/substack/js-traverse.git"},"devDependencies":{"expresso":"0.7.x"},"scripts":{"test":"expresso"}}; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/traverse/package.json"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/traverse/index.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/traverse"; - var __filename = "/node_modules/burrito/node_modules/traverse/index.js"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/traverse"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/traverse"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/traverse/index.js"]._cached = module.exports; - - (function () { - module.exports = Traverse; -function Traverse (obj) { - if (!(this instanceof Traverse)) return new Traverse(obj); - this.value = obj; -} - -Traverse.prototype.get = function (ps) { - var node = this.value; - for (var i = 0; i < ps.length; i ++) { - var key = ps[i]; - if (!Object.hasOwnProperty.call(node, key)) { - node = undefined; - break; - } - node = node[key]; - } - return node; -}; - -Traverse.prototype.set = function (ps, value) { - var node = this.value; - for (var i = 0; i < ps.length - 1; i ++) { - var key = ps[i]; - if (!Object.hasOwnProperty.call(node, key)) node[key] = {}; - node = node[key]; - } - node[ps[i]] = value; - return value; -}; - -Traverse.prototype.map = function (cb) { - return walk(this.value, cb, true); -}; - -Traverse.prototype.forEach = function (cb) { - this.value = walk(this.value, cb, false); - return this.value; -}; - -Traverse.prototype.reduce = function (cb, init) { - var skip = arguments.length === 1; - var acc = skip ? this.value : init; - this.forEach(function (x) { - if (!this.isRoot || !skip) { - acc = cb.call(this, acc, x); - } - }); - return acc; -}; - -Traverse.prototype.paths = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.path); - }); - return acc; -}; - -Traverse.prototype.nodes = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.node); - }); - return acc; -}; - -Traverse.prototype.clone = function () { - var parents = [], nodes = []; - - return (function clone (src) { - for (var i = 0; i < parents.length; i++) { - if (parents[i] === src) { - return nodes[i]; - } - } - - if (typeof src === 'object' && src !== null) { - var dst = copy(src); - - parents.push(src); - nodes.push(dst); - - forEach(Object_keys(src), function (key) { - dst[key] = clone(src[key]); - }); - - parents.pop(); - nodes.pop(); - return dst; - } - else { - return src; - } - })(this.value); -}; - -function walk (root, cb, immutable) { - var path = []; - var parents = []; - var alive = true; - - return (function walker (node_) { - var node = immutable ? copy(node_) : node_; - var modifiers = {}; - - var keepGoing = true; - - var state = { - node : node, - node_ : node_, - path : [].concat(path), - parent : parents[parents.length - 1], - parents : parents, - key : path.slice(-1)[0], - isRoot : path.length === 0, - level : path.length, - circular : null, - update : function (x, stopHere) { - if (!state.isRoot) { - state.parent.node[state.key] = x; - } - state.node = x; - if (stopHere) keepGoing = false; - }, - 'delete' : function () { - delete state.parent.node[state.key]; - }, - remove : function () { - if (Array_isArray(state.parent.node)) { - state.parent.node.splice(state.key, 1); - } - else { - delete state.parent.node[state.key]; - } - }, - keys : null, - before : function (f) { modifiers.before = f }, - after : function (f) { modifiers.after = f }, - pre : function (f) { modifiers.pre = f }, - post : function (f) { modifiers.post = f }, - stop : function () { alive = false }, - block : function () { keepGoing = false } - }; - - if (!alive) return state; - - if (typeof node === 'object' && node !== null) { - state.keys = Object_keys(node); - - state.isLeaf = state.keys.length == 0; - - for (var i = 0; i < parents.length; i++) { - if (parents[i].node_ === node_) { - state.circular = parents[i]; - break; - } - } - } - else { - state.isLeaf = true; - } - - state.notLeaf = !state.isLeaf; - state.notRoot = !state.isRoot; - - // use return values to update if defined - var ret = cb.call(state, state.node); - if (ret !== undefined && state.update) state.update(ret); - - if (modifiers.before) modifiers.before.call(state, state.node); - - if (!keepGoing) return state; - - if (typeof state.node == 'object' - && state.node !== null && !state.circular) { - parents.push(state); - - forEach(state.keys, function (key, i) { - path.push(key); - - if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); - - var child = walker(state.node[key]); - if (immutable && Object.hasOwnProperty.call(state.node, key)) { - state.node[key] = child.node; - } - - child.isLast = i == state.keys.length - 1; - child.isFirst = i == 0; - - if (modifiers.post) modifiers.post.call(state, child); - - path.pop(); - }); - parents.pop(); - } - - if (modifiers.after) modifiers.after.call(state, state.node); - - return state; - })(root).node; -} - -function copy (src) { - if (typeof src === 'object' && src !== null) { - var dst; - - if (Array_isArray(src)) { - dst = []; - } - else if (src instanceof Date) { - dst = new Date(src); - } - else if (src instanceof Boolean) { - dst = new Boolean(src); - } - else if (src instanceof Number) { - dst = new Number(src); - } - else if (src instanceof String) { - dst = new String(src); - } - else if (Object.create && Object.getPrototypeOf) { - dst = Object.create(Object.getPrototypeOf(src)); - } - else if (src.__proto__ || src.constructor.prototype) { - var proto = src.__proto__ || src.constructor.prototype || {}; - var T = function () {}; - T.prototype = proto; - dst = new T; - if (!dst.__proto__) dst.__proto__ = proto; - } - - forEach(Object_keys(src), function (key) { - dst[key] = src[key]; - }); - return dst; - } - else return src; -} - -var Object_keys = Object.keys || function keys (obj) { - var res = []; - for (var key in obj) res.push(key) - return res; -}; - -var Array_isArray = Array.isArray || function isArray (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - -var forEach = function (xs, fn) { - if (xs.forEach) return xs.forEach(fn) - else for (var i = 0; i < xs.length; i++) { - fn(xs[i], i, xs); - } -}; - -forEach(Object_keys(Traverse.prototype), function (key) { - Traverse[key] = function (obj) { - var args = [].slice.call(arguments, 1); - var t = Traverse(obj); - return t[key].apply(t, args); - }; -}); -; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/traverse/index.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["vm"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "."; - var __filename = "vm"; - - var require = function (file) { - return __require(file, "."); - }; - - require.resolve = function (file) { - return __require.resolve(name, "."); - }; - - require.modules = __require.modules; - __require.modules["vm"]._cached = module.exports; - - (function () { - var Object_keys = function (obj) { - if (Object.keys) return Object.keys(obj) - else { - var res = []; - for (var key in obj) res.push(key) - return res; - } -}; - -var forEach = function (xs, fn) { - if (xs.forEach) return xs.forEach(fn) - else for (var i = 0; i < xs.length; i++) { - fn(xs[i], i, xs); - } -}; - -var Script = exports.Script = function NodeScript (code) { - if (!(this instanceof Script)) return new Script(code); - this.code = code; -}; - -var iframe = document.createElement('iframe'); -if (!iframe.style) iframe.style = {}; -iframe.style.display = 'none'; - -var iframeCapable = true; // until proven otherwise -if (navigator.appName === 'Microsoft Internet Explorer') { - var m = navigator.appVersion.match(/\bMSIE (\d+\.\d+);/); - if (m && parseFloat(m[1]) <= 9.0) { - iframeCapable = false; - } -} - -Script.prototype.runInNewContext = function (context) { - if (!context) context = {}; - - if (!iframeCapable) { - var keys = Object_keys(context); - var args = []; - for (var i = 0; i < keys.length; i++) { - args.push(context[keys[i]]); - } - - var fn = Function(keys, this.code); - return fn.apply(null, args); - } - - document.body.appendChild(iframe); - - var win = iframe.contentWindow - || (window.frames && window.frames[window.frames.length - 1]) - || window[window.length - 1] - ; - - forEach(Object_keys(context), function (key) { - win[key] = context[key]; - iframe[key] = context[key]; - }); - - if (win.eval) { - // chrome and ff can just .eval() - var res = win.eval(this.code); - } - else { - // this works in IE9 but not anything newer - iframe.setAttribute('src', - 'javascript:__browserifyVmResult=(' + this.code + ')' - ); - if ('__browserifyVmResult' in win) { - var res = win.__browserifyVmResult; - } - else { - iframeCapable = false; - res = this.runInThisContext(context); - } - } - - forEach(Object_keys(win), function (key) { - context[key] = win[key]; - }); - - document.body.removeChild(iframe); - - return res; -}; - -Script.prototype.runInThisContext = function () { - return eval(this.code); // maybe... -}; - -Script.prototype.runInContext = function (context) { - // seems to be just runInNewContext on magical context objects which are - // otherwise indistinguishable from objects except plain old objects - // for the parameter segfaults node - return this.runInNewContext(context); -}; - -forEach(Object_keys(Script.prototype), function (name) { - exports[name] = Script[name] = function (code) { - var s = Script(code); - return s[name].apply(s, [].slice.call(arguments, 1)); - }; -}); - -exports.createScript = function (code) { - return exports.Script(code); -}; - -exports.createContext = Script.createContext = function (context) { - // not really sure what this one does - // seems to just make a shallow copy - var copy = {}; - forEach(Object_keys(context), function (key) { - copy[key] = context[key]; - }); - return copy; -}; -; - }).call(module.exports); - - __require.modules["vm"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/jsonify/package.json"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/jsonify"; - var __filename = "/node_modules/jsonify/package.json"; - - var require = function (file) { - return __require(file, "/node_modules/jsonify"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/jsonify"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/jsonify/package.json"]._cached = module.exports; - - (function () { - module.exports = {"name":"jsonify","version":"0.0.0","description":"JSON without touching any globals","main":"index.js","directories":{"lib":".","test":"test"},"devDependencies":{"tap":"0.0.x","garbage":"0.0.x"},"scripts":{"test":"tap test"},"repository":{"type":"git","url":"http://github.com/substack/jsonify.git"},"keywords":["json","browser"],"author":{"name":"Douglas Crockford","url":"http://crockford.com/"},"license":"Public Domain"}; - }).call(module.exports); - - __require.modules["/node_modules/jsonify/package.json"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/jsonify/index.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/jsonify"; - var __filename = "/node_modules/jsonify/index.js"; - - var require = function (file) { - return __require(file, "/node_modules/jsonify"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/jsonify"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/jsonify/index.js"]._cached = module.exports; - - (function () { - exports.parse = require('./lib/parse'); -exports.stringify = require('./lib/stringify'); -; - }).call(module.exports); - - __require.modules["/node_modules/jsonify/index.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/jsonify/lib/parse.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/jsonify/lib"; - var __filename = "/node_modules/jsonify/lib/parse.js"; - - var require = function (file) { - return __require(file, "/node_modules/jsonify/lib"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/jsonify/lib"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/jsonify/lib/parse.js"]._cached = module.exports; - - (function () { - var at, // The index of the current character - ch, // The current character - escapee = { - '"': '"', - '\\': '\\', - '/': '/', - b: '\b', - f: '\f', - n: '\n', - r: '\r', - t: '\t' - }, - text, - - error = function (m) { - // Call error when something is wrong. - throw { - name: 'SyntaxError', - message: m, - at: at, - text: text - }; - }, - - next = function (c) { - // If a c parameter is provided, verify that it matches the current character. - if (c && c !== ch) { - error("Expected '" + c + "' instead of '" + ch + "'"); - } - - // Get the next character. When there are no more characters, - // return the empty string. - - ch = text.charAt(at); - at += 1; - return ch; - }, - - number = function () { - // Parse a number value. - var number, - string = ''; - - if (ch === '-') { - string = '-'; - next('-'); - } - while (ch >= '0' && ch <= '9') { - string += ch; - next(); - } - if (ch === '.') { - string += '.'; - while (next() && ch >= '0' && ch <= '9') { - string += ch; - } - } - if (ch === 'e' || ch === 'E') { - string += ch; - next(); - if (ch === '-' || ch === '+') { - string += ch; - next(); - } - while (ch >= '0' && ch <= '9') { - string += ch; - next(); - } - } - number = +string; - if (!isFinite(number)) { - error("Bad number"); - } else { - return number; - } - }, - - string = function () { - // Parse a string value. - var hex, - i, - string = '', - uffff; - - // When parsing for string values, we must look for " and \ characters. - if (ch === '"') { - while (next()) { - if (ch === '"') { - next(); - return string; - } else if (ch === '\\') { - next(); - if (ch === 'u') { - uffff = 0; - for (i = 0; i < 4; i += 1) { - hex = parseInt(next(), 16); - if (!isFinite(hex)) { - break; - } - uffff = uffff * 16 + hex; - } - string += String.fromCharCode(uffff); - } else if (typeof escapee[ch] === 'string') { - string += escapee[ch]; - } else { - break; - } - } else { - string += ch; - } - } - } - error("Bad string"); - }, - - white = function () { - -// Skip whitespace. - - while (ch && ch <= ' ') { - next(); - } - }, - - word = function () { - -// true, false, or null. - - switch (ch) { - case 't': - next('t'); - next('r'); - next('u'); - next('e'); - return true; - case 'f': - next('f'); - next('a'); - next('l'); - next('s'); - next('e'); - return false; - case 'n': - next('n'); - next('u'); - next('l'); - next('l'); - return null; - } - error("Unexpected '" + ch + "'"); - }, - - value, // Place holder for the value function. - - array = function () { - -// Parse an array value. - - var array = []; - - if (ch === '[') { - next('['); - white(); - if (ch === ']') { - next(']'); - return array; // empty array - } - while (ch) { - array.push(value()); - white(); - if (ch === ']') { - next(']'); - return array; - } - next(','); - white(); - } - } - error("Bad array"); - }, - - object = function () { - -// Parse an object value. - - var key, - object = {}; - - if (ch === '{') { - next('{'); - white(); - if (ch === '}') { - next('}'); - return object; // empty object - } - while (ch) { - key = string(); - white(); - next(':'); - if (Object.hasOwnProperty.call(object, key)) { - error('Duplicate key "' + key + '"'); - } - object[key] = value(); - white(); - if (ch === '}') { - next('}'); - return object; - } - next(','); - white(); - } - } - error("Bad object"); - }; - -value = function () { - -// Parse a JSON value. It could be an object, an array, a string, a number, -// or a word. - - white(); - switch (ch) { - case '{': - return object(); - case '[': - return array(); - case '"': - return string(); - case '-': - return number(); - default: - return ch >= '0' && ch <= '9' ? number() : word(); - } -}; - -// Return the json_parse function. It will have access to all of the above -// functions and variables. - -module.exports = function (source, reviver) { - var result; - - text = source; - at = 0; - ch = ' '; - result = value(); - white(); - if (ch) { - error("Syntax error"); - } - - // If there is a reviver function, we recursively walk the new structure, - // passing each name/value pair to the reviver function for possible - // transformation, starting with a temporary root object that holds the result - // in an empty key. If there is not a reviver function, we simply return the - // result. - - return typeof reviver === 'function' ? (function walk(holder, key) { - var k, v, value = holder[key]; - if (value && typeof value === 'object') { - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = walk(value, k); - if (v !== undefined) { - value[k] = v; - } else { - delete value[k]; - } - } - } - } - return reviver.call(holder, key, value); - }({'': result}, '')) : result; -}; -; - }).call(module.exports); - - __require.modules["/node_modules/jsonify/lib/parse.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/jsonify/lib/stringify.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/jsonify/lib"; - var __filename = "/node_modules/jsonify/lib/stringify.js"; - - var require = function (file) { - return __require(file, "/node_modules/jsonify/lib"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/jsonify/lib"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/jsonify/lib/stringify.js"]._cached = module.exports; - - (function () { - var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - gap, - indent, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep; - -function quote(string) { - // If the string contains no control characters, no quote characters, and no - // backslash characters, then we can safely slap some quotes around it. - // Otherwise we must also replace the offending characters with safe escape - // sequences. - - escapable.lastIndex = 0; - return escapable.test(string) ? '"' + string.replace(escapable, function (a) { - var c = meta[a]; - return typeof c === 'string' ? c : - '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : '"' + string + '"'; -} - -function str(key, holder) { - // Produce a string from holder[key]. - var i, // The loop counter. - k, // The member key. - v, // The member value. - length, - mind = gap, - partial, - value = holder[key]; - - // If the value has a toJSON method, call it to obtain a replacement value. - if (value && typeof value === 'object' && - typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - - // If we were called with a replacer function, then call the replacer to - // obtain a replacement value. - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - - // What happens next depends on the value's type. - switch (typeof value) { - case 'string': - return quote(value); - - case 'number': - // JSON numbers must be finite. Encode non-finite numbers as null. - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - // If the value is a boolean or null, convert it to a string. Note: - // typeof null does not produce 'null'. The case is included here in - // the remote chance that this gets fixed someday. - return String(value); - - case 'object': - if (!value) return 'null'; - gap += indent; - partial = []; - - // Array.isArray - if (Object.prototype.toString.apply(value) === '[object Array]') { - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } - - // Join all of the elements together, separated with commas, and - // wrap them in brackets. - v = partial.length === 0 ? '[]' : gap ? - '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : - '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - - // If the replacer is an array, use it to select the members to be - // stringified. - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - k = rep[i]; - if (typeof k === 'string') { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - else { - // Otherwise, iterate through all of the keys in the object. - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - - // Join all of the member texts together, separated with commas, - // and wrap them in braces. - - v = partial.length === 0 ? '{}' : gap ? - '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : - '{' + partial.join(',') + '}'; - gap = mind; - return v; - } -} - -module.exports = function (value, replacer, space) { - var i; - gap = ''; - indent = ''; - - // If the space parameter is a number, make an indent string containing that - // many spaces. - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - } - // If the space parameter is a string, it will be used as the indent string. - else if (typeof space === 'string') { - indent = space; - } - - // If there is a replacer, it must be a function or an array. - // Otherwise, throw an error. - rep = replacer; - if (replacer && typeof replacer !== 'function' - && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - - // Make a fake root object containing our value under the key of ''. - // Return the result of stringifying the value. - return str('', {'': value}); -}; -; - }).call(module.exports); - - __require.modules["/node_modules/jsonify/lib/stringify.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/index.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito"; - var __filename = "/node_modules/burrito/index.js"; - - var require = function (file) { - return __require(file, "/node_modules/burrito"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/index.js"]._cached = module.exports; - - (function () { - var uglify = require('uglify-js'); -var parser = uglify.parser; -var parse = function (expr) { - if (typeof expr !== 'string') throw 'expression should be a string'; - - //try { - var args = [].slice.call(arguments); - var ast = parser.parse.apply(null, args); - /* } - catch (err) { - if (err.message === undefined - || err.line === undefined - || err.col === undefined - || err.pos === undefined - ) { throw err } - - var e = new SyntaxError( - err.message - + '\n at line ' + err.line + ':' + err.col + ' in expression:\n\n' - + ' ' + expr.split(/\r?\n/)[err.line] - ); - - e.original = err; - e.line = err.line; - e.col = err.col; - e.pos = err.pos; - throw e; - } - */ - return ast; -}; - -var deparse = function (ast, b) { - return uglify.uglify.gen_code(ast, { beautify : b }); -}; - -var traverse = require('traverse'); -var vm = require('vm'); - -var burrito = module.exports = function (code, cb) { - var ast = Array_isArray(code) - ? code // already an ast - : parse(code.toString(), false, true) - ; - - var ast_ = traverse(ast).map(function mapper () { - wrapNode(this, cb); - }); - - return deparse(parse(deparse(ast_)), true); -}; - -var wrapNode = burrito.wrapNode = function (state, cb) { - var node = state.node; - - var ann = Array_isArray(node) && node[0] - && typeof node[0] === 'object' && node[0].name - ? node[0] - : null - ; - - if (!ann) return undefined; - - var self = { - name : ann.name, - node : node, - start : node[0].start, - end : node[0].end, - value : node.slice(1), - state : state - }; - - self.wrap = function (s) { - var subsrc = deparse( - traverse(node).map(function (x) { - if (!this.isRoot) wrapNode(this, cb) - }) - ); - - if (self.name === 'binary') { - var a = deparse(traverse(node[2]).map(function (x) { - if (!this.isRoot) wrapNode(this, cb) - })); - var b = deparse(traverse(node[3]).map(function (x) { - if (!this.isRoot) wrapNode(this, cb) - })); - } - - var src = ''; - - if (typeof s === 'function') { - if (self.name === 'binary') { - src = s(subsrc, a, b); - } - else { - src = s(subsrc); - } - } - else { - src = s.toString() - .replace(/%s/g, function () { - return subsrc - }) - ; - - if (self.name === 'binary') { - src = src - .replace(/%a/g, function () { return a }) - .replace(/%b/g, function () { return b }) - ; - } - } - - var expr = parse(src); - state.update(expr, true); - }; - - var cache = {}; - - self.parent = state.isRoot ? null : function () { - if (!cache.parent) { - var s = state; - var x; - do { - s = s.parent; - if (s) x = wrapNode(s); - } while (s && !x); - - cache.parent = x; - } - - return cache.parent; - }; - - self.source = function () { - if (!cache.source) cache.source = deparse(node); - return cache.source; - }; - - self.label = function () { - return burrito.label(self); - }; - - if (cb) cb.call(state, self); - - if (self.node[0].name === 'conditional') { - self.wrap('[%s][0]'); - } - - return self; -} - -burrito.microwave = function (code, context, cb) { - if (!cb) { cb = context; context = {} }; - if (!context) context = {}; - - var src = burrito(code, cb); - return vm.runInNewContext(src, context); -}; - -burrito.generateName = function (len) { - var name = ''; - var lower = '$'.charCodeAt(0); - var upper = 'z'.charCodeAt(0); - - while (name.length < len) { - var c = String.fromCharCode(Math.floor( - Math.random() * (upper - lower + 1) + lower - )); - if ((name + c).match(/^[A-Za-z_$][A-Za-z0-9_$]*$/)) name += c; - } - - return name; -}; - -burrito.parse = parse; -burrito.deparse = deparse; - -burrito.label = function (node) { - if (node.name === 'call') { - if (typeof node.value[0] === 'string') { - return node.value[0]; - } - else if (node.value[0] && typeof node.value[0][1] === 'string') { - return node.value[0][1]; - } - else { - return null; - } - } - else if (node.name === 'var') { - return node.value[0].map(function (x) { return x[0] }); - } - else if (node.name === 'defun') { - return node.value[0]; - } - else if (node.name === 'function') { - return node.value[0]; - } - else { - return null; - } -}; - -var Array_isArray = Array.isArray || function isArray (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; -; - }).call(module.exports); - - __require.modules["/node_modules/burrito/index.js"]._cached = module.exports; - return module.exports; -}; - -process.nextTick(function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/"; - var __filename = "//home/substack/projects/node-burrito/example/web"; - - var require = function (file) { - return __require(file, "/"); - }; - require.modules = __require.modules; - - var burrito = require('burrito'); -var json = require('jsonify'); - -var src = [ - 'function f () { g() }', - 'function g () { h() }', - 'function h () { throw "moo" + Array(x).join("!") }', - 'var x = 4', - 'f()' -].join('\r\n'); - -window.onload = function () { - burrito(src, function (node) { - document.body.innerHTML += node.name + '
\n'; - }); -}; -if (document.readyState === 'complete') window.onload(); -; -}); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/index.html b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/index.html deleted file mode 100644 index 66804fba..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -

-
-
diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/main.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/main.js
deleted file mode 100644
index cc81a8b7..00000000
--- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/main.js
+++ /dev/null
@@ -1,17 +0,0 @@
-var burrito = require('burrito');
-var json = require('jsonify');
-
-var src = [
-    'function f () { g() }',
-    'function g () { h() }',
-    'function h () { throw "moo" + Array(x).join("!") }',
-    'var x = 4',
-    'f()'
-].join('\r\n');
-
-window.onload = function () {
-    burrito(src, function (node) {
-        document.body.innerHTML += node.name + '
\n'; - }); -}; -if (document.readyState === 'complete') window.onload(); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/server.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/server.js deleted file mode 100644 index 6bce0206..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/web/server.js +++ /dev/null @@ -1,12 +0,0 @@ -var express = require('express'); -var browserify = require('browserify'); - -var app = express.createServer(); -app.use(express.static(__dirname)); -app.use(browserify({ - entry : __dirname + '/main.js', - watch : true, -})); - -app.listen(8081); -console.log('Listening on :8081'); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/wrap.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/wrap.js deleted file mode 100644 index 16424012..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/example/wrap.js +++ /dev/null @@ -1,7 +0,0 @@ -var burrito = require('burrito'); - -var src = burrito('f() && g(h())\nfoo()', function (node) { - if (node.name === 'call') node.wrap('qqq(%s)'); -}); - -console.log(src); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/index.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/index.js deleted file mode 100644 index 60ef5698..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/index.js +++ /dev/null @@ -1,208 +0,0 @@ -var uglify = require('uglify-js'); -var parser = uglify.parser; -var parse = function (expr) { - if (typeof expr !== 'string') throw 'expression should be a string'; - - try { - var ast = parser.parse.apply(null, arguments); - } - catch (err) { - if (err.message === undefined - || err.line === undefined - || err.col === undefined - || err.pos === undefined - ) { throw err } - - var e = new SyntaxError( - err.message - + '\n at line ' + err.line + ':' + err.col + ' in expression:\n\n' - + ' ' + expr.split(/\r?\n/)[err.line] - ); - - e.original = err; - e.line = err.line; - e.col = err.col; - e.pos = err.pos; - throw e; - } - return ast; -}; - -var deparse = function (ast, b) { - return uglify.uglify.gen_code(ast, { beautify : b }); -}; - -var traverse = require('traverse'); -var vm = require('vm'); - -var burrito = module.exports = function (code, cb) { - var ast = Array_isArray(code) - ? code // already an ast - : parse(code.toString(), false, true) - ; - - var ast_ = traverse(ast).map(function mapper () { - wrapNode(this, cb); - }); - - return deparse(parse(deparse(ast_)), true); -}; - -var wrapNode = burrito.wrapNode = function (state, cb) { - var node = state.node; - - var ann = Array_isArray(node) && node[0] - && typeof node[0] === 'object' && node[0].name - ? node[0] - : null - ; - - if (!ann) return undefined; - - var self = { - name : ann.name, - node : node, - start : node[0].start, - end : node[0].end, - value : node.slice(1), - state : state - }; - - self.wrap = function (s) { - var subsrc = deparse( - traverse(node).map(function (x) { - if (!this.isRoot) wrapNode(this, cb) - }) - ); - - if (self.name === 'binary') { - var a = deparse(traverse(node[2]).map(function (x) { - if (!this.isRoot) wrapNode(this, cb) - })); - var b = deparse(traverse(node[3]).map(function (x) { - if (!this.isRoot) wrapNode(this, cb) - })); - } - - var src = ''; - - if (typeof s === 'function') { - if (self.name === 'binary') { - src = s(subsrc, a, b); - } - else { - src = s(subsrc); - } - } - else { - src = s.toString() - .replace(/%s/g, function () { - return subsrc - }) - ; - - if (self.name === 'binary') { - src = src - .replace(/%a/g, function () { return a }) - .replace(/%b/g, function () { return b }) - ; - } - } - - var expr = parse(src); - state.update(expr, true); - }; - - var cache = {}; - - self.parent = state.isRoot ? null : function () { - if (!cache.parent) { - var s = state; - var x; - do { - s = s.parent; - if (s) x = wrapNode(s); - } while (s && !x); - - cache.parent = x; - } - - return cache.parent; - }; - - self.source = function () { - if (!cache.source) cache.source = deparse(node); - return cache.source; - }; - - self.label = function () { - return burrito.label(self); - }; - - if (cb) cb.call(state, self); - - if (self.node[0].name === 'conditional') { - self.wrap('[%s][0]'); - } - - return self; -} - -burrito.microwave = function (code, context, cb) { - if (!cb) { cb = context; context = {} }; - if (!context) context = {}; - - var src = burrito(code, cb); - return vm.runInNewContext(src, context); -}; - -burrito.generateName = function (len) { - var name = ''; - var lower = '$'.charCodeAt(0); - var upper = 'z'.charCodeAt(0); - - while (name.length < len) { - var c = String.fromCharCode(Math.floor( - Math.random() * (upper - lower + 1) + lower - )); - if ((name + c).match(/^[A-Za-z_$][A-Za-z0-9_$]*$/)) name += c; - } - - return name; -}; - -burrito.parse = parse; -burrito.deparse = deparse; - -burrito.label = function (node) { - if (node.name === 'call') { - if (typeof node.value[0] === 'string') { - return node.value[0]; - } - else if (node.value[0] && typeof node.value[0][1] === 'string') { - return node.value[0][1]; - } - else if (node.value[0][0] === 'dot') { - return node.value[0][node.value[0].length - 1]; - } - else { - return null; - } - } - else if (node.name === 'var') { - return node.value[0].map(function (x) { return x[0] }); - } - else if (node.name === 'defun') { - return node.value[0]; - } - else if (node.name === 'function') { - return node.value[0]; - } - else { - return null; - } -}; - -var Array_isArray = Array.isArray || function isArray (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/.bin/uglifyjs b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/.bin/uglifyjs deleted file mode 120000 index fef3468b..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/.bin/uglifyjs +++ /dev/null @@ -1 +0,0 @@ -../uglify-js/bin/uglifyjs \ No newline at end of file diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/.npmignore b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/.npmignore deleted file mode 100644 index 3c3629e6..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/LICENSE b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/LICENSE deleted file mode 100644 index 7b75500c..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: -http://www.opensource.org/licenses/mit-license.php - -Copyright 2010 James Halliday (mail@substack.net) - -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/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/README.markdown b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/README.markdown deleted file mode 100644 index f86ef769..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/README.markdown +++ /dev/null @@ -1,237 +0,0 @@ -traverse -======== - -Traverse and transform objects by visiting every node on a recursive walk. - -examples -======== - -transform negative numbers in-place ------------------------------------ - -negative.js - -````javascript -var traverse = require('traverse'); -var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - -traverse(obj).forEach(function (x) { - if (x < 0) this.update(x + 128); -}); - -console.dir(obj); -```` - -Output: - - [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ] - -collect leaf nodes ------------------- - -leaves.js - -````javascript -var traverse = require('traverse'); - -var obj = { - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 }, -}; - -var leaves = traverse(obj).reduce(function (acc, x) { - if (this.isLeaf) acc.push(x); - return acc; -}, []); - -console.dir(leaves); -```` - -Output: - - [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] - -scrub circular references -------------------------- - -scrub.js: - -````javascript -var traverse = require('traverse'); - -var obj = { a : 1, b : 2, c : [ 3, 4 ] }; -obj.c.push(obj); - -var scrubbed = traverse(obj).map(function (x) { - if (this.circular) this.remove() -}); -console.dir(scrubbed); -```` - -output: - - { a: 1, b: 2, c: [ 3, 4 ] } - -context -======= - -Each method that takes a callback has a context (its `this` object) with these -attributes: - -this.node ---------- - -The present node on the recursive walk - -this.path ---------- - -An array of string keys from the root to the present node - -this.parent ------------ - -The context of the node's parent. -This is `undefined` for the root node. - -this.key --------- - -The name of the key of the present node in its parent. -This is `undefined` for the root node. - -this.isRoot, this.notRoot -------------------------- - -Whether the present node is the root node - -this.isLeaf, this.notLeaf -------------------------- - -Whether or not the present node is a leaf node (has no children) - -this.level ----------- - -Depth of the node within the traversal - -this.circular -------------- - -If the node equals one of its parents, the `circular` attribute is set to the -context of that parent and the traversal progresses no deeper. - -this.update(value, stopHere=false) ----------------------------------- - -Set a new value for the present node. - -All the elements in `value` will be recursively traversed unless `stopHere` is -true. - -this.remove(stopHere=false) -------------- - -Remove the current element from the output. If the node is in an Array it will -be spliced off. Otherwise it will be deleted from its parent. - -this.delete(stopHere=false) -------------- - -Delete the current element from its parent in the output. Calls `delete` even on -Arrays. - -this.before(fn) ---------------- - -Call this function before any of the children are traversed. - -You can assign into `this.keys` here to traverse in a custom order. - -this.after(fn) --------------- - -Call this function after any of the children are traversed. - -this.pre(fn) ------------- - -Call this function before each of the children are traversed. - -this.post(fn) -------------- - -Call this function after each of the children are traversed. - -methods -======= - -.map(fn) --------- - -Execute `fn` for each node in the object and return a new object with the -results of the walk. To update nodes in the result use `this.update(value)`. - -.forEach(fn) ------------- - -Execute `fn` for each node in the object but unlike `.map()`, when -`this.update()` is called it updates the object in-place. - -.reduce(fn, acc) ----------------- - -For each node in the object, perform a -[left-fold](http://en.wikipedia.org/wiki/Fold_(higher-order_function)) -with the return value of `fn(acc, node)`. - -If `acc` isn't specified, `acc` is set to the root object for the first step -and the root element is skipped. - -.paths() --------- - -Return an `Array` of every possible non-cyclic path in the object. -Paths are `Array`s of string keys. - -.nodes() --------- - -Return an `Array` of every node in the object. - -.clone() --------- - -Create a deep clone of the object. - -install -======= - -Using [npm](http://npmjs.org) do: - - $ npm install traverse - -test -==== - -Using [expresso](http://github.com/visionmedia/expresso) do: - - $ expresso - - 100% wahoo, your stuff is not broken! - -in the browser -============== - -Use [browserify](https://github.com/substack/node-browserify) to run traverse in -the browser. - -traverse has been tested and works with: - -* Internet Explorer 5.5, 6.0, 7.0, 8.0, 9.0 -* Firefox 3.5 -* Chrome 6.0 -* Opera 10.6 -* Safari 5.0 diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/json.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/json.js deleted file mode 100755 index 50d612e3..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/json.js +++ /dev/null @@ -1,16 +0,0 @@ -var traverse = require('traverse'); - -var id = 54; -var callbacks = {}; -var obj = { moo : function () {}, foo : [2,3,4, function () {}] }; - -var scrubbed = traverse(obj).map(function (x) { - if (typeof x === 'function') { - callbacks[id] = { id : id, f : x, path : this.path }; - this.update('[Function]'); - id++; - } -}); - -console.dir(scrubbed); -console.dir(callbacks); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/leaves.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/leaves.js deleted file mode 100755 index c1b310b9..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/leaves.js +++ /dev/null @@ -1,15 +0,0 @@ -var traverse = require('traverse'); - -var obj = { - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 }, -}; - -var leaves = traverse(obj).reduce(function (acc, x) { - if (this.isLeaf) acc.push(x); - return acc; -}, []); - -console.dir(leaves); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/negative.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/negative.js deleted file mode 100755 index 78608a05..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/negative.js +++ /dev/null @@ -1,8 +0,0 @@ -var traverse = require('traverse'); -var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - -traverse(obj).forEach(function (x) { - if (x < 0) this.update(x + 128); -}); - -console.dir(obj); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/scrub.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/scrub.js deleted file mode 100755 index 5d15b916..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/scrub.js +++ /dev/null @@ -1,10 +0,0 @@ -// scrub out circular references -var traverse = require('traverse'); - -var obj = { a : 1, b : 2, c : [ 3, 4 ] }; -obj.c.push(obj); - -var scrubbed = traverse(obj).map(function (x) { - if (this.circular) this.remove() -}); -console.dir(scrubbed); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/stringify.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/stringify.js deleted file mode 100755 index 167b68b2..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/stringify.js +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env node -var traverse = require('traverse'); - -var obj = [ 'five', 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - -var s = ''; -traverse(obj).forEach(function to_s (node) { - if (Array.isArray(node)) { - this.before(function () { s += '[' }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += ']' }); - } - else if (typeof node == 'object') { - this.before(function () { s += '{' }); - this.pre(function (x, key) { - to_s(key); - s += ':'; - }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += '}' }); - } - else if (typeof node == 'string') { - s += '"' + node.toString().replace(/"/g, '\\"') + '"'; - } - else if (typeof node == 'function') { - s += 'null'; - } - else { - s += node.toString(); - } -}); - -console.log('JSON.stringify: ' + JSON.stringify(obj)); -console.log('this stringify: ' + s); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/index.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/index.js deleted file mode 100644 index 038a1ada..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/index.js +++ /dev/null @@ -1,267 +0,0 @@ -module.exports = Traverse; -function Traverse (obj) { - if (!(this instanceof Traverse)) return new Traverse(obj); - this.value = obj; -} - -Traverse.prototype.get = function (ps) { - var node = this.value; - for (var i = 0; i < ps.length; i ++) { - var key = ps[i]; - if (!Object.hasOwnProperty.call(node, key)) { - node = undefined; - break; - } - node = node[key]; - } - return node; -}; - -Traverse.prototype.set = function (ps, value) { - var node = this.value; - for (var i = 0; i < ps.length - 1; i ++) { - var key = ps[i]; - if (!Object.hasOwnProperty.call(node, key)) node[key] = {}; - node = node[key]; - } - node[ps[i]] = value; - return value; -}; - -Traverse.prototype.map = function (cb) { - return walk(this.value, cb, true); -}; - -Traverse.prototype.forEach = function (cb) { - this.value = walk(this.value, cb, false); - return this.value; -}; - -Traverse.prototype.reduce = function (cb, init) { - var skip = arguments.length === 1; - var acc = skip ? this.value : init; - this.forEach(function (x) { - if (!this.isRoot || !skip) { - acc = cb.call(this, acc, x); - } - }); - return acc; -}; - -Traverse.prototype.paths = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.path); - }); - return acc; -}; - -Traverse.prototype.nodes = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.node); - }); - return acc; -}; - -Traverse.prototype.clone = function () { - var parents = [], nodes = []; - - return (function clone (src) { - for (var i = 0; i < parents.length; i++) { - if (parents[i] === src) { - return nodes[i]; - } - } - - if (typeof src === 'object' && src !== null) { - var dst = copy(src); - - parents.push(src); - nodes.push(dst); - - forEach(Object_keys(src), function (key) { - dst[key] = clone(src[key]); - }); - - parents.pop(); - nodes.pop(); - return dst; - } - else { - return src; - } - })(this.value); -}; - -function walk (root, cb, immutable) { - var path = []; - var parents = []; - var alive = true; - - return (function walker (node_) { - var node = immutable ? copy(node_) : node_; - var modifiers = {}; - - var keepGoing = true; - - var state = { - node : node, - node_ : node_, - path : [].concat(path), - parent : parents[parents.length - 1], - parents : parents, - key : path.slice(-1)[0], - isRoot : path.length === 0, - level : path.length, - circular : null, - update : function (x, stopHere) { - if (!state.isRoot) { - state.parent.node[state.key] = x; - } - state.node = x; - if (stopHere) keepGoing = false; - }, - 'delete' : function (stopHere) { - delete state.parent.node[state.key]; - if (stopHere) keepGoing = false; - }, - remove : function (stopHere) { - if (Array_isArray(state.parent.node)) { - state.parent.node.splice(state.key, 1); - } - else { - delete state.parent.node[state.key]; - } - if (stopHere) keepGoing = false; - }, - keys : null, - before : function (f) { modifiers.before = f }, - after : function (f) { modifiers.after = f }, - pre : function (f) { modifiers.pre = f }, - post : function (f) { modifiers.post = f }, - stop : function () { alive = false }, - block : function () { keepGoing = false } - }; - - if (!alive) return state; - - if (typeof node === 'object' && node !== null) { - state.keys = Object_keys(node); - - state.isLeaf = state.keys.length == 0; - - for (var i = 0; i < parents.length; i++) { - if (parents[i].node_ === node_) { - state.circular = parents[i]; - break; - } - } - } - else { - state.isLeaf = true; - } - - state.notLeaf = !state.isLeaf; - state.notRoot = !state.isRoot; - - // use return values to update if defined - var ret = cb.call(state, state.node); - if (ret !== undefined && state.update) state.update(ret); - - if (modifiers.before) modifiers.before.call(state, state.node); - - if (!keepGoing) return state; - - if (typeof state.node == 'object' - && state.node !== null && !state.circular) { - parents.push(state); - - forEach(state.keys, function (key, i) { - path.push(key); - - if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); - - var child = walker(state.node[key]); - if (immutable && Object.hasOwnProperty.call(state.node, key)) { - state.node[key] = child.node; - } - - child.isLast = i == state.keys.length - 1; - child.isFirst = i == 0; - - if (modifiers.post) modifiers.post.call(state, child); - - path.pop(); - }); - parents.pop(); - } - - if (modifiers.after) modifiers.after.call(state, state.node); - - return state; - })(root).node; -} - -function copy (src) { - if (typeof src === 'object' && src !== null) { - var dst; - - if (Array_isArray(src)) { - dst = []; - } - else if (src instanceof Date) { - dst = new Date(src); - } - else if (src instanceof Boolean) { - dst = new Boolean(src); - } - else if (src instanceof Number) { - dst = new Number(src); - } - else if (src instanceof String) { - dst = new String(src); - } - else if (Object.create && Object.getPrototypeOf) { - dst = Object.create(Object.getPrototypeOf(src)); - } - else if (src.__proto__ || src.constructor.prototype) { - var proto = src.__proto__ || src.constructor.prototype || {}; - var T = function () {}; - T.prototype = proto; - dst = new T; - if (!dst.__proto__) dst.__proto__ = proto; - } - - forEach(Object_keys(src), function (key) { - dst[key] = src[key]; - }); - return dst; - } - else return src; -} - -var Object_keys = Object.keys || function keys (obj) { - var res = []; - for (var key in obj) res.push(key) - return res; -}; - -var Array_isArray = Array.isArray || function isArray (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - -var forEach = function (xs, fn) { - if (xs.forEach) return xs.forEach(fn) - else for (var i = 0; i < xs.length; i++) { - fn(xs[i], i, xs); - } -}; - -forEach(Object_keys(Traverse.prototype), function (key) { - Traverse[key] = function (obj) { - var args = [].slice.call(arguments, 1); - var t = Traverse(obj); - return t[key].apply(t, args); - }; -}); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/main.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/main.js deleted file mode 100755 index d562d379..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/main.js +++ /dev/null @@ -1,10 +0,0 @@ -// scrub out circular references -var traverse = require('./index.js'); - -var obj = { a : 1, b : 2, c : [ 3, 4 ] }; -obj.c.push(obj); - -var scrubbed = traverse(obj).map(function (x) { - if (this.circular) this.remove() -}); -console.dir(scrubbed); diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/package.json b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/package.json deleted file mode 100644 index 7c86426a..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "traverse", - "version": "0.5.2", - "description": "Traverse and transform objects by visiting every node on a recursive walk", - "author": { - "name": "James Halliday" - }, - "license": "MIT/X11", - "main": "./index", - "repository": { - "type": "git", - "url": "git://github.com/substack/js-traverse.git" - }, - "devDependencies": { - "expresso": "0.7.x" - }, - "scripts": { - "test": "expresso" - }, - "_npmJsonOpts": { - "file": "/home/substack/.npm/traverse/0.5.2/package/package.json", - "wscript": false, - "contributors": false, - "serverjs": false - }, - "_id": "traverse@0.5.2", - "dependencies": {}, - "engines": { - "node": "*" - }, - "_engineSupported": true, - "_npmVersion": "1.0.30", - "_nodeVersion": "v0.4.12", - "_defaultsLoaded": true, - "dist": { - "shasum": "e203c58d5f7f0e37db6e74c0acb929bb09b61d85", - "tarball": "http://registry.npmjs.org/traverse/-/traverse-0.5.2.tgz" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, - "_shasum": "e203c58d5f7f0e37db6e74c0acb929bb09b61d85", - "_from": "traverse@>=0.5.1 <0.6.0", - "_resolved": "https://registry.npmjs.org/traverse/-/traverse-0.5.2.tgz", - "bugs": { - "url": "https://github.com/substack/js-traverse/issues" - }, - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/substack/js-traverse#readme" -} diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/circular.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/circular.js deleted file mode 100644 index 91626011..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/circular.js +++ /dev/null @@ -1,115 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); -var deepEqual = require('./lib/deep_equal'); -var util = require('util'); - -exports.circular = function () { - var obj = { x : 3 }; - obj.y = obj; - var foundY = false; - Traverse(obj).forEach(function (x) { - if (this.path.join('') == 'y') { - assert.equal( - util.inspect(this.circular.node), - util.inspect(obj) - ); - foundY = true; - } - }); - assert.ok(foundY); -}; - -exports.deepCirc = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - - var times = 0; - Traverse(obj).forEach(function (x) { - if (this.circular) { - assert.deepEqual(this.circular.path, []); - assert.deepEqual(this.path, [ 'y', 2 ]); - times ++; - } - }); - - assert.deepEqual(times, 1); -}; - -exports.doubleCirc = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - var circs = []; - Traverse(obj).forEach(function (x) { - if (this.circular) { - circs.push({ circ : this.circular, self : this, node : x }); - } - }); - - assert.deepEqual(circs[0].self.path, [ 'x', 3, 2 ]); - assert.deepEqual(circs[0].circ.path, []); - - assert.deepEqual(circs[1].self.path, [ 'y', 2 ]); - assert.deepEqual(circs[1].circ.path, []); - - assert.deepEqual(circs.length, 2); -}; - -exports.circDubForEach = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - Traverse(obj).forEach(function (x) { - if (this.circular) this.update('...'); - }); - - assert.deepEqual(obj, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] }); -}; - -exports.circDubMap = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - var c = Traverse(obj).map(function (x) { - if (this.circular) { - this.update('...'); - } - }); - - assert.deepEqual(c, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] }); -}; - -exports.circClone = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - var clone = Traverse.clone(obj); - assert.ok(obj !== clone); - - assert.ok(clone.y[2] === clone); - assert.ok(clone.y[2] !== obj); - assert.ok(clone.x[3][2] === clone); - assert.ok(clone.x[3][2] !== obj); - assert.deepEqual(clone.x.slice(0,3), [1,2,3]); - assert.deepEqual(clone.y.slice(0,2), [4,5]); -}; - -exports.circMapScrub = function () { - var obj = { a : 1, b : 2 }; - obj.c = obj; - - var scrubbed = Traverse(obj).map(function (node) { - if (this.circular) this.remove(); - }); - assert.deepEqual( - Object.keys(scrubbed).sort(), - [ 'a', 'b' ] - ); - assert.ok(deepEqual(scrubbed, { a : 1, b : 2 })); - - assert.equal(obj.c, obj); -}; diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/date.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/date.js deleted file mode 100644 index 4ca06dc3..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/date.js +++ /dev/null @@ -1,35 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports.dateEach = function () { - var obj = { x : new Date, y : 10, z : 5 }; - - var counts = {}; - - Traverse(obj).forEach(function (node) { - var t = (node instanceof Date && 'Date') || typeof node; - counts[t] = (counts[t] || 0) + 1; - }); - - assert.deepEqual(counts, { - object : 1, - Date : 1, - number : 2, - }); -}; - -exports.dateMap = function () { - var obj = { x : new Date, y : 10, z : 5 }; - - var res = Traverse(obj).map(function (node) { - if (typeof node === 'number') this.update(node + 100); - }); - - assert.ok(obj.x !== res.x); - assert.deepEqual(res, { - x : obj.x, - y : 110, - z : 105, - }); -}; - diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/equal.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/equal.js deleted file mode 100644 index decc7550..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/equal.js +++ /dev/null @@ -1,220 +0,0 @@ -var assert = require('assert'); -var traverse = require('../'); -var deepEqual = require('./lib/deep_equal'); - -exports.deepDates = function () { - assert.ok( - deepEqual( - { d : new Date, x : [ 1, 2, 3 ] }, - { d : new Date, x : [ 1, 2, 3 ] } - ), - 'dates should be equal' - ); - - var d0 = new Date; - setTimeout(function () { - assert.ok( - !deepEqual( - { d : d0, x : [ 1, 2, 3 ], }, - { d : new Date, x : [ 1, 2, 3 ] } - ), - 'microseconds should count in date equality' - ); - }, 5); -}; - -exports.deepCircular = function () { - var a = [1]; - a.push(a); // a = [ 1, *a ] - - var b = [1]; - b.push(a); // b = [ 1, [ 1, *a ] ] - - assert.ok( - !deepEqual(a, b), - 'circular ref mount points count towards equality' - ); - - var c = [1]; - c.push(c); // c = [ 1, *c ] - assert.ok( - deepEqual(a, c), - 'circular refs are structurally the same here' - ); - - var d = [1]; - d.push(a); // c = [ 1, [ 1, *d ] ] - assert.ok( - deepEqual(b, d), - 'non-root circular ref structural comparison' - ); -}; - -exports.deepInstances = function () { - assert.ok( - !deepEqual([ new Boolean(false) ], [ false ]), - 'boolean instances are not real booleans' - ); - - assert.ok( - !deepEqual([ new String('x') ], [ 'x' ]), - 'string instances are not real strings' - ); - - assert.ok( - !deepEqual([ new Number(4) ], [ 4 ]), - 'number instances are not real numbers' - ); - - assert.ok( - deepEqual([ new RegExp('x') ], [ /x/ ]), - 'regexp instances are real regexps' - ); - - assert.ok( - !deepEqual([ new RegExp(/./) ], [ /../ ]), - 'these regexps aren\'t the same' - ); - - assert.ok( - !deepEqual( - [ function (x) { return x * 2 } ], - [ function (x) { return x * 2 } ] - ), - 'functions with the same .toString() aren\'t necessarily the same' - ); - - var f = function (x) { return x * 2 }; - assert.ok( - deepEqual([ f ], [ f ]), - 'these functions are actually equal' - ); -}; - -exports.deepEqual = function () { - assert.ok( - !deepEqual([ 1, 2, 3 ], { 0 : 1, 1 : 2, 2 : 3 }), - 'arrays are not objects' - ); -}; - -exports.falsy = function () { - assert.ok( - !deepEqual([ undefined ], [ null ]), - 'null is not undefined!' - ); - - assert.ok( - !deepEqual([ null ], [ undefined ]), - 'undefined is not null!' - ); - - assert.ok( - !deepEqual( - { a : 1, b : 2, c : [ 3, undefined, 5 ] }, - { a : 1, b : 2, c : [ 3, null, 5 ] } - ), - 'undefined is not null, however deeply!' - ); - - assert.ok( - !deepEqual( - { a : 1, b : 2, c : [ 3, undefined, 5 ] }, - { a : 1, b : 2, c : [ 3, null, 5 ] } - ), - 'null is not undefined, however deeply!' - ); - - assert.ok( - !deepEqual( - { a : 1, b : 2, c : [ 3, undefined, 5 ] }, - { a : 1, b : 2, c : [ 3, null, 5 ] } - ), - 'null is not undefined, however deeply!' - ); -}; - -exports.deletedArrayEqual = function () { - var xs = [ 1, 2, 3, 4 ]; - delete xs[2]; - - var ys = Object.create(Array.prototype); - ys[0] = 1; - ys[1] = 2; - ys[3] = 4; - - assert.ok( - deepEqual(xs, ys), - 'arrays with deleted elements are only equal to' - + ' arrays with similarly deleted elements' - ); - - assert.ok( - !deepEqual(xs, [ 1, 2, undefined, 4 ]), - 'deleted array elements cannot be undefined' - ); - - assert.ok( - !deepEqual(xs, [ 1, 2, null, 4 ]), - 'deleted array elements cannot be null' - ); -}; - -exports.deletedObjectEqual = function () { - var obj = { a : 1, b : 2, c : 3 }; - delete obj.c; - - assert.ok( - deepEqual(obj, { a : 1, b : 2 }), - 'deleted object elements should not show up' - ); - - assert.ok( - !deepEqual(obj, { a : 1, b : 2, c : undefined }), - 'deleted object elements are not undefined' - ); - - assert.ok( - !deepEqual(obj, { a : 1, b : 2, c : null }), - 'deleted object elements are not null' - ); -}; - -exports.emptyKeyEqual = function () { - assert.ok(!deepEqual( - { a : 1 }, { a : 1, '' : 55 } - )); -}; - -exports.deepArguments = function () { - assert.ok( - !deepEqual( - [ 4, 5, 6 ], - (function () { return arguments })(4, 5, 6) - ), - 'arguments are not arrays' - ); - - assert.ok( - deepEqual( - (function () { return arguments })(4, 5, 6), - (function () { return arguments })(4, 5, 6) - ), - 'arguments should equal' - ); -}; - -exports.deepUn = function () { - assert.ok(!deepEqual({ a : 1, b : 2 }, undefined)); - assert.ok(!deepEqual({ a : 1, b : 2 }, {})); - assert.ok(!deepEqual(undefined, { a : 1, b : 2 })); - assert.ok(!deepEqual({}, { a : 1, b : 2 })); - assert.ok(deepEqual(undefined, undefined)); - assert.ok(deepEqual(null, null)); - assert.ok(!deepEqual(undefined, null)); -}; - -exports.deepLevels = function () { - var xs = [ 1, 2, [ 3, 4, [ 5, 6 ] ] ]; - assert.ok(!deepEqual(xs, [])); -}; diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/instance.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/instance.js deleted file mode 100644 index 8d735256..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/instance.js +++ /dev/null @@ -1,17 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); -var EventEmitter = require('events').EventEmitter; - -exports['check instanceof on node elems'] = function () { - - var counts = { emitter : 0 }; - - Traverse([ new EventEmitter, 3, 4, { ev : new EventEmitter }]) - .forEach(function (node) { - if (node instanceof EventEmitter) counts.emitter ++; - }) - ; - - assert.equal(counts.emitter, 2); -}; - diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/interface.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/interface.js deleted file mode 100644 index fce5bf9a..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/interface.js +++ /dev/null @@ -1,42 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports['interface map'] = function () { - var obj = { a : [ 5,6,7 ], b : { c : [8] } }; - - assert.deepEqual( - Traverse.paths(obj) - .sort() - .map(function (path) { return path.join('/') }) - .slice(1) - .join(' ') - , - 'a a/0 a/1 a/2 b b/c b/c/0' - ); - - assert.deepEqual( - Traverse.nodes(obj), - [ - { a: [ 5, 6, 7 ], b: { c: [ 8 ] } }, - [ 5, 6, 7 ], 5, 6, 7, - { c: [ 8 ] }, [ 8 ], 8 - ] - ); - - assert.deepEqual( - Traverse.map(obj, function (node) { - if (typeof node == 'number') { - return node + 1000; - } - else if (Array.isArray(node)) { - return node.join(' '); - } - }), - { a: '5 6 7', b: { c: '8' } } - ); - - var nodes = 0; - Traverse.forEach(obj, function (node) { nodes ++ }); - assert.deepEqual(nodes, 8); -}; - diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/json.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/json.js deleted file mode 100644 index 0a045293..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/json.js +++ /dev/null @@ -1,47 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports['json test'] = function () { - var id = 54; - var callbacks = {}; - var obj = { moo : function () {}, foo : [2,3,4, function () {}] }; - - var scrubbed = Traverse(obj).map(function (x) { - if (typeof x === 'function') { - callbacks[id] = { id : id, f : x, path : this.path }; - this.update('[Function]'); - id++; - } - }); - - assert.equal( - scrubbed.moo, '[Function]', - 'obj.moo replaced with "[Function]"' - ); - - assert.equal( - scrubbed.foo[3], '[Function]', - 'obj.foo[3] replaced with "[Function]"' - ); - - assert.deepEqual(scrubbed, { - moo : '[Function]', - foo : [ 2, 3, 4, "[Function]" ] - }, 'Full JSON string matches'); - - assert.deepEqual( - typeof obj.moo, 'function', - 'Original obj.moo still a function' - ); - - assert.deepEqual( - typeof obj.foo[3], 'function', - 'Original obj.foo[3] still a function' - ); - - assert.deepEqual(callbacks, { - 54: { id: 54, f : obj.moo, path: [ 'moo' ] }, - 55: { id: 55, f : obj.foo[3], path: [ 'foo', '3' ] }, - }, 'Check the generated callbacks list'); -}; - diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/keys.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/keys.js deleted file mode 100644 index 7ecd545e..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/keys.js +++ /dev/null @@ -1,29 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports['sort test'] = function () { - var acc = []; - Traverse({ - a: 30, - b: 22, - id: 9 - }).forEach(function (node) { - if ((! Array.isArray(node)) && typeof node === 'object') { - this.before(function(node) { - this.keys = Object.keys(node); - this.keys.sort(function(a, b) { - a = [a === "id" ? 0 : 1, a]; - b = [b === "id" ? 0 : 1, b]; - return a < b ? -1 : a > b ? 1 : 0; - }); - }); - } - if (this.isLeaf) acc.push(node); - }); - - assert.equal( - acc.join(' '), - '9 30 22', - 'Traversal in a custom order' - ); -}; diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/leaves.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/leaves.js deleted file mode 100644 index e520b72e..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/leaves.js +++ /dev/null @@ -1,21 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports['leaves test'] = function () { - var acc = []; - Traverse({ - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 } - }).forEach(function (x) { - if (this.isLeaf) acc.push(x); - }); - - assert.equal( - acc.join(' '), - '1 2 3 4 5 6 7 8 9', - 'Traversal in the right(?) order' - ); -}; - diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/lib/deep_equal.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/lib/deep_equal.js deleted file mode 100644 index 4fa07bb8..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/lib/deep_equal.js +++ /dev/null @@ -1,92 +0,0 @@ -var traverse = require('../../'); - -module.exports = function (a, b) { - if (arguments.length !== 2) { - throw new Error( - 'deepEqual requires exactly two objects to compare against' - ); - } - - var equal = true; - var node = b; - - traverse(a).forEach(function (y) { - var notEqual = (function () { - equal = false; - //this.stop(); - return undefined; - }).bind(this); - - //if (node === undefined || node === null) return notEqual(); - - if (!this.isRoot) { - /* - if (!Object.hasOwnProperty.call(node, this.key)) { - return notEqual(); - } - */ - if (typeof node !== 'object') return notEqual(); - node = node[this.key]; - } - - var x = node; - - this.post(function () { - node = x; - }); - - var toS = function (o) { - return Object.prototype.toString.call(o); - }; - - if (this.circular) { - if (traverse(b).get(this.circular.path) !== x) notEqual(); - } - else if (typeof x !== typeof y) { - notEqual(); - } - else if (x === null || y === null || x === undefined || y === undefined) { - if (x !== y) notEqual(); - } - else if (x.__proto__ !== y.__proto__) { - notEqual(); - } - else if (x === y) { - // nop - } - else if (typeof x === 'function') { - if (x instanceof RegExp) { - // both regexps on account of the __proto__ check - if (x.toString() != y.toString()) notEqual(); - } - else if (x !== y) notEqual(); - } - else if (typeof x === 'object') { - if (toS(y) === '[object Arguments]' - || toS(x) === '[object Arguments]') { - if (toS(x) !== toS(y)) { - notEqual(); - } - } - else if (x instanceof Date || y instanceof Date) { - if (!(x instanceof Date) || !(y instanceof Date) - || x.getTime() !== y.getTime()) { - notEqual(); - } - } - else { - var kx = Object.keys(x); - var ky = Object.keys(y); - if (kx.length !== ky.length) return notEqual(); - for (var i = 0; i < kx.length; i++) { - var k = kx[i]; - if (!Object.hasOwnProperty.call(y, k)) { - notEqual(); - } - } - } - } - }); - - return equal; -}; diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/mutability.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/mutability.js deleted file mode 100644 index 2236f563..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/mutability.js +++ /dev/null @@ -1,252 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); -var deepEqual = require('./lib/deep_equal'); - -exports.mutate = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).forEach(function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - assert.deepEqual(obj, res); - assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] }); -}; - -exports.mutateT = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse.forEach(obj, function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - assert.deepEqual(obj, res); - assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] }); -}; - -exports.map = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).map(function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] }); -}; - -exports.mapT = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse.map(obj, function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] }); -}; - -exports.clone = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).clone(); - assert.deepEqual(obj, res); - assert.ok(obj !== res); - obj.a ++; - assert.deepEqual(res.a, 1); - obj.c.push(5); - assert.deepEqual(res.c, [ 3, 4 ]); -}; - -exports.cloneT = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse.clone(obj); - assert.deepEqual(obj, res); - assert.ok(obj !== res); - obj.a ++; - assert.deepEqual(res.a, 1); - obj.c.push(5); - assert.deepEqual(res.c, [ 3, 4 ]); -}; - -exports.reduce = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).reduce(function (acc, x) { - if (this.isLeaf) acc.push(x); - return acc; - }, []); - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, [ 1, 2, 3, 4 ]); -}; - -exports.reduceInit = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).reduce(function (acc, x) { - if (this.isRoot) assert.fail('got root'); - return acc; - }); - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, obj); -}; - -exports.remove = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - Traverse(obj).forEach(function (x) { - if (this.isLeaf && x % 2 == 0) this.remove(); - }); - - assert.deepEqual(obj, { a : 1, c : [ 3 ] }); -}; - -exports.removeNoStop = function() { - var obj = { a : 1, b : 2, c : { d: 3, e: 4 }, f: 5 }; - - var keys = []; - Traverse(obj).forEach(function (x) { - keys.push(this.key) - if (this.key == 'c') this.remove(); - }); - - assert.deepEqual(keys, [undefined, 'a', 'b', 'c', 'd', 'e', 'f']) -} - -exports.removeStop = function() { - var obj = { a : 1, b : 2, c : { d: 3, e: 4 }, f: 5 }; - - var keys = []; - Traverse(obj).forEach(function (x) { - keys.push(this.key) - if (this.key == 'c') this.remove(true); - }); - - assert.deepEqual(keys, [undefined, 'a', 'b', 'c', 'f']) -} - -exports.removeMap = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).map(function (x) { - if (this.isLeaf && x % 2 == 0) this.remove(); - }); - - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, { a : 1, c : [ 3 ] }); -}; - -exports.delete = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - Traverse(obj).forEach(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - assert.ok(!deepEqual( - obj, { a : 1, c : [ 3, undefined ] } - )); - - assert.ok(deepEqual( - obj, { a : 1, c : [ 3 ] } - )); - - assert.ok(!deepEqual( - obj, { a : 1, c : [ 3, null ] } - )); -}; - -exports.deleteNoStop = function() { - var obj = { a : 1, b : 2, c : { d: 3, e: 4 } }; - - var keys = []; - Traverse(obj).forEach(function (x) { - keys.push(this.key) - if (this.key == 'c') this.delete(); - }); - - assert.deepEqual(keys, [undefined, 'a', 'b', 'c', 'd', 'e']) -} - -exports.deleteStop = function() { - var obj = { a : 1, b : 2, c : { d: 3, e: 4 } }; - - var keys = []; - Traverse(obj).forEach(function (x) { - keys.push(this.key) - if (this.key == 'c') this.delete(true); - }); - - assert.deepEqual(keys, [undefined, 'a', 'b', 'c']) -} - -exports.deleteRedux = function () { - var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] }; - Traverse(obj).forEach(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - assert.ok(!deepEqual( - obj, { a : 1, c : [ 3, undefined, 5 ] } - )); - - assert.ok(deepEqual( - obj, { a : 1, c : [ 3 ,, 5 ] } - )); - - assert.ok(!deepEqual( - obj, { a : 1, c : [ 3, null, 5 ] } - )); - - assert.ok(!deepEqual( - obj, { a : 1, c : [ 3, 5 ] } - )); -}; - -exports.deleteMap = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).map(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - assert.ok(deepEqual( - obj, - { a : 1, b : 2, c : [ 3, 4 ] } - )); - - var xs = [ 3, 4 ]; - delete xs[1]; - - assert.ok(deepEqual( - res, { a : 1, c : xs } - )); - - assert.ok(deepEqual( - res, { a : 1, c : [ 3, ] } - )); - - assert.ok(deepEqual( - res, { a : 1, c : [ 3 ] } - )); -}; - -exports.deleteMapRedux = function () { - var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] }; - var res = Traverse(obj).map(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - assert.ok(deepEqual( - obj, - { a : 1, b : 2, c : [ 3, 4, 5 ] } - )); - - var xs = [ 3, 4, 5 ]; - delete xs[1]; - - assert.ok(deepEqual( - res, { a : 1, c : xs } - )); - - assert.ok(!deepEqual( - res, { a : 1, c : [ 3, 5 ] } - )); - - assert.ok(deepEqual( - res, { a : 1, c : [ 3 ,, 5 ] } - )); -}; diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/negative.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/negative.js deleted file mode 100644 index f92dfb07..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/negative.js +++ /dev/null @@ -1,20 +0,0 @@ -var Traverse = require('../'); -var assert = require('assert'); - -exports['negative update test'] = function () { - var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - var fixed = Traverse.map(obj, function (x) { - if (x < 0) this.update(x + 128); - }); - - assert.deepEqual(fixed, - [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ], - 'Negative values += 128' - ); - - assert.deepEqual(obj, - [ 5, 6, -3, [ 7, 8, -2, 1 ], { f: 10, g: -13 } ], - 'Original references not modified' - ); -} - diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/obj.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/obj.js deleted file mode 100644 index d46fd38a..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/obj.js +++ /dev/null @@ -1,15 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports['traverse an object with nested functions'] = function () { - var to = setTimeout(function () { - assert.fail('never ran'); - }, 1000); - - function Cons (x) { - clearTimeout(to); - assert.equal(x, 10); - }; - Traverse(new Cons(10)); -}; - diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/siblings.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/siblings.js deleted file mode 100644 index 99c0f1b2..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/siblings.js +++ /dev/null @@ -1,35 +0,0 @@ -var assert = require('assert'); -var traverse = require('../'); - -exports.siblings = function () { - var obj = { a : 1, b : 2, c : [ 4, 5, 6 ] }; - - var res = traverse(obj).reduce(function (acc, x) { - var p = '/' + this.path.join('/'); - if (this.parent) { - acc[p] = { - siblings : this.parent.keys, - key : this.key, - index : this.parent.keys.indexOf(this.key) - }; - } - else { - acc[p] = { - siblings : [], - key : this.key, - index : -1 - } - } - return acc; - }, {}); - - assert.deepEqual(res, { - '/' : { siblings : [], key : undefined, index : -1 }, - '/a' : { siblings : [ 'a', 'b', 'c' ], key : 'a', index : 0 }, - '/b' : { siblings : [ 'a', 'b', 'c' ], key : 'b', index : 1 }, - '/c' : { siblings : [ 'a', 'b', 'c' ], key : 'c', index : 2 }, - '/c/0' : { siblings : [ '0', '1', '2' ], key : '0', index : 0 }, - '/c/1' : { siblings : [ '0', '1', '2' ], key : '1', index : 1 }, - '/c/2' : { siblings : [ '0', '1', '2' ], key : '2', index : 2 } - }); -}; diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stop.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stop.js deleted file mode 100644 index 3529847d..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stop.js +++ /dev/null @@ -1,41 +0,0 @@ -var assert = require('assert'); -var traverse = require('../'); - -exports.stop = function () { - var visits = 0; - traverse('abcdefghij'.split('')).forEach(function (node) { - if (typeof node === 'string') { - visits ++; - if (node === 'e') this.stop() - } - }); - - assert.equal(visits, 5); -}; - -exports.stopMap = function () { - var s = traverse('abcdefghij'.split('')).map(function (node) { - if (typeof node === 'string') { - if (node === 'e') this.stop() - return node.toUpperCase(); - } - }).join(''); - - assert.equal(s, 'ABCDEfghij'); -}; - -exports.stopReduce = function () { - var obj = { - a : [ 4, 5 ], - b : [ 6, [ 7, 8, 9 ] ] - }; - var xs = traverse(obj).reduce(function (acc, node) { - if (this.isLeaf) { - if (node === 7) this.stop(); - else acc.push(node) - } - return acc; - }, []); - - assert.deepEqual(xs, [ 4, 5, 6 ]); -}; diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stringify.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stringify.js deleted file mode 100644 index 932f5d3c..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stringify.js +++ /dev/null @@ -1,36 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports.stringify = function () { - var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - - var s = ''; - Traverse(obj).forEach(function (node) { - if (Array.isArray(node)) { - this.before(function () { s += '[' }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += ']' }); - } - else if (typeof node == 'object') { - this.before(function () { s += '{' }); - this.pre(function (x, key) { - s += '"' + key + '"' + ':'; - }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += '}' }); - } - else if (typeof node == 'function') { - s += 'null'; - } - else { - s += node.toString(); - } - }); - - assert.equal(s, JSON.stringify(obj)); -} - diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/subexpr.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/subexpr.js deleted file mode 100644 index a217beba..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/subexpr.js +++ /dev/null @@ -1,34 +0,0 @@ -var traverse = require('../'); -var assert = require('assert'); - -exports.subexpr = function () { - var obj = [ 'a', 4, 'b', 5, 'c', 6 ]; - var r = traverse(obj).map(function (x) { - if (typeof x === 'number') { - this.update([ x - 0.1, x, x + 0.1 ], true); - } - }); - - assert.deepEqual(obj, [ 'a', 4, 'b', 5, 'c', 6 ]); - assert.deepEqual(r, [ - 'a', [ 3.9, 4, 4.1 ], - 'b', [ 4.9, 5, 5.1 ], - 'c', [ 5.9, 6, 6.1 ], - ]); -}; - -exports.block = function () { - var obj = [ [ 1 ], [ 2 ], [ 3 ] ]; - var r = traverse(obj).map(function (x) { - if (Array.isArray(x) && !this.isRoot) { - if (x[0] === 5) this.block() - else this.update([ [ x[0] + 1 ] ]) - } - }); - - assert.deepEqual(r, [ - [ [ [ [ [ 5 ] ] ] ] ], - [ [ [ [ 5 ] ] ] ], - [ [ [ 5 ] ] ], - ]); -}; diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/super_deep.js b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/super_deep.js deleted file mode 100644 index acac2fd9..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/super_deep.js +++ /dev/null @@ -1,55 +0,0 @@ -var assert = require('assert'); -var traverse = require('../'); -var deepEqual = require('./lib/deep_equal'); - -exports.super_deep = function () { - var util = require('util'); - var a0 = make(); - var a1 = make(); - assert.ok(deepEqual(a0, a1)); - - a0.c.d.moo = true; - assert.ok(!deepEqual(a0, a1)); - - a1.c.d.moo = true; - assert.ok(deepEqual(a0, a1)); - - // TODO: this one - //a0.c.a = a1; - //assert.ok(!deepEqual(a0, a1)); -}; - -function make () { - var a = { self : 'a' }; - var b = { self : 'b' }; - var c = { self : 'c' }; - var d = { self : 'd' }; - var e = { self : 'e' }; - - a.a = a; - a.b = b; - a.c = c; - - b.a = a; - b.b = b; - b.c = c; - - c.a = a; - c.b = b; - c.c = c; - c.d = d; - - d.a = a; - d.b = b; - d.c = c; - d.d = d; - d.e = e; - - e.a = a; - e.b = b; - e.c = c; - e.d = d; - e.e = e; - - return a; -} diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/.npmignore b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/.npmignore deleted file mode 100644 index d97eaa09..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -.tmp*~ -*.local.* -.pinf-* \ No newline at end of file diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.html b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.html deleted file mode 100644 index 8f5223f0..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.html +++ /dev/null @@ -1,1026 +0,0 @@ - - - - -UglifyJS -- a JavaScript parser/compressor/beautifier - - - - - - - - - - - - -
- -

UglifyJS – a JavaScript parser/compressor/beautifier

- - - - -
-

1 UglifyJS — a JavaScript parser/compressor/beautifier

-
- - -

-This package implements a general-purpose JavaScript -parser/compressor/beautifier toolkit. It is developed on NodeJS, but it -should work on any JavaScript platform supporting the CommonJS module system -(and if your platform of choice doesn't support CommonJS, you can easily -implement it, or discard the exports.* lines from UglifyJS sources). -

-

-The tokenizer/parser generates an abstract syntax tree from JS code. You -can then traverse the AST to learn more about the code, or do various -manipulations on it. This part is implemented in parse-js.js and it's a -port to JavaScript of the excellent parse-js Common Lisp library from Marijn Haverbeke. -

-

-( See cl-uglify-js if you're looking for the Common Lisp version of -UglifyJS. ) -

-

-The second part of this package, implemented in process.js, inspects and -manipulates the AST generated by the parser to provide the following: -

-
    -
  • -ability to re-generate JavaScript code from the AST. Optionally -indented—you can use this if you want to “beautify” a program that has -been compressed, so that you can inspect the source. But you can also run -our code generator to print out an AST without any whitespace, so you -achieve compression as well. - -
  • -
  • -shorten variable names (usually to single characters). Our mangler will -analyze the code and generate proper variable names, depending on scope -and usage, and is smart enough to deal with globals defined elsewhere, or -with eval() calls or with{} statements. In short, if eval() or -with{} are used in some scope, then all variables in that scope and any -variables in the parent scopes will remain unmangled, and any references -to such variables remain unmangled as well. - -
  • -
  • -various small optimizations that may lead to faster code but certainly -lead to smaller code. Where possible, we do the following: - -
      -
    • -foo["bar"] ==> foo.bar - -
    • -
    • -remove block brackets {} - -
    • -
    • -join consecutive var declarations: -var a = 10; var b = 20; ==> var a=10,b=20; - -
    • -
    • -resolve simple constant expressions: 1 +2 * 3 ==> 7. We only do the -replacement if the result occupies less bytes; for example 1/3 would -translate to 0.333333333333, so in this case we don't replace it. - -
    • -
    • -consecutive statements in blocks are merged into a sequence; in many -cases, this leaves blocks with a single statement, so then we can remove -the block brackets. - -
    • -
    • -various optimizations for IF statements: - -
        -
      • -if (foo) bar(); else baz(); ==> foo?bar():baz(); -
      • -
      • -if (!foo) bar(); else baz(); ==> foo?baz():bar(); -
      • -
      • -if (foo) bar(); ==> foo&&bar(); -
      • -
      • -if (!foo) bar(); ==> foo||bar(); -
      • -
      • -if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); -
      • -
      • -if (foo) return bar(); else something(); ==> {if(foo)return bar();something()} - -
      • -
      -
    • -
    • -remove some unreachable code and warn about it (code that follows a -return, throw, break or continue statement, except -function/variable declarations). - -
    • -
    • -act a limited version of a pre-processor (c.f. the pre-processor of -C/C++) to allow you to safely replace selected global symbols with -specified values. When combined with the optimisations above this can -make UglifyJS operate slightly more like a compilation process, in -that when certain symbols are replaced by constant values, entire code -blocks may be optimised away as unreachable. -
    • -
    -
  • -
- - - -
- -
-

1.1 Unsafe transformations

-
- - -

-The following transformations can in theory break code, although they're -probably safe in most practical cases. To enable them you need to pass the ---unsafe flag. -

- -
- -
-

1.1.1 Calls involving the global Array constructor

-
- - -

-The following transformations occur: -

- - - -
new Array(1, 2, 3, 4)  => [1,2,3,4]
-Array(a, b, c)         => [a,b,c]
-new Array(5)           => Array(5)
-new Array(a)           => Array(a)
-
- - - -

-These are all safe if the Array name isn't redefined. JavaScript does allow -one to globally redefine Array (and pretty much everything, in fact) but I -personally don't see why would anyone do that. -

-

-UglifyJS does handle the case where Array is redefined locally, or even -globally but with a function or var declaration. Therefore, in the -following cases UglifyJS doesn't touch calls or instantiations of Array: -

- - - -
// case 1.  globally declared variable
-  var Array;
-  new Array(1, 2, 3);
-  Array(a, b);
-
-  // or (can be declared later)
-  new Array(1, 2, 3);
-  var Array;
-
-  // or (can be a function)
-  new Array(1, 2, 3);
-  function Array() { ... }
-
-// case 2.  declared in a function
-  (function(){
-    a = new Array(1, 2, 3);
-    b = Array(5, 6);
-    var Array;
-  })();
-
-  // or
-  (function(Array){
-    return Array(5, 6, 7);
-  })();
-
-  // or
-  (function(){
-    return new Array(1, 2, 3, 4);
-    function Array() { ... }
-  })();
-
-  // etc.
-
- - - -
- -
- -
-

1.1.2 obj.toString() ==> obj+“”

-
- - -
-
- -
- -
-

1.2 Install (NPM)

-
- - -

-UglifyJS is now available through NPM — npm install uglify-js should do -the job. -

-
- -
- -
-

1.3 Install latest code from GitHub

-
- - - - - -
## clone the repository
-mkdir -p /where/you/wanna/put/it
-cd /where/you/wanna/put/it
-git clone git://github.com/mishoo/UglifyJS.git
-
-## make the module available to Node
-mkdir -p ~/.node_libraries/
-cd ~/.node_libraries/
-ln -s /where/you/wanna/put/it/UglifyJS/uglify-js.js
-
-## and if you want the CLI script too:
-mkdir -p ~/bin
-cd ~/bin
-ln -s /where/you/wanna/put/it/UglifyJS/bin/uglifyjs
-  # (then add ~/bin to your $PATH if it's not there already)
-
- - - -
- -
- -
-

1.4 Usage

-
- - -

-There is a command-line tool that exposes the functionality of this library -for your shell-scripting needs: -

- - - -
uglifyjs [ options... ] [ filename ]
-
- - - -

-filename should be the last argument and should name the file from which -to read the JavaScript code. If you don't specify it, it will read code -from STDIN. -

-

-Supported options: -

-
    -
  • --b or --beautify — output indented code; when passed, additional -options control the beautifier: - -
      -
    • --i N or --indent N — indentation level (number of spaces) - -
    • -
    • --q or --quote-keys — quote keys in literal objects (by default, -only keys that cannot be identifier names will be quotes). - -
    • -
    -
  • -
  • ---ascii — pass this argument to encode non-ASCII characters as -\uXXXX sequences. By default UglifyJS won't bother to do it and will -output Unicode characters instead. (the output is always encoded in UTF8, -but if you pass this option you'll only get ASCII). - -
  • -
  • --nm or --no-mangle — don't mangle variable names - -
  • -
  • --ns or --no-squeeze — don't call ast_squeeze() (which does various -optimizations that result in smaller, less readable code). - -
  • -
  • --mt or --mangle-toplevel — mangle names in the toplevel scope too -(by default we don't do this). - -
  • -
  • ---no-seqs — when ast_squeeze() is called (thus, unless you pass ---no-squeeze) it will reduce consecutive statements in blocks into a -sequence. For example, "a = 10; b = 20; foo();" will be written as -"a=10,b=20,foo();". In various occasions, this allows us to discard the -block brackets (since the block becomes a single statement). This is ON -by default because it seems safe and saves a few hundred bytes on some -libs that I tested it on, but pass --no-seqs to disable it. - -
  • -
  • ---no-dead-code — by default, UglifyJS will remove code that is -obviously unreachable (code that follows a return, throw, break or -continue statement and is not a function/variable declaration). Pass -this option to disable this optimization. - -
  • -
  • --nc or --no-copyright — by default, uglifyjs will keep the initial -comment tokens in the generated code (assumed to be copyright information -etc.). If you pass this it will discard it. - -
  • -
  • --o filename or --output filename — put the result in filename. If -this isn't given, the result goes to standard output (or see next one). - -
  • -
  • ---overwrite — if the code is read from a file (not from STDIN) and you -pass --overwrite then the output will be written in the same file. - -
  • -
  • ---ast — pass this if you want to get the Abstract Syntax Tree instead -of JavaScript as output. Useful for debugging or learning more about the -internals. - -
  • -
  • --v or --verbose — output some notes on STDERR (for now just how long -each operation takes). - -
  • -
  • --d SYMBOL[=VALUE] or --define SYMBOL[=VALUE] — will replace -all instances of the specified symbol where used as an identifier -(except where symbol has properly declared by a var declaration or -use as function parameter or similar) with the specified value. This -argument may be specified multiple times to define multiple -symbols - if no value is specified the symbol will be replaced with -the value true, or you can specify a numeric value (such as -1024), a quoted string value (such as ="object"= or -='https://github.com'), or the name of another symbol or keyword (such as =null or document). -This allows you, for example, to assign meaningful names to key -constant values but discard the symbolic names in the uglified -version for brevity/efficiency, or when used wth care, allows -UglifyJS to operate as a form of conditional compilation -whereby defining appropriate values may, by dint of the constant -folding and dead code removal features above, remove entire -superfluous code blocks (e.g. completely remove instrumentation or -trace code for production use). -Where string values are being defined, the handling of quotes are -likely to be subject to the specifics of your command shell -environment, so you may need to experiment with quoting styles -depending on your platform, or you may find the option ---define-from-module more suitable for use. - -
  • -
  • --define-from-module SOMEMODULE — will load the named module (as -per the NodeJS require() function) and iterate all the exported -properties of the module defining them as symbol names to be defined -(as if by the --define option) per the name of each property -(i.e. without the module name prefix) and given the value of the -property. This is a much easier way to handle and document groups of -symbols to be defined rather than a large number of --define -options. - -
  • -
  • ---unsafe — enable other additional optimizations that are known to be -unsafe in some contrived situations, but could still be generally useful. -For now only these: - -
      -
    • -foo.toString() ==> foo+"" -
    • -
    • -new Array(x,…) ==> [x,…] -
    • -
    • -new Array(x) ==> Array(x) - -
    • -
    -
  • -
  • ---max-line-len (default 32K characters) — add a newline after around -32K characters. I've seen both FF and Chrome croak when all the code was -on a single line of around 670K. Pass –max-line-len 0 to disable this -safety feature. - -
  • -
  • ---reserved-names — some libraries rely on certain names to be used, as -pointed out in issue #92 and #81, so this option allow you to exclude such -names from the mangler. For example, to keep names require and $super -intact you'd specify –reserved-names "require,$super". - -
  • -
  • ---inline-script – when you want to include the output literally in an -HTML <script> tag you can use this option to prevent </script from -showing up in the output. - -
  • -
  • ---lift-vars – when you pass this, UglifyJS will apply the following -transformations (see the notes in API, ast_lift_variables): - -
      -
    • -put all var declarations at the start of the scope -
    • -
    • -make sure a variable is declared only once -
    • -
    • -discard unused function arguments -
    • -
    • -discard unused inner (named) functions -
    • -
    • -finally, try to merge assignments into that one var declaration, if -possible. -
    • -
    -
  • -
- - - -
- -
-

1.4.1 API

-
- - -

-To use the library from JavaScript, you'd do the following (example for -NodeJS): -

- - - -
var jsp = require("uglify-js").parser;
-var pro = require("uglify-js").uglify;
-
-var orig_code = "... JS code here";
-var ast = jsp.parse(orig_code); // parse code and get the initial AST
-ast = pro.ast_mangle(ast); // get a new AST with mangled names
-ast = pro.ast_squeeze(ast); // get an AST with compression optimizations
-var final_code = pro.gen_code(ast); // compressed code here
-
- - - -

-The above performs the full compression that is possible right now. As you -can see, there are a sequence of steps which you can apply. For example if -you want compressed output but for some reason you don't want to mangle -variable names, you would simply skip the line that calls -pro.ast_mangle(ast). -

-

-Some of these functions take optional arguments. Here's a description: -

-
    -
  • -jsp.parse(code, strict_semicolons) – parses JS code and returns an AST. -strict_semicolons is optional and defaults to false. If you pass -true then the parser will throw an error when it expects a semicolon and -it doesn't find it. For most JS code you don't want that, but it's useful -if you want to strictly sanitize your code. - -
  • -
  • -pro.ast_lift_variables(ast) – merge and move var declarations to the -scop of the scope; discard unused function arguments or variables; discard -unused (named) inner functions. It also tries to merge assignments -following the var declaration into it. - -

    -If your code is very hand-optimized concerning var declarations, this -lifting variable declarations might actually increase size. For me it -helps out. On jQuery it adds 865 bytes (243 after gzip). YMMV. Also -note that (since it's not enabled by default) this operation isn't yet -heavily tested (please report if you find issues!). -

    -

    -Note that although it might increase the image size (on jQuery it gains -865 bytes, 243 after gzip) it's technically more correct: in certain -situations, dead code removal might drop variable declarations, which -would not happen if the variables are lifted in advance. -

    -

    -Here's an example of what it does: -

    -
  • -
- - - - -
function f(a, b, c, d, e) {
-    var q;
-    var w;
-    w = 10;
-    q = 20;
-    for (var i = 1; i < 10; ++i) {
-        var boo = foo(a);
-    }
-    for (var i = 0; i < 1; ++i) {
-        var boo = bar(c);
-    }
-    function foo(){ ... }
-    function bar(){ ... }
-    function baz(){ ... }
-}
-
-// transforms into ==>
-
-function f(a, b, c) {
-    var i, boo, w = 10, q = 20;
-    for (i = 1; i < 10; ++i) {
-        boo = foo(a);
-    }
-    for (i = 0; i < 1; ++i) {
-        boo = bar(c);
-    }
-    function foo() { ... }
-    function bar() { ... }
-}
-
- - - -
    -
  • -pro.ast_mangle(ast, options) – generates a new AST containing mangled -(compressed) variable and function names. It supports the following -options: - -
      -
    • -toplevel – mangle toplevel names (by default we don't touch them). -
    • -
    • -except – an array of names to exclude from compression. -
    • -
    • -defines – an object with properties named after symbols to -replace (see the --define option for the script) and the values -representing the AST replacement value. - -
    • -
    -
  • -
  • -pro.ast_squeeze(ast, options) – employs further optimizations designed -to reduce the size of the code that gen_code would generate from the -AST. Returns a new AST. options can be a hash; the supported options -are: - -
      -
    • -make_seqs (default true) which will cause consecutive statements in a -block to be merged using the "sequence" (comma) operator - -
    • -
    • -dead_code (default true) which will remove unreachable code. - -
    • -
    -
  • -
  • -pro.gen_code(ast, options) – generates JS code from the AST. By -default it's minified, but using the options argument you can get nicely -formatted output. options is, well, optional :-) and if you pass it it -must be an object and supports the following properties (below you can see -the default values): - -
      -
    • -beautify: false – pass true if you want indented output -
    • -
    • -indent_start: 0 (only applies when beautify is true) – initial -indentation in spaces -
    • -
    • -indent_level: 4 (only applies when beautify is true) -- -indentation level, in spaces (pass an even number) -
    • -
    • -quote_keys: false – if you pass true it will quote all keys in -literal objects -
    • -
    • -space_colon: false (only applies when beautify is true) – wether -to put a space before the colon in object literals -
    • -
    • -ascii_only: false – pass true if you want to encode non-ASCII -characters as \uXXXX. -
    • -
    • -inline_script: false – pass true to escape occurrences of -</script in strings -
    • -
    -
  • -
- - -
- -
- -
-

1.4.2 Beautifier shortcoming – no more comments

-
- - -

-The beautifier can be used as a general purpose indentation tool. It's -useful when you want to make a minified file readable. One limitation, -though, is that it discards all comments, so you don't really want to use it -to reformat your code, unless you don't have, or don't care about, comments. -

-

-In fact it's not the beautifier who discards comments — they are dumped at -the parsing stage, when we build the initial AST. Comments don't really -make sense in the AST, and while we could add nodes for them, it would be -inconvenient because we'd have to add special rules to ignore them at all -the processing stages. -

-
- -
- -
-

1.4.3 Use as a code pre-processor

-
- - -

-The --define option can be used, particularly when combined with the -constant folding logic, as a form of pre-processor to enable or remove -particular constructions, such as might be used for instrumenting -development code, or to produce variations aimed at a specific -platform. -

-

-The code below illustrates the way this can be done, and how the -symbol replacement is performed. -

- - - -
CLAUSE1: if (typeof DEVMODE === 'undefined') {
-    DEVMODE = true;
-}
-
-CLAUSE2: function init() {
-    if (DEVMODE) {
-        console.log("init() called");
-    }
-    ....
-    DEVMODE &amp;&amp; console.log("init() complete");
-}
-
-CLAUSE3: function reportDeviceStatus(device) {
-    var DEVMODE = device.mode, DEVNAME = device.name;
-    if (DEVMODE === 'open') {
-        ....
-    }
-}
-
- - - -

-When the above code is normally executed, the undeclared global -variable DEVMODE will be assigned the value true (see CLAUSE1) -and so the init() function (CLAUSE2) will write messages to the -console log when executed, but in CLAUSE3 a locally declared -variable will mask access to the DEVMODE global symbol. -

-

-If the above code is processed by UglifyJS with an argument of ---define DEVMODE=false then UglifyJS will replace DEVMODE with the -boolean constant value false within CLAUSE1 and CLAUSE2, but it -will leave CLAUSE3 as it stands because there DEVMODE resolves to -a validly declared variable. -

-

-And more so, the constant-folding features of UglifyJS will recognise -that the if condition of CLAUSE1 is thus always false, and so will -remove the test and body of CLAUSE1 altogether (including the -otherwise slightly problematical statement false = true; which it -will have formed by replacing DEVMODE in the body). Similarly, -within CLAUSE2 both calls to console.log() will be removed -altogether. -

-

-In this way you can mimic, to a limited degree, the functionality of -the C/C++ pre-processor to enable or completely remove blocks -depending on how certain symbols are defined - perhaps using UglifyJS -to generate different versions of source aimed at different -environments -

-

-It is recommmended (but not made mandatory) that symbols designed for -this purpose are given names consisting of UPPER_CASE_LETTERS to -distinguish them from other (normal) symbols and avoid the sort of -clash that CLAUSE3 above illustrates. -

-
-
- -
- -
-

1.5 Compression – how good is it?

-
- - -

-Here are updated statistics. (I also updated my Google Closure and YUI -installations). -

-

-We're still a lot better than YUI in terms of compression, though slightly -slower. We're still a lot faster than Closure, and compression after gzip -is comparable. -

- - -- - - - - - - - - - -
FileUglifyJSUglifyJS+gzipClosureClosure+gzipYUIYUI+gzip
jquery-1.6.2.js91001 (0:01.59)3189690678 (0:07.40)31979101527 (0:01.82)34646
paper.js142023 (0:01.65)43334134301 (0:07.42)42495173383 (0:01.58)48785
prototype.js88544 (0:01.09)2668086955 (0:06.97)2632692130 (0:00.79)28624
thelib-full.js (DynarchLIB)251939 (0:02.55)72535249911 (0:09.05)72696258869 (0:01.94)76584
- - -
- -
- -
-

1.6 Bugs?

-
- - -

-Unfortunately, for the time being there is no automated test suite. But I -ran the compressor manually on non-trivial code, and then I tested that the -generated code works as expected. A few hundred times. -

-

-DynarchLIB was started in times when there was no good JS minifier. -Therefore I was quite religious about trying to write short code manually, -and as such DL contains a lot of syntactic hacks1 such as “foo == bar ? a -= 10 : b = 20”, though the more readable version would clearly be to use -“if/else”. -

-

-Since the parser/compressor runs fine on DL and jQuery, I'm quite confident -that it's solid enough for production use. If you can identify any bugs, -I'd love to hear about them (use the Google Group or email me directly). -

-
- -
- -
-

1.7 Links

-
- - - - - -
- -
- -
-

1.8 License

-
- - -

-UglifyJS is released under the BSD license: -

- - - -
Copyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>
-Based on parse-js (http://marijn.haverbeke.nl/parse-js/).
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-    * Redistributions of source code must retain the above
-      copyright notice, this list of conditions and the following
-      disclaimer.
-
-    * Redistributions in binary form must reproduce the above
-      copyright notice, this list of conditions and the following
-      disclaimer in the documentation and/or other materials
-      provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
-TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
-THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
- - - - -
-
-
-
-

Footnotes:

-
-

1 I even reported a few bugs and suggested some fixes in the original -parse-js library, and Marijn pushed fixes literally in minutes. -

-
-
-
-

Author: Mihai Bazon -

-

Date: 2011-08-29 19:17:55 EEST

-

HTML generated by org-mode 7.01trans in emacs 23

-
-
- - diff --git a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.org b/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.org deleted file mode 100644 index 50c9c273..00000000 --- a/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.org +++ /dev/null @@ -1,571 +0,0 @@ -#+TITLE: UglifyJS -- a JavaScript parser/compressor/beautifier -#+KEYWORDS: javascript, js, parser, compiler, compressor, mangle, minify, minifier -#+DESCRIPTION: a JavaScript parser/compressor/beautifier in JavaScript -#+STYLE: -#+AUTHOR: Mihai Bazon -#+EMAIL: mihai.bazon@gmail.com - -* UglifyJS --- a JavaScript parser/compressor/beautifier - -This package implements a general-purpose JavaScript -parser/compressor/beautifier toolkit. It is developed on [[http://nodejs.org/][NodeJS]], but it -should work on any JavaScript platform supporting the CommonJS module system -(and if your platform of choice doesn't support CommonJS, you can easily -implement it, or discard the =exports.*= lines from UglifyJS sources). - -The tokenizer/parser generates an abstract syntax tree from JS code. You -can then traverse the AST to learn more about the code, or do various -manipulations on it. This part is implemented in [[../lib/parse-js.js][parse-js.js]] and it's a -port to JavaScript of the excellent [[http://marijn.haverbeke.nl/parse-js/][parse-js]] Common Lisp library from [[http://marijn.haverbeke.nl/][Marijn -Haverbeke]]. - -( See [[http://github.com/mishoo/cl-uglify-js][cl-uglify-js]] if you're looking for the Common Lisp version of -UglifyJS. ) - -The second part of this package, implemented in [[../lib/process.js][process.js]], inspects and -manipulates the AST generated by the parser to provide the following: - -- ability to re-generate JavaScript code from the AST. Optionally - indented---you can use this if you want to “beautify” a program that has - been compressed, so that you can inspect the source. But you can also run - our code generator to print out an AST without any whitespace, so you - achieve compression as well. - -- shorten variable names (usually to single characters). Our mangler will - analyze the code and generate proper variable names, depending on scope - and usage, and is smart enough to deal with globals defined elsewhere, or - with =eval()= calls or =with{}= statements. In short, if =eval()= or - =with{}= are used in some scope, then all variables in that scope and any - variables in the parent scopes will remain unmangled, and any references - to such variables remain unmangled as well. - -- various small optimizations that may lead to faster code but certainly - lead to smaller code. Where possible, we do the following: - - - foo["bar"] ==> foo.bar - - - remove block brackets ={}= - - - join consecutive var declarations: - var a = 10; var b = 20; ==> var a=10,b=20; - - - resolve simple constant expressions: 1 +2 * 3 ==> 7. We only do the - replacement if the result occupies less bytes; for example 1/3 would - translate to 0.333333333333, so in this case we don't replace it. - - - consecutive statements in blocks are merged into a sequence; in many - cases, this leaves blocks with a single statement, so then we can remove - the block brackets. - - - various optimizations for IF statements: - - - if (foo) bar(); else baz(); ==> foo?bar():baz(); - - if (!foo) bar(); else baz(); ==> foo?baz():bar(); - - if (foo) bar(); ==> foo&&bar(); - - if (!foo) bar(); ==> foo||bar(); - - if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); - - if (foo) return bar(); else something(); ==> {if(foo)return bar();something()} - - - remove some unreachable code and warn about it (code that follows a - =return=, =throw=, =break= or =continue= statement, except - function/variable declarations). - - - act a limited version of a pre-processor (c.f. the pre-processor of - C/C++) to allow you to safely replace selected global symbols with - specified values. When combined with the optimisations above this can - make UglifyJS operate slightly more like a compilation process, in - that when certain symbols are replaced by constant values, entire code - blocks may be optimised away as unreachable. - -** <> - -The following transformations can in theory break code, although they're -probably safe in most practical cases. To enable them you need to pass the -=--unsafe= flag. - -*** Calls involving the global Array constructor - -The following transformations occur: - -#+BEGIN_SRC js -new Array(1, 2, 3, 4) => [1,2,3,4] -Array(a, b, c) => [a,b,c] -new Array(5) => Array(5) -new Array(a) => Array(a) -#+END_SRC - -These are all safe if the Array name isn't redefined. JavaScript does allow -one to globally redefine Array (and pretty much everything, in fact) but I -personally don't see why would anyone do that. - -UglifyJS does handle the case where Array is redefined locally, or even -globally but with a =function= or =var= declaration. Therefore, in the -following cases UglifyJS *doesn't touch* calls or instantiations of Array: - -#+BEGIN_SRC js -// case 1. globally declared variable - var Array; - new Array(1, 2, 3); - Array(a, b); - - // or (can be declared later) - new Array(1, 2, 3); - var Array; - - // or (can be a function) - new Array(1, 2, 3); - function Array() { ... } - -// case 2. declared in a function - (function(){ - a = new Array(1, 2, 3); - b = Array(5, 6); - var Array; - })(); - - // or - (function(Array){ - return Array(5, 6, 7); - })(); - - // or - (function(){ - return new Array(1, 2, 3, 4); - function Array() { ... } - })(); - - // etc. -#+END_SRC - -*** =obj.toString()= ==> =obj+“”= - -** Install (NPM) - -UglifyJS is now available through NPM --- =npm install uglify-js= should do -the job. - -** Install latest code from GitHub - -#+BEGIN_SRC sh -## clone the repository -mkdir -p /where/you/wanna/put/it -cd /where/you/wanna/put/it -git clone git://github.com/mishoo/UglifyJS.git - -## make the module available to Node -mkdir -p ~/.node_libraries/ -cd ~/.node_libraries/ -ln -s /where/you/wanna/put/it/UglifyJS/uglify-js.js - -## and if you want the CLI script too: -mkdir -p ~/bin -cd ~/bin -ln -s /where/you/wanna/put/it/UglifyJS/bin/uglifyjs - # (then add ~/bin to your $PATH if it's not there already) -#+END_SRC - -** Usage - -There is a command-line tool that exposes the functionality of this library -for your shell-scripting needs: - -#+BEGIN_SRC sh -uglifyjs [ options... ] [ filename ] -#+END_SRC - -=filename= should be the last argument and should name the file from which -to read the JavaScript code. If you don't specify it, it will read code -from STDIN. - -Supported options: - -- =-b= or =--beautify= --- output indented code; when passed, additional - options control the beautifier: - - - =-i N= or =--indent N= --- indentation level (number of spaces) - - - =-q= or =--quote-keys= --- quote keys in literal objects (by default, - only keys that cannot be identifier names will be quotes). - -- =--ascii= --- pass this argument to encode non-ASCII characters as - =\uXXXX= sequences. By default UglifyJS won't bother to do it and will - output Unicode characters instead. (the output is always encoded in UTF8, - but if you pass this option you'll only get ASCII). - -- =-nm= or =--no-mangle= --- don't mangle variable names - -- =-ns= or =--no-squeeze= --- don't call =ast_squeeze()= (which does various - optimizations that result in smaller, less readable code). - -- =-mt= or =--mangle-toplevel= --- mangle names in the toplevel scope too - (by default we don't do this). - -- =--no-seqs= --- when =ast_squeeze()= is called (thus, unless you pass - =--no-squeeze=) it will reduce consecutive statements in blocks into a - sequence. For example, "a = 10; b = 20; foo();" will be written as - "a=10,b=20,foo();". In various occasions, this allows us to discard the - block brackets (since the block becomes a single statement). This is ON - by default because it seems safe and saves a few hundred bytes on some - libs that I tested it on, but pass =--no-seqs= to disable it. - -- =--no-dead-code= --- by default, UglifyJS will remove code that is - obviously unreachable (code that follows a =return=, =throw=, =break= or - =continue= statement and is not a function/variable declaration). Pass - this option to disable this optimization. - -- =-nc= or =--no-copyright= --- by default, =uglifyjs= will keep the initial - comment tokens in the generated code (assumed to be copyright information - etc.). If you pass this it will discard it. - -- =-o filename= or =--output filename= --- put the result in =filename=. If - this isn't given, the result goes to standard output (or see next one). - -- =--overwrite= --- if the code is read from a file (not from STDIN) and you - pass =--overwrite= then the output will be written in the same file. - -- =--ast= --- pass this if you want to get the Abstract Syntax Tree instead - of JavaScript as output. Useful for debugging or learning more about the - internals. - -- =-v= or =--verbose= --- output some notes on STDERR (for now just how long - each operation takes). - -- =-d SYMBOL[=VALUE]= or =--define SYMBOL[=VALUE]= --- will replace - all instances of the specified symbol where used as an identifier - (except where symbol has properly declared by a var declaration or - use as function parameter or similar) with the specified value. This - argument may be specified multiple times to define multiple - symbols - if no value is specified the symbol will be replaced with - the value =true=, or you can specify a numeric value (such as - =1024=), a quoted string value (such as ="object"= or - ='https://github.com'=), or the name of another symbol or keyword - (such as =null= or =document=). - This allows you, for example, to assign meaningful names to key - constant values but discard the symbolic names in the uglified - version for brevity/efficiency, or when used wth care, allows - UglifyJS to operate as a form of *conditional compilation* - whereby defining appropriate values may, by dint of the constant - folding and dead code removal features above, remove entire - superfluous code blocks (e.g. completely remove instrumentation or - trace code for production use). - Where string values are being defined, the handling of quotes are - likely to be subject to the specifics of your command shell - environment, so you may need to experiment with quoting styles - depending on your platform, or you may find the option - =--define-from-module= more suitable for use. - -- =-define-from-module SOMEMODULE= --- will load the named module (as - per the NodeJS =require()= function) and iterate all the exported - properties of the module defining them as symbol names to be defined - (as if by the =--define= option) per the name of each property - (i.e. without the module name prefix) and given the value of the - property. This is a much easier way to handle and document groups of - symbols to be defined rather than a large number of =--define= - options. - -- =--unsafe= --- enable other additional optimizations that are known to be - unsafe in some contrived situations, but could still be generally useful. - For now only these: - - - foo.toString() ==> foo+"" - - new Array(x,...) ==> [x,...] - - new Array(x) ==> Array(x) - -- =--max-line-len= (default 32K characters) --- add a newline after around - 32K characters. I've seen both FF and Chrome croak when all the code was - on a single line of around 670K. Pass --max-line-len 0 to disable this - safety feature. - -- =--reserved-names= --- some libraries rely on certain names to be used, as - pointed out in issue #92 and #81, so this option allow you to exclude such - names from the mangler. For example, to keep names =require= and =$super= - intact you'd specify --reserved-names "require,$super". - -- =--inline-script= -- when you want to include the output literally in an - HTML =