From ba6b3c311de480edbfe28dcd8bf970144807ab93 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 28 Jan 2015 15:33:44 -0500 Subject: [PATCH] Update included modules --- lib/driver.js | 4 +- node_modules/dblite/package.json | 2 +- node_modules/es6-shim/.flowconfig | 8 + node_modules/es6-shim/.jscs.json | 2 + node_modules/es6-shim/.jshintrc | 3 + node_modules/es6-shim/CHANGELOG.md | 51 +- node_modules/es6-shim/README.md | 13 +- node_modules/es6-shim/bower.json | 2 +- node_modules/es6-shim/component.json | 2 +- node_modules/es6-shim/es6-sham.js | 188 +- node_modules/es6-shim/es6-sham.map | 2 +- node_modules/es6-shim/es6-sham.min.js | 6 +- node_modules/es6-shim/es6-shim.js | 877 +- node_modules/es6-shim/es6-shim.map | 2 +- node_modules/es6-shim/es6-shim.min.js | 6 +- node_modules/es6-shim/package.json | 65 +- .../es6-shim/test-sham/set-prototype-of.js | 11 +- .../node_modules/chalk/index.js | 95 + .../chalk/node_modules/.bin/has-ansi | 1 + .../chalk/node_modules/.bin/strip-ansi | 1 + .../chalk/node_modules/.bin/supports-color | 1 + .../chalk/node_modules/ansi-styles/index.js | 40 + .../node_modules/ansi-styles/package.json | 74 + .../chalk/node_modules/ansi-styles/readme.md | 70 + .../escape-string-regexp/index.js | 11 + .../escape-string-regexp/package.json | 69 + .../escape-string-regexp/readme.md | 27 + .../chalk/node_modules/has-ansi/cli.js | 53 + .../chalk/node_modules/has-ansi/index.js | 4 + .../has-ansi/node_modules/ansi-regex/index.js | 4 + .../node_modules/ansi-regex/package.json | 79 + .../node_modules/ansi-regex/readme.md | 33 + .../chalk/node_modules/has-ansi/package.json | 85 + .../chalk/node_modules/has-ansi/readme.md | 45 + .../chalk/node_modules/strip-ansi/cli.js | 39 + .../chalk/node_modules/strip-ansi/index.js | 6 + .../node_modules/ansi-regex/index.js | 4 + .../node_modules/ansi-regex/package.json | 79 + .../node_modules/ansi-regex/readme.md | 33 + .../node_modules/strip-ansi/package.json | 84 + .../chalk/node_modules/strip-ansi/readme.md | 43 + .../chalk/node_modules/supports-color/cli.js | 28 + .../node_modules/supports-color/index.js | 32 + .../node_modules/supports-color/package.json | 78 + .../node_modules/supports-color/readme.md | 44 + .../node_modules/chalk/package.json | 82 + .../node_modules/chalk/readme.md | 175 + .../istanbul/node_modules/abbrev/package.json | 2 +- .../istanbul/node_modules/async/README.md | 1646 --- .../node_modules/async/component.json | 11 - .../istanbul/node_modules/async/lib/async.js | 1123 -- .../istanbul/node_modules/async/package.json | 45 - .../node_modules/esprima/package.json | 2 +- .../node_modules/estraverse/package.json | 2 +- .../node_modules/esutils/package.json | 2 +- .../node_modules/source-map/CHANGELOG.md | 21 + .../node_modules/source-map/README.md | 26 + .../source-map/lib/source-map/base64-vlq.js | 4 +- .../lib/source-map/binary-search.js | 29 +- .../source-map/lib/source-map/mapping-list.js | 86 + .../lib/source-map/source-map-consumer.js | 144 +- .../lib/source-map/source-map-generator.js | 25 +- .../source-map/lib/source-map/source-node.js | 30 +- .../node_modules/source-map/package.json | 30 +- .../test/source-map/test-binary-search.js | 8 +- .../source-map/test-source-map-consumer.js | 171 + .../source-map/test-source-map-generator.js | 21 + .../source-map/test/source-map/util.js | 16 + .../node_modules/escodegen/package.json | 2 +- .../istanbul/node_modules/esprima/esprima.js | 4 +- .../node_modules/esprima/package.json | 16 +- .../node_modules/esprima/test/test.js | 76 +- .../glob/node_modules/inherits/package.json | 2 +- .../node_modules/lru-cache/package.json | 2 +- .../node_modules/sigmund/package.json | 2 +- .../glob/node_modules/minimatch/package.json | 2 +- .../fileset/node_modules/glob/package.json | 2 +- .../node_modules/lru-cache/package.json | 2 +- .../node_modules/sigmund/package.json | 2 +- .../node_modules/minimatch/package.json | 2 +- .../node_modules/fileset/package.json | 2 +- .../node_modules/optimist/package.json | 2 +- .../uglify-js/node_modules/async/package.json | 2 +- .../node_modules/source-map/CHANGELOG.md | 21 + .../node_modules/source-map/README.md | 26 + .../source-map/lib/source-map/base64-vlq.js | 4 +- .../lib/source-map/binary-search.js | 29 +- .../source-map/lib/source-map/mapping-list.js | 86 + .../lib/source-map/source-map-consumer.js | 144 +- .../lib/source-map/source-map-generator.js | 25 +- .../source-map/lib/source-map/source-node.js | 30 +- .../node_modules/source-map/package.json | 30 +- .../test/source-map/test-binary-search.js | 8 +- .../source-map/test-source-map-consumer.js | 171 + .../source-map/test-source-map-generator.js | 21 + .../source-map/test/source-map/util.js | 16 + .../node_modules/uglify-js/package.json | 2 +- .../node_modules/handlebars/package.json | 2 +- .../istanbul/node_modules/js-yaml/HISTORY.md | 14 + .../node_modules/js-yaml/dist/js-yaml.js | 128 +- .../node_modules/js-yaml/dist/js-yaml.min.js | 6 +- .../js-yaml/lib/js-yaml/loader.js | 47 +- .../js-yaml/lib/js-yaml/type/binary.js | 4 + .../js-yaml/lib/js-yaml/type/bool.js | 4 + .../js-yaml/lib/js-yaml/type/float.js | 4 + .../js-yaml/lib/js-yaml/type/int.js | 4 + .../js-yaml/lib/js-yaml/type/js/function.js | 4 + .../js-yaml/lib/js-yaml/type/js/regexp.js | 8 + .../js-yaml/lib/js-yaml/type/map.js | 3 +- .../js-yaml/lib/js-yaml/type/merge.js | 4 +- .../js-yaml/lib/js-yaml/type/null.js | 4 + .../js-yaml/lib/js-yaml/type/omap.js | 11 +- .../js-yaml/lib/js-yaml/type/pairs.js | 8 + .../js-yaml/lib/js-yaml/type/seq.js | 3 +- .../js-yaml/lib/js-yaml/type/set.js | 11 +- .../js-yaml/lib/js-yaml/type/str.js | 3 +- .../js-yaml/lib/js-yaml/type/timestamp.js | 4 + .../js-yaml/node_modules/argparse/HISTORY.md | 6 + .../js-yaml/node_modules/argparse/README.md | 6 +- .../argparse/lib/argument_parser.js | 29 +- .../argparse/lib/help/formatter.js | 17 +- .../node_modules/underscore.string/.npmignore | 2 + .../underscore.string/.travis.yml | 8 +- .../node_modules/underscore.string/Gemfile | 4 - .../underscore.string/Gemfile.lock | 17 - .../underscore.string/README.markdown | 21 +- .../node_modules/underscore.string/Rakefile | 23 - .../node_modules/underscore.string/bower.json | 33 + .../underscore.string/component.json | 2 +- .../dist/underscore.string.min.js | 1 - .../node_modules/underscore.string/foo.js | 10 + .../underscore.string/gulpfile.js | 26 + .../lib/underscore.string.js | 8 +- .../underscore.string/package.json | 47 +- .../underscore.string/test/run-qunit.js | 45 - .../underscore.string/test/speed.js | 148 - .../underscore.string/test/strings.js | 685 -- .../test/strings_standalone.js | 12 - .../underscore.string/test/test.html | 31 - .../test/test_standalone.html | 18 - .../test/test_underscore/arrays.js | 200 - .../test/test_underscore/chaining.js | 59 - .../test/test_underscore/collections.js | 426 - .../test/test_underscore/functions.js | 259 - .../test/test_underscore/index.html | 45 - .../test/test_underscore/objects.js | 548 - .../test/test_underscore/speed.js | 75 - .../test/test_underscore/utility.js | 249 - .../test/test_underscore/vendor/jquery.js | 9404 ----------------- .../test/test_underscore/vendor/jslitmus.js | 670 -- .../test/test_underscore/vendor/qunit.css | 235 - .../test/test_underscore/vendor/qunit.js | 1977 ---- .../node_modules/underscore/.npmignore | 4 - .../node_modules/underscore/.travis.yml | 5 - .../argparse/node_modules/underscore/CNAME | 1 - .../node_modules/underscore/CONTRIBUTING.md | 9 - .../argparse/node_modules/underscore/LICENSE | 3 +- .../node_modules/underscore/README.md | 5 +- .../node_modules/underscore/favicon.ico | Bin 1406 -> 0 bytes .../node_modules/underscore/index.html | 2467 ----- .../argparse/node_modules/underscore/index.js | 1 - .../node_modules/underscore/package.json | 52 +- .../node_modules/underscore/underscore-min.js | 7 +- .../node_modules/underscore/underscore.js | 1145 +- .../node_modules/argparse/package.json | 38 +- .../js-yaml/node_modules/esprima/package.json | 2 +- .../node_modules/js-yaml/package.json | 17 +- .../istanbul/node_modules/mkdirp/package.json | 2 +- .../istanbul/node_modules/nopt/package.json | 2 +- .../node_modules/resolve/package.json | 2 +- .../istanbul/node_modules/which/LICENSE | 32 +- .../istanbul/node_modules/which/package.json | 36 +- .../istanbul/node_modules/which/which.js | 7 +- .../node_modules/wordwrap/package.json | 2 +- .../node_modules/istanbul/package.json | 2 +- .../node_modules/nue/package.json | 6 +- node_modules/grunt-istanbul/package.json | 18 +- node_modules/grunt-istanbul/tasks/helpers.js | 58 +- node_modules/grunt-istanbul/tasks/istanbul.js | 127 +- node_modules/jsdoc/.editorconfig | 12 + node_modules/jsdoc/{changes.md => CHANGES.md} | 94 + node_modules/jsdoc/LICENSE.md | 92 +- node_modules/jsdoc/README.md | 8 +- node_modules/jsdoc/cli.js | 93 +- node_modules/jsdoc/jsdoc.js | 4 +- node_modules/jsdoc/lib/jsdoc/augment.js | 445 +- node_modules/jsdoc/lib/jsdoc/borrow.js | 115 +- node_modules/jsdoc/lib/jsdoc/config.js | 3 +- node_modules/jsdoc/lib/jsdoc/doclet.js | 76 +- node_modules/jsdoc/lib/jsdoc/name.js | 393 +- .../jsdoc/lib/jsdoc/opts/argparser.js | 7 +- node_modules/jsdoc/lib/jsdoc/opts/args.js | 26 +- node_modules/jsdoc/lib/jsdoc/package.js | 288 +- node_modules/jsdoc/lib/jsdoc/plugins.js | 8 +- node_modules/jsdoc/lib/jsdoc/schema.js | 137 +- .../jsdoc/lib/jsdoc/src/astbuilder.js | 123 +- node_modules/jsdoc/lib/jsdoc/src/astnode.js | 108 +- node_modules/jsdoc/lib/jsdoc/src/handlers.js | 430 +- node_modules/jsdoc/lib/jsdoc/src/parser.js | 162 +- node_modules/jsdoc/lib/jsdoc/src/visitor.js | 46 +- node_modules/jsdoc/lib/jsdoc/src/walker.js | 28 +- node_modules/jsdoc/lib/jsdoc/tag.js | 104 +- .../jsdoc/lib/jsdoc/tag/dictionary.js | 151 +- .../lib/jsdoc/tag/dictionary/definitions.js | 666 +- node_modules/jsdoc/lib/jsdoc/tag/type.js | 15 +- node_modules/jsdoc/lib/jsdoc/tag/validator.js | 11 + node_modules/jsdoc/lib/jsdoc/template.js | 11 +- node_modules/jsdoc/lib/jsdoc/tutorial.js | 39 +- .../jsdoc/lib/jsdoc/tutorial/resolver.js | 123 +- node_modules/jsdoc/lib/jsdoc/util/doop.js | 75 +- node_modules/jsdoc/lib/jsdoc/util/dumper.js | 52 +- node_modules/jsdoc/lib/jsdoc/util/logger.js | 52 +- node_modules/jsdoc/lib/jsdoc/util/runtime.js | 2 +- .../jsdoc/lib/jsdoc/util/templateHelper.js | 434 +- node_modules/jsdoc/node/fs.js | 4 +- .../jsdoc/node_modules/async/.gitmodules | 9 - .../jsdoc/node_modules/async/.npmignore | 4 - .../jsdoc/node_modules/async/Makefile | 25 - .../jsdoc/node_modules/async/README.md | 1021 -- .../jsdoc/node_modules/async/index.js | 3 - .../jsdoc/node_modules/async/lib/async.js | 692 -- .../jsdoc/node_modules/async/package.json | 33 - .../jsdoc/node_modules/catharsis/README.md | 5 + .../node_modules/catharsis/lib/parser.js | 6008 ++++++++++- .../node_modules/underscore/LICENSE | 23 + .../node_modules/underscore/README.md | 22 + .../node_modules/underscore/package.json | 50 + .../node_modules/underscore/underscore-min.js | 6 + .../node_modules/underscore}/underscore.js | 492 +- .../underscore-contrib/package.json | 2 +- .../jsdoc/node_modules/catharsis/package.json | 24 +- .../jsdoc/node_modules/catharsis/res/en.json | 2 +- .../escape-string-regexp/index.js | 11 + .../escape-string-regexp/package.json | 69 + .../escape-string-regexp/readme.md | 27 + .../jsdoc/node_modules/esprima/package.json | 6 +- .../node_modules/js2xmlparser/.gitattributes | 22 - .../node_modules/js2xmlparser/.npmignore | 335 +- .../node_modules/js2xmlparser/CHANGES.md | 81 +- .../node_modules/js2xmlparser/LICENSE.md | 30 +- .../jsdoc/node_modules/js2xmlparser/README.md | 439 +- .../js2xmlparser/example/example.js | 270 +- .../js2xmlparser/lib/js2xmlparser.js | 681 +- .../node_modules/js2xmlparser/package.json | 18 +- .../node_modules/js2xmlparser/test/test.js | 2667 ++--- .../jsdoc/node_modules/marked/Makefile | 2 +- .../jsdoc/node_modules/marked/README.md | 20 + .../jsdoc/node_modules/marked/bower.json | 24 + .../jsdoc/node_modules/marked/lib/marked.js | 16 +- .../jsdoc/node_modules/marked/marked.min.js | 6 + .../jsdoc/node_modules/marked/package.json | 22 +- .../jsdoc/node_modules/requizzle/README.md | 3 + .../requizzle/lib/wrappers/requirepaths.js | 2 +- .../requizzle/node_modules/underscore/LICENSE | 23 + .../node_modules/underscore/README.md | 22 + .../node_modules/underscore/package.json | 50 + .../node_modules/underscore/underscore-min.js | 6 + .../node_modules/underscore/underscore.js | 1343 +++ .../jsdoc/node_modules/requizzle/package.json | 19 +- .../strip-json-comments/package.json | 21 +- .../strip-json-comments/readme.md | 6 +- .../strip-json-comments.js | 3 + .../jsdoc/node_modules/taffydb/package.json | 4 +- .../node_modules/underscore/package.json | 35 +- .../node_modules/underscore/underscore-min.js | 4 +- .../node_modules/underscore/underscore.js | 920 +- .../jsdoc/node_modules/wrench/.npmignore | 1 + .../jsdoc/node_modules/wrench/lib/wrench.js | 242 +- .../jsdoc/node_modules/wrench/lib/x.js | 1 - .../jsdoc/node_modules/wrench/package.json | 30 +- .../jsdoc/node_modules/wrench/readme.md | 47 +- .../wrench/tests/copydirsync_unix.js | 242 + .../jsdoc/node_modules/wrench/tests/mkdir.js | 4 +- .../node_modules/wrench/tests/readdir.js | 13 +- .../wrench/tests/rmdirSyncRecursive.js | 74 + .../jsdoc/node_modules/wrench/tests/runner.js | 4 +- .../wrench/tests/shown/.hidden.txt | 1 + .../wrench/tests/shown/.hidden/dolor.md | 0 .../node_modules/wrench/tests/shown/bar.txt | 1 + .../wrench/tests/shown/foo/bar/ipsum.js | 0 .../wrench/tests/shown/foo/dolor.md | 0 .../wrench/tests/shown/foo/lorem.txt | 0 .../wrench/tests/withsymlinks/test | 1 + node_modules/jsdoc/package.json | 48 +- node_modules/jsdoc/package.json.orig | 23 +- node_modules/jsdoc/plugins/commentConvert.js | 4 +- node_modules/jsdoc/plugins/escapeHtml.js | 4 +- node_modules/jsdoc/plugins/markdown.js | 33 +- node_modules/jsdoc/plugins/partial.js | 25 +- node_modules/jsdoc/plugins/railsTemplate.js | 2 +- node_modules/jsdoc/plugins/shout.js | 2 +- node_modules/jsdoc/plugins/sourcetag.js | 1 - node_modules/jsdoc/plugins/summarize.js | 61 + .../jsdoc/plugins/test/fixtures/markdown.js | 25 + .../plugins/test/fixtures/seetag-markdown.js | 11 - .../jsdoc/plugins/test/fixtures/underscore.js | 22 + .../jsdoc/plugins/test/specs/markdown.js | 56 +- .../jsdoc/plugins/test/specs/sourcetag.js | 12 +- .../jsdoc/plugins/test/specs/summarize.js | 112 + .../jsdoc/plugins/test/specs/underscore.js | 35 + node_modules/jsdoc/plugins/underscore.js | 21 + .../jsdoc/templates/default/README.md | 11 + .../jsdoc/templates/default/publish.js | 208 +- .../static/fonts/OpenSans-Bold-webfont.eot | Bin 0 -> 19544 bytes .../static/fonts/OpenSans-Bold-webfont.svg | 1830 ++++ .../static/fonts/OpenSans-Bold-webfont.woff | Bin 0 -> 22432 bytes .../fonts/OpenSans-BoldItalic-webfont.eot | Bin 0 -> 20133 bytes .../fonts/OpenSans-BoldItalic-webfont.svg | 1830 ++++ .../fonts/OpenSans-BoldItalic-webfont.woff | Bin 0 -> 23048 bytes .../static/fonts/OpenSans-Italic-webfont.eot | Bin 0 -> 20265 bytes .../static/fonts/OpenSans-Italic-webfont.svg | 1830 ++++ .../static/fonts/OpenSans-Italic-webfont.woff | Bin 0 -> 23188 bytes .../static/fonts/OpenSans-Light-webfont.eot | Bin 0 -> 19514 bytes .../static/fonts/OpenSans-Light-webfont.svg | 1831 ++++ .../static/fonts/OpenSans-Light-webfont.woff | Bin 0 -> 22248 bytes .../fonts/OpenSans-LightItalic-webfont.eot | Bin 0 -> 20535 bytes .../fonts/OpenSans-LightItalic-webfont.svg | 1835 ++++ .../fonts/OpenSans-LightItalic-webfont.woff | Bin 0 -> 23400 bytes .../static/fonts/OpenSans-Regular-webfont.eot | Bin 0 -> 19836 bytes .../static/fonts/OpenSans-Regular-webfont.svg | 1831 ++++ .../fonts/OpenSans-Regular-webfont.woff | Bin 0 -> 22660 bytes .../default/static/styles/jsdoc-default.css | 166 +- .../static/styles/prettify-tomorrow.css | 2 +- .../templates/default/tmpl/augments.tmpl | 10 + .../templates/default/tmpl/container.tmpl | 97 +- .../jsdoc/templates/default/tmpl/details.tmpl | 64 +- .../templates/default/tmpl/exceptions.tmpl | 2 + .../jsdoc/templates/default/tmpl/layout.tmpl | 2 +- .../jsdoc/templates/default/tmpl/members.tmpl | 61 +- .../jsdoc/templates/default/tmpl/method.tmpl | 162 +- .../jsdoc/templates/default/tmpl/params.tmpl | 23 +- .../templates/default/tmpl/properties.tmpl | 9 +- .../jsdoc/templates/haruki/publish.js | 14 +- node_modules/mysql/Changes.md | 5 + node_modules/mysql/Readme.md | 10 +- node_modules/mysql/lib/protocol/Parser.js | 2 +- .../mysql/lib/protocol/constants/errors.js | 40 +- .../node_modules/bignumber.js/package.json | 3 +- .../node_modules/core-util-is/package.json | 3 +- .../node_modules/inherits/package.json | 2 +- .../node_modules/string_decoder/package.json | 2 +- .../node_modules/readable-stream/package.json | 2 +- .../node_modules/require-all/package.json | 6 +- node_modules/mysql/package.json | 21 +- node_modules/mysql2/Changelog.md | 29 +- node_modules/mysql2/README.md | 164 +- node_modules/mysql2/benchmarks/run-unit.js | 134 + .../unit/fixtures/column_definition0 | Bin 0 -> 43 bytes .../unit/fixtures/column_definition1 | Bin 0 -> 43 bytes .../unit/fixtures/column_definition10 | Bin 0 -> 61 bytes .../unit/fixtures/column_definition11 | Bin 0 -> 59 bytes .../unit/fixtures/column_definition12 | Bin 0 -> 53 bytes .../unit/fixtures/column_definition13 | Bin 0 -> 55 bytes .../unit/fixtures/column_definition14 | Bin 0 -> 65 bytes .../unit/fixtures/column_definition15 | Bin 0 -> 55 bytes .../unit/fixtures/column_definition16 | Bin 0 -> 55 bytes .../unit/fixtures/column_definition17 | Bin 0 -> 59 bytes .../unit/fixtures/column_definition18 | Bin 0 -> 55 bytes .../unit/fixtures/column_definition19 | Bin 0 -> 77 bytes .../unit/fixtures/column_definition2 | Bin 0 -> 51 bytes .../unit/fixtures/column_definition20 | Bin 0 -> 67 bytes .../unit/fixtures/column_definition21 | Bin 0 -> 59 bytes .../unit/fixtures/column_definition22 | Bin 0 -> 65 bytes .../unit/fixtures/column_definition23 | Bin 0 -> 67 bytes .../unit/fixtures/column_definition24 | Bin 0 -> 67 bytes .../unit/fixtures/column_definition25 | Bin 0 -> 63 bytes .../unit/fixtures/column_definition26 | Bin 0 -> 73 bytes .../unit/fixtures/column_definition27 | Bin 0 -> 71 bytes .../unit/fixtures/column_definition28 | Bin 0 -> 67 bytes .../unit/fixtures/column_definition29 | Bin 0 -> 55 bytes .../unit/fixtures/column_definition3 | Bin 0 -> 57 bytes .../unit/fixtures/column_definition30 | Bin 0 -> 59 bytes .../unit/fixtures/column_definition31 | Bin 0 -> 79 bytes .../unit/fixtures/column_definition32 | Bin 0 -> 51 bytes .../unit/fixtures/column_definition33 | Bin 0 -> 55 bytes .../unit/fixtures/column_definition34 | Bin 0 -> 57 bytes .../unit/fixtures/column_definition35 | Bin 0 -> 59 bytes .../unit/fixtures/column_definition36 | Bin 0 -> 61 bytes .../unit/fixtures/column_definition37 | Bin 0 -> 57 bytes .../unit/fixtures/column_definition38 | Bin 0 -> 65 bytes .../unit/fixtures/column_definition39 | Bin 0 -> 75 bytes .../unit/fixtures/column_definition4 | Bin 0 -> 57 bytes .../unit/fixtures/column_definition40 | Bin 0 -> 47 bytes .../unit/fixtures/column_definition41 | Bin 0 -> 77 bytes .../unit/fixtures/column_definition42 | Bin 0 -> 67 bytes .../unit/fixtures/column_definition5 | Bin 0 -> 57 bytes .../unit/fixtures/column_definition6 | Bin 0 -> 57 bytes .../unit/fixtures/column_definition7 | Bin 0 -> 57 bytes .../unit/fixtures/column_definition8 | Bin 0 -> 53 bytes .../unit/fixtures/column_definition9 | Bin 0 -> 57 bytes .../mysql2/benchmarks/unit/packet_parser.js | 47 + .../unit/packets/column_definition.js | 56 + .../unit/simple/buffer-to-string.js | 24 + node_modules/mysql2/debug.md | 39 - node_modules/mysql2/dump.rdb | Bin 5178 -> 0 bytes .../mysql2/examples/connect-over-socks.js | 33 + node_modules/mysql2/examples/execute.js | 7 + node_modules/mysql2/examples/pass-sha.js | 8 + node_modules/mysql2/examples/prepare.js | 5 + node_modules/mysql2/examples/server.js | 22 +- node_modules/mysql2/examples/sprocedure.js | 11 - .../mysql2/fixtures/ssl-profiles.json | 5 + node_modules/mysql2/index.js | 1 - node_modules/mysql2/inflate-test.js | 3 - node_modules/mysql2/lib/auth_41.js | 75 + .../mysql2/lib/commands/change_user.js | 45 + .../mysql2/lib/commands/client_handshake.js | 20 +- .../mysql2/lib/commands/close_statement.js | 18 + node_modules/mysql2/lib/commands/execute.js | 158 +- node_modules/mysql2/lib/commands/index.js | 4 +- node_modules/mysql2/lib/commands/prepare.js | 112 + node_modules/mysql2/lib/commands/query.js | 88 +- .../mysql2/lib/commands/server_handshake.js | 47 +- .../mysql2/lib/compile_binary_parser.js | 13 +- node_modules/mysql2/lib/connection.js | 198 +- node_modules/mysql2/lib/connection.js.orig | 674 ++ node_modules/mysql2/lib/connection_config.js | 49 +- node_modules/mysql2/lib/packet_parser.js | 146 +- .../mysql2/lib/packets/binlog_dump.js | 4 +- .../mysql2/lib/packets/change_user.js | 50 + .../mysql2/lib/packets/close_statement.js | 19 + .../mysql2/lib/packets/column_definition.js | 73 +- node_modules/mysql2/lib/packets/execute.js | 2 +- node_modules/mysql2/lib/packets/handshake.js | 4 +- .../mysql2/lib/packets/handshake_response.js | 67 +- node_modules/mysql2/lib/packets/index.js | 12 +- node_modules/mysql2/lib/packets/packet.js | 34 +- .../mysql2/lib/packets/prepare_statement.js | 2 +- node_modules/mysql2/lib/packets/query.js | 6 +- .../mysql2/lib/packets/register_slave.js | 4 +- .../mysql2/lib/packets/resultset_header.js | 5 +- .../mysql2/lib/packets/ssl_request.js | 4 +- node_modules/mysql2/lib/packets/text_row.js | 8 +- node_modules/mysql2/lib/pool.js | 1 - node_modules/mysql2/lib/results_stream.js | 7 +- node_modules/mysql2/lib/server.js | 8 +- node_modules/mysql2/lib/sql_string.js | 33 +- node_modules/mysql2/load.js | 5 + node_modules/mysql2/node_modules/bn.js/1.js | 17 - .../mysql2/node_modules/bn.js/lib/bn.js | 377 +- .../mysql2/node_modules/bn.js/package.json | 19 +- .../mysql2/node_modules/bn.js/test/bn-test.js | 137 + .../node_modules/bn.js/test/fixtures.js | 264 + .../bn.js/test/pummel/dh-group-test.js | 21 + .../node_modules/bn.js/test/red-test.js | 1 + .../node_modules/ansicolors/package.json | 2 +- .../redeyed/node_modules/esprima/package.json | 2 +- .../node_modules/redeyed/package.json | 2 +- .../mysql2/node_modules/cardinal/package.json | 20 +- .../double-ended-queue/.npmignore | 31 + .../double-ended-queue/Gruntfile.js | 188 + .../node_modules/double-ended-queue}/LICENSE | 8 +- .../node_modules/double-ended-queue/README.md | 293 + .../double-ended-queue/js/deque.js | 287 + .../double-ended-queue/package.json | 64 + .../mysql2/node_modules/fastqueue/README.md | 26 - .../node_modules/fastqueue/package.json | 28 - .../mysql2/node_modules/fastqueue/queue.js | 67 - .../named-placeholders/.npmignore | 17 + .../named-placeholders}/.travis.yml | 1 + .../node_modules/named-placeholders}/LICENSE | 12 +- .../node_modules/named-placeholders/README.md | 29 + .../node_modules/named-placeholders/index.js | 110 + .../node_modules/lru-cache/.npmignore | 1 + .../node_modules/lru-cache/CONTRIBUTORS | 14 + .../node_modules/lru-cache/LICENSE | 23 + .../node_modules/lru-cache/README.md | 97 + .../node_modules/lru-cache/lib/lru-cache.js | 252 + .../node_modules/lru-cache/package.json | 33 + .../node_modules/lru-cache/test/basic.js | 369 + .../node_modules/lru-cache/test/foreach.js | 52 + .../lru-cache/test/memory-leak.js | 50 + .../named-placeholders/package.json | 58 + .../named-placeholders/test/example.md | 13 + .../named-placeholders/test/mocha.opts | 2 + node_modules/mysql2/package.json | 33 +- node_modules/mysql2/select.js | 52 + node_modules/mysql2/test/common.js | 11 +- .../connection/test-binary-charset-string.js | 5 +- .../connection/test-buffer-params.js | 2 +- .../connection/test-change-user.js | 57 + .../connection/test-connect-sha1.js | 68 + .../connection/test-custom-date-parameter.js | 2 +- .../connection/test-date-parameter.js | 2 +- .../integration/connection/test-datetime.js | 5 +- .../integration/connection/test-domains.js | 8 +- .../integration/connection/test-errors.js | 2 +- .../integration/connection/test-execute-1.js | 2 +- .../connection/test-execute-and-unprepare.js | 21 + .../connection/test-execute-cached.js | 35 + .../connection/test-execute-newdecimal.js | 2 +- .../connection/test-execute-nocolumndef.js | 149 + .../connection/test-execute-null-bitmap.js | 2 +- .../connection/test-execute-signed.js | 2 +- .../connection/test-execute-type-casting.js | 3 +- .../connection/test-handshake-errors.js | 24 - .../connection/test-invalid-date-result.js | 3 +- .../connection/test-load-infile.js | 73 + .../connection/test-multiple-results.js | 20 +- .../connection/test-named-paceholders.js | 41 + .../connection/test-nested-tables-query.js | 4 +- .../connection/test-null-double.js | 2 +- .../integration/connection/test-null-int.js | 3 +- .../test/integration/connection/test-null.js | 3 +- .../connection/test-prepare-and-close.js | 26 + .../connection/test-prepare-simple.js | 29 + .../connection/test-prepare-then-execute.js | 26 + .../integration/connection/test-select-1.js | 3 +- .../connection/test-select-empty-string.js | 3 +- .../connection/test-select-negative.js | 3 +- .../connection/test-select-utf8.js | 2 +- .../connection/test-select-utf8mb4.js | 3 +- .../connection/test-server-listen.js | 35 + .../connection/test-signed-tinyint.js | 2 +- .../integration/connection/test-timestamp.js | 4 +- .../connection/test-type-cast-null-fields.js | 2 +- .../connection/test-type-casting.js | 2 +- .../test/unit/protocol/test-SqlString.js | 175 + .../mysql2/test/unit/test-packet-parser.js | 80 + node_modules/mysql2/ttt.js | 17 - node_modules/node-firebird/.npmignore | 3 +- node_modules/node-firebird/README.md | 13 +- node_modules/node-firebird/lib/index.js | 189 +- node_modules/node-firebird/lib/serialize.js | 4 +- node_modules/node-firebird/package.json | 17 +- node_modules/node-firebird/test/image.png | Bin 5472 -> 0 bytes node_modules/node-firebird/test/run.js | 454 - node_modules/pg/.npmignore | 4 + node_modules/pg/.travis.yml | 1 + node_modules/pg/Makefile | 36 +- node_modules/pg/NEWS.md | 11 + node_modules/pg/README.md | 59 +- node_modules/pg/benchmark/4e822a1.txt | 17 - node_modules/pg/benchmark/835f71a76f.txt | 17 - node_modules/pg/benchmark/df766c913.txt | 17 - node_modules/pg/benchmark/index.js | 42 - node_modules/pg/benchmark/prepare-values.js | 46 - .../benchmark/prepared-statement-parsing.js | 73 - .../pg/benchmark/simple-query-parsing.js | 59 - node_modules/pg/binding.gyp | 38 - node_modules/pg/lib/client.js | 58 +- node_modules/pg/lib/connection.js | 5 + node_modules/pg/lib/copystream.js | 206 - node_modules/pg/lib/index.js | 10 +- node_modules/pg/lib/native/index.js | 347 +- node_modules/pg/lib/native/query.js | 177 +- node_modules/pg/lib/native/result.js | 22 + node_modules/pg/lib/query.js | 4 +- node_modules/pg/lib/result.js | 4 +- node_modules/pg/lib/type-overrides.js | 30 + node_modules/pg/node_modules/.bin/semver | 1 + .../pg/node_modules/bindings/README.md | 97 - .../pg/node_modules/bindings/bindings.js | 166 - .../pg/node_modules/bindings/package.json | 56 - node_modules/pg/node_modules/nan/.dntrc | 30 - node_modules/pg/node_modules/nan/CHANGELOG.md | 200 - node_modules/pg/node_modules/nan/LICENSE | 46 - node_modules/pg/node_modules/nan/README.md | 1054 -- node_modules/pg/node_modules/nan/appveyor.yml | 32 - .../pg/node_modules/nan/include_dirs.js | 1 - node_modules/pg/node_modules/nan/nan.h | 2331 ---- node_modules/pg/node_modules/nan/package.json | 78 - .../split/node_modules/through/package.json | 2 +- .../pgpass/node_modules/split/package.json | 16 +- .../pgpass/node_modules/split/readme.markdown | 12 + .../pg/node_modules/semver/.npmignore | 1 + node_modules/pg/node_modules/semver/LICENSE | 27 + node_modules/pg/node_modules/semver/Makefile | 24 + node_modules/pg/node_modules/semver/README.md | 300 + .../pg/node_modules/semver/bin/semver | 133 + .../pg/node_modules/semver/foot.js.txt | 6 + .../pg/node_modules/semver/head.js.txt | 2 + .../pg/node_modules/semver/package.json | 55 + .../pg/node_modules/semver/semver.browser.js | 1147 ++ .../node_modules/semver/semver.browser.js.gz | Bin 0 -> 7739 bytes node_modules/pg/node_modules/semver/semver.js | 1151 ++ .../pg/node_modules/semver/semver.min.js | 1 + .../pg/node_modules/semver/semver.min.js.gz | Bin 0 -> 3564 bytes .../pg/node_modules/semver/test/amd.js | 15 + .../pg/node_modules/semver/test/clean.js | 29 + .../pg/node_modules/semver/test/gtr.js | 173 + .../pg/node_modules/semver/test/index.js | 682 ++ .../pg/node_modules/semver/test/ltr.js | 181 + .../pg/node_modules/semver/test/no-module.js | 19 + node_modules/pg/package.json | 31 +- node_modules/pg/src/binding.cc | 957 -- node_modules/pg/test/cli.js | 4 + .../test/integration/client/appname-tests.js | 3 +- .../integration/client/cancel-query-tests.js | 14 +- .../pg/test/integration/client/copy-tests.js | 168 - .../integration/client/custom-types-tests.js | 18 + .../client/error-handling-tests.js | 18 +- .../client/force-native-with-envvar-tests.js | 1 + .../test/integration/client/notice-tests.js | 1 + .../client/query-callback-error-tests.js | 1 + ...error-handling-prepared-statement-tests.js | 2 +- .../client/query-error-handling-tests.js | 48 + .../client/result-metadata-tests.js | 1 + .../integration/client/type-coercion-tests.js | 6 +- .../client/type-parser-override-tests.js | 34 + .../connection-pool/error-tests.js | 7 +- .../connection-pool/max-connection-tests.js | 3 +- .../test/integration/gh-issues/699-tests.js | 27 + .../pg/test/native/copy-events-tests.js | 40 - .../pg/test/native/copyto-largedata-tests.js | 23 - .../pg/test/native/evented-api-tests.js | 57 +- node_modules/pg/test/native/missing-native.js | 8 + node_modules/pg/test/native/stress-tests.js | 6 +- node_modules/pg/test/test-helper.js | 3 +- .../pg/test/unit/copystream/copyfrom-tests.js | 99 - .../pg/test/unit/copystream/copyto-tests.js | 122 - node_modules/pg/wscript | 32 - 612 files changed, 41581 insertions(+), 36451 deletions(-) create mode 100644 node_modules/es6-shim/.flowconfig create mode 100644 node_modules/es6-shim/.jshintrc create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/index.js create mode 120000 node_modules/grunt-istanbul/node_modules/chalk/node_modules/.bin/has-ansi create mode 120000 node_modules/grunt-istanbul/node_modules/chalk/node_modules/.bin/strip-ansi create mode 120000 node_modules/grunt-istanbul/node_modules/chalk/node_modules/.bin/supports-color create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/ansi-styles/index.js create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/ansi-styles/package.json create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/ansi-styles/readme.md create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/escape-string-regexp/index.js create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/escape-string-regexp/package.json create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/escape-string-regexp/readme.md create mode 100755 node_modules/grunt-istanbul/node_modules/chalk/node_modules/has-ansi/cli.js create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/has-ansi/index.js create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/has-ansi/package.json create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/has-ansi/readme.md create mode 100755 node_modules/grunt-istanbul/node_modules/chalk/node_modules/strip-ansi/cli.js create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/strip-ansi/index.js create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/strip-ansi/package.json create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/strip-ansi/readme.md create mode 100755 node_modules/grunt-istanbul/node_modules/chalk/node_modules/supports-color/cli.js create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/supports-color/index.js create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/supports-color/package.json create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/node_modules/supports-color/readme.md create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/package.json create mode 100644 node_modules/grunt-istanbul/node_modules/chalk/readme.md delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/README.md delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/component.json delete mode 100755 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/lib/async.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/package.json create mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/mapping-list.js create mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/mapping-list.js create mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.npmignore delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile create mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/bower.json delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js create mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/foo.js create mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/gulpfile.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings_standalone.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test.html delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/jquery.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/jslitmus.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.css delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.js delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.npmignore delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/.travis.yml delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CNAME delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CONTRIBUTING.md delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/favicon.ico delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.html delete mode 100644 node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js create mode 100644 node_modules/jsdoc/.editorconfig rename node_modules/jsdoc/{changes.md => CHANGES.md} (65%) delete mode 100644 node_modules/jsdoc/node_modules/async/.gitmodules delete mode 100644 node_modules/jsdoc/node_modules/async/.npmignore delete mode 100644 node_modules/jsdoc/node_modules/async/Makefile delete mode 100644 node_modules/jsdoc/node_modules/async/README.md delete mode 100644 node_modules/jsdoc/node_modules/async/index.js delete mode 100644 node_modules/jsdoc/node_modules/async/lib/async.js delete mode 100644 node_modules/jsdoc/node_modules/async/package.json create mode 100644 node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/LICENSE create mode 100644 node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/README.md create mode 100644 node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/package.json create mode 100644 node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore-min.js rename node_modules/{grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test => jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore}/underscore.js (72%) create mode 100644 node_modules/jsdoc/node_modules/escape-string-regexp/index.js create mode 100644 node_modules/jsdoc/node_modules/escape-string-regexp/package.json create mode 100644 node_modules/jsdoc/node_modules/escape-string-regexp/readme.md delete mode 100644 node_modules/jsdoc/node_modules/js2xmlparser/.gitattributes create mode 100644 node_modules/jsdoc/node_modules/marked/bower.json create mode 100644 node_modules/jsdoc/node_modules/marked/marked.min.js create mode 100644 node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/LICENSE create mode 100644 node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/README.md create mode 100644 node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/package.json create mode 100644 node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore-min.js create mode 100644 node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore.js delete mode 100644 node_modules/jsdoc/node_modules/wrench/lib/x.js create mode 100644 node_modules/jsdoc/node_modules/wrench/tests/copydirsync_unix.js create mode 100644 node_modules/jsdoc/node_modules/wrench/tests/rmdirSyncRecursive.js create mode 100644 node_modules/jsdoc/node_modules/wrench/tests/shown/.hidden.txt create mode 100644 node_modules/jsdoc/node_modules/wrench/tests/shown/.hidden/dolor.md create mode 100644 node_modules/jsdoc/node_modules/wrench/tests/shown/bar.txt create mode 100644 node_modules/jsdoc/node_modules/wrench/tests/shown/foo/bar/ipsum.js create mode 100644 node_modules/jsdoc/node_modules/wrench/tests/shown/foo/dolor.md create mode 100644 node_modules/jsdoc/node_modules/wrench/tests/shown/foo/lorem.txt create mode 100644 node_modules/jsdoc/node_modules/wrench/tests/withsymlinks/test create mode 100644 node_modules/jsdoc/plugins/summarize.js create mode 100644 node_modules/jsdoc/plugins/test/fixtures/markdown.js delete mode 100644 node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js create mode 100644 node_modules/jsdoc/plugins/test/fixtures/underscore.js create mode 100644 node_modules/jsdoc/plugins/test/specs/summarize.js create mode 100644 node_modules/jsdoc/plugins/test/specs/underscore.js create mode 100644 node_modules/jsdoc/plugins/underscore.js create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.eot create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.svg create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.woff create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.eot create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.svg create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.woff create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.eot create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.svg create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.woff create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.eot create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.svg create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.woff create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.eot create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.svg create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.woff create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.eot create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.svg create mode 100644 node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.woff create mode 100644 node_modules/jsdoc/templates/default/tmpl/augments.tmpl create mode 100755 node_modules/mysql2/benchmarks/run-unit.js create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition0 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition1 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition10 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition11 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition12 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition13 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition14 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition15 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition16 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition17 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition18 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition19 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition2 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition20 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition21 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition22 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition23 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition24 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition25 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition26 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition27 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition28 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition29 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition3 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition30 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition31 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition32 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition33 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition34 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition35 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition36 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition37 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition38 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition39 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition4 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition40 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition41 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition42 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition5 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition6 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition7 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition8 create mode 100644 node_modules/mysql2/benchmarks/unit/fixtures/column_definition9 create mode 100644 node_modules/mysql2/benchmarks/unit/packet_parser.js create mode 100644 node_modules/mysql2/benchmarks/unit/packets/column_definition.js create mode 100644 node_modules/mysql2/benchmarks/unit/simple/buffer-to-string.js delete mode 100644 node_modules/mysql2/debug.md delete mode 100644 node_modules/mysql2/dump.rdb create mode 100644 node_modules/mysql2/examples/connect-over-socks.js create mode 100644 node_modules/mysql2/examples/pass-sha.js create mode 100644 node_modules/mysql2/examples/prepare.js delete mode 100644 node_modules/mysql2/examples/sprocedure.js create mode 100644 node_modules/mysql2/fixtures/ssl-profiles.json delete mode 100644 node_modules/mysql2/inflate-test.js create mode 100644 node_modules/mysql2/lib/auth_41.js create mode 100644 node_modules/mysql2/lib/commands/change_user.js create mode 100644 node_modules/mysql2/lib/commands/close_statement.js create mode 100644 node_modules/mysql2/lib/commands/prepare.js create mode 100644 node_modules/mysql2/lib/connection.js.orig create mode 100644 node_modules/mysql2/lib/packets/change_user.js create mode 100644 node_modules/mysql2/lib/packets/close_statement.js create mode 100644 node_modules/mysql2/load.js delete mode 100644 node_modules/mysql2/node_modules/bn.js/1.js create mode 100644 node_modules/mysql2/node_modules/bn.js/test/fixtures.js create mode 100644 node_modules/mysql2/node_modules/bn.js/test/pummel/dh-group-test.js create mode 100644 node_modules/mysql2/node_modules/double-ended-queue/.npmignore create mode 100644 node_modules/mysql2/node_modules/double-ended-queue/Gruntfile.js rename node_modules/{jsdoc/node_modules/async => mysql2/node_modules/double-ended-queue}/LICENSE (82%) create mode 100644 node_modules/mysql2/node_modules/double-ended-queue/README.md create mode 100644 node_modules/mysql2/node_modules/double-ended-queue/js/deque.js create mode 100644 node_modules/mysql2/node_modules/double-ended-queue/package.json delete mode 100644 node_modules/mysql2/node_modules/fastqueue/README.md delete mode 100644 node_modules/mysql2/node_modules/fastqueue/package.json delete mode 100644 node_modules/mysql2/node_modules/fastqueue/queue.js create mode 100644 node_modules/mysql2/node_modules/named-placeholders/.npmignore rename node_modules/{grunt-istanbul/node_modules/istanbul/node_modules/async => mysql2/node_modules/named-placeholders}/.travis.yml (77%) rename node_modules/{grunt-istanbul/node_modules/istanbul/node_modules/async => mysql2/node_modules/named-placeholders}/LICENSE (86%) create mode 100644 node_modules/mysql2/node_modules/named-placeholders/README.md create mode 100644 node_modules/mysql2/node_modules/named-placeholders/index.js create mode 100644 node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/.npmignore create mode 100644 node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/CONTRIBUTORS create mode 100644 node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/LICENSE create mode 100644 node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/README.md create mode 100644 node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/lib/lru-cache.js create mode 100644 node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/package.json create mode 100644 node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/test/basic.js create mode 100644 node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/test/foreach.js create mode 100644 node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/test/memory-leak.js create mode 100644 node_modules/mysql2/node_modules/named-placeholders/package.json create mode 100644 node_modules/mysql2/node_modules/named-placeholders/test/example.md create mode 100644 node_modules/mysql2/node_modules/named-placeholders/test/mocha.opts create mode 100644 node_modules/mysql2/select.js create mode 100644 node_modules/mysql2/test/integration/connection/test-change-user.js create mode 100644 node_modules/mysql2/test/integration/connection/test-connect-sha1.js create mode 100644 node_modules/mysql2/test/integration/connection/test-execute-and-unprepare.js create mode 100644 node_modules/mysql2/test/integration/connection/test-execute-cached.js create mode 100644 node_modules/mysql2/test/integration/connection/test-execute-nocolumndef.js delete mode 100644 node_modules/mysql2/test/integration/connection/test-handshake-errors.js create mode 100644 node_modules/mysql2/test/integration/connection/test-load-infile.js create mode 100644 node_modules/mysql2/test/integration/connection/test-named-paceholders.js create mode 100644 node_modules/mysql2/test/integration/connection/test-prepare-and-close.js create mode 100644 node_modules/mysql2/test/integration/connection/test-prepare-simple.js create mode 100644 node_modules/mysql2/test/integration/connection/test-prepare-then-execute.js create mode 100644 node_modules/mysql2/test/integration/connection/test-server-listen.js create mode 100644 node_modules/mysql2/test/unit/protocol/test-SqlString.js create mode 100644 node_modules/mysql2/test/unit/test-packet-parser.js delete mode 100644 node_modules/mysql2/ttt.js delete mode 100644 node_modules/node-firebird/test/image.png delete mode 100644 node_modules/node-firebird/test/run.js delete mode 100644 node_modules/pg/benchmark/4e822a1.txt delete mode 100644 node_modules/pg/benchmark/835f71a76f.txt delete mode 100644 node_modules/pg/benchmark/df766c913.txt delete mode 100644 node_modules/pg/benchmark/index.js delete mode 100644 node_modules/pg/benchmark/prepare-values.js delete mode 100644 node_modules/pg/benchmark/prepared-statement-parsing.js delete mode 100644 node_modules/pg/benchmark/simple-query-parsing.js delete mode 100644 node_modules/pg/binding.gyp delete mode 100644 node_modules/pg/lib/copystream.js create mode 100644 node_modules/pg/lib/native/result.js create mode 100644 node_modules/pg/lib/type-overrides.js create mode 120000 node_modules/pg/node_modules/.bin/semver delete mode 100644 node_modules/pg/node_modules/bindings/README.md delete mode 100644 node_modules/pg/node_modules/bindings/bindings.js delete mode 100644 node_modules/pg/node_modules/bindings/package.json delete mode 100644 node_modules/pg/node_modules/nan/.dntrc delete mode 100644 node_modules/pg/node_modules/nan/CHANGELOG.md delete mode 100644 node_modules/pg/node_modules/nan/LICENSE delete mode 100644 node_modules/pg/node_modules/nan/README.md delete mode 100644 node_modules/pg/node_modules/nan/appveyor.yml delete mode 100644 node_modules/pg/node_modules/nan/include_dirs.js delete mode 100644 node_modules/pg/node_modules/nan/nan.h delete mode 100644 node_modules/pg/node_modules/nan/package.json create mode 100644 node_modules/pg/node_modules/semver/.npmignore create mode 100644 node_modules/pg/node_modules/semver/LICENSE create mode 100644 node_modules/pg/node_modules/semver/Makefile create mode 100644 node_modules/pg/node_modules/semver/README.md create mode 100755 node_modules/pg/node_modules/semver/bin/semver create mode 100644 node_modules/pg/node_modules/semver/foot.js.txt create mode 100644 node_modules/pg/node_modules/semver/head.js.txt create mode 100644 node_modules/pg/node_modules/semver/package.json create mode 100644 node_modules/pg/node_modules/semver/semver.browser.js create mode 100644 node_modules/pg/node_modules/semver/semver.browser.js.gz create mode 100644 node_modules/pg/node_modules/semver/semver.js create mode 100644 node_modules/pg/node_modules/semver/semver.min.js create mode 100644 node_modules/pg/node_modules/semver/semver.min.js.gz create mode 100644 node_modules/pg/node_modules/semver/test/amd.js create mode 100644 node_modules/pg/node_modules/semver/test/clean.js create mode 100644 node_modules/pg/node_modules/semver/test/gtr.js create mode 100644 node_modules/pg/node_modules/semver/test/index.js create mode 100644 node_modules/pg/node_modules/semver/test/ltr.js create mode 100644 node_modules/pg/node_modules/semver/test/no-module.js delete mode 100644 node_modules/pg/src/binding.cc delete mode 100644 node_modules/pg/test/integration/client/copy-tests.js create mode 100644 node_modules/pg/test/integration/client/custom-types-tests.js create mode 100644 node_modules/pg/test/integration/client/type-parser-override-tests.js create mode 100644 node_modules/pg/test/integration/gh-issues/699-tests.js delete mode 100644 node_modules/pg/test/native/copy-events-tests.js delete mode 100644 node_modules/pg/test/native/copyto-largedata-tests.js create mode 100644 node_modules/pg/test/native/missing-native.js delete mode 100644 node_modules/pg/test/unit/copystream/copyfrom-tests.js delete mode 100644 node_modules/pg/test/unit/copystream/copyto-tests.js delete mode 100644 node_modules/pg/wscript diff --git a/lib/driver.js b/lib/driver.js index 7b77c2c..0cad5a5 100755 --- a/lib/driver.js +++ b/lib/driver.js @@ -72,7 +72,7 @@ var d = { } // Handle commas - if (str.contains(',')) + if (str.includes(',')) { var parts = str.split(',').map(helpers.stringTrim); str = parts.map(d.quoteIdentifiers).join(','); @@ -83,7 +83,7 @@ var d = { raw = hiers.join('.'); // Fix functions - if (raw.contains('(') && raw.contains(')')) + if (raw.includes('(') && raw.includes(')')) { var funcs = pattern.exec(raw); diff --git a/node_modules/dblite/package.json b/node_modules/dblite/package.json index fc82d7c..4bdb198 100644 --- a/node_modules/dblite/package.json +++ b/node_modules/dblite/package.json @@ -39,7 +39,7 @@ }, "_id": "dblite@0.6.1", "_shasum": "18e6d3811f4031ff0119e8a7b13ef1558215376a", - "_from": "dblite@^0.6.1", + "_from": "dblite@>=0.6.1 <0.7.0", "_npmVersion": "1.4.9", "_npmUser": { "name": "webreflection", diff --git a/node_modules/es6-shim/.flowconfig b/node_modules/es6-shim/.flowconfig new file mode 100644 index 0000000..5a47ff4 --- /dev/null +++ b/node_modules/es6-shim/.flowconfig @@ -0,0 +1,8 @@ +[ignore] +.min.js +Gruntfile.js +.map + +[include] +es6-shim.js +es6-sham.js diff --git a/node_modules/es6-shim/.jscs.json b/node_modules/es6-shim/.jscs.json index 8bca4f1..496777b 100644 --- a/node_modules/es6-shim/.jscs.json +++ b/node_modules/es6-shim/.jscs.json @@ -13,6 +13,8 @@ "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + "requireSpaceBetweenArguments": true, + "disallowSpacesInsideParentheses": true, "disallowSpacesInsideArrayBrackets": true, diff --git a/node_modules/es6-shim/.jshintrc b/node_modules/es6-shim/.jshintrc new file mode 100644 index 0000000..20688b7 --- /dev/null +++ b/node_modules/es6-shim/.jshintrc @@ -0,0 +1,3 @@ +{ + "es3": true +} diff --git a/node_modules/es6-shim/CHANGELOG.md b/node_modules/es6-shim/CHANGELOG.md index 23f0881..dc20110 100644 --- a/node_modules/es6-shim/CHANGELOG.md +++ b/node_modules/es6-shim/CHANGELOG.md @@ -1,5 +1,48 @@ # es6-shim x.x.x (not yet released) +# es6-shim 0.23.0 (26 Jan 2015) +* Use Symbol.species when available, else fall back to "@@species" (renamed from "@@create") +* Fix `npm run test-native` +* Correct broken Math implementations: `log1p`, `exmp1`, `tanh`, `acosh`, `cosh`, `sinh`, `round` (#314) +* Update `jscs`, `grunt-saucelabs`, `jshint` + +# es6-shim 0.22.2 (4 Jan 2015) +* Faster travis-ci builds +* Better ES3 support: quoting/avoiding reserved words +* Update `mocha`, `jscs`, `jshint`, `grunt-saucelabs`, `uglify-js` + +# es6-shim 0.22.1 (13 Dec 2014) +* Make RegExp#flags generic, per spec (#310) + +# es6-shim 0.22.0 (12 Dec 2014) +* Add RegExp#flags +* Make `new RegExp` work with both a regex and a flags string +* Remove non-spec `Object.{getPropertyNames,getPropertyDescriptor}` + +# es6-shim 0.21.1 (4 Dec 2014) +* Promise/Promise.prototype methods, and String#{startsWith,endsWith} are now not enumerable +* Array#{keys, values, entries} should all be @@unscopeable in browsers that support that +* Ensure that tampering with Function#{call,apply} won’t break internal methods +* Add Math.clz32, RegExp tests +* Update es6-sham UMD +* Update `chai`, `es5-shim`, `grunt-saucelabs`, `jscs` + +# es6-shim 0.21.0 (21 Nov 2014) +* String#contains → String#includes per 2014-11-19 TC39 meeting +* Use an invalid identifier as the es6-shim iterator key, so it doesn’t show up in the console as easily. + +# es6-shim 0.20.4 (20 Nov 2014) +* Performance improvements: avoid slicing arguments, avoid `Function#call` when possible +* Name `String.{fromCodePoint,raw}` for debugging +* Fix `String.raw` to match spec +* Ensure Chrome’s excess Promise methods are purged +* Ensure `Set#keys === Set#values`, per spec + +# es6-shim 0.20.3 (19 Nov 2014) +* Fix Set#add and Map#set to always return "this" (#302) +* Clarify TypeError messages thrown by Map/Set +* Fix Chrome 38 bug with Array#values + # es6-shim 0.20.2 (28 Oct 2014) * Fix AMD (#299) @@ -20,7 +63,7 @@ # es6-shim 0.19.0 (9 Oct 2014) * Detect and override noncompliant Map in Firefox 32 (#294) -* Fix Map and Set for engines that don't preserve numeric key order (#292, #290) +* Fix Map and Set for engines that don’t preserve numeric key order (#292, #290) * Detect and override noncompliant Safari 7.1 Promises (#289) * Fix Array#keys and Array#entries in Safari 7.1 * General style and whitespace cleanup @@ -57,9 +100,9 @@ # es6-shim 0.14.0 (20 Jul 2014) * Properly recognize Symbol.iterator when it is present (#277) -* Fix Math.clz's improper handling of values that coerce to NaN (#269) +* Fix Math.clz’s improper handling of values that coerce to NaN (#269) * Fix incorrect handling of negative end index on Array#fill (#270) -* Removed Object.getOwnPropertyKeys, which shouldn't be anywhere (#267) +* Removed Object.getOwnPropertyKeys, which shouldn’t be anywhere (#267) * Fixed arity of Map and Set constructors, per 2014.04.27 draft spec (rev 24) * Added a full additional suite of ES6 promise tests (thanks to @smikes!) (#265) * Make Number.isInteger a bit more efficient (#266) @@ -92,7 +135,7 @@ # es6-shim 0.10.1 (13 Mar 2014) * Update bower.json, component.json, and .npmignore (#229, #230, #233) * Minor updates to `Promise` implementation and test suite. -* Workaround lack of 'strict mode' in IE9. (#232) +* Workaround lack of "strict mode" in IE9. (#232) # es6-shim 0.10.0 (1 March 2014) * Implement `Promise`, per spec. (#209, #215, #224, #225) diff --git a/node_modules/es6-shim/README.md b/node_modules/es6-shim/README.md index a6948b7..f11b72d 100644 --- a/node_modules/es6-shim/README.md +++ b/node_modules/es6-shim/README.md @@ -36,7 +36,11 @@ details. * `repeat()` ([a standalone shim is also available](http://mths.be/repeat)) * `startsWith()` ([a standalone shim is also available](http://mths.be/startswith)) * `endsWith()` ([a standalone shim is also available](http://mths.be/endswith)) - * `contains()` ([a standalone shim is also available](http://mths.be/contains)) + * `includes()` ([a standalone shim is also available](http://mths.be/includes)) +* `RegExp`: + * `new RegExp`, when given a RegExp as the pattern, will no longer throw when given a "flags" string argument. (requires ES5) +* `RegExp.prototype`: + * `flags` (requires ES5) ([a standalone shim is also available](https://github.com/es-shims/RegExp.prototype.flags)) * `Number`: * `MAX_SAFE_INTEGER` * `MIN_SAFE_INTEGER` @@ -59,10 +63,7 @@ details. * `entries()` * `values()` * `Object`: - * `getPropertyDescriptor()` (ES5) - * `getPropertyNames()` (ES5) - * `getPropertyKeys()` (ES5) - * `keys()` (ES5, but no longer throws on non-object non-null/undefined values in ES6) + * `keys()` (in ES5, but no longer throws on non-object non-null/undefined values in ES6) * `is()` ([a standalone shim is also available](https://github.com/ljharb/object-is)) * `assign()` ([a standalone shim is also available](https://github.com/ljharb/object.assign)) * `setPrototypeOf()` (IE >= 11) @@ -126,7 +127,7 @@ WeakMap has a very unusual use-case so you probably won't need it at all ```javascript 'abc'.startsWith('a') // true 'abc'.endsWith('a') // false -'john alice'.contains('john') // true +'john alice'.includes('john') // true '123'.repeat(2) // '123123' Object.is(NaN, NaN) // Fixes ===. 0 isnt -0, NaN is NaN diff --git a/node_modules/es6-shim/bower.json b/node_modules/es6-shim/bower.json index 8d36fda..426d261 100644 --- a/node_modules/es6-shim/bower.json +++ b/node_modules/es6-shim/bower.json @@ -1,6 +1,6 @@ { "name": "es6-shim", - "version": "0.20.2", + "version": "0.23.0", "repo": "paulmillr/es6-shim", "description": "ECMAScript 6 (Harmony) compatibility shims for legacy JavaScript engines", "keywords": [ diff --git a/node_modules/es6-shim/component.json b/node_modules/es6-shim/component.json index 53d2473..fee8fd9 100644 --- a/node_modules/es6-shim/component.json +++ b/node_modules/es6-shim/component.json @@ -1,6 +1,6 @@ { "name": "es6-shim", - "version": "0.20.2", + "version": "0.23.0", "repo": "paulmillr/es6-shim", "description": "ECMAScript 6 (Harmony) compatibility shims for legacy JavaScript engines", "keywords": [ diff --git a/node_modules/es6-shim/es6-sham.js b/node_modules/es6-shim/es6-sham.js index b18015f..fe67bfd 100644 --- a/node_modules/es6-shim/es6-sham.js +++ b/node_modules/es6-shim/es6-sham.js @@ -2,112 +2,118 @@ * https://github.com/paulmillr/es6-shim * @license es6-shim Copyright 2013-2014 by Paul Miller (http://paulmillr.com) * and contributors, MIT License - * es6-sham: v0.20.2 - * see https://github.com/paulmillr/es6-shim/blob/master/LICENSE + * es6-sham: v0.23.0 + * see https://github.com/paulmillr/es6-shim/blob/0.22.2/LICENSE * Details and documentation: * https://github.com/paulmillr/es6-shim/ */ -(function (undefined) { +// UMD (Universal Module Definition) +// see https://github.com/umdjs/umd/blob/master/returnExports.js +(function (root, factory) { + /*global define, exports, module */ + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(factory); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like enviroments that support module.exports, + // like Node. + module.exports = factory(); + } else { + // Browser globals (root is window) + root.returnExports = factory(); + } +}(this, function (undefined) { 'use strict'; /*jshint evil: true */ var getGlobal = new Function('return this;'); /*jshint evil: false */ - var main = function () { - var globals = getGlobal(); - var Object = globals.Object; + var globals = getGlobal(); + var Object = globals.Object; - // NOTE: This versions needs object ownership - // beacuse every promoted object needs to be reassigned - // otherwise uncompatible browsers cannot work as expected - // - // NOTE: This might need es5-shim or polyfills upfront - // because it's based on ES5 API. - // (probably just an IE <= 8 problem) - // - // NOTE: nodejs is fine in version 0.8, 0.10, and future versions. - (function () { - if (Object.setPrototypeOf) { return; } + // NOTE: This versions needs object ownership + // beacuse every promoted object needs to be reassigned + // otherwise uncompatible browsers cannot work as expected + // + // NOTE: This might need es5-shim or polyfills upfront + // because it's based on ES5 API. + // (probably just an IE <= 8 problem) + // + // NOTE: nodejs is fine in version 0.8, 0.10, and future versions. + (function () { + if (Object.setPrototypeOf) { return; } - /*jshint proto: true */ - // @author Andrea Giammarchi - @WebReflection - // define into target descriptors from source - var copyDescriptors = function (target, source) { - getOwnPropertyNames(source).forEach(function (key) { - defineProperty( - target, - key, - getOwnPropertyDescriptor(source, key) - ); - }); - return target; + /*jshint proto: true */ + // @author Andrea Giammarchi - @WebReflection + // define into target descriptors from source + var copyDescriptors = function (target, source) { + getOwnPropertyNames(source).forEach(function (key) { + defineProperty( + target, + key, + getOwnPropertyDescriptor(source, key) + ); + }); + return target; + }; + // used as fallback when no promotion is possible + var createAndCopy = function (origin, proto) { + return copyDescriptors(create(proto), origin); + }; + var create = Object.create; + var defineProperty = Object.defineProperty; + var getPrototypeOf = Object.getPrototypeOf; + var getOwnPropertyNames = Object.getOwnPropertyNames; + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + var proto = Object.prototype; + var set, setPrototypeOf; + try { + // this might fail for various reasons + // ignore if Chrome cought it at runtime + set = getOwnPropertyDescriptor(proto, '__proto__').set; + set.call({}, null); + // setter not poisoned, it can promote + // Firefox, Chrome + setPrototypeOf = function (origin, proto) { + set.call(origin, proto); + return origin; }; - // used as fallback when no promotion is possible - var createAndCopy = function (origin, proto) { - return copyDescriptors(create(proto), origin); - }; - var create = Object.create; - var defineProperty = Object.defineProperty; - var getPrototypeOf = Object.getPrototypeOf; - var getOwnPropertyNames = Object.getOwnPropertyNames; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var proto = Object.prototype; - var set, setPrototypeOf; - - try { - // this might fail for various reasons - // ignore if Chrome cought it at runtime - set = getOwnPropertyDescriptor(proto, '__proto__').set; - set.call({}, null); - // setter not poisoned, it can promote - // Firefox, Chrome - setPrototypeOf = function (origin, proto) { - set.call(origin, proto); - return origin; - }; - } catch (e) { - // do one or more feature detections - set = {__proto__: null}; - // if proto does not work, needs to fallback - // some Opera, Rhino, ducktape + } catch (e) { + // do one or more feature detections + set = {__proto__: null}; + // if proto does not work, needs to fallback + // some Opera, Rhino, ducktape + if (set instanceof Object) { + setPrototypeOf = createAndCopy; + } else { + // verify if null objects are buggy + set.__proto__ = proto; + // if null objects are buggy + // nodejs 0.8 to 0.10 if (set instanceof Object) { - setPrototypeOf = createAndCopy; + setPrototypeOf = function (origin, proto) { + // use such bug to promote + origin.__proto__ = proto; + return origin; + }; } else { - // verify if null objects are buggy - set.__proto__ = proto; - // if null objects are buggy - // nodejs 0.8 to 0.10 - if (set instanceof Object) { - setPrototypeOf = function (origin, proto) { - // use such bug to promote - origin.__proto__ = proto; - return origin; - }; - } else { - // try to use proto or fallback - // Safari, old Firefox, many others - setPrototypeOf = function (origin, proto) { - // if proto is not null - return getPrototypeOf(origin) ? - // use __proto__ to promote - ((origin.__proto__ = proto), origin) : - // otherwise unable to promote: fallback - createAndCopy(origin, proto); - }; - } + // try to use proto or fallback + // Safari, old Firefox, many others + setPrototypeOf = function (origin, proto) { + // if proto is not null + return getPrototypeOf(origin) ? + // use __proto__ to promote + ((origin.__proto__ = proto), origin) : + // otherwise unable to promote: fallback + createAndCopy(origin, proto); + }; } } - Object.setPrototypeOf = setPrototypeOf; - }()); - - }; - - if (typeof define === 'function' && define.amd) { - define(main); // RequireJS - } else { - main(); // CommonJS and - -``` - -## Documentation - -### Collections - -* [`each`](#each) -* [`eachSeries`](#eachSeries) -* [`eachLimit`](#eachLimit) -* [`map`](#map) -* [`mapSeries`](#mapSeries) -* [`mapLimit`](#mapLimit) -* [`filter`](#filter) -* [`filterSeries`](#filterSeries) -* [`reject`](#reject) -* [`rejectSeries`](#rejectSeries) -* [`reduce`](#reduce) -* [`reduceRight`](#reduceRight) -* [`detect`](#detect) -* [`detectSeries`](#detectSeries) -* [`sortBy`](#sortBy) -* [`some`](#some) -* [`every`](#every) -* [`concat`](#concat) -* [`concatSeries`](#concatSeries) - -### Control Flow - -* [`series`](#seriestasks-callback) -* [`parallel`](#parallel) -* [`parallelLimit`](#parallellimittasks-limit-callback) -* [`whilst`](#whilst) -* [`doWhilst`](#doWhilst) -* [`until`](#until) -* [`doUntil`](#doUntil) -* [`forever`](#forever) -* [`waterfall`](#waterfall) -* [`compose`](#compose) -* [`seq`](#seq) -* [`applyEach`](#applyEach) -* [`applyEachSeries`](#applyEachSeries) -* [`queue`](#queue) -* [`priorityQueue`](#priorityQueue) -* [`cargo`](#cargo) -* [`auto`](#auto) -* [`retry`](#retry) -* [`iterator`](#iterator) -* [`apply`](#apply) -* [`nextTick`](#nextTick) -* [`times`](#times) -* [`timesSeries`](#timesSeries) - -### Utils - -* [`memoize`](#memoize) -* [`unmemoize`](#unmemoize) -* [`log`](#log) -* [`dir`](#dir) -* [`noConflict`](#noConflict) - - -## Collections - - - -### each(arr, iterator, callback) - -Applies the function `iterator` to each item in `arr`, in parallel. -The `iterator` is called with an item from the list, and a callback for when it -has finished. If the `iterator` passes an error to its `callback`, the main -`callback` (for the `each` function) is immediately called with the error. - -Note, that since this function applies `iterator` to each item in parallel, -there is no guarantee that the iterator functions will complete in order. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err)` which must be called once it has - completed. If no error has occured, the `callback` should be run without - arguments or with an explicit `null` argument. -* `callback(err)` - A callback which is called when all `iterator` functions - have finished, or an error occurs. - -__Examples__ - - -```js -// assuming openFiles is an array of file names and saveFile is a function -// to save the modified contents of that file: - -async.each(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error -}); -``` - -```js -// assuming openFiles is an array of file names - -async.each(openFiles, function( file, callback) { - - // Perform operation on file here. - console.log('Processing file ' + file); - - if( file.length > 32 ) { - console.log('This file name is too long'); - callback('File name too long'); - } else { - // Do work to process file here - console.log('File processed'); - callback(); - } -}, function(err){ - // if any of the file processing produced an error, err would equal that error - if( err ) { - // One of the iterations produced an error. - // All processing will now stop. - console.log('A file failed to process'); - } else { - console.log('All files have been processed successfully'); - } -}); -``` - ---------------------------------------- - - - -### eachSeries(arr, iterator, callback) - -The same as [`each`](#each), only `iterator` is applied to each item in `arr` in -series. The next `iterator` is only called once the current one has completed. -This means the `iterator` functions will complete in order. - - ---------------------------------------- - - - -### eachLimit(arr, limit, iterator, callback) - -The same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously -running at any time. - -Note that the items in `arr` are not processed in batches, so there is no guarantee that -the first `limit` `iterator` functions will complete before any others are started. - -__Arguments__ - -* `arr` - An array to iterate over. -* `limit` - The maximum number of `iterator`s to run at any time. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err)` which must be called once it has - completed. If no error has occured, the callback should be run without - arguments or with an explicit `null` argument. -* `callback(err)` - A callback which is called when all `iterator` functions - have finished, or an error occurs. - -__Example__ - -```js -// Assume documents is an array of JSON objects and requestApi is a -// function that interacts with a rate-limited REST api. - -async.eachLimit(documents, 20, requestApi, function(err){ - // if any of the saves produced an error, err would equal that error -}); -``` - ---------------------------------------- - - -### map(arr, iterator, callback) - -Produces a new array of values by mapping each value in `arr` through -the `iterator` function. The `iterator` is called with an item from `arr` and a -callback for when it has finished processing. Each of these callback takes 2 arguments: -an `error`, and the transformed item from `arr`. If `iterator` passes an error to this -callback, the main `callback` (for the `map` function) is immediately called with the error. - -Note, that since this function applies the `iterator` to each item in parallel, -there is no guarantee that the `iterator` functions will complete in order. -However, the results array will be in the same order as the original `arr`. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err, transformed)` which must be called once - it has completed with an error (which can be `null`) and a transformed item. -* `callback(err, results)` - A callback which is called when all `iterator` - functions have finished, or an error occurs. Results is an array of the - transformed items from the `arr`. - -__Example__ - -```js -async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file -}); -``` - ---------------------------------------- - - -### mapSeries(arr, iterator, callback) - -The same as [`map`](#map), only the `iterator` is applied to each item in `arr` in -series. The next `iterator` is only called once the current one has completed. -The results array will be in the same order as the original. - - ---------------------------------------- - - -### mapLimit(arr, limit, iterator, callback) - -The same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously -running at any time. - -Note that the items are not processed in batches, so there is no guarantee that -the first `limit` `iterator` functions will complete before any others are started. - -__Arguments__ - -* `arr` - An array to iterate over. -* `limit` - The maximum number of `iterator`s to run at any time. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err, transformed)` which must be called once - it has completed with an error (which can be `null`) and a transformed item. -* `callback(err, results)` - A callback which is called when all `iterator` - calls have finished, or an error occurs. The result is an array of the - transformed items from the original `arr`. - -__Example__ - -```js -async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){ - // results is now an array of stats for each file -}); -``` - ---------------------------------------- - - - -### filter(arr, iterator, callback) - -__Alias:__ `select` - -Returns a new array of all the values in `arr` which pass an async truth test. -_The callback for each `iterator` call only accepts a single argument of `true` or -`false`; it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like `fs.exists`. This operation is -performed in parallel, but the results array will be in the same order as the -original. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A truth test to apply to each item in `arr`. - The `iterator` is passed a `callback(truthValue)`, which must be called with a - boolean argument once it has completed. -* `callback(results)` - A callback which is called after all the `iterator` - functions have finished. - -__Example__ - -```js -async.filter(['file1','file2','file3'], fs.exists, function(results){ - // results now equals an array of the existing files -}); -``` - ---------------------------------------- - - - -### filterSeries(arr, iterator, callback) - -__Alias:__ `selectSeries` - -The same as [`filter`](#filter) only the `iterator` is applied to each item in `arr` in -series. The next `iterator` is only called once the current one has completed. -The results array will be in the same order as the original. - ---------------------------------------- - - -### reject(arr, iterator, callback) - -The opposite of [`filter`](#filter). Removes values that pass an `async` truth test. - ---------------------------------------- - - -### rejectSeries(arr, iterator, callback) - -The same as [`reject`](#reject), only the `iterator` is applied to each item in `arr` -in series. - - ---------------------------------------- - - -### reduce(arr, memo, iterator, callback) - -__Aliases:__ `inject`, `foldl` - -Reduces `arr` into a single value using an async `iterator` to return -each successive step. `memo` is the initial state of the reduction. -This function only operates in series. - -For performance reasons, it may make sense to split a call to this function into -a parallel map, and then use the normal `Array.prototype.reduce` on the results. -This function is for situations where each step in the reduction needs to be async; -if you can get the data before reducing it, then it's probably a good idea to do so. - -__Arguments__ - -* `arr` - An array to iterate over. -* `memo` - The initial state of the reduction. -* `iterator(memo, item, callback)` - A function applied to each item in the - array to produce the next step in the reduction. The `iterator` is passed a - `callback(err, reduction)` which accepts an optional error as its first - argument, and the state of the reduction as the second. If an error is - passed to the callback, the reduction is stopped and the main `callback` is - immediately called with the error. -* `callback(err, result)` - A callback which is called after all the `iterator` - functions have finished. Result is the reduced value. - -__Example__ - -```js -async.reduce([1,2,3], 0, function(memo, item, callback){ - // pointless async: - process.nextTick(function(){ - callback(null, memo + item) - }); -}, function(err, result){ - // result is now equal to the last value of memo, which is 6 -}); -``` - ---------------------------------------- - - -### reduceRight(arr, memo, iterator, callback) - -__Alias:__ `foldr` - -Same as [`reduce`](#reduce), only operates on `arr` in reverse order. - - ---------------------------------------- - - -### detect(arr, iterator, callback) - -Returns the first value in `arr` that passes an async truth test. The -`iterator` is applied in parallel, meaning the first iterator to return `true` will -fire the detect `callback` with that result. That means the result might not be -the first item in the original `arr` (in terms of order) that passes the test. - -If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries). - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A truth test to apply to each item in `arr`. - The iterator is passed a `callback(truthValue)` which must be called with a - boolean argument once it has completed. -* `callback(result)` - A callback which is called as soon as any iterator returns - `true`, or after all the `iterator` functions have finished. Result will be - the first item in the array that passes the truth test (iterator) or the - value `undefined` if none passed. - -__Example__ - -```js -async.detect(['file1','file2','file3'], fs.exists, function(result){ - // result now equals the first file in the list that exists -}); -``` - ---------------------------------------- - - -### detectSeries(arr, iterator, callback) - -The same as [`detect`](#detect), only the `iterator` is applied to each item in `arr` -in series. This means the result is always the first in the original `arr` (in -terms of array order) that passes the truth test. - - ---------------------------------------- - - -### sortBy(arr, iterator, callback) - -Sorts a list by the results of running each `arr` value through an async `iterator`. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err, sortValue)` which must be called once it - has completed with an error (which can be `null`) and a value to use as the sort - criteria. -* `callback(err, results)` - A callback which is called after all the `iterator` - functions have finished, or an error occurs. Results is the items from - the original `arr` sorted by the values returned by the `iterator` calls. - -__Example__ - -```js -async.sortBy(['file1','file2','file3'], function(file, callback){ - fs.stat(file, function(err, stats){ - callback(err, stats.mtime); - }); -}, function(err, results){ - // results is now the original array of files sorted by - // modified date -}); -``` - -__Sort Order__ - -By modifying the callback parameter the sorting order can be influenced: - -```js -//ascending order -async.sortBy([1,9,3,5], function(x, callback){ - callback(err, x); -}, function(err,result){ - //result callback -} ); - -//descending order -async.sortBy([1,9,3,5], function(x, callback){ - callback(err, x*-1); //<- x*-1 instead of x, turns the order around -}, function(err,result){ - //result callback -} ); -``` - ---------------------------------------- - - -### some(arr, iterator, callback) - -__Alias:__ `any` - -Returns `true` if at least one element in the `arr` satisfies an async test. -_The callback for each iterator call only accepts a single argument of `true` or -`false`; it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like `fs.exists`. Once any iterator -call returns `true`, the main `callback` is immediately called. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A truth test to apply to each item in the array - in parallel. The iterator is passed a callback(truthValue) which must be - called with a boolean argument once it has completed. -* `callback(result)` - A callback which is called as soon as any iterator returns - `true`, or after all the iterator functions have finished. Result will be - either `true` or `false` depending on the values of the async tests. - -__Example__ - -```js -async.some(['file1','file2','file3'], fs.exists, function(result){ - // if result is true then at least one of the files exists -}); -``` - ---------------------------------------- - - -### every(arr, iterator, callback) - -__Alias:__ `all` - -Returns `true` if every element in `arr` satisfies an async test. -_The callback for each `iterator` call only accepts a single argument of `true` or -`false`; it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like `fs.exists`. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A truth test to apply to each item in the array - in parallel. The iterator is passed a callback(truthValue) which must be - called with a boolean argument once it has completed. -* `callback(result)` - A callback which is called after all the `iterator` - functions have finished. Result will be either `true` or `false` depending on - the values of the async tests. - -__Example__ - -```js -async.every(['file1','file2','file3'], fs.exists, function(result){ - // if result is true then every file exists -}); -``` - ---------------------------------------- - - -### concat(arr, iterator, callback) - -Applies `iterator` to each item in `arr`, concatenating the results. Returns the -concatenated list. The `iterator`s are called in parallel, and the results are -concatenated as they return. There is no guarantee that the results array will -be returned in the original order of `arr` passed to the `iterator` function. - -__Arguments__ - -* `arr` - An array to iterate over. -* `iterator(item, callback)` - A function to apply to each item in `arr`. - The iterator is passed a `callback(err, results)` which must be called once it - has completed with an error (which can be `null`) and an array of results. -* `callback(err, results)` - A callback which is called after all the `iterator` - functions have finished, or an error occurs. Results is an array containing - the concatenated results of the `iterator` function. - -__Example__ - -```js -async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ - // files is now a list of filenames that exist in the 3 directories -}); -``` - ---------------------------------------- - - -### concatSeries(arr, iterator, callback) - -Same as [`concat`](#concat), but executes in series instead of parallel. - - -## Control Flow - - -### series(tasks, [callback]) - -Run the functions in the `tasks` array in series, each one running once the previous -function has completed. If any functions in the series pass an error to its -callback, no more functions are run, and `callback` is immediately called with the value of the error. -Otherwise, `callback` receives an array of results when `tasks` have completed. - -It is also possible to use an object instead of an array. Each property will be -run as a function, and the results will be passed to the final `callback` as an object -instead of an array. This can be a more readable way of handling results from -[`series`](#series). - -**Note** that while many implementations preserve the order of object properties, the -[ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) -explicitly states that - -> The mechanics and order of enumerating the properties is not specified. - -So if you rely on the order in which your series of functions are executed, and want -this to work on all platforms, consider using an array. - -__Arguments__ - -* `tasks` - An array or object containing functions to run, each function is passed - a `callback(err, result)` it must call on completion with an error `err` (which can - be `null`) and an optional `result` value. -* `callback(err, results)` - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the `task` callbacks. - -__Example__ - -```js -async.series([ - function(callback){ - // do some stuff ... - callback(null, 'one'); - }, - function(callback){ - // do some more stuff ... - callback(null, 'two'); - } -], -// optional callback -function(err, results){ - // results is now equal to ['one', 'two'] -}); - - -// an example using an object instead of an array -async.series({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - } -}, -function(err, results) { - // results is now equal to: {one: 1, two: 2} -}); -``` - ---------------------------------------- - - -### parallel(tasks, [callback]) - -Run the `tasks` array of functions in parallel, without waiting until the previous -function has completed. If any of the functions pass an error to its -callback, the main `callback` is immediately called with the value of the error. -Once the `tasks` have completed, the results are passed to the final `callback` as an -array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final `callback` as an object -instead of an array. This can be a more readable way of handling results from -[`parallel`](#parallel). - - -__Arguments__ - -* `tasks` - An array or object containing functions to run. Each function is passed - a `callback(err, result)` which it must call on completion with an error `err` - (which can be `null`) and an optional `result` value. -* `callback(err, results)` - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the task callbacks. - -__Example__ - -```js -async.parallel([ - function(callback){ - setTimeout(function(){ - callback(null, 'one'); - }, 200); - }, - function(callback){ - setTimeout(function(){ - callback(null, 'two'); - }, 100); - } -], -// optional callback -function(err, results){ - // the results array will equal ['one','two'] even though - // the second function had a shorter timeout. -}); - - -// an example using an object instead of an array -async.parallel({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - } -}, -function(err, results) { - // results is now equals to: {one: 1, two: 2} -}); -``` - ---------------------------------------- - - -### parallelLimit(tasks, limit, [callback]) - -The same as [`parallel`](#parallel), only `tasks` are executed in parallel -with a maximum of `limit` tasks executing at any time. - -Note that the `tasks` are not executed in batches, so there is no guarantee that -the first `limit` tasks will complete before any others are started. - -__Arguments__ - -* `tasks` - An array or object containing functions to run, each function is passed - a `callback(err, result)` it must call on completion with an error `err` (which can - be `null`) and an optional `result` value. -* `limit` - The maximum number of `tasks` to run at any time. -* `callback(err, results)` - An optional callback to run once all the functions - have completed. This function gets a results array (or object) containing all - the result arguments passed to the `task` callbacks. - ---------------------------------------- - - -### whilst(test, fn, callback) - -Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped, -or an error occurs. - -__Arguments__ - -* `test()` - synchronous truth test to perform before each execution of `fn`. -* `fn(callback)` - A function which is called each time `test` passes. The function is - passed a `callback(err)`, which must be called once it has completed with an - optional `err` argument. -* `callback(err)` - A callback which is called after the test fails and repeated - execution of `fn` has stopped. - -__Example__ - -```js -var count = 0; - -async.whilst( - function () { return count < 5; }, - function (callback) { - count++; - setTimeout(callback, 1000); - }, - function (err) { - // 5 seconds have passed - } -); -``` - ---------------------------------------- - - -### doWhilst(fn, test, callback) - -The post-check version of [`whilst`](#whilst). To reflect the difference in -the order of operations, the arguments `test` and `fn` are switched. - -`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - ---------------------------------------- - - -### until(test, fn, callback) - -Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped, -or an error occurs. - -The inverse of [`whilst`](#whilst). - ---------------------------------------- - - -### doUntil(fn, test, callback) - -Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`. - ---------------------------------------- - - -### forever(fn, errback) - -Calls the asynchronous function `fn` with a callback parameter that allows it to -call itself again, in series, indefinitely. - -If an error is passed to the callback then `errback` is called with the -error, and execution stops, otherwise it will never be called. - -```js -async.forever( - function(next) { - // next is suitable for passing to things that need a callback(err [, whatever]); - // it will result in this function being called again. - }, - function(err) { - // if next is called with a value in its first parameter, it will appear - // in here as 'err', and execution will stop. - } -); -``` - ---------------------------------------- - - -### waterfall(tasks, [callback]) - -Runs the `tasks` array of functions in series, each passing their results to the next in -the array. However, if any of the `tasks` pass an error to their own callback, the -next function is not executed, and the main `callback` is immediately called with -the error. - -__Arguments__ - -* `tasks` - An array of functions to run, each function is passed a - `callback(err, result1, result2, ...)` it must call on completion. The first - argument is an error (which can be `null`) and any further arguments will be - passed as arguments in order to the next task. -* `callback(err, [results])` - An optional callback to run once all the functions - have completed. This will be passed the results of the last task's callback. - - - -__Example__ - -```js -async.waterfall([ - function(callback){ - callback(null, 'one', 'two'); - }, - function(arg1, arg2, callback){ - // arg1 now equals 'one' and arg2 now equals 'two' - callback(null, 'three'); - }, - function(arg1, callback){ - // arg1 now equals 'three' - callback(null, 'done'); - } -], function (err, result) { - // result now equals 'done' -}); -``` - ---------------------------------------- - -### compose(fn1, fn2...) - -Creates a function which is a composition of the passed asynchronous -functions. Each function consumes the return value of the function that -follows. Composing functions `f()`, `g()`, and `h()` would produce the result of -`f(g(h()))`, only this version uses callbacks to obtain the return values. - -Each function is executed with the `this` binding of the composed function. - -__Arguments__ - -* `functions...` - the asynchronous functions to compose - - -__Example__ - -```js -function add1(n, callback) { - setTimeout(function () { - callback(null, n + 1); - }, 10); -} - -function mul3(n, callback) { - setTimeout(function () { - callback(null, n * 3); - }, 10); -} - -var add1mul3 = async.compose(mul3, add1); - -add1mul3(4, function (err, result) { - // result now equals 15 -}); -``` - ---------------------------------------- - -### seq(fn1, fn2...) - -Version of the compose function that is more natural to read. -Each following function consumes the return value of the latter function. - -Each function is executed with the `this` binding of the composed function. - -__Arguments__ - -* functions... - the asynchronous functions to compose - - -__Example__ - -```js -// Requires lodash (or underscore), express3 and dresende's orm2. -// Part of an app, that fetches cats of the logged user. -// This example uses `seq` function to avoid overnesting and error -// handling clutter. -app.get('/cats', function(request, response) { - function handleError(err, data, callback) { - if (err) { - console.error(err); - response.json({ status: 'error', message: err.message }); - } - else { - callback(data); - } - } - var User = request.models.User; - async.seq( - _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data)) - handleError, - function(user, fn) { - user.getCats(fn); // 'getCats' has signature (callback(err, data)) - }, - handleError, - function(cats) { - response.json({ status: 'ok', message: 'Cats found', data: cats }); - } - )(req.session.user_id); - } -}); -``` - ---------------------------------------- - -### applyEach(fns, args..., callback) - -Applies the provided arguments to each function in the array, calling -`callback` after all functions have completed. If you only provide the first -argument, then it will return a function which lets you pass in the -arguments as if it were a single function call. - -__Arguments__ - -* `fns` - the asynchronous functions to all call with the same arguments -* `args...` - any number of separate arguments to pass to the function -* `callback` - the final argument should be the callback, called when all - functions have completed processing - - -__Example__ - -```js -async.applyEach([enableSearch, updateSchema], 'bucket', callback); - -// partial application example: -async.each( - buckets, - async.applyEach([enableSearch, updateSchema]), - callback -); -``` - ---------------------------------------- - - -### applyEachSeries(arr, iterator, callback) - -The same as [`applyEach`](#applyEach) only the functions are applied in series. - ---------------------------------------- - - -### queue(worker, concurrency) - -Creates a `queue` object with the specified `concurrency`. Tasks added to the -`queue` are processed in parallel (up to the `concurrency` limit). If all -`worker`s are in progress, the task is queued until one becomes available. -Once a `worker` completes a `task`, that `task`'s callback is called. - -__Arguments__ - -* `worker(task, callback)` - An asynchronous function for processing a queued - task, which must call its `callback(err)` argument when finished, with an - optional `error` as an argument. -* `concurrency` - An `integer` for determining how many `worker` functions should be - run in parallel. - -__Queue objects__ - -The `queue` object returned by this function has the following properties and -methods: - -* `length()` - a function returning the number of items waiting to be processed. -* `started` - a function returning whether or not any items have been pushed and processed by the queue -* `running()` - a function returning the number of items currently being processed. -* `idle()` - a function returning false if there are items waiting or being processed, or true if not. -* `concurrency` - an integer for determining how many `worker` functions should be - run in parallel. This property can be changed after a `queue` is created to - alter the concurrency on-the-fly. -* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once - the `worker` has finished processing the task. Instead of a single task, a `tasks` array - can be submitted. The respective callback is used for every task in the list. -* `unshift(task, [callback])` - add a new task to the front of the `queue`. -* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit, - and further tasks will be queued. -* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`. -* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`. -* `paused` - a boolean for determining whether the queue is in a paused state -* `pause()` - a function that pauses the processing of tasks until `resume()` is called. -* `resume()` - a function that resumes the processing of queued tasks when the queue is paused. -* `kill()` - a function that empties remaining tasks from the queue forcing it to go idle. - -__Example__ - -```js -// create a queue object with concurrency 2 - -var q = async.queue(function (task, callback) { - console.log('hello ' + task.name); - callback(); -}, 2); - - -// assign a callback -q.drain = function() { - console.log('all items have been processed'); -} - -// add some items to the queue - -q.push({name: 'foo'}, function (err) { - console.log('finished processing foo'); -}); -q.push({name: 'bar'}, function (err) { - console.log('finished processing bar'); -}); - -// add some items to the queue (batch-wise) - -q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { - console.log('finished processing bar'); -}); - -// add some items to the front of the queue - -q.unshift({name: 'bar'}, function (err) { - console.log('finished processing bar'); -}); -``` - - ---------------------------------------- - - -### priorityQueue(worker, concurrency) - -The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects: - -* `push(task, priority, [callback])` - `priority` should be a number. If an array of - `tasks` is given, all tasks will be assigned the same priority. -* The `unshift` method was removed. - ---------------------------------------- - - -### cargo(worker, [payload]) - -Creates a `cargo` object with the specified payload. Tasks added to the -cargo will be processed altogether (up to the `payload` limit). If the -`worker` is in progress, the task is queued until it becomes available. Once -the `worker` has completed some tasks, each callback of those tasks is called. -Check out [this animation](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) for how `cargo` and `queue` work. - -While [queue](#queue) passes only one task to one of a group of workers -at a time, cargo passes an array of tasks to a single worker, repeating -when the worker is finished. - -__Arguments__ - -* `worker(tasks, callback)` - An asynchronous function for processing an array of - queued tasks, which must call its `callback(err)` argument when finished, with - an optional `err` argument. -* `payload` - An optional `integer` for determining how many tasks should be - processed per round; if omitted, the default is unlimited. - -__Cargo objects__ - -The `cargo` object returned by this function has the following properties and -methods: - -* `length()` - A function returning the number of items waiting to be processed. -* `payload` - An `integer` for determining how many tasks should be - process per round. This property can be changed after a `cargo` is created to - alter the payload on-the-fly. -* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called - once the `worker` has finished processing the task. Instead of a single task, an array of `tasks` - can be submitted. The respective callback is used for every task in the list. -* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued. -* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`. -* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`. - -__Example__ - -```js -// create a cargo object with payload 2 - -var cargo = async.cargo(function (tasks, callback) { - for(var i=0; i -### auto(tasks, [callback]) - -Determines the best order for running the functions in `tasks`, based on their -requirements. Each function can optionally depend on other functions being completed -first, and each function is run as soon as its requirements are satisfied. - -If any of the functions pass an error to their callback, it will not -complete (so any other functions depending on it will not run), and the main -`callback` is immediately called with the error. Functions also receive an -object containing the results of functions which have completed so far. - -Note, all functions are called with a `results` object as a second argument, -so it is unsafe to pass functions in the `tasks` object which cannot handle the -extra argument. - -For example, this snippet of code: - -```js -async.auto({ - readData: async.apply(fs.readFile, 'data.txt', 'utf-8') -}, callback); -``` - -will have the effect of calling `readFile` with the results object as the last -argument, which will fail: - -```js -fs.readFile('data.txt', 'utf-8', cb, {}); -``` - -Instead, wrap the call to `readFile` in a function which does not forward the -`results` object: - -```js -async.auto({ - readData: function(cb, results){ - fs.readFile('data.txt', 'utf-8', cb); - } -}, callback); -``` - -__Arguments__ - -* `tasks` - An object. Each of its properties is either a function or an array of - requirements, with the function itself the last item in the array. The object's key - of a property serves as the name of the task defined by that property, - i.e. can be used when specifying requirements for other tasks. - The function receives two arguments: (1) a `callback(err, result)` which must be - called when finished, passing an `error` (which can be `null`) and the result of - the function's execution, and (2) a `results` object, containing the results of - the previously executed functions. -* `callback(err, results)` - An optional callback which is called when all the - tasks have been completed. It receives the `err` argument if any `tasks` - pass an error to their callback. Results are always returned; however, if - an error occurs, no further `tasks` will be performed, and the results - object will only contain partial results. - - -__Example__ - -```js -async.auto({ - get_data: function(callback){ - console.log('in get_data'); - // async code to get some data - callback(null, 'data', 'converted to array'); - }, - make_folder: function(callback){ - console.log('in make_folder'); - // async code to create a directory to store a file in - // this is run at the same time as getting the data - callback(null, 'folder'); - }, - write_file: ['get_data', 'make_folder', function(callback, results){ - console.log('in write_file', JSON.stringify(results)); - // once there is some data and the directory exists, - // write the data to a file in the directory - callback(null, 'filename'); - }], - email_link: ['write_file', function(callback, results){ - console.log('in email_link', JSON.stringify(results)); - // once the file is written let's email a link to it... - // results.write_file contains the filename returned by write_file. - callback(null, {'file':results.write_file, 'email':'user@example.com'}); - }] -}, function(err, results) { - console.log('err = ', err); - console.log('results = ', results); -}); -``` - -This is a fairly trivial example, but to do this using the basic parallel and -series functions would look like this: - -```js -async.parallel([ - function(callback){ - console.log('in get_data'); - // async code to get some data - callback(null, 'data', 'converted to array'); - }, - function(callback){ - console.log('in make_folder'); - // async code to create a directory to store a file in - // this is run at the same time as getting the data - callback(null, 'folder'); - } -], -function(err, results){ - async.series([ - function(callback){ - console.log('in write_file', JSON.stringify(results)); - // once there is some data and the directory exists, - // write the data to a file in the directory - results.push('filename'); - callback(null); - }, - function(callback){ - console.log('in email_link', JSON.stringify(results)); - // once the file is written let's email a link to it... - callback(null, {'file':results.pop(), 'email':'user@example.com'}); - } - ]); -}); -``` - -For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding -new tasks much easier (and the code more readable). - - ---------------------------------------- - - -### retry([times = 5], task, [callback]) - -Attempts to get a successful response from `task` no more than `times` times before -returning an error. If the task is successful, the `callback` will be passed the result -of the successfull task. If all attemps fail, the callback will be passed the error and -result (if any) of the final attempt. - -__Arguments__ - -* `times` - An integer indicating how many times to attempt the `task` before giving up. Defaults to 5. -* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)` - which must be called when finished, passing `err` (which can be `null`) and the `result` of - the function's execution, and (2) a `results` object, containing the results of - the previously executed functions (if nested inside another control flow). -* `callback(err, results)` - An optional callback which is called when the - task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`. - -The [`retry`](#retry) function can be used as a stand-alone control flow by passing a -callback, as shown below: - -```js -async.retry(3, apiMethod, function(err, result) { - // do something with the result -}); -``` - -It can also be embeded within other control flow functions to retry individual methods -that are not as reliable, like this: - -```js -async.auto({ - users: api.getUsers.bind(api), - payments: async.retry(3, api.getPayments.bind(api)) -}, function(err, results) { - // do something with the results -}); -``` - - ---------------------------------------- - - -### iterator(tasks) - -Creates an iterator function which calls the next function in the `tasks` array, -returning a continuation to call the next one after that. It's also possible to -“peek” at the next iterator with `iterator.next()`. - -This function is used internally by the `async` module, but can be useful when -you want to manually control the flow of functions in series. - -__Arguments__ - -* `tasks` - An array of functions to run. - -__Example__ - -```js -var iterator = async.iterator([ - function(){ sys.p('one'); }, - function(){ sys.p('two'); }, - function(){ sys.p('three'); } -]); - -node> var iterator2 = iterator(); -'one' -node> var iterator3 = iterator2(); -'two' -node> iterator3(); -'three' -node> var nextfn = iterator2.next(); -node> nextfn(); -'three' -``` - ---------------------------------------- - - -### apply(function, arguments..) - -Creates a continuation function with some arguments already applied. - -Useful as a shorthand when combined with other control flow functions. Any arguments -passed to the returned function are added to the arguments originally passed -to apply. - -__Arguments__ - -* `function` - The function you want to eventually apply all arguments to. -* `arguments...` - Any number of arguments to automatically apply when the - continuation is called. - -__Example__ - -```js -// using apply - -async.parallel([ - async.apply(fs.writeFile, 'testfile1', 'test1'), - async.apply(fs.writeFile, 'testfile2', 'test2'), -]); - - -// the same process without using apply - -async.parallel([ - function(callback){ - fs.writeFile('testfile1', 'test1', callback); - }, - function(callback){ - fs.writeFile('testfile2', 'test2', callback); - } -]); -``` - -It's possible to pass any number of additional arguments when calling the -continuation: - -```js -node> var fn = async.apply(sys.puts, 'one'); -node> fn('two', 'three'); -one -two -three -``` - ---------------------------------------- - - -### nextTick(callback) - -Calls `callback` on a later loop around the event loop. In Node.js this just -calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)` -if available, otherwise `setTimeout(callback, 0)`, which means other higher priority -events may precede the execution of `callback`. - -This is used internally for browser-compatibility purposes. - -__Arguments__ - -* `callback` - The function to call on a later loop around the event loop. - -__Example__ - -```js -var call_order = []; -async.nextTick(function(){ - call_order.push('two'); - // call_order now equals ['one','two'] -}); -call_order.push('one') -``` - - -### times(n, callback) - -Calls the `callback` function `n` times, and accumulates results in the same manner -you would use with [`map`](#map). - -__Arguments__ - -* `n` - The number of times to run the function. -* `callback` - The function to call `n` times. - -__Example__ - -```js -// Pretend this is some complicated async factory -var createUser = function(id, callback) { - callback(null, { - id: 'user' + id - }) -} -// generate 5 users -async.times(5, function(n, next){ - createUser(n, function(err, user) { - next(err, user) - }) -}, function(err, users) { - // we should now have 5 users -}); -``` - - -### timesSeries(n, callback) - -The same as [`times`](#times), only the iterator is applied to each item in `arr` in -series. The next `iterator` is only called once the current one has completed. -The results array will be in the same order as the original. - - -## Utils - - -### memoize(fn, [hasher]) - -Caches the results of an `async` function. When creating a hash to store function -results against, the callback is omitted from the hash and an optional hash -function can be used. - -The cache of results is exposed as the `memo` property of the function returned -by `memoize`. - -__Arguments__ - -* `fn` - The function to proxy and cache results from. -* `hasher` - Tn optional function for generating a custom hash for storing - results. It has all the arguments applied to it apart from the callback, and - must be synchronous. - -__Example__ - -```js -var slow_fn = function (name, callback) { - // do something - callback(null, result); -}; -var fn = async.memoize(slow_fn); - -// fn can now be used as if it were slow_fn -fn('some name', function () { - // callback -}); -``` - - -### unmemoize(fn) - -Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized -form. Handy for testing. - -__Arguments__ - -* `fn` - the memoized function - - -### log(function, arguments) - -Logs the result of an `async` function to the `console`. Only works in Node.js or -in browsers that support `console.log` and `console.error` (such as FF and Chrome). -If multiple arguments are returned from the async function, `console.log` is -called on each argument in order. - -__Arguments__ - -* `function` - The function you want to eventually apply all arguments to. -* `arguments...` - Any number of arguments to apply to the function. - -__Example__ - -```js -var hello = function(name, callback){ - setTimeout(function(){ - callback(null, 'hello ' + name); - }, 1000); -}; -``` -```js -node> async.log(hello, 'world'); -'hello world' -``` - ---------------------------------------- - - -### dir(function, arguments) - -Logs the result of an `async` function to the `console` using `console.dir` to -display the properties of the resulting object. Only works in Node.js or -in browsers that support `console.dir` and `console.error` (such as FF and Chrome). -If multiple arguments are returned from the async function, `console.dir` is -called on each argument in order. - -__Arguments__ - -* `function` - The function you want to eventually apply all arguments to. -* `arguments...` - Any number of arguments to apply to the function. - -__Example__ - -```js -var hello = function(name, callback){ - setTimeout(function(){ - callback(null, {hello: name}); - }, 1000); -}; -``` -```js -node> async.dir(hello, 'world'); -{hello: 'world'} -``` - ---------------------------------------- - - -### noConflict() - -Changes the value of `async` back to its original value, returning a reference to the -`async` object. diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/component.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/component.json deleted file mode 100644 index bbb0115..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "async", - "repo": "caolan/async", - "description": "Higher-order functions and common patterns for asynchronous code", - "version": "0.1.23", - "keywords": [], - "dependencies": {}, - "development": {}, - "main": "lib/async.js", - "scripts": [ "lib/async.js" ] -} diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/lib/async.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/lib/async.js deleted file mode 100755 index 01e8afc..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/lib/async.js +++ /dev/null @@ -1,1123 +0,0 @@ -/*! - * async - * https://github.com/caolan/async - * - * Copyright 2010-2014 Caolan McMahon - * Released under the MIT license - */ -/*jshint onevar: false, indent:4 */ -/*global setImmediate: false, setTimeout: false, console: false */ -(function () { - - var async = {}; - - // global on the server, window in the browser - var root, previous_async; - - root = this; - if (root != null) { - previous_async = root.async; - } - - async.noConflict = function () { - root.async = previous_async; - return async; - }; - - function only_once(fn) { - var called = false; - return function() { - if (called) throw new Error("Callback was already called."); - called = true; - fn.apply(root, arguments); - } - } - - //// cross-browser compatiblity functions //// - - var _toString = Object.prototype.toString; - - var _isArray = Array.isArray || function (obj) { - return _toString.call(obj) === '[object Array]'; - }; - - var _each = function (arr, iterator) { - if (arr.forEach) { - return arr.forEach(iterator); - } - for (var i = 0; i < arr.length; i += 1) { - iterator(arr[i], i, arr); - } - }; - - var _map = function (arr, iterator) { - if (arr.map) { - return arr.map(iterator); - } - var results = []; - _each(arr, function (x, i, a) { - results.push(iterator(x, i, a)); - }); - return results; - }; - - var _reduce = function (arr, iterator, memo) { - if (arr.reduce) { - return arr.reduce(iterator, memo); - } - _each(arr, function (x, i, a) { - memo = iterator(memo, x, i, a); - }); - return memo; - }; - - var _keys = function (obj) { - if (Object.keys) { - return Object.keys(obj); - } - var keys = []; - for (var k in obj) { - if (obj.hasOwnProperty(k)) { - keys.push(k); - } - } - return keys; - }; - - //// exported async module functions //// - - //// nextTick implementation with browser-compatible fallback //// - if (typeof process === 'undefined' || !(process.nextTick)) { - if (typeof setImmediate === 'function') { - async.nextTick = function (fn) { - // not a direct alias for IE10 compatibility - setImmediate(fn); - }; - async.setImmediate = async.nextTick; - } - else { - async.nextTick = function (fn) { - setTimeout(fn, 0); - }; - async.setImmediate = async.nextTick; - } - } - else { - async.nextTick = process.nextTick; - if (typeof setImmediate !== 'undefined') { - async.setImmediate = function (fn) { - // not a direct alias for IE10 compatibility - setImmediate(fn); - }; - } - else { - async.setImmediate = async.nextTick; - } - } - - async.each = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - _each(arr, function (x) { - iterator(x, only_once(done) ); - }); - function done(err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed >= arr.length) { - callback(); - } - } - } - }; - async.forEach = async.each; - - async.eachSeries = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - var iterate = function () { - iterator(arr[completed], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed >= arr.length) { - callback(); - } - else { - iterate(); - } - } - }); - }; - iterate(); - }; - async.forEachSeries = async.eachSeries; - - async.eachLimit = function (arr, limit, iterator, callback) { - var fn = _eachLimit(limit); - fn.apply(null, [arr, iterator, callback]); - }; - async.forEachLimit = async.eachLimit; - - var _eachLimit = function (limit) { - - return function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length || limit <= 0) { - return callback(); - } - var completed = 0; - var started = 0; - var running = 0; - - (function replenish () { - if (completed >= arr.length) { - return callback(); - } - - while (running < limit && started < arr.length) { - started += 1; - running += 1; - iterator(arr[started - 1], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - running -= 1; - if (completed >= arr.length) { - callback(); - } - else { - replenish(); - } - } - }); - } - })(); - }; - }; - - - var doParallel = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.each].concat(args)); - }; - }; - var doParallelLimit = function(limit, fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [_eachLimit(limit)].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.eachSeries].concat(args)); - }; - }; - - - var _asyncMap = function (eachfn, arr, iterator, callback) { - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - if (!callback) { - eachfn(arr, function (x, callback) { - iterator(x.value, function (err) { - callback(err); - }); - }); - } else { - var results = []; - eachfn(arr, function (x, callback) { - iterator(x.value, function (err, v) { - results[x.index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - async.map = doParallel(_asyncMap); - async.mapSeries = doSeries(_asyncMap); - async.mapLimit = function (arr, limit, iterator, callback) { - return _mapLimit(limit)(arr, iterator, callback); - }; - - var _mapLimit = function(limit) { - return doParallelLimit(limit, _asyncMap); - }; - - // reduce only has a series version, as doing reduce in parallel won't - // work in many situations. - async.reduce = function (arr, memo, iterator, callback) { - async.eachSeries(arr, function (x, callback) { - iterator(memo, x, function (err, v) { - memo = v; - callback(err); - }); - }, function (err) { - callback(err, memo); - }); - }; - // inject alias - async.inject = async.reduce; - // foldl alias - async.foldl = async.reduce; - - async.reduceRight = function (arr, memo, iterator, callback) { - var reversed = _map(arr, function (x) { - return x; - }).reverse(); - async.reduce(reversed, memo, iterator, callback); - }; - // foldr alias - async.foldr = async.reduceRight; - - var _filter = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.filter = doParallel(_filter); - async.filterSeries = doSeries(_filter); - // select alias - async.select = async.filter; - async.selectSeries = async.filterSeries; - - var _reject = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (!v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.reject = doParallel(_reject); - async.rejectSeries = doSeries(_reject); - - var _detect = function (eachfn, arr, iterator, main_callback) { - eachfn(arr, function (x, callback) { - iterator(x, function (result) { - if (result) { - main_callback(x); - main_callback = function () {}; - } - else { - callback(); - } - }); - }, function (err) { - main_callback(); - }); - }; - async.detect = doParallel(_detect); - async.detectSeries = doSeries(_detect); - - async.some = function (arr, iterator, main_callback) { - async.each(arr, function (x, callback) { - iterator(x, function (v) { - if (v) { - main_callback(true); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(false); - }); - }; - // any alias - async.any = async.some; - - async.every = function (arr, iterator, main_callback) { - async.each(arr, function (x, callback) { - iterator(x, function (v) { - if (!v) { - main_callback(false); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(true); - }); - }; - // all alias - async.all = async.every; - - async.sortBy = function (arr, iterator, callback) { - async.map(arr, function (x, callback) { - iterator(x, function (err, criteria) { - if (err) { - callback(err); - } - else { - callback(null, {value: x, criteria: criteria}); - } - }); - }, function (err, results) { - if (err) { - return callback(err); - } - else { - var fn = function (left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }; - callback(null, _map(results.sort(fn), function (x) { - return x.value; - })); - } - }); - }; - - async.auto = function (tasks, callback) { - callback = callback || function () {}; - var keys = _keys(tasks); - var remainingTasks = keys.length - if (!remainingTasks) { - return callback(); - } - - var results = {}; - - var listeners = []; - var addListener = function (fn) { - listeners.unshift(fn); - }; - var removeListener = function (fn) { - for (var i = 0; i < listeners.length; i += 1) { - if (listeners[i] === fn) { - listeners.splice(i, 1); - return; - } - } - }; - var taskComplete = function () { - remainingTasks-- - _each(listeners.slice(0), function (fn) { - fn(); - }); - }; - - addListener(function () { - if (!remainingTasks) { - var theCallback = callback; - // prevent final callback from calling itself if it errors - callback = function () {}; - - theCallback(null, results); - } - }); - - _each(keys, function (k) { - var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]]; - var taskCallback = function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - if (err) { - var safeResults = {}; - _each(_keys(results), function(rkey) { - safeResults[rkey] = results[rkey]; - }); - safeResults[k] = args; - callback(err, safeResults); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - results[k] = args; - async.setImmediate(taskComplete); - } - }; - var requires = task.slice(0, Math.abs(task.length - 1)) || []; - var ready = function () { - return _reduce(requires, function (a, x) { - return (a && results.hasOwnProperty(x)); - }, true) && !results.hasOwnProperty(k); - }; - if (ready()) { - task[task.length - 1](taskCallback, results); - } - else { - var listener = function () { - if (ready()) { - removeListener(listener); - task[task.length - 1](taskCallback, results); - } - }; - addListener(listener); - } - }); - }; - - async.retry = function(times, task, callback) { - var DEFAULT_TIMES = 5; - var attempts = []; - // Use defaults if times not passed - if (typeof times === 'function') { - callback = task; - task = times; - times = DEFAULT_TIMES; - } - // Make sure times is a number - times = parseInt(times, 10) || DEFAULT_TIMES; - var wrappedTask = function(wrappedCallback, wrappedResults) { - var retryAttempt = function(task, finalAttempt) { - return function(seriesCallback) { - task(function(err, result){ - seriesCallback(!err || finalAttempt, {err: err, result: result}); - }, wrappedResults); - }; - }; - while (times) { - attempts.push(retryAttempt(task, !(times-=1))); - } - async.series(attempts, function(done, data){ - data = data[data.length - 1]; - (wrappedCallback || callback)(data.err, data.result); - }); - } - // If a callback is passed, run this as a controll flow - return callback ? wrappedTask() : wrappedTask - }; - - async.waterfall = function (tasks, callback) { - callback = callback || function () {}; - if (!_isArray(tasks)) { - var err = new Error('First argument to waterfall must be an array of functions'); - return callback(err); - } - if (!tasks.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback.apply(null, arguments); - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - var next = iterator.next(); - if (next) { - args.push(wrapIterator(next)); - } - else { - args.push(callback); - } - async.setImmediate(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - var _parallel = function(eachfn, tasks, callback) { - callback = callback || function () {}; - if (_isArray(tasks)) { - eachfn.map(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - eachfn.each(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.parallel = function (tasks, callback) { - _parallel({ map: async.map, each: async.each }, tasks, callback); - }; - - async.parallelLimit = function(tasks, limit, callback) { - _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback); - }; - - async.series = function (tasks, callback) { - callback = callback || function () {}; - if (_isArray(tasks)) { - async.mapSeries(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.eachSeries(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.iterator = function (tasks) { - var makeCallback = function (index) { - var fn = function () { - if (tasks.length) { - tasks[index].apply(null, arguments); - } - return fn.next(); - }; - fn.next = function () { - return (index < tasks.length - 1) ? makeCallback(index + 1): null; - }; - return fn; - }; - return makeCallback(0); - }; - - async.apply = function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return fn.apply( - null, args.concat(Array.prototype.slice.call(arguments)) - ); - }; - }; - - var _concat = function (eachfn, arr, fn, callback) { - var r = []; - eachfn(arr, function (x, cb) { - fn(x, function (err, y) { - r = r.concat(y || []); - cb(err); - }); - }, function (err) { - callback(err, r); - }); - }; - async.concat = doParallel(_concat); - async.concatSeries = doSeries(_concat); - - async.whilst = function (test, iterator, callback) { - if (test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.whilst(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.doWhilst = function (iterator, test, callback) { - iterator(function (err) { - if (err) { - return callback(err); - } - var args = Array.prototype.slice.call(arguments, 1); - if (test.apply(null, args)) { - async.doWhilst(iterator, test, callback); - } - else { - callback(); - } - }); - }; - - async.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.doUntil = function (iterator, test, callback) { - iterator(function (err) { - if (err) { - return callback(err); - } - var args = Array.prototype.slice.call(arguments, 1); - if (!test.apply(null, args)) { - async.doUntil(iterator, test, callback); - } - else { - callback(); - } - }); - }; - - async.queue = function (worker, concurrency) { - if (concurrency === undefined) { - concurrency = 1; - } - function _insert(q, data, pos, callback) { - if (!q.started){ - q.started = true; - } - if (!_isArray(data)) { - data = [data]; - } - if(data.length == 0) { - // call drain immediately if there are no tasks - return async.setImmediate(function() { - if (q.drain) { - q.drain(); - } - }); - } - _each(data, function(task) { - var item = { - data: task, - callback: typeof callback === 'function' ? callback : null - }; - - if (pos) { - q.tasks.unshift(item); - } else { - q.tasks.push(item); - } - - if (q.saturated && q.tasks.length === q.concurrency) { - q.saturated(); - } - async.setImmediate(q.process); - }); - } - - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - started: false, - paused: false, - push: function (data, callback) { - _insert(q, data, false, callback); - }, - kill: function () { - q.drain = null; - q.tasks = []; - }, - unshift: function (data, callback) { - _insert(q, data, true, callback); - }, - process: function () { - if (!q.paused && workers < q.concurrency && q.tasks.length) { - var task = q.tasks.shift(); - if (q.empty && q.tasks.length === 0) { - q.empty(); - } - workers += 1; - var next = function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if (q.drain && q.tasks.length + workers === 0) { - q.drain(); - } - q.process(); - }; - var cb = only_once(next); - worker(task.data, cb); - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - }, - idle: function() { - return q.tasks.length + workers === 0; - }, - pause: function () { - if (q.paused === true) { return; } - q.paused = true; - q.process(); - }, - resume: function () { - if (q.paused === false) { return; } - q.paused = false; - q.process(); - } - }; - return q; - }; - - async.priorityQueue = function (worker, concurrency) { - - function _compareTasks(a, b){ - return a.priority - b.priority; - }; - - function _binarySearch(sequence, item, compare) { - var beg = -1, - end = sequence.length - 1; - while (beg < end) { - var mid = beg + ((end - beg + 1) >>> 1); - if (compare(item, sequence[mid]) >= 0) { - beg = mid; - } else { - end = mid - 1; - } - } - return beg; - } - - function _insert(q, data, priority, callback) { - if (!q.started){ - q.started = true; - } - if (!_isArray(data)) { - data = [data]; - } - if(data.length == 0) { - // call drain immediately if there are no tasks - return async.setImmediate(function() { - if (q.drain) { - q.drain(); - } - }); - } - _each(data, function(task) { - var item = { - data: task, - priority: priority, - callback: typeof callback === 'function' ? callback : null - }; - - q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item); - - if (q.saturated && q.tasks.length === q.concurrency) { - q.saturated(); - } - async.setImmediate(q.process); - }); - } - - // Start with a normal queue - var q = async.queue(worker, concurrency); - - // Override push to accept second parameter representing priority - q.push = function (data, priority, callback) { - _insert(q, data, priority, callback); - }; - - // Remove unshift function - delete q.unshift; - - return q; - }; - - async.cargo = function (worker, payload) { - var working = false, - tasks = []; - - var cargo = { - tasks: tasks, - payload: payload, - saturated: null, - empty: null, - drain: null, - drained: true, - push: function (data, callback) { - if (!_isArray(data)) { - data = [data]; - } - _each(data, function(task) { - tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - cargo.drained = false; - if (cargo.saturated && tasks.length === payload) { - cargo.saturated(); - } - }); - async.setImmediate(cargo.process); - }, - process: function process() { - if (working) return; - if (tasks.length === 0) { - if(cargo.drain && !cargo.drained) cargo.drain(); - cargo.drained = true; - return; - } - - var ts = typeof payload === 'number' - ? tasks.splice(0, payload) - : tasks.splice(0, tasks.length); - - var ds = _map(ts, function (task) { - return task.data; - }); - - if(cargo.empty) cargo.empty(); - working = true; - worker(ds, function () { - working = false; - - var args = arguments; - _each(ts, function (data) { - if (data.callback) { - data.callback.apply(null, args); - } - }); - - process(); - }); - }, - length: function () { - return tasks.length; - }, - running: function () { - return working; - } - }; - return cargo; - }; - - var _console_fn = function (name) { - return function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - fn.apply(null, args.concat([function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (typeof console !== 'undefined') { - if (err) { - if (console.error) { - console.error(err); - } - } - else if (console[name]) { - _each(args, function (x) { - console[name](x); - }); - } - } - }])); - }; - }; - async.log = _console_fn('log'); - async.dir = _console_fn('dir'); - /*async.info = _console_fn('info'); - async.warn = _console_fn('warn'); - async.error = _console_fn('error');*/ - - async.memoize = function (fn, hasher) { - var memo = {}; - var queues = {}; - hasher = hasher || function (x) { - return x; - }; - var memoized = function () { - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - var key = hasher.apply(null, args); - if (key in memo) { - async.nextTick(function () { - callback.apply(null, memo[key]); - }); - } - else if (key in queues) { - queues[key].push(callback); - } - else { - queues[key] = [callback]; - fn.apply(null, args.concat([function () { - memo[key] = arguments; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, arguments); - } - }])); - } - }; - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; - }; - - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; - - async.times = function (count, iterator, callback) { - var counter = []; - for (var i = 0; i < count; i++) { - counter.push(i); - } - return async.map(counter, iterator, callback); - }; - - async.timesSeries = function (count, iterator, callback) { - var counter = []; - for (var i = 0; i < count; i++) { - counter.push(i); - } - return async.mapSeries(counter, iterator, callback); - }; - - async.seq = function (/* functions... */) { - var fns = arguments; - return function () { - var that = this; - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - async.reduce(fns, args, function (newargs, fn, cb) { - fn.apply(that, newargs.concat([function () { - var err = arguments[0]; - var nextargs = Array.prototype.slice.call(arguments, 1); - cb(err, nextargs); - }])) - }, - function (err, results) { - callback.apply(that, [err].concat(results)); - }); - }; - }; - - async.compose = function (/* functions... */) { - return async.seq.apply(null, Array.prototype.reverse.call(arguments)); - }; - - var _applyEach = function (eachfn, fns /*args...*/) { - var go = function () { - var that = this; - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - return eachfn(fns, function (fn, cb) { - fn.apply(that, args.concat([cb])); - }, - callback); - }; - if (arguments.length > 2) { - var args = Array.prototype.slice.call(arguments, 2); - return go.apply(this, args); - } - else { - return go; - } - }; - async.applyEach = doParallel(_applyEach); - async.applyEachSeries = doSeries(_applyEach); - - async.forever = function (fn, callback) { - function next(err) { - if (err) { - if (callback) { - return callback(err); - } - throw err; - } - fn(next); - } - next(); - }; - - // Node.js - if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - // AMD / RequireJS - else if (typeof define !== 'undefined' && define.amd) { - define([], function () { - return async; - }); - } - // included directly via \n\n```\n\n## Documentation\n\n### Collections\n\n* [`each`](#each)\n* [`eachSeries`](#eachSeries)\n* [`eachLimit`](#eachLimit)\n* [`map`](#map)\n* [`mapSeries`](#mapSeries)\n* [`mapLimit`](#mapLimit)\n* [`filter`](#filter)\n* [`filterSeries`](#filterSeries)\n* [`reject`](#reject)\n* [`rejectSeries`](#rejectSeries)\n* [`reduce`](#reduce)\n* [`reduceRight`](#reduceRight)\n* [`detect`](#detect)\n* [`detectSeries`](#detectSeries)\n* [`sortBy`](#sortBy)\n* [`some`](#some)\n* [`every`](#every)\n* [`concat`](#concat)\n* [`concatSeries`](#concatSeries)\n\n### Control Flow\n\n* [`series`](#seriestasks-callback)\n* [`parallel`](#parallel)\n* [`parallelLimit`](#parallellimittasks-limit-callback)\n* [`whilst`](#whilst)\n* [`doWhilst`](#doWhilst)\n* [`until`](#until)\n* [`doUntil`](#doUntil)\n* [`forever`](#forever)\n* [`waterfall`](#waterfall)\n* [`compose`](#compose)\n* [`seq`](#seq)\n* [`applyEach`](#applyEach)\n* [`applyEachSeries`](#applyEachSeries)\n* [`queue`](#queue)\n* [`priorityQueue`](#priorityQueue)\n* [`cargo`](#cargo)\n* [`auto`](#auto)\n* [`retry`](#retry)\n* [`iterator`](#iterator)\n* [`apply`](#apply)\n* [`nextTick`](#nextTick)\n* [`times`](#times)\n* [`timesSeries`](#timesSeries)\n\n### Utils\n\n* [`memoize`](#memoize)\n* [`unmemoize`](#unmemoize)\n* [`log`](#log)\n* [`dir`](#dir)\n* [`noConflict`](#noConflict)\n\n\n## Collections\n\n\n\n### each(arr, iterator, callback)\n\nApplies the function `iterator` to each item in `arr`, in parallel.\nThe `iterator` is called with an item from the list, and a callback for when it\nhas finished. If the `iterator` passes an error to its `callback`, the main\n`callback` (for the `each` function) is immediately called with the error.\n\nNote, that since this function applies `iterator` to each item in parallel,\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err)` which must be called once it has \n completed. If no error has occured, the `callback` should be run without \n arguments or with an explicit `null` argument.\n* `callback(err)` - A callback which is called when all `iterator` functions\n have finished, or an error occurs.\n\n__Examples__\n\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n```js\n// assuming openFiles is an array of file names \n\nasync.each(openFiles, function( file, callback) {\n \n // Perform operation on file here.\n console.log('Processing file ' + file);\n \n if( file.length > 32 ) {\n console.log('This file name is too long');\n callback('File name too long');\n } else {\n // Do work to process file here\n console.log('File processed');\n callback();\n }\n}, function(err){\n // if any of the file processing produced an error, err would equal that error\n if( err ) {\n // One of the iterations produced an error.\n // All processing will now stop.\n console.log('A file failed to process');\n } else {\n console.log('All files have been processed successfully');\n }\n});\n```\n\n---------------------------------------\n\n\n\n### eachSeries(arr, iterator, callback)\n\nThe same as [`each`](#each), only `iterator` is applied to each item in `arr` in\nseries. The next `iterator` is only called once the current one has completed. \nThis means the `iterator` functions will complete in order.\n\n\n---------------------------------------\n\n\n\n### eachLimit(arr, limit, iterator, callback)\n\nThe same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously \nrunning at any time.\n\nNote that the items in `arr` are not processed in batches, so there is no guarantee that \nthe first `limit` `iterator` functions will complete before any others are started.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `limit` - The maximum number of `iterator`s to run at any time.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err)` which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit `null` argument.\n* `callback(err)` - A callback which is called when all `iterator` functions\n have finished, or an error occurs.\n\n__Example__\n\n```js\n// Assume documents is an array of JSON objects and requestApi is a\n// function that interacts with a rate-limited REST api.\n\nasync.eachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in `arr` through\nthe `iterator` function. The `iterator` is called with an item from `arr` and a\ncallback for when it has finished processing. Each of these callback takes 2 arguments: \nan `error`, and the transformed item from `arr`. If `iterator` passes an error to this \ncallback, the main `callback` (for the `map` function) is immediately called with the error.\n\nNote, that since this function applies the `iterator` to each item in parallel,\nthere is no guarantee that the `iterator` functions will complete in order. \nHowever, the results array will be in the same order as the original `arr`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, transformed)` which must be called once \n it has completed with an error (which can be `null`) and a transformed item.\n* `callback(err, results)` - A callback which is called when all `iterator`\n functions have finished, or an error occurs. Results is an array of the\n transformed items from the `arr`.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as [`map`](#map), only the `iterator` is applied to each item in `arr` in\nseries. The next `iterator` is only called once the current one has completed. \nThe results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### mapLimit(arr, limit, iterator, callback)\n\nThe same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that \nthe first `limit` `iterator` functions will complete before any others are started.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `limit` - The maximum number of `iterator`s to run at any time.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, transformed)` which must be called once \n it has completed with an error (which can be `null`) and a transformed item.\n* `callback(err, results)` - A callback which is called when all `iterator`\n calls have finished, or an error occurs. The result is an array of the\n transformed items from the original `arr`.\n\n__Example__\n\n```js\nasync.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ `select`\n\nReturns a new array of all the values in `arr` which pass an async truth test.\n_The callback for each `iterator` call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in `arr`.\n The `iterator` is passed a `callback(truthValue)`, which must be called with a \n boolean argument once it has completed.\n* `callback(results)` - A callback which is called after all the `iterator`\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n---------------------------------------\n\n\n\n### filterSeries(arr, iterator, callback)\n\n__Alias:__ `selectSeries`\n\nThe same as [`filter`](#filter) only the `iterator` is applied to each item in `arr` in\nseries. The next `iterator` is only called once the current one has completed. \nThe results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of [`filter`](#filter). Removes values that pass an `async` truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as [`reject`](#reject), only the `iterator` is applied to each item in `arr`\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__Aliases:__ `inject`, `foldl`\n\nReduces `arr` into a single value using an async `iterator` to return\neach successive step. `memo` is the initial state of the reduction. \nThis function only operates in series. \n\nFor performance reasons, it may make sense to split a call to this function into \na parallel map, and then use the normal `Array.prototype.reduce` on the results. \nThis function is for situations where each step in the reduction needs to be async; \nif you can get the data before reducing it, then it's probably a good idea to do so.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `memo` - The initial state of the reduction.\n* `iterator(memo, item, callback)` - A function applied to each item in the\n array to produce the next step in the reduction. The `iterator` is passed a\n `callback(err, reduction)` which accepts an optional error as its first \n argument, and the state of the reduction as the second. If an error is \n passed to the callback, the reduction is stopped and the main `callback` is \n immediately called with the error.\n* `callback(err, result)` - A callback which is called after all the `iterator`\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ `foldr`\n\nSame as [`reduce`](#reduce), only operates on `arr` in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in `arr` that passes an async truth test. The\n`iterator` is applied in parallel, meaning the first iterator to return `true` will\nfire the detect `callback` with that result. That means the result might not be\nthe first item in the original `arr` (in terms of order) that passes the test.\n\nIf order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in `arr`.\n The iterator is passed a `callback(truthValue)` which must be called with a \n boolean argument once it has completed.\n* `callback(result)` - A callback which is called as soon as any iterator returns\n `true`, or after all the `iterator` functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value `undefined` if none passed.\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as [`detect`](#detect), only the `iterator` is applied to each item in `arr`\nin series. This means the result is always the first in the original `arr` (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each `arr` value through an async `iterator`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, sortValue)` which must be called once it\n has completed with an error (which can be `null`) and a value to use as the sort\n criteria.\n* `callback(err, results)` - A callback which is called after all the `iterator`\n functions have finished, or an error occurs. Results is the items from\n the original `arr` sorted by the values returned by the `iterator` calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n__Sort Order__\n\nBy modifying the callback parameter the sorting order can be influenced:\n\n```js\n//ascending order\nasync.sortBy([1,9,3,5], function(x, callback){\n callback(err, x);\n}, function(err,result){\n //result callback\n} );\n\n//descending order\nasync.sortBy([1,9,3,5], function(x, callback){\n callback(err, x*-1); //<- x*-1 instead of x, turns the order around\n}, function(err,result){\n //result callback\n} );\n```\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ `any`\n\nReturns `true` if at least one element in the `arr` satisfies an async test.\n_The callback for each iterator call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`. Once any iterator\ncall returns `true`, the main `callback` is immediately called.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in the array\n in parallel. The iterator is passed a callback(truthValue) which must be \n called with a boolean argument once it has completed.\n* `callback(result)` - A callback which is called as soon as any iterator returns\n `true`, or after all the iterator functions have finished. Result will be\n either `true` or `false` depending on the values of the async tests.\n\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ `all`\n\nReturns `true` if every element in `arr` satisfies an async test.\n_The callback for each `iterator` call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in the array\n in parallel. The iterator is passed a callback(truthValue) which must be \n called with a boolean argument once it has completed.\n* `callback(result)` - A callback which is called after all the `iterator`\n functions have finished. Result will be either `true` or `false` depending on\n the values of the async tests.\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies `iterator` to each item in `arr`, concatenating the results. Returns the\nconcatenated list. The `iterator`s are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of `arr` passed to the `iterator` function.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, results)` which must be called once it \n has completed with an error (which can be `null`) and an array of results.\n* `callback(err, results)` - A callback which is called after all the `iterator`\n functions have finished, or an error occurs. Results is an array containing\n the concatenated results of the `iterator` function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as [`concat`](#concat), but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun the functions in the `tasks` array in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run, and `callback` is immediately called with the value of the error. \nOtherwise, `callback` receives an array of results when `tasks` have completed.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function, and the results will be passed to the final `callback` as an object\ninstead of an array. This can be a more readable way of handling results from\n[`series`](#series).\n\n**Note** that while many implementations preserve the order of object properties, the\n[ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) \nexplicitly states that\n\n> The mechanics and order of enumerating the properties is not specified.\n\nSo if you rely on the order in which your series of functions are executed, and want\nthis to work on all platforms, consider using an array. \n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run, each function is passed\n a `callback(err, result)` it must call on completion with an error `err` (which can\n be `null`) and an optional `result` value.\n* `callback(err, results)` - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the `task` callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun the `tasks` array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main `callback` is immediately called with the value of the error.\nOnce the `tasks` have completed, the results are passed to the final `callback` as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final `callback` as an object\ninstead of an array. This can be a more readable way of handling results from\n[`parallel`](#parallel).\n\n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run. Each function is passed \n a `callback(err, result)` which it must call on completion with an error `err` \n (which can be `null`) and an optional `result` value.\n* `callback(err, results)` - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallelLimit(tasks, limit, [callback])\n\nThe same as [`parallel`](#parallel), only `tasks` are executed in parallel \nwith a maximum of `limit` tasks executing at any time.\n\nNote that the `tasks` are not executed in batches, so there is no guarantee that \nthe first `limit` tasks will complete before any others are started.\n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run, each function is passed \n a `callback(err, result)` it must call on completion with an error `err` (which can\n be `null`) and an optional `result` value.\n* `limit` - The maximum number of `tasks` to run at any time.\n* `callback(err, results)` - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the `task` callbacks.\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,\nor an error occurs.\n\n__Arguments__\n\n* `test()` - synchronous truth test to perform before each execution of `fn`.\n* `fn(callback)` - A function which is called each time `test` passes. The function is\n passed a `callback(err)`, which must be called once it has completed with an \n optional `err` argument.\n* `callback(err)` - A callback which is called after the test fails and repeated\n execution of `fn` has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n\n### doWhilst(fn, test, callback)\n\nThe post-check version of [`whilst`](#whilst). To reflect the difference in \nthe order of operations, the arguments `test` and `fn` are switched. \n\n`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,\nor an error occurs.\n\nThe inverse of [`whilst`](#whilst).\n\n---------------------------------------\n\n\n### doUntil(fn, test, callback)\n\nLike [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n\n### forever(fn, errback)\n\nCalls the asynchronous function `fn` with a callback parameter that allows it to\ncall itself again, in series, indefinitely.\n\nIf an error is passed to the callback then `errback` is called with the\nerror, and execution stops, otherwise it will never be called.\n\n```js\nasync.forever(\n function(next) {\n // next is suitable for passing to things that need a callback(err [, whatever]);\n // it will result in this function being called again.\n },\n function(err) {\n // if next is called with a value in its first parameter, it will appear\n // in here as 'err', and execution will stop.\n }\n);\n```\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns the `tasks` array of functions in series, each passing their results to the next in\nthe array. However, if any of the `tasks` pass an error to their own callback, the\nnext function is not executed, and the main `callback` is immediately called with\nthe error.\n\n__Arguments__\n\n* `tasks` - An array of functions to run, each function is passed a \n `callback(err, result1, result2, ...)` it must call on completion. The first\n argument is an error (which can be `null`) and any further arguments will be \n passed as arguments in order to the next task.\n* `callback(err, [results])` - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n // arg1 now equals 'one' and arg2 now equals 'two'\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done' \n});\n```\n\n---------------------------------------\n\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions `f()`, `g()`, and `h()` would produce the result of\n`f(g(h()))`, only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* `functions...` - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n\n### seq(fn1, fn2...)\n\nVersion of the compose function that is more natural to read.\nEach following function consumes the return value of the latter function. \n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* functions... - the asynchronous functions to compose\n\n\n__Example__\n\n```js\n// Requires lodash (or underscore), express3 and dresende's orm2.\n// Part of an app, that fetches cats of the logged user.\n// This example uses `seq` function to avoid overnesting and error \n// handling clutter.\napp.get('/cats', function(request, response) {\n function handleError(err, data, callback) {\n if (err) {\n console.error(err);\n response.json({ status: 'error', message: err.message });\n }\n else {\n callback(data);\n }\n }\n var User = request.models.User;\n async.seq(\n _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))\n handleError,\n function(user, fn) {\n user.getCats(fn); // 'getCats' has signature (callback(err, data))\n },\n handleError,\n function(cats) {\n response.json({ status: 'ok', message: 'Cats found', data: cats });\n }\n )(req.session.user_id);\n }\n});\n```\n\n---------------------------------------\n\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling \n`callback` after all functions have completed. If you only provide the first\nargument, then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* `fns` - the asynchronous functions to all call with the same arguments\n* `args...` - any number of separate arguments to pass to the function\n* `callback` - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n---------------------------------------\n\n\n### applyEachSeries(arr, iterator, callback)\n\nThe same as [`applyEach`](#applyEach) only the functions are applied in series.\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a `queue` object with the specified `concurrency`. Tasks added to the\n`queue` are processed in parallel (up to the `concurrency` limit). If all\n`worker`s are in progress, the task is queued until one becomes available. \nOnce a `worker` completes a `task`, that `task`'s callback is called.\n\n__Arguments__\n\n* `worker(task, callback)` - An asynchronous function for processing a queued\n task, which must call its `callback(err)` argument when finished, with an \n optional `error` as an argument.\n* `concurrency` - An `integer` for determining how many `worker` functions should be\n run in parallel.\n\n__Queue objects__\n\nThe `queue` object returned by this function has the following properties and\nmethods:\n\n* `length()` - a function returning the number of items waiting to be processed.\n* `started` - a function returning whether or not any items have been pushed and processed by the queue\n* `running()` - a function returning the number of items currently being processed.\n* `idle()` - a function returning false if there are items waiting or being processed, or true if not.\n* `concurrency` - an integer for determining how many `worker` functions should be\n run in parallel. This property can be changed after a `queue` is created to\n alter the concurrency on-the-fly.\n* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once \n the `worker` has finished processing the task. Instead of a single task, a `tasks` array\n can be submitted. The respective callback is used for every task in the list.\n* `unshift(task, [callback])` - add a new task to the front of the `queue`.\n* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit, \n and further tasks will be queued.\n* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.\n* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.\n* `paused` - a boolean for determining whether the queue is in a paused state\n* `pause()` - a function that pauses the processing of tasks until `resume()` is called.\n* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.\n* `kill()` - a function that empties remaining tasks from the queue forcing it to go idle.\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n\n---------------------------------------\n\n\n### priorityQueue(worker, concurrency)\n\nThe same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:\n\n* `push(task, priority, [callback])` - `priority` should be a number. If an array of\n `tasks` is given, all tasks will be assigned the same priority.\n* The `unshift` method was removed.\n\n---------------------------------------\n\n\n### cargo(worker, [payload])\n\nCreates a `cargo` object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the `payload` limit). If the\n`worker` is in progress, the task is queued until it becomes available. Once\nthe `worker` has completed some tasks, each callback of those tasks is called.\nCheck out [this animation](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) for how `cargo` and `queue` work.\n\nWhile [queue](#queue) passes only one task to one of a group of workers\nat a time, cargo passes an array of tasks to a single worker, repeating\nwhen the worker is finished.\n\n__Arguments__\n\n* `worker(tasks, callback)` - An asynchronous function for processing an array of\n queued tasks, which must call its `callback(err)` argument when finished, with \n an optional `err` argument.\n* `payload` - An optional `integer` for determining how many tasks should be\n processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe `cargo` object returned by this function has the following properties and\nmethods:\n\n* `length()` - A function returning the number of items waiting to be processed.\n* `payload` - An `integer` for determining how many tasks should be\n process per round. This property can be changed after a `cargo` is created to\n alter the payload on-the-fly.\n* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called\n once the `worker` has finished processing the task. Instead of a single task, an array of `tasks` \n can be submitted. The respective callback is used for every task in the list.\n* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.\n* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.\n* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n for(var i=0; i\n### auto(tasks, [callback])\n\nDetermines the best order for running the functions in `tasks`, based on their \nrequirements. Each function can optionally depend on other functions being completed \nfirst, and each function is run as soon as its requirements are satisfied. \n\nIf any of the functions pass an error to their callback, it will not \ncomplete (so any other functions depending on it will not run), and the main \n`callback` is immediately called with the error. Functions also receive an \nobject containing the results of functions which have completed so far.\n\nNote, all functions are called with a `results` object as a second argument, \nso it is unsafe to pass functions in the `tasks` object which cannot handle the\nextra argument. \n\nFor example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8')\n}, callback);\n```\n\nwill have the effect of calling `readFile` with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to `readFile` in a function which does not forward the \n`results` object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* `tasks` - An object. Each of its properties is either a function or an array of\n requirements, with the function itself the last item in the array. The object's key\n of a property serves as the name of the task defined by that property,\n i.e. can be used when specifying requirements for other tasks.\n The function receives two arguments: (1) a `callback(err, result)` which must be \n called when finished, passing an `error` (which can be `null`) and the result of \n the function's execution, and (2) a `results` object, containing the results of\n the previously executed functions.\n* `callback(err, results)` - An optional callback which is called when all the\n tasks have been completed. It receives the `err` argument if any `tasks` \n pass an error to their callback. Results are always returned; however, if \n an error occurs, no further `tasks` will be performed, and the results\n object will only contain partial results.\n\n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n console.log('in get_data');\n // async code to get some data\n callback(null, 'data', 'converted to array');\n },\n make_folder: function(callback){\n console.log('in make_folder');\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n callback(null, 'folder');\n },\n write_file: ['get_data', 'make_folder', function(callback, results){\n console.log('in write_file', JSON.stringify(results));\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, 'filename');\n }],\n email_link: ['write_file', function(callback, results){\n console.log('in email_link', JSON.stringify(results));\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n callback(null, {'file':results.write_file, 'email':'user@example.com'});\n }]\n}, function(err, results) {\n console.log('err = ', err);\n console.log('results = ', results);\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n console.log('in get_data');\n // async code to get some data\n callback(null, 'data', 'converted to array');\n },\n function(callback){\n console.log('in make_folder');\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n callback(null, 'folder');\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n console.log('in write_file', JSON.stringify(results));\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n results.push('filename');\n callback(null);\n },\n function(callback){\n console.log('in email_link', JSON.stringify(results));\n // once the file is written let's email a link to it...\n callback(null, {'file':results.pop(), 'email':'user@example.com'});\n }\n ]);\n});\n```\n\nFor a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding\nnew tasks much easier (and the code more readable).\n\n\n---------------------------------------\n\n\n### retry([times = 5], task, [callback])\n\nAttempts to get a successful response from `task` no more than `times` times before\nreturning an error. If the task is successful, the `callback` will be passed the result\nof the successfull task. If all attemps fail, the callback will be passed the error and\nresult (if any) of the final attempt.\n\n__Arguments__\n\n* `times` - An integer indicating how many times to attempt the `task` before giving up. Defaults to 5.\n* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`\n which must be called when finished, passing `err` (which can be `null`) and the `result` of \n the function's execution, and (2) a `results` object, containing the results of\n the previously executed functions (if nested inside another control flow).\n* `callback(err, results)` - An optional callback which is called when the\n task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.\n\nThe [`retry`](#retry) function can be used as a stand-alone control flow by passing a\ncallback, as shown below:\n\n```js\nasync.retry(3, apiMethod, function(err, result) {\n // do something with the result\n});\n```\n\nIt can also be embeded within other control flow functions to retry individual methods\nthat are not as reliable, like this:\n\n```js\nasync.auto({\n users: api.getUsers.bind(api),\n payments: async.retry(3, api.getPayments.bind(api))\n}, function(err, results) {\n // do something with the results\n});\n```\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the `tasks` array,\nreturning a continuation to call the next one after that. It's also possible to\n“peek” at the next iterator with `iterator.next()`.\n\nThis function is used internally by the `async` module, but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* `tasks` - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied. \n\nUseful as a shorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls `callback` on a later loop around the event loop. In Node.js this just\ncalls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`\nif available, otherwise `setTimeout(callback, 0)`, which means other higher priority\nevents may precede the execution of `callback`.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* `callback` - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n\n### times(n, callback)\n\nCalls the `callback` function `n` times, and accumulates results in the same manner\nyou would use with [`map`](#map).\n\n__Arguments__\n\n* `n` - The number of times to run the function.\n* `callback` - The function to call `n` times.\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n\n### timesSeries(n, callback)\n\nThe same as [`times`](#times), only the iterator is applied to each item in `arr` in\nseries. The next `iterator` is only called once the current one has completed. \nThe results array will be in the same order as the original.\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an `async` function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* `fn` - The function to proxy and cache results from.\n* `hasher` - Tn optional function for generating a custom hash for storing\n results. It has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n\n### unmemoize(fn)\n\nUndoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized\nform. Handy for testing.\n\n__Arguments__\n\n* `fn` - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an `async` function to the `console`. Only works in Node.js or\nin browsers that support `console.log` and `console.error` (such as FF and Chrome).\nIf multiple arguments are returned from the async function, `console.log` is\ncalled on each argument in order.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an `async` function to the `console` using `console.dir` to\ndisplay the properties of the resulting object. Only works in Node.js or\nin browsers that support `console.dir` and `console.error` (such as FF and Chrome).\nIf multiple arguments are returned from the async function, `console.dir` is\ncalled on each argument in order.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of `async` back to its original value, returning a reference to the\n`async` object.\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/caolan/async", - "_id": "async@0.9.0", - "_shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7", - "_from": "async@0.9.x", - "_resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz" -} diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esprima/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esprima/package.json index 58b2cba..3124497 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esprima/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esprima/package.json @@ -82,5 +82,5 @@ "readme": "**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance,\nstandard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)\nparser written in ECMAScript (also popularly known as\n[JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)).\nEsprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat),\nwith the help of [many contributors](https://github.com/ariya/esprima/contributors).\n\n### Features\n\n- Full support for ECMAScript 5.1 ([ECMA-262](http://www.ecma-international.org/publications/standards/Ecma-262.htm))\n- Sensible [syntax tree format](http://esprima.org/doc/index.html#ast) compatible with Mozilla\n[Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API)\n- Optional tracking of syntax node location (index-based and line-column)\n- Heavily tested (> 600 [unit tests](http://esprima.org/test/) with solid statement and branch coverage)\n- Experimental support for ES6/Harmony (module, class, destructuring, ...)\n\nEsprima serves as a **building block** for some JavaScript\nlanguage tools, from [code instrumentation](http://esprima.org/demo/functiontrace.html)\nto [editor autocompletion](http://esprima.org/demo/autocomplete.html).\n\nEsprima runs on many popular web browsers, as well as other ECMAScript platforms such as\n[Rhino](http://www.mozilla.org/rhino) and [Node.js](https://npmjs.org/package/esprima).\n\nFor more information, check the web site [esprima.org](http://esprima.org).\n", "readmeFilename": "README.md", "_id": "esprima@1.1.1", - "_from": "esprima@~1.1.1" + "_from": "esprima@>=1.1.1 <1.2.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/estraverse/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/estraverse/package.json index f211ee0..5585153 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/estraverse/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/estraverse/package.json @@ -46,7 +46,7 @@ "shasum": "867a3e8e58a9f84618afb6c2ddbcd916b7cbaf71", "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz" }, - "_from": "estraverse@~1.5.0", + "_from": "estraverse@>=1.5.0 <1.6.0", "_npmVersion": "1.4.3", "_npmUser": { "name": "constellation", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esutils/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esutils/package.json index 9dcd98b..47f1b46 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esutils/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/esutils/package.json @@ -45,5 +45,5 @@ "url": "https://github.com/Constellation/esutils/issues" }, "_id": "esutils@1.0.0", - "_from": "esutils@~1.0.0" + "_from": "esutils@>=1.0.0 <1.1.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/CHANGELOG.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/CHANGELOG.md index 518bed4..2e7ca5d 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/CHANGELOG.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/CHANGELOG.md @@ -1,5 +1,26 @@ # Change Log +## 0.1.43 + +* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue + #148 for some discussion and issues #150, #151, and #152 for implementations. + +## 0.1.42 + +* Fix an issue where `SourceNode`s from different versions of the source-map + library couldn't be used in conjunction with each other. See issue #142. + +## 0.1.41 + +* Fix a bug with getting the source content of relative sources with a "./" + prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). + +* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the + column span of each mapping. + +* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find + all generated positions associated with a given original source and line. + ## 0.1.40 * Performance improvements for parsing source maps in SourceMapConsumer. diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/README.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/README.md index 1a1c7d8..59767aa 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/README.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/README.md @@ -175,6 +175,11 @@ following attributes: * `file`: Optional. The generated filename this source map is associated with. +#### SourceMapConsumer.prototype.computeColumnSpans() + +Compute the last column for each generated mapping. The last column is +inclusive. + #### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) Returns the original source, line, and column information for the generated @@ -216,6 +221,22 @@ and an object is returned with the following properties: * `column`: The column number in the generated source, or null. +#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) + +Returns all generated line and column information for the original source +and line provided. The only argument is an object with the following +properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. + +and an array of objects is returned, each with the following properties: + +* `line`: The line number in the generated source, or null. + +* `column`: The column number in the generated source, or null. + #### SourceMapConsumer.prototype.sourceContentFor(source) Returns the original source content for the source provided. The only @@ -253,6 +274,11 @@ You may pass an object with the following properties: * `sourceRoot`: A root for all relative URLs in this source map. +* `skipValidation`: Optional. When `true`, disables validation of mappings as + they are added. This can improve performance but should be used with + discretion, as a last resort. Even then, one should avoid using this flag when + running tests, if possible. + #### SourceMapGenerator.fromSourceMap(sourceMapConsumer) Creates a new SourceMapGenerator based on a SourceMapConsumer diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/base64-vlq.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/base64-vlq.js index b4ff136..e22dcae 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/base64-vlq.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/base64-vlq.js @@ -66,7 +66,7 @@ define(function (require, exports, module) { /** * Converts from a two-complement value to a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: + * placed in the least significant bit. For example, as decimals: * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) */ @@ -78,7 +78,7 @@ define(function (require, exports, module) { /** * Converts to a two-complement value from a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: + * placed in the least significant bit. For example, as decimals: * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 */ diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/binary-search.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/binary-search.js index ff347c6..e085f81 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/binary-search.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/binary-search.js @@ -23,17 +23,17 @@ define(function (require, exports, module) { // // 1. We find the exact element we are looking for. // - // 2. We did not find the exact element, but we can return the next - // closest element that is less than that element. + // 2. We did not find the exact element, but we can return the index of + // the next closest element that is less than that element. // // 3. We did not find the exact element, and there is no next-closest // element which is less than the one we are searching for, so we - // return null. + // return -1. var mid = Math.floor((aHigh - aLow) / 2) + aLow; var cmp = aCompare(aNeedle, aHaystack[mid], true); if (cmp === 0) { // Found the element we are looking for. - return aHaystack[mid]; + return mid; } else if (cmp > 0) { // aHaystack[mid] is greater than our needle. @@ -43,7 +43,7 @@ define(function (require, exports, module) { } // We did not find an exact match, return the next closest one // (termination case 2). - return aHaystack[mid]; + return mid; } else { // aHaystack[mid] is less than our needle. @@ -53,18 +53,16 @@ define(function (require, exports, module) { } // The exact needle element was not found in this haystack. Determine if // we are in termination case (2) or (3) and return the appropriate thing. - return aLow < 0 - ? null - : aHaystack[aLow]; + return aLow < 0 ? -1 : aLow; } } /** * This is an implementation of binary search which will always try and return - * the next lowest value checked if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. + * the index of next lowest value checked if there is no exact hit. This is + * because mappings between original and generated line/col pairs are single + * points, and there is an implicit region between each of them, so a miss + * just means that you aren't on the very start of a region. * * @param aNeedle The element you are looking for. * @param aHaystack The array that is being searched. @@ -73,9 +71,10 @@ define(function (require, exports, module) { * than, equal to, or greater than the element, respectively. */ exports.search = function search(aNeedle, aHaystack, aCompare) { - return aHaystack.length > 0 - ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) - : null; + if (aHaystack.length === 0) { + return -1; + } + return recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) }; }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/mapping-list.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/mapping-list.js new file mode 100644 index 0000000..2a4eb61 --- /dev/null +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/mapping-list.js @@ -0,0 +1,86 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +if (typeof define !== 'function') { + var define = require('amdefine')(module, require); +} +define(function (require, exports, module) { + + var util = require('./util'); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositions(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + var mapping; + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositions); + this._sorted = true; + } + return this._array; + }; + + exports.MappingList = MappingList; + +}); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-consumer.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-consumer.js index ea643bf..cfaa299 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-consumer.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-consumer.js @@ -66,6 +66,11 @@ define(function (require, exports, module) { throw new Error('Unsupported version: ' + version); } + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + sources = sources.map(util.normalize); + // Pass `true` below to allow duplicate names and sources. While source maps // are intended to be compressed and deduplicated, the TypeScript compiler // sometimes generates source maps with duplicates in them. See Github issue @@ -97,9 +102,8 @@ define(function (require, exports, module) { smc.sourceRoot); smc.file = aSourceMap._file; - smc.__generatedMappings = aSourceMap._mappings.slice() - .sort(util.compareByGeneratedPositions); - smc.__originalMappings = aSourceMap._mappings.slice() + smc.__generatedMappings = aSourceMap._mappings.toArray().slice(); + smc.__originalMappings = aSourceMap._mappings.toArray().slice() .sort(util.compareByOriginalPositions); return smc; @@ -290,6 +294,33 @@ define(function (require, exports, module) { return binarySearch.search(aNeedle, aMappings, aComparator); }; + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + SourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object @@ -312,23 +343,27 @@ define(function (require, exports, module) { generatedColumn: util.getArg(aArgs, 'column') }; - var mapping = this._findMapping(needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositions); + var index = this._findMapping(needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositions); - if (mapping && mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source != null && this.sourceRoot != null) { - source = util.join(this.sourceRoot, source); + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source != null && this.sourceRoot != null) { + source = util.join(this.sourceRoot, source); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: util.getArg(mapping, 'name', null) + }; } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: util.getArg(mapping, 'name', null) - }; } return { @@ -406,25 +441,82 @@ define(function (require, exports, module) { needle.source = util.relative(this.sourceRoot, needle.source); } - var mapping = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions); + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions); + + if (index >= 0) { + var mapping = this._originalMappings[index]; - if (mapping) { return { line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null) + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }; } return { line: null, - column: null + column: null, + lastColumn: null }; }; + /** + * Returns all generated line and column information for the original source + * and line provided. The only argument is an object with the following + * properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + // When there is no exact match, SourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to Infinity, we thus find the last + // mapping for the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: util.getArg(aArgs, 'line'), + originalColumn: Infinity + }; + + if (this.sourceRoot != null) { + needle.source = util.relative(this.sourceRoot, needle.source); + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + while (mapping && mapping.originalLine === needle.originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[--index]; + } + } + + return mappings.reverse(); + }; + SourceMapConsumer.GENERATED_ORDER = 1; SourceMapConsumer.ORIGINAL_ORDER = 2; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-generator.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-generator.js index 5387fa1..1ab7a47 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-generator.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-generator.js @@ -12,6 +12,7 @@ define(function (require, exports, module) { var base64VLQ = require('./base64-vlq'); var util = require('./util'); var ArraySet = require('./array-set').ArraySet; + var MappingList = require('./mapping-list').MappingList; /** * An instance of the SourceMapGenerator represents a source map which is @@ -27,9 +28,10 @@ define(function (require, exports, module) { } this._file = util.getArg(aArgs, 'file', null); this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); this._sources = new ArraySet(); this._names = new ArraySet(); - this._mappings = []; + this._mappings = new MappingList(); this._sourcesContents = null; } @@ -99,7 +101,9 @@ define(function (require, exports, module) { var source = util.getArg(aArgs, 'source', null); var name = util.getArg(aArgs, 'name', null); - this._validateMapping(generated, original, source, name); + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } if (source != null && !this._sources.has(source)) { this._sources.add(source); @@ -109,7 +113,7 @@ define(function (require, exports, module) { this._names.add(name); } - this._mappings.push({ + this._mappings.add({ generatedLine: generated.line, generatedColumn: generated.column, originalLine: original != null && original.line, @@ -186,7 +190,7 @@ define(function (require, exports, module) { var newNames = new ArraySet(); // Find mappings for the "sourceFile" - this._mappings.forEach(function (mapping) { + this._mappings.unsortedForEach(function (mapping) { if (mapping.source === sourceFile && mapping.originalLine != null) { // Check if it can be mapped by the source map, then update the mapping. var original = aSourceMapConsumer.originalPositionFor({ @@ -292,15 +296,10 @@ define(function (require, exports, module) { var result = ''; var mapping; - // The mappings must be guaranteed to be in sorted order before we start - // serializing them or else the generated line numbers (which are defined - // via the ';' separators) will be all messed up. Note: it might be more - // performant to maintain the sorting as we insert them, rather than as we - // serialize them, but the big O is the same either way. - this._mappings.sort(util.compareByGeneratedPositions); + var mappings = this._mappings.toArray(); - for (var i = 0, len = this._mappings.length; i < len; i++) { - mapping = this._mappings[i]; + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; if (mapping.generatedLine !== previousGeneratedLine) { previousGeneratedColumn = 0; @@ -311,7 +310,7 @@ define(function (require, exports, module) { } else { if (i > 0) { - if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) { + if (!util.compareByGeneratedPositions(mapping, mappings[i - 1])) { continue; } result += ','; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-node.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-node.js index baa5f40..9ee90bd 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-node.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-node.js @@ -16,8 +16,13 @@ define(function (require, exports, module) { // operating systems these days (capturing the result). var REGEX_NEWLINE = /(\r?\n)/; - // Matches a Windows-style newline, or any character. - var REGEX_CHARACTER = /\r\n|[\s\S]/g; + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; /** * SourceNodes provide a way to abstract over interpolating/concatenating @@ -38,6 +43,7 @@ define(function (require, exports, module) { this.column = aColumn == null ? null : aColumn; this.source = aSource == null ? null : aSource; this.name = aName == null ? null : aName; + this[isSourceNode] = true; if (aChunks != null) this.add(aChunks); } @@ -168,7 +174,7 @@ define(function (require, exports, module) { this.add(chunk); }, this); } - else if (aChunk instanceof SourceNode || typeof aChunk === "string") { + else if (aChunk[isSourceNode] || typeof aChunk === "string") { if (aChunk) { this.children.push(aChunk); } @@ -193,7 +199,7 @@ define(function (require, exports, module) { this.prepend(aChunk[i]); } } - else if (aChunk instanceof SourceNode || typeof aChunk === "string") { + else if (aChunk[isSourceNode] || typeof aChunk === "string") { this.children.unshift(aChunk); } else { @@ -215,7 +221,7 @@ define(function (require, exports, module) { var chunk; for (var i = 0, len = this.children.length; i < len; i++) { chunk = this.children[i]; - if (chunk instanceof SourceNode) { + if (chunk[isSourceNode]) { chunk.walk(aFn); } else { @@ -260,7 +266,7 @@ define(function (require, exports, module) { */ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { var lastChild = this.children[this.children.length - 1]; - if (lastChild instanceof SourceNode) { + if (lastChild[isSourceNode]) { lastChild.replaceRight(aPattern, aReplacement); } else if (typeof lastChild === 'string') { @@ -293,7 +299,7 @@ define(function (require, exports, module) { SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i] instanceof SourceNode) { + if (this.children[i][isSourceNode]) { this.children[i].walkSourceContents(aFn); } } @@ -369,12 +375,12 @@ define(function (require, exports, module) { lastOriginalSource = null; sourceMappingActive = false; } - chunk.match(REGEX_CHARACTER).forEach(function (ch, idx, array) { - if (REGEX_NEWLINE.test(ch)) { + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { generated.line++; generated.column = 0; // Mappings end at eol - if (idx + 1 === array.length) { + if (idx + 1 === length) { lastOriginalSource = null; sourceMappingActive = false; } else if (sourceMappingActive) { @@ -392,9 +398,9 @@ define(function (require, exports, module) { }); } } else { - generated.column += ch.length; + generated.column++; } - }); + } }); this.walkSourceContents(function (sourceFile, sourceContent) { map.setSourceContent(sourceFile, sourceContent); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/package.json index e5acb7c..0a1e4a0 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/package.json @@ -1,7 +1,7 @@ { "name": "source-map", "description": "Generates and consumes source maps", - "version": "0.1.40", + "version": "0.1.43", "homepage": "https://github.com/mozilla/source-map", "author": { "name": "Nick Fitzgerald", @@ -107,6 +107,22 @@ { "name": "Chris Montgomery", "email": "christopher.montgomery@dowjones.com" + }, + { + "name": "J. Ryan Stinnett", + "email": "jryans@gmail.com" + }, + { + "name": "Jack Herrington", + "email": "jherrington@walmartlabs.com" + }, + { + "name": "Chris Truter", + "email": "jeffpalentine@gmail.com" + }, + { + "name": "Daniel Espeset", + "email": "daniel@danielespeset.com" } ], "repository": { @@ -139,9 +155,9 @@ "bugs": { "url": "https://github.com/mozilla/source-map/issues" }, - "_id": "source-map@0.1.40", - "_shasum": "7e0ee49ec0452aa9ac2b93ad5ae54ef33e82b37f", - "_from": "source-map@~0.1.33", + "_id": "source-map@0.1.43", + "_shasum": "c24bc146ca517c1471f5dacbe2571b2b7f9e3346", + "_from": "source-map@>=0.1.33 <0.2.0", "_npmVersion": "1.4.9", "_npmUser": { "name": "nickfitzgerald", @@ -162,9 +178,9 @@ } ], "dist": { - "shasum": "7e0ee49ec0452aa9ac2b93ad5ae54ef33e82b37f", - "tarball": "http://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz" + "shasum": "c24bc146ca517c1471f5dacbe2571b2b7f9e3346", + "tarball": "http://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz" }, - "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz", + "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-binary-search.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-binary-search.js index ee30683..f1c9e0f 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-binary-search.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-binary-search.js @@ -23,7 +23,7 @@ define(function (require, exports, module) { binarySearch.search(needle, haystack, numberCompare); }); - assert.equal(binarySearch.search(needle, haystack, numberCompare), 20); + assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 20); }; exports['test too low'] = function (assert, util) { @@ -34,21 +34,21 @@ define(function (require, exports, module) { binarySearch.search(needle, haystack, numberCompare); }); - assert.equal(binarySearch.search(needle, haystack, numberCompare), null); + assert.equal(binarySearch.search(needle, haystack, numberCompare), -1); }; exports['test exact search'] = function (assert, util) { var needle = 4; var haystack = [2,4,6,8,10,12,14,16,18,20]; - assert.equal(binarySearch.search(needle, haystack, numberCompare), 4); + assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 4); }; exports['test fuzzy search'] = function (assert, util) { var needle = 19; var haystack = [2,4,6,8,10,12,14,16,18,20]; - assert.equal(binarySearch.search(needle, haystack, numberCompare), 18); + assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 18); }; }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-consumer.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-consumer.js index a4c6659..c714943 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-consumer.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-consumer.js @@ -252,6 +252,25 @@ define(function (require, exports, module) { }, Error); }; + exports['test that we can get the original source content with relative source paths'] = function (assert, util) { + var map = new SourceMapConsumer(util.testMapRelativeSources); + var sources = map.sources; + + assert.equal(map.sourceContentFor(sources[0]), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); + assert.equal(map.sourceContentFor(sources[1]), ' TWO.inc = function (n) {\n return n + 1;\n };'); + assert.equal(map.sourceContentFor("one.js"), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); + assert.equal(map.sourceContentFor("two.js"), ' TWO.inc = function (n) {\n return n + 1;\n };'); + assert.throws(function () { + map.sourceContentFor(""); + }, Error); + assert.throws(function () { + map.sourceContentFor("/the/root/three.js"); + }, Error); + assert.throws(function () { + map.sourceContentFor("three.js"); + }, Error); + }; + exports['test sourceRoot + generatedPositionFor'] = function (assert, util) { var map = new SourceMapGenerator({ sourceRoot: 'foo/bar', @@ -290,6 +309,158 @@ define(function (require, exports, module) { assert.equal(pos.column, 2); }; + exports['test allGeneratedPositionsFor'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'bar.coffee' + }); + map.addMapping({ + original: { line: 2, column: 1 }, + generated: { line: 3, column: 2 }, + source: 'bar.coffee' + }); + map.addMapping({ + original: { line: 2, column: 2 }, + generated: { line: 3, column: 3 }, + source: 'bar.coffee' + }); + map.addMapping({ + original: { line: 3, column: 1 }, + generated: { line: 4, column: 2 }, + source: 'bar.coffee' + }); + map = new SourceMapConsumer(map.toString()); + + var mappings = map.allGeneratedPositionsFor({ + line: 2, + source: 'bar.coffee' + }); + + assert.equal(mappings.length, 2); + assert.equal(mappings[0].line, 3); + assert.equal(mappings[0].column, 2); + assert.equal(mappings[1].line, 3); + assert.equal(mappings[1].column, 3); + }; + + exports['test allGeneratedPositionsFor for line with no mappings'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'bar.coffee' + }); + map.addMapping({ + original: { line: 3, column: 1 }, + generated: { line: 4, column: 2 }, + source: 'bar.coffee' + }); + map = new SourceMapConsumer(map.toString()); + + var mappings = map.allGeneratedPositionsFor({ + line: 2, + source: 'bar.coffee' + }); + + assert.equal(mappings.length, 0); + }; + + exports['test allGeneratedPositionsFor source map with no mappings'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated.js' + }); + map = new SourceMapConsumer(map.toString()); + + var mappings = map.allGeneratedPositionsFor({ + line: 2, + source: 'bar.coffee' + }); + + assert.equal(mappings.length, 0); + }; + + exports['test computeColumnSpans'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 1, column: 1 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 2, column: 1 }, + generated: { line: 2, column: 1 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 2, column: 2 }, + generated: { line: 2, column: 10 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 2, column: 3 }, + generated: { line: 2, column: 20 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 3, column: 1 }, + generated: { line: 3, column: 1 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 3, column: 2 }, + generated: { line: 3, column: 2 }, + source: 'foo.coffee' + }); + map = new SourceMapConsumer(map.toString()); + + map.computeColumnSpans(); + + var mappings = map.allGeneratedPositionsFor({ + line: 1, + source: 'foo.coffee' + }); + + assert.equal(mappings.length, 1); + assert.equal(mappings[0].lastColumn, Infinity); + + var mappings = map.allGeneratedPositionsFor({ + line: 2, + source: 'foo.coffee' + }); + + assert.equal(mappings.length, 3); + assert.equal(mappings[0].lastColumn, 9); + assert.equal(mappings[1].lastColumn, 19); + assert.equal(mappings[2].lastColumn, Infinity); + + var mappings = map.allGeneratedPositionsFor({ + line: 3, + source: 'foo.coffee' + }); + + assert.equal(mappings.length, 2); + assert.equal(mappings[0].lastColumn, 1); + assert.equal(mappings[1].lastColumn, Infinity); + }; + exports['test sourceRoot + originalPositionFor'] = function (assert, util) { var map = new SourceMapGenerator({ sourceRoot: 'foo/bar', diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-generator.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-generator.js index a0d9d00..d748bb1 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-generator.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-generator.js @@ -98,6 +98,27 @@ define(function (require, exports, module) { }); }; + exports['test adding mappings with skipValidation'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated-foo.js', + sourceRoot: '.', + skipValidation: true + }); + + // Not enough info, caught by `util.getArgs` + assert.throws(function () { + map.addMapping({}); + }); + + // Original file position, but no source. Not checked. + assert.doesNotThrow(function () { + map.addMapping({ + generated: { line: 1, column: 1 }, + original: { line: 1, column: 1 } + }); + }); + }; + exports['test that the correct mappings are being generated'] = function (assert, util) { var map = new SourceMapGenerator({ file: 'min.js', diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/util.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/util.js index fa213ce..56bbe2c 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/util.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/util.js @@ -71,6 +71,22 @@ define(function (require, exports, module) { sourceRoot: '/the/root', mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' }; + exports.testMapRelativeSources = { + version: 3, + file: 'min.js', + names: ['bar', 'baz', 'n'], + sources: ['./one.js', './two.js'], + sourcesContent: [ + ' ONE.foo = function (bar) {\n' + + ' return baz(bar);\n' + + ' };', + ' TWO.inc = function (n) {\n' + + ' return n + 1;\n' + + ' };' + ], + sourceRoot: '/the/root', + mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' + }; exports.emptyMap = { version: 3, file: 'min.js', diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/package.json index cff8b7d..d1e782f 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/escodegen/package.json @@ -65,7 +65,7 @@ "shasum": "f024016f5a88e046fd12005055e939802e6c5f23", "tarball": "http://registry.npmjs.org/escodegen/-/escodegen-1.3.3.tgz" }, - "_from": "escodegen@1.3.x", + "_from": "escodegen@>=1.3.0 <1.4.0", "_npmVersion": "1.4.3", "_npmUser": { "name": "constellation", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/esprima.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/esprima.js index 593021f..c83f93d 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/esprima.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/esprima.js @@ -1260,7 +1260,7 @@ parseStatement: true, parseSourceElement: true */ } return collectRegex(); } - if (prevToken.type === 'Keyword') { + if (prevToken.type === 'Keyword' && prevToken.value !== 'this') { return collectRegex(); } return scanPunctuator(); @@ -3724,7 +3724,7 @@ parseStatement: true, parseSourceElement: true */ } // Sync with *.json manifests. - exports.version = '1.2.2'; + exports.version = '1.2.3'; exports.tokenize = tokenize; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/package.json index 5f87b07..f6dc693 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/package.json @@ -7,7 +7,7 @@ "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" }, - "version": "1.2.2", + "version": "1.2.3", "files": [ "bin", "test/run.js", @@ -67,7 +67,7 @@ "lint": "npm run-script check-version && npm run-script eslint && npm run-script jscs && npm run-script jslint", "check-version": "node tools/check-version.js", "eslint": "node node_modules/eslint/bin/eslint.js esprima.js", - "jscs": "node node_modules/.bin/jscs esprima.js", + "jscs": "node node_modules/jscs/bin/jscs esprima.js", "jslint": "node node_modules/jslint/bin/jslint.js esprima.js", "coverage": "npm run-script analyze-coverage && npm run-script check-coverage", "analyze-coverage": "node node_modules/istanbul/lib/cli.js cover test/runner.js", @@ -78,19 +78,19 @@ "benchmark": "node test/benchmarks.js", "benchmark-quick": "node test/benchmarks.js quick" }, - "_id": "esprima@1.2.2", + "_id": "esprima@1.2.3", "dist": { - "shasum": "76a0fd66fcfe154fd292667dc264019750b1657b", - "tarball": "http://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz" + "shasum": "173c9c28d0ec7753afb977b6b21b3017367aac1b", + "tarball": "http://registry.npmjs.org/esprima/-/esprima-1.2.3.tgz" }, - "_from": "esprima@1.2.x", + "_from": "esprima@>=1.2.0 <1.3.0", "_npmVersion": "1.4.3", "_npmUser": { "name": "ariya", "email": "ariya.hidayat@gmail.com" }, "directories": {}, - "_shasum": "76a0fd66fcfe154fd292667dc264019750b1657b", - "_resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", + "_shasum": "173c9c28d0ec7753afb977b6b21b3017367aac1b", + "_resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.3.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/test/test.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/test/test.js index 2e5831c..f8c8636 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/test/test.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/esprima/test/test.js @@ -21840,8 +21840,82 @@ var testFixture = { lineNumber: 1, column: 8, message: 'Error: Line 1: Invalid regular expression: missing /' - } + }, + 'this / 100;': [ + { + "type": "Keyword", + "value": "this", + "range": [ + 0, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 5, + 6 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + { + "type": "Numeric", + "value": "100", + "range": [ + 7, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ";", + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + } + ] }, 'API': { diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/package.json index 5bf0db5..ca12ef3 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/package.json @@ -29,5 +29,5 @@ }, "homepage": "https://github.com/isaacs/inherits", "_id": "inherits@2.0.1", - "_from": "inherits@2" + "_from": "inherits@>=2.0.0 <3.0.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json index 4472725..0acc7b8 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json @@ -29,5 +29,5 @@ }, "homepage": "https://github.com/isaacs/node-lru-cache", "_id": "lru-cache@2.5.0", - "_from": "lru-cache@2" + "_from": "lru-cache@>=2.0.0 <3.0.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json index cb7e2bd..94b6453 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json @@ -38,5 +38,5 @@ }, "homepage": "https://github.com/isaacs/sigmund", "_id": "sigmund@1.0.0", - "_from": "sigmund@~1.0.0" + "_from": "sigmund@>=1.0.0 <1.1.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/package.json index 0fe147d..b0691e5 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/minimatch/package.json @@ -35,7 +35,7 @@ "homepage": "https://github.com/isaacs/minimatch", "_id": "minimatch@0.3.0", "_shasum": "275d8edaac4f1bb3326472089e7949c8394699dd", - "_from": "minimatch@0.3", + "_from": "minimatch@>=0.3.0 <0.4.0", "_npmVersion": "1.4.10", "_npmUser": { "name": "isaacs", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/package.json index 915a365..f3a86b9 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/glob/package.json @@ -36,7 +36,7 @@ "homepage": "https://github.com/isaacs/node-glob", "_id": "glob@3.2.11", "_shasum": "4a973f635b9190f715d10987d5c00fd2815ebe3d", - "_from": "glob@3.x", + "_from": "glob@>=3.0.0 <4.0.0", "_npmVersion": "1.4.10", "_npmUser": { "name": "isaacs", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/package.json index 4472725..0acc7b8 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/package.json @@ -29,5 +29,5 @@ }, "homepage": "https://github.com/isaacs/node-lru-cache", "_id": "lru-cache@2.5.0", - "_from": "lru-cache@2" + "_from": "lru-cache@>=2.0.0 <3.0.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/package.json index cb7e2bd..94b6453 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/package.json @@ -38,5 +38,5 @@ }, "homepage": "https://github.com/isaacs/sigmund", "_id": "sigmund@1.0.0", - "_from": "sigmund@~1.0.0" + "_from": "sigmund@>=1.0.0 <1.1.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/package.json index 97198a8..7220613 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/package.json @@ -36,7 +36,7 @@ "homepage": "https://github.com/isaacs/minimatch", "_id": "minimatch@0.4.0", "_shasum": "bd2c7d060d2c8c8fd7cde7f1f2ed2d5b270fdb1b", - "_from": "minimatch@0.x", + "_from": "minimatch@>=0.0.0 <1.0.0", "_npmVersion": "1.5.0-alpha-1", "_npmUser": { "name": "isaacs", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/package.json index fa9b988..fbdcccc 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/fileset/package.json @@ -30,5 +30,5 @@ "url": "https://github.com/mklabs/node-fileset/issues" }, "_id": "fileset@0.1.5", - "_from": "fileset@0.1.x" + "_from": "fileset@>=0.1.0 <0.2.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/package.json index a37f7d9..ad1a6c8 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/package.json @@ -42,5 +42,5 @@ }, "homepage": "https://github.com/substack/node-optimist", "_id": "optimist@0.3.7", - "_from": "optimist@~0.3" + "_from": "optimist@>=0.3.0 <0.4.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/async/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/async/package.json index 1af8811..e4e34ad 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/async/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/async/package.json @@ -39,5 +39,5 @@ "readmeFilename": "README.md", "homepage": "https://github.com/caolan/async", "_id": "async@0.2.10", - "_from": "async@~0.2.6" + "_from": "async@>=0.2.6 <0.3.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md index 518bed4..2e7ca5d 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md @@ -1,5 +1,26 @@ # Change Log +## 0.1.43 + +* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue + #148 for some discussion and issues #150, #151, and #152 for implementations. + +## 0.1.42 + +* Fix an issue where `SourceNode`s from different versions of the source-map + library couldn't be used in conjunction with each other. See issue #142. + +## 0.1.41 + +* Fix a bug with getting the source content of relative sources with a "./" + prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768). + +* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the + column span of each mapping. + +* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find + all generated positions associated with a given original source and line. + ## 0.1.40 * Performance improvements for parsing source maps in SourceMapConsumer. diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md index 1a1c7d8..59767aa 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md @@ -175,6 +175,11 @@ following attributes: * `file`: Optional. The generated filename this source map is associated with. +#### SourceMapConsumer.prototype.computeColumnSpans() + +Compute the last column for each generated mapping. The last column is +inclusive. + #### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) Returns the original source, line, and column information for the generated @@ -216,6 +221,22 @@ and an object is returned with the following properties: * `column`: The column number in the generated source, or null. +#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) + +Returns all generated line and column information for the original source +and line provided. The only argument is an object with the following +properties: + +* `source`: The filename of the original source. + +* `line`: The line number in the original source. + +and an array of objects is returned, each with the following properties: + +* `line`: The line number in the generated source, or null. + +* `column`: The column number in the generated source, or null. + #### SourceMapConsumer.prototype.sourceContentFor(source) Returns the original source content for the source provided. The only @@ -253,6 +274,11 @@ You may pass an object with the following properties: * `sourceRoot`: A root for all relative URLs in this source map. +* `skipValidation`: Optional. When `true`, disables validation of mappings as + they are added. This can improve performance but should be used with + discretion, as a last resort. Even then, one should avoid using this flag when + running tests, if possible. + #### SourceMapGenerator.fromSourceMap(sourceMapConsumer) Creates a new SourceMapGenerator based on a SourceMapConsumer diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js index b4ff136..e22dcae 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js @@ -66,7 +66,7 @@ define(function (require, exports, module) { /** * Converts from a two-complement value to a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: + * placed in the least significant bit. For example, as decimals: * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) */ @@ -78,7 +78,7 @@ define(function (require, exports, module) { /** * Converts to a two-complement value from a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: + * placed in the least significant bit. For example, as decimals: * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 */ diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js index ff347c6..e085f81 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js @@ -23,17 +23,17 @@ define(function (require, exports, module) { // // 1. We find the exact element we are looking for. // - // 2. We did not find the exact element, but we can return the next - // closest element that is less than that element. + // 2. We did not find the exact element, but we can return the index of + // the next closest element that is less than that element. // // 3. We did not find the exact element, and there is no next-closest // element which is less than the one we are searching for, so we - // return null. + // return -1. var mid = Math.floor((aHigh - aLow) / 2) + aLow; var cmp = aCompare(aNeedle, aHaystack[mid], true); if (cmp === 0) { // Found the element we are looking for. - return aHaystack[mid]; + return mid; } else if (cmp > 0) { // aHaystack[mid] is greater than our needle. @@ -43,7 +43,7 @@ define(function (require, exports, module) { } // We did not find an exact match, return the next closest one // (termination case 2). - return aHaystack[mid]; + return mid; } else { // aHaystack[mid] is less than our needle. @@ -53,18 +53,16 @@ define(function (require, exports, module) { } // The exact needle element was not found in this haystack. Determine if // we are in termination case (2) or (3) and return the appropriate thing. - return aLow < 0 - ? null - : aHaystack[aLow]; + return aLow < 0 ? -1 : aLow; } } /** * This is an implementation of binary search which will always try and return - * the next lowest value checked if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. + * the index of next lowest value checked if there is no exact hit. This is + * because mappings between original and generated line/col pairs are single + * points, and there is an implicit region between each of them, so a miss + * just means that you aren't on the very start of a region. * * @param aNeedle The element you are looking for. * @param aHaystack The array that is being searched. @@ -73,9 +71,10 @@ define(function (require, exports, module) { * than, equal to, or greater than the element, respectively. */ exports.search = function search(aNeedle, aHaystack, aCompare) { - return aHaystack.length > 0 - ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) - : null; + if (aHaystack.length === 0) { + return -1; + } + return recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) }; }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/mapping-list.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/mapping-list.js new file mode 100644 index 0000000..2a4eb61 --- /dev/null +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/mapping-list.js @@ -0,0 +1,86 @@ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +if (typeof define !== 'function') { + var define = require('amdefine')(module, require); +} +define(function (require, exports, module) { + + var util = require('./util'); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositions(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + var mapping; + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositions); + this._sorted = true; + } + return this._array; + }; + + exports.MappingList = MappingList; + +}); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js index ea643bf..cfaa299 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js @@ -66,6 +66,11 @@ define(function (require, exports, module) { throw new Error('Unsupported version: ' + version); } + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + sources = sources.map(util.normalize); + // Pass `true` below to allow duplicate names and sources. While source maps // are intended to be compressed and deduplicated, the TypeScript compiler // sometimes generates source maps with duplicates in them. See Github issue @@ -97,9 +102,8 @@ define(function (require, exports, module) { smc.sourceRoot); smc.file = aSourceMap._file; - smc.__generatedMappings = aSourceMap._mappings.slice() - .sort(util.compareByGeneratedPositions); - smc.__originalMappings = aSourceMap._mappings.slice() + smc.__generatedMappings = aSourceMap._mappings.toArray().slice(); + smc.__originalMappings = aSourceMap._mappings.toArray().slice() .sort(util.compareByOriginalPositions); return smc; @@ -290,6 +294,33 @@ define(function (require, exports, module) { return binarySearch.search(aNeedle, aMappings, aComparator); }; + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + SourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object @@ -312,23 +343,27 @@ define(function (require, exports, module) { generatedColumn: util.getArg(aArgs, 'column') }; - var mapping = this._findMapping(needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositions); + var index = this._findMapping(needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositions); - if (mapping && mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source != null && this.sourceRoot != null) { - source = util.join(this.sourceRoot, source); + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source != null && this.sourceRoot != null) { + source = util.join(this.sourceRoot, source); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: util.getArg(mapping, 'name', null) + }; } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: util.getArg(mapping, 'name', null) - }; } return { @@ -406,25 +441,82 @@ define(function (require, exports, module) { needle.source = util.relative(this.sourceRoot, needle.source); } - var mapping = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions); + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions); + + if (index >= 0) { + var mapping = this._originalMappings[index]; - if (mapping) { return { line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null) + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }; } return { line: null, - column: null + column: null, + lastColumn: null }; }; + /** + * Returns all generated line and column information for the original source + * and line provided. The only argument is an object with the following + * properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + // When there is no exact match, SourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to Infinity, we thus find the last + // mapping for the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: util.getArg(aArgs, 'line'), + originalColumn: Infinity + }; + + if (this.sourceRoot != null) { + needle.source = util.relative(this.sourceRoot, needle.source); + } + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + while (mapping && mapping.originalLine === needle.originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[--index]; + } + } + + return mappings.reverse(); + }; + SourceMapConsumer.GENERATED_ORDER = 1; SourceMapConsumer.ORIGINAL_ORDER = 2; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js index 5387fa1..1ab7a47 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js @@ -12,6 +12,7 @@ define(function (require, exports, module) { var base64VLQ = require('./base64-vlq'); var util = require('./util'); var ArraySet = require('./array-set').ArraySet; + var MappingList = require('./mapping-list').MappingList; /** * An instance of the SourceMapGenerator represents a source map which is @@ -27,9 +28,10 @@ define(function (require, exports, module) { } this._file = util.getArg(aArgs, 'file', null); this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); this._sources = new ArraySet(); this._names = new ArraySet(); - this._mappings = []; + this._mappings = new MappingList(); this._sourcesContents = null; } @@ -99,7 +101,9 @@ define(function (require, exports, module) { var source = util.getArg(aArgs, 'source', null); var name = util.getArg(aArgs, 'name', null); - this._validateMapping(generated, original, source, name); + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } if (source != null && !this._sources.has(source)) { this._sources.add(source); @@ -109,7 +113,7 @@ define(function (require, exports, module) { this._names.add(name); } - this._mappings.push({ + this._mappings.add({ generatedLine: generated.line, generatedColumn: generated.column, originalLine: original != null && original.line, @@ -186,7 +190,7 @@ define(function (require, exports, module) { var newNames = new ArraySet(); // Find mappings for the "sourceFile" - this._mappings.forEach(function (mapping) { + this._mappings.unsortedForEach(function (mapping) { if (mapping.source === sourceFile && mapping.originalLine != null) { // Check if it can be mapped by the source map, then update the mapping. var original = aSourceMapConsumer.originalPositionFor({ @@ -292,15 +296,10 @@ define(function (require, exports, module) { var result = ''; var mapping; - // The mappings must be guaranteed to be in sorted order before we start - // serializing them or else the generated line numbers (which are defined - // via the ';' separators) will be all messed up. Note: it might be more - // performant to maintain the sorting as we insert them, rather than as we - // serialize them, but the big O is the same either way. - this._mappings.sort(util.compareByGeneratedPositions); + var mappings = this._mappings.toArray(); - for (var i = 0, len = this._mappings.length; i < len; i++) { - mapping = this._mappings[i]; + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; if (mapping.generatedLine !== previousGeneratedLine) { previousGeneratedColumn = 0; @@ -311,7 +310,7 @@ define(function (require, exports, module) { } else { if (i > 0) { - if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) { + if (!util.compareByGeneratedPositions(mapping, mappings[i - 1])) { continue; } result += ','; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js index baa5f40..9ee90bd 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js @@ -16,8 +16,13 @@ define(function (require, exports, module) { // operating systems these days (capturing the result). var REGEX_NEWLINE = /(\r?\n)/; - // Matches a Windows-style newline, or any character. - var REGEX_CHARACTER = /\r\n|[\s\S]/g; + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; /** * SourceNodes provide a way to abstract over interpolating/concatenating @@ -38,6 +43,7 @@ define(function (require, exports, module) { this.column = aColumn == null ? null : aColumn; this.source = aSource == null ? null : aSource; this.name = aName == null ? null : aName; + this[isSourceNode] = true; if (aChunks != null) this.add(aChunks); } @@ -168,7 +174,7 @@ define(function (require, exports, module) { this.add(chunk); }, this); } - else if (aChunk instanceof SourceNode || typeof aChunk === "string") { + else if (aChunk[isSourceNode] || typeof aChunk === "string") { if (aChunk) { this.children.push(aChunk); } @@ -193,7 +199,7 @@ define(function (require, exports, module) { this.prepend(aChunk[i]); } } - else if (aChunk instanceof SourceNode || typeof aChunk === "string") { + else if (aChunk[isSourceNode] || typeof aChunk === "string") { this.children.unshift(aChunk); } else { @@ -215,7 +221,7 @@ define(function (require, exports, module) { var chunk; for (var i = 0, len = this.children.length; i < len; i++) { chunk = this.children[i]; - if (chunk instanceof SourceNode) { + if (chunk[isSourceNode]) { chunk.walk(aFn); } else { @@ -260,7 +266,7 @@ define(function (require, exports, module) { */ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { var lastChild = this.children[this.children.length - 1]; - if (lastChild instanceof SourceNode) { + if (lastChild[isSourceNode]) { lastChild.replaceRight(aPattern, aReplacement); } else if (typeof lastChild === 'string') { @@ -293,7 +299,7 @@ define(function (require, exports, module) { SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i] instanceof SourceNode) { + if (this.children[i][isSourceNode]) { this.children[i].walkSourceContents(aFn); } } @@ -369,12 +375,12 @@ define(function (require, exports, module) { lastOriginalSource = null; sourceMappingActive = false; } - chunk.match(REGEX_CHARACTER).forEach(function (ch, idx, array) { - if (REGEX_NEWLINE.test(ch)) { + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { generated.line++; generated.column = 0; // Mappings end at eol - if (idx + 1 === array.length) { + if (idx + 1 === length) { lastOriginalSource = null; sourceMappingActive = false; } else if (sourceMappingActive) { @@ -392,9 +398,9 @@ define(function (require, exports, module) { }); } } else { - generated.column += ch.length; + generated.column++; } - }); + } }); this.walkSourceContents(function (sourceFile, sourceContent) { map.setSourceContent(sourceFile, sourceContent); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json index 070587a..73cdef7 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json @@ -1,7 +1,7 @@ { "name": "source-map", "description": "Generates and consumes source maps", - "version": "0.1.40", + "version": "0.1.43", "homepage": "https://github.com/mozilla/source-map", "author": { "name": "Nick Fitzgerald", @@ -107,6 +107,22 @@ { "name": "Chris Montgomery", "email": "christopher.montgomery@dowjones.com" + }, + { + "name": "J. Ryan Stinnett", + "email": "jryans@gmail.com" + }, + { + "name": "Jack Herrington", + "email": "jherrington@walmartlabs.com" + }, + { + "name": "Chris Truter", + "email": "jeffpalentine@gmail.com" + }, + { + "name": "Daniel Espeset", + "email": "daniel@danielespeset.com" } ], "repository": { @@ -139,9 +155,9 @@ "bugs": { "url": "https://github.com/mozilla/source-map/issues" }, - "_id": "source-map@0.1.40", - "_shasum": "7e0ee49ec0452aa9ac2b93ad5ae54ef33e82b37f", - "_from": "source-map@~0.1.7", + "_id": "source-map@0.1.43", + "_shasum": "c24bc146ca517c1471f5dacbe2571b2b7f9e3346", + "_from": "source-map@>=0.1.7 <0.2.0", "_npmVersion": "1.4.9", "_npmUser": { "name": "nickfitzgerald", @@ -162,9 +178,9 @@ } ], "dist": { - "shasum": "7e0ee49ec0452aa9ac2b93ad5ae54ef33e82b37f", - "tarball": "http://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz" + "shasum": "c24bc146ca517c1471f5dacbe2571b2b7f9e3346", + "tarball": "http://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz" }, - "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.40.tgz", + "_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js index ee30683..f1c9e0f 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js @@ -23,7 +23,7 @@ define(function (require, exports, module) { binarySearch.search(needle, haystack, numberCompare); }); - assert.equal(binarySearch.search(needle, haystack, numberCompare), 20); + assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 20); }; exports['test too low'] = function (assert, util) { @@ -34,21 +34,21 @@ define(function (require, exports, module) { binarySearch.search(needle, haystack, numberCompare); }); - assert.equal(binarySearch.search(needle, haystack, numberCompare), null); + assert.equal(binarySearch.search(needle, haystack, numberCompare), -1); }; exports['test exact search'] = function (assert, util) { var needle = 4; var haystack = [2,4,6,8,10,12,14,16,18,20]; - assert.equal(binarySearch.search(needle, haystack, numberCompare), 4); + assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 4); }; exports['test fuzzy search'] = function (assert, util) { var needle = 19; var haystack = [2,4,6,8,10,12,14,16,18,20]; - assert.equal(binarySearch.search(needle, haystack, numberCompare), 18); + assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 18); }; }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js index a4c6659..c714943 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js @@ -252,6 +252,25 @@ define(function (require, exports, module) { }, Error); }; + exports['test that we can get the original source content with relative source paths'] = function (assert, util) { + var map = new SourceMapConsumer(util.testMapRelativeSources); + var sources = map.sources; + + assert.equal(map.sourceContentFor(sources[0]), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); + assert.equal(map.sourceContentFor(sources[1]), ' TWO.inc = function (n) {\n return n + 1;\n };'); + assert.equal(map.sourceContentFor("one.js"), ' ONE.foo = function (bar) {\n return baz(bar);\n };'); + assert.equal(map.sourceContentFor("two.js"), ' TWO.inc = function (n) {\n return n + 1;\n };'); + assert.throws(function () { + map.sourceContentFor(""); + }, Error); + assert.throws(function () { + map.sourceContentFor("/the/root/three.js"); + }, Error); + assert.throws(function () { + map.sourceContentFor("three.js"); + }, Error); + }; + exports['test sourceRoot + generatedPositionFor'] = function (assert, util) { var map = new SourceMapGenerator({ sourceRoot: 'foo/bar', @@ -290,6 +309,158 @@ define(function (require, exports, module) { assert.equal(pos.column, 2); }; + exports['test allGeneratedPositionsFor'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'bar.coffee' + }); + map.addMapping({ + original: { line: 2, column: 1 }, + generated: { line: 3, column: 2 }, + source: 'bar.coffee' + }); + map.addMapping({ + original: { line: 2, column: 2 }, + generated: { line: 3, column: 3 }, + source: 'bar.coffee' + }); + map.addMapping({ + original: { line: 3, column: 1 }, + generated: { line: 4, column: 2 }, + source: 'bar.coffee' + }); + map = new SourceMapConsumer(map.toString()); + + var mappings = map.allGeneratedPositionsFor({ + line: 2, + source: 'bar.coffee' + }); + + assert.equal(mappings.length, 2); + assert.equal(mappings[0].line, 3); + assert.equal(mappings[0].column, 2); + assert.equal(mappings[1].line, 3); + assert.equal(mappings[1].column, 3); + }; + + exports['test allGeneratedPositionsFor for line with no mappings'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 2, column: 2 }, + source: 'bar.coffee' + }); + map.addMapping({ + original: { line: 3, column: 1 }, + generated: { line: 4, column: 2 }, + source: 'bar.coffee' + }); + map = new SourceMapConsumer(map.toString()); + + var mappings = map.allGeneratedPositionsFor({ + line: 2, + source: 'bar.coffee' + }); + + assert.equal(mappings.length, 0); + }; + + exports['test allGeneratedPositionsFor source map with no mappings'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated.js' + }); + map = new SourceMapConsumer(map.toString()); + + var mappings = map.allGeneratedPositionsFor({ + line: 2, + source: 'bar.coffee' + }); + + assert.equal(mappings.length, 0); + }; + + exports['test computeColumnSpans'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated.js' + }); + map.addMapping({ + original: { line: 1, column: 1 }, + generated: { line: 1, column: 1 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 2, column: 1 }, + generated: { line: 2, column: 1 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 2, column: 2 }, + generated: { line: 2, column: 10 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 2, column: 3 }, + generated: { line: 2, column: 20 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 3, column: 1 }, + generated: { line: 3, column: 1 }, + source: 'foo.coffee' + }); + map.addMapping({ + original: { line: 3, column: 2 }, + generated: { line: 3, column: 2 }, + source: 'foo.coffee' + }); + map = new SourceMapConsumer(map.toString()); + + map.computeColumnSpans(); + + var mappings = map.allGeneratedPositionsFor({ + line: 1, + source: 'foo.coffee' + }); + + assert.equal(mappings.length, 1); + assert.equal(mappings[0].lastColumn, Infinity); + + var mappings = map.allGeneratedPositionsFor({ + line: 2, + source: 'foo.coffee' + }); + + assert.equal(mappings.length, 3); + assert.equal(mappings[0].lastColumn, 9); + assert.equal(mappings[1].lastColumn, 19); + assert.equal(mappings[2].lastColumn, Infinity); + + var mappings = map.allGeneratedPositionsFor({ + line: 3, + source: 'foo.coffee' + }); + + assert.equal(mappings.length, 2); + assert.equal(mappings[0].lastColumn, 1); + assert.equal(mappings[1].lastColumn, Infinity); + }; + exports['test sourceRoot + originalPositionFor'] = function (assert, util) { var map = new SourceMapGenerator({ sourceRoot: 'foo/bar', diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js index a0d9d00..d748bb1 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js @@ -98,6 +98,27 @@ define(function (require, exports, module) { }); }; + exports['test adding mappings with skipValidation'] = function (assert, util) { + var map = new SourceMapGenerator({ + file: 'generated-foo.js', + sourceRoot: '.', + skipValidation: true + }); + + // Not enough info, caught by `util.getArgs` + assert.throws(function () { + map.addMapping({}); + }); + + // Original file position, but no source. Not checked. + assert.doesNotThrow(function () { + map.addMapping({ + generated: { line: 1, column: 1 }, + original: { line: 1, column: 1 } + }); + }); + }; + exports['test that the correct mappings are being generated'] = function (assert, util) { var map = new SourceMapGenerator({ file: 'min.js', diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js index fa213ce..56bbe2c 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js @@ -71,6 +71,22 @@ define(function (require, exports, module) { sourceRoot: '/the/root', mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' }; + exports.testMapRelativeSources = { + version: 3, + file: 'min.js', + names: ['bar', 'baz', 'n'], + sources: ['./one.js', './two.js'], + sourcesContent: [ + ' ONE.foo = function (bar) {\n' + + ' return baz(bar);\n' + + ' };', + ' TWO.inc = function (n) {\n' + + ' return n + 1;\n' + + ' };' + ], + sourceRoot: '/the/root', + mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA' + }; exports.emptyMap = { version: 3, file: 'min.js', diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/package.json index 4037228..066a10b 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/package.json @@ -35,5 +35,5 @@ "url": "https://github.com/mishoo/UglifyJS2/issues" }, "_id": "uglify-js@2.3.6", - "_from": "uglify-js@~2.3" + "_from": "uglify-js@>=2.3.0 <2.4.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/package.json index 6e6a260..28c9b00 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/handlebars/package.json @@ -68,7 +68,7 @@ "shasum": "9e9b130a93e389491322d975cf3ec1818c37ce34", "tarball": "http://registry.npmjs.org/handlebars/-/handlebars-1.3.0.tgz" }, - "_from": "handlebars@1.3.x", + "_from": "handlebars@>=1.3.0 <1.4.0", "_npmVersion": "1.3.11", "_npmUser": { "name": "kpdecker", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/HISTORY.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/HISTORY.md index e57a4b8..0733e89 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/HISTORY.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/HISTORY.md @@ -1,3 +1,17 @@ +3.2.5 / 2014-12-28 +------------------ + +- Fixed resolving of all built-in types on empty nodes. +- Fixed invalid warning on empty lines within quoted scalars and flow collections. +- Fixed bug: Tag on an empty node didn't resolve in some cases. + + +3.2.4 / 2014-12-19 +------------------ + +- Fixed resolving of !!null tag on an empty node. + + 3.2.3 / 2014-11-08 ------------------ diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.js index f518f13..451b05d 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.js @@ -1,4 +1,4 @@ -/* js-yaml 3.2.3 https://github.com/nodeca/js-yaml */!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.jsyaml=e()}}(function(){var define,module,exports;return (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;oparent, 0: this=parent, -1: this parentIndent) { - isIndented = true; - - } else { - return false; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; } } } - if (isIndented) { + if (1 === indentStatus) { while (readTagProperty(state) || readAnchorProperty(state)) { if (skipSeparationSpace(state, true, -1)) { atNewLine = true; + allowBlockCollections = allowBlockStyles; if (state.lineIndent > parentIndent) { - isIndented = true; - allowBlockCollections = allowBlockStyles; - + indentStatus = 1; } else if (state.lineIndent === parentIndent) { - isIndented = false; - allowBlockCollections = allowBlockStyles; - - } else { - return true; + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; } } else { allowBlockCollections = false; @@ -1991,7 +1986,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact allowBlockCollections = atNewLine || allowCompact; } - if (isIndented || CONTEXT_BLOCK_OUT === nodeContext) { + if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) { if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { flowIndent = parentIndent; } else { @@ -2000,7 +1995,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact blockIndent = state.position - state.lineStart; - if (isIndented) { + if (1 === indentStatus) { if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || @@ -2031,7 +2026,9 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact state.anchorMap[state.anchor] = state.result; } } - } else { + } else if (0 === indentStatus) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); } } @@ -2646,6 +2643,10 @@ var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 function resolveYamlBinary(data) { + if (null === data) { + return false; + } + var code, idx, bitlen = 0, len = 0, max = data.length, map = BASE64_MAP; // Convert one by one. @@ -2768,6 +2769,10 @@ module.exports = new Type('tag:yaml.org,2002:binary', { var Type = require('../type'); function resolveYamlBoolean(data) { + if (null === data) { + return false; + } + var max = data.length; return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || @@ -2811,6 +2816,10 @@ var YAML_FLOAT_PATTERN = new RegExp( '|\\.(?:nan|NaN|NAN))$'); function resolveYamlFloat(data) { + if (null === data) { + return false; + } + var value, sign, base, digits; if (!YAML_FLOAT_PATTERN.test(data)) { @@ -2926,6 +2935,10 @@ function isDecCode(c) { } function resolveYamlInteger(data) { + if (null === data) { + return false; + } + var max = data.length, index = 0, hasDigits = false, @@ -3108,6 +3121,10 @@ try { var Type = require('../../type'); function resolveJavascriptFunction(data) { + if (null === data) { + return false; + } + try { var source = '(' + data + ')', ast = esprima.parse(source, { range: true }), @@ -3175,6 +3192,14 @@ module.exports = new Type('tag:yaml.org,2002:js/function', { var Type = require('../../type'); function resolveJavascriptRegExp(data) { + if (null === data) { + return false; + } + + if (0 === data.length) { + return false; + } + var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = ''; @@ -3282,7 +3307,8 @@ module.exports = new Type('tag:yaml.org,2002:js/undefined', { var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping' + kind: 'mapping', + construct: function (data) { return null !== data ? data : {}; } }); },{"../type":13}],22:[function(require,module,exports){ @@ -3291,12 +3317,12 @@ module.exports = new Type('tag:yaml.org,2002:map', { var Type = require('../type'); function resolveYamlMerge(data) { - return '<<' === data; + return '<<' === data || null === data; } module.exports = new Type('tag:yaml.org,2002:merge', { kind: 'scalar', - resolve: resolveYamlMerge, + resolve: resolveYamlMerge }); },{"../type":13}],23:[function(require,module,exports){ @@ -3305,6 +3331,10 @@ module.exports = new Type('tag:yaml.org,2002:merge', { var Type = require('../type'); function resolveYamlNull(data) { + if (null === data) { + return true; + } + var max = data.length; return (max === 1 && data === '~') || @@ -3342,6 +3372,10 @@ var _hasOwnProperty = Object.prototype.hasOwnProperty; var _toString = Object.prototype.toString; function resolveYamlOmap(data) { + if (null === data) { + return true; + } + var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; @@ -3377,9 +3411,14 @@ function resolveYamlOmap(data) { return true; } +function constructYamlOmap(data) { + return null !== data ? data : []; +} + module.exports = new Type('tag:yaml.org,2002:omap', { kind: 'sequence', - resolve: resolveYamlOmap + resolve: resolveYamlOmap, + construct: constructYamlOmap }); },{"../type":13}],25:[function(require,module,exports){ @@ -3390,6 +3429,10 @@ var Type = require('../type'); var _toString = Object.prototype.toString; function resolveYamlPairs(data) { + if (null === data) { + return true; + } + var index, length, pair, keys, result, object = data; @@ -3415,6 +3458,10 @@ function resolveYamlPairs(data) { } function constructYamlPairs(data) { + if (null === data) { + return []; + } + var index, length, pair, keys, result, object = data; @@ -3443,7 +3490,8 @@ module.exports = new Type('tag:yaml.org,2002:pairs', { var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence' + kind: 'sequence', + construct: function (data) { return null !== data ? data : []; } }); },{"../type":13}],27:[function(require,module,exports){ @@ -3454,6 +3502,10 @@ var Type = require('../type'); var _hasOwnProperty = Object.prototype.hasOwnProperty; function resolveYamlSet(data) { + if (null === data) { + return true; + } + var key, object = data; for (key in object) { @@ -3467,9 +3519,14 @@ function resolveYamlSet(data) { return true; } +function constructYamlSet(data) { + return null !== data ? data : {}; +} + module.exports = new Type('tag:yaml.org,2002:set', { kind: 'mapping', - resolve: resolveYamlSet + resolve: resolveYamlSet, + construct: constructYamlSet }); },{"../type":13}],28:[function(require,module,exports){ @@ -3478,7 +3535,8 @@ module.exports = new Type('tag:yaml.org,2002:set', { var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar' + kind: 'scalar', + construct: function (data) { return null !== data ? data : ''; } }); },{"../type":13}],29:[function(require,module,exports){ @@ -3499,6 +3557,10 @@ var YAML_TIMESTAMP_REGEXP = new RegExp( '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute function resolveYamlTimestamp(data) { + if (null === data) { + return false; + } + var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.min.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.min.js index 42ee1e1..531e3eb 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.min.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/dist/js-yaml.min.js @@ -1,3 +1,3 @@ -/* js-yaml 3.2.3 https://github.com/nodeca/js-yaml */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.jsyaml=e()}}(function(){return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var p=n[a]={exports:{}};t[a][0].call(p.exports,function(e){var n=t[a][1][e];return r(n?n:e)},p,p.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;an;n+=1)r=o[n],e[r]=t[r];return e}function a(e,t){var n,i="";for(n=0;t>n;n+=1)i+=e;return i}function s(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}t.exports.isNothing=n,t.exports.isObject=i,t.exports.toArray=r,t.exports.repeat=a,t.exports.isNegativeZero=s,t.exports.extend=o},{}],3:[function(e,t){"use strict";function n(e,t){var n,i,r,o,a,s,c;if(null===t)return{};for(n={},i=Object.keys(t),r=0,o=i.length;o>r;r+=1)a=i[r],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap[a],c&&C.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[a]=s;return n}function i(e){var t,n,i;if(t=e.toString(16).toUpperCase(),255>=e)n="x",i=2;else if(65535>=e)n="u",i=4;else{if(!(4294967295>=e))throw new v("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+x.repeat("0",i-t.length)+t}function r(e){this.schema=e.schema||A,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=x.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=n(this.schema,e.styles||null),this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function o(e,t){return"\n"+x.repeat(" ",e.indent*t)}function a(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;i>n;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function s(e,t){var n,r,o,s,c,u;for(e.dump="",n=!1,r=0,u=t.charCodeAt(0)||0,-1!==Z.indexOf(t)?n=!0:0===t.length?n=!0:S===u||S===t.charCodeAt(t.length-1)?n=!0:(D===u||q===u)&&(n=!0),o=0,s=t.length;s>o;o+=1)c=t.charCodeAt(o),n||(k===c||j===c||I===c||L===c||R===c||H===c||B===c||V===c||F===c||_===c||M===c||O===c||G===c||Y===c||T===c||E===c||N===c||P===c||U===c||$===c)&&(n=!0),(W[c]||!(c>=32&&126>=c||133===c||c>=160&&55295>=c||c>=57344&&65533>=c||c>=65536&&1114111>=c))&&(e.dump+=t.slice(r,o),e.dump+=W[c]||i(c),r=o+1,n=!0);o>r&&(e.dump+=t.slice(r,o)),!n&&a(e,e.dump)&&(n=!0),n&&(e.dump='"'+e.dump+'"')}function c(e,t,n){var i,r,o="",a=e.tag;for(i=0,r=n.length;r>i;i+=1)d(e,t,n[i],!1,!1)&&(0!==i&&(o+=", "),o+=e.dump);e.tag=a,e.dump="["+o+"]"}function u(e,t,n,i){var r,a,s="",c=e.tag;for(r=0,a=n.length;a>r;r+=1)d(e,t+1,n[r],!0,!0)&&(i&&0===r||(s+=o(e,t)),s+="- "+e.dump);e.tag=c,e.dump=s||"[]"}function p(e,t,n){var i,r,o,a,s,c="",u=e.tag,p=Object.keys(n);for(i=0,r=p.length;r>i;i+=1)s="",0!==i&&(s+=", "),o=p[i],a=n[o],d(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+": ",d(e,t,a,!1,!1)&&(s+=e.dump,c+=s));e.tag=u,e.dump="{"+c+"}"}function l(e,t,n,i){var r,a,s,c,u,p,l="",f=e.tag,h=Object.keys(n);for(r=0,a=h.length;a>r;r+=1)p="",i&&0===r||(p+=o(e,t)),s=h[r],c=n[s],d(e,t+1,s,!0,!0)&&(u=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,u&&(p+=e.dump&&j===e.dump.charCodeAt(0)?"?":"? "),p+=e.dump,u&&(p+=o(e,t)),d(e,t+1,c,!0,u)&&(p+=e.dump&&j===e.dump.charCodeAt(0)?":":": ",p+=e.dump,l+=p));e.tag=f,e.dump=l||"{}"}function f(e,t,n){var i,r,o,a,s,c;for(r=n?e.explicitTypes:e.implicitTypes,o=0,a=r.length;a>o;o+=1)if(s=r[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,"[object Function]"===w.call(s.represent))i=s.represent(t,c);else{if(!C.call(s.represent,c))throw new v("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');i=s.represent[c](t,c)}e.dump=i}return!0}return!1}function d(e,t,n,i,r){e.tag=null,e.dump=n,f(e,n,!1)||f(e,n,!0);var o=w.call(e.dump);i&&(i=0>e.flowLevel||e.flowLevel>t),(null!==e.tag&&"?"!==e.tag||2!==e.indent&&t>0)&&(r=!1);var a,d,h="[object Object]"===o||"[object Array]"===o;if(h&&(a=e.duplicates.indexOf(n),d=-1!==a),d&&e.usedDuplicates[a])e.dump="*ref_"+a;else{if(h&&d&&!e.usedDuplicates[a]&&(e.usedDuplicates[a]=!0),"[object Object]"===o)i&&0!==Object.keys(e.dump).length?(l(e,t,e.dump,r),d&&(e.dump="&ref_"+a+(0===t?"\n":"")+e.dump)):(p(e,t,e.dump),d&&(e.dump="&ref_"+a+" "+e.dump));else if("[object Array]"===o)i&&0!==e.dump.length?(u(e,t,e.dump,r),d&&(e.dump="&ref_"+a+(0===t?"\n":"")+e.dump)):(c(e,t,e.dump),d&&(e.dump="&ref_"+a+" "+e.dump));else{if("[object String]"!==o){if(e.skipInvalid)return!1;throw new v("unacceptable kind of an object to dump "+o)}"?"!==e.tag&&s(e,e.dump)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function h(e,t){var n,i,r=[],o=[];for(m(e,r,o),n=0,i=o.length;i>n;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function m(e,t,n){{var i,r,o;w.call(e)}if(null!==e&&"object"==typeof e)if(r=t.indexOf(e),-1!==r)-1===n.indexOf(r)&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;o>r;r+=1)m(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;o>r;r+=1)m(e[i[r]],t,n)}function g(e,t){t=t||{};var n=new r(t);return h(e,n),d(n,0,e,!0,!0)?n.dump+"\n":""}function y(e,t){return g(e,x.extend({schema:b},t))}var x=e("./common"),v=e("./exception"),A=e("./schema/default_full"),b=e("./schema/default_safe"),w=Object.prototype.toString,C=Object.prototype.hasOwnProperty,k=9,j=10,I=13,S=32,O=33,E=34,F=35,N=37,_=38,T=39,M=42,L=44,D=45,U=58,Y=62,q=63,P=64,R=91,H=93,$=96,B=123,G=124,V=125,W={};W[0]="\\0",W[7]="\\a",W[8]="\\b",W[9]="\\t",W[10]="\\n",W[11]="\\v",W[12]="\\f",W[13]="\\r",W[27]="\\e",W[34]='\\"',W[92]="\\\\",W[133]="\\N",W[160]="\\_",W[8232]="\\L",W[8233]="\\P";var Z=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];t.exports.dump=g,t.exports.safeDump=y},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(e,t){"use strict";function n(e,t){this.name="YAMLException",this.reason=e,this.mark=t,this.message=this.toString(!1)}n.prototype.toString=function(e){var t;return t="JS-YAML: "+(this.reason||"(unknown reason)"),!e&&this.mark&&(t+=" "+this.mark.toString()),t},t.exports=n},{}],5:[function(e,t){"use strict";function n(e){return 10===e||13===e}function i(e){return 9===e||32===e}function r(e){return 9===e||32===e||10===e||13===e}function o(e){return 44===e||91===e||93===e||123===e||125===e}function a(e){var t;return e>=48&&57>=e?e-48:(t=32|e,t>=97&&102>=t?t-97+10:-1)}function s(e){return 120===e?2:117===e?4:85===e?8:0}function c(e){return e>=48&&57>=e?e-48:-1}function u(e){return 48===e?"\x00":97===e?"":98===e?"\b":116===e?" ":9===e?" ":110===e?"\n":118===e?" ":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function p(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||H,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function l(e,t){return new q(t,new P(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function f(e,t){throw l(e,t)}function d(e,t){var n=l(e,t);if(!e.onWarning)throw n;e.onWarning.call(null,n)}function h(e,t,n,i){var r,o,a,s;if(n>t){if(s=e.input.slice(t,n),i)for(r=0,o=s.length;o>r;r+=1)a=s.charCodeAt(r),9===a||a>=32&&1114111>=a||f(e,"expected valid JSON character");e.result+=s}}function m(e,t,n){var i,r,o,a;for(Y.isObject(n)||f(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;a>o;o+=1)r=i[o],$.call(t,r)||(t[r]=n[r])}function g(e,t,n,i,r){var o,a;if(i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(r))for(o=0,a=r.length;a>o;o+=1)m(e,t,r[o]);else m(e,t,r);else t[i]=r;return t}function y(e){var t;t=e.input.charCodeAt(e.position),10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):f(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function x(e,t,r){for(var o=0,a=e.input.charCodeAt(e.position);0!==a;){for(;i(a);)a=e.input.charCodeAt(++e.position);if(t&&35===a)do a=e.input.charCodeAt(++e.position);while(10!==a&&13!==a&&0!==a);if(!n(a))break;for(y(e),a=e.input.charCodeAt(e.position),o++,e.lineIndent=0;32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position);e.lineIndent1&&(e.result+=Y.repeat("\n",t-1))}function b(e,t,a){var s,c,u,p,l,f,d,m,g,y=e.kind,b=e.result;if(g=e.input.charCodeAt(e.position),r(g)||o(g)||35===g||38===g||42===g||33===g||124===g||62===g||39===g||34===g||37===g||64===g||96===g)return!1;if((63===g||45===g)&&(c=e.input.charCodeAt(e.position+1),r(c)||a&&o(c)))return!1;for(e.kind="scalar",e.result="",u=p=e.position,l=!1;0!==g;){if(58===g){if(c=e.input.charCodeAt(e.position+1),r(c)||a&&o(c))break}else if(35===g){if(s=e.input.charCodeAt(e.position-1),r(s))break}else{if(e.position===e.lineStart&&v(e)||a&&o(g))break;if(n(g)){if(f=e.line,d=e.lineStart,m=e.lineIndent,x(e,!1,-1),e.lineIndent>=t){l=!0,g=e.input.charCodeAt(e.position);continue}e.position=p,e.line=f,e.lineStart=d,e.lineIndent=m;break}}l&&(h(e,u,p,!1),A(e,e.line-f),u=p=e.position,l=!1),i(g)||(p=e.position+1),g=e.input.charCodeAt(++e.position)}return h(e,u,p,!1),e.result?!0:(e.kind=y,e.result=b,!1)}function w(e,t){var i,r,o;if(i=e.input.charCodeAt(e.position),39!==i)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;0!==(i=e.input.charCodeAt(e.position));)if(39===i){if(h(e,r,e.position,!0),i=e.input.charCodeAt(++e.position),39!==i)return!0;r=o=e.position,e.position++}else n(i)?(h(e,r,o,!0),A(e,x(e,!1,t)),r=o=e.position):e.position===e.lineStart&&v(e)?f(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);f(e,"unexpected end of the stream within a single quoted scalar")}function C(e,t){var i,r,o,c,u,p;if(p=e.input.charCodeAt(e.position),34!==p)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;0!==(p=e.input.charCodeAt(e.position));){if(34===p)return h(e,i,e.position,!0),e.position++,!0;if(92===p){if(h(e,i,e.position,!0),p=e.input.charCodeAt(++e.position),n(p))x(e,!1,t);else if(256>p&&nt[p])e.result+=it[p],e.position++;else if((u=s(p))>0){for(o=u,c=0;o>0;o--)p=e.input.charCodeAt(++e.position),(u=a(p))>=0?c=(c<<4)+u:f(e,"expected hexadecimal character");e.result+=String.fromCharCode(c),e.position++}else f(e,"unknown escape sequence");i=r=e.position}else n(p)?(h(e,i,r,!0),A(e,x(e,!1,t)),i=r=e.position):e.position===e.lineStart&&v(e)?f(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}f(e,"unexpected end of the stream within a double quoted scalar")}function k(e,t){var n,i,o,a,s,c,u,p,l,d,h,m=!0,y=e.tag,v=e.anchor;if(h=e.input.charCodeAt(e.position),91===h)a=93,u=!1,i=[];else{if(123!==h)return!1;a=125,u=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),h=e.input.charCodeAt(++e.position);0!==h;){if(x(e,!0,t),h=e.input.charCodeAt(e.position),h===a)return e.position++,e.tag=y,e.anchor=v,e.kind=u?"mapping":"sequence",e.result=i,!0;m||f(e,"missed comma between flow collection entries"),l=p=d=null,s=c=!1,63===h&&(o=e.input.charCodeAt(e.position+1),r(o)&&(s=c=!0,e.position++,x(e,!0,t))),n=e.line,N(e,t,B,!1,!0),l=e.tag,p=e.result,x(e,!0,t),h=e.input.charCodeAt(e.position),!c&&e.line!==n||58!==h||(s=!0,h=e.input.charCodeAt(++e.position),x(e,!0,t),N(e,t,B,!1,!0),d=e.result),u?g(e,i,l,p,d):i.push(s?g(e,null,l,p,d):p),x(e,!0,t),h=e.input.charCodeAt(e.position),44===h?(m=!0,h=e.input.charCodeAt(++e.position)):m=!1}f(e,"unexpected end of the stream within a flow collection")}function j(e,t){var r,o,a,s,u=Z,p=!1,l=t,d=0,m=!1;if(s=e.input.charCodeAt(e.position),124===s)o=!1;else{if(62!==s)return!1;o=!0}for(e.kind="scalar",e.result="";0!==s;)if(s=e.input.charCodeAt(++e.position),43===s||45===s)Z===u?u=43===s?z:J:f(e,"repeat of a chomping mode identifier");else{if(!((a=c(s))>=0))break;0===a?f(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):p?f(e,"repeat of an indentation width identifier"):(l=t+a-1,p=!0)}if(i(s)){do s=e.input.charCodeAt(++e.position);while(i(s));if(35===s)do s=e.input.charCodeAt(++e.position);while(!n(s)&&0!==s)}for(;0!==s;){for(y(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!p||e.lineIndentl&&(l=e.lineIndent),n(s))d++;else{if(e.lineIndentt)&&0!==o)f(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(N(e,t,W,!0,a)&&(y?h=e.result:m=e.result),y||(g(e,l,d,h,m),d=h=m=null),x(e,!0,-1),c=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==c)f(e,"bad indentation of a mapping entry");else if(e.lineIndentt))return!1;g=!0}if(g)for(;O(e)||E(e);)if(x(e,!0,-1))if(m=!0,e.lineIndent>t)g=!0,s=o;else{if(e.lineIndent!==t)return!0;g=!1,s=o}else s=!1;if(s&&(s=m||r),(g||W===n)&&(l=B===n||G===n?t:t+1,h=e.position-e.lineStart,g?s&&(I(e,h)||S(e,h,l))||k(e,l)?y=!0:(a&&j(e,l)||w(e,l)||C(e,l)?y=!0:F(e)?(y=!0,(null!==e.tag||null!==e.anchor)&&f(e,"alias node should not have any properties")):b(e,l,B===n)&&(y=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):y=s&&I(e,h)),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(c=0,u=e.implicitTypes.length;u>c;c+=1)if(p=e.implicitTypes[c],p.resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else $.call(e.typeMap,e.tag)?(p=e.typeMap[e.tag],null!==e.result&&p.kind!==e.kind&&f(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result)?(e.result=p.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):f(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):d(e,"unknown tag !<"+e.tag+">");return null!==e.tag||null!==e.anchor||y}function _(e){var t,o,a,s,c=e.position,u=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(s=e.input.charCodeAt(e.position))&&(x(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==s));){for(u=!0,s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!r(s);)s=e.input.charCodeAt(++e.position);for(o=e.input.slice(t,e.position),a=[],o.length<1&&f(e,"directive name must not be less than one character in length");0!==s;){for(;i(s);)s=e.input.charCodeAt(++e.position);if(35===s){do s=e.input.charCodeAt(++e.position);while(0!==s&&!n(s));break}if(n(s))break;for(t=e.position;0!==s&&!r(s);)s=e.input.charCodeAt(++e.position);a.push(e.input.slice(t,e.position))}0!==s&&y(e),$.call(ot,o)?ot[o](e,o,a):d(e,'unknown document directive "'+o+'"')}return x(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,x(e,!0,-1)):u&&f(e,"directives end mark is expected"),N(e,e.lineIndent-1,W,!1,!0),x(e,!0,-1),e.checkLineBreaks&&Q.test(e.input.slice(c,e.position))&&d(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&v(e)?void(46===e.input.charCodeAt(e.position)&&(e.position+=3,x(e,!0,-1))):void(e.positioni;i+=1)t(o[i])}function L(e,t){var n=T(e,t);if(0===n.length)return void 0;if(1===n.length)return n[0];throw new q("expected a single document in the stream, but found more")}function D(e,t,n){M(e,t,Y.extend({schema:R},n))}function U(e,t){return L(e,Y.extend({schema:R},t))}for(var Y=e("./common"),q=e("./exception"),P=e("./mark"),R=e("./schema/default_safe"),H=e("./schema/default_full"),$=Object.prototype.hasOwnProperty,B=1,G=2,V=3,W=4,Z=1,J=2,z=3,K=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uD800-\uDFFF\uFFFE\uFFFF]/,Q=/[\x85\u2028\u2029]/,X=/[,\[\]\{\}]/,et=/^(?:!|!!|![a-z\-]+!)$/i,tt=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,nt=new Array(256),it=new Array(256),rt=0;256>rt;rt++)nt[rt]=u(rt)?1:0,it[rt]=u(rt);var ot={YAML:function(e,t,n){var i,r,o;null!==e.version&&f(e,"duplication of %YAML directive"),1!==n.length&&f(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===i&&f(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&f(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=2>o,1!==o&&2!==o&&d(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&f(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],et.test(i)||f(e,"ill-formed tag handle (first argument) of the TAG directive"),$.call(e.tagMap,i)&&f(e,'there is a previously declared suffix for "'+i+'" tag handle'),tt.test(r)||f(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[i]=r}};t.exports.loadAll=M,t.exports.load=L,t.exports.safeLoadAll=D,t.exports.safeLoad=U},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(e,t){"use strict";function n(e,t,n,i,r){this.name=e,this.buffer=t,this.position=n,this.line=i,this.column=r}var i=e("./common");n.prototype.getSnippet=function(e,t){var n,r,o,a,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",r=this.position;r>0&&-1==="\x00\r\n…\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>t/2-1){n=" ... ",r+=5;break}for(o="",a=this.position;at/2-1){o=" ... ",a-=5;break}return s=this.buffer.slice(r,a),i.repeat(" ",e)+n+s+o+"\n"+i.repeat(" ",e+this.position-r+n.length)+"^"},n.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(n+=":\n"+t)),n},t.exports=n},{"./common":2}],7:[function(e,t){"use strict";function n(e,t,i){var r=[];return e.include.forEach(function(e){i=n(e,t,i)}),e[t].forEach(function(e){i.forEach(function(t,n){t.tag===e.tag&&r.push(n)}),i.push(e)}),i.filter(function(e,t){return-1===r.indexOf(t)})}function i(){function e(e){i[e.tag]=e}var t,n,i={};for(t=0,n=arguments.length;n>t;t+=1)arguments[t].forEach(e);return i}function r(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new a("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=n(this,"implicit",[]),this.compiledExplicit=n(this,"explicit",[]),this.compiledTypeMap=i(this.compiledImplicit,this.compiledExplicit)}var o=e("./common"),a=e("./exception"),s=e("./type");r.DEFAULT=null,r.create=function(){var e,t;switch(arguments.length){case 1:e=r.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new a("Wrong number of arguments for Schema.create function")}if(e=o.toArray(e),t=o.toArray(t),!e.every(function(e){return e instanceof r}))throw new a("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof s}))throw new a("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new r({include:e,explicit:t})},t.exports=r},{"./common":2,"./exception":4,"./type":13}],8:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({include:[e("./json")]})},{"../schema":7,"./json":12}],9:[function(e,t){"use strict";var n=e("../schema");t.exports=n.DEFAULT=new n({include:[e("./default_safe")],explicit:[e("../type/js/undefined"),e("../type/js/regexp"),e("../type/js/function")]})},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({include:[e("./core")],implicit:[e("../type/timestamp"),e("../type/merge")],explicit:[e("../type/binary"),e("../type/omap"),e("../type/pairs"),e("../type/set")]})},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({explicit:[e("../type/str"),e("../type/seq"),e("../type/map")]})},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({include:[e("./failsafe")],implicit:[e("../type/null"),e("../type/bool"),e("../type/int"),e("../type/float")]})},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(e,t){"use strict";function n(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=n(t.styleAliases||null),-1===a.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var r=e("./exception"),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],a=["scalar","sequence","mapping"];t.exports=i},{"./exception":4}],14:[function(e,t){"use strict";function n(e){var t,n,i=0,r=e.length,o=c;for(n=0;r>n;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(0>t)return!1;i+=6}return i%8===0}function i(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=c,s=0,u=[];for(t=0;r>t;t++)t%4===0&&t&&(u.push(s>>16&255),u.push(s>>8&255),u.push(255&s)),s=s<<6|o.indexOf(i.charAt(t));return n=r%4*6,0===n?(u.push(s>>16&255),u.push(s>>8&255),u.push(255&s)):18===n?(u.push(s>>10&255),u.push(s>>2&255)):12===n&&u.push(s>>4&255),a?new a(u):u}function r(e){var t,n,i="",r=0,o=e.length,a=c;for(t=0;o>t;t++)t%3===0&&t&&(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return n=o%3,0===n?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}function o(e){return a&&a.isBuffer(e)}var a=e("buffer").Buffer,s=e("../type"),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new s("tag:yaml.org,2002:binary",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../type":13,buffer:30}],15:[function(e,t){"use strict";function n(e){var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function i(e){return"true"===e||"True"===e||"TRUE"===e}function r(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var o=e("../type");t.exports=new o("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:i,predicate:r,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t){"use strict";function n(e){return c.test(e)?!0:!1}function i(e){var t,n,i,r;return t=e.replace(/_/g,"").toLowerCase(),n="-"===t[0]?-1:1,r=[],0<="+-".indexOf(t[0])&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?0/0:0<=t.indexOf(":")?(t.split(":").forEach(function(e){r.unshift(parseFloat(e,10))}),t=0,i=1,r.forEach(function(e){t+=e*i,i*=60}),n*t):n*parseFloat(t,10)}function r(e,t){if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else{if(Number.NEGATIVE_INFINITY!==e)return a.isNegativeZero(e)?"-0.0":e.toString(10);switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}}}function o(e){return"[object Number]"===Object.prototype.toString.call(e)&&(0!==e%1||a.isNegativeZero(e))}var a=e("../common"),s=e("../type"),c=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?|\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");t.exports=new s("tag:yaml.org,2002:float",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r,defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t){"use strict";function n(e){return e>=48&&57>=e||e>=65&&70>=e||e>=97&&102>=e}function i(e){return e>=48&&55>=e}function r(e){return e>=48&&57>=e}function o(e){var t,o=e.length,a=0,s=!1;if(!o)return!1;if(t=e[a],("-"===t||"+"===t)&&(t=e[++a]),"0"===t){if(a+1===o)return!0;if(t=e[++a],"b"===t){for(a++;o>a;a++)if(t=e[a],"_"!==t){if("0"!==t&&"1"!==t)return!1;s=!0}return s}if("x"===t){for(a++;o>a;a++)if(t=e[a],"_"!==t){if(!n(e.charCodeAt(a)))return!1;s=!0}return s}for(;o>a;a++)if(t=e[a],"_"!==t){if(!i(e.charCodeAt(a)))return!1;s=!0}return s}for(;o>a;a++)if(t=e[a],"_"!==t){if(":"===t)break;if(!r(e.charCodeAt(a)))return!1; -s=!0}return s?":"!==t?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(a)):!1}function a(e){var t,n,i=e,r=1,o=[];return-1!==i.indexOf("_")&&(i=i.replace(/_/g,"")),t=i[0],("-"===t||"+"===t)&&("-"===t&&(r=-1),i=i.slice(1),t=i[0]),"0"===i?0:"0"===t?"b"===i[1]?r*parseInt(i.slice(2),2):"x"===i[1]?r*parseInt(i,16):r*parseInt(i,8):-1!==i.indexOf(":")?(i.split(":").forEach(function(e){o.unshift(parseInt(e,10))}),i=0,n=1,o.forEach(function(e){i+=e*n,n*=60}),r*i):r*parseInt(i,10)}function s(e){return"[object Number]"===Object.prototype.toString.call(e)&&0===e%1&&!c.isNegativeZero(e)}var c=e("../common"),u=e("../type");t.exports=new u("tag:yaml.org,2002:int",{kind:"scalar",resolve:o,construct:a,predicate:s,represent:{binary:function(e){return"0b"+e.toString(2)},octal:function(e){return"0"+e.toString(8)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return"0x"+e.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":2,"../type":13}],18:[function(e,t){"use strict";function n(e){try{var t="("+e+")",n=a.parse(t,{range:!0});return"Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"FunctionExpression"!==n.body[0].expression.type?!1:!0}catch(i){return!1}}function i(e){var t,n="("+e+")",i=a.parse(n,{range:!0}),r=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach(function(e){r.push(e.name)}),t=i.body[0].expression.body.range,new Function(r,n.slice(t[0]+1,t[1]-1))}function r(e){return e.toString()}function o(e){return"[object Function]"===Object.prototype.toString.call(e)}var a;try{a=e("esprima")}catch(s){"undefined"!=typeof window&&(a=window.esprima)}var c=e("../../type");t.exports=new c("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../../type":13,esprima:"esprima"}],19:[function(e,t){"use strict";function n(e){var t=e,n=/\/([gim]*)$/.exec(e),i="";if("/"===t[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==t[t.length-i.length-1])return!1;t=t.slice(1,t.length-i.length-1)}try{{new RegExp(t,i)}return!0}catch(r){return!1}}function i(e){var t=e,n=/\/([gim]*)$/.exec(e),i="";return"/"===t[0]&&(n&&(i=n[1]),t=t.slice(1,t.length-i.length-1)),new RegExp(t,i)}function r(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function o(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var a=e("../../type");t.exports=new a("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../../type":13}],20:[function(e,t){"use strict";function n(){return!0}function i(){return void 0}function r(){return""}function o(e){return"undefined"==typeof e}var a=e("../../type");t.exports=new a("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../../type":13}],21:[function(e,t){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:map",{kind:"mapping"})},{"../type":13}],22:[function(e,t){"use strict";function n(e){return"<<"===e}var i=e("../type");t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})},{"../type":13}],23:[function(e,t){"use strict";function n(e){var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function i(){return null}function r(e){return null===e}var o=e("../type");t.exports=new o("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:i,predicate:r,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":13}],24:[function(e,t){"use strict";function n(e){var t,n,i,a,s,c=[],u=e;for(t=0,n=u.length;n>t;t+=1){if(i=u[t],s=!1,"[object Object]"!==o.call(i))return!1;for(a in i)if(r.call(i,a)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==c.indexOf(a))return!1;c.push(a)}return!0}var i=e("../type"),r=Object.prototype.hasOwnProperty,o=Object.prototype.toString;t.exports=new i("tag:yaml.org,2002:omap",{kind:"sequence",resolve:n})},{"../type":13}],25:[function(e,t){"use strict";function n(e){var t,n,i,r,a,s=e;for(a=new Array(s.length),t=0,n=s.length;n>t;t+=1){if(i=s[t],"[object Object]"!==o.call(i))return!1;if(r=Object.keys(i),1!==r.length)return!1;a[t]=[r[0],i[r[0]]]}return!0}function i(e){var t,n,i,r,o,a=e;for(o=new Array(a.length),t=0,n=a.length;n>t;t+=1)i=a[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var r=e("../type"),o=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:n,construct:i})},{"../type":13}],26:[function(e,t){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:seq",{kind:"sequence"})},{"../type":13}],27:[function(e,t){"use strict";function n(e){var t,n=e;for(t in n)if(r.call(n,t)&&null!==n[t])return!1;return!0}var i=e("../type"),r=Object.prototype.hasOwnProperty;t.exports=new i("tag:yaml.org,2002:set",{kind:"mapping",resolve:n})},{"../type":13}],28:[function(e,t){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:str",{kind:"scalar"})},{"../type":13}],29:[function(e,t){"use strict";function n(e){var t;return t=a.exec(e),null===t?!1:!0}function i(e){var t,n,i,r,o,s,c,u,p,l,f=0,d=null;if(t=a.exec(e),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],s=+t[5],c=+t[6],t[7]){for(f=t[7].slice(0,3);f.length<3;)f+="0";f=+f}return t[9]&&(u=+t[10],p=+(t[11]||0),d=6e4*(60*u+p),"-"===t[9]&&(d=-d)),l=new Date(Date.UTC(n,i,r,o,s,c,f)),d&&l.setTime(l.getTime()-d),l}function r(e){return e.toISOString()}var o=e("../type"),a=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$");t.exports=new o("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:i,instanceOf:Date,represent:r})},{"../type":13}],30:[function(){},{}],"/":[function(e,t){"use strict";var n=e("./lib/js-yaml.js");t.exports=n},{"./lib/js-yaml.js":1}]},{},[])("/")}); \ No newline at end of file +/* js-yaml 3.2.5 https://github.com/nodeca/js-yaml */ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.jsyaml=e()}}(function(){return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return r(n?n:e)},l,l.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;an;n+=1)r=o[n],e[r]=t[r];return e}function a(e,t){var n,i="";for(n=0;t>n;n+=1)i+=e;return i}function s(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}t.exports.isNothing=n,t.exports.isObject=i,t.exports.toArray=r,t.exports.repeat=a,t.exports.isNegativeZero=s,t.exports.extend=o},{}],3:[function(e,t){"use strict";function n(e,t){var n,i,r,o,a,s,u;if(null===t)return{};for(n={},i=Object.keys(t),r=0,o=i.length;o>r;r+=1)a=i[r],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),u=e.compiledTypeMap[a],u&&C.call(u.styleAliases,s)&&(s=u.styleAliases[s]),n[a]=s;return n}function i(e){var t,n,i;if(t=e.toString(16).toUpperCase(),255>=e)n="x",i=2;else if(65535>=e)n="u",i=4;else{if(!(4294967295>=e))throw new v("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+x.repeat("0",i-t.length)+t}function r(e){this.schema=e.schema||A,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=x.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=n(this.schema,e.styles||null),this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function o(e,t){return"\n"+x.repeat(" ",e.indent*t)}function a(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;i>n;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function s(e,t){var n,r,o,s,u,c;for(e.dump="",n=!1,r=0,c=t.charCodeAt(0)||0,-1!==Z.indexOf(t)?n=!0:0===t.length?n=!0:S===c||S===t.charCodeAt(t.length-1)?n=!0:(D===c||q===c)&&(n=!0),o=0,s=t.length;s>o;o+=1)u=t.charCodeAt(o),n||(k===u||j===u||I===u||L===u||R===u||H===u||B===u||V===u||F===u||_===u||M===u||O===u||G===u||Y===u||T===u||E===u||N===u||P===u||U===u||$===u)&&(n=!0),(W[u]||!(u>=32&&126>=u||133===u||u>=160&&55295>=u||u>=57344&&65533>=u||u>=65536&&1114111>=u))&&(e.dump+=t.slice(r,o),e.dump+=W[u]||i(u),r=o+1,n=!0);o>r&&(e.dump+=t.slice(r,o)),!n&&a(e,e.dump)&&(n=!0),n&&(e.dump='"'+e.dump+'"')}function u(e,t,n){var i,r,o="",a=e.tag;for(i=0,r=n.length;r>i;i+=1)d(e,t,n[i],!1,!1)&&(0!==i&&(o+=", "),o+=e.dump);e.tag=a,e.dump="["+o+"]"}function c(e,t,n,i){var r,a,s="",u=e.tag;for(r=0,a=n.length;a>r;r+=1)d(e,t+1,n[r],!0,!0)&&(i&&0===r||(s+=o(e,t)),s+="- "+e.dump);e.tag=u,e.dump=s||"[]"}function l(e,t,n){var i,r,o,a,s,u="",c=e.tag,l=Object.keys(n);for(i=0,r=l.length;r>i;i+=1)s="",0!==i&&(s+=", "),o=l[i],a=n[o],d(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+": ",d(e,t,a,!1,!1)&&(s+=e.dump,u+=s));e.tag=c,e.dump="{"+u+"}"}function p(e,t,n,i){var r,a,s,u,c,l,p="",f=e.tag,h=Object.keys(n);for(r=0,a=h.length;a>r;r+=1)l="",i&&0===r||(l+=o(e,t)),s=h[r],u=n[s],d(e,t+1,s,!0,!0)&&(c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,c&&(l+=e.dump&&j===e.dump.charCodeAt(0)?"?":"? "),l+=e.dump,c&&(l+=o(e,t)),d(e,t+1,u,!0,c)&&(l+=e.dump&&j===e.dump.charCodeAt(0)?":":": ",l+=e.dump,p+=l));e.tag=f,e.dump=p||"{}"}function f(e,t,n){var i,r,o,a,s,u;for(r=n?e.explicitTypes:e.implicitTypes,o=0,a=r.length;a>o;o+=1)if(s=r[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(u=e.styleMap[s.tag]||s.defaultStyle,"[object Function]"===w.call(s.represent))i=s.represent(t,u);else{if(!C.call(s.represent,u))throw new v("!<"+s.tag+'> tag resolver accepts not "'+u+'" style');i=s.represent[u](t,u)}e.dump=i}return!0}return!1}function d(e,t,n,i,r){e.tag=null,e.dump=n,f(e,n,!1)||f(e,n,!0);var o=w.call(e.dump);i&&(i=0>e.flowLevel||e.flowLevel>t),(null!==e.tag&&"?"!==e.tag||2!==e.indent&&t>0)&&(r=!1);var a,d,h="[object Object]"===o||"[object Array]"===o;if(h&&(a=e.duplicates.indexOf(n),d=-1!==a),d&&e.usedDuplicates[a])e.dump="*ref_"+a;else{if(h&&d&&!e.usedDuplicates[a]&&(e.usedDuplicates[a]=!0),"[object Object]"===o)i&&0!==Object.keys(e.dump).length?(p(e,t,e.dump,r),d&&(e.dump="&ref_"+a+(0===t?"\n":"")+e.dump)):(l(e,t,e.dump),d&&(e.dump="&ref_"+a+" "+e.dump));else if("[object Array]"===o)i&&0!==e.dump.length?(c(e,t,e.dump,r),d&&(e.dump="&ref_"+a+(0===t?"\n":"")+e.dump)):(u(e,t,e.dump),d&&(e.dump="&ref_"+a+" "+e.dump));else{if("[object String]"!==o){if(e.skipInvalid)return!1;throw new v("unacceptable kind of an object to dump "+o)}"?"!==e.tag&&s(e,e.dump)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function h(e,t){var n,i,r=[],o=[];for(m(e,r,o),n=0,i=o.length;i>n;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function m(e,t,n){{var i,r,o;w.call(e)}if(null!==e&&"object"==typeof e)if(r=t.indexOf(e),-1!==r)-1===n.indexOf(r)&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;o>r;r+=1)m(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;o>r;r+=1)m(e[i[r]],t,n)}function g(e,t){t=t||{};var n=new r(t);return h(e,n),d(n,0,e,!0,!0)?n.dump+"\n":""}function y(e,t){return g(e,x.extend({schema:b},t))}var x=e("./common"),v=e("./exception"),A=e("./schema/default_full"),b=e("./schema/default_safe"),w=Object.prototype.toString,C=Object.prototype.hasOwnProperty,k=9,j=10,I=13,S=32,O=33,E=34,F=35,N=37,_=38,T=39,M=42,L=44,D=45,U=58,Y=62,q=63,P=64,R=91,H=93,$=96,B=123,G=124,V=125,W={};W[0]="\\0",W[7]="\\a",W[8]="\\b",W[9]="\\t",W[10]="\\n",W[11]="\\v",W[12]="\\f",W[13]="\\r",W[27]="\\e",W[34]='\\"',W[92]="\\\\",W[133]="\\N",W[160]="\\_",W[8232]="\\L",W[8233]="\\P";var Z=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];t.exports.dump=g,t.exports.safeDump=y},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(e,t){"use strict";function n(e,t){this.name="YAMLException",this.reason=e,this.mark=t,this.message=this.toString(!1)}n.prototype.toString=function(e){var t;return t="JS-YAML: "+(this.reason||"(unknown reason)"),!e&&this.mark&&(t+=" "+this.mark.toString()),t},t.exports=n},{}],5:[function(e,t){"use strict";function n(e){return 10===e||13===e}function i(e){return 9===e||32===e}function r(e){return 9===e||32===e||10===e||13===e}function o(e){return 44===e||91===e||93===e||123===e||125===e}function a(e){var t;return e>=48&&57>=e?e-48:(t=32|e,t>=97&&102>=t?t-97+10:-1)}function s(e){return 120===e?2:117===e?4:85===e?8:0}function u(e){return e>=48&&57>=e?e-48:-1}function c(e){return 48===e?"\x00":97===e?"":98===e?"\b":116===e?" ":9===e?" ":110===e?"\n":118===e?" ":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function l(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||H,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function p(e,t){return new q(t,new P(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function f(e,t){throw p(e,t)}function d(e,t){var n=p(e,t);if(!e.onWarning)throw n;e.onWarning.call(null,n)}function h(e,t,n,i){var r,o,a,s;if(n>t){if(s=e.input.slice(t,n),i)for(r=0,o=s.length;o>r;r+=1)a=s.charCodeAt(r),9===a||a>=32&&1114111>=a||f(e,"expected valid JSON character");e.result+=s}}function m(e,t,n){var i,r,o,a;for(Y.isObject(n)||f(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;a>o;o+=1)r=i[o],$.call(t,r)||(t[r]=n[r])}function g(e,t,n,i,r){var o,a;if(i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(r))for(o=0,a=r.length;a>o;o+=1)m(e,t,r[o]);else m(e,t,r);else t[i]=r;return t}function y(e){var t;t=e.input.charCodeAt(e.position),10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):f(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function x(e,t,r){for(var o=0,a=e.input.charCodeAt(e.position);0!==a;){for(;i(a);)a=e.input.charCodeAt(++e.position);if(t&&35===a)do a=e.input.charCodeAt(++e.position);while(10!==a&&13!==a&&0!==a);if(!n(a))break;for(y(e),a=e.input.charCodeAt(e.position),o++,e.lineIndent=0;32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position)}return-1!==r&&0!==o&&e.lineIndent1&&(e.result+=Y.repeat("\n",t-1))}function b(e,t,a){var s,u,c,l,p,f,d,m,g,y=e.kind,b=e.result;if(g=e.input.charCodeAt(e.position),r(g)||o(g)||35===g||38===g||42===g||33===g||124===g||62===g||39===g||34===g||37===g||64===g||96===g)return!1;if((63===g||45===g)&&(u=e.input.charCodeAt(e.position+1),r(u)||a&&o(u)))return!1;for(e.kind="scalar",e.result="",c=l=e.position,p=!1;0!==g;){if(58===g){if(u=e.input.charCodeAt(e.position+1),r(u)||a&&o(u))break}else if(35===g){if(s=e.input.charCodeAt(e.position-1),r(s))break}else{if(e.position===e.lineStart&&v(e)||a&&o(g))break;if(n(g)){if(f=e.line,d=e.lineStart,m=e.lineIndent,x(e,!1,-1),e.lineIndent>=t){p=!0,g=e.input.charCodeAt(e.position);continue}e.position=l,e.line=f,e.lineStart=d,e.lineIndent=m;break}}p&&(h(e,c,l,!1),A(e,e.line-f),c=l=e.position,p=!1),i(g)||(l=e.position+1),g=e.input.charCodeAt(++e.position)}return h(e,c,l,!1),e.result?!0:(e.kind=y,e.result=b,!1)}function w(e,t){var i,r,o;if(i=e.input.charCodeAt(e.position),39!==i)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;0!==(i=e.input.charCodeAt(e.position));)if(39===i){if(h(e,r,e.position,!0),i=e.input.charCodeAt(++e.position),39!==i)return!0;r=o=e.position,e.position++}else n(i)?(h(e,r,o,!0),A(e,x(e,!1,t)),r=o=e.position):e.position===e.lineStart&&v(e)?f(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);f(e,"unexpected end of the stream within a single quoted scalar")}function C(e,t){var i,r,o,u,c,l;if(l=e.input.charCodeAt(e.position),34!==l)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;0!==(l=e.input.charCodeAt(e.position));){if(34===l)return h(e,i,e.position,!0),e.position++,!0;if(92===l){if(h(e,i,e.position,!0),l=e.input.charCodeAt(++e.position),n(l))x(e,!1,t);else if(256>l&&nt[l])e.result+=it[l],e.position++;else if((c=s(l))>0){for(o=c,u=0;o>0;o--)l=e.input.charCodeAt(++e.position),(c=a(l))>=0?u=(u<<4)+c:f(e,"expected hexadecimal character");e.result+=String.fromCharCode(u),e.position++}else f(e,"unknown escape sequence");i=r=e.position}else n(l)?(h(e,i,r,!0),A(e,x(e,!1,t)),i=r=e.position):e.position===e.lineStart&&v(e)?f(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}f(e,"unexpected end of the stream within a double quoted scalar")}function k(e,t){var n,i,o,a,s,u,c,l,p,d,h,m=!0,y=e.tag,v=e.anchor;if(h=e.input.charCodeAt(e.position),91===h)a=93,c=!1,i=[];else{if(123!==h)return!1;a=125,c=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),h=e.input.charCodeAt(++e.position);0!==h;){if(x(e,!0,t),h=e.input.charCodeAt(e.position),h===a)return e.position++,e.tag=y,e.anchor=v,e.kind=c?"mapping":"sequence",e.result=i,!0;m||f(e,"missed comma between flow collection entries"),p=l=d=null,s=u=!1,63===h&&(o=e.input.charCodeAt(e.position+1),r(o)&&(s=u=!0,e.position++,x(e,!0,t))),n=e.line,N(e,t,B,!1,!0),p=e.tag,l=e.result,x(e,!0,t),h=e.input.charCodeAt(e.position),!u&&e.line!==n||58!==h||(s=!0,h=e.input.charCodeAt(++e.position),x(e,!0,t),N(e,t,B,!1,!0),d=e.result),c?g(e,i,p,l,d):i.push(s?g(e,null,p,l,d):l),x(e,!0,t),h=e.input.charCodeAt(e.position),44===h?(m=!0,h=e.input.charCodeAt(++e.position)):m=!1}f(e,"unexpected end of the stream within a flow collection")}function j(e,t){var r,o,a,s,c=Z,l=!1,p=t,d=0,m=!1;if(s=e.input.charCodeAt(e.position),124===s)o=!1;else{if(62!==s)return!1;o=!0}for(e.kind="scalar",e.result="";0!==s;)if(s=e.input.charCodeAt(++e.position),43===s||45===s)Z===c?c=43===s?z:J:f(e,"repeat of a chomping mode identifier");else{if(!((a=u(s))>=0))break;0===a?f(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?f(e,"repeat of an indentation width identifier"):(p=t+a-1,l=!0)}if(i(s)){do s=e.input.charCodeAt(++e.position);while(i(s));if(35===s)do s=e.input.charCodeAt(++e.position);while(!n(s)&&0!==s)}for(;0!==s;){for(y(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!l||e.lineIndentp&&(p=e.lineIndent),n(s))d++;else{if(e.lineIndentt)&&0!==o)f(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(N(e,t,W,!0,a)&&(y?h=e.result:m=e.result),y||(g(e,p,d,h,m),d=h=m=null),x(e,!0,-1),u=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==u)f(e,"bad indentation of a mapping entry");else if(e.lineIndentt?m=1:e.lineIndent===t?m=0:e.lineIndentt?m=1:e.lineIndent===t?m=0:e.lineIndentu;u+=1)if(l=e.implicitTypes[u],l.resolve(e.result)){e.result=l.construct(e.result),e.tag=l.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else $.call(e.typeMap,e.tag)?(l=e.typeMap[e.tag],null!==e.result&&l.kind!==e.kind&&f(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result)?(e.result=l.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):f(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):d(e,"unknown tag !<"+e.tag+">");return null!==e.tag||null!==e.anchor||y}function _(e){var t,o,a,s,u=e.position,c=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(s=e.input.charCodeAt(e.position))&&(x(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==s));){for(c=!0,s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!r(s);)s=e.input.charCodeAt(++e.position);for(o=e.input.slice(t,e.position),a=[],o.length<1&&f(e,"directive name must not be less than one character in length");0!==s;){for(;i(s);)s=e.input.charCodeAt(++e.position);if(35===s){do s=e.input.charCodeAt(++e.position);while(0!==s&&!n(s));break}if(n(s))break;for(t=e.position;0!==s&&!r(s);)s=e.input.charCodeAt(++e.position);a.push(e.input.slice(t,e.position))}0!==s&&y(e),$.call(ot,o)?ot[o](e,o,a):d(e,'unknown document directive "'+o+'"')}return x(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,x(e,!0,-1)):c&&f(e,"directives end mark is expected"),N(e,e.lineIndent-1,W,!1,!0),x(e,!0,-1),e.checkLineBreaks&&Q.test(e.input.slice(u,e.position))&&d(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&v(e)?void(46===e.input.charCodeAt(e.position)&&(e.position+=3,x(e,!0,-1))):void(e.positioni;i+=1)t(o[i])}function L(e,t){var n=T(e,t);if(0===n.length)return void 0;if(1===n.length)return n[0];throw new q("expected a single document in the stream, but found more")}function D(e,t,n){M(e,t,Y.extend({schema:R},n))}function U(e,t){return L(e,Y.extend({schema:R},t))}for(var Y=e("./common"),q=e("./exception"),P=e("./mark"),R=e("./schema/default_safe"),H=e("./schema/default_full"),$=Object.prototype.hasOwnProperty,B=1,G=2,V=3,W=4,Z=1,J=2,z=3,K=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uD800-\uDFFF\uFFFE\uFFFF]/,Q=/[\x85\u2028\u2029]/,X=/[,\[\]\{\}]/,et=/^(?:!|!!|![a-z\-]+!)$/i,tt=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,nt=new Array(256),it=new Array(256),rt=0;256>rt;rt++)nt[rt]=c(rt)?1:0,it[rt]=c(rt);var ot={YAML:function(e,t,n){var i,r,o;null!==e.version&&f(e,"duplication of %YAML directive"),1!==n.length&&f(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===i&&f(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&f(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=2>o,1!==o&&2!==o&&d(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&f(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],et.test(i)||f(e,"ill-formed tag handle (first argument) of the TAG directive"),$.call(e.tagMap,i)&&f(e,'there is a previously declared suffix for "'+i+'" tag handle'),tt.test(r)||f(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[i]=r}};t.exports.loadAll=M,t.exports.load=L,t.exports.safeLoadAll=D,t.exports.safeLoad=U},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(e,t){"use strict";function n(e,t,n,i,r){this.name=e,this.buffer=t,this.position=n,this.line=i,this.column=r}var i=e("./common");n.prototype.getSnippet=function(e,t){var n,r,o,a,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",r=this.position;r>0&&-1==="\x00\r\n…\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>t/2-1){n=" ... ",r+=5;break}for(o="",a=this.position;at/2-1){o=" ... ",a-=5;break}return s=this.buffer.slice(r,a),i.repeat(" ",e)+n+s+o+"\n"+i.repeat(" ",e+this.position-r+n.length)+"^"},n.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(n+=":\n"+t)),n},t.exports=n},{"./common":2}],7:[function(e,t){"use strict";function n(e,t,i){var r=[];return e.include.forEach(function(e){i=n(e,t,i)}),e[t].forEach(function(e){i.forEach(function(t,n){t.tag===e.tag&&r.push(n)}),i.push(e)}),i.filter(function(e,t){return-1===r.indexOf(t)})}function i(){function e(e){i[e.tag]=e}var t,n,i={};for(t=0,n=arguments.length;n>t;t+=1)arguments[t].forEach(e);return i}function r(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new a("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=n(this,"implicit",[]),this.compiledExplicit=n(this,"explicit",[]),this.compiledTypeMap=i(this.compiledImplicit,this.compiledExplicit)}var o=e("./common"),a=e("./exception"),s=e("./type");r.DEFAULT=null,r.create=function(){var e,t;switch(arguments.length){case 1:e=r.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new a("Wrong number of arguments for Schema.create function")}if(e=o.toArray(e),t=o.toArray(t),!e.every(function(e){return e instanceof r}))throw new a("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof s}))throw new a("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new r({include:e,explicit:t})},t.exports=r},{"./common":2,"./exception":4,"./type":13}],8:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({include:[e("./json")]})},{"../schema":7,"./json":12}],9:[function(e,t){"use strict";var n=e("../schema");t.exports=n.DEFAULT=new n({include:[e("./default_safe")],explicit:[e("../type/js/undefined"),e("../type/js/regexp"),e("../type/js/function")]})},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({include:[e("./core")],implicit:[e("../type/timestamp"),e("../type/merge")],explicit:[e("../type/binary"),e("../type/omap"),e("../type/pairs"),e("../type/set")]})},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({explicit:[e("../type/str"),e("../type/seq"),e("../type/map")]})},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(e,t){"use strict";var n=e("../schema");t.exports=new n({include:[e("./failsafe")],implicit:[e("../type/null"),e("../type/bool"),e("../type/int"),e("../type/float")]})},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(e,t){"use strict";function n(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=n(t.styleAliases||null),-1===a.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var r=e("./exception"),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],a=["scalar","sequence","mapping"];t.exports=i},{"./exception":4}],14:[function(e,t){"use strict";function n(e){if(null===e)return!1;var t,n,i=0,r=e.length,o=u;for(n=0;r>n;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(0>t)return!1;i+=6}return i%8===0}function i(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=u,s=0,c=[];for(t=0;r>t;t++)t%4===0&&t&&(c.push(s>>16&255),c.push(s>>8&255),c.push(255&s)),s=s<<6|o.indexOf(i.charAt(t));return n=r%4*6,0===n?(c.push(s>>16&255),c.push(s>>8&255),c.push(255&s)):18===n?(c.push(s>>10&255),c.push(s>>2&255)):12===n&&c.push(s>>4&255),a?new a(c):c}function r(e){var t,n,i="",r=0,o=e.length,a=u;for(t=0;o>t;t++)t%3===0&&t&&(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return n=o%3,0===n?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}function o(e){return a&&a.isBuffer(e)}var a=e("buffer").Buffer,s=e("../type"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new s("tag:yaml.org,2002:binary",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../type":13,buffer:30}],15:[function(e,t){"use strict";function n(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function i(e){return"true"===e||"True"===e||"TRUE"===e}function r(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var o=e("../type");t.exports=new o("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:i,predicate:r,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t){"use strict";function n(e){if(null===e)return!1;return u.test(e)?!0:!1}function i(e){var t,n,i,r;return t=e.replace(/_/g,"").toLowerCase(),n="-"===t[0]?-1:1,r=[],0<="+-".indexOf(t[0])&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?0/0:0<=t.indexOf(":")?(t.split(":").forEach(function(e){r.unshift(parseFloat(e,10))}),t=0,i=1,r.forEach(function(e){t+=e*i,i*=60}),n*t):n*parseFloat(t,10)}function r(e,t){if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else{if(Number.NEGATIVE_INFINITY!==e)return a.isNegativeZero(e)?"-0.0":e.toString(10);switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}}}function o(e){return"[object Number]"===Object.prototype.toString.call(e)&&(0!==e%1||a.isNegativeZero(e))}var a=e("../common"),s=e("../type"),u=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?|\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");t.exports=new s("tag:yaml.org,2002:float",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r,defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t){"use strict";function n(e){return e>=48&&57>=e||e>=65&&70>=e||e>=97&&102>=e}function i(e){return e>=48&&55>=e}function r(e){return e>=48&&57>=e}function o(e){if(null===e)return!1;var t,o=e.length,a=0,s=!1;if(!o)return!1;if(t=e[a],("-"===t||"+"===t)&&(t=e[++a]),"0"===t){if(a+1===o)return!0;if(t=e[++a],"b"===t){for(a++;o>a;a++)if(t=e[a],"_"!==t){if("0"!==t&&"1"!==t)return!1;s=!0}return s}if("x"===t){for(a++;o>a;a++)if(t=e[a],"_"!==t){if(!n(e.charCodeAt(a)))return!1;s=!0}return s}for(;o>a;a++)if(t=e[a],"_"!==t){if(!i(e.charCodeAt(a)))return!1; +s=!0}return s}for(;o>a;a++)if(t=e[a],"_"!==t){if(":"===t)break;if(!r(e.charCodeAt(a)))return!1;s=!0}return s?":"!==t?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(a)):!1}function a(e){var t,n,i=e,r=1,o=[];return-1!==i.indexOf("_")&&(i=i.replace(/_/g,"")),t=i[0],("-"===t||"+"===t)&&("-"===t&&(r=-1),i=i.slice(1),t=i[0]),"0"===i?0:"0"===t?"b"===i[1]?r*parseInt(i.slice(2),2):"x"===i[1]?r*parseInt(i,16):r*parseInt(i,8):-1!==i.indexOf(":")?(i.split(":").forEach(function(e){o.unshift(parseInt(e,10))}),i=0,n=1,o.forEach(function(e){i+=e*n,n*=60}),r*i):r*parseInt(i,10)}function s(e){return"[object Number]"===Object.prototype.toString.call(e)&&0===e%1&&!u.isNegativeZero(e)}var u=e("../common"),c=e("../type");t.exports=new c("tag:yaml.org,2002:int",{kind:"scalar",resolve:o,construct:a,predicate:s,represent:{binary:function(e){return"0b"+e.toString(2)},octal:function(e){return"0"+e.toString(8)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return"0x"+e.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":2,"../type":13}],18:[function(e,t){"use strict";function n(e){if(null===e)return!1;try{var t="("+e+")",n=a.parse(t,{range:!0});return"Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"FunctionExpression"!==n.body[0].expression.type?!1:!0}catch(i){return!1}}function i(e){var t,n="("+e+")",i=a.parse(n,{range:!0}),r=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach(function(e){r.push(e.name)}),t=i.body[0].expression.body.range,new Function(r,n.slice(t[0]+1,t[1]-1))}function r(e){return e.toString()}function o(e){return"[object Function]"===Object.prototype.toString.call(e)}var a;try{a=e("esprima")}catch(s){"undefined"!=typeof window&&(a=window.esprima)}var u=e("../../type");t.exports=new u("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../../type":13,esprima:"esprima"}],19:[function(e,t){"use strict";function n(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),i="";if("/"===t[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==t[t.length-i.length-1])return!1;t=t.slice(1,t.length-i.length-1)}try{{new RegExp(t,i)}return!0}catch(r){return!1}}function i(e){var t=e,n=/\/([gim]*)$/.exec(e),i="";return"/"===t[0]&&(n&&(i=n[1]),t=t.slice(1,t.length-i.length-1)),new RegExp(t,i)}function r(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function o(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var a=e("../../type");t.exports=new a("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../../type":13}],20:[function(e,t){"use strict";function n(){return!0}function i(){return void 0}function r(){return""}function o(e){return"undefined"==typeof e}var a=e("../../type");t.exports=new a("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:r})},{"../../type":13}],21:[function(e,t){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},{"../type":13}],22:[function(e,t){"use strict";function n(e){return"<<"===e||null===e}var i=e("../type");t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})},{"../type":13}],23:[function(e,t){"use strict";function n(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function i(){return null}function r(e){return null===e}var o=e("../type");t.exports=new o("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:i,predicate:r,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":13}],24:[function(e,t){"use strict";function n(e){if(null===e)return!0;var t,n,i,r,s,u=[],c=e;for(t=0,n=c.length;n>t;t+=1){if(i=c[t],s=!1,"[object Object]"!==a.call(i))return!1;for(r in i)if(o.call(i,r)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==u.indexOf(r))return!1;u.push(r)}return!0}function i(e){return null!==e?e:[]}var r=e("../type"),o=Object.prototype.hasOwnProperty,a=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:n,construct:i})},{"../type":13}],25:[function(e,t){"use strict";function n(e){if(null===e)return!0;var t,n,i,r,a,s=e;for(a=new Array(s.length),t=0,n=s.length;n>t;t+=1){if(i=s[t],"[object Object]"!==o.call(i))return!1;if(r=Object.keys(i),1!==r.length)return!1;a[t]=[r[0],i[r[0]]]}return!0}function i(e){if(null===e)return[];var t,n,i,r,o,a=e;for(o=new Array(a.length),t=0,n=a.length;n>t;t+=1)i=a[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var r=e("../type"),o=Object.prototype.toString;t.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:n,construct:i})},{"../type":13}],26:[function(e,t){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},{"../type":13}],27:[function(e,t){"use strict";function n(e){if(null===e)return!0;var t,n=e;for(t in n)if(o.call(n,t)&&null!==n[t])return!1;return!0}function i(e){return null!==e?e:{}}var r=e("../type"),o=Object.prototype.hasOwnProperty;t.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:n,construct:i})},{"../type":13}],28:[function(e,t){"use strict";var n=e("../type");t.exports=new n("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},{"../type":13}],29:[function(e,t){"use strict";function n(e){if(null===e)return!1;var t;return t=a.exec(e),null===t?!1:!0}function i(e){var t,n,i,r,o,s,u,c,l,p,f=0,d=null;if(t=a.exec(e),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],s=+t[5],u=+t[6],t[7]){for(f=t[7].slice(0,3);f.length<3;)f+="0";f=+f}return t[9]&&(c=+t[10],l=+(t[11]||0),d=6e4*(60*c+l),"-"===t[9]&&(d=-d)),p=new Date(Date.UTC(n,i,r,o,s,u,f)),d&&p.setTime(p.getTime()-d),p}function r(e){return e.toISOString()}var o=e("../type"),a=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$");t.exports=new o("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:i,instanceOf:Date,represent:r})},{"../type":13}],30:[function(){},{}],"/":[function(e,t){"use strict";var n=e("./lib/js-yaml.js");t.exports=n},{"./lib/js-yaml.js":1}]},{},[])("/")}); \ No newline at end of file diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/loader.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/loader.js index 81aa89b..7e924a8 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/loader.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/loader.js @@ -337,15 +337,15 @@ function skipSeparationSpace(state, allowComments, checkIndent) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } - - if (state.lineIndent < checkIndent) { - throwWarning(state, 'deficient indentation'); - } } else { break; } } + if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + return lineBreaks; } @@ -1241,8 +1241,8 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact var allowBlockStyles, allowBlockScalars, allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { - isIndented = true; - - } else { - return false; + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; } } } - if (isIndented) { + if (1 === indentStatus) { while (readTagProperty(state) || readAnchorProperty(state)) { if (skipSeparationSpace(state, true, -1)) { atNewLine = true; + allowBlockCollections = allowBlockStyles; if (state.lineIndent > parentIndent) { - isIndented = true; - allowBlockCollections = allowBlockStyles; - + indentStatus = 1; } else if (state.lineIndent === parentIndent) { - isIndented = false; - allowBlockCollections = allowBlockStyles; - - } else { - return true; + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; } } else { allowBlockCollections = false; @@ -1302,7 +1297,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact allowBlockCollections = atNewLine || allowCompact; } - if (isIndented || CONTEXT_BLOCK_OUT === nodeContext) { + if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) { if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { flowIndent = parentIndent; } else { @@ -1311,7 +1306,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact blockIndent = state.position - state.lineStart; - if (isIndented) { + if (1 === indentStatus) { if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || @@ -1342,7 +1337,9 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact state.anchorMap[state.anchor] = state.result; } } - } else { + } else if (0 === indentStatus) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); } } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/binary.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/binary.js index e52599c..1fdf47d 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/binary.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/binary.js @@ -12,6 +12,10 @@ var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 function resolveYamlBinary(data) { + if (null === data) { + return false; + } + var code, idx, bitlen = 0, len = 0, max = data.length, map = BASE64_MAP; // Convert one by one. diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/bool.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/bool.js index 364626f..5c2a304 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/bool.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/bool.js @@ -3,6 +3,10 @@ var Type = require('../type'); function resolveYamlBoolean(data) { + if (null === data) { + return false; + } + var max = data.length; return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/float.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/float.js index efb1331..9e3eff4 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/float.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/float.js @@ -11,6 +11,10 @@ var YAML_FLOAT_PATTERN = new RegExp( '|\\.(?:nan|NaN|NAN))$'); function resolveYamlFloat(data) { + if (null === data) { + return false; + } + var value, sign, base, digits; if (!YAML_FLOAT_PATTERN.test(data)) { diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/int.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/int.js index 4dfdd6d..efada88 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/int.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/int.js @@ -18,6 +18,10 @@ function isDecCode(c) { } function resolveYamlInteger(data) { + if (null === data) { + return false; + } + var max = data.length, index = 0, hasDigits = false, diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/function.js index 39b9dd2..05eface 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/function.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/function.js @@ -19,6 +19,10 @@ try { var Type = require('../../type'); function resolveJavascriptFunction(data) { + if (null === data) { + return false; + } + try { var source = '(' + data + ')', ast = esprima.parse(source, { range: true }), diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js index fd36173..07ef521 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js @@ -3,6 +3,14 @@ var Type = require('../../type'); function resolveJavascriptRegExp(data) { + if (null === data) { + return false; + } + + if (0 === data.length) { + return false; + } + var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = ''; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/map.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/map.js index e0c8fdc..dab9838 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/map.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/map.js @@ -3,5 +3,6 @@ var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping' + kind: 'mapping', + construct: function (data) { return null !== data ? data : {}; } }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/merge.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/merge.js index e6fb8a2..29fa382 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/merge.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/merge.js @@ -3,10 +3,10 @@ var Type = require('../type'); function resolveYamlMerge(data) { - return '<<' === data; + return '<<' === data || null === data; } module.exports = new Type('tag:yaml.org,2002:merge', { kind: 'scalar', - resolve: resolveYamlMerge, + resolve: resolveYamlMerge }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/null.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/null.js index d0c0a63..3474055 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/null.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/null.js @@ -3,6 +3,10 @@ var Type = require('../type'); function resolveYamlNull(data) { + if (null === data) { + return true; + } + var max = data.length; return (max === 1 && data === '~') || diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/omap.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/omap.js index 9a7f9d8..f956459 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/omap.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/omap.js @@ -6,6 +6,10 @@ var _hasOwnProperty = Object.prototype.hasOwnProperty; var _toString = Object.prototype.toString; function resolveYamlOmap(data) { + if (null === data) { + return true; + } + var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; @@ -41,7 +45,12 @@ function resolveYamlOmap(data) { return true; } +function constructYamlOmap(data) { + return null !== data ? data : []; +} + module.exports = new Type('tag:yaml.org,2002:omap', { kind: 'sequence', - resolve: resolveYamlOmap + resolve: resolveYamlOmap, + construct: constructYamlOmap }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/pairs.js index a019ea9..02a0af6 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/pairs.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/pairs.js @@ -5,6 +5,10 @@ var Type = require('../type'); var _toString = Object.prototype.toString; function resolveYamlPairs(data) { + if (null === data) { + return true; + } + var index, length, pair, keys, result, object = data; @@ -30,6 +34,10 @@ function resolveYamlPairs(data) { } function constructYamlPairs(data) { + if (null === data) { + return []; + } + var index, length, pair, keys, result, object = data; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/seq.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/seq.js index ec706c0..5b860a2 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/seq.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/seq.js @@ -3,5 +3,6 @@ var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence' + kind: 'sequence', + construct: function (data) { return null !== data ? data : []; } }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/set.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/set.js index f4ec165..64d29e9 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/set.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/set.js @@ -5,6 +5,10 @@ var Type = require('../type'); var _hasOwnProperty = Object.prototype.hasOwnProperty; function resolveYamlSet(data) { + if (null === data) { + return true; + } + var key, object = data; for (key in object) { @@ -18,7 +22,12 @@ function resolveYamlSet(data) { return true; } +function constructYamlSet(data) { + return null !== data ? data : {}; +} + module.exports = new Type('tag:yaml.org,2002:set', { kind: 'mapping', - resolve: resolveYamlSet + resolve: resolveYamlSet, + construct: constructYamlSet }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/str.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/str.js index 88189bb..8b5284f 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/str.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/str.js @@ -3,5 +3,6 @@ var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar' + kind: 'scalar', + construct: function (data) { return null !== data ? data : ''; } }); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/timestamp.js index ef7f6bb..dc8cf15 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/lib/js-yaml/type/timestamp.js @@ -15,6 +15,10 @@ var YAML_TIMESTAMP_REGEXP = new RegExp( '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute function resolveYamlTimestamp(data) { + if (null === data) { + return false; + } + var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/HISTORY.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/HISTORY.md index 102f82b..bb97617 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/HISTORY.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/HISTORY.md @@ -1,3 +1,9 @@ +0.1.16 / 2013-12-01 +------------------- + +* Maintenance release. Updated dependencies and docs. + + 0.1.15 / 2013-05-13 ------------------- diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/README.md b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/README.md index f20e0c1..b7e8473 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/README.md +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/README.md @@ -80,12 +80,12 @@ Creates a new ArgumentParser object. - ```description``` - Text to display before the argument help. - ```epilog``` - Text to display after the argument help. -- ```addHelp``` - Add a -h/–help option to the parser. (default: True) -- ```argumentDefault``` - Set the global default value for arguments. (default: None) +- ```addHelp``` - Add a -h/–help option to the parser. (default: true) +- ```argumentDefault``` - Set the global default value for arguments. (default: null) - ```parents``` - A list of ArgumentParser objects whose arguments should also be included. - ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘) - ```formatterClass``` - A class for customizing the help output. -- ```prog``` - The name of the program (default: sys.argv[0]) +- ```prog``` - The name of the program (default: `path.basename(process.argv[1])`) - ```usage``` - The string describing the program usage (default: generated) - ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals. diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js index 97cf098..103c337 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js @@ -33,7 +33,7 @@ var Namespace = require('./namespace'); * Create a new ArgumentParser object. * * ##### Options: - * - `prog` The name of the program (default: sys.argv[0]) + * - `prog` The name of the program (default: Path.basename(process.argv[1])) * - `usage` A usage message (default: auto-generated from arguments) * - `description` A description of what the program does * - `epilog` Text following the argument descriptions @@ -311,13 +311,15 @@ ArgumentParser.prototype._parseKnownArgs = function (argStrings, namespace) { // of two different mutually exclusive groups. function actionHash(action) { - // some sort of hashable key for this action - // action itself cannot be a key in actionConflicts - // I think getName() (join of optionStrings) is unique enough - return action.getName(); - } + // some sort of hashable key for this action + // action itself cannot be a key in actionConflicts + // I think getName() (join of optionStrings) is unique enough + return action.getName(); + } + var conflicts, key; var actionConflicts = {}; + this._mutuallyExclusiveGroups.forEach(function (mutexGroup) { mutexGroup._groupActions.forEach(function (mutexAction, i, groupActions) { key = actionHash(mutexAction); @@ -513,11 +515,10 @@ ArgumentParser.prototype._parseKnownArgs = function (argStrings, namespace) { var position; var maxOptionStringIndex = -1; - if (!!optionStringIndices) { - for (position in optionStringIndices) { - maxOptionStringIndex = Math.max(maxOptionStringIndex, parseInt(position, 10)); - } - } + + Object.keys(optionStringIndices).forEach(function (position) { + maxOptionStringIndex = Math.max(maxOptionStringIndex, parseInt(position, 10)); + }); var positionalsEndIndex, nextOptionStringIndex; @@ -525,6 +526,8 @@ ArgumentParser.prototype._parseKnownArgs = function (argStrings, namespace) { // consume any Positionals preceding the next option nextOptionStringIndex = null; for (position in optionStringIndices) { + if (!optionStringIndices.hasOwnProperty(position)) { continue; } + position = parseInt(position, 10); if (position >= startIndex) { if (nextOptionStringIndex !== null) { @@ -688,10 +691,10 @@ ArgumentParser.prototype._matchArgumentsPartial = function (actions, regexpArgSt return string.length; }; - for (i = actions.length; i > 0; i -= 1) { + for (i = actions.length; i > 0; i--) { pattern = ''; actionSlice = actions.slice(0, i); - for (j in actionSlice) { + for (j = 0; j < actionSlice.length; j++) { pattern += self._getNargsPattern(actionSlice[j]); } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js index 541d918..89319b9 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js @@ -722,20 +722,15 @@ HelpFormatter.prototype._formatArgs = function (action, metavarDefault) { }; HelpFormatter.prototype._expandHelp = function (action) { - var actionProperty; - var actionValue; + var params = { prog: this._prog }; - var params = {prog: this._prog}; + Object.keys(action).forEach(function (actionProperty) { + var actionValue = action[actionProperty]; - for (actionProperty in action) { - if (action.hasOwnProperty(actionProperty)) { - actionValue = action[actionProperty]; - - if (actionValue !== $$.SUPPRESS) { - params[actionProperty] = actionValue; - } + if (actionValue !== $$.SUPPRESS) { + params[actionProperty] = actionValue; } - } + }); if (!!params.choices) { if (_.isString(params.choices)) { diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.npmignore b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.npmignore new file mode 100644 index 0000000..0fc18a4 --- /dev/null +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.npmignore @@ -0,0 +1,2 @@ +test +dist diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml index ab27b29..b4ae6a7 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml @@ -1,8 +1,8 @@ -language: ruby -rvm: - - 1.9.3 +language: node_js +node_js: + - "0.11" before_script: - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" - - sleep 2 \ No newline at end of file + - sleep 2 diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile deleted file mode 100644 index aed29c3..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source "https://rubygems.org" - -gem 'uglifier' -gem 'rake' diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock deleted file mode 100644 index 2c52be4..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock +++ /dev/null @@ -1,17 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - execjs (1.4.0) - multi_json (~> 1.0) - multi_json (1.3.6) - rake (0.9.2.2) - uglifier (1.3.0) - execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - -PLATFORMS - ruby - -DEPENDENCIES - rake - uglifier diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown index 1a39ad9..4e58be4 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown @@ -9,11 +9,11 @@ for example from [Dive Into JavaScript][d]. [d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object -As name states this an extension for [Underscore.js][u], but it can be used +As name states this an extension for [Underscore.js][u] (and [Lo-Dash](http://lodash.com/)), but it can be used independently from **_s**-global variable. But with Underscore.js you can use Object-Oriented style and chaining: -[u]: http://documentcloud.github.com/underscore/ +[u]: http://underscorejs.org/ ```javascript _(" epeli ").chain().trim().capitalize().value() @@ -291,16 +291,19 @@ _('my name is epeli').titleize() **camelize** _.camelize(string) -Converts underscored or dasherized string to a camelized one +Converts underscored or dasherized string to a camelized one. Begins with +a lower case letter unless it starts with an underscore or string ```javascript +_('moz-transform').camelize() +=> 'mozTransform' _('-moz-transform').camelize() => 'MozTransform' ``` **classify** _.classify(string) -Converts string to camelized class name +Converts string to camelized class name. First letter is always upper case ```javascript _('some_class_name').classify() @@ -415,7 +418,7 @@ C like string formatting. Credits goes to [Alexandru Marasteanu][o]. For more detailed documentation, see the [original page][o]. -[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript +[o]: http://www.diveintojavascript.com/projects/javascript-sprintf ```javascript _.sprintf("%.1f", 1.17) @@ -680,12 +683,20 @@ _ = _.string ## Changelog ## +### 2.4.0 ### + +* Move from rake to gulp +* Add support form classify camelcase strings +* Fix bower.json +* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.3...2.4.0) + ### 2.3.3 ### * Add `toBoolean` * Add `unquote` * Add quote char option to `quote` * Support dash-separated words in `titleize` +* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.2...2.3.3) ### 2.3.2 ### diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile deleted file mode 100644 index 2cd9eed..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile +++ /dev/null @@ -1,23 +0,0 @@ -# encoding: utf-8 -task default: :test - -desc 'Use UglifyJS to compress Underscore.string' -task :build do - require 'uglifier' - source = File.read('lib/underscore.string.js', :encoding => 'utf-8') - compressed = Uglifier.compile(source, copyright: false) - File.open('dist/underscore.string.min.js', 'w'){ |f| f.write compressed } - compression_rate = compressed.length.to_f/source.length - puts "compressed dist/underscore.string.min.js: #{compressed.length}/#{source.length} #{(compression_rate * 100).round}%" -end - -desc 'Run tests' -task :test do - puts "Running underscore.string test suite." - result1 = system %{phantomjs ./test/run-qunit.js "test/test.html"} - - puts "Running Underscore test suite." - result2 = system %{phantomjs ./test/run-qunit.js "test/test_underscore/index.html"} - - exit(result1 && result2 ? 0 : 1) -end diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/bower.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/bower.json new file mode 100644 index 0000000..6aef0bd --- /dev/null +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/bower.json @@ -0,0 +1,33 @@ +{ + "name": "underscore.string", + "version": "2.4.0", + "description": "String manipulation extensions for Underscore.js javascript library.", + "homepage": "http://epeli.github.com/underscore.string/", + "contributors": [ + "Esa-Matti Suuronen (http://esa-matti.suuronen.org/)", + "Edward Tsech ", + "Pavel Pravosud ()", + "Sasha Koss (http://koss.nocorp.me/)", + "Vladimir Dronnikov ", + "Pete Kruckenberg ()", + "Paul Chavard ()", + "Ed Finkler ()" + ], + "keywords": [ + "underscore", + "string" + ], + "main": "./lib/underscore.string.js", + "repository": { + "type": "git", + "url": "https://github.com/epeli/underscore.string.git" + }, + "bugs": { + "url": "https://github.com/epeli/underscore.string/issues" + }, + "licenses": [ + { + "type": "MIT" + } + ] +} diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json index ae91b65..96e23d3 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json @@ -2,7 +2,7 @@ "name": "underscore.string", "repo": "epeli/underscore.string", "description": "String manipulation extensions for Underscore.js javascript library", - "version": "2.3.3", + "version": "2.4.0", "keywords": ["underscore", "string"], "dependencies": {}, "development": {}, diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js deleted file mode 100644 index 4f6b2b9..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,n){"use strict";function r(e,n){var r,t,u=e.toLowerCase();for(n=[].concat(n),r=0;n.length>r;r+=1)if(t=n[r]){if(t.test&&t.test(e))return!0;if(t.toLowerCase()===u)return!0}}var t=n.prototype.trim,u=n.prototype.trimRight,i=n.prototype.trimLeft,l=function(e){return 1*e||0},o=function(e,n){if(1>n)return"";for(var r="";n>0;)1&n&&(r+=e),n>>=1,e+=e;return r},a=[].slice,c=function(e){return null==e?"\\s":e.source?e.source:"["+g.escapeRegExp(e)+"]"},s={lt:"<",gt:">",quot:'"',amp:"&",apos:"'"},f={};for(var p in s)f[s[p]]=p;f["'"]="#39";var h=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}var r=o,t=function(){return t.cache.hasOwnProperty(arguments[0])||(t.cache[arguments[0]]=t.parse(arguments[0])),t.format.call(null,t.cache[arguments[0]],arguments)};return t.format=function(t,u){var i,l,o,a,c,s,f,p=1,g=t.length,d="",m=[];for(l=0;g>l;l++)if(d=e(t[l]),"string"===d)m.push(t[l]);else if("array"===d){if(a=t[l],a[2])for(i=u[p],o=0;a[2].length>o;o++){if(!i.hasOwnProperty(a[2][o]))throw new Error(h('[_.sprintf] property "%s" does not exist',a[2][o]));i=i[a[2][o]]}else i=a[1]?u[a[1]]:u[p++];if(/[^s]/.test(a[8])&&"number"!=e(i))throw new Error(h("[_.sprintf] expecting number but found %s",e(i)));switch(a[8]){case"b":i=i.toString(2);break;case"c":i=n.fromCharCode(i);break;case"d":i=parseInt(i,10);break;case"e":i=a[7]?i.toExponential(a[7]):i.toExponential();break;case"f":i=a[7]?parseFloat(i).toFixed(a[7]):parseFloat(i);break;case"o":i=i.toString(8);break;case"s":i=(i=n(i))&&a[7]?i.substring(0,a[7]):i;break;case"u":i=Math.abs(i);break;case"x":i=i.toString(16);break;case"X":i=i.toString(16).toUpperCase()}i=/[def]/.test(a[8])&&a[3]&&i>=0?"+"+i:i,s=a[4]?"0"==a[4]?"0":a[4].charAt(1):" ",f=a[6]-n(i).length,c=a[6]?r(s,f):"",m.push(a[5]?i+c:c+i)}return m.join("")},t.cache={},t.parse=function(e){for(var n=e,r=[],t=[],u=0;n;){if(null!==(r=/^[^\x25]+/.exec(n)))t.push(r[0]);else if(null!==(r=/^\x25{2}/.exec(n)))t.push("%");else{if(null===(r=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(n)))throw new Error("[_.sprintf] huh?");if(r[2]){u|=1;var i=[],l=r[2],o=[];if(null===(o=/^([a-z_][a-z_\d]*)/i.exec(l)))throw new Error("[_.sprintf] huh?");for(i.push(o[1]);""!==(l=l.substring(o[0].length));)if(null!==(o=/^\.([a-z_][a-z_\d]*)/i.exec(l)))i.push(o[1]);else{if(null===(o=/^\[(\d+)\]/.exec(l)))throw new Error("[_.sprintf] huh?");i.push(o[1])}r[2]=i}else u|=2;if(3===u)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");t.push(r)}n=n.substring(r[0].length)}return t},t}(),g={VERSION:"2.3.0",isBlank:function(e){return null==e&&(e=""),/^\s*$/.test(e)},stripTags:function(e){return null==e?"":n(e).replace(/<\/?[^>]+>/g,"")},capitalize:function(e){return e=null==e?"":n(e),e.charAt(0).toUpperCase()+e.slice(1)},chop:function(e,r){return null==e?[]:(e=n(e),r=~~r,r>0?e.match(new RegExp(".{1,"+r+"}","g")):[e])},clean:function(e){return g.strip(e).replace(/\s+/g," ")},count:function(e,r){if(null==e||null==r)return 0;e=n(e),r=n(r);for(var t=0,u=0,i=r.length;;){if(u=e.indexOf(r,u),-1===u)break;t++,u+=i}return t},chars:function(e){return null==e?[]:n(e).split("")},swapCase:function(e){return null==e?"":n(e).replace(/\S/g,function(e){return e===e.toUpperCase()?e.toLowerCase():e.toUpperCase()})},escapeHTML:function(e){return null==e?"":n(e).replace(/[&<>"']/g,function(e){return"&"+f[e]+";"})},unescapeHTML:function(e){return null==e?"":n(e).replace(/\&([^;]+);/g,function(e,r){var t;return r in s?s[r]:(t=r.match(/^#x([\da-fA-F]+)$/))?n.fromCharCode(parseInt(t[1],16)):(t=r.match(/^#(\d+)$/))?n.fromCharCode(~~t[1]):e})},escapeRegExp:function(e){return null==e?"":n(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},splice:function(e,n,r,t){var u=g.chars(e);return u.splice(~~n,~~r,t),u.join("")},insert:function(e,n,r){return g.splice(e,n,0,r)},include:function(e,r){return""===r?!0:null==e?!1:-1!==n(e).indexOf(r)},join:function(){var e=a.call(arguments),n=e.shift();return null==n&&(n=""),e.join(n)},lines:function(e){return null==e?[]:n(e).split("\n")},reverse:function(e){return g.chars(e).reverse().join("")},startsWith:function(e,r){return""===r?!0:null==e||null==r?!1:(e=n(e),r=n(r),e.length>=r.length&&e.slice(0,r.length)===r)},endsWith:function(e,r){return""===r?!0:null==e||null==r?!1:(e=n(e),r=n(r),e.length>=r.length&&e.slice(e.length-r.length)===r)},succ:function(e){return null==e?"":(e=n(e),e.slice(0,-1)+n.fromCharCode(e.charCodeAt(e.length-1)+1))},titleize:function(e){return null==e?"":(e=n(e).toLowerCase(),e.replace(/(?:^|\s|-)\S/g,function(e){return e.toUpperCase()}))},camelize:function(e){return g.trim(e).replace(/[-_\s]+(.)?/g,function(e,n){return n?n.toUpperCase():""})},underscored:function(e){return g.trim(e).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(e){return g.trim(e).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},classify:function(e){return g.titleize(n(e).replace(/[\W_]/g," ")).replace(/\s/g,"")},humanize:function(e){return g.capitalize(g.underscored(e).replace(/_id$/,"").replace(/_/g," "))},trim:function(e,r){return null==e?"":!r&&t?t.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+|"+r+"+$","g"),""))},ltrim:function(e,r){return null==e?"":!r&&i?i.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+"),""))},rtrim:function(e,r){return null==e?"":!r&&u?u.call(e):(r=c(r),n(e).replace(new RegExp(r+"+$"),""))},truncate:function(e,r,t){return null==e?"":(e=n(e),t=t||"...",r=~~r,e.length>r?e.slice(0,r)+t:e)},prune:function(e,r,t){if(null==e)return"";if(e=n(e),r=~~r,t=null!=t?n(t):"...",r>=e.length)return e;var u=function(e){return e.toUpperCase()!==e.toLowerCase()?"A":" "},i=e.slice(0,r+1).replace(/.(?=\W*\w*$)/g,u);return i=i.slice(i.length-2).match(/\w\w/)?i.replace(/\s*\S+$/,""):g.rtrim(i.slice(0,i.length-1)),(i+t).length>e.length?e:e.slice(0,i.length)+t},words:function(e,n){return g.isBlank(e)?[]:g.trim(e,n).split(n||/\s+/)},pad:function(e,r,t,u){e=null==e?"":n(e),r=~~r;var i=0;switch(t?t.length>1&&(t=t.charAt(0)):t=" ",u){case"right":return i=r-e.length,e+o(t,i);case"both":return i=r-e.length,o(t,Math.ceil(i/2))+e+o(t,Math.floor(i/2));default:return i=r-e.length,o(t,i)+e}},lpad:function(e,n,r){return g.pad(e,n,r)},rpad:function(e,n,r){return g.pad(e,n,r,"right")},lrpad:function(e,n,r){return g.pad(e,n,r,"both")},sprintf:h,vsprintf:function(e,n){return n.unshift(e),h.apply(null,n)},toNumber:function(e,n){return e?(e=g.trim(e),e.match(/^-?\d+(?:\.\d+)?$/)?l(l(e).toFixed(~~n)):0/0):0},numberFormat:function(e,n,r,t){if(isNaN(e)||null==e)return"";e=e.toFixed(~~n),t="string"==typeof t?t:",";var u=e.split("."),i=u[0],l=u[1]?(r||".")+u[1]:"";return i.replace(/(\d)(?=(?:\d{3})+$)/g,"$1"+t)+l},strRight:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.indexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strRightBack:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.lastIndexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strLeft:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.indexOf(r):-1;return~t?e.slice(0,t):e},strLeftBack:function(e,n){if(null==e)return"";e+="",n=null!=n?""+n:n;var r=e.lastIndexOf(n);return~r?e.slice(0,r):e},toSentence:function(e,n,r,t){n=n||", ",r=r||" and ";var u=e.slice(),i=u.pop();return e.length>2&&t&&(r=g.rtrim(n)+r),u.length?u.join(n)+r+i:i},toSentenceSerial:function(){var e=a.call(arguments);return e[3]=!0,g.toSentence.apply(g,e)},slugify:function(e){if(null==e)return"";var r="ąàáäâãåæăćęèéëêìíïîłńòóöôõøśșțùúüûñçżź",t="aaaaaaaaaceeeeeiiiilnoooooosstuuuunczz",u=new RegExp(c(r),"g");return e=n(e).toLowerCase().replace(u,function(e){var n=r.indexOf(e);return t.charAt(n)||"-"}),g.dasherize(e.replace(/[^\w\s-]/g,""))},surround:function(e,n){return[n,e,n].join("")},quote:function(e,n){return g.surround(e,n||'"')},unquote:function(e,n){return n=n||'"',e[0]===n&&e[e.length-1]===n?e.slice(1,e.length-1):e},exports:function(){var e={};for(var n in this)this.hasOwnProperty(n)&&!n.match(/^(?:include|contains|reverse)$/)&&(e[n]=this[n]);return e},repeat:function(e,r,t){if(null==e)return"";if(r=~~r,null==t)return o(n(e),r);for(var u=[];r>0;u[--r]=e);return u.join(t)},naturalCmp:function(e,r){if(e==r)return 0;if(!e)return-1;if(!r)return 1;for(var t=/(\.\d+)|(\d+)|(\D+)/g,u=n(e).toLowerCase().match(t),i=n(r).toLowerCase().match(t),l=Math.min(u.length,i.length),o=0;l>o;o++){var a=u[o],c=i[o];if(a!==c){var s=parseInt(a,10);if(!isNaN(s)){var f=parseInt(c,10);if(!isNaN(f)&&s-f)return s-f}return c>a?-1:1}}return u.length===i.length?u.length-i.length:r>e?-1:1},levenshtein:function(e,r){if(null==e&&null==r)return 0;if(null==e)return n(r).length;if(null==r)return n(e).length;e=n(e),r=n(r);for(var t,u,i=[],l=0;r.length>=l;l++)for(var o=0;e.length>=o;o++)u=l&&o?e.charAt(o-1)===r.charAt(l-1)?t:Math.min(i[o],i[o-1],t)+1:l+o,t=i[o],i[o]=u;return i.pop()},toBoolean:function(e,n,t){return"number"==typeof e&&(e=""+e),"string"!=typeof e?!!e:(e=g.trim(e),r(e,n||["true","1"])?!0:r(e,t||["false","0"])?!1:void 0)}};g.strip=g.trim,g.lstrip=g.ltrim,g.rstrip=g.rtrim,g.center=g.lrpad,g.rjust=g.lpad,g.ljust=g.rpad,g.contains=g.include,g.q=g.quote,g.toBool=g.toBoolean,"undefined"!=typeof exports&&("undefined"!=typeof module&&module.exports&&(module.exports=g),exports._s=g),"function"==typeof define&&define.amd&&define("underscore.string",[],function(){return g}),e._=e._||{},e._.string=e._.str=g}(this,String); \ No newline at end of file diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/foo.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/foo.js new file mode 100644 index 0000000..cdc1d08 --- /dev/null +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/foo.js @@ -0,0 +1,10 @@ + + function boolMatch(s, matchers) { + var i, matcher, down = s.toLowerCase(); + matchers = [].concat(matchers); + for (i = 0; i < matchers.length; i += 1) { + matcher = matchers[i]; + if (matcher.test && matcher.test(s)) return true; + if (matcher && matcher.toLowerCase() === down) return true; + } + } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/gulpfile.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/gulpfile.js new file mode 100644 index 0000000..6eaead8 --- /dev/null +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/gulpfile.js @@ -0,0 +1,26 @@ +var gulp = require('gulp'), + qunit = require("gulp-qunit"), + uglify = require('gulp-uglify'), + clean = require('gulp-clean'), + rename = require('gulp-rename'), + SRC = 'lib/underscore.string.js', + DEST = 'dist', + MIN_FILE = 'underscore.string.min.js', + TEST_SUITES = ['test/test.html', 'test/test_underscore/index.html']; + +gulp.task('test', function() { + return gulp.src(TEST_SUITES) + .pipe(qunit()); +}); + +gulp.task('clean', function() { + return gulp.src(DEST) + .pipe(clean()); +}); + +gulp.task('build', ['test', 'clean'], function() { + return gulp.src(SRC) + .pipe(uglify()) + .pipe(rename(MIN_FILE)) + .pipe(gulp.dest(DEST)); +}); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js index 8761117..c9c8d47 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js @@ -3,7 +3,7 @@ // Underscore.string is freely distributable under the terms of the MIT license. // Documentation: https://github.com/epeli/underscore.string // Some code is borrowed from MooTools and Alexandru Marasteanu. -// Version '2.3.2' +// Version '2.4.0' !function(root, String){ 'use strict'; @@ -189,7 +189,7 @@ var _s = { - VERSION: '2.3.0', + VERSION: '2.4.0', isBlank: function(str){ if (str == null) str = ''; @@ -349,7 +349,7 @@ }, classify: function(str){ - return _s.titleize(String(str).replace(/[\W_]/g, ' ')).replace(/\s/g, ''); + return _s.capitalize(_s.camelize(String(str).replace(/[\W_]/g, ' ')).replace(/\s/g, '')); }, humanize: function(str){ @@ -360,7 +360,7 @@ if (str == null) return ''; if (!characters && nativeTrim) return nativeTrim.call(str); characters = defaultToWhiteSpace(characters); - return String(str).replace(new RegExp('\^' + characters + '+|' + characters + '+$', 'g'), ''); + return String(str).replace(new RegExp('^' + characters + '+|' + characters + '+$', 'g'), ''); }, ltrim: function(str, characters){ diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json index 9556365..fb7151e 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json @@ -1,6 +1,6 @@ { "name": "underscore.string", - "version": "2.3.3", + "version": "2.4.0", "description": "String manipulation extensions for Underscore.js javascript library.", "homepage": "http://epeli.github.com/underscore.string/", "contributors": [ @@ -47,7 +47,7 @@ "underscore", "string" ], - "main": "./lib/underscore.string", + "main": "./lib/underscore.string.js", "directories": { "lib": "./lib" }, @@ -66,9 +66,42 @@ "type": "MIT" } ], - "readme": "# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) #\n\n\n\nJavascript lacks complete string manipulation operations.\nThis an attempt to fill that gap. List of build-in methods can be found\nfor example from [Dive Into JavaScript][d].\n\n[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object\n\n\nAs name states this an extension for [Underscore.js][u], but it can be used\nindependently from **_s**-global variable. But with Underscore.js you can\nuse Object-Oriented style and chaining:\n\n[u]: http://documentcloud.github.com/underscore/\n\n```javascript\n_(\" epeli \").chain().trim().capitalize().value()\n=> \"Epeli\"\n```\n\n## Download ##\n\n * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb*\n * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb*\n\n\n## Node.js installation ##\n\n**npm package**\n\n npm install underscore.string\n\n**Standalone usage**:\n\n```javascript\nvar _s = require('underscore.string');\n```\n\n**Integrate with Underscore.js**:\n\n```javascript\nvar _ = require('underscore');\n\n// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains)\n_.str = require('underscore.string');\n\n// Mix in non-conflict functions to Underscore namespace if you want\n_.mixin(_.str.exports());\n\n// All functions, include conflict, will be available through _.str object\n_.str.include('Underscore.string', 'string'); // => true\n```\n\n**Or Integrate with Underscore.js without module loading**\n\nRun the following expression after Underscore.js and Underscore.string are loaded\n```javascript\n// _.str becomes a global variable if no module loading is detected\n// Mix in non-conflict functions to Underscore namespace\n_.mixin(_.str.exports());\n```\n\n## String Functions ##\n\nFor availability of functions in this way you need to mix in Underscore.string functions:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\notherwise functions from examples will be available through _.string or _.str objects:\n\n```javascript\n_.str.capitalize('epeli')\n=> \"Epeli\"\n```\n\n**numberFormat** _.numberFormat(number, [ decimals=0, decimalSeparator='.', orderSeparator=','])\n\nFormats the numbers.\n\n```javascript\n_.numberFormat(1000, 2)\n=> \"1,000.00\"\n\n_.numberFormat(123456789.123, 5, '.', ',')\n=> \"123,456,789.12300\"\n```\n\n\n**levenshtein** _.levenshtein(string1, string2)\n\nCalculates [Levenshtein distance][ld] between two strings.\n[ld]: http://en.wikipedia.org/wiki/Levenshtein_distance\n\n```javascript\n_.levenshtein('kitten', 'kittah')\n=> 2\n```\n\n**capitalize** _.capitalize(string)\n\nConverts first letter of the string to uppercase.\n\n```javascript\n_.capitalize(\"foo Bar\")\n=> \"Foo Bar\"\n```\n\n**chop** _.chop(string, step)\n\n```javascript\n_.chop('whitespace', 3)\n=> ['whi','tes','pac','e']\n```\n\n**clean** _.clean(str)\n\nCompress some whitespaces to one.\n\n```javascript\n_.clean(\" foo bar \")\n=> 'foo bar'\n```\n\n**chars** _.chars(str)\n\n```javascript\n_.chars('Hello')\n=> ['H','e','l','l','o']\n```\n\n**swapCase** _.swapCase(str)\n\nReturns a copy of the string in which all the case-based characters have had their case swapped.\n\n```javascript\n_.swapCase('hELLO')\n=> 'Hello'\n```\n\n**include** available only through _.str object, because Underscore has function with the same name.\n\n```javascript\n_.str.include(\"foobar\", \"ob\")\n=> true\n```\n\n(removed) **includes** _.includes(string, substring)\n\nTests if string contains a substring.\n\n```javascript\n_.includes(\"foobar\", \"ob\")\n=> true\n```\n\n**includes** function was removed\n\nBut you can create it in this way, for compatibility with previous versions:\n\n```javascript\n_.includes = _.str.include\n```\n\n**count** _.count(string, substring)\n\n```javascript\n_('Hello world').count('l')\n=> 3\n```\n\n**escapeHTML** _.escapeHTML(string)\n\nConverts HTML special characters to their entity equivalents.\n\n```javascript\n_('
Blah blah blah
').escapeHTML();\n=> '<div>Blah blah blah</div>'\n```\n\n**unescapeHTML** _.unescapeHTML(string)\n\nConverts entity characters to HTML equivalents.\n\n```javascript\n_('<div>Blah blah blah</div>').unescapeHTML();\n=> '
Blah blah blah
'\n```\n\n**insert** _.insert(string, index, substing)\n\n```javascript\n_('Hello ').insert(6, 'world')\n=> 'Hello world'\n```\n\n**isBlank** _.isBlank(string)\n\n```javascript\n_('').isBlank(); // => true\n_('\\n').isBlank(); // => true\n_(' ').isBlank(); // => true\n_('a').isBlank(); // => false\n```\n\n**join** _.join(separator, *strings)\n\nJoins strings together with given separator\n\n```javascript\n_.join(\" \", \"foo\", \"bar\")\n=> \"foo bar\"\n```\n\n**lines** _.lines(str)\n\n```javascript\n_.lines(\"Hello\\nWorld\")\n=> [\"Hello\", \"World\"]\n```\n\n**reverse** available only through _.str object, because Underscore has function with the same name.\n\nReturn reversed string:\n\n```javascript\n_.str.reverse(\"foobar\")\n=> 'raboof'\n```\n\n**splice** _.splice(string, index, howmany, substring)\n\nLike a array splice.\n\n```javascript\n_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli')\n=> 'https://edtsech@bitbucket.org/epeli/underscore.strings'\n```\n\n**startsWith** _.startsWith(string, starts)\n\nThis method checks whether string starts with starts.\n\n```javascript\n_(\"image.gif\").startsWith(\"image\")\n=> true\n```\n\n**endsWith** _.endsWith(string, ends)\n\nThis method checks whether string ends with ends.\n\n```javascript\n_(\"image.gif\").endsWith(\"gif\")\n=> true\n```\n\n**succ** _.succ(str)\n\nReturns the successor to str.\n\n```javascript\n_('a').succ()\n=> 'b'\n\n_('A').succ()\n=> 'B'\n```\n\n**supplant**\n\nSupplant function was removed, use Underscore.js [template function][p].\n\n[p]: http://documentcloud.github.com/underscore/#template\n\n**strip** alias for *trim*\n\n**lstrip** alias for *ltrim*\n\n**rstrip** alias for *rtrim*\n\n**titleize** _.titleize(string)\n\n```javascript\n_('my name is epeli').titleize()\n=> 'My Name Is Epeli'\n```\n\n**camelize** _.camelize(string)\n\nConverts underscored or dasherized string to a camelized one\n\n```javascript\n_('-moz-transform').camelize()\n=> 'MozTransform'\n```\n\n**classify** _.classify(string)\n\nConverts string to camelized class name\n\n```javascript\n_('some_class_name').classify()\n=> 'SomeClassName'\n```\n\n**underscored** _.underscored(string)\n\nConverts a camelized or dasherized string into an underscored one\n\n```javascript\n_('MozTransform').underscored()\n=> 'moz_transform'\n```\n\n**dasherize** _.dasherize(string)\n\nConverts a underscored or camelized string into an dasherized one\n\n```javascript\n_('MozTransform').dasherize()\n=> '-moz-transform'\n```\n\n**humanize** _.humanize(string)\n\nConverts an underscored, camelized, or dasherized string into a humanized one.\nAlso removes beginning and ending whitespace, and removes the postfix '_id'.\n\n```javascript\n_(' capitalize dash-CamelCase_underscore trim ').humanize()\n=> 'Capitalize dash camel case underscore trim'\n```\n\n**trim** _.trim(string, [characters])\n\ntrims defined characters from begining and ending of the string.\nDefaults to whitespace characters.\n\n```javascript\n_.trim(\" foobar \")\n=> \"foobar\"\n\n_.trim(\"_-foobar-_\", \"_-\")\n=> \"foobar\"\n```\n\n\n**ltrim** _.ltrim(string, [characters])\n\nLeft trim. Similar to trim, but only for left side.\n\n\n**rtrim** _.rtrim(string, [characters])\n\nRight trim. Similar to trim, but only for right side.\n\n**truncate** _.truncate(string, length, truncateString)\n\n```javascript\n_('Hello world').truncate(5)\n=> 'Hello...'\n\n_('Hello').truncate(10)\n=> 'Hello'\n```\n\n**prune** _.prune(string, length, pruneString)\n\nElegant version of truncate.\nMakes sure the pruned string does not exceed the original length.\nAvoid half-chopped words when truncating.\n\n```javascript\n_('Hello, world').prune(5)\n=> 'Hello...'\n\n_('Hello, world').prune(8)\n=> 'Hello...'\n\n_('Hello, world').prune(5, ' (read a lot more)')\n=> 'Hello, world' (as adding \"(read a lot more)\" would be longer than the original string)\n\n_('Hello, cruel world').prune(15)\n=> 'Hello, cruel...'\n\n_('Hello').prune(10)\n=> 'Hello'\n```\n\n**words** _.words(str, delimiter=/\\s+/)\n\nSplit string by delimiter (String or RegExp), /\\s+/ by default.\n\n```javascript\n_.words(\" I love you \")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I_love_you\", \"_\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I-love-you\", /-/)\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\" \")\n=> []\n```\n\n**sprintf** _.sprintf(string format, *arguments)\n\nC like string formatting.\nCredits goes to [Alexandru Marasteanu][o].\nFor more detailed documentation, see the [original page][o].\n\n[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript\n\n```javascript\n_.sprintf(\"%.1f\", 1.17)\n\"1.2\"\n```\n\n**pad** _.pad(str, length, [padStr, type])\n\npads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`\" \"`). `padStr` is truncated to a single character if necessary.\n\n```javascript\n_.pad(\"1\", 8)\n-> \" 1\";\n\n_.pad(\"1\", 8, '0')\n-> \"00000001\";\n\n_.pad(\"1\", 8, '0', 'right')\n-> \"10000000\";\n\n_.pad(\"1\", 8, '0', 'both')\n-> \"00001000\";\n\n_.pad(\"1\", 8, 'bleepblorp', 'both')\n-> \"bbbb1bbb\";\n```\n\n**lpad** _.lpad(str, length, [padStr])\n\nleft-pad a string. Alias for `pad(str, length, padStr, 'left')`\n\n```javascript\n_.lpad(\"1\", 8, '0')\n-> \"00000001\";\n```\n\n**rpad** _.rpad(str, length, [padStr])\n\nright-pad a string. Alias for `pad(str, length, padStr, 'right')`\n\n```javascript\n_.rpad(\"1\", 8, '0')\n-> \"10000000\";\n```\n\n**lrpad** _.lrpad(str, length, [padStr])\n\nleft/right-pad a string. Alias for `pad(str, length, padStr, 'both')`\n\n```javascript\n_.lrpad(\"1\", 8, '0')\n-> \"00001000\";\n```\n\n**center** alias for **lrpad**\n\n**ljust** alias for *rpad*\n\n**rjust** alias for *lpad*\n\n**toNumber** _.toNumber(string, [decimals])\n\nParse string to number. Returns NaN if string can't be parsed to number.\n\n```javascript\n_('2.556').toNumber()\n=> 3\n\n_('2.556').toNumber(1)\n=> 2.6\n```\n\n**strRight** _.strRight(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRight('_')\n=> \"is_a_test_string\";\n```\n\n**strRightBack** _.strRightBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRightBack('_')\n=> \"string\";\n```\n\n**strLeft** _.strLeft(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeft('_')\n=> \"This\";\n```\n\n**strLeftBack** _.strLeftBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeftBack('_')\n=> \"This_is_a_test\";\n```\n\n**stripTags**\n\nRemoves all html tags from string.\n\n```javascript\n_('a
link').stripTags()\n=> 'a link'\n\n_('a link').stripTags()\n=> 'a linkalert(\"hello world!\")'\n```\n\n**toSentence** _.toSentence(array, [delimiter, lastDelimiter])\n\nJoin an array into a human readable sentence.\n\n```javascript\n_.toSentence(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools and Prototype';\n\n_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ')\n=> 'jQuery, Mootools unt Prototype';\n```\n\n**toSentenceSerial** _.toSentenceSerial(array, [delimiter, lastDelimiter])\n\nThe same as `toSentence`, but adjusts delimeters to use [Serial comma](http://en.wikipedia.org/wiki/Serial_comma).\n\n```javascript\n_.toSentenceSerial(['jQuery', 'Mootools'])\n=> 'jQuery and Mootools';\n\n_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools, and Prototype'\n\n_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ');\n=> 'jQuery, Mootools, unt Prototype';\n```\n\n**repeat** _.repeat(string, count, [separator])\n\nRepeats a string count times.\n\n```javascript\n_.repeat(\"foo\", 3)\n=> 'foofoofoo';\n\n_.repeat(\"foo\", 3, \"bar\")\n=> 'foobarfoobarfoo'\n```\n\n**surround** _.surround(string, wrap)\n\nSurround a string with another string.\n\n```javascript\n_.surround(\"foo\", \"ab\")\n=> 'abfooab';\n```\n\n**quote** _.quote(string, quoteChar) or _.q(string, quoteChar)\n\nQuotes a string. `quoteChar` defaults to `\"`.\n\n```javascript\n_.quote('foo', quoteChar)\n=> '\"foo\"';\n```\n**unquote** _.unquote(string, quoteChar)\n\nUnquotes a string. `quoteChar` defaults to `\"`.\n\n```javascript\n_.unquote('\"foo\"')\n=> 'foo';\n_.unquote(\"'foo'\", \"'\")\n=> 'foo';\n```\n\n\n**slugify** _.slugify(string)\n\nTransform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash.\n\n```javascript\n_.slugify(\"Un éléphant à l'orée du bois\")\n=> 'un-elephant-a-loree-du-bois';\n```\n\n***Caution: this function is charset dependent***\n\n**naturalCmp** array.sort(_.naturalCmp)\n\nNaturally sort strings like humans would do.\n\n```javascript\n['foo20', 'foo5'].sort(_.naturalCmp)\n=> [ 'foo5', 'foo20' ]\n```\n\n**toBoolean** _.toBoolean(string) or _.toBool(string)\n\nTurn strings that can be commonly considered as booleas to real booleans. Such as \"true\", \"false\", \"1\" and \"0\". This function is case insensitive.\n\n```javascript\n_.toBoolean(\"true\")\n=> true\n_.toBoolean(\"FALSE\")\n=> false\n_.toBoolean(\"random\")\n=> undefined\n```\n\nIt can be customized by giving arrays of truth and falsy value matcher as parameters. Matchers can be also RegExp objects.\n\n```javascript\n_.toBoolean(\"truthy\", [\"truthy\"], [\"falsy\"])\n=> true\n_.toBoolean(\"true only at start\", [/^true/])\n=> true\n```\n\n## Roadmap ##\n\nAny suggestions or bug reports are welcome. Just email me or more preferably open an issue.\n\n#### Problems\n\nWe lose two things for `include` and `reverse` methods from `_.string`:\n\n* Calls like `_('foobar').include('bar')` aren't available;\n* Chaining isn't available too.\n\nBut if you need this functionality you can create aliases for conflict functions which will be convenient for you:\n\n```javascript\n_.mixin({\n includeString: _.str.include,\n reverseString: _.str.reverse\n})\n\n// Now wrapper calls and chaining are available.\n_('foobar').chain().reverseString().includeString('rab').value()\n```\n\n#### Standalone Usage\n\nIf you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias\nBut of course you can just reassign `_` variable with `_.string`\n\n```javascript\n_ = _.string\n```\n\n## Changelog ##\n\n### 2.3.3 ###\n\n* Add `toBoolean`\n* Add `unquote`\n* Add quote char option to `quote`\n* Support dash-separated words in `titleize`\n\n### 2.3.2 ###\n\n* Add `naturalCmp`\n* Bug fix to `camelize`\n* Add ă, ș, ț and ś to `slugify`\n* Doc updates\n* Add support for [component](http://component.io/)\n* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.1...v2.3.2)\n\n### 2.3.1 ###\n\n* Bug fixes to `escapeHTML`, `classify`, `substr`\n* Faster `count`\n* Documentation fixes\n* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.0...v2.3.1)\n\n### 2.3.0 ###\n\n* Added `numberformat` method\n* Added `levenshtein` method (Levenshtein distance calculation)\n* Added `swapCase` method\n* Changed default behavior of `words` method\n* Added `toSentenceSerial` method\n* Added `surround` and `quote` methods\n\n### 2.2.1 ###\n\n* Same as 2.2.0 (2.2.0rc on npm) to fix some npm drama\n\n### 2.2.0 ###\n\n* Capitalize method behavior changed\n* Various perfomance tweaks\n\n### 2.1.1###\n\n* Fixed words method bug\n* Added classify method\n\n### 2.1.0 ###\n\n* AMD support\n* Added toSentence method\n* Added slugify method\n* Lots of speed optimizations\n\n### 2.0.0 ###\n\n* Added prune, humanize functions\n* Added _.string (_.str) namespace for Underscore.string library\n* Removed includes function\n\nFor upgrading to this version you need to mix in Underscore.string library to Underscore object:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\nand all non-conflict Underscore.string functions will be available through Underscore object.\nAlso function `includes` has been removed, you should replace this function by `_.str.include`\nor create alias `_.includes = _.str.include` and all your code will work fine.\n\n### 1.1.6 ###\n\n* Fixed reverse and truncate\n* Added isBlank, stripTags, inlude(alias for includes)\n* Added uglifier compression\n\n### 1.1.5 ###\n\n* Added strRight, strRightBack, strLeft, strLeftBack\n\n### 1.1.4 ###\n\n* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust\n* Integration with Underscore 1.1.6\n\n### 1.1.3 ###\n\n* Added methods: underscored, camelize, dasherize\n* Support newer version of npm\n\n### 1.1.2 ###\n\n* Created functions: lines, chars, words functions\n\n### 1.0.2 ###\n\n* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible)\n* Removed 'reverse' function, because this function override underscore.js 'reverse'\n\n## Contribute ##\n\n* Fork & pull request. Don't forget about tests.\n* If you planning add some feature please create issue before.\n\nOtherwise changes will be rejected.\n\n## Contributors list ##\n[Can be found here](https://github.com/epeli/underscore.string/graphs/contributors).\n\n\n## Licence ##\n\nThe MIT License\n\nCopyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies 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\nTHE SOFTWARE.\n", - "readmeFilename": "README.markdown", - "_id": "underscore.string@2.3.3", - "_from": "underscore.string@~2.3.1", - "scripts": {} + "scripts": { + "test": "gulp test" + }, + "devDependencies": { + "gulp": "~3.8.10", + "gulp-uglify": "~1.0.1", + "gulp-qunit": "~1.0.0", + "gulp-clean": "~0.3.1", + "gulp-rename": "~1.2.0" + }, + "_id": "underscore.string@2.4.0", + "dist": { + "shasum": "8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b", + "tarball": "http://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz" + }, + "_from": "underscore.string@>=2.4.0 <2.5.0", + "_npmVersion": "1.3.24", + "_npmUser": { + "name": "epeli", + "email": "esa-matti@suuronen.org" + }, + "maintainers": [ + { + "name": "edtsech", + "email": "edtsech@gmail.com" + }, + { + "name": "rwz", + "email": "rwz@duckroll.ru" + }, + { + "name": "epeli", + "email": "esa-matti@suuronen.org" + } + ], + "_shasum": "8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b", + "_resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js deleted file mode 100644 index 44a2167..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js +++ /dev/null @@ -1,45 +0,0 @@ -function waitFor(test, complete, timeout) { - var result, start = new Date().getTime() - setInterval(function interval() { - if ((new Date().getTime() - start < timeout) && !result) { - result = test() - } else { - if (!result) { - phantom.exit(1) - } else { - complete() - clearInterval(interval) - } - } - }, 100) -} - - -var fs = require('fs'), page = require('webpage').create(); -var url = 'file://localhost' + fs.workingDirectory + '/' + phantom.args[0]; - -page.onConsoleMessage = function(msg) { - console.log(msg) -} - -page.open(url, function(status) { - waitFor(function() { - return page.evaluate(function(){ - var el = document.getElementById('qunit-testresult') - return el && el.innerText.match('completed') - }) - }, function() { - var failures = page.evaluate(function() { - var el = document.getElementById('qunit-testresult'), - fails = document.getElementsByClassName('fail') - - for (var i = 0; i < fails.length; i++) - console.log(fails[i].innerText) - - console.log(el.innerText) - - return parseInt(el.getElementsByClassName('failed')[0].innerHTML) - }) - phantom.exit(failures > 0 ? 1 : 0) - }, 10000) -}) \ No newline at end of file diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js deleted file mode 100644 index 9ceeea7..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js +++ /dev/null @@ -1,148 +0,0 @@ -(function() { - - JSLitmus.test('levenshtein', function() { - return [ - _.levenshtein('pineapple', 'potato'), - _.levenshtein('seven', 'eight'), - _.levenshtein('the very same string', 'the very same string'), - _.levenshtein('very very very long string', 'something completely different') - ]; - }); - - - JSLitmus.test('trimNoNative', function() { - return _.trim(" foobar ", " "); - }); - - JSLitmus.test('trim', function() { - return _.trim(" foobar "); - }); - - JSLitmus.test('trim object-oriented', function() { - return _(" foobar ").trim(); - }); - - JSLitmus.test('trim jQuery', function() { - return jQuery.trim(" foobar "); - }); - - JSLitmus.test('ltrimp', function() { - return _.ltrim(" foobar ", " "); - }); - - JSLitmus.test('rtrimp', function() { - return _.rtrim(" foobar ", " "); - }); - - JSLitmus.test('startsWith', function() { - return _.startsWith("foobar", "foo"); - }); - - JSLitmus.test('endsWith', function() { - return _.endsWith("foobar", "xx"); - }); - - JSLitmus.test('chop', function(){ - return _('whitespace').chop(2); - }); - - JSLitmus.test('count', function(){ - return _('Hello worls').count('l'); - }); - - JSLitmus.test('insert', function() { - return _('Hello ').insert(6, 'world'); - }); - - JSLitmus.test('splice', function() { - return _('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'); - }); - - JSLitmus.test('succ', function(){ - var let = 'a', alphabet = []; - - for (var i=0; i < 26; i++) { - alphabet.push(let); - let = _(let).succ(); - } - - return alphabet; - }); - - JSLitmus.test('titleize', function(){ - return _('the titleize string method').titleize(); - }); - - JSLitmus.test('truncate', function(){ - return _('Hello world').truncate(5); - }); - - JSLitmus.test('prune', function(){ - return _('Hello world').prune(5); - }); - - JSLitmus.test('isBlank', function(){ - return _('').isBlank(); - }); - - JSLitmus.test('escapeHTML', function(){ - _('
Blah blah blah
').escapeHTML(); - }); - - JSLitmus.test('unescapeHTML', function(){ - _('<div>Blah blah blah</div>').unescapeHTML(); - }); - - JSLitmus.test('reverse', function(){ - _('Hello World').reverse(); - }); - - JSLitmus.test('pad default', function(){ - _('foo').pad(12); - }); - - JSLitmus.test('pad hash left', function(){ - _('foo').pad(12, '#'); - }); - - JSLitmus.test('pad hash right', function(){ - _('foo').pad(12, '#', 'right'); - }); - - JSLitmus.test('pad hash both', function(){ - _('foo').pad(12, '#', 'both'); - }); - - JSLitmus.test('pad hash both longPad', function(){ - _('foo').pad(12, 'f00f00f00', 'both'); - }); - - JSLitmus.test('toNumber', function(){ - _('10.232323').toNumber(2); - }); - - JSLitmus.test('strRight', function(){ - _('aaa_bbb_ccc').strRight('_'); - }); - - JSLitmus.test('strRightBack', function(){ - _('aaa_bbb_ccc').strRightBack('_'); - }); - - JSLitmus.test('strLeft', function(){ - _('aaa_bbb_ccc').strLeft('_'); - }); - - JSLitmus.test('strLeftBack', function(){ - _('aaa_bbb_ccc').strLeftBack('_'); - }); - - JSLitmus.test('join', function(){ - _('separator').join(1, 2, 3, 4, 5, 6, 7, 8, 'foo', 'bar', 'lol', 'wut'); - }); - - JSLitmus.test('slugify', function(){ - _("Un éléphant à l'orée du bois").slugify(); - }); - -})(); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js deleted file mode 100644 index 77364f2..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js +++ /dev/null @@ -1,685 +0,0 @@ -$(document).ready(function() { - - // Include Underscore.string methods to Underscore namespace - _.mixin(_.str.exports()); - - module('String extensions'); - - test('Strings: naturalSort', function() { - var arr = ['foo2', 'foo1', 'foo10', 'foo30', 'foo100', 'foo10bar'], - sorted = ['foo1', 'foo2', 'foo10', 'foo10bar', 'foo30', 'foo100']; - deepEqual(arr.sort(_.naturalCmp), sorted); - }); - - test('Strings: trim', function() { - equal(_.trim(123), '123', 'Non string'); - equal(_(' foo').trim(), 'foo'); - equal(_('foo ').trim(), 'foo'); - equal(_(' foo ').trim(), 'foo'); - equal(_(' foo ').trim(), 'foo'); - equal(_(' foo ').trim(' '), 'foo', 'Manually set whitespace'); - equal(_('\t foo \t ').trim(/\s/), 'foo', 'Manually set RegExp /\\s+/'); - - equal(_('ffoo').trim('f'), 'oo'); - equal(_('ooff').trim('f'), 'oo'); - equal(_('ffooff').trim('f'), 'oo'); - - - equal(_('_-foobar-_').trim('_-'), 'foobar'); - - equal(_('http://foo/').trim('/'), 'http://foo'); - equal(_('c:\\').trim('\\'), 'c:'); - - equal(_(123).trim(), '123'); - equal(_(123).trim(3), '12'); - equal(_('').trim(), '', 'Trim empty string should return empty string'); - equal(_(null).trim(), '', 'Trim null should return empty string'); - equal(_(undefined).trim(), '', 'Trim undefined should return empty string'); - }); - - test('String: levenshtein', function() { - equal(_.levenshtein('Godfather', 'Godfather'), 0); - equal(_.levenshtein('Godfather', 'Godfathe'), 1); - equal(_.levenshtein('Godfather', 'odfather'), 1); - equal(_.levenshtein('Godfather', 'Gdfthr'), 3); - equal(_.levenshtein('seven', 'eight'), 5); - equal(_.levenshtein('123', 123), 0); - equal(_.levenshtein(321, '321'), 0); - equal(_.levenshtein('lol', null), 3); - equal(_.levenshtein('lol'), 3); - equal(_.levenshtein(null, 'lol'), 3); - equal(_.levenshtein(undefined, 'lol'), 3); - equal(_.levenshtein(), 0); - }); - - test('Strings: ltrim', function() { - equal(_(' foo').ltrim(), 'foo'); - equal(_(' foo').ltrim(), 'foo'); - equal(_('foo ').ltrim(), 'foo '); - equal(_(' foo ').ltrim(), 'foo '); - equal(_('').ltrim(), '', 'ltrim empty string should return empty string'); - equal(_(null).ltrim(), '', 'ltrim null should return empty string'); - equal(_(undefined).ltrim(), '', 'ltrim undefined should return empty string'); - - equal(_('ffoo').ltrim('f'), 'oo'); - equal(_('ooff').ltrim('f'), 'ooff'); - equal(_('ffooff').ltrim('f'), 'ooff'); - - equal(_('_-foobar-_').ltrim('_-'), 'foobar-_'); - - equal(_(123).ltrim(1), '23'); - }); - - test('Strings: rtrim', function() { - equal(_('http://foo/').rtrim('/'), 'http://foo', 'clean trailing slash'); - equal(_(' foo').rtrim(), ' foo'); - equal(_('foo ').rtrim(), 'foo'); - equal(_('foo ').rtrim(), 'foo'); - equal(_('foo bar ').rtrim(), 'foo bar'); - equal(_(' foo ').rtrim(), ' foo'); - - equal(_('ffoo').rtrim('f'), 'ffoo'); - equal(_('ooff').rtrim('f'), 'oo'); - equal(_('ffooff').rtrim('f'), 'ffoo'); - - equal(_('_-foobar-_').rtrim('_-'), '_-foobar'); - - equal(_(123).rtrim(3), '12'); - equal(_('').rtrim(), '', 'rtrim empty string should return empty string'); - equal(_(null).rtrim(), '', 'rtrim null should return empty string'); - }); - - test('Strings: capitalize', function() { - equal(_('fabio').capitalize(), 'Fabio', 'First letter is upper case'); - equal(_.capitalize('fabio'), 'Fabio', 'First letter is upper case'); - equal(_.capitalize('FOO'), 'FOO', 'Other letters unchanged'); - equal(_(123).capitalize(), '123', 'Non string'); - equal(_.capitalize(''), '', 'Capitalizing empty string returns empty string'); - equal(_.capitalize(null), '', 'Capitalizing null returns empty string'); - equal(_.capitalize(undefined), '', 'Capitalizing undefined returns empty string'); - }); - - test('Strings: join', function() { - equal(_.join('', 'foo', 'bar'), 'foobar', 'basic join'); - equal(_.join('', 1, 'foo', 2), '1foo2', 'join numbers and strings'); - equal(_.join(' ','foo', 'bar'), 'foo bar', 'join with spaces'); - equal(_.join('1', '2', '2'), '212', 'join number strings'); - equal(_.join(1, 2, 2), '212', 'join numbers'); - equal(_.join('','foo', null), 'foo', 'join null with string returns string'); - equal(_.join(null,'foo', 'bar'), 'foobar', 'join strings with null returns string'); - equal(_(' ').join('foo', 'bar'), 'foo bar', 'join object oriented'); - }); - - test('Strings: reverse', function() { - equal(_.str.reverse('foo'), 'oof' ); - equal(_.str.reverse('foobar'), 'raboof' ); - equal(_.str.reverse('foo bar'), 'rab oof' ); - equal(_.str.reverse('saippuakauppias'), 'saippuakauppias' ); - equal(_.str.reverse(123), '321', 'Non string'); - equal(_.str.reverse(123.45), '54.321', 'Non string'); - equal(_.str.reverse(''), '', 'reversing empty string returns empty string' ); - equal(_.str.reverse(null), '', 'reversing null returns empty string' ); - equal(_.str.reverse(undefined), '', 'reversing undefined returns empty string' ); - }); - - test('Strings: clean', function() { - equal(_(' foo bar ').clean(), 'foo bar'); - equal(_(123).clean(), '123'); - equal(_('').clean(), '', 'claning empty string returns empty string'); - equal(_(null).clean(), '', 'claning null returns empty string'); - equal(_(undefined).clean(), '', 'claning undefined returns empty string'); - }); - - test('Strings: sprintf', function() { - // Should be very tested function already. Thanks to - // http://www.diveintojavascript.com/projects/sprintf-for-javascript - equal(_.sprintf('Hello %s', 'me'), 'Hello me', 'basic'); - equal(_('Hello %s').sprintf('me'), 'Hello me', 'object'); - equal(_('hello %s').chain().sprintf('me').capitalize().value(), 'Hello me', 'Chaining works'); - equal(_.sprintf('%.1f', 1.22222), '1.2', 'round'); - equal(_.sprintf('%.1f', 1.17), '1.2', 'round 2'); - equal(_.sprintf('%(id)d - %(name)s', {id: 824, name: 'Hello World'}), '824 - Hello World', 'Named replacements work'); - equal(_.sprintf('%(args[0].id)d - %(args[1].name)s', {args: [{id: 824}, {name: 'Hello World'}]}), '824 - Hello World', 'Named replacements with arrays work'); - }); - - - test('Strings: vsprintf', function() { - equal(_.vsprintf('Hello %s', ['me']), 'Hello me', 'basic'); - equal(_('Hello %s').vsprintf(['me']), 'Hello me', 'object'); - equal(_('hello %s').chain().vsprintf(['me']).capitalize().value(), 'Hello me', 'Chaining works'); - equal(_.vsprintf('%.1f', [1.22222]), '1.2', 'round'); - equal(_.vsprintf('%.1f', [1.17]), '1.2', 'round 2'); - equal(_.vsprintf('%(id)d - %(name)s', [{id: 824, name: 'Hello World'}]), '824 - Hello World', 'Named replacement works'); - equal(_.vsprintf('%(args[0].id)d - %(args[1].name)s', [{args: [{id: 824}, {name: 'Hello World'}]}]), '824 - Hello World', 'Named replacement with arrays works'); - }); - - test('Strings: startsWith', function() { - ok(_('foobar').startsWith('foo'), 'foobar starts with foo'); - ok(!_('oobar').startsWith('foo'), 'oobar does not start with foo'); - ok(_(12345).startsWith(123), '12345 starts with 123'); - ok(!_(2345).startsWith(123), '2345 does not start with 123'); - ok(_('').startsWith(''), 'empty string starts with empty string'); - ok(_(null).startsWith(''), 'null starts with empty string'); - ok(!_(null).startsWith('foo'), 'null starts with foo'); - }); - - test('Strings: endsWith', function() { - ok(_('foobar').endsWith('bar'), 'foobar ends with bar'); - ok(_.endsWith('foobar', 'bar'), 'foobar ends with bar'); - ok(_.endsWith('00018-0000062.Plone.sdh264.1a7264e6912a91aa4a81b64dc5517df7b8875994.mp4', 'mp4'), 'endsWith .mp4'); - ok(!_('fooba').endsWith('bar'), 'fooba does not end with bar'); - ok(_.endsWith(12345, 45), '12345 ends with 45'); - ok(!_.endsWith(12345, 6), '12345 does not end with 6'); - ok(_('').endsWith(''), 'empty string ends with empty string'); - ok(_(null).endsWith(''), 'null ends with empty string'); - ok(!_(null).endsWith('foo'), 'null ends with foo'); - }); - - test('Strings: include', function() { - ok(_.str.include('foobar', 'bar'), 'foobar includes bar'); - ok(!_.str.include('foobar', 'buzz'), 'foobar does not includes buzz'); - ok(_.str.include(12345, 34), '12345 includes 34'); - ok(!_.str.contains(12345, 6), '12345 does not includes 6'); - ok(!_.str.include('', 34), 'empty string includes 34'); - ok(!_.str.include(null, 34), 'null includes 34'); - ok(_.str.include(null, ''), 'null includes empty string'); - }); - - test('String: chop', function(){ - ok(_('whitespace').chop(2).length === 5, 'output [wh, it, es, pa, ce]'); - ok(_('whitespace').chop(3).length === 4, 'output [whi, tes, pac, e]'); - ok(_('whitespace').chop()[0].length === 10, 'output [whitespace]'); - ok(_(12345).chop(1).length === 5, 'output [1, 2, 3, 4, 5]'); - }); - - test('String: clean', function(){ - equal(_.clean(' foo bar '), 'foo bar'); - equal(_.clean(''), ''); - equal(_.clean(null), ''); - equal(_.clean(1), '1'); - }); - - test('String: count', function(){ - equal(_('Hello world').count('l'), 3); - equal(_('Hello world').count('Hello'), 1); - equal(_('Hello world').count('foo'), 0); - equal(_('x.xx....x.x').count('x'), 5); - equal(_('').count('x'), 0); - equal(_(null).count('x'), 0); - equal(_(undefined).count('x'), 0); - equal(_(12345).count(1), 1); - equal(_(11345).count(1), 2); - }); - - test('String: insert', function(){ - equal(_('Hello ').insert(6, 'Jessy'), 'Hello Jessy'); - equal(_('Hello ').insert(100, 'Jessy'), 'Hello Jessy'); - equal(_('').insert(100, 'Jessy'), 'Jessy'); - equal(_(null).insert(100, 'Jessy'), 'Jessy'); - equal(_(undefined).insert(100, 'Jessy'), 'Jessy'); - equal(_(12345).insert(6, 'Jessy'), '12345Jessy'); - }); - - test('String: splice', function(){ - equal(_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'), - 'https://edtsech@bitbucket.org/epeli/underscore.strings'); - equal(_.splice(12345, 1, 2, 321), '132145', 'Non strings'); - }); - - test('String: succ', function(){ - equal(_('a').succ(), 'b'); - equal(_('A').succ(), 'B'); - equal(_('+').succ(), ','); - equal(_(1).succ(), '2'); - }); - - test('String: titleize', function(){ - equal(_('the titleize string method').titleize(), 'The Titleize String Method'); - equal(_('the titleize string method').titleize(), 'The Titleize String Method'); - equal(_('').titleize(), '', 'Titleize empty string returns empty string'); - equal(_(null).titleize(), '', 'Titleize null returns empty string'); - equal(_(undefined).titleize(), '', 'Titleize undefined returns empty string'); - equal(_('let\'s have some fun').titleize(), 'Let\'s Have Some Fun'); - equal(_('a-dash-separated-string').titleize(), 'A-Dash-Separated-String'); - equal(_('A-DASH-SEPARATED-STRING').titleize(), 'A-Dash-Separated-String'); - equal(_(123).titleize(), '123'); - }); - - test('String: camelize', function(){ - equal(_('the_camelize_string_method').camelize(), 'theCamelizeStringMethod'); - equal(_('-the-camelize-string-method').camelize(), 'TheCamelizeStringMethod'); - equal(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); - equal(_(' the camelize string method').camelize(), 'theCamelizeStringMethod'); - equal(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); - equal(_('').camelize(), '', 'Camelize empty string returns empty string'); - equal(_(null).camelize(), '', 'Camelize null returns empty string'); - equal(_(undefined).camelize(), '', 'Camelize undefined returns empty string'); - equal(_(123).camelize(), '123'); - }); - - test('String: underscored', function(){ - equal(_('the-underscored-string-method').underscored(), 'the_underscored_string_method'); - equal(_('theUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); - equal(_('TheUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); - equal(_(' the underscored string method').underscored(), 'the_underscored_string_method'); - equal(_('').underscored(), ''); - equal(_(null).underscored(), ''); - equal(_(undefined).underscored(), ''); - equal(_(123).underscored(), '123'); - }); - - test('String: dasherize', function(){ - equal(_('the_dasherize_string_method').dasherize(), 'the-dasherize-string-method'); - equal(_('TheDasherizeStringMethod').dasherize(), '-the-dasherize-string-method'); - equal(_('thisIsATest').dasherize(), 'this-is-a-test'); - equal(_('this Is A Test').dasherize(), 'this-is-a-test'); - equal(_('thisIsATest123').dasherize(), 'this-is-a-test123'); - equal(_('123thisIsATest').dasherize(), '123this-is-a-test'); - equal(_('the dasherize string method').dasherize(), 'the-dasherize-string-method'); - equal(_('the dasherize string method ').dasherize(), 'the-dasherize-string-method'); - equal(_('téléphone').dasherize(), 'téléphone'); - equal(_('foo$bar').dasherize(), 'foo$bar'); - equal(_('').dasherize(), ''); - equal(_(null).dasherize(), ''); - equal(_(undefined).dasherize(), ''); - equal(_(123).dasherize(), '123'); - }); - - test('String: camelize', function(){ - equal(_.camelize('-moz-transform'), 'MozTransform'); - equal(_.camelize('webkit-transform'), 'webkitTransform'); - equal(_.camelize('under_scored'), 'underScored'); - equal(_.camelize(' with spaces'), 'withSpaces'); - equal(_('').camelize(), ''); - equal(_(null).camelize(), ''); - equal(_(undefined).camelize(), ''); - equal(_("_som eWeird---name-").camelize(), 'SomEWeirdName'); - }); - - test('String: join', function(){ - equal(_.join(1, 2, 3, 4), '21314'); - equal(_.join('|', 'foo', 'bar', 'baz'), 'foo|bar|baz'); - equal(_.join('',2,3,null), '23'); - equal(_.join(null,2,3), '23'); - }); - - test('String: classify', function(){ - equal(_.classify(1), '1'); - equal(_('some_class_name').classify(), 'SomeClassName'); - equal(_('my wonderfull class_name').classify(), 'MyWonderfullClassName'); - equal(_('my wonderfull.class.name').classify(), 'MyWonderfullClassName'); - }); - - test('String: humanize', function(){ - equal(_('the_humanize_string_method').humanize(), 'The humanize string method'); - equal(_('ThehumanizeStringMethod').humanize(), 'Thehumanize string method'); - equal(_('the humanize string method').humanize(), 'The humanize string method'); - equal(_('the humanize_id string method_id').humanize(), 'The humanize id string method'); - equal(_('the humanize string method ').humanize(), 'The humanize string method'); - equal(_(' capitalize dash-CamelCase_underscore trim ').humanize(), 'Capitalize dash camel case underscore trim'); - equal(_(123).humanize(), '123'); - equal(_('').humanize(), ''); - equal(_(null).humanize(), ''); - equal(_(undefined).humanize(), ''); - }); - - test('String: truncate', function(){ - equal(_('Hello world').truncate(6, 'read more'), 'Hello read more'); - equal(_('Hello world').truncate(5), 'Hello...'); - equal(_('Hello').truncate(10), 'Hello'); - equal(_('').truncate(10), ''); - equal(_(null).truncate(10), ''); - equal(_(undefined).truncate(10), ''); - equal(_(1234567890).truncate(5), '12345...'); - }); - - test('String: prune', function(){ - equal(_('Hello, cruel world').prune(6, ' read more'), 'Hello read more'); - equal(_('Hello, world').prune(5, 'read a lot more'), 'Hello, world'); - equal(_('Hello, world').prune(5), 'Hello...'); - equal(_('Hello, world').prune(8), 'Hello...'); - equal(_('Hello, cruel world').prune(15), 'Hello, cruel...'); - equal(_('Hello world').prune(22), 'Hello world'); - equal(_('Привет, жестокий мир').prune(6, ' read more'), 'Привет read more'); - equal(_('Привет, мир').prune(6, 'read a lot more'), 'Привет, мир'); - equal(_('Привет, мир').prune(6), 'Привет...'); - equal(_('Привет, мир').prune(8), 'Привет...'); - equal(_('Привет, жестокий мир').prune(16), 'Привет, жестокий...'); - equal(_('Привет, мир').prune(22), 'Привет, мир'); - equal(_('alksjd!!!!!!....').prune(100, ''), 'alksjd!!!!!!....'); - equal(_(123).prune(10), '123'); - equal(_(123).prune(1, 321), '321'); - equal(_('').prune(5), ''); - equal(_(null).prune(5), ''); - equal(_(undefined).prune(5), ''); - }); - - test('String: isBlank', function(){ - ok(_('').isBlank()); - ok(_(' ').isBlank()); - ok(_('\n').isBlank()); - ok(!_('a').isBlank()); - ok(!_('0').isBlank()); - ok(!_(0).isBlank()); - ok(_('').isBlank()); - ok(_(null).isBlank()); - ok(_(undefined).isBlank()); - }); - - test('String: escapeRegExp', function(){ - equal(_.escapeRegExp(/hello(?=\sworld)/.source), 'hello\\(\\?\\=\\\\sworld\\)', 'with lookahead'); - equal(_.escapeRegExp(/hello(?!\shell)/.source), 'hello\\(\\?\\!\\\\shell\\)', 'with negative lookahead'); - }); - - test('String: escapeHTML', function(){ - equal(_('
Blah & "blah" & \'blah\'
').escapeHTML(), - '<div>Blah & "blah" & 'blah'</div>'); - equal(_('<').escapeHTML(), '&lt;'); - equal(_(5).escapeHTML(), '5'); - equal(_('').escapeHTML(), ''); - equal(_(null).escapeHTML(), ''); - equal(_(undefined).escapeHTML(), ''); - }); - - test('String: unescapeHTML', function(){ - equal(_('<div>Blah & "blah" & 'blah'</div>').unescapeHTML(), - '
Blah & "blah" & \'blah\'
'); - equal(_('&lt;').unescapeHTML(), '<'); - equal(_(''').unescapeHTML(), '\''); - equal(_(''').unescapeHTML(), '\''); - equal(_(''').unescapeHTML(), '\''); - equal(_('J').unescapeHTML(), 'J'); - equal(_('J').unescapeHTML(), 'J'); - equal(_('J').unescapeHTML(), 'J'); - equal(_('&_#39;').unescapeHTML(), '&_#39;'); - equal(_(''_;').unescapeHTML(), ''_;'); - equal(_('&#38;').unescapeHTML(), '&'); - equal(_('&amp;').unescapeHTML(), '&'); - equal(_('').unescapeHTML(), ''); - equal(_(null).unescapeHTML(), ''); - equal(_(undefined).unescapeHTML(), ''); - equal(_(5).unescapeHTML(), '5'); - // equal(_(undefined).unescapeHTML(), ''); - }); - - test('String: words', function() { - deepEqual(_('I love you!').words(), ['I', 'love', 'you!']); - deepEqual(_(' I love you! ').words(), ['I', 'love', 'you!']); - deepEqual(_('I_love_you!').words('_'), ['I', 'love', 'you!']); - deepEqual(_('I-love-you!').words(/-/), ['I', 'love', 'you!']); - deepEqual(_(123).words(), ['123'], '123 number has one word "123".'); - deepEqual(_(0).words(), ['0'], 'Zero number has one word "0".'); - deepEqual(_('').words(), [], 'Empty strings has no words.'); - deepEqual(_(' ').words(), [], 'Blank strings has no words.'); - deepEqual(_(null).words(), [], 'null has no words.'); - deepEqual(_(undefined).words(), [], 'undefined has no words.'); - }); - - test('String: chars', function() { - equal(_('Hello').chars().length, 5); - equal(_(123).chars().length, 3); - equal(_('').chars().length, 0); - equal(_(null).chars().length, 0); - equal(_(undefined).chars().length, 0); - }); - - test('String: swapCase', function(){ - equal(_('AaBbCcDdEe').swapCase(), 'aAbBcCdDeE'); - equal(_('Hello World').swapCase(), 'hELLO wORLD'); - equal(_('').swapCase(), ''); - equal(_(null).swapCase(), ''); - equal(_(undefined).swapCase(), ''); - }); - - test('String: lines', function() { - equal(_('Hello\nWorld').lines().length, 2); - equal(_('Hello World').lines().length, 1); - equal(_(123).lines().length, 1); - equal(_('').lines().length, 1); - equal(_(null).lines().length, 0); - equal(_(undefined).lines().length, 0); - }); - - test('String: pad', function() { - equal(_('1').pad(8), ' 1'); - equal(_(1).pad(8), ' 1'); - equal(_('1').pad(8, '0'), '00000001'); - equal(_('1').pad(8, '0', 'left'), '00000001'); - equal(_('1').pad(8, '0', 'right'), '10000000'); - equal(_('1').pad(8, '0', 'both'), '00001000'); - equal(_('foo').pad(8, '0', 'both'), '000foo00'); - equal(_('foo').pad(7, '0', 'both'), '00foo00'); - equal(_('foo').pad(7, '!@$%dofjrofj', 'both'), '!!foo!!'); - equal(_('').pad(2), ' '); - equal(_(null).pad(2), ' '); - equal(_(undefined).pad(2), ' '); - }); - - test('String: lpad', function() { - equal(_('1').lpad(8), ' 1'); - equal(_(1).lpad(8), ' 1'); - equal(_('1').lpad(8, '0'), '00000001'); - equal(_('1').lpad(8, '0', 'left'), '00000001'); - equal(_('').lpad(2), ' '); - equal(_(null).lpad(2), ' '); - equal(_(undefined).lpad(2), ' '); - }); - - test('String: rpad', function() { - equal(_('1').rpad(8), '1 '); - equal(_(1).lpad(8), ' 1'); - equal(_('1').rpad(8, '0'), '10000000'); - equal(_('foo').rpad(8, '0'), 'foo00000'); - equal(_('foo').rpad(7, '0'), 'foo0000'); - equal(_('').rpad(2), ' '); - equal(_(null).rpad(2), ' '); - equal(_(undefined).rpad(2), ' '); - }); - - test('String: lrpad', function() { - equal(_('1').lrpad(8), ' 1 '); - equal(_(1).lrpad(8), ' 1 '); - equal(_('1').lrpad(8, '0'), '00001000'); - equal(_('foo').lrpad(8, '0'), '000foo00'); - equal(_('foo').lrpad(7, '0'), '00foo00'); - equal(_('foo').lrpad(7, '!@$%dofjrofj'), '!!foo!!'); - equal(_('').lrpad(2), ' '); - equal(_(null).lrpad(2), ' '); - equal(_(undefined).lrpad(2), ' '); - }); - - test('String: toNumber', function() { - deepEqual(_('not a number').toNumber(), NaN); - equal(_(0).toNumber(), 0); - equal(_('0').toNumber(), 0); - equal(_('0.0').toNumber(), 0); - equal(_('0.1').toNumber(), 0); - equal(_('0.1').toNumber(1), 0.1); - equal(_(' 0.1 ').toNumber(1), 0.1); - equal(_('0000').toNumber(), 0); - equal(_('2.345').toNumber(), 2); - equal(_('2.345').toNumber(NaN), 2); - equal(_('2.345').toNumber(2), 2.35); - equal(_('2.344').toNumber(2), 2.34); - equal(_('2').toNumber(2), 2.00); - equal(_(2).toNumber(2), 2.00); - equal(_(-2).toNumber(), -2); - equal(_('-2').toNumber(), -2); - equal(_('').toNumber(), 0); - equal(_(null).toNumber(), 0); - equal(_(undefined).toNumber(), 0); - }); - - test('String: numberFormat', function() { - equal(_.numberFormat(9000), '9,000'); - equal(_.numberFormat(9000, 0), '9,000'); - equal(_.numberFormat(9000, 0, '', ''), '9000'); - equal(_.numberFormat(90000, 2), '90,000.00'); - equal(_.numberFormat(1000.754), '1,001'); - equal(_.numberFormat(1000.754, 2), '1,000.75'); - equal(_.numberFormat(1000.754, 0, ',', '.'), '1.001'); - equal(_.numberFormat(1000.754, 2, ',', '.'), '1.000,75'); - equal(_.numberFormat(1000000.754, 2, ',', '.'), '1.000.000,75'); - equal(_.numberFormat(1000000000), '1,000,000,000'); - equal(_.numberFormat(100000000), '100,000,000'); - equal(_.numberFormat('not number'), ''); - equal(_.numberFormat(), ''); - equal(_.numberFormat(null, '.', ','), ''); - equal(_.numberFormat(undefined, '.', ','), ''); - equal(_.numberFormat(new Number(5000)), '5,000'); - }); - - test('String: strRight', function() { - equal(_('This_is_a_test_string').strRight('_'), 'is_a_test_string'); - equal(_('This_is_a_test_string').strRight('string'), ''); - equal(_('This_is_a_test_string').strRight(), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRight(''), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRight('-'), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRight(''), 'This_is_a_test_string'); - equal(_('').strRight('foo'), ''); - equal(_(null).strRight('foo'), ''); - equal(_(undefined).strRight('foo'), ''); - equal(_(12345).strRight(2), '345'); - }); - - test('String: strRightBack', function() { - equal(_('This_is_a_test_string').strRightBack('_'), 'string'); - equal(_('This_is_a_test_string').strRightBack('string'), ''); - equal(_('This_is_a_test_string').strRightBack(), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRightBack(''), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRightBack('-'), 'This_is_a_test_string'); - equal(_('').strRightBack('foo'), ''); - equal(_(null).strRightBack('foo'), ''); - equal(_(undefined).strRightBack('foo'), ''); - equal(_(12345).strRightBack(2), '345'); - }); - - test('String: strLeft', function() { - equal(_('This_is_a_test_string').strLeft('_'), 'This'); - equal(_('This_is_a_test_string').strLeft('This'), ''); - equal(_('This_is_a_test_string').strLeft(), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strLeft(''), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strLeft('-'), 'This_is_a_test_string'); - equal(_('').strLeft('foo'), ''); - equal(_(null).strLeft('foo'), ''); - equal(_(undefined).strLeft('foo'), ''); - equal(_(123454321).strLeft(3), '12'); - }); - - test('String: strLeftBack', function() { - equal(_('This_is_a_test_string').strLeftBack('_'), 'This_is_a_test'); - equal(_('This_is_a_test_string').strLeftBack('This'), ''); - equal(_('This_is_a_test_string').strLeftBack(), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strLeftBack(''), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strLeftBack('-'), 'This_is_a_test_string'); - equal(_('').strLeftBack('foo'), ''); - equal(_(null).strLeftBack('foo'), ''); - equal(_(undefined).strLeftBack('foo'), ''); - equal(_(123454321).strLeftBack(3), '123454'); - }); - - test('Strings: stripTags', function() { - equal(_('a link').stripTags(), 'a link'); - equal(_('a link - - - - - - - - -

Underscore.string Test Suite

-

-

-
    -
    -

    Underscore.string Speed Suite

    - -
    - - diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html deleted file mode 100644 index 9854c17..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Underscore.strings Test Suite - - - - - - - - -

    Underscore.string Test Suite

    -

    -

    -
      - - diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js deleted file mode 100644 index 32252a3..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js +++ /dev/null @@ -1,200 +0,0 @@ -$(document).ready(function() { - - module("Arrays"); - - test("first", function() { - equal(_.first([1,2,3]), 1, 'can pull out the first element of an array'); - equal(_([1, 2, 3]).first(), 1, 'can perform OO-style "first()"'); - equal(_.first([1,2,3], 0).join(', '), "", 'can pass an index to first'); - equal(_.first([1,2,3], 2).join(', '), '1, 2', 'can pass an index to first'); - equal(_.first([1,2,3], 5).join(', '), '1, 2, 3', 'can pass an index to first'); - var result = (function(){ return _.first(arguments); })(4, 3, 2, 1); - equal(result, 4, 'works on an arguments object.'); - result = _.map([[1,2,3],[1,2,3]], _.first); - equal(result.join(','), '1,1', 'works well with _.map'); - result = (function() { return _.take([1,2,3], 2); })(); - equal(result.join(','), '1,2', 'aliased as take'); - - equal(_.first(null), undefined, 'handles nulls'); - }); - - test("rest", function() { - var numbers = [1, 2, 3, 4]; - equal(_.rest(numbers).join(", "), "2, 3, 4", 'working rest()'); - equal(_.rest(numbers, 0).join(", "), "1, 2, 3, 4", 'working rest(0)'); - equal(_.rest(numbers, 2).join(', '), '3, 4', 'rest can take an index'); - var result = (function(){ return _(arguments).tail(); })(1, 2, 3, 4); - equal(result.join(', '), '2, 3, 4', 'aliased as tail and works on arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.rest); - equal(_.flatten(result).join(','), '2,3,2,3', 'works well with _.map'); - result = (function(){ return _(arguments).drop(); })(1, 2, 3, 4); - equal(result.join(', '), '2, 3, 4', 'aliased as drop and works on arguments object'); - }); - - test("initial", function() { - equal(_.initial([1,2,3,4,5]).join(", "), "1, 2, 3, 4", 'working initial()'); - equal(_.initial([1,2,3,4],2).join(", "), "1, 2", 'initial can take an index'); - var result = (function(){ return _(arguments).initial(); })(1, 2, 3, 4); - equal(result.join(", "), "1, 2, 3", 'initial works on arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.initial); - equal(_.flatten(result).join(','), '1,2,1,2', 'initial works with _.map'); - }); - - test("last", function() { - equal(_.last([1,2,3]), 3, 'can pull out the last element of an array'); - equal(_.last([1,2,3], 0).join(', '), "", 'can pass an index to last'); - equal(_.last([1,2,3], 2).join(', '), '2, 3', 'can pass an index to last'); - equal(_.last([1,2,3], 5).join(', '), '1, 2, 3', 'can pass an index to last'); - var result = (function(){ return _(arguments).last(); })(1, 2, 3, 4); - equal(result, 4, 'works on an arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.last); - equal(result.join(','), '3,3', 'works well with _.map'); - - equal(_.last(null), undefined, 'handles nulls'); - }); - - test("compact", function() { - equal(_.compact([0, 1, false, 2, false, 3]).length, 3, 'can trim out all falsy values'); - var result = (function(){ return _(arguments).compact().length; })(0, 1, false, 2, false, 3); - equal(result, 3, 'works on an arguments object'); - }); - - test("flatten", function() { - if (window.JSON) { - var list = [1, [2], [3, [[[4]]]]]; - equal(JSON.stringify(_.flatten(list)), '[1,2,3,4]', 'can flatten nested arrays'); - equal(JSON.stringify(_.flatten(list, true)), '[1,2,3,[[[4]]]]', 'can shallowly flatten nested arrays'); - var result = (function(){ return _.flatten(arguments); })(1, [2], [3, [[[4]]]]); - equal(JSON.stringify(result), '[1,2,3,4]', 'works on an arguments object'); - } - }); - - test("without", function() { - var list = [1, 2, 1, 0, 3, 1, 4]; - equal(_.without(list, 0, 1).join(', '), '2, 3, 4', 'can remove all instances of an object'); - var result = (function(){ return _.without(arguments, 0, 1); })(1, 2, 1, 0, 3, 1, 4); - equal(result.join(', '), '2, 3, 4', 'works on an arguments object'); - - var list = [{one : 1}, {two : 2}]; - ok(_.without(list, {one : 1}).length == 2, 'uses real object identity for comparisons.'); - ok(_.without(list, list[0]).length == 1, 'ditto.'); - }); - - test("uniq", function() { - var list = [1, 2, 1, 3, 1, 4]; - equal(_.uniq(list).join(', '), '1, 2, 3, 4', 'can find the unique values of an unsorted array'); - - var list = [1, 1, 1, 2, 2, 3]; - equal(_.uniq(list, true).join(', '), '1, 2, 3', 'can find the unique values of a sorted array faster'); - - var list = [{name:'moe'}, {name:'curly'}, {name:'larry'}, {name:'curly'}]; - var iterator = function(value) { return value.name; }; - equal(_.map(_.uniq(list, false, iterator), iterator).join(', '), 'moe, curly, larry', 'can find the unique values of an array using a custom iterator'); - - var iterator = function(value) { return value +1; }; - var list = [1, 2, 2, 3, 4, 4]; - equal(_.uniq(list, true, iterator).join(', '), '1, 2, 3, 4', 'iterator works with sorted array'); - - var result = (function(){ return _.uniq(arguments); })(1, 2, 1, 3, 1, 4); - equal(result.join(', '), '1, 2, 3, 4', 'works on an arguments object'); - }); - - test("intersection", function() { - var stooges = ['moe', 'curly', 'larry'], leaders = ['moe', 'groucho']; - equal(_.intersection(stooges, leaders).join(''), 'moe', 'can take the set intersection of two arrays'); - equal(_(stooges).intersection(leaders).join(''), 'moe', 'can perform an OO-style intersection'); - var result = (function(){ return _.intersection(arguments, leaders); })('moe', 'curly', 'larry'); - equal(result.join(''), 'moe', 'works on an arguments object'); - }); - - test("union", function() { - var result = _.union([1, 2, 3], [2, 30, 1], [1, 40]); - equal(result.join(' '), '1 2 3 30 40', 'takes the union of a list of arrays'); - - var result = _.union([1, 2, 3], [2, 30, 1], [1, 40, [1]]); - equal(result.join(' '), '1 2 3 30 40 1', 'takes the union of a list of nested arrays'); - }); - - test("difference", function() { - var result = _.difference([1, 2, 3], [2, 30, 40]); - equal(result.join(' '), '1 3', 'takes the difference of two arrays'); - - var result = _.difference([1, 2, 3, 4], [2, 30, 40], [1, 11, 111]); - equal(result.join(' '), '3 4', 'takes the difference of three arrays'); - }); - - test('zip', function() { - var names = ['moe', 'larry', 'curly'], ages = [30, 40, 50], leaders = [true]; - var stooges = _.zip(names, ages, leaders); - equal(String(stooges), 'moe,30,true,larry,40,,curly,50,', 'zipped together arrays of different lengths'); - }); - - test('object', function() { - var result = _.object(['moe', 'larry', 'curly'], [30, 40, 50]); - var shouldBe = {moe: 30, larry: 40, curly: 50}; - ok(_.isEqual(result, shouldBe), 'two arrays zipped together into an object'); - - result = _.object([['one', 1], ['two', 2], ['three', 3]]); - shouldBe = {one: 1, two: 2, three: 3}; - ok(_.isEqual(result, shouldBe), 'an array of pairs zipped together into an object'); - - var stooges = {moe: 30, larry: 40, curly: 50}; - ok(_.isEqual(_.object(_.pairs(stooges)), stooges), 'an object converted to pairs and back to an object'); - - ok(_.isEqual(_.object(null), {}), 'handles nulls'); - }); - - test("indexOf", function() { - var numbers = [1, 2, 3]; - numbers.indexOf = null; - equal(_.indexOf(numbers, 2), 1, 'can compute indexOf, even without the native function'); - var result = (function(){ return _.indexOf(arguments, 2); })(1, 2, 3); - equal(result, 1, 'works on an arguments object'); - equal(_.indexOf(null, 2), -1, 'handles nulls properly'); - - var numbers = [10, 20, 30, 40, 50], num = 35; - var index = _.indexOf(numbers, num, true); - equal(index, -1, '35 is not in the list'); - - numbers = [10, 20, 30, 40, 50]; num = 40; - index = _.indexOf(numbers, num, true); - equal(index, 3, '40 is in the list'); - - numbers = [1, 40, 40, 40, 40, 40, 40, 40, 50, 60, 70]; num = 40; - index = _.indexOf(numbers, num, true); - equal(index, 1, '40 is in the list'); - - numbers = [1, 2, 3, 1, 2, 3, 1, 2, 3]; - index = _.indexOf(numbers, 2, 5); - equal(index, 7, 'supports the fromIndex argument'); - }); - - test("lastIndexOf", function() { - var numbers = [1, 0, 1]; - equal(_.lastIndexOf(numbers, 1), 2); - - numbers = [1, 0, 1, 0, 0, 1, 0, 0, 0]; - numbers.lastIndexOf = null; - equal(_.lastIndexOf(numbers, 1), 5, 'can compute lastIndexOf, even without the native function'); - equal(_.lastIndexOf(numbers, 0), 8, 'lastIndexOf the other element'); - var result = (function(){ return _.lastIndexOf(arguments, 1); })(1, 0, 1, 0, 0, 1, 0, 0, 0); - equal(result, 5, 'works on an arguments object'); - equal(_.indexOf(null, 2), -1, 'handles nulls properly'); - - numbers = [1, 2, 3, 1, 2, 3, 1, 2, 3]; - index = _.lastIndexOf(numbers, 2, 2); - equal(index, 1, 'supports the fromIndex argument'); - }); - - test("range", function() { - equal(_.range(0).join(''), '', 'range with 0 as a first argument generates an empty array'); - equal(_.range(4).join(' '), '0 1 2 3', 'range with a single positive argument generates an array of elements 0,1,2,...,n-1'); - equal(_.range(5, 8).join(' '), '5 6 7', 'range with two arguments a & b, a<b generates an array of elements a,a+1,a+2,...,b-2,b-1'); - equal(_.range(8, 5).join(''), '', 'range with two arguments a & b, b<a generates an empty array'); - equal(_.range(3, 10, 3).join(' '), '3 6 9', 'range with three arguments a & b & c, c < b-a, a < b generates an array of elements a,a+c,a+2c,...,b - (multiplier of a) < c'); - equal(_.range(3, 10, 15).join(''), '3', 'range with three arguments a & b & c, c > b-a, a < b generates an array with a single element, equal to a'); - equal(_.range(12, 7, -2).join(' '), '12 10 8', 'range with three arguments a & b & c, a > b, c < 0 generates an array of elements a,a-c,a-2c and ends with the number not less than b'); - equal(_.range(0, -10, -1).join(' '), '0 -1 -2 -3 -4 -5 -6 -7 -8 -9', 'final example in the Python docs'); - }); - -}); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js deleted file mode 100644 index 16cf7bf..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js +++ /dev/null @@ -1,59 +0,0 @@ -$(document).ready(function() { - - module("Chaining"); - - test("map/flatten/reduce", function() { - var lyrics = [ - "I'm a lumberjack and I'm okay", - "I sleep all night and I work all day", - "He's a lumberjack and he's okay", - "He sleeps all night and he works all day" - ]; - var counts = _(lyrics).chain() - .map(function(line) { return line.split(''); }) - .flatten() - .reduce(function(hash, l) { - hash[l] = hash[l] || 0; - hash[l]++; - return hash; - }, {}).value(); - ok(counts['a'] == 16 && counts['e'] == 10, 'counted all the letters in the song'); - }); - - test("select/reject/sortBy", function() { - var numbers = [1,2,3,4,5,6,7,8,9,10]; - numbers = _(numbers).chain().select(function(n) { - return n % 2 == 0; - }).reject(function(n) { - return n % 4 == 0; - }).sortBy(function(n) { - return -n; - }).value(); - equal(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("select/reject/sortBy in functional style", function() { - var numbers = [1,2,3,4,5,6,7,8,9,10]; - numbers = _.chain(numbers).select(function(n) { - return n % 2 == 0; - }).reject(function(n) { - return n % 4 == 0; - }).sortBy(function(n) { - return -n; - }).value(); - equal(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("reverse/concat/unshift/pop/map", function() { - var numbers = [1,2,3,4,5]; - numbers = _(numbers).chain() - .reverse() - .concat([5, 5, 5]) - .unshift(17) - .pop() - .map(function(n){ return n * 2; }) - .value(); - equal(numbers.join(', '), "34, 10, 8, 6, 4, 2, 10, 10", 'can chain together array functions.'); - }); - -}); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js deleted file mode 100644 index e089626..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js +++ /dev/null @@ -1,426 +0,0 @@ -$(document).ready(function() { - - module("Collections"); - - test("each", function() { - _.each([1, 2, 3], function(num, i) { - equal(num, i + 1, 'each iterators provide value and iteration count'); - }); - - var answers = []; - _.each([1, 2, 3], function(num){ answers.push(num * this.multiplier);}, {multiplier : 5}); - equal(answers.join(', '), '5, 10, 15', 'context object property accessed'); - - answers = []; - _.forEach([1, 2, 3], function(num){ answers.push(num); }); - equal(answers.join(', '), '1, 2, 3', 'aliased as "forEach"'); - - answers = []; - var obj = {one : 1, two : 2, three : 3}; - obj.constructor.prototype.four = 4; - _.each(obj, function(value, key){ answers.push(key); }); - equal(answers.join(", "), 'one, two, three', 'iterating over objects works, and ignores the object prototype.'); - delete obj.constructor.prototype.four; - - answer = null; - _.each([1, 2, 3], function(num, index, arr){ if (_.include(arr, num)) answer = true; }); - ok(answer, 'can reference the original collection from inside the iterator'); - - answers = 0; - _.each(null, function(){ ++answers; }); - equal(answers, 0, 'handles a null properly'); - }); - - test('map', function() { - var doubled = _.map([1, 2, 3], function(num){ return num * 2; }); - equal(doubled.join(', '), '2, 4, 6', 'doubled numbers'); - - doubled = _.collect([1, 2, 3], function(num){ return num * 2; }); - equal(doubled.join(', '), '2, 4, 6', 'aliased as "collect"'); - - var tripled = _.map([1, 2, 3], function(num){ return num * this.multiplier; }, {multiplier : 3}); - equal(tripled.join(', '), '3, 6, 9', 'tripled numbers with context'); - - var doubled = _([1, 2, 3]).map(function(num){ return num * 2; }); - equal(doubled.join(', '), '2, 4, 6', 'OO-style doubled numbers'); - - if (document.querySelectorAll) { - var ids = _.map(document.querySelectorAll('#map-test *'), function(n){ return n.id; }); - deepEqual(ids, ['id1', 'id2'], 'Can use collection methods on NodeLists.'); - } - - var ids = _.map($('#map-test').children(), function(n){ return n.id; }); - deepEqual(ids, ['id1', 'id2'], 'Can use collection methods on jQuery Array-likes.'); - - var ids = _.map(document.images, function(n){ return n.id; }); - ok(ids[0] == 'chart_image', 'can use collection methods on HTMLCollections'); - - var ifnull = _.map(null, function(){}); - ok(_.isArray(ifnull) && ifnull.length === 0, 'handles a null properly'); - }); - - test('reduce', function() { - var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }, 0); - equal(sum, 6, 'can sum up an array'); - - var context = {multiplier : 3}; - sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num * this.multiplier; }, 0, context); - equal(sum, 18, 'can reduce with a context object'); - - sum = _.inject([1, 2, 3], function(sum, num){ return sum + num; }, 0); - equal(sum, 6, 'aliased as "inject"'); - - sum = _([1, 2, 3]).reduce(function(sum, num){ return sum + num; }, 0); - equal(sum, 6, 'OO-style reduce'); - - var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }); - equal(sum, 6, 'default initial value'); - - var ifnull; - try { - _.reduce(null, function(){}); - } catch (ex) { - ifnull = ex; - } - ok(ifnull instanceof TypeError, 'handles a null (without inital value) properly'); - - ok(_.reduce(null, function(){}, 138) === 138, 'handles a null (with initial value) properly'); - equal(_.reduce([], function(){}, undefined), undefined, 'undefined can be passed as a special case'); - raises(function() { _.reduce([], function(){}); }, TypeError, 'throws an error for empty arrays with no initial value'); - }); - - test('reduceRight', function() { - var list = _.reduceRight(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); - equal(list, 'bazbarfoo', 'can perform right folds'); - - var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); - equal(list, 'bazbarfoo', 'aliased as "foldr"'); - - var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }); - equal(list, 'bazbarfoo', 'default initial value'); - - var ifnull; - try { - _.reduceRight(null, function(){}); - } catch (ex) { - ifnull = ex; - } - ok(ifnull instanceof TypeError, 'handles a null (without inital value) properly'); - - var sum = _.reduceRight({a: 1, b: 2, c: 3}, function(sum, num){ return sum + num; }); - equal(sum, 6, 'default initial value on object'); - - ok(_.reduceRight(null, function(){}, 138) === 138, 'handles a null (with initial value) properly'); - - equal(_.reduceRight([], function(){}, undefined), undefined, 'undefined can be passed as a special case'); - raises(function() { _.reduceRight([], function(){}); }, TypeError, 'throws an error for empty arrays with no initial value'); - - // Assert that the correct arguments are being passed. - - var args, - memo = {}, - object = {a: 1, b: 2}, - lastKey = _.keys(object).pop(); - - var expected = lastKey == 'a' - ? [memo, 1, 'a', object] - : [memo, 2, 'b', object]; - - _.reduceRight(object, function() { - args || (args = _.toArray(arguments)); - }, memo); - - deepEqual(args, expected); - - // And again, with numeric keys. - - object = {'2': 'a', '1': 'b'}; - lastKey = _.keys(object).pop(); - args = null; - - expected = lastKey == '2' - ? [memo, 'a', '2', object] - : [memo, 'b', '1', object]; - - _.reduceRight(object, function() { - args || (args = _.toArray(arguments)); - }, memo); - - deepEqual(args, expected); - }); - - test('find', function() { - var array = [1, 2, 3, 4]; - strictEqual(_.find(array, function(n) { return n > 2; }), 3, 'should return first found `value`'); - strictEqual(_.find(array, function() { return false; }), void 0, 'should return `undefined` if `value` is not found'); - }); - - test('detect', function() { - var result = _.detect([1, 2, 3], function(num){ return num * 2 == 4; }); - equal(result, 2, 'found the first "2" and broke the loop'); - }); - - test('select', function() { - var evens = _.select([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equal(evens.join(', '), '2, 4, 6', 'selected each even number'); - - evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equal(evens.join(', '), '2, 4, 6', 'aliased as "filter"'); - }); - - test('reject', function() { - var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equal(odds.join(', '), '1, 3, 5', 'rejected each even number'); - - var context = "obj"; - - var evens = _.reject([1, 2, 3, 4, 5, 6], function(num){ - equal(context, "obj"); - return num % 2 != 0; - }, context); - equal(evens.join(', '), '2, 4, 6', 'rejected each odd number'); - }); - - test('all', function() { - ok(_.all([], _.identity), 'the empty set'); - ok(_.all([true, true, true], _.identity), 'all true values'); - ok(!_.all([true, false, true], _.identity), 'one false value'); - ok(_.all([0, 10, 28], function(num){ return num % 2 == 0; }), 'even numbers'); - ok(!_.all([0, 11, 28], function(num){ return num % 2 == 0; }), 'an odd number'); - ok(_.all([1], _.identity) === true, 'cast to boolean - true'); - ok(_.all([0], _.identity) === false, 'cast to boolean - false'); - ok(_.every([true, true, true], _.identity), 'aliased as "every"'); - ok(!_.all([undefined, undefined, undefined], _.identity), 'works with arrays of undefined'); - }); - - test('any', function() { - var nativeSome = Array.prototype.some; - Array.prototype.some = null; - ok(!_.any([]), 'the empty set'); - ok(!_.any([false, false, false]), 'all false values'); - ok(_.any([false, false, true]), 'one true value'); - ok(_.any([null, 0, 'yes', false]), 'a string'); - ok(!_.any([null, 0, '', false]), 'falsy values'); - ok(!_.any([1, 11, 29], function(num){ return num % 2 == 0; }), 'all odd numbers'); - ok(_.any([1, 10, 29], function(num){ return num % 2 == 0; }), 'an even number'); - ok(_.any([1], _.identity) === true, 'cast to boolean - true'); - ok(_.any([0], _.identity) === false, 'cast to boolean - false'); - ok(_.some([false, false, true]), 'aliased as "some"'); - Array.prototype.some = nativeSome; - }); - - test('include', function() { - ok(_.include([1,2,3], 2), 'two is in the array'); - ok(!_.include([1,3,9], 2), 'two is not in the array'); - ok(_.contains({moe:1, larry:3, curly:9}, 3) === true, '_.include on objects checks their values'); - ok(_([1,2,3]).include(2), 'OO-style include'); - }); - - test('invoke', function() { - var list = [[5, 1, 7], [3, 2, 1]]; - var result = _.invoke(list, 'sort'); - equal(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equal(result[1].join(', '), '1, 2, 3', 'second array sorted'); - }); - - test('invoke w/ function reference', function() { - var list = [[5, 1, 7], [3, 2, 1]]; - var result = _.invoke(list, Array.prototype.sort); - equal(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equal(result[1].join(', '), '1, 2, 3', 'second array sorted'); - }); - - // Relevant when using ClojureScript - test('invoke when strings have a call method', function() { - String.prototype.call = function() { - return 42; - }; - var list = [[5, 1, 7], [3, 2, 1]]; - var s = "foo"; - equal(s.call(), 42, "call function exists"); - var result = _.invoke(list, 'sort'); - equal(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equal(result[1].join(', '), '1, 2, 3', 'second array sorted'); - delete String.prototype.call; - equal(s.call, undefined, "call function removed"); - }); - - test('pluck', function() { - var people = [{name : 'moe', age : 30}, {name : 'curly', age : 50}]; - equal(_.pluck(people, 'name').join(', '), 'moe, curly', 'pulls names out of objects'); - }); - - test('where', function() { - var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}]; - var result = _.where(list, {a: 1}); - equal(result.length, 3); - equal(result[result.length - 1].b, 4); - result = _.where(list, {b: 2}); - equal(result.length, 2); - equal(result[0].a, 1); - }); - - test('max', function() { - equal(3, _.max([1, 2, 3]), 'can perform a regular Math.max'); - - var neg = _.max([1, 2, 3], function(num){ return -num; }); - equal(neg, 1, 'can perform a computation-based max'); - - equal(-Infinity, _.max({}), 'Maximum value of an empty object'); - equal(-Infinity, _.max([]), 'Maximum value of an empty array'); - - equal(299999, _.max(_.range(1,300000)), "Maximum value of a too-big array"); - }); - - test('min', function() { - equal(1, _.min([1, 2, 3]), 'can perform a regular Math.min'); - - var neg = _.min([1, 2, 3], function(num){ return -num; }); - equal(neg, 3, 'can perform a computation-based min'); - - equal(Infinity, _.min({}), 'Minimum value of an empty object'); - equal(Infinity, _.min([]), 'Minimum value of an empty array'); - - var now = new Date(9999999999); - var then = new Date(0); - equal(_.min([now, then]), then); - - equal(1, _.min(_.range(1,300000)), "Minimum value of a too-big array"); - }); - - test('sortBy', function() { - var people = [{name : 'curly', age : 50}, {name : 'moe', age : 30}]; - people = _.sortBy(people, function(person){ return person.age; }); - equal(_.pluck(people, 'name').join(', '), 'moe, curly', 'stooges sorted by age'); - - var list = [undefined, 4, 1, undefined, 3, 2]; - equal(_.sortBy(list, _.identity).join(','), '1,2,3,4,,', 'sortBy with undefined values'); - - var list = ["one", "two", "three", "four", "five"]; - var sorted = _.sortBy(list, 'length'); - equal(sorted.join(' '), 'one two four five three', 'sorted by length'); - - function Pair(x, y) { - this.x = x; - this.y = y; - } - - var collection = [ - new Pair(1, 1), new Pair(1, 2), - new Pair(1, 3), new Pair(1, 4), - new Pair(1, 5), new Pair(1, 6), - new Pair(2, 1), new Pair(2, 2), - new Pair(2, 3), new Pair(2, 4), - new Pair(2, 5), new Pair(2, 6), - new Pair(undefined, 1), new Pair(undefined, 2), - new Pair(undefined, 3), new Pair(undefined, 4), - new Pair(undefined, 5), new Pair(undefined, 6) - ]; - - var actual = _.sortBy(collection, function(pair) { - return pair.x; - }); - - deepEqual(actual, collection, 'sortBy should be stable'); - }); - - test('groupBy', function() { - var parity = _.groupBy([1, 2, 3, 4, 5, 6], function(num){ return num % 2; }); - ok('0' in parity && '1' in parity, 'created a group for each value'); - equal(parity[0].join(', '), '2, 4, 6', 'put each even number in the right group'); - - var list = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]; - var grouped = _.groupBy(list, 'length'); - equal(grouped['3'].join(' '), 'one two six ten'); - equal(grouped['4'].join(' '), 'four five nine'); - equal(grouped['5'].join(' '), 'three seven eight'); - - var context = {}; - _.groupBy([{}], function(){ ok(this === context); }, context); - - grouped = _.groupBy([4.2, 6.1, 6.4], function(num) { - return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; - }); - equal(grouped.constructor.length, 1); - equal(grouped.hasOwnProperty.length, 2); - - var array = [{}]; - _.groupBy(array, function(value, index, obj){ ok(obj === array); }); - }); - - test('countBy', function() { - var parity = _.countBy([1, 2, 3, 4, 5], function(num){ return num % 2 == 0; }); - equal(parity['true'], 2); - equal(parity['false'], 3); - - var list = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]; - var grouped = _.countBy(list, 'length'); - equal(grouped['3'], 4); - equal(grouped['4'], 3); - equal(grouped['5'], 3); - - var context = {}; - _.countBy([{}], function(){ ok(this === context); }, context); - - grouped = _.countBy([4.2, 6.1, 6.4], function(num) { - return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; - }); - equal(grouped.constructor, 1); - equal(grouped.hasOwnProperty, 2); - - var array = [{}]; - _.countBy(array, function(value, index, obj){ ok(obj === array); }); - }); - - test('sortedIndex', function() { - var numbers = [10, 20, 30, 40, 50], num = 35; - var indexForNum = _.sortedIndex(numbers, num); - equal(indexForNum, 3, '35 should be inserted at index 3'); - - var indexFor30 = _.sortedIndex(numbers, 30); - equal(indexFor30, 2, '30 should be inserted at index 2'); - - var objects = [{x: 10}, {x: 20}, {x: 30}, {x: 40}]; - var iterator = function(obj){ return obj.x; }; - strictEqual(_.sortedIndex(objects, {x: 25}, iterator), 2); - strictEqual(_.sortedIndex(objects, {x: 35}, 'x'), 3); - - var context = {1: 2, 2: 3, 3: 4}; - iterator = function(obj){ return this[obj]; }; - strictEqual(_.sortedIndex([1, 3], 2, iterator, context), 1); - }); - - test('shuffle', function() { - var numbers = _.range(10); - var shuffled = _.shuffle(numbers).sort(); - notStrictEqual(numbers, shuffled, 'original object is unmodified'); - equal(shuffled.join(','), numbers.join(','), 'contains the same members before and after shuffle'); - }); - - test('toArray', function() { - ok(!_.isArray(arguments), 'arguments object is not an array'); - ok(_.isArray(_.toArray(arguments)), 'arguments object converted into array'); - var a = [1,2,3]; - ok(_.toArray(a) !== a, 'array is cloned'); - equal(_.toArray(a).join(', '), '1, 2, 3', 'cloned array contains same elements'); - - var numbers = _.toArray({one : 1, two : 2, three : 3}); - equal(numbers.join(', '), '1, 2, 3', 'object flattened into array'); - }); - - test('size', function() { - equal(_.size({one : 1, two : 2, three : 3}), 3, 'can compute the size of an object'); - equal(_.size([1, 2, 3]), 3, 'can compute the size of an array'); - - var func = function() { - return _.size(arguments); - }; - - equal(func(1, 2, 3, 4), 4, 'can test the size of the arguments object'); - - equal(_.size('hello'), 5, 'can compute the size of a string'); - - equal(_.size(null), 0, 'handles nulls'); - }); - -}); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js deleted file mode 100644 index a529658..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js +++ /dev/null @@ -1,259 +0,0 @@ -$(document).ready(function() { - - module("Functions"); - - test("bind", function() { - var context = {name : 'moe'}; - var func = function(arg) { return "name: " + (this.name || arg); }; - var bound = _.bind(func, context); - equal(bound(), 'name: moe', 'can bind a function to a context'); - - bound = _(func).bind(context); - equal(bound(), 'name: moe', 'can do OO-style binding'); - - bound = _.bind(func, null, 'curly'); - equal(bound(), 'name: curly', 'can bind without specifying a context'); - - func = function(salutation, name) { return salutation + ': ' + name; }; - func = _.bind(func, this, 'hello'); - equal(func('moe'), 'hello: moe', 'the function was partially applied in advance'); - - var func = _.bind(func, this, 'curly'); - equal(func(), 'hello: curly', 'the function was completely applied in advance'); - - var func = function(salutation, firstname, lastname) { return salutation + ': ' + firstname + ' ' + lastname; }; - func = _.bind(func, this, 'hello', 'moe', 'curly'); - equal(func(), 'hello: moe curly', 'the function was partially applied in advance and can accept multiple arguments'); - - func = function(context, message) { equal(this, context, message); }; - _.bind(func, 0, 0, 'can bind a function to `0`')(); - _.bind(func, '', '', 'can bind a function to an empty string')(); - _.bind(func, false, false, 'can bind a function to `false`')(); - - // These tests are only meaningful when using a browser without a native bind function - // To test this with a modern browser, set underscore's nativeBind to undefined - var F = function () { return this; }; - var Boundf = _.bind(F, {hello: "moe curly"}); - equal(new Boundf().hello, undefined, "function should not be bound to the context, to comply with ECMAScript 5"); - equal(Boundf().hello, "moe curly", "When called without the new operator, it's OK to be bound to the context"); - }); - - test("bindAll", function() { - var curly = {name : 'curly'}, moe = { - name : 'moe', - getName : function() { return 'name: ' + this.name; }, - sayHi : function() { return 'hi: ' + this.name; } - }; - curly.getName = moe.getName; - _.bindAll(moe, 'getName', 'sayHi'); - curly.sayHi = moe.sayHi; - equal(curly.getName(), 'name: curly', 'unbound function is bound to current object'); - equal(curly.sayHi(), 'hi: moe', 'bound function is still bound to original object'); - - curly = {name : 'curly'}; - moe = { - name : 'moe', - getName : function() { return 'name: ' + this.name; }, - sayHi : function() { return 'hi: ' + this.name; } - }; - _.bindAll(moe); - curly.sayHi = moe.sayHi; - equal(curly.sayHi(), 'hi: moe', 'calling bindAll with no arguments binds all functions to the object'); - }); - - test("memoize", function() { - var fib = function(n) { - return n < 2 ? n : fib(n - 1) + fib(n - 2); - }; - var fastFib = _.memoize(fib); - equal(fib(10), 55, 'a memoized version of fibonacci produces identical results'); - equal(fastFib(10), 55, 'a memoized version of fibonacci produces identical results'); - - var o = function(str) { - return str; - }; - var fastO = _.memoize(o); - equal(o('toString'), 'toString', 'checks hasOwnProperty'); - equal(fastO('toString'), 'toString', 'checks hasOwnProperty'); - }); - - asyncTest("delay", 2, function() { - var delayed = false; - _.delay(function(){ delayed = true; }, 100); - setTimeout(function(){ ok(!delayed, "didn't delay the function quite yet"); }, 50); - setTimeout(function(){ ok(delayed, 'delayed the function'); start(); }, 150); - }); - - asyncTest("defer", 1, function() { - var deferred = false; - _.defer(function(bool){ deferred = bool; }, true); - _.delay(function(){ ok(deferred, "deferred the function"); start(); }, 50); - }); - - asyncTest("throttle", 2, function() { - var counter = 0; - var incr = function(){ counter++; }; - var throttledIncr = _.throttle(incr, 100); - throttledIncr(); throttledIncr(); throttledIncr(); - setTimeout(throttledIncr, 70); - setTimeout(throttledIncr, 120); - setTimeout(throttledIncr, 140); - setTimeout(throttledIncr, 190); - setTimeout(throttledIncr, 220); - setTimeout(throttledIncr, 240); - _.delay(function(){ equal(counter, 1, "incr was called immediately"); }, 30); - _.delay(function(){ equal(counter, 4, "incr was throttled"); start(); }, 400); - }); - - asyncTest("throttle arguments", 2, function() { - var value = 0; - var update = function(val){ value = val; }; - var throttledUpdate = _.throttle(update, 100); - throttledUpdate(1); throttledUpdate(2); throttledUpdate(3); - setTimeout(function(){ throttledUpdate(4); }, 120); - setTimeout(function(){ throttledUpdate(5); }, 140); - setTimeout(function(){ throttledUpdate(6); }, 250); - _.delay(function(){ equal(value, 1, "updated to latest value"); }, 40); - _.delay(function(){ equal(value, 6, "updated to latest value"); start(); }, 400); - }); - - asyncTest("throttle once", 2, function() { - var counter = 0; - var incr = function(){ return ++counter; }; - var throttledIncr = _.throttle(incr, 100); - var result = throttledIncr(); - _.delay(function(){ - equal(result, 1, "throttled functions return their value"); - equal(counter, 1, "incr was called once"); start(); - }, 220); - }); - - asyncTest("throttle twice", 1, function() { - var counter = 0; - var incr = function(){ counter++; }; - var throttledIncr = _.throttle(incr, 100); - throttledIncr(); throttledIncr(); - _.delay(function(){ equal(counter, 2, "incr was called twice"); start(); }, 220); - }); - - asyncTest("throttle repeatedly with results", 9, function() { - var counter = 0; - var incr = function(){ return ++counter; }; - var throttledIncr = _.throttle(incr, 100); - var results = []; - var saveResult = function() { results.push(throttledIncr()); }; - saveResult(); saveResult(); saveResult(); - setTimeout(saveResult, 70); - setTimeout(saveResult, 120); - setTimeout(saveResult, 140); - setTimeout(saveResult, 190); - setTimeout(saveResult, 240); - setTimeout(saveResult, 260); - _.delay(function() { - equal(results[0], 1, "incr was called once"); - equal(results[1], 1, "incr was throttled"); - equal(results[2], 1, "incr was throttled"); - equal(results[3], 1, "incr was throttled"); - equal(results[4], 2, "incr was called twice"); - equal(results[5], 2, "incr was throttled"); - equal(results[6], 2, "incr was throttled"); - equal(results[7], 3, "incr was called thrice"); - equal(results[8], 3, "incr was throttled"); - start(); - }, 400); - }); - - asyncTest("debounce", 1, function() { - var counter = 0; - var incr = function(){ counter++; }; - var debouncedIncr = _.debounce(incr, 50); - debouncedIncr(); debouncedIncr(); debouncedIncr(); - setTimeout(debouncedIncr, 30); - setTimeout(debouncedIncr, 60); - setTimeout(debouncedIncr, 90); - setTimeout(debouncedIncr, 120); - setTimeout(debouncedIncr, 150); - _.delay(function(){ equal(counter, 1, "incr was debounced"); start(); }, 220); - }); - - asyncTest("debounce asap", 5, function() { - var a, b, c; - var counter = 0; - var incr = function(){ return ++counter; }; - var debouncedIncr = _.debounce(incr, 50, true); - a = debouncedIncr(); - b = debouncedIncr(); - c = debouncedIncr(); - equal(a, 1); - equal(b, 1); - equal(c, 1); - equal(counter, 1, 'incr was called immediately'); - setTimeout(debouncedIncr, 30); - setTimeout(debouncedIncr, 60); - setTimeout(debouncedIncr, 90); - setTimeout(debouncedIncr, 120); - setTimeout(debouncedIncr, 150); - _.delay(function(){ equal(counter, 1, "incr was debounced"); start(); }, 220); - }); - - asyncTest("debounce asap recursively", 2, function() { - var counter = 0; - var debouncedIncr = _.debounce(function(){ - counter++; - if (counter < 5) debouncedIncr(); - }, 50, true); - debouncedIncr(); - equal(counter, 1, 'incr was called immediately'); - _.delay(function(){ equal(counter, 1, "incr was debounced"); start(); }, 70); - }); - - test("once", function() { - var num = 0; - var increment = _.once(function(){ num++; }); - increment(); - increment(); - equal(num, 1); - }); - - test("wrap", function() { - var greet = function(name){ return "hi: " + name; }; - var backwards = _.wrap(greet, function(func, name){ return func(name) + ' ' + name.split('').reverse().join(''); }); - equal(backwards('moe'), 'hi: moe eom', 'wrapped the saluation function'); - - var inner = function(){ return "Hello "; }; - var obj = {name : "Moe"}; - obj.hi = _.wrap(inner, function(fn){ return fn() + this.name; }); - equal(obj.hi(), "Hello Moe"); - - var noop = function(){}; - var wrapped = _.wrap(noop, function(fn){ return Array.prototype.slice.call(arguments, 0); }); - var ret = wrapped(['whats', 'your'], 'vector', 'victor'); - deepEqual(ret, [noop, ['whats', 'your'], 'vector', 'victor']); - }); - - test("compose", function() { - var greet = function(name){ return "hi: " + name; }; - var exclaim = function(sentence){ return sentence + '!'; }; - var composed = _.compose(exclaim, greet); - equal(composed('moe'), 'hi: moe!', 'can compose a function that takes another'); - - composed = _.compose(greet, exclaim); - equal(composed('moe'), 'hi: moe!', 'in this case, the functions are also commutative'); - }); - - test("after", function() { - var testAfter = function(afterAmount, timesCalled) { - var afterCalled = 0; - var after = _.after(afterAmount, function() { - afterCalled++; - }); - while (timesCalled--) after(); - return afterCalled; - }; - - equal(testAfter(5, 5), 1, "after(N) should fire after being called N times"); - equal(testAfter(5, 4), 0, "after(N) should not fire unless called N times"); - equal(testAfter(0, 0), 1, "after(0) should fire immediately"); - }); - -}); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html deleted file mode 100644 index 064fa98..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - Underscore Test Suite - - - - - - - - - - - - - - - - -
      -
      -
      -
      -
      -
      -
      -
      -

      Underscore Speed Suite

      -

      - A representative sample of the functions are benchmarked here, to provide - a sense of how fast they might run in different browsers. - Each iteration runs on an array of 1000 elements.

      - For example, the 'intersection' test measures the number of times you can - find the intersection of two thousand-element arrays in one second. -

      -
      - - - diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js deleted file mode 100644 index 22949c3..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js +++ /dev/null @@ -1,548 +0,0 @@ -$(document).ready(function() { - - module("Objects"); - - test("keys", function() { - equal(_.keys({one : 1, two : 2}).join(', '), 'one, two', 'can extract the keys from an object'); - // the test above is not safe because it relies on for-in enumeration order - var a = []; a[1] = 0; - equal(_.keys(a).join(', '), '1', 'is not fooled by sparse arrays; see issue #95'); - raises(function() { _.keys(null); }, TypeError, 'throws an error for `null` values'); - raises(function() { _.keys(void 0); }, TypeError, 'throws an error for `undefined` values'); - raises(function() { _.keys(1); }, TypeError, 'throws an error for number primitives'); - raises(function() { _.keys('a'); }, TypeError, 'throws an error for string primitives'); - raises(function() { _.keys(true); }, TypeError, 'throws an error for boolean primitives'); - }); - - test("values", function() { - equal(_.values({one: 1, two: 2}).join(', '), '1, 2', 'can extract the values from an object'); - equal(_.values({one: 1, two: 2, length: 3}).join(', '), '1, 2, 3', '... even when one of them is "length"'); - }); - - test("pairs", function() { - deepEqual(_.pairs({one: 1, two: 2}), [['one', 1], ['two', 2]], 'can convert an object into pairs'); - deepEqual(_.pairs({one: 1, two: 2, length: 3}), [['one', 1], ['two', 2], ['length', 3]], '... even when one of them is "length"'); - }); - - test("invert", function() { - var obj = {first: 'Moe', second: 'Larry', third: 'Curly'}; - equal(_.keys(_.invert(obj)).join(' '), 'Moe Larry Curly', 'can invert an object'); - ok(_.isEqual(_.invert(_.invert(obj)), obj), 'two inverts gets you back where you started'); - - var obj = {length: 3}; - ok(_.invert(obj)['3'] == 'length', 'can invert an object with "length"') - }); - - test("functions", function() { - var obj = {a : 'dash', b : _.map, c : (/yo/), d : _.reduce}; - ok(_.isEqual(['b', 'd'], _.functions(obj)), 'can grab the function names of any passed-in object'); - - var Animal = function(){}; - Animal.prototype.run = function(){}; - equal(_.functions(new Animal).join(''), 'run', 'also looks up functions on the prototype'); - }); - - test("extend", function() { - var result; - equal(_.extend({}, {a:'b'}).a, 'b', 'can extend an object with the attributes of another'); - equal(_.extend({a:'x'}, {a:'b'}).a, 'b', 'properties in source override destination'); - equal(_.extend({x:'x'}, {a:'b'}).x, 'x', 'properties not in source dont get overriden'); - result = _.extend({x:'x'}, {a:'a'}, {b:'b'}); - ok(_.isEqual(result, {x:'x', a:'a', b:'b'}), 'can extend from multiple source objects'); - result = _.extend({x:'x'}, {a:'a', x:2}, {a:'b'}); - ok(_.isEqual(result, {x:2, a:'b'}), 'extending from multiple source objects last property trumps'); - result = _.extend({}, {a: void 0, b: null}); - equal(_.keys(result).join(''), 'ab', 'extend does not copy undefined values'); - }); - - test("pick", function() { - var result; - result = _.pick({a:1, b:2, c:3}, 'a', 'c'); - ok(_.isEqual(result, {a:1, c:3}), 'can restrict properties to those named'); - result = _.pick({a:1, b:2, c:3}, ['b', 'c']); - ok(_.isEqual(result, {b:2, c:3}), 'can restrict properties to those named in an array'); - result = _.pick({a:1, b:2, c:3}, ['a'], 'b'); - ok(_.isEqual(result, {a:1, b:2}), 'can restrict properties to those named in mixed args'); - - var Obj = function(){}; - Obj.prototype = {a: 1, b: 2, c: 3}; - ok(_.isEqual(_.pick(new Obj, 'a', 'c'), {a:1, c: 3}), 'include prototype props'); - }); - - test("omit", function() { - var result; - result = _.omit({a:1, b:2, c:3}, 'b'); - ok(_.isEqual(result, {a:1, c:3}), 'can omit a single named property'); - result = _.omit({a:1, b:2, c:3}, 'a', 'c'); - ok(_.isEqual(result, {b:2}), 'can omit several named properties'); - result = _.omit({a:1, b:2, c:3}, ['b', 'c']); - ok(_.isEqual(result, {a:1}), 'can omit properties named in an array'); - - var Obj = function(){}; - Obj.prototype = {a: 1, b: 2, c: 3}; - ok(_.isEqual(_.omit(new Obj, 'b'), {a:1, c: 3}), 'include prototype props'); - }); - - test("defaults", function() { - var result; - var options = {zero: 0, one: 1, empty: "", nan: NaN, string: "string"}; - - _.defaults(options, {zero: 1, one: 10, twenty: 20}); - equal(options.zero, 0, 'value exists'); - equal(options.one, 1, 'value exists'); - equal(options.twenty, 20, 'default applied'); - - _.defaults(options, {empty: "full"}, {nan: "nan"}, {word: "word"}, {word: "dog"}); - equal(options.empty, "", 'value exists'); - ok(_.isNaN(options.nan), "NaN isn't overridden"); - equal(options.word, "word", 'new value is added, first one wins'); - }); - - test("clone", function() { - var moe = {name : 'moe', lucky : [13, 27, 34]}; - var clone = _.clone(moe); - equal(clone.name, 'moe', 'the clone as the attributes of the original'); - - clone.name = 'curly'; - ok(clone.name == 'curly' && moe.name == 'moe', 'clones can change shallow attributes without affecting the original'); - - clone.lucky.push(101); - equal(_.last(moe.lucky), 101, 'changes to deep attributes are shared with the original'); - - equal(_.clone(undefined), void 0, 'non objects should not be changed by clone'); - equal(_.clone(1), 1, 'non objects should not be changed by clone'); - equal(_.clone(null), null, 'non objects should not be changed by clone'); - }); - - test("isEqual", function() { - function First() { - this.value = 1; - } - First.prototype.value = 1; - function Second() { - this.value = 1; - } - Second.prototype.value = 2; - - // Basic equality and identity comparisons. - ok(_.isEqual(null, null), "`null` is equal to `null`"); - ok(_.isEqual(), "`undefined` is equal to `undefined`"); - - ok(!_.isEqual(0, -0), "`0` is not equal to `-0`"); - ok(!_.isEqual(-0, 0), "Commutative equality is implemented for `0` and `-0`"); - ok(!_.isEqual(null, undefined), "`null` is not equal to `undefined`"); - ok(!_.isEqual(undefined, null), "Commutative equality is implemented for `null` and `undefined`"); - - // String object and primitive comparisons. - ok(_.isEqual("Curly", "Curly"), "Identical string primitives are equal"); - ok(_.isEqual(new String("Curly"), new String("Curly")), "String objects with identical primitive values are equal"); - ok(_.isEqual(new String("Curly"), "Curly"), "String primitives and their corresponding object wrappers are equal"); - ok(_.isEqual("Curly", new String("Curly")), "Commutative equality is implemented for string objects and primitives"); - - ok(!_.isEqual("Curly", "Larry"), "String primitives with different values are not equal"); - ok(!_.isEqual(new String("Curly"), new String("Larry")), "String objects with different primitive values are not equal"); - ok(!_.isEqual(new String("Curly"), {toString: function(){ return "Curly"; }}), "String objects and objects with a custom `toString` method are not equal"); - - // Number object and primitive comparisons. - ok(_.isEqual(75, 75), "Identical number primitives are equal"); - ok(_.isEqual(new Number(75), new Number(75)), "Number objects with identical primitive values are equal"); - ok(_.isEqual(75, new Number(75)), "Number primitives and their corresponding object wrappers are equal"); - ok(_.isEqual(new Number(75), 75), "Commutative equality is implemented for number objects and primitives"); - ok(!_.isEqual(new Number(0), -0), "`new Number(0)` and `-0` are not equal"); - ok(!_.isEqual(0, new Number(-0)), "Commutative equality is implemented for `new Number(0)` and `-0`"); - - ok(!_.isEqual(new Number(75), new Number(63)), "Number objects with different primitive values are not equal"); - ok(!_.isEqual(new Number(63), {valueOf: function(){ return 63; }}), "Number objects and objects with a `valueOf` method are not equal"); - - // Comparisons involving `NaN`. - ok(_.isEqual(NaN, NaN), "`NaN` is equal to `NaN`"); - ok(!_.isEqual(61, NaN), "A number primitive is not equal to `NaN`"); - ok(!_.isEqual(new Number(79), NaN), "A number object is not equal to `NaN`"); - ok(!_.isEqual(Infinity, NaN), "`Infinity` is not equal to `NaN`"); - - // Boolean object and primitive comparisons. - ok(_.isEqual(true, true), "Identical boolean primitives are equal"); - ok(_.isEqual(new Boolean, new Boolean), "Boolean objects with identical primitive values are equal"); - ok(_.isEqual(true, new Boolean(true)), "Boolean primitives and their corresponding object wrappers are equal"); - ok(_.isEqual(new Boolean(true), true), "Commutative equality is implemented for booleans"); - ok(!_.isEqual(new Boolean(true), new Boolean), "Boolean objects with different primitive values are not equal"); - - // Common type coercions. - ok(!_.isEqual(true, new Boolean(false)), "Boolean objects are not equal to the boolean primitive `true`"); - ok(!_.isEqual("75", 75), "String and number primitives with like values are not equal"); - ok(!_.isEqual(new Number(63), new String(63)), "String and number objects with like values are not equal"); - ok(!_.isEqual(75, "75"), "Commutative equality is implemented for like string and number values"); - ok(!_.isEqual(0, ""), "Number and string primitives with like values are not equal"); - ok(!_.isEqual(1, true), "Number and boolean primitives with like values are not equal"); - ok(!_.isEqual(new Boolean(false), new Number(0)), "Boolean and number objects with like values are not equal"); - ok(!_.isEqual(false, new String("")), "Boolean primitives and string objects with like values are not equal"); - ok(!_.isEqual(12564504e5, new Date(2009, 9, 25)), "Dates and their corresponding numeric primitive values are not equal"); - - // Dates. - ok(_.isEqual(new Date(2009, 9, 25), new Date(2009, 9, 25)), "Date objects referencing identical times are equal"); - ok(!_.isEqual(new Date(2009, 9, 25), new Date(2009, 11, 13)), "Date objects referencing different times are not equal"); - ok(!_.isEqual(new Date(2009, 11, 13), { - getTime: function(){ - return 12606876e5; - } - }), "Date objects and objects with a `getTime` method are not equal"); - ok(!_.isEqual(new Date("Curly"), new Date("Curly")), "Invalid dates are not equal"); - - // Functions. - ok(!_.isEqual(First, Second), "Different functions with identical bodies and source code representations are not equal"); - - // RegExps. - ok(_.isEqual(/(?:)/gim, /(?:)/gim), "RegExps with equivalent patterns and flags are equal"); - ok(!_.isEqual(/(?:)/g, /(?:)/gi), "RegExps with equivalent patterns and different flags are not equal"); - ok(!_.isEqual(/Moe/gim, /Curly/gim), "RegExps with different patterns and equivalent flags are not equal"); - ok(!_.isEqual(/(?:)/gi, /(?:)/g), "Commutative equality is implemented for RegExps"); - ok(!_.isEqual(/Curly/g, {source: "Larry", global: true, ignoreCase: false, multiline: false}), "RegExps and RegExp-like objects are not equal"); - - // Empty arrays, array-like objects, and object literals. - ok(_.isEqual({}, {}), "Empty object literals are equal"); - ok(_.isEqual([], []), "Empty array literals are equal"); - ok(_.isEqual([{}], [{}]), "Empty nested arrays and objects are equal"); - ok(!_.isEqual({length: 0}, []), "Array-like objects and arrays are not equal."); - ok(!_.isEqual([], {length: 0}), "Commutative equality is implemented for array-like objects"); - - ok(!_.isEqual({}, []), "Object literals and array literals are not equal"); - ok(!_.isEqual([], {}), "Commutative equality is implemented for objects and arrays"); - - // Arrays with primitive and object values. - ok(_.isEqual([1, "Larry", true], [1, "Larry", true]), "Arrays containing identical primitives are equal"); - ok(_.isEqual([(/Moe/g), new Date(2009, 9, 25)], [(/Moe/g), new Date(2009, 9, 25)]), "Arrays containing equivalent elements are equal"); - - // Multi-dimensional arrays. - var a = [new Number(47), false, "Larry", /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}]; - var b = [new Number(47), false, "Larry", /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}]; - ok(_.isEqual(a, b), "Arrays containing nested arrays and objects are recursively compared"); - - // Overwrite the methods defined in ES 5.1 section 15.4.4. - a.forEach = a.map = a.filter = a.every = a.indexOf = a.lastIndexOf = a.some = a.reduce = a.reduceRight = null; - b.join = b.pop = b.reverse = b.shift = b.slice = b.splice = b.concat = b.sort = b.unshift = null; - - // Array elements and properties. - ok(_.isEqual(a, b), "Arrays containing equivalent elements and different non-numeric properties are equal"); - a.push("White Rocks"); - ok(!_.isEqual(a, b), "Arrays of different lengths are not equal"); - a.push("East Boulder"); - b.push("Gunbarrel Ranch", "Teller Farm"); - ok(!_.isEqual(a, b), "Arrays of identical lengths containing different elements are not equal"); - - // Sparse arrays. - ok(_.isEqual(Array(3), Array(3)), "Sparse arrays of identical lengths are equal"); - ok(!_.isEqual(Array(3), Array(6)), "Sparse arrays of different lengths are not equal when both are empty"); - - // Simple objects. - ok(_.isEqual({a: "Curly", b: 1, c: true}, {a: "Curly", b: 1, c: true}), "Objects containing identical primitives are equal"); - ok(_.isEqual({a: /Curly/g, b: new Date(2009, 11, 13)}, {a: /Curly/g, b: new Date(2009, 11, 13)}), "Objects containing equivalent members are equal"); - ok(!_.isEqual({a: 63, b: 75}, {a: 61, b: 55}), "Objects of identical sizes with different values are not equal"); - ok(!_.isEqual({a: 63, b: 75}, {a: 61, c: 55}), "Objects of identical sizes with different property names are not equal"); - ok(!_.isEqual({a: 1, b: 2}, {a: 1}), "Objects of different sizes are not equal"); - ok(!_.isEqual({a: 1}, {a: 1, b: 2}), "Commutative equality is implemented for objects"); - ok(!_.isEqual({x: 1, y: undefined}, {x: 1, z: 2}), "Objects with identical keys and different values are not equivalent"); - - // `A` contains nested objects and arrays. - a = { - name: new String("Moe Howard"), - age: new Number(77), - stooge: true, - hobbies: ["acting"], - film: { - name: "Sing a Song of Six Pants", - release: new Date(1947, 9, 30), - stars: [new String("Larry Fine"), "Shemp Howard"], - minutes: new Number(16), - seconds: 54 - } - }; - - // `B` contains equivalent nested objects and arrays. - b = { - name: new String("Moe Howard"), - age: new Number(77), - stooge: true, - hobbies: ["acting"], - film: { - name: "Sing a Song of Six Pants", - release: new Date(1947, 9, 30), - stars: [new String("Larry Fine"), "Shemp Howard"], - minutes: new Number(16), - seconds: 54 - } - }; - ok(_.isEqual(a, b), "Objects with nested equivalent members are recursively compared"); - - // Instances. - ok(_.isEqual(new First, new First), "Object instances are equal"); - ok(!_.isEqual(new First, new Second), "Objects with different constructors and identical own properties are not equal"); - ok(!_.isEqual({value: 1}, new First), "Object instances and objects sharing equivalent properties are not equal"); - ok(!_.isEqual({value: 2}, new Second), "The prototype chain of objects should not be examined"); - - // Circular Arrays. - (a = []).push(a); - (b = []).push(b); - ok(_.isEqual(a, b), "Arrays containing circular references are equal"); - a.push(new String("Larry")); - b.push(new String("Larry")); - ok(_.isEqual(a, b), "Arrays containing circular references and equivalent properties are equal"); - a.push("Shemp"); - b.push("Curly"); - ok(!_.isEqual(a, b), "Arrays containing circular references and different properties are not equal"); - - // More circular arrays #767. - a = ["everything is checked but", "this", "is not"]; - a[1] = a; - b = ["everything is checked but", ["this", "array"], "is not"]; - ok(!_.isEqual(a, b), "Comparison of circular references with non-circular references are not equal"); - - // Circular Objects. - a = {abc: null}; - b = {abc: null}; - a.abc = a; - b.abc = b; - ok(_.isEqual(a, b), "Objects containing circular references are equal"); - a.def = 75; - b.def = 75; - ok(_.isEqual(a, b), "Objects containing circular references and equivalent properties are equal"); - a.def = new Number(75); - b.def = new Number(63); - ok(!_.isEqual(a, b), "Objects containing circular references and different properties are not equal"); - - // More circular objects #767. - a = {everything: "is checked", but: "this", is: "not"}; - a.but = a; - b = {everything: "is checked", but: {that:"object"}, is: "not"}; - ok(!_.isEqual(a, b), "Comparison of circular references with non-circular object references are not equal"); - - // Cyclic Structures. - a = [{abc: null}]; - b = [{abc: null}]; - (a[0].abc = a).push(a); - (b[0].abc = b).push(b); - ok(_.isEqual(a, b), "Cyclic structures are equal"); - a[0].def = "Larry"; - b[0].def = "Larry"; - ok(_.isEqual(a, b), "Cyclic structures containing equivalent properties are equal"); - a[0].def = new String("Larry"); - b[0].def = new String("Curly"); - ok(!_.isEqual(a, b), "Cyclic structures containing different properties are not equal"); - - // Complex Circular References. - a = {foo: {b: {foo: {c: {foo: null}}}}}; - b = {foo: {b: {foo: {c: {foo: null}}}}}; - a.foo.b.foo.c.foo = a; - b.foo.b.foo.c.foo = b; - ok(_.isEqual(a, b), "Cyclic structures with nested and identically-named properties are equal"); - - // Chaining. - ok(!_.isEqual(_({x: 1, y: undefined}).chain(), _({x: 1, z: 2}).chain()), 'Chained objects containing different values are not equal'); - equal(_({x: 1, y: 2}).chain().isEqual(_({x: 1, y: 2}).chain()).value(), true, '`isEqual` can be chained'); - - // Custom `isEqual` methods. - var isEqualObj = {isEqual: function (o) { return o.isEqual == this.isEqual; }, unique: {}}; - var isEqualObjClone = {isEqual: isEqualObj.isEqual, unique: {}}; - - ok(_.isEqual(isEqualObj, isEqualObjClone), 'Both objects implement identical `isEqual` methods'); - ok(_.isEqual(isEqualObjClone, isEqualObj), 'Commutative equality is implemented for objects with custom `isEqual` methods'); - ok(!_.isEqual(isEqualObj, {}), 'Objects that do not implement equivalent `isEqual` methods are not equal'); - ok(!_.isEqual({}, isEqualObj), 'Commutative equality is implemented for objects with different `isEqual` methods'); - - // Objects from another frame. - ok(_.isEqual({}, iObject)); - }); - - test("isEmpty", function() { - ok(!_([1]).isEmpty(), '[1] is not empty'); - ok(_.isEmpty([]), '[] is empty'); - ok(!_.isEmpty({one : 1}), '{one : 1} is not empty'); - ok(_.isEmpty({}), '{} is empty'); - ok(_.isEmpty(new RegExp('')), 'objects with prototype properties are empty'); - ok(_.isEmpty(null), 'null is empty'); - ok(_.isEmpty(), 'undefined is empty'); - ok(_.isEmpty(''), 'the empty string is empty'); - ok(!_.isEmpty('moe'), 'but other strings are not'); - - var obj = {one : 1}; - delete obj.one; - ok(_.isEmpty(obj), 'deleting all the keys from an object empties it'); - }); - - // Setup remote variables for iFrame tests. - var iframe = document.createElement('iframe'); - jQuery(iframe).appendTo(document.body); - var iDoc = iframe.contentDocument || iframe.contentWindow.document; - iDoc.write( - "" - ); - iDoc.close(); - - test("isElement", function() { - ok(!_.isElement('div'), 'strings are not dom elements'); - ok(_.isElement($('html')[0]), 'the html tag is a DOM element'); - ok(_.isElement(iElement), 'even from another frame'); - }); - - test("isArguments", function() { - var args = (function(){ return arguments; })(1, 2, 3); - ok(!_.isArguments('string'), 'a string is not an arguments object'); - ok(!_.isArguments(_.isArguments), 'a function is not an arguments object'); - ok(_.isArguments(args), 'but the arguments object is an arguments object'); - ok(!_.isArguments(_.toArray(args)), 'but not when it\'s converted into an array'); - ok(!_.isArguments([1,2,3]), 'and not vanilla arrays.'); - ok(_.isArguments(iArguments), 'even from another frame'); - }); - - test("isObject", function() { - ok(_.isObject(arguments), 'the arguments object is object'); - ok(_.isObject([1, 2, 3]), 'and arrays'); - ok(_.isObject($('html')[0]), 'and DOM element'); - ok(_.isObject(iElement), 'even from another frame'); - ok(_.isObject(function () {}), 'and functions'); - ok(_.isObject(iFunction), 'even from another frame'); - ok(!_.isObject(null), 'but not null'); - ok(!_.isObject(undefined), 'and not undefined'); - ok(!_.isObject('string'), 'and not string'); - ok(!_.isObject(12), 'and not number'); - ok(!_.isObject(true), 'and not boolean'); - ok(_.isObject(new String('string')), 'but new String()'); - }); - - test("isArray", function() { - ok(!_.isArray(arguments), 'the arguments object is not an array'); - ok(_.isArray([1, 2, 3]), 'but arrays are'); - ok(_.isArray(iArray), 'even from another frame'); - }); - - test("isString", function() { - ok(!_.isString(document.body), 'the document body is not a string'); - ok(_.isString([1, 2, 3].join(', ')), 'but strings are'); - ok(_.isString(iString), 'even from another frame'); - }); - - test("isNumber", function() { - ok(!_.isNumber('string'), 'a string is not a number'); - ok(!_.isNumber(arguments), 'the arguments object is not a number'); - ok(!_.isNumber(undefined), 'undefined is not a number'); - ok(_.isNumber(3 * 4 - 7 / 10), 'but numbers are'); - ok(_.isNumber(NaN), 'NaN *is* a number'); - ok(_.isNumber(Infinity), 'Infinity is a number'); - ok(_.isNumber(iNumber), 'even from another frame'); - ok(!_.isNumber('1'), 'numeric strings are not numbers'); - }); - - test("isBoolean", function() { - ok(!_.isBoolean(2), 'a number is not a boolean'); - ok(!_.isBoolean("string"), 'a string is not a boolean'); - ok(!_.isBoolean("false"), 'the string "false" is not a boolean'); - ok(!_.isBoolean("true"), 'the string "true" is not a boolean'); - ok(!_.isBoolean(arguments), 'the arguments object is not a boolean'); - ok(!_.isBoolean(undefined), 'undefined is not a boolean'); - ok(!_.isBoolean(NaN), 'NaN is not a boolean'); - ok(!_.isBoolean(null), 'null is not a boolean'); - ok(_.isBoolean(true), 'but true is'); - ok(_.isBoolean(false), 'and so is false'); - ok(_.isBoolean(iBoolean), 'even from another frame'); - }); - - test("isFunction", function() { - ok(!_.isFunction([1, 2, 3]), 'arrays are not functions'); - ok(!_.isFunction('moe'), 'strings are not functions'); - ok(_.isFunction(_.isFunction), 'but functions are'); - ok(_.isFunction(iFunction), 'even from another frame'); - }); - - test("isDate", function() { - ok(!_.isDate(100), 'numbers are not dates'); - ok(!_.isDate({}), 'objects are not dates'); - ok(_.isDate(new Date()), 'but dates are'); - ok(_.isDate(iDate), 'even from another frame'); - }); - - test("isRegExp", function() { - ok(!_.isRegExp(_.identity), 'functions are not RegExps'); - ok(_.isRegExp(/identity/), 'but RegExps are'); - ok(_.isRegExp(iRegExp), 'even from another frame'); - }); - - test("isFinite", function() { - ok(!_.isFinite(undefined), 'undefined is not Finite'); - ok(!_.isFinite(null), 'null is not Finite'); - ok(!_.isFinite(NaN), 'NaN is not Finite'); - ok(!_.isFinite(Infinity), 'Infinity is not Finite'); - ok(!_.isFinite(-Infinity), '-Infinity is not Finite'); - ok(!_.isFinite('12'), 'Strings are not numbers'); - var obj = new Number(5); - ok(_.isFinite(obj), 'Number instances can be finite'); - ok(_.isFinite(0), '0 is Finite'); - ok(_.isFinite(123), 'Ints are Finite'); - ok(_.isFinite(-12.44), 'Floats are Finite'); - }); - - test("isNaN", function() { - ok(!_.isNaN(undefined), 'undefined is not NaN'); - ok(!_.isNaN(null), 'null is not NaN'); - ok(!_.isNaN(0), '0 is not NaN'); - ok(_.isNaN(NaN), 'but NaN is'); - ok(_.isNaN(iNaN), 'even from another frame'); - ok(_.isNaN(new Number(NaN)), 'wrapped NaN is still NaN'); - }); - - test("isNull", function() { - ok(!_.isNull(undefined), 'undefined is not null'); - ok(!_.isNull(NaN), 'NaN is not null'); - ok(_.isNull(null), 'but null is'); - ok(_.isNull(iNull), 'even from another frame'); - }); - - test("isUndefined", function() { - ok(!_.isUndefined(1), 'numbers are defined'); - ok(!_.isUndefined(null), 'null is defined'); - ok(!_.isUndefined(false), 'false is defined'); - ok(!_.isUndefined(NaN), 'NaN is defined'); - ok(_.isUndefined(), 'nothing is undefined'); - ok(_.isUndefined(undefined), 'undefined is undefined'); - ok(_.isUndefined(iUndefined), 'even from another frame'); - }); - - if (window.ActiveXObject) { - test("IE host objects", function() { - var xml = new ActiveXObject("Msxml2.DOMDocument.3.0"); - ok(!_.isNumber(xml)); - ok(!_.isBoolean(xml)); - ok(!_.isNaN(xml)); - ok(!_.isFunction(xml)); - ok(!_.isNull(xml)); - ok(!_.isUndefined(xml)); - }); - } - - test("tap", function() { - var intercepted = null; - var interceptor = function(obj) { intercepted = obj; }; - var returned = _.tap(1, interceptor); - equal(intercepted, 1, "passes tapped object to interceptor"); - equal(returned, 1, "returns tapped object"); - - returned = _([1,2,3]).chain(). - map(function(n){ return n * 2; }). - max(). - tap(interceptor). - value(); - ok(returned == 6 && intercepted == 6, 'can use tapped objects in a chain'); - }); -}); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js deleted file mode 100644 index 05e3f2a..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js +++ /dev/null @@ -1,75 +0,0 @@ -(function() { - - var numbers = []; - for (var i=0; i<1000; i++) numbers.push(i); - var objects = _.map(numbers, function(n){ return {num : n}; }); - var randomized = _.sortBy(numbers, function(){ return Math.random(); }); - var deep = _.map(_.range(100), function() { return _.range(1000); }); - - JSLitmus.test('_.each()', function() { - var timesTwo = []; - _.each(numbers, function(num){ timesTwo.push(num * 2); }); - return timesTwo; - }); - - JSLitmus.test('_(list).each()', function() { - var timesTwo = []; - _(numbers).each(function(num){ timesTwo.push(num * 2); }); - return timesTwo; - }); - - JSLitmus.test('jQuery.each()', function() { - var timesTwo = []; - jQuery.each(numbers, function(){ timesTwo.push(this * 2); }); - return timesTwo; - }); - - JSLitmus.test('_.map()', function() { - return _.map(objects, function(obj){ return obj.num; }); - }); - - JSLitmus.test('jQuery.map()', function() { - return jQuery.map(objects, function(obj){ return obj.num; }); - }); - - JSLitmus.test('_.pluck()', function() { - return _.pluck(objects, 'num'); - }); - - JSLitmus.test('_.uniq()', function() { - return _.uniq(randomized); - }); - - JSLitmus.test('_.uniq() (sorted)', function() { - return _.uniq(numbers, true); - }); - - JSLitmus.test('_.sortBy()', function() { - return _.sortBy(numbers, function(num){ return -num; }); - }); - - JSLitmus.test('_.isEqual()', function() { - return _.isEqual(numbers, randomized); - }); - - JSLitmus.test('_.keys()', function() { - return _.keys(objects); - }); - - JSLitmus.test('_.values()', function() { - return _.values(objects); - }); - - JSLitmus.test('_.intersection()', function() { - return _.intersection(numbers, randomized); - }); - - JSLitmus.test('_.range()', function() { - return _.range(1000); - }); - - JSLitmus.test('_.flatten()', function() { - return _.flatten(deep); - }); - -})(); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js deleted file mode 100644 index c9be20a..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js +++ /dev/null @@ -1,249 +0,0 @@ -$(document).ready(function() { - - var templateSettings; - - module("Utility", { - - setup: function() { - templateSettings = _.clone(_.templateSettings); - }, - - teardown: function() { - _.templateSettings = templateSettings; - } - - }); - - test("#750 - Return _ instance.", 2, function() { - var instance = _([]); - ok(_(instance) === instance); - ok(new _(instance) === instance); - }); - - test("identity", function() { - var moe = {name : 'moe'}; - equal(_.identity(moe), moe, 'moe is the same as his identity'); - }); - - test("uniqueId", function() { - var ids = [], i = 0; - while(i++ < 100) ids.push(_.uniqueId()); - equal(_.uniq(ids).length, ids.length, 'can generate a globally-unique stream of ids'); - }); - - test("times", function() { - var vals = []; - _.times(3, function (i) { vals.push(i); }); - ok(_.isEqual(vals, [0,1,2]), "is 0 indexed"); - // - vals = []; - _(3).times(function (i) { vals.push(i); }); - ok(_.isEqual(vals, [0,1,2]), "works as a wrapper"); - }); - - test("mixin", function() { - _.mixin({ - myReverse: function(string) { - return string.split('').reverse().join(''); - } - }); - equal(_.myReverse('panacea'), 'aecanap', 'mixed in a function to _'); - equal(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper'); - }); - - test("_.escape", function() { - equal(_.escape("Curly & Moe"), "Curly & Moe"); - equal(_.escape("Curly & Moe"), "Curly &amp; Moe"); - equal(_.escape(null), ''); - }); - - test("_.unescape", function() { - var string = "Curly & Moe"; - equal(_.unescape("Curly & Moe"), string); - equal(_.unescape("Curly &amp; Moe"), "Curly & Moe"); - equal(_.unescape(null), ''); - equal(_.unescape(_.escape(string)), string); - }); - - test("template", function() { - var basicTemplate = _.template("<%= thing %> is gettin' on my noives!"); - var result = basicTemplate({thing : 'This'}); - equal(result, "This is gettin' on my noives!", 'can do basic attribute interpolation'); - - var sansSemicolonTemplate = _.template("A <% this %> B"); - equal(sansSemicolonTemplate(), "A B"); - - var backslashTemplate = _.template("<%= thing %> is \\ridanculous"); - equal(backslashTemplate({thing: 'This'}), "This is \\ridanculous"); - - var escapeTemplate = _.template('<%= a ? "checked=\\"checked\\"" : "" %>'); - equal(escapeTemplate({a: true}), 'checked="checked"', 'can handle slash escapes in interpolations.'); - - var fancyTemplate = _.template(""); - result = fancyTemplate({people : {moe : "Moe", larry : "Larry", curly : "Curly"}}); - equal(result, "", 'can run arbitrary javascript in templates'); - - var escapedCharsInJavascriptTemplate = _.template(""); - result = escapedCharsInJavascriptTemplate({numbers: "one\ntwo\nthree\nfour"}); - equal(result, "", 'Can use escaped characters (e.g. \\n) in Javascript'); - - var namespaceCollisionTemplate = _.template("<%= pageCount %> <%= thumbnails[pageCount] %> <% _.each(thumbnails, function(p) { %>
      \">
      <% }); %>"); - result = namespaceCollisionTemplate({ - pageCount: 3, - thumbnails: { - 1: "p1-thumbnail.gif", - 2: "p2-thumbnail.gif", - 3: "p3-thumbnail.gif" - } - }); - equal(result, "3 p3-thumbnail.gif
      "); - - var noInterpolateTemplate = _.template("

      Just some text. Hey, I know this is silly but it aids consistency.

      "); - result = noInterpolateTemplate(); - equal(result, "

      Just some text. Hey, I know this is silly but it aids consistency.

      "); - - var quoteTemplate = _.template("It's its, not it's"); - equal(quoteTemplate({}), "It's its, not it's"); - - var quoteInStatementAndBody = _.template("<%\ - if(foo == 'bar'){ \ - %>Statement quotes and 'quotes'.<% } %>"); - equal(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'."); - - var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.'); - equal(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.'); - - var template = _.template("<%- value %>"); - var result = template({value: " - - - diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5..0000000 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./underscore'); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json index 014ab26..11c7175 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json @@ -15,21 +15,55 @@ }, "repository": { "type": "git", - "url": "git://github.com/documentcloud/underscore.git" + "url": "git://github.com/jashkenas/underscore.git" }, "main": "underscore.js", - "version": "1.4.4", + "version": "1.7.0", "devDependencies": { - "phantomjs": "0.2.2" + "docco": "0.6.x", + "phantomjs": "1.9.7-1", + "uglify-js": "2.4.x", + "eslint": "0.6.x" }, "scripts": { - "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" + "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true && eslint underscore.js test/*.js test/vendor/runner.js", + "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js", + "doc": "docco underscore.js" }, - "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n", - "readmeFilename": "README.md", + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/jashkenas/underscore/master/LICENSE" + } + ], + "files": [ + "underscore.js", + "underscore-min.js", + "LICENSE" + ], + "gitHead": "da996e665deb0b69b257e80e3e257c04fde4191c", "bugs": { - "url": "https://github.com/documentcloud/underscore/issues" + "url": "https://github.com/jashkenas/underscore/issues" }, - "_id": "underscore@1.4.4", - "_from": "underscore@~1.4.3" + "_id": "underscore@1.7.0", + "_shasum": "6bbaf0877500d36be34ecaa584e0db9fef035209", + "_from": "underscore@>=1.7.0 <1.8.0", + "_npmVersion": "1.4.24", + "_npmUser": { + "name": "jashkenas", + "email": "jashkenas@gmail.com" + }, + "maintainers": [ + { + "name": "jashkenas", + "email": "jashkenas@gmail.com" + } + ], + "dist": { + "shasum": "6bbaf0877500d36be34ecaa584e0db9fef035209", + "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js index c1d9d3a..11f1d96 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js @@ -1 +1,6 @@ -(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.indexi;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i},w.bind=function(n,t){if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);return 0===t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var M={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};M.unescape=w.invert(M.escape);var S={escape:RegExp("["+w.keys(M.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(M.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(S[n],function(t){return M[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); \ No newline at end of file +// Underscore.js 1.7.0 +// http://underscorejs.org +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. +(function(){var n=this,t=n._,r=Array.prototype,e=Object.prototype,u=Function.prototype,i=r.push,a=r.slice,o=r.concat,l=e.toString,c=e.hasOwnProperty,f=Array.isArray,s=Object.keys,p=u.bind,h=function(n){return n instanceof h?n:this instanceof h?void(this._wrapped=n):new h(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=h),exports._=h):n._=h,h.VERSION="1.7.0";var g=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}};h.iteratee=function(n,t,r){return null==n?h.identity:h.isFunction(n)?g(n,t,r):h.isObject(n)?h.matches(n):h.property(n)},h.each=h.forEach=function(n,t,r){if(null==n)return n;t=g(t,r);var e,u=n.length;if(u===+u)for(e=0;u>e;e++)t(n[e],e,n);else{var i=h.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},h.map=h.collect=function(n,t,r){if(null==n)return[];t=h.iteratee(t,r);for(var e,u=n.length!==+n.length&&h.keys(n),i=(u||n).length,a=Array(i),o=0;i>o;o++)e=u?u[o]:o,a[o]=t(n[e],e,n);return a};var v="Reduce of empty array with no initial value";h.reduce=h.foldl=h.inject=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length,o=0;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[o++]:o++]}for(;a>o;o++)u=i?i[o]:o,r=t(r,n[u],u,n);return r},h.reduceRight=h.foldr=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[--a]:--a]}for(;a--;)u=i?i[a]:a,r=t(r,n[u],u,n);return r},h.find=h.detect=function(n,t,r){var e;return t=h.iteratee(t,r),h.some(n,function(n,r,u){return t(n,r,u)?(e=n,!0):void 0}),e},h.filter=h.select=function(n,t,r){var e=[];return null==n?e:(t=h.iteratee(t,r),h.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e)},h.reject=function(n,t,r){return h.filter(n,h.negate(h.iteratee(t)),r)},h.every=h.all=function(n,t,r){if(null==n)return!0;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,!t(n[u],u,n))return!1;return!0},h.some=h.any=function(n,t,r){if(null==n)return!1;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,t(n[u],u,n))return!0;return!1},h.contains=h.include=function(n,t){return null==n?!1:(n.length!==+n.length&&(n=h.values(n)),h.indexOf(n,t)>=0)},h.invoke=function(n,t){var r=a.call(arguments,2),e=h.isFunction(t);return h.map(n,function(n){return(e?t:n[t]).apply(n,r)})},h.pluck=function(n,t){return h.map(n,h.property(t))},h.where=function(n,t){return h.filter(n,h.matches(t))},h.findWhere=function(n,t){return h.find(n,h.matches(t))},h.max=function(n,t,r){var e,u,i=-1/0,a=-1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],e>i&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(u>a||u===-1/0&&i===-1/0)&&(i=n,a=u)});return i},h.min=function(n,t,r){var e,u,i=1/0,a=1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],i>e&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(a>u||1/0===u&&1/0===i)&&(i=n,a=u)});return i},h.shuffle=function(n){for(var t,r=n&&n.length===+n.length?n:h.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=h.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},h.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=h.values(n)),n[h.random(n.length-1)]):h.shuffle(n).slice(0,Math.max(0,t))},h.sortBy=function(n,t,r){return t=h.iteratee(t,r),h.pluck(h.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var m=function(n){return function(t,r,e){var u={};return r=h.iteratee(r,e),h.each(t,function(e,i){var a=r(e,i,t);n(u,e,a)}),u}};h.groupBy=m(function(n,t,r){h.has(n,r)?n[r].push(t):n[r]=[t]}),h.indexBy=m(function(n,t,r){n[r]=t}),h.countBy=m(function(n,t,r){h.has(n,r)?n[r]++:n[r]=1}),h.sortedIndex=function(n,t,r,e){r=h.iteratee(r,e,1);for(var u=r(t),i=0,a=n.length;a>i;){var o=i+a>>>1;r(n[o])t?[]:a.call(n,0,t)},h.initial=function(n,t,r){return a.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},h.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:a.call(n,Math.max(n.length-t,0))},h.rest=h.tail=h.drop=function(n,t,r){return a.call(n,null==t||r?1:t)},h.compact=function(n){return h.filter(n,h.identity)};var y=function(n,t,r,e){if(t&&h.every(n,h.isArray))return o.apply(e,n);for(var u=0,a=n.length;a>u;u++){var l=n[u];h.isArray(l)||h.isArguments(l)?t?i.apply(e,l):y(l,t,r,e):r||e.push(l)}return e};h.flatten=function(n,t){return y(n,t,!1,[])},h.without=function(n){return h.difference(n,a.call(arguments,1))},h.uniq=h.unique=function(n,t,r,e){if(null==n)return[];h.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=h.iteratee(r,e));for(var u=[],i=[],a=0,o=n.length;o>a;a++){var l=n[a];if(t)a&&i===l||u.push(l),i=l;else if(r){var c=r(l,a,n);h.indexOf(i,c)<0&&(i.push(c),u.push(l))}else h.indexOf(u,l)<0&&u.push(l)}return u},h.union=function(){return h.uniq(y(arguments,!0,!0,[]))},h.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!h.contains(t,i)){for(var a=1;r>a&&h.contains(arguments[a],i);a++);a===r&&t.push(i)}}return t},h.difference=function(n){var t=y(a.call(arguments,1),!0,!0,[]);return h.filter(n,function(n){return!h.contains(t,n)})},h.zip=function(n){if(null==n)return[];for(var t=h.max(arguments,"length").length,r=Array(t),e=0;t>e;e++)r[e]=h.pluck(arguments,e);return r},h.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},h.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=h.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}for(;u>e;e++)if(n[e]===t)return e;return-1},h.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=n.length;for("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1));--e>=0;)if(n[e]===t)return e;return-1},h.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var d=function(){};h.bind=function(n,t){var r,e;if(p&&n.bind===p)return p.apply(n,a.call(arguments,1));if(!h.isFunction(n))throw new TypeError("Bind must be called on a function");return r=a.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(a.call(arguments)));d.prototype=n.prototype;var u=new d;d.prototype=null;var i=n.apply(u,r.concat(a.call(arguments)));return h.isObject(i)?i:u}},h.partial=function(n){var t=a.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===h&&(e[u]=arguments[r++]);for(;r=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=h.bind(n[r],n);return n},h.memoize=function(n,t){var r=function(e){var u=r.cache,i=t?t.apply(this,arguments):e;return h.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},h.delay=function(n,t){var r=a.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},h.defer=function(n){return h.delay.apply(h,[n,1].concat(a.call(arguments,1)))},h.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var l=function(){o=r.leading===!1?0:h.now(),a=null,i=n.apply(e,u),a||(e=u=null)};return function(){var c=h.now();o||r.leading!==!1||(o=c);var f=t-(c-o);return e=this,u=arguments,0>=f||f>t?(clearTimeout(a),a=null,o=c,i=n.apply(e,u),a||(e=u=null)):a||r.trailing===!1||(a=setTimeout(l,f)),i}},h.debounce=function(n,t,r){var e,u,i,a,o,l=function(){var c=h.now()-a;t>c&&c>0?e=setTimeout(l,t-c):(e=null,r||(o=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,a=h.now();var c=r&&!e;return e||(e=setTimeout(l,t)),c&&(o=n.apply(i,u),i=u=null),o}},h.wrap=function(n,t){return h.partial(t,n)},h.negate=function(n){return function(){return!n.apply(this,arguments)}},h.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},h.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},h.before=function(n,t){var r;return function(){return--n>0?r=t.apply(this,arguments):t=null,r}},h.once=h.partial(h.before,2),h.keys=function(n){if(!h.isObject(n))return[];if(s)return s(n);var t=[];for(var r in n)h.has(n,r)&&t.push(r);return t},h.values=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},h.pairs=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},h.invert=function(n){for(var t={},r=h.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},h.functions=h.methods=function(n){var t=[];for(var r in n)h.isFunction(n[r])&&t.push(r);return t.sort()},h.extend=function(n){if(!h.isObject(n))return n;for(var t,r,e=1,u=arguments.length;u>e;e++){t=arguments[e];for(r in t)c.call(t,r)&&(n[r]=t[r])}return n},h.pick=function(n,t,r){var e,u={};if(null==n)return u;if(h.isFunction(t)){t=g(t,r);for(e in n){var i=n[e];t(i,e,n)&&(u[e]=i)}}else{var l=o.apply([],a.call(arguments,1));n=new Object(n);for(var c=0,f=l.length;f>c;c++)e=l[c],e in n&&(u[e]=n[e])}return u},h.omit=function(n,t,r){if(h.isFunction(t))t=h.negate(t);else{var e=h.map(o.apply([],a.call(arguments,1)),String);t=function(n,t){return!h.contains(e,t)}}return h.pick(n,t,r)},h.defaults=function(n){if(!h.isObject(n))return n;for(var t=1,r=arguments.length;r>t;t++){var e=arguments[t];for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n},h.clone=function(n){return h.isObject(n)?h.isArray(n)?n.slice():h.extend({},n):n},h.tap=function(n,t){return t(n),n};var b=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof h&&(n=n._wrapped),t instanceof h&&(t=t._wrapped);var u=l.call(n);if(u!==l.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]===n)return e[i]===t;var a=n.constructor,o=t.constructor;if(a!==o&&"constructor"in n&&"constructor"in t&&!(h.isFunction(a)&&a instanceof a&&h.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c,f;if("[object Array]"===u){if(c=n.length,f=c===t.length)for(;c--&&(f=b(n[c],t[c],r,e)););}else{var s,p=h.keys(n);if(c=p.length,f=h.keys(t).length===c)for(;c--&&(s=p[c],f=h.has(t,s)&&b(n[s],t[s],r,e)););}return r.pop(),e.pop(),f};h.isEqual=function(n,t){return b(n,t,[],[])},h.isEmpty=function(n){if(null==n)return!0;if(h.isArray(n)||h.isString(n)||h.isArguments(n))return 0===n.length;for(var t in n)if(h.has(n,t))return!1;return!0},h.isElement=function(n){return!(!n||1!==n.nodeType)},h.isArray=f||function(n){return"[object Array]"===l.call(n)},h.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},h.each(["Arguments","Function","String","Number","Date","RegExp"],function(n){h["is"+n]=function(t){return l.call(t)==="[object "+n+"]"}}),h.isArguments(arguments)||(h.isArguments=function(n){return h.has(n,"callee")}),"function"!=typeof/./&&(h.isFunction=function(n){return"function"==typeof n||!1}),h.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},h.isNaN=function(n){return h.isNumber(n)&&n!==+n},h.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===l.call(n)},h.isNull=function(n){return null===n},h.isUndefined=function(n){return n===void 0},h.has=function(n,t){return null!=n&&c.call(n,t)},h.noConflict=function(){return n._=t,this},h.identity=function(n){return n},h.constant=function(n){return function(){return n}},h.noop=function(){},h.property=function(n){return function(t){return t[n]}},h.matches=function(n){var t=h.pairs(n),r=t.length;return function(n){if(null==n)return!r;n=new Object(n);for(var e=0;r>e;e++){var u=t[e],i=u[0];if(u[1]!==n[i]||!(i in n))return!1}return!0}},h.times=function(n,t,r){var e=Array(Math.max(0,n));t=g(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},h.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},h.now=Date.now||function(){return(new Date).getTime()};var _={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},w=h.invert(_),j=function(n){var t=function(t){return n[t]},r="(?:"+h.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};h.escape=j(_),h.unescape=j(w),h.result=function(n,t){if(null==n)return void 0;var r=n[t];return h.isFunction(r)?n[t]():r};var x=0;h.uniqueId=function(n){var t=++x+"";return n?n+t:t},h.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var A=/(.)^/,k={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\u2028|\u2029/g,F=function(n){return"\\"+k[n]};h.template=function(n,t,r){!t&&r&&(t=r),t=h.defaults({},t,h.templateSettings);var e=RegExp([(t.escape||A).source,(t.interpolate||A).source,(t.evaluate||A).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,a,o){return i+=n.slice(u,o).replace(O,F),u=o+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=new Function(t.variable||"obj","_",i)}catch(o){throw o.source=i,o}var l=function(n){return a.call(this,n,h)},c=t.variable||"obj";return l.source="function("+c+"){\n"+i+"}",l},h.chain=function(n){var t=h(n);return t._chain=!0,t};var E=function(n){return this._chain?h(n).chain():n};h.mixin=function(n){h.each(h.functions(n),function(t){var r=h[t]=n[t];h.prototype[t]=function(){var n=[this._wrapped];return i.apply(n,arguments),E.call(this,r.apply(h,n))}})},h.mixin(h),h.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=r[n];h.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],E.call(this,r)}}),h.each(["concat","join","slice"],function(n){var t=r[n];h.prototype[n]=function(){return E.call(this,t.apply(this._wrapped,arguments))}}),h.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return h})}).call(this); +//# sourceMappingURL=underscore-min.map \ No newline at end of file diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js index a12f0d9..b4f49a0 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js @@ -1,6 +1,6 @@ -// Underscore.js 1.4.4 +// Underscore.js 1.7.0 // http://underscorejs.org -// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. (function() { @@ -8,37 +8,26 @@ // Baseline setup // -------------- - // Establish the root object, `window` in the browser, or `global` on the server. + // Establish the root object, `window` in the browser, or `exports` on the server. var root = this; // Save the previous value of the `_` variable. var previousUnderscore = root._; - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - // Save bytes in the minified (but not gzipped) version: var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; + var + push = ArrayProto.push, + slice = ArrayProto.slice, + concat = ArrayProto.concat, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; // All **ECMAScript 5** native function implementations that we hope to use // are declared here. var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, nativeIsArray = Array.isArray, nativeKeys = Object.keys, nativeBind = FuncProto.bind; @@ -52,8 +41,7 @@ // Export the Underscore object for **Node.js**, with // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. + // the browser, add `_` as a global object. if (typeof exports !== 'undefined') { if (typeof module !== 'undefined' && module.exports) { exports = module.exports = _; @@ -64,98 +52,125 @@ } // Current version. - _.VERSION = '1.4.4'; + _.VERSION = '1.7.0'; + + // Internal function that returns an efficient (for current engines) version + // of the passed-in callback, to be repeatedly applied in other Underscore + // functions. + var createCallback = function(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + case 2: return function(value, other) { + return func.call(context, value, other); + }; + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; + } + return function() { + return func.apply(context, arguments); + }; + }; + + // A mostly-internal function to generate callbacks that can be applied + // to each element in a collection, returning the desired result — either + // identity, an arbitrary callback, a property matcher, or a property accessor. + _.iteratee = function(value, context, argCount) { + if (value == null) return _.identity; + if (_.isFunction(value)) return createCallback(value, context, argCount); + if (_.isObject(value)) return _.matches(value); + return _.property(value); + }; // Collection Functions // -------------------- // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; + // Handles raw objects in addition to array-likes. Treats all + // sparse array-likes as if they were dense. + _.each = _.forEach = function(obj, iteratee, context) { + if (obj == null) return obj; + iteratee = createCallback(iteratee, context); + var i, length = obj.length; + if (length === +length) { + for (i = 0; i < length; i++) { + iteratee(obj[i], i, obj); } } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } + var keys = _.keys(obj); + for (i = 0, length = keys.length; i < length; i++) { + iteratee(obj[keys[i]], keys[i], obj); } } + return obj; }; - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); + // Return the results of applying the iteratee to each element. + _.map = _.collect = function(obj, iteratee, context) { + if (obj == null) return []; + iteratee = _.iteratee(iteratee, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + results = Array(length), + currentKey; + for (var index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); + } return results; }; var reduceError = 'Reduce of empty array with no initial value'; // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; + // or `foldl`. + _.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) { if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); + iteratee = createCallback(iteratee, context, 4); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index = 0, currentKey; + if (arguments.length < 3) { + if (!length) throw new TypeError(reduceError); + memo = obj[keys ? keys[index++] : index++]; + } + for (; index < length; index++) { + currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); return memo; }; // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; + _.reduceRight = _.foldr = function(obj, iteratee, memo, context) { if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); + iteratee = createCallback(iteratee, context, 4); + var keys = obj.length !== + obj.length && _.keys(obj), + index = (keys || obj).length, + currentKey; + if (arguments.length < 3) { + if (!index) throw new TypeError(reduceError); + memo = obj[keys ? keys[--index] : --index]; } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; + while (index--) { + currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); return memo; }; // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { + _.find = _.detect = function(obj, predicate, context) { var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { + predicate = _.iteratee(predicate, context); + _.some(obj, function(value, index, list) { + if (predicate(value, index, list)) { result = value; return true; } @@ -164,61 +179,58 @@ }; // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { + _.filter = _.select = function(obj, predicate, context) { var results = []; if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; + predicate = _.iteratee(predicate, context); + _.each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); }); return results; }; // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); - }, context); + _.reject = function(obj, predicate, context) { + return _.filter(obj, _.negate(_.iteratee(predicate)), context); }; // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; + _.every = _.all = function(obj, predicate, context) { + if (obj == null) return true; + predicate = _.iteratee(predicate, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index, currentKey; + for (index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; + } + return true; }; // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; + _.some = _.any = function(obj, predicate, context) { + if (obj == null) return false; + predicate = _.iteratee(predicate, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index, currentKey; + for (index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; }; // Determine if the array or object contains a given value (using `===`). // Aliased as `include`. _.contains = _.include = function(obj, target) { if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); + if (obj.length !== +obj.length) obj = _.values(obj); + return _.indexOf(obj, target) >= 0; }; // Invoke a method (with arguments) on every item in a collection. @@ -232,83 +244,104 @@ // Convenience version of a common use case of `map`: fetching a property. _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); + return _.map(obj, _.property(key)); }; // Convenience version of a common use case of `filter`: selecting only objects // containing specific `key:value` pairs. - _.where = function(obj, attrs, first) { - if (_.isEmpty(attrs)) return first ? null : []; - return _[first ? 'find' : 'filter'](obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); + _.where = function(obj, attrs) { + return _.filter(obj, _.matches(attrs)); }; // Convenience version of a common use case of `find`: getting the first object // containing specific `key:value` pairs. _.findWhere = function(obj, attrs) { - return _.where(obj, attrs, true); + return _.find(obj, _.matches(attrs)); }; - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See: https://bugs.webkit.org/show_bug.cgi?id=80797 - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); + // Return the maximum element (or element-based computation). + _.max = function(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = obj.length === +obj.length ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value > result) { + result = value; + } + } + } else { + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = value; + lastComputed = computed; + } + }); } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity, value: -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; + return result; }; // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); + _.min = function(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = obj.length === +obj.length ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value < result) { + result = value; + } + } + } else { + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = value; + lastComputed = computed; + } + }); } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity, value: Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; + return result; }; - // Shuffle an array. + // Shuffle a collection, using the modern version of the + // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); + var set = obj && obj.length === +obj.length ? obj : _.values(obj); + var length = set.length; + var shuffled = Array(length); + for (var index = 0, rand; index < length; index++) { + rand = _.random(0, index); + if (rand !== index) shuffled[index] = shuffled[rand]; + shuffled[rand] = set[index]; + } return shuffled; }; - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; + // Sample **n** random values from a collection. + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `map`. + _.sample = function(obj, n, guard) { + if (n == null || guard) { + if (obj.length !== +obj.length) obj = _.values(obj); + return obj[_.random(obj.length - 1)]; + } + return _.shuffle(obj).slice(0, Math.max(0, n)); }; - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); + // Sort the object's values by a criterion produced by an iteratee. + _.sortBy = function(obj, iteratee, context) { + iteratee = _.iteratee(iteratee, context); return _.pluck(_.map(obj, function(value, index, list) { return { - value : value, - index : index, - criteria : iterator.call(context, value, index, list) + value: value, + index: index, + criteria: iteratee(value, index, list) }; }).sort(function(left, right) { var a = left.criteria; @@ -317,53 +350,56 @@ if (a > b || a === void 0) return 1; if (a < b || b === void 0) return -1; } - return left.index < right.index ? -1 : 1; + return left.index - right.index; }), 'value'); }; // An internal function used for aggregate "group by" operations. - var group = function(obj, value, context, behavior) { - var result = {}; - var iterator = lookupIterator(value || _.identity); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; + var group = function(behavior) { + return function(obj, iteratee, context) { + var result = {}; + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); + }); + return result; + }; }; // Groups the object's values by a criterion. Pass either a string attribute // to group by, or a function that returns the criterion. - _.groupBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - }; + _.groupBy = group(function(result, value, key) { + if (_.has(result, key)) result[key].push(value); else result[key] = [value]; + }); + + // Indexes the object's values by a criterion, similar to `groupBy`, but for + // when you know that your index values will be unique. + _.indexBy = group(function(result, value, key) { + result[key] = value; + }); // Counts instances of an object that group by a certain criterion. Pass // either a string attribute to count by, or a function that returns the // criterion. - _.countBy = function(obj, value, context) { - return group(obj, value, context, function(result, key) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; + _.countBy = group(function(result, value, key) { + if (_.has(result, key)) result[key]++; else result[key] = 1; + }); // Use a comparator function to figure out the smallest index at which // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); - var value = iterator.call(context, obj); + _.sortedIndex = function(array, obj, iteratee, context) { + iteratee = _.iteratee(iteratee, context, 1); + var value = iteratee(obj); var low = 0, high = array.length; while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; + var mid = low + high >>> 1; + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; } return low; }; - // Safely convert anything iterable into a real, live array. + // Safely create a real, live array from anything iterable. _.toArray = function(obj) { if (!obj) return []; if (_.isArray(obj)) return slice.call(obj); @@ -374,7 +410,18 @@ // Return the number of elements in an object. _.size = function(obj) { if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; + return obj.length === +obj.length ? obj.length : _.keys(obj).length; + }; + + // Split a collection into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(obj, predicate, context) { + predicate = _.iteratee(predicate, context); + var pass = [], fail = []; + _.each(obj, function(value, key, obj) { + (predicate(value, key, obj) ? pass : fail).push(value); + }); + return [pass, fail]; }; // Array Functions @@ -385,7 +432,9 @@ // allows it to work with `_.map`. _.first = _.head = _.take = function(array, n, guard) { if (array == null) return void 0; - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; + if (n == null || guard) return array[0]; + if (n < 0) return []; + return slice.call(array, 0, n); }; // Returns everything but the last entry of the array. Especially useful on @@ -393,18 +442,15 @@ // the array, excluding the last N. The **guard** check allows it to work with // `_.map`. _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); }; // Get the last element of an array. Passing **n** will return the last N // values in the array. The **guard** check allows it to work with `_.map`. _.last = function(array, n, guard) { if (array == null) return void 0; - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } + if (n == null || guard) return array[array.length - 1]; + return slice.call(array, Math.max(array.length - n, 0)); }; // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. @@ -412,7 +458,7 @@ // the rest N values in the array. The **guard** // check allows it to work with `_.map`. _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); + return slice.call(array, n == null || guard ? 1 : n); }; // Trim out all falsy values from an array. @@ -421,20 +467,26 @@ }; // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - each(input, function(value) { - if (_.isArray(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); + var flatten = function(input, shallow, strict, output) { + if (shallow && _.every(input, _.isArray)) { + return concat.apply(output, input); + } + for (var i = 0, length = input.length; i < length; i++) { + var value = input[i]; + if (!_.isArray(value) && !_.isArguments(value)) { + if (!strict) output.push(value); + } else if (shallow) { + push.apply(output, value); } else { - output.push(value); + flatten(value, shallow, strict, output); } - }); + } return output; }; - // Return a completely flattened version of an array. + // Flatten out an array, either recursively (by default), or just one level. _.flatten = function(array, shallow) { - return flatten(array, shallow, []); + return flatten(array, shallow, false, []); }; // Return a version of the array that does not contain the specified value(s). @@ -445,56 +497,74 @@ // Produce a duplicate-free version of the array. If the array has already // been sorted, you have the option of using a faster algorithm. // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; + _.uniq = _.unique = function(array, isSorted, iteratee, context) { + if (array == null) return []; + if (!_.isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; isSorted = false; } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; + if (iteratee != null) iteratee = _.iteratee(iteratee, context); + var result = []; var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); + for (var i = 0, length = array.length; i < length; i++) { + var value = array[i]; + if (isSorted) { + if (!i || seen !== value) result.push(value); + seen = value; + } else if (iteratee) { + var computed = iteratee(value, i, array); + if (_.indexOf(seen, computed) < 0) { + seen.push(computed); + result.push(value); + } + } else if (_.indexOf(result, value) < 0) { + result.push(value); } - }); - return results; + } + return result; }; // Produce an array that contains the union: each distinct element from all of // the passed-in arrays. _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); + return _.uniq(flatten(arguments, true, true, [])); }; // Produce an array that contains every item shared between all the // passed-in arrays. _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); + if (array == null) return []; + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = array.length; i < length; i++) { + var item = array[i]; + if (_.contains(result, item)) continue; + for (var j = 1; j < argsLength; j++) { + if (!_.contains(arguments[j], item)) break; + } + if (j === argsLength) result.push(item); + } + return result; }; // Take the difference between one array and a number of other arrays. // Only the elements present in just the first array will remain. _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); + var rest = flatten(slice.call(arguments, 1), true, true, []); + return _.filter(array, function(value){ + return !_.contains(rest, value); + }); }; // Zip together multiple lists into a single array -- elements that share // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); + _.zip = function(array) { + if (array == null) return []; + var length = _.max(arguments, 'length').length; + var results = Array(length); for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); + results[i] = _.pluck(arguments, i); } return results; }; @@ -505,7 +575,7 @@ _.object = function(list, values) { if (list == null) return {}; var result = {}; - for (var i = 0, l = list.length; i < l; i++) { + for (var i = 0, length = list.length; i < length; i++) { if (values) { result[list[i]] = values[i]; } else { @@ -515,37 +585,32 @@ return result; }; - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. + // Return the position of the first occurrence of an item in an array, + // or -1 if the item is not included in the array. // If the array is large and already in sort order, pass `true` // for **isSorted** to use binary search. _.indexOf = function(array, item, isSorted) { if (array == null) return -1; - var i = 0, l = array.length; + var i = 0, length = array.length; if (isSorted) { if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); + i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted; } else { i = _.sortedIndex(array, item); return array[i] === item ? i : -1; } } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < l; i++) if (array[i] === item) return i; + for (; i < length; i++) if (array[i] === item) return i; return -1; }; - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. _.lastIndexOf = function(array, item, from) { if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); + var idx = array.length; + if (typeof from == 'number') { + idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1); } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; + while (--idx >= 0) if (array[idx] === item) return idx; return -1; }; @@ -557,15 +622,13 @@ stop = start || 0; start = 0; } - step = arguments[2] || 1; + step = step || 1; - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); + var length = Math.max(Math.ceil((stop - start) / step), 0); + var range = Array(length); - while(idx < len) { - range[idx++] = start; - start += step; + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; } return range; @@ -574,50 +637,77 @@ // Function (ahem) Functions // ------------------ + // Reusable constructor function for prototype setting. + var Ctor = function(){}; + // Create a function bound to a given object (assigning `this`, and arguments, // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if // available. _.bind = function(func, context) { - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - var args = slice.call(arguments, 2); - return function() { - return func.apply(context, args.concat(slice.call(arguments))); + var args, bound; + if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); + args = slice.call(arguments, 2); + bound = function() { + if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); + Ctor.prototype = func.prototype; + var self = new Ctor; + Ctor.prototype = null; + var result = func.apply(self, args.concat(slice.call(arguments))); + if (_.isObject(result)) return result; + return self; }; + return bound; }; // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. + // arguments pre-filled, without changing its dynamic `this` context. _ acts + // as a placeholder, allowing any combination of arguments to be pre-filled. _.partial = function(func) { - var args = slice.call(arguments, 1); + var boundArgs = slice.call(arguments, 1); return function() { - return func.apply(this, args.concat(slice.call(arguments))); + var position = 0; + var args = boundArgs.slice(); + for (var i = 0, length = args.length; i < length; i++) { + if (args[i] === _) args[i] = arguments[position++]; + } + while (position < arguments.length) args.push(arguments[position++]); + return func.apply(this, args); }; }; - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); + var i, length = arguments.length, key; + if (length <= 1) throw new Error('bindAll must be passed function names'); + for (i = 1; i < length; i++) { + key = arguments[i]; + obj[key] = _.bind(obj[key], obj); + } return obj; }; // Memoize an expensive function by storing its results. _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); + var memoize = function(key) { + var cache = memoize.cache; + var address = hasher ? hasher.apply(this, arguments) : key; + if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; }; + memoize.cache = {}; + return memoize; }; // Delays a function for the given number of milliseconds, and then calls // it with the arguments supplied. _.delay = function(func, wait) { var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); + return setTimeout(function(){ + return func.apply(null, args); + }, wait); }; // Defers a function, scheduling it to run after the current call stack has @@ -627,26 +717,34 @@ }; // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, result; + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. + _.throttle = function(func, wait, options) { + var context, args, result; + var timeout = null; var previous = 0; + if (!options) options = {}; var later = function() { - previous = new Date; + previous = options.leading === false ? 0 : _.now(); timeout = null; result = func.apply(context, args); + if (!timeout) context = args = null; }; return function() { - var now = new Date; + var now = _.now(); + if (!previous && options.leading === false) previous = now; var remaining = wait - (now - previous); context = this; args = arguments; - if (remaining <= 0) { + if (remaining <= 0 || remaining > wait) { clearTimeout(timeout); timeout = null; previous = now; result = func.apply(context, args); - } else if (!timeout) { + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } return result; @@ -658,31 +756,34 @@ // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. _.debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) result = func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); - return result; - }; - }; + var timeout, args, context, timestamp, result; + + var later = function() { + var last = _.now() - timestamp; + + if (last < wait && last > 0) { + timeout = setTimeout(later, wait - last); + } else { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + if (!timeout) context = args = null; + } + } + }; - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; + context = this; + args = arguments; + timestamp = _.now(); + var callNow = immediate && !timeout; + if (!timeout) timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + + return result; }; }; @@ -690,29 +791,31 @@ // allowing you to adjust arguments, run code before and after, and // conditionally execute the original function. _.wrap = function(func, wrapper) { + return _.partial(wrapper, func); + }; + + // Returns a negated version of the passed-in predicate. + _.negate = function(predicate) { return function() { - var args = [func]; - push.apply(args, arguments); - return wrapper.apply(this, args); + return !predicate.apply(this, arguments); }; }; // Returns a function that is the composition of a list of functions, each // consuming the return value of the function that follows. _.compose = function() { - var funcs = arguments; + var args = arguments; + var start = args.length - 1; return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; + var i = start; + var result = args[start].apply(this, arguments); + while (i--) result = args[i].call(this, result); + return result; }; }; // Returns a function that will only be executed after being called N times. _.after = function(times, func) { - if (times <= 0) return func(); return function() { if (--times < 1) { return func.apply(this, arguments); @@ -720,36 +823,65 @@ }; }; + // Returns a function that will only be executed before being called N times. + _.before = function(times, func) { + var memo; + return function() { + if (--times > 0) { + memo = func.apply(this, arguments); + } else { + func = null; + } + return memo; + }; + }; + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = _.partial(_.before, 2); + // Object Functions // ---------------- // Retrieve the names of an object's properties. // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); + _.keys = function(obj) { + if (!_.isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; + for (var key in obj) if (_.has(obj, key)) keys.push(key); return keys; }; // Retrieve the values of an object's properties. _.values = function(obj) { - var values = []; - for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); + var keys = _.keys(obj); + var length = keys.length; + var values = Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[keys[i]]; + } return values; }; // Convert an object into a list of `[key, value]` pairs. _.pairs = function(obj) { - var pairs = []; - for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); + var keys = _.keys(obj); + var length = keys.length; + var pairs = Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [keys[i], obj[keys[i]]]; + } return pairs; }; // Invert the keys and values of an object. The values must be serializable. _.invert = function(obj) { var result = {}; - for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + result[obj[keys[i]]] = keys[i]; + } return result; }; @@ -765,45 +897,62 @@ // Extend a given object with all the properties in passed-in object(s). _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; + if (!_.isObject(obj)) return obj; + var source, prop; + for (var i = 1, length = arguments.length; i < length; i++) { + source = arguments[i]; + for (prop in source) { + if (hasOwnProperty.call(source, prop)) { + obj[prop] = source[prop]; } } - }); + } return obj; }; // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; + _.pick = function(obj, iteratee, context) { + var result = {}, key; + if (obj == null) return result; + if (_.isFunction(iteratee)) { + iteratee = createCallback(iteratee, context); + for (key in obj) { + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; + } + } else { + var keys = concat.apply([], slice.call(arguments, 1)); + obj = new Object(obj); + for (var i = 0, length = keys.length; i < length; i++) { + key = keys[i]; + if (key in obj) result[key] = obj[key]; + } + } + return result; }; // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; + _.omit = function(obj, iteratee, context) { + if (_.isFunction(iteratee)) { + iteratee = _.negate(iteratee); + } else { + var keys = _.map(concat.apply([], slice.call(arguments, 1)), String); + iteratee = function(value, key) { + return !_.contains(keys, key); + }; } - return copy; + return _.pick(obj, iteratee, context); }; // Fill in a given object with default properties. _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } + if (!_.isObject(obj)) return obj; + for (var i = 1, length = arguments.length; i < length; i++) { + var source = arguments[i]; + for (var prop in source) { + if (obj[prop] === void 0) obj[prop] = source[prop]; } - }); + } return obj; }; @@ -824,8 +973,8 @@ // Internal recursive comparison function for `isEqual`. var eq = function(a, b, aStack, bStack) { // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; // A strict comparison is necessary because `null == undefined`. if (a == null || b == null) return a === b; // Unwrap any wrapped objects. @@ -833,29 +982,27 @@ if (b instanceof _) b = b._wrapped; // Compare `[[Class]]` names. var className = toString.call(a); - if (className != toString.call(b)) return false; + if (className !== toString.call(b)) return false; switch (className) { - // Strings, numbers, dates, and booleans are compared by value. + // Strings, numbers, regular expressions, dates, and booleans are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') case '[object String]': // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is // equivalent to `new String("5")`. - return a == String(b); + return '' + a === '' + b; case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; case '[object Date]': case '[object Boolean]': // Coerce dates and booleans to numeric primitive values. Dates are compared by their // millisecond representations. Note that invalid dates with millisecond representations // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; + return +a === +b; } if (typeof a != 'object' || typeof b != 'object') return false; // Assume equality for cyclic structures. The algorithm for detecting cyclic @@ -864,17 +1011,29 @@ while (length--) { // Linear search. Performance is inversely proportional to the number of // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; + if (aStack[length] === a) return bStack[length] === b; + } + // Objects with different constructors are not equivalent, but `Object`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if ( + aCtor !== bCtor && + // Handle Object.create(x) cases + 'constructor' in a && 'constructor' in b && + !(_.isFunction(aCtor) && aCtor instanceof aCtor && + _.isFunction(bCtor) && bCtor instanceof bCtor) + ) { + return false; } // Add the first object to the stack of traversed objects. aStack.push(a); bStack.push(b); - var size = 0, result = true; + var size, result; // Recursively compare objects and arrays. - if (className == '[object Array]') { + if (className === '[object Array]') { // Compare array lengths to determine if a deep comparison is necessary. size = a.length; - result = size == b.length; + result = size === b.length; if (result) { // Deep compare the contents, ignoring non-numeric properties. while (size--) { @@ -882,29 +1041,18 @@ } } } else { - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor))) { - return false; - } // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. + var keys = _.keys(a), key; + size = keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + result = _.keys(b).length === size; + if (result) { + while (size--) { + // Deep compare each member + key = keys[size]; if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; } } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } } // Remove the first object from the stack of traversed objects. aStack.pop(); @@ -921,7 +1069,7 @@ // An "empty" object has no enumerable own-properties. _.isEmpty = function(obj) { if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; + if (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) return obj.length === 0; for (var key in obj) if (_.has(obj, key)) return false; return true; }; @@ -934,18 +1082,19 @@ // Is a given value an array? // Delegates to ECMA5's native Array.isArray _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; + return toString.call(obj) === '[object Array]'; }; // Is a given variable an object? _.isObject = function(obj) { - return obj === Object(obj); + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; }; // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { + _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; + return toString.call(obj) === '[object ' + name + ']'; }; }); @@ -953,14 +1102,14 @@ // there isn't any inspectable "Arguments" type. if (!_.isArguments(arguments)) { _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); + return _.has(obj, 'callee'); }; } - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { + // Optimize `isFunction` if appropriate. Work around an IE 11 bug. + if (typeof /./ !== 'function') { _.isFunction = function(obj) { - return typeof obj === 'function'; + return typeof obj == 'function' || false; }; } @@ -971,12 +1120,12 @@ // Is the given value `NaN`? (NaN is the only number which does not equal itself). _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; + return _.isNumber(obj) && obj !== +obj; }; // Is a given value a boolean? _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; }; // Is a given value equal to null? @@ -992,7 +1141,7 @@ // Shortcut function for checking if an object has a given property directly // on itself (in other words, not on a prototype). _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); + return obj != null && hasOwnProperty.call(obj, key); }; // Utility Functions @@ -1005,15 +1154,44 @@ return this; }; - // Keep the identity function around for default iterators. + // Keep the identity function around for default iteratees. _.identity = function(value) { return value; }; + _.constant = function(value) { + return function() { + return value; + }; + }; + + _.noop = function(){}; + + _.property = function(key) { + return function(obj) { + return obj[key]; + }; + }; + + // Returns a predicate for checking whether an object has a given set of `key:value` pairs. + _.matches = function(attrs) { + var pairs = _.pairs(attrs), length = pairs.length; + return function(obj) { + if (obj == null) return !length; + obj = new Object(obj); + for (var i = 0; i < length; i++) { + var pair = pairs[i], key = pair[0]; + if (pair[1] !== obj[key] || !(key in obj)) return false; + } + return true; + }; + }; + // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(n); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); + _.times = function(n, iteratee, context) { + var accum = Array(Math.max(0, n)); + iteratee = createCallback(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); return accum; }; @@ -1026,53 +1204,45 @@ return min + Math.floor(Math.random() * (max - min + 1)); }; - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/' - } + // A (possibly faster) way to get the current timestamp as an integer. + _.now = Date.now || function() { + return new Date().getTime(); }; - entityMap.unescape = _.invert(entityMap.escape); - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') + // List of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' }; + var unescapeMap = _.invert(escapeMap); // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); + var createEscaper = function(map) { + var escaper = function(match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped + var source = '(?:' + _.keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; }; - }); - - // If the value of the named property is a function then invoke it; - // otherwise, return it. - _.result = function(object, property) { - if (object == null) return null; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; }; + _.escape = createEscaper(escapeMap); + _.unescape = createEscaper(unescapeMap); - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); + // If the value of the named `property` is a function then invoke it with the + // `object` as context; otherwise, return it. + _.result = function(object, property) { + if (object == null) return void 0; + var value = object[property]; + return _.isFunction(value) ? object[property]() : value; }; // Generate a unique integer id (unique within the entire client session). @@ -1103,22 +1273,26 @@ '\\': '\\', '\r': 'r', '\n': 'n', - '\t': 't', '\u2028': 'u2028', '\u2029': 'u2029' }; - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; + var escaper = /\\|'|\r|\n|\u2028|\u2029/g; + + var escapeChar = function(match) { + return '\\' + escapes[match]; + }; // JavaScript micro-templating, similar to John Resig's implementation. // Underscore templating handles arbitrary delimiters, preserves whitespace, // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; + // NB: `oldSettings` only exists for backwards compatibility. + _.template = function(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; settings = _.defaults({}, settings, _.templateSettings); // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ + var matcher = RegExp([ (settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source @@ -1128,19 +1302,18 @@ var index = 0; var source = "__p+='"; text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); + source += text.slice(index, offset).replace(escaper, escapeChar); + index = offset + match.length; if (escape) { source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { + } else if (interpolate) { source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { + } else if (evaluate) { source += "';\n" + evaluate + "\n__p+='"; } - index = offset + match.length; + + // Adobe VMs need the match returned to produce the correct offest. return match; }); source += "';\n"; @@ -1150,29 +1323,31 @@ source = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; + source + 'return __p;\n'; try { - render = new Function(settings.variable || 'obj', '_', source); + var render = new Function(settings.variable || 'obj', '_', source); } catch (e) { e.source = source; throw e; } - if (data) return render(data, _); var template = function(data) { return render.call(this, data, _); }; - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; + // Provide the compiled source as a convenience for precompilation. + var argument = settings.variable || 'obj'; + template.source = 'function(' + argument + '){\n' + source + '}'; return template; }; - // Add a "chain" function, which will delegate to the wrapper. + // Add a "chain" function. Start chaining a wrapped Underscore object. _.chain = function(obj) { - return _(obj).chain(); + var instance = _(obj); + instance._chain = true; + return instance; }; // OOP @@ -1186,41 +1361,55 @@ return this._chain ? _(obj).chain() : obj; }; + // Add your own custom functions to the Underscore object. + _.mixin = function(obj) { + _.each(_.functions(obj), function(name) { + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return result.call(this, func.apply(_, args)); + }; + }); + }; + // Add all of the Underscore functions to the wrapper object. _.mixin(_); // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { var obj = this._wrapped; method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; + if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; return result.call(this, obj); }; }); // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { + _.each(['concat', 'join', 'slice'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { return result.call(this, method.apply(this._wrapped, arguments)); }; }); - _.extend(_.prototype, { + // Extracts the result from a wrapped and chained object. + _.prototype.value = function() { + return this._wrapped; + }; - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - -}).call(this); + // AMD registration happens at the end for compatibility with AMD loaders + // that may not enforce next-turn semantics on modules. Even though general + // practice for AMD registration is to be anonymous, underscore registers + // as a named module because, like jQuery, it is a base library that is + // popular enough to be bundled in a third party lib, but not be part of + // an AMD load request. Those cases could generate an error when an + // anonymous define() is called outside of a loader request. + if (typeof define === 'function' && define.amd) { + define('underscore', [], function() { + return _; + }); + } +}.call(this)); diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/package.json index 09382f8..b64aac3 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/package.json @@ -1,7 +1,7 @@ { "name": "argparse", "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", - "version": "0.1.15", + "version": "0.1.16", "keywords": [ "cli", "parser", @@ -21,10 +21,7 @@ "bugs": { "url": "https://github.com/nodeca/argparse/issues" }, - "license": { - "type": "MIT", - "url": "https://github.com/nodeca/argparse/blob/master/LICENSE" - }, + "license": "MIT", "repository": { "type": "git", "url": "git://github.com/nodeca/argparse.git" @@ -34,17 +31,32 @@ "test": "make test" }, "dependencies": { - "underscore": "~1.4.3", - "underscore.string": "~2.3.1" + "underscore": "~1.7.0", + "underscore.string": "~2.4.0" }, "devDependencies": { "mocha": "*" }, - "engines": { - "node": ">= 0.6.0" + "gitHead": "9c32eb1405d5d4b5686087d95bac010774979659", + "_id": "argparse@0.1.16", + "_shasum": "cfd01e0fbba3d6caed049fbd758d40f65196f57c", + "_from": "argparse@>=0.1.11 <0.2.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" }, - "readme": "argparse\n========\n\n[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse)\n\nCLI arguments parser for node.js. Javascript port of python's\n[argparse](http://docs.python.org/dev/library/argparse.html) module\n(original version 3.2). That's a full port, except some very rare options,\nrecorded in issue tracker.\n\n**NB.** Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).\n\n\nExample\n=======\n\ntest.js file:\n\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse example'\n});\nparser.addArgument(\n [ '-f', '--foo' ],\n {\n help: 'foo bar'\n }\n);\nparser.addArgument(\n [ '-b', '--bar' ],\n {\n help: 'bar foo'\n }\n);\nvar args = parser.parseArgs();\nconsole.dir(args);\n```\n\nDisplay help:\n\n```\n$ ./test.js -h\nusage: example.js [-h] [-v] [-f FOO] [-b BAR]\n\nArgparse example\n\nOptional arguments:\n -h, --help Show this help message and exit.\n -v, --version Show program's version number and exit.\n -f FOO, --foo FOO foo bar\n -b BAR, --bar BAR bar foo\n```\n\nParse arguments:\n\n```\n$ ./test.js -f=3 --bar=4\n{ foo: '3', bar: '4' }\n```\n\nMore [examples](https://github.com/nodeca/argparse/tree/master/examples).\n\n\nArgumentParser objects\n======================\n\n```\nnew ArgumentParser({paramters hash});\n```\n\nCreates a new ArgumentParser object.\n\n**Supported params:**\n\n- ```description``` - Text to display before the argument help.\n- ```epilog``` - Text to display after the argument help.\n- ```addHelp``` - Add a -h/–help option to the parser. (default: True)\n- ```argumentDefault``` - Set the global default value for arguments. (default: None)\n- ```parents``` - A list of ArgumentParser objects whose arguments should also be included.\n- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘)\n- ```formatterClass``` - A class for customizing the help output.\n- ```prog``` - The name of the program (default: sys.argv[0])\n- ```usage``` - The string describing the program usage (default: generated)\n- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.\n\n**Not supportied yet**\n\n- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.\n\n\nDetails in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)\n\n\naddArgument() method\n====================\n\n```\nArgumentParser.addArgument([names or flags], {options})\n```\n\nDefines how a single command-line argument should be parsed.\n\n- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -f, --foo.\n\nOptions:\n\n- ```action``` - The basic type of action to be taken when this argument is encountered at the command line.\n- ```nargs```- The number of command-line arguments that should be consumed.\n- ```constant``` - A constant value required by some action and nargs selections.\n- ```defaultValue``` - The value produced if the argument is absent from the command line.\n- ```type``` - The type to which the command-line argument should be converted.\n- ```choices``` - A container of the allowable values for the argument.\n- ```required``` - Whether or not the command-line option may be omitted (optionals only).\n- ```help``` - A brief description of what the argument does.\n- ```metavar``` - A name for the argument in usage messages.\n- ```dest``` - The name of the attribute to be added to the object returned by parseArgs().\n\nDetails in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)\n\n\nAction (some details)\n================\n\nArgumentParser objects associate command-line arguments with actions.\nThese actions can do just about anything with the command-line arguments associated\nwith them, though most actions simply add an attribute to the object returned by\nparseArgs(). The action keyword argument specifies how the command-line arguments\nshould be handled. The supported actions are:\n\n- ```store``` - Just stores the argument’s value. This is the default action.\n- ```storeConst``` - Stores value, specified by the const keyword argument.\n (Note that the const keyword argument defaults to the rather unhelpful None.)\n The 'storeConst' action is most commonly used with optional arguments, that\n specify some sort of flag.\n- ```storeTrue``` and ```storeFalse``` - Stores values True and False\n respectively. These are special cases of 'storeConst'.\n- ```append``` - Stores a list, and appends each argument value to the list.\n This is useful to allow an option to be specified multiple times.\n- ```appendConst``` - Stores a list, and appends value, specified by the\n const keyword argument to the list. (Note, that the const keyword argument defaults\n is None.) The 'appendConst' action is typically used when multiple arguments need\n to store constants to the same list.\n- ```count``` - Counts the number of times a keyword argument occurs. For example,\n used for increasing verbosity levels.\n- ```help``` - Prints a complete help message for all the options in the current\n parser and then exits. By default a help action is automatically added to the parser.\n See ArgumentParser for details of how the output is created.\n- ```version``` - Prints version information and exit. Expects a `version=`\n keyword argument in the addArgument() call.\n\nDetails in [original action guide](http://docs.python.org/dev/library/argparse.html#action)\n\n\nSub-commands\n============\n\nArgumentParser.addSubparsers()\n\nMany programs split their functionality into a number of sub-commands, for\nexample, the svn program can invoke sub-commands like `svn checkout`, `svn update`,\nand `svn commit`. Splitting up functionality this way can be a particularly good\nidea when a program performs several different functions which require different\nkinds of command-line arguments. `ArgumentParser` supports creation of such\nsub-commands with `addSubparsers()` method. The `addSubparsers()` method is\nnormally called with no arguments and returns an special action object.\nThis object has a single method `addParser()`, which takes a command name and\nany `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object\nthat can be modified as usual.\n\nExample:\n\nsub_commands.js\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse examples: sub-commands',\n});\n\nvar subparsers = parser.addSubparsers({\n title:'subcommands',\n dest:\"subcommand_name\"\n});\n\nvar bar = subparsers.addParser('c1', {addHelp:true});\nbar.addArgument(\n [ '-f', '--foo' ],\n {\n action: 'store',\n help: 'foo3 bar3'\n }\n);\nvar bar = subparsers.addParser(\n 'c2',\n {aliases:['co'], addHelp:true}\n);\nbar.addArgument(\n [ '-b', '--bar' ],\n {\n action: 'store',\n type: 'int',\n help: 'foo3 bar3'\n }\n);\n\nvar args = parser.parseArgs();\nconsole.dir(args);\n\n```\n\nDetails in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)\n\n\nContributors\n============\n\n- [Eugene Shkuropat](https://github.com/shkuropat)\n- [Paul Jacobson](https://github.com/hpaulj)\n\n[others](https://github.com/nodeca/argparse/graphs/contributors)\n\nLicense\n=======\n\nCopyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).\nReleased under the MIT license. See\n[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.\n\n\n", - "readmeFilename": "README.md", - "_id": "argparse@0.1.15", - "_from": "argparse@~ 0.1.11" + "maintainers": [ + { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + } + ], + "dist": { + "shasum": "cfd01e0fbba3d6caed049fbd758d40f65196f57c", + "tarball": "http://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/esprima/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/esprima/package.json index 9a2294a..b1c65c5 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/esprima/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/esprima/package.json @@ -55,5 +55,5 @@ "url": "https://github.com/ariya/esprima/issues" }, "_id": "esprima@1.0.4", - "_from": "esprima@~ 1.0.2" + "_from": "esprima@>=1.0.2 <1.1.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/package.json index 1c32464..c698c72 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/package.json @@ -1,6 +1,6 @@ { "name": "js-yaml", - "version": "3.2.3", + "version": "3.2.5", "description": "YAML 1.2 parser and serializer", "keywords": [ "yaml", @@ -57,11 +57,11 @@ "browser": { "buffer": false }, - "gitHead": "a6cd5657603496c7128d3b9fa621ce9274283194", - "_id": "js-yaml@3.2.3", + "gitHead": "8a73181030e075b208c8f4065a4888a786365ae2", + "_id": "js-yaml@3.2.5", "scripts": {}, - "_shasum": "a3af632d13df5bfa95f3b8f3c4b61efe212cd750", - "_from": "js-yaml@3.x", + "_shasum": "c29ee9a9e503e7ab83f071ccacdd0dac25ff9e22", + "_from": "js-yaml@>=3.0.0 <4.0.0", "_npmVersion": "1.4.28", "_npmUser": { "name": "vitaly", @@ -74,9 +74,10 @@ } ], "dist": { - "shasum": "a3af632d13df5bfa95f3b8f3c4b61efe212cd750", - "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.2.3.tgz" + "shasum": "c29ee9a9e503e7ab83f071ccacdd0dac25ff9e22", + "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.2.5.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.2.3.tgz" + "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.2.5.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/mkdirp/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/mkdirp/package.json index b7fe466..54d87e7 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/mkdirp/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/mkdirp/package.json @@ -39,7 +39,7 @@ "shasum": "1d73076a6df986cd9344e15e71fcc05a4c9abf12", "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz" }, - "_from": "mkdirp@0.5.x", + "_from": "mkdirp@>=0.5.0 <0.6.0", "_npmVersion": "1.4.3", "_npmUser": { "name": "substack", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/nopt/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/nopt/package.json index 4cda2c4..4b1f700 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/nopt/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/nopt/package.json @@ -35,7 +35,7 @@ "homepage": "https://github.com/isaacs/nopt", "_id": "nopt@3.0.1", "_shasum": "bce5c42446a3291f47622a370abbf158fbbacbfd", - "_from": "nopt@3.x", + "_from": "nopt@>=3.0.0 <4.0.0", "_npmVersion": "1.4.18", "_npmUser": { "name": "isaacs", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/resolve/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/resolve/package.json index cb1a7e4..3d79a60 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/resolve/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/resolve/package.json @@ -32,7 +32,7 @@ "homepage": "https://github.com/substack/node-resolve", "_id": "resolve@0.7.4", "_shasum": "395a9ef9e873fbfe12bd14408bd91bb936003d69", - "_from": "resolve@0.7.x", + "_from": "resolve@>=0.7.0 <0.8.0", "_npmVersion": "1.4.21", "_npmUser": { "name": "substack", diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/LICENSE b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/LICENSE index 05a4010..19129e3 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/LICENSE +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/LICENSE @@ -1,23 +1,15 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. +The ISC 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: +Copyright (c) Isaac Z. Schlueter and Contributors -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +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", 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. +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/grunt-istanbul/node_modules/istanbul/node_modules/which/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/package.json index 0fd9657..56acacd 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/package.json @@ -6,7 +6,7 @@ }, "name": "which", "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "1.0.5", + "version": "1.0.8", "repository": { "type": "git", "url": "git://github.com/isaacs/node-which.git" @@ -15,17 +15,33 @@ "bin": { "which": "./bin/which" }, - "engines": { - "node": "*" - }, - "dependencies": {}, - "devDependencies": {}, - "readme": "The \"which\" util from npm's guts.\n\nFinds the first instance of a specified executable in the PATH\nenvironment variable. Does not cache the results, so `hash -r` is not\nneeded when the PATH changes.\n", - "readmeFilename": "README.md", + "license": "ISC", + "gitHead": "681a9ebbc447cb428232ddf6c0983006d89e7755", "bugs": { "url": "https://github.com/isaacs/node-which/issues" }, "homepage": "https://github.com/isaacs/node-which", - "_id": "which@1.0.5", - "_from": "which@1.0.x" + "_id": "which@1.0.8", + "scripts": {}, + "_shasum": "c2ff319534ac4a1fa45df2221b56c36279903ded", + "_from": "which@>=1.0.0 <1.1.0", + "_npmVersion": "2.1.11", + "_nodeVersion": "0.10.16", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "c2ff319534ac4a1fa45df2221b56c36279903ded", + "tarball": "http://registry.npmjs.org/which/-/which-1.0.8.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/which/-/which-1.0.8.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/which.js b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/which.js index db7e8f7..f19dd33 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/which.js +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/which/which.js @@ -5,12 +5,7 @@ var path = require("path") , fs , COLON = process.platform === "win32" ? ";" : ":" , isExe - -try { - fs = require("graceful-fs") -} catch (ex) { - fs = require("fs") -} + , fs = require("fs") if (process.platform == "win32") { // On windows, there is no good way to check that a file is executable diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/wordwrap/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/wordwrap/package.json index a034188..1f88554 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/wordwrap/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/wordwrap/package.json @@ -41,5 +41,5 @@ }, "homepage": "https://github.com/substack/node-wordwrap", "_id": "wordwrap@0.0.2", - "_from": "wordwrap@0.0.x" + "_from": "wordwrap@>=0.0.0 <0.1.0" } diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/package.json b/node_modules/grunt-istanbul/node_modules/istanbul/package.json index 4fc131c..aeb4b6b 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/package.json +++ b/node_modules/grunt-istanbul/node_modules/istanbul/package.json @@ -211,7 +211,7 @@ "homepage": "https://github.com/gotwarlost/istanbul", "_id": "istanbul@0.2.16", "_shasum": "870545a0d4f4b4ce161039e9e805a98c2c700bd9", - "_from": "istanbul@0.2.16", + "_from": "istanbul@>=0.2.3 <0.3.0", "_npmVersion": "1.4.16", "_npmUser": { "name": "gotwarlost", diff --git a/node_modules/grunt-istanbul/node_modules/nue/package.json b/node_modules/grunt-istanbul/node_modules/nue/package.json index b676983..e57cb92 100644 --- a/node_modules/grunt-istanbul/node_modules/nue/package.json +++ b/node_modules/grunt-istanbul/node_modules/nue/package.json @@ -38,6 +38,10 @@ ], "directories": {}, "_shasum": "f55c3624e2d53257ed67bee545d9e0c1bd915ff8", + "_resolved": "https://registry.npmjs.org/nue/-/nue-0.7.0dev.tgz", "_from": "nue@0.7.0-dev", - "_resolved": "https://registry.npmjs.org/nue/-/nue-0.7.0dev.tgz" + "bugs": { + "url": "https://github.com/nakamura-to/nue/issues" + }, + "homepage": "https://github.com/nakamura-to/nue" } diff --git a/node_modules/grunt-istanbul/package.json b/node_modules/grunt-istanbul/package.json index 80490aa..3a91e51 100644 --- a/node_modules/grunt-istanbul/package.json +++ b/node_modules/grunt-istanbul/package.json @@ -1,7 +1,7 @@ { "name": "grunt-istanbul", "description": "JavaScript codecoverage tool for Grunt", - "version": "0.3.0", + "version": "0.4.0", "homepage": "https://github.com/taichi/grunt-istanbul", "author": { "name": "taichi", @@ -20,6 +20,10 @@ { "name": "rowanbeentje", "email": "rowan@beent.je" + }, + { + "name": "Martin Geisler", + "email": "martin@geisler.net" } ], "repository": { @@ -46,6 +50,7 @@ "test": "grunt test" }, "dependencies": { + "chalk": "~0.5.1", "istanbul": "~0.2.3", "nue": "0.7.0-dev" }, @@ -69,8 +74,8 @@ "JS coverage", "istanbul" ], - "_id": "grunt-istanbul@0.3.0", - "_shasum": "663166d06dd7f598e42cc702e8a6cc116ebc810d", + "_id": "grunt-istanbul@0.4.0", + "_shasum": "33d1ae29919b434c8e8337598e6e9a24c1d70a30", "_from": "grunt-istanbul@*", "_npmVersion": "1.4.9", "_npmUser": { @@ -84,9 +89,10 @@ } ], "dist": { - "shasum": "663166d06dd7f598e42cc702e8a6cc116ebc810d", - "tarball": "http://registry.npmjs.org/grunt-istanbul/-/grunt-istanbul-0.3.0.tgz" + "shasum": "33d1ae29919b434c8e8337598e6e9a24c1d70a30", + "tarball": "http://registry.npmjs.org/grunt-istanbul/-/grunt-istanbul-0.4.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/grunt-istanbul/-/grunt-istanbul-0.3.0.tgz" + "_resolved": "https://registry.npmjs.org/grunt-istanbul/-/grunt-istanbul-0.4.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/grunt-istanbul/tasks/helpers.js b/node_modules/grunt-istanbul/tasks/helpers.js index 525d42a..775dd61 100644 --- a/node_modules/grunt-istanbul/tasks/helpers.js +++ b/node_modules/grunt-istanbul/tasks/helpers.js @@ -1,6 +1,8 @@ exports.init = function(grunt) { 'use strict'; + var chalk = require('chalk'); + var fs = require('fs'); var path = require('path'); @@ -12,8 +14,6 @@ exports.init = function(grunt) { function flowEnd(err, done) { if (err) { grunt.fail.fatal(err); - } else { - grunt.log.ok(); } done(); } @@ -61,34 +61,29 @@ exports.init = function(grunt) { return path.join(options.basePath, options.flatten === true ? path.basename(file) : file); }; - var instFlow = flow(function readFile(f) { - fs.readFile(f.name, 'utf8', this.async({ - name : f.name, - code : as(1) - })); - }, function instrument(f) { - grunt.verbose.writeln('instrument from ' + f.name); + var tally = { instrumented : 0, skipped : 0 }; + + var instFlow = flow( + function instrumentFile(f) { + var code = grunt.file.read(f.name); var instrumenter = new istanbul.Instrumenter(options); - instrumenter.instrument(f.code, f.name, this.async({ + instrumenter.instrument(code, f.name, this.async({ name : f.name, code : as(1) })); }, function write(result) { var out = outFile(result.name); - grunt.verbose.writeln('instrument to ' + out); - grunt.file.mkdir(path.dirname(out)); - fs.writeFile(out, result.code, 'utf8', this.async(as(1))); + grunt.file.write(out, result.code); + tally.instrumented++; + this.next(); }, function end() { flowEnd(this.err, this.next.bind(this)); }); - var dateCheckFlow = flow(function checkDestExists(f) { - grunt.verbose.writeln('checking destination exists ' + f.name); - fs.exists(outFile(f.name), this.async({ name : f.name, exists : as(0) })); - }, + var dateCheckFlow = flow( function readStat(f) { - if (f.exists) { - grunt.verbose.writeln('reading stat for ' + f.name); + if (grunt.file.exists(f.name)) { + grunt.log.debug('reading stat for ' + f.name); fs.stat(f.name, this.async({ name : f.name, stat : as(1) })); fs.stat(outFile(f.name), this.async({ name : f.name, stat : as(1) })); } else { @@ -97,12 +92,13 @@ exports.init = function(grunt) { } }, function decision(i, o) { var reinstrument = i.stat.mtime.getTime() > o.stat.mtime.getTime(); - grunt.verbose.writeln('make a decision about instrumenting ' + i.name + ': ' + reinstrument); + grunt.log.debug('make a decision about instrumenting ' + i.name + ': ' + reinstrument); this.end({ name: i.name, instrument: reinstrument }); }, function end(f) { if (f.instrument) { this.exec(instFlow, { name : f.name }, this.async()); } else { + tally.skipped++; flowEnd(this.err, this.next.bind(this)); } }); @@ -111,27 +107,31 @@ exports.init = function(grunt) { this.asyncEach(filelist, function(file, group) { this.exec((options.lazy ? dateCheckFlow : instFlow), { name : file }, group.async(as(1))); }); + }, function outputSummary() { + grunt.log.write('Instrumented ' + chalk.cyan(tally.instrumented) + ' ' + + grunt.util.pluralize(tally.instrumented, 'file/files')); + if (options.lazy) { + grunt.log.write(' (skipped ' + chalk.cyan(tally.skipped) + ' ' + + grunt.util.pluralize(tally.skipped, 'file/files') + ')'); + } + grunt.log.writeln(); + this.next(); }, done)(files); }, storeCoverage : function(coverage, options, done) { flow(function write_json(cov) { var json = path.resolve(options.dir, options.json); - grunt.file.mkdir(path.dirname(json)); - fs.writeFile(json, JSON.stringify(cov), 'utf8', this.async(as(1))); + grunt.file.write(json, JSON.stringify(cov)); + this.next(); }, function() { flowEnd(this.err, done); })(coverage); }, makeReport : function(files, options, done) { flow(function(filelist) { - this.asyncEach(filelist, function(file, group) { - grunt.verbose.writeln('read from ' + file); - fs.readFile(file, 'utf8', group.async(as(1))); - }); - }, function report(list) { var collector = new istanbul.Collector(); - list.forEach(function(json) { - collector.add(JSON.parse(json)); + filelist.forEach(function(file) { + collector.add(grunt.file.readJSON(file)); }); makeReporters(options).forEach(function(repoDef) { var reporter = istanbul.Report.create(repoDef.type, repoDef.options); diff --git a/node_modules/grunt-istanbul/tasks/istanbul.js b/node_modules/grunt-istanbul/tasks/istanbul.js index b2e1db4..7783950 100644 --- a/node_modules/grunt-istanbul/tasks/istanbul.js +++ b/node_modules/grunt-istanbul/tasks/istanbul.js @@ -1,65 +1,62 @@ -/* - * grunt-istanbul - * https://github.com/taichi/grunt-istanbul - * - * Copyright (c) 2012 taichi - * Licensed under the MIT license. - */ -module.exports = function(grunt) { - 'use strict'; - - var helper = require('./helpers').init(grunt); - grunt - .registerTask('instrument', 'instruments a file or a directory tree', - function(target) { - var key = 'instrument.files'; - this.requiresConfig(key); - var files = grunt.config(key); - var options = this.options({ - basePath : 'build/instrument/', - flatten : false - }); - grunt.verbose.writeflags(options, 'Options'); - helper.instrument(grunt.file.expand(files), options, this - .async()); - }); - - grunt.registerTask('reloadTasks', 'override instrumented tasks', function( - target) { - var key = 'reloadTasks.rootPath'; - this.requiresConfig(key); - var path = grunt.config(key); - grunt.verbose.writeln('Tasks from ' + path); - grunt.loadTasks(path); - grunt.log.ok(); - }); - - grunt.registerTask('storeCoverage', 'store coverage from global', function( - target) { - var options = this.options({ - dir : 'build/reports/', - json : 'coverage.json', - coverageVar : '__coverage__' - }); - grunt.verbose.writeflags(options, 'Options'); - if (global[options.coverageVar]) { - helper.storeCoverage(global[options.coverageVar], options, this.async()); - } else { - grunt.fail.fatal('No coverage information was collected'); - } - }); - - grunt.registerTask('makeReport', 'make coverage report', function(target) { - var key = 'makeReport.src'; - this.requiresConfig(key); - var files = grunt.config(key); - var options = this.options({ - reporters : {}, - type : 'lcov', - dir : 'build/reports/', - print : 'none' - }); - grunt.verbose.writeflags(options, 'Options'); - helper.makeReport(grunt.file.expand(files), options, this.async()); - }); -}; +/* + * grunt-istanbul + * https://github.com/taichi/grunt-istanbul + * + * Copyright (c) 2012 taichi + * Licensed under the MIT license. + */ +module.exports = function(grunt) { + 'use strict'; + + var helper = require('./helpers').init(grunt); + grunt + .registerTask('instrument', 'instruments a file or a directory tree', + function(target) { + var key = 'instrument.files'; + this.requiresConfig(key); + var files = grunt.config(key); + var options = this.options({ + basePath : 'build/instrument/', + flatten : false + }); + helper.instrument(grunt.file.expand(files), options, this + .async()); + }); + + grunt.registerTask('reloadTasks', 'override instrumented tasks', function( + target) { + var key = 'reloadTasks.rootPath'; + this.requiresConfig(key); + var path = grunt.config(key); + grunt.verbose.writeln('Tasks from ' + path); + grunt.loadTasks(path); + grunt.log.ok(); + }); + + grunt.registerTask('storeCoverage', 'store coverage from global', function( + target) { + var options = this.options({ + dir : 'build/reports/', + json : 'coverage.json', + coverageVar : '__coverage__' + }); + if (global[options.coverageVar]) { + helper.storeCoverage(global[options.coverageVar], options, this.async()); + } else { + grunt.fail.fatal('No coverage information was collected'); + } + }); + + grunt.registerTask('makeReport', 'make coverage report', function(target) { + var key = 'makeReport.src'; + this.requiresConfig(key); + var files = grunt.config(key); + var options = this.options({ + reporters : {}, + type : 'lcov', + dir : 'build/reports/', + print : 'none' + }); + helper.makeReport(grunt.file.expand(files), options, this.async()); + }); +}; diff --git a/node_modules/jsdoc/.editorconfig b/node_modules/jsdoc/.editorconfig new file mode 100644 index 0000000..c035c9f --- /dev/null +++ b/node_modules/jsdoc/.editorconfig @@ -0,0 +1,12 @@ +[*] +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true + +[package.json] +indent_style = space +indent_size = 2 + +[{**/*.js,**/*.css,**/*.json}] +indent_style = space +indent_size = 4 diff --git a/node_modules/jsdoc/changes.md b/node_modules/jsdoc/CHANGES.md similarity index 65% rename from node_modules/jsdoc/changes.md rename to node_modules/jsdoc/CHANGES.md index fc832d8..cbd92a4 100644 --- a/node_modules/jsdoc/changes.md +++ b/node_modules/jsdoc/CHANGES.md @@ -2,6 +2,94 @@ This file describes notable changes in each version of JSDoc 3. To download a specific version of JSDoc 3, see [GitHub's tags page](https://github.com/jsdoc3/jsdoc/tags). +## 3.3.0 (January 2015) + +**Note**: This draft changelog is current through January 21, 2015, and is subject to change before JSDoc 3.3.0 is released. + +### Major changes ++ You can now run JSDoc on Node.js. (#93) ++ You can now use the `@interface` and `@implements` tags to document interfaces and their implementations. (#720, #828) ++ Closure Compiler's `@inheritDoc` and `@override` tags are now supported. (#53) ++ If the JSDoc comment for a symbol includes the `@mixes` tag, all of the mixins now appear in the symbol's documentation. (#378) ++ JSDoc can now log information to the console as it runs (for example, the name of each file that JSDoc parses). To log this information, run JSDoc with the `--verbose` flag. (#416) ++ You can now use any file as the package or README file for your documentation. Use the `-P/--package/` and `-R/--readme` flags to specify the package and README file. (#708) ++ The default template's typography and color scheme have been significantly improved. (#550, #780, #843) + +### Enhancements ++ You can now use the `--pedantic` flag to treat all errors as fatal errors, and to treat warnings as errors. This flag replaces the `--lenient` flag, which had roughly the opposite meaning and is no longer available. (#416) ++ You can now use the `-a/--access` flag to control whether private, protected, and public symbols appear in the documentation. (#860, #861) ++ You can now use the `--debug` flag to log detailed debugging information to the console. This information can help you diagnose bugs in JSDoc itself. (#416) ++ JSDoc's configuration file can now contain JavaScript comments. (#660) ++ You can now include source files from a directory, but exclude one of its subdirectories, by adding the subdirectory to the `source.exclude` option in the configuration file. (#484) ++ The `source.exclude` option now works correctly when JSDoc is run with the `-r/--recurse` flag. (#616) ++ When JSDoc is run with the `-r/--recurse` flag, it now scans for tutorials recursively. (#712) ++ JSDoc's `-X/--explain` option now runs much more quickly. (#633) ++ If all of the text for an `@example` tag is indented, JSDoc now removes the extra indentation. (#540) ++ The default value for a parameter or property can now include brackets (for example, `@param {Array.} [foo=['bar']]`). (#640) ++ You can now provide a default value for parameters and properties that are not optional (for example, `@property {string} foo='bar'`). (#791) ++ If the `@type` tag includes a description (for example, `@type {string} some text`), JSDoc now parses the type expression correctly and discards the description. (#615) ++ You can now add JSDoc comments to function parameters. (#473) ++ For Closure Compiler projects, you can now enable a Closure Compiler-specific tag dictionary that more closely matches Closure Compiler's semantics. To enable Closure Compiler semantics, set the configuration file's `tags.dictionaries` option to `['closure']`. This option can contain the values `jsdoc`, `closure`, or both. If multiple dictionaries are enabled, and a tag is defined in more than one dictionary, JSDoc uses the definition from the first dictionary that contains the tag. (#729, #730, #731, #732) ++ If one symbol overrides another, JSDoc now adds an `overrides` property to the doclet that is overriding another. The `overrides` property contains the longname of the overridden symbol. (#792) ++ When a JSDoc tag contains a type expression, the doclet's `type` object now includes a hidden `parsedType` property. The `parsedType` property contains a syntax tree that represents the type expression. The syntax tree is generated by [Catharsis](https://github.com/hegemonic/catharsis), and its format may change in the future. (#576) ++ JSDoc now allows output filenames to contain non-ASCII characters. In addition, links to output files are now URL-encoded when necessary. (#677) ++ JSDoc now ensures that output filenames do not have a leading underscore. (#758) ++ JSDoc now tries to ensure that `id` attributes in output files are unique within that file. (#539) ++ JSDoc now has an up-to-date JSON Schema file for parse results. The schema file is available in `lib/jsdoc/schema.js`. (#327) ++ JSDoc now extracts more information from package files. (#710) ++ JSDoc now displays usage information if you run JSDoc without any input files, or with an unrecognized command-line option. (#609, #840) + +### Bug fixes ++ When the `allowUnknownTags` option is set to `false`, JSDoc no longer logs warnings about the presence of `@also` and `@scope` tags. (#574) ++ Fixed several errors when parsing type expressions. (#619, #644, #652, #705, #767) ++ Properties added to the `module.exports` object can now be documented. (#500) ++ When a symbol's name starts with the same characters as its parent namespace (such as `Vector` in `V.Vector`), JSDoc now assigns the correct longname to the symbol. (#608) ++ If a child class inherits from multiple parent classes, and the parent classes have instance members with the same name, the child class no longer displays the documentation from both parent classes. (#613) ++ If a source file contains an object literal, and one of the property names is a whitespace character or a character that must be escaped in a regular expression, JSDoc now parses the file successfully. (#549, #775) ++ Virtual comments now work correctly for overloaded functions. (#727) ++ When a virtual comment appears within a module, JSDoc now assigns the correct values to the virtual comment doclet's `memberof`, `longname`, and `scope` properties. (#631) ++ JSDoc now sets the `scope` property to `global` for all global doclets. (#684) ++ Module doclets no longer have a `scope` property. (#782) ++ In Markdown tutorials, JSDoc no longer unescapes HTML entities. (#743) ++ If a longname includes a variation (for example, `Foo#bar(variation)`), the link text is now preserved when generating HTML links. (#857) ++ When a single JSDoc comment includes `@class`, `@classdesc`, and `@constructor` tags, JSDoc no longer ignores the value of the `@classdesc` tag. (#806) ++ For tags where the name and type are both optional (`@constant`, `@external`, `@member`, `@module`, `@namespace`, and `@param`), JSDoc now parses the tag correctly when it includes a type but not a name. (#351, #535) ++ The `@default` tag now works correctly when used with an array literal. (#604) ++ The `@enum` tag now works correctly when the enumeration is part of a chain of assignments (for example, `var FOO = exports.FOO = {/* enumerated values */}`). (#702) ++ The `@exports` and `@module` tags now work correctly when their value includes a `module:` namespace (for example, `@exports module:foo`). (#786) ++ The `@memberof` tag now works correctly when it refers to a module that is defined in a separate file. (#880) ++ The `@variation` tag now works correctly when its value is enclosed in parentheses (for example, `@variation (foo)`). (#850) + +### Plugins ++ Tag definitions can now have a `mustNotHaveDescription` property. When this property is set to `true`, JSDoc will warn the user if the tag text includes a description (such as `The description` in `@param {string} foo - The description`). (#615) ++ Tag definitions can now call the method `dictionary.normalize`, which is a synonym for `dictionary.normalise`. (#884) ++ The Markdown plugin no longer prevents inline `{@link}` tags from working. (#518) ++ The Markdown plugin now converts `@author` and `@throws` tag values to HTML by default. (#736, #878) ++ JSDoc now includes a `summarize` plugin that automatically generates summaries based on the description. (#485) ++ JSDoc now includes an `underscore` plugin that finds symbols whose names begin with an underscore and automatically tags them as `@private`. (#471) ++ Plugins can now replace the `doclet` property of `newDoclet` events. (#584) + +### Template improvements ++ You can now override the default template's main layout file, `layout.tmpl`, by setting the `templates.default.layoutFile` option in JSDoc's configuration file. The property can contain a relative or absolute path to the replacement for `layout.tmpl`. Relative paths are resolved against the path to the configuration file; the current working directory; and the JSDoc directory, in that order. (#480) ++ When the `templates.default.outputSourceFiles` option is set to `false`, the documentation no longer shows the path to each source file. (#571) ++ You can now use the property `templates.default.staticFiles.include` to list files that will be copied to the output directory. For backwards compatibility, the property `templates.default.staticFiles.paths` is also supported but is deprecated. (#785) ++ The `templates.default.staticFiles` options now work correctly on Windows. (#785) ++ Output files no longer show the default value for members of an enumeration. (#689) ++ In certain types of AMD modules, the module-overview section is no longer duplicated. (#853) ++ If a constructor is assigned to `module.exports`, the value of the `@classdesc` tag now appears in the documentation. (#740) ++ If a constructor is assigned to `module.exports`, and the constructor inherits from another class, the parent class is now listed in the documentation. (#594) ++ Text within an `@example` tag, including HTML tags, is now properly escaped. (#511) ++ If a member has a `@fires` tag, the tag information now appears in the documentation. (#568) ++ If a symbol has members that use the `@mixin` tag, the mixins are now listed in the documentation. (#379, #602) ++ When multiple `@param` tags are used to document properties of array values (for example, `@param {Object[]} foo` and `@param {string} foo[].bar`), the properties are now grouped into the appropriate row of the parameters table. (#870) ++ If a member has a `@requires` tag, the tag information now appears in the documentation. (#563) ++ Type expressions are now presented more clearly. (#618) ++ Pretty-printed source files now include line numbers. (#532) ++ When you run JSDoc with a single input file, the full path to the file no longer appears in the documentation. (#553) ++ When an overloaded function is assigned to `module.exports`, the documentation now displays all of the signatures for the overloaded function. (#727) ++ Resolved several issues that caused the default template to generate invalid HTML. (#843) + + ## 3.2.2 (November 2013) ### Bug fixes @@ -12,6 +100,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + If a function accepts a parameter named `prototype`, the parameter is no longer renamed during parsing. (#505) + If the list of input files includes relative paths, the paths are now resolved relative to the user's working directory. (a3d33842) + ## 3.2.1 (October 2013) ### Enhancements @@ -43,6 +132,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + If a `@default` tag is added to a symbol whose default value is an object, the value is now displayed in the output file. (#419) + Output files now identify symbols as "abstract" rather than "virtual." (#432) + ## 3.2.0 (May 2013) ### Major changes @@ -101,6 +191,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + The "Classes" header is no longer repeated in the navigation bar. (#361) + When the only documented symbols in global scope are type definitions, you can now click the "Global" header to view their documentation. (#261) + ## 3.1.1 (February 2013) + Resolved a crash when no input files contain JSDoc comments. (#329) @@ -114,6 +205,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + `getSignatureTypes` + `linkto` + ## 3.1.0 (January 2013) ### Major changes @@ -218,6 +310,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + Members are now contained in arrays rather than objects, allowing overloaded members to be documented. (#153) + A clearer error message is now provided when the output destination is not specified correctly. (#174) + ## 3.0.1 (June 2012) ### Enhancements @@ -235,6 +328,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp + The default template now sorts classes by name correctly when the classes come from several modules. (4ce17195) + The Haruki template now correctly supports `@example`, `@members`, and `@returns` tags. (6580e176, 59655252, 31c8554d) + ## 3.0.0 (May 2012) Initial release. diff --git a/node_modules/jsdoc/LICENSE.md b/node_modules/jsdoc/LICENSE.md index 051763a..ace2936 100644 --- a/node_modules/jsdoc/LICENSE.md +++ b/node_modules/jsdoc/LICENSE.md @@ -4,7 +4,7 @@ JSDoc 3 is free software, licensed under the Apache License, Version 2.0 (the "License"). Commercial and non-commercial use are permitted in compliance with the License. -Copyright (c) 2011-2014 Michael Mathews and the +Copyright (c) 2011-2015 Michael Mathews and the [contributors to JSDoc](https://github.com/jsdoc3/jsdoc/graphs/contributors). All rights reserved. @@ -77,11 +77,21 @@ Copyright (c) 2010 Caolan McMahon. The source code for Async.js is available at: https://github.com/caolan/async +## buffer-browserify ## + +buffer-browserify is distributed under the MIT license, which is reproduced +above. + +Copyright (c) Romain Beauxis. + +The source code for buffer-browserify is available at: +https://github.com/toots/buffer-browserify + ## Catharsis ## Catharsis is distributed under the MIT license, which is reproduced above. -Copyright (c) 2012-2013 Jeff Williams. +Copyright (c) 2012-2014 Jeff Williams. The source code for Catharsis is available at: https://github.com/hegemonic/catharsis @@ -96,6 +106,16 @@ Copyright (c) 2013 Dominic Tarr. The source code for crypto-browserify is available at: https://github.com/dominictarr/crypto-browserify +## escape-string-regexp ## + +escape-string-regexp is distributed under the MIT License, which is reproduced +above. + +Copyright (c) Sindre Sorhus . + +The source code for escape-string-regexp is available at: +https://github.com/sindresorhus/escape-string-regexp + ## Esprima ## Esprima is distributed under the BSD 2-clause license: @@ -125,6 +145,19 @@ Copyright (c) 2011-2013 Ariya Hidayat and other Esprima contributors. The source code for Esprima is available at: https://github.com/ariya/esprima +## events ## + +Portions of the events source code are incorporated into the following files: + ++ `rhino/events.js` + +events is distributed under the MIT license, which is reproduced above. + +Copyright Joyent, Inc. and other Node contributors. All rights reserved. + +The source code for events is available at: +https://github.com/Gozala/events + ## github-flavored-markdown ## github-flavored-markdown is distributed under the BSD 3-clause license: @@ -200,38 +233,6 @@ Copyright (c) 2012 Michael Kourlas. The source code for js2xmlparser is available at: https://github.com/michaelkourlas/node-js2xmlparser -## JSHint ## - -JSHint is distributed under the MIT license, which is reproduced above. - -Portions of JSHint are derived from JSLint, which is distributed under a -modified MIT license: - -> Copyright (c) 2002 Douglas Crockford (www.JSLint.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 shall be used for Good, not Evil. -> -> 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. - -The source code for JSHint is available at: -https://github.com/jshint/jshint - ## Node.js ## Portions of the Node.js source code are incorporated into the following files: @@ -262,17 +263,15 @@ above. The source code for node-browser-builtins is available at: https://github.com/alexgorbatchev/node-browser-builtins -## node-browserify ## +## Open Sans ## -Portions of the node-browserify source code are incorporated into the following -files: +Open Sans is distributed under the Apache License 2.0, which is +included with this package. -- `rhino/events.js` +Copyright (c) 2010-2011, Google Inc. -node-browserify is distributed under the MIT license, which is reproduced above. - -The source code for node-browserify is available at: -https://github.com/substack/node-browserify +This typeface, including the complete set of variations, are available at: +http://www.google.com/fonts/specimen/Open+Sans ## Requizzle ## @@ -381,6 +380,15 @@ Reporters & Editors. The source code for Underscore.js is available at: https://github.com/jashkenas/underscore +## url ## + +url is distributed under the MIT license, which is reproduced above. + +Copyright Joyent, Inc. and other Node contributors. + +The source code for url is available at: +https://github.com/defunctzombie/node-url + ## wrench-js ## wrench-js is distributed under the MIT license, which is reproduced above. diff --git a/node_modules/jsdoc/README.md b/node_modules/jsdoc/README.md index bae6441..6428c17 100644 --- a/node_modules/jsdoc/README.md +++ b/node_modules/jsdoc/README.md @@ -29,11 +29,6 @@ To install the latest development version: npm install git+https://github.com/jsdoc3/jsdoc.git -**Note**: If you install JSDoc globally, do not use `sudo npm install`. This may -prevent you from running JSDoc as a normal user. If you cannot install global -packages without `sudo`, please -[fix your npm directory permissions](http://howtonode.org/introduction-to-npm). - #### Running JSDoc with Node.js If you installed JSDoc locally, the JSDoc command-line tool is available in @@ -117,8 +112,7 @@ For More Information + Documentation is available at [Use JSDoc](http://usejsdoc.org). + Contribute to the docs at [jsdoc3/jsdoc3.github.com](https://github.com/jsdoc3/jsdoc3.github.com). -+ ~~Post questions to the [JSDoc Users mailing list](http://groups.google.com/group/jsdoc-users).~~ -(temporarily unavailable) ++ Ask for help on the [JSDoc Users mailing list](http://groups.google.com/group/jsdoc-users). + Post questions tagged `jsdoc` to [Stack Overflow](http://stackoverflow.com/questions/tagged/jsdoc). diff --git a/node_modules/jsdoc/cli.js b/node_modules/jsdoc/cli.js index 1a5cefc..dbbad18 100644 --- a/node_modules/jsdoc/cli.js +++ b/node_modules/jsdoc/cli.js @@ -71,7 +71,10 @@ cli.loadConfig = function() { env.opts = args.parse(env.args); } catch (e) { - cli.exit(1, e.message + '\n' + FATAL_ERROR_MESSAGE); + console.error(e.message + '\n'); + cli.printHelp(function() { + cli.exit(1); + }); } confPath = env.opts.configure || path.join(env.dirname, 'conf.json'); @@ -241,40 +244,68 @@ cli.main = function(cb) { cb(0); }; -function getRandomId() { - var MIN = 100000; - var MAX = 999999; +function readPackageJson(filepath) { + var fs = require('jsdoc/fs'); - return Math.floor(Math.random() * (MAX - MIN + 1) + MIN); + try { + return stripJsonComments( fs.readFileSync(filepath, 'utf8') ); + } + catch (e) { + logger.error('Unable to read the package file "%s"', filepath); + return null; + } +} + +function buildSourceList() { + var fs = require('jsdoc/fs'); + var Readme = require('jsdoc/readme'); + + var packageJson; + var readmeHtml; + var sourceFile; + var sourceFiles = env.opts._ ? env.opts._.slice(0) : []; + + if (env.conf.source && env.conf.source.include) { + sourceFiles = sourceFiles.concat(env.conf.source.include); + } + + // load the user-specified package/README files, if any + if (env.opts.package) { + packageJson = readPackageJson(env.opts.package); + } + if (env.opts.readme) { + readmeHtml = new Readme(env.opts.readme).html; + } + + // source files named `package.json` or `README.md` get special treatment, unless the user + // explicitly specified a package and/or README file + for (var i = 0, l = sourceFiles.length; i < l; i++) { + sourceFile = sourceFiles[i]; + + if ( !env.opts.package && /\bpackage\.json$/i.test(sourceFile) ) { + packageJson = readPackageJson(sourceFile); + sourceFiles.splice(i--, 1); + } + + if ( !env.opts.readme && /(\bREADME|\.md)$/i.test(sourceFile) ) { + readmeHtml = new Readme(sourceFile).html; + sourceFiles.splice(i--, 1); + } + } + + props.packageJson = packageJson; + env.opts.readme = readmeHtml; + + return sourceFiles; } // TODO: docs cli.scanFiles = function() { var Filter = require('jsdoc/src/filter').Filter; - var fs = require('jsdoc/fs'); - var Readme = require('jsdoc/readme'); var filter; - var opt; - if (env.conf.source && env.conf.source.include) { - env.opts._ = (env.opts._ || []).concat(env.conf.source.include); - } - - // source files named `package.json` or `README.md` get special treatment - for (var i = 0, l = env.opts._.length; i < l; i++) { - opt = env.opts._[i]; - - if ( /\bpackage\.json$/i.test(opt) ) { - props.packageJson = fs.readFileSync(opt, 'utf8'); - env.opts._.splice(i--, 1); - } - - if ( /(\bREADME|\.md)$/i.test(opt) ) { - env.opts.readme = new Readme(opt).html; - env.opts._.splice(i--, 1); - } - } + env.opts._ = buildSourceList(); // are there any files to scan and parse? if (env.conf.source && env.opts._.length) { @@ -290,7 +321,6 @@ cli.scanFiles = function() { function resolvePluginPaths(paths) { var path = require('jsdoc/path'); - var isNode = require('jsdoc/util/runtime').isNode(); var pluginPaths = []; paths.forEach(function(plugin) { @@ -342,10 +372,13 @@ cli.parseFiles = function() { packageDocs.files = env.sourceFiles || []; docs.push(packageDocs); - logger.debug('Adding inherited symbols...'); + logger.debug('Indexing doclets...'); borrow.indexAll(docs); - augment.addInherited(docs); + logger.debug('Adding inherited symbols, mixins, and interface implementations...'); + augment.augmentAll(docs); + logger.debug('Adding borrowed doclets...'); borrow.resolveBorrows(docs); + logger.debug('Post-processing complete.'); app.jsdoc.parser.fireProcessingComplete(docs); @@ -389,7 +422,6 @@ cli.generateDocs = function() { var template; env.opts.template = (function() { - var isNode = require('jsdoc/util/runtime').isNode(); var publish = env.opts.template || 'templates/default'; var templatePath = path.getResourcePath(publish); @@ -433,5 +465,4 @@ cli.exit = function(exitCode, message) { }; return cli; - })(); diff --git a/node_modules/jsdoc/jsdoc.js b/node_modules/jsdoc/jsdoc.js index 5ea476d..6f63faa 100755 --- a/node_modules/jsdoc/jsdoc.js +++ b/node_modules/jsdoc/jsdoc.js @@ -136,10 +136,10 @@ global.app = { global.dump = function() { 'use strict'; - var doop = require('./lib/jsdoc/util/doop').doop; var _dump = require('./lib/jsdoc/util/dumper').dump; + for (var i = 0, l = arguments.length; i < l; i++) { - console.log( _dump(doop(arguments[i])) ); + console.log( _dump(arguments[i]) ); } }; diff --git a/node_modules/jsdoc/lib/jsdoc/augment.js b/node_modules/jsdoc/lib/jsdoc/augment.js index 7a3778f..6075634 100644 --- a/node_modules/jsdoc/lib/jsdoc/augment.js +++ b/node_modules/jsdoc/lib/jsdoc/augment.js @@ -1,19 +1,33 @@ 'use strict'; +/** + * Provides methods for augmenting the parse results based on their content. + * @module jsdoc/augment + */ + +var doop = require('jsdoc/util/doop'); +var name = require('jsdoc/name'); + var hasOwnProp = Object.prototype.hasOwnProperty; -function mapDependencies(index) { - var doclets, doc, len, dependencies = {}; +function mapDependencies(index, propertyName) { + var dependencies = {}; + var doc; + var doclets; + var kinds = ['class', 'external', 'mixin']; + var len = 0; - Object.keys(index).forEach(function(name) { - doclets = index[name]; - for (var i = 0, ii = doclets.length; i < ii; ++i) { + Object.keys(index).forEach(function(indexName) { + doclets = index[indexName]; + for (var i = 0, ii = doclets.length; i < ii; i++) { doc = doclets[i]; - if (doc.kind === 'class' || doc.kind === 'external') { - dependencies[name] = {}; - len = doc.augments && doc.augments.length || 0; - for (var j = 0; j < len; ++j) { - dependencies[name][doc.augments[j]] = true; + if (kinds.indexOf(doc.kind) !== -1) { + dependencies[indexName] = {}; + if (hasOwnProp.call(doc, propertyName)) { + len = doc[propertyName].length; + for (var j = 0; j < len; j++) { + dependencies[indexName][doc[propertyName][j]] = true; + } } } } @@ -59,20 +73,95 @@ function sort(dependencies) { return sorter.sort(); } -function getMembers(longname, docs) { - var candidate, members = []; - for (var i = 0, ii = docs.length; i < ii; ++i) { +function getMembers(longname, docs, scopes) { + var candidate; + var members = []; + + for (var i = 0, l = docs.length; i < l; i++) { candidate = docs[i]; - if (candidate.memberof === longname && candidate.scope === 'instance') { + + if (candidate.memberof === longname && + (!scopes || !scopes.length || scopes.indexOf(candidate.scope) !== -1)) { members.push(candidate); } } + return members; } -function getAdditions(doclets, docs, longnames) { - var doop = require('jsdoc/util/doop'); +function addDocletProperty(doclets, propName, value) { + for (var i = 0, l = doclets.length; i < l; i++) { + doclets[i][propName] = value; + } +} +function reparentDoclet(parent, child) { + var parts = name.shorten(child.longname); + + parts.memberof = parent.longname; + child.memberof = parent.longname; + child.longname = name.combine(parts); +} + +function parentIsClass(parent) { + return parent.kind === 'class'; +} + +function staticToInstance(doclet) { + var parts = name.shorten(doclet.longname); + + parts.scope = name.SCOPE.PUNC.INSTANCE; + doclet.longname = name.combine(parts); + doclet.scope = name.SCOPE.NAMES.INSTANCE; +} + +/** + * Update the list of doclets to be added to another symbol. + * + * We add only one doclet per longname. For example: If `ClassA` inherits from two classes that both + * use the same method name, `ClassA` gets docs for one method rather than two. + * + * Also, the last symbol wins for any given longname. For example: If you write `@extends Class1 + * @extends Class2`, and both classes have an instance method called `myMethod`, you get the docs + * from `Class2#myMethod`. + * + * @private + * @param {Array.} additions - An array of doclets that will be added to + * another symbol. + * @param {Object.} indexes - A dictionary of indexes into the `additions` array. + * Each key is a longname, and each value is the index of the longname's doclet. + * @return {void} + */ +function updateAddedDoclets(doclet, additions, indexes) { + if (typeof indexes[doclet.longname] !== 'undefined') { + // replace the existing doclet + additions[indexes[doclet.longname]] = doclet; + } + else { + // add the doclet to the array, and track its index + additions.push(doclet); + indexes[doclet.longname] = additions.length - 1; + } +} + +function explicitlyInherits(doclets) { + var doclet; + var inherits = false; + + for (var i = 0, l = doclets.length; i < l; i++) { + doclet = doclets[i]; + if (typeof doclet.inheritdoc !== 'undefined' || typeof doclet.override !== 'undefined') { + inherits = true; + break; + } + } + + return inherits; +} + +// TODO: try to reduce overlap with similar methods +function getInheritedAdditions(doclets, docs, documented) { + var additionIndexes; var additions = []; var doc; var parents; @@ -86,59 +175,331 @@ function getAdditions(doclets, docs, longnames) { for (var i = 0, ii = doclets.length; i < ii; i++) { doc = doclets[i]; parents = doc.augments; + if (parents && doc.kind === 'class') { + // reset the lookup table of added doclet indexes by longname + additionIndexes = {}; + for (var j = 0, jj = parents.length; j < jj; j++) { - members = getMembers(parents[j], docs); + members = getMembers(parents[j], docs, ['instance']); + for (var k = 0, kk = members.length; k < kk; k++) { member = doop(members[k]); - if(!member.inherited) - { + if (!member.inherited) { member.inherits = member.longname; } member.inherited = true; + // TODO: this will fail on longnames like: MyClass#"quoted#Longname" + // and nested instance members like: MyClass#MyOtherClass#myMethod; + // switch to updateLongname()! member.memberof = doc.longname; parts = member.longname.split('#'); parts[0] = doc.longname; member.longname = parts.join('#'); - // if the child doesn't override the parent member, add the parent member - if (longnames.indexOf(member.longname) === -1) { - additions.push(member); + // Indicate what the descendant is overriding. (We only care about the closest + // ancestor. For classes A > B > C, if B#a overrides A#a, and C#a inherits B#a, + // we don't want the doclet for C#a to say that it overrides A#a.) + if (docs.index.longname[member.longname]) { + member.overrides = members[k].longname; + } + else { + delete member.overrides; + } + + // Add the ancestor's docs unless the descendant overrides the ancestor AND + // documents the override. + if ( !hasOwnProp.call(documented, member.longname) ) { + updateAddedDoclets(member, additions, additionIndexes); + } + // If the descendant used an @inheritdoc or @override tag, add the ancestor's + // docs, and ignore the existing doclets. + else if ( explicitlyInherits(documented[member.longname]) ) { + // Ignore any existing doclets. (This is safe because we only get here if + // `member.longname` is an own property of `documented`.) + addDocletProperty(documented[member.longname], 'ignore', true); + + updateAddedDoclets(member, additions, additionIndexes); + + // Remove property that's no longer accurate. + if (member.virtual) { + delete member.virtual; + } + // Remove properties that we no longer need. + if (member.inheritdoc) { + delete member.inheritdoc; + } + if (member.override) { + delete member.override; + } + } + // If the descendant overrides the ancestor and documents the override, + // update the doclets to indicate what the descendant is overriding. + else { + addDocletProperty(documented[member.longname], 'overrides', + members[k].longname); } } } } } + return additions; } -exports.addInherited = function(docs) { - var dependencies = mapDependencies(docs.index); - var sorted = sort(dependencies); - var longnames = []; +function updateMixes(mixedDoclet, mixedLongname) { + var idx; + var mixedName; + var names; - // only build the list of longnames if we'll actually need it - if (sorted.length) { - longnames = docs.map(function(doc) { - // keep the ancestor's docs for a symbol if a local override is not documented - if (doc.longname && !doc.undocumented) { - return doc.longname; - } + // take the fast path if there's no array of mixed-in longnames + if (!mixedDoclet.mixes) { + mixedDoclet.mixes = [mixedLongname]; + } + else { + // find the short name of the longname we're mixing in + mixedName = name.shorten(mixedLongname).name; + // find the short name of each previously mixed-in symbol + names = mixedDoclet.mixes.map(function(m) { + return name.shorten(mixedDoclet.longname).name; }); + + // if we're mixing `myMethod` into `MixinC` from `MixinB`, and `MixinB` had the method mixed + // in from `MixinA`, don't show `MixinA.myMethod` in the `mixes` list + idx = names.indexOf(mixedName); + if (idx !== -1) { + mixedDoclet.mixes.splice(idx, 1); + } + + mixedDoclet.mixes.push(mixedLongname); + } +} + +// TODO: try to reduce overlap with similar methods +function getMixedInAdditions(mixinDoclets, allDoclets, commentedDoclets) { + var additionIndexes; + var additions = []; + var doclet; + var idx; + var mixedDoclet; + var mixedDoclets; + var mixes; + + // mixinDoclets will be undefined if the mixed-in symbol isn't documented + mixinDoclets = mixinDoclets || []; + + for (var i = 0, ii = mixinDoclets.length; i < ii; i++) { + doclet = mixinDoclets[i]; + mixes = doclet.mixes; + + if (mixes) { + // reset the lookup table of added doclet indexes by longname + additionIndexes = {}; + + for (var j = 0, jj = mixes.length; j < jj; j++) { + mixedDoclets = getMembers(mixes[j], allDoclets, ['static']); + + for (var k = 0, kk = mixedDoclets.length; k < kk; k++) { + mixedDoclet = doop(mixedDoclets[k]); + + updateMixes(mixedDoclet, mixedDoclet.longname); + mixedDoclet.mixed = true; + + reparentDoclet(doclet, mixedDoclet); + + // if we're mixing into a class, treat the mixed-in symbol as an instance member + if (parentIsClass(doclet)) { + staticToInstance(mixedDoclet); + } + + updateAddedDoclets(mixedDoclet, additions, additionIndexes); + } + } + } } - sorted.forEach(function(name) { - var doclets = docs.index[name]; - var additions = getAdditions(doclets, docs, longnames); - additions.forEach(function(doc) { - var name = doc.longname; - if ( !hasOwnProp.call(docs.index, name) ) { - docs.index[name] = []; + return additions; +} + +function updateImplements(implDoclets, implementedLongname) { + if ( !Array.isArray(implDoclets) ) { + implDoclets = [implDoclets]; + } + + implDoclets.forEach(function(implDoclet) { + if ( !hasOwnProp.call(implDoclet, 'implements') ) { + implDoclet.implements = []; + } + + implDoclet.implements.push(implementedLongname); + }); +} + +// TODO: try to reduce overlap with similar methods +function getImplementedAdditions(implDoclets, allDoclets, commentedDoclets) { + var additionIndexes; + var additions = []; + var doclet; + var idx; + var implementations; + var implExists; + var implementationDoclet; + var interfaceDoclets; + + // interfaceDoclets will be undefined if the implemented symbol isn't documented + implDoclets = implDoclets || []; + + for (var i = 0, ii = implDoclets.length; i < ii; i++) { + doclet = implDoclets[i]; + implementations = doclet.implements; + + if (implementations) { + // reset the lookup table of added doclet indexes by longname + additionIndexes = {}; + + for (var j = 0, jj = implementations.length; j < jj; j++) { + interfaceDoclets = getMembers(implementations[j], allDoclets, ['instance']); + + for (var k = 0, kk = interfaceDoclets.length; k < kk; k++) { + implementationDoclet = doop(interfaceDoclets[k]); + + reparentDoclet(doclet, implementationDoclet); + updateImplements(implementationDoclet, interfaceDoclets[k].longname); + + // If there's no implementation, move along. + implExists = hasOwnProp.call(allDoclets.index.longname, + implementationDoclet.longname); + if (!implExists) { + continue; + } + + // Add the interface's docs unless the implementation is already documented. + if ( !hasOwnProp.call(commentedDoclets, implementationDoclet.longname) ) { + updateAddedDoclets(implementationDoclet, additions, additionIndexes); + } + // If the implementation used an @inheritdoc or @override tag, add the + // interface's docs, and ignore the existing doclets. + else if ( explicitlyInherits(commentedDoclets[implementationDoclet.longname]) ) { + // Ignore any existing doclets. (This is safe because we only get here if + // `implementationDoclet.longname` is an own property of + // `commentedDoclets`.) + addDocletProperty(commentedDoclets[implementationDoclet.longname], 'ignore', + true); + + updateAddedDoclets(implementationDoclet, additions, additionIndexes); + + // Remove property that's no longer accurate. + if (implementationDoclet.virtual) { + delete implementationDoclet.virtual; + } + // Remove properties that we no longer need. + if (implementationDoclet.inheritdoc) { + delete implementationDoclet.inheritdoc; + } + if (implementationDoclet.override) { + delete implementationDoclet.override; + } + } + // If there's an implementation, and it's documented, update the doclets to + // indicate what the implementation is implementing. + else { + updateImplements(commentedDoclets[implementationDoclet.longname], + interfaceDoclets[k].longname); + } + } } - docs.index[name].push(doc); - docs.push(doc); + } + } + + return additions; +} + +function augment(doclets, propertyName, docletFinder) { + var index = doclets.index.longname; + var dependencies = sort( mapDependencies(index, propertyName) ); + + dependencies.forEach(function(depName) { + var additions = docletFinder.call(null, index[depName], doclets, doclets.index.documented); + + additions.forEach(function(addition) { + var longname = addition.longname; + + if ( !hasOwnProp.call(index, longname) ) { + index[longname] = []; + } + index[longname].push(addition); + doclets.push(addition); }); }); +} + +/** + * Add doclets to reflect class inheritance. + * + * For example, if `ClassA` has the instance method `myMethod`, and `ClassB` inherits from `ClassA`, + * calling this method creates a new doclet for `ClassB#myMethod`. + * + * @param {!Array.} doclets - The doclets generated by JSDoc. + * @param {!Object} doclets.index - The doclet index added by {@link module:jsdoc/borrow.indexAll}. + * @return {void} + */ +exports.addInherited = function(doclets) { + augment(doclets, 'augments', getInheritedAdditions); +}; + +/** + * Add doclets to reflect mixins. When a symbol is mixed into a class, the class' version of the + * mixed-in symbol is treated as an instance member. + * + * For example: + * + * + If `MixinA` has the static method `myMethod`, and `MixinB` mixes `MixinA`, calling this method + * creates a new doclet for the static method `MixinB.myMethod`. + * + If `MixinA` has the static method `myMethod`, and `ClassA` mixes `MixinA`, calling this method + * creates a new doclet for the instance method `ClassA#myMethod`. + * + * @param {!Array.} doclets - The doclets generated by JSDoc. + * @param {!Object} doclets.index - The doclet index added by {@link module:jsdoc/borrow.indexAll}. + * @return {void} + */ +exports.addMixedIn = function(doclets) { + augment(doclets, 'mixes', getMixedInAdditions); +}; + +// TODO: move as much of this as possible to jsdoc/borrow.indexAll +/** + * Update doclets to reflect implementations of interfaces. + * + * For example, if `InterfaceA` has the instance method `myMethod`, and `ClassA` implements + * `InterfaceA`, calling this method does the following: + * + * + Updates `InterfaceA` to indicate that it is implemented by `ClassA` + * + Updates `InterfaceA#myMethod` to indicate that it is implemented by `ClassA#myMethod` + * + Updates `ClassA#myMethod` to indicate that it implements `InterfaceA#myMethod` + * + * @param {!Array.} docs - The doclets generated by JSDoc. + * @param {!Object} doclets.index - The doclet index added by {@link module:jsdoc/borrow.indexAll}. + * @return {void} + */ +exports.addImplemented = function(doclets) { + augment(doclets, 'implements', getImplementedAdditions); +}; + +/** + * Add and update doclets to reflect all of the following: + * + * + Inherited classes + * + Mixins + * + Interface implementations + * + * Calling this method is equivalent to calling all other methods exported by this module. + * + * @return {void} + */ +exports.augmentAll = function(doclets) { + exports.addInherited(doclets); + exports.addMixedIn(doclets); + exports.addImplemented(doclets); }; diff --git a/node_modules/jsdoc/lib/jsdoc/borrow.js b/node_modules/jsdoc/lib/jsdoc/borrow.js index 6f93ea9..5c49882 100644 --- a/node_modules/jsdoc/lib/jsdoc/borrow.js +++ b/node_modules/jsdoc/lib/jsdoc/borrow.js @@ -8,21 +8,79 @@ var doop = require('jsdoc/util/doop'); var logger = require('jsdoc/util/logger'); +var SCOPE = require('jsdoc/name').SCOPE; var hasOwnProp = Object.prototype.hasOwnProperty; -exports.indexAll = function(docs) { - var lookupTable = {}; +// TODO: add the index at parse time, so we don't have to iterate over all the doclets again +exports.indexAll = function(doclets) { + var borrowed = []; + var doclet; + var documented = {}; + var longname = {}; - docs.forEach(function(doc) { - if ( !hasOwnProp.call(lookupTable, doc.longname) ) { - lookupTable[doc.longname] = []; + for (var i = 0, l = doclets.length; i < l; i++) { + doclet = doclets[i]; + + // track all doclets by longname + if ( !hasOwnProp.call(longname, doclet.longname) ) { + longname[doclet.longname] = []; } - lookupTable[doc.longname].push(doc); - }); - docs.index = lookupTable; + longname[doclet.longname].push(doclet); + + // track longnames of documented symbols + if (!doclet.undocumented) { + if ( !hasOwnProp.call(documented, doclet.longname) ) { + documented[doclet.longname] = []; + } + documented[doclet.longname].push(doclet); + } + + // track doclets with a `borrowed` property + if ( hasOwnProp.call(doclet, 'borrowed') ) { + borrowed.push(doclet); + } + } + + doclets.index = { + borrowed: borrowed, + documented: documented, + longname: longname + }; }; +function cloneBorrowedDoclets(doclet, doclets) { + doclet.borrowed.forEach(function(borrowed) { + var borrowedDoclets = doclets.index.longname[borrowed.from]; + var borrowedAs = borrowed.as || borrowed.from; + var clonedDoclets; + var parts; + var scopePunc; + + if (borrowedDoclets) { + borrowedAs = borrowedAs.replace(/^prototype\./, SCOPE.PUNC.INSTANCE); + clonedDoclets = doop(borrowedDoclets).forEach(function(clone) { + // TODO: this will fail on longnames like '"Foo#bar".baz' + parts = borrowedAs.split(SCOPE.PUNC.INSTANCE); + + if (parts.length === 2) { + clone.scope = SCOPE.NAMES.INSTANCE; + scopePunc = SCOPE.PUNC.INSTANCE; + } + else { + clone.scope = SCOPE.NAMES.STATIC; + scopePunc = SCOPE.PUNC.STATIC; + } + + clone.name = parts.pop(); + clone.memberof = doclet.longname; + clone.longname = clone.memberof + scopePunc + clone.name; + doclets.push(clone); + }); + } + }); +} + // requires docs to have been indexed: docs.index must be defined here /** Take a copy of the docs for borrowed symbols and attach them to the @@ -30,41 +88,20 @@ exports.indexAll = function(docs) { moving docs from the "borrowed" array and into the general docs, then deleting the "borrowed" array. */ -exports.resolveBorrows = function(docs) { - /*eslint max-nested-callbacks:[2, 3] */ - if (!docs.index) { +exports.resolveBorrows = function(doclets) { + var doclet; + + if (!doclets.index) { logger.error('Unable to resolve borrowed symbols, because the docs have not been indexed.'); return; } - docs.forEach(function(doc) { - if (doc.borrowed) { - doc.borrowed.forEach(function(b, i) { - var lent = docs.index[b.from], // lent is an array - asName = b.as || b.from; + for (var i = 0, l = doclets.index.borrowed.length; i < l; i++) { + doclet = doclets.index.borrowed[i]; - if (lent) { - var cloned = doop(lent); + cloneBorrowedDoclets(doclet, doclets); + delete doclet.borrowed; + } - cloned.forEach(function(clone) { - asName = asName.replace(/^prototype\./, '#'); - var parts = asName.split('#'); - - if (parts.length === 2) { clone.scope = 'instance'; } - else { clone.scope = 'static'; } - - asName = parts.pop(); - clone.name = asName; - clone.memberof = doc.longname; - clone.longname = clone.memberof + (clone.scope === 'instance' ? '#' : '.') + - clone.name; - docs.push(clone); - }); - - } - }); - - delete doc.borrowed; - } - }); + doclets.index.borrowed = []; }; diff --git a/node_modules/jsdoc/lib/jsdoc/config.js b/node_modules/jsdoc/lib/jsdoc/config.js index 6e95bfd..ee09b68 100644 --- a/node_modules/jsdoc/lib/jsdoc/config.js +++ b/node_modules/jsdoc/lib/jsdoc/config.js @@ -26,7 +26,8 @@ function mergeRecurse(target, source) { // required config values, override these defaults in your config.json if necessary var defaults = { tags: { - allowUnknownTags: true + allowUnknownTags: true, + dictionaries: ['jsdoc', 'closure'] }, templates: { monospaceLinks: false, diff --git a/node_modules/jsdoc/lib/jsdoc/doclet.js b/node_modules/jsdoc/lib/jsdoc/doclet.js index deb2d2e..4e7ecef 100644 --- a/node_modules/jsdoc/lib/jsdoc/doclet.js +++ b/node_modules/jsdoc/lib/jsdoc/doclet.js @@ -19,9 +19,6 @@ var jsdoc = { tag: { Tag: require('jsdoc/tag').Tag, dictionary: require('jsdoc/tag/dictionary') - }, - util: { - doop: require('jsdoc/util/doop') } }; var path = require('jsdoc/path'); @@ -80,29 +77,33 @@ function unwrap(docletSrc) { return docletSrc; } -function split(docletSrc) { - var tagSrcs = []; +/** + * Convert the raw source of the doclet comment into an array of pseudo-Tag objects. + * @private + */ +function toTags(docletSrc) { + var parsedTag; + var tagData = []; + var tagText; + var tagTitle; // split out the basic tags, keep surrounding whitespace // like: @tagTitle tagBody docletSrc - .replace(/^(\s*)@(\S)/gm, '$1\\@$2') // replace splitter ats with an arbitrary sequence - .split('\\@') // then split on that arbitrary sequence + // replace splitter ats with an arbitrary sequence + .replace(/^(\s*)@(\S)/gm, '$1\\@$2') + // then split on that arbitrary sequence + .split('\\@') .forEach(function($) { - var parsedTag; - var tagText; - var tagTitle; - if ($) { - parsedTag = $.match(/^(\S+)(:?\s+(\S[\s\S]*))?/); + parsedTag = $.match(/^(\S+)(?:\s+(\S[\s\S]*))?/); if (parsedTag) { - // we don't need parsedTag[0] tagTitle = parsedTag[1]; tagText = parsedTag[2]; if (tagTitle) { - tagSrcs.push({ + tagData.push({ title: tagTitle, text: tagText }); @@ -111,31 +112,30 @@ function split(docletSrc) { } }); - return tagSrcs; -} - -/** - * Convert the raw source of the doclet comment into an array of Tag objects. - * @private - */ -function toTags(docletSrc) { - var tags = []; - var tagSrcs = split(docletSrc); - - for (var i = 0, l = tagSrcs.length; i < l; i++) { - tags.push({ title: tagSrcs[i].title, text: tagSrcs[i].text }); - } - - return tags; + return tagData; } function fixDescription(docletSrc) { - if (!/^\s*@/.test(docletSrc)) { + if (!/^\s*@/.test(docletSrc) && docletSrc.replace(/\s/g, '').length) { docletSrc = '@description ' + docletSrc; } return docletSrc; } +/** + * Replace the existing tag dictionary with a new tag dictionary. + * + * Used for testing only. + * + * @private + * @param {module:jsdoc/tag/dictionary.Dictionary} dict - The new tag dictionary. + */ +exports._replaceDictionary = function _replaceDictionary(dict) { + jsdoc.tag.dictionary = dict; + require('jsdoc/tag')._replaceDictionary(dict); + require('jsdoc/util/templateHelper')._replaceDictionary(dict); +}; + /** * @class * @classdesc Represents a single JSDoc comment. @@ -217,7 +217,7 @@ Doclet.prototype.addTag = function(title, text) { }; function removeGlobal(longname) { - var globalRegexp = new RegExp('^' + jsdoc.name.GLOBAL_LONGNAME + '\\.?'); + var globalRegexp = new RegExp('^' + jsdoc.name.LONGNAMES.GLOBAL + '\\.?'); return longname.replace(globalRegexp, ''); } @@ -233,7 +233,7 @@ Doclet.prototype.setMemberof = function(sid) { * @type string */ this.memberof = removeGlobal(sid) - .replace(/\.prototype/g, jsdoc.name.INSTANCE); + .replace(/\.prototype/g, jsdoc.name.SCOPE.PUNC.INSTANCE); }; /** @@ -270,22 +270,22 @@ function getFilepath(doclet) { /** * Set the doclet's `scope` property. Must correspond to a scope name that is defined in - * {@link module:jsdoc/name.SCOPE_NAMES}. + * {@link module:jsdoc/name.SCOPE.NAMES}. * - * @param {module:jsdoc/name.SCOPE_NAMES} scope - The scope for the doclet relative to the symbol's + * @param {module:jsdoc/name.SCOPE.NAMES} scope - The scope for the doclet relative to the symbol's * parent. * @throws {Error} If the scope name is not recognized. */ Doclet.prototype.setScope = function(scope) { var errorMessage; var filepath; - var scopeNames = Object.keys(jsdoc.name.SCOPE_NAMES); + var scopeNames = _.values(jsdoc.name.SCOPE.NAMES); if (scopeNames.indexOf(scope) === -1) { filepath = getFilepath(this); - errorMessage = util.format('The scope name "%s" is not recognized. Use one of the names ' + - 'defined in module:jsdoc/name.SCOPE_NAMES.', scope); + errorMessage = util.format('The scope name "%s" is not recognized. Use one of the ' + + 'following values: %j', scope, scopeNames); if (filepath) { errorMessage += util.format(' (Source file: %s)', filepath); } diff --git a/node_modules/jsdoc/lib/jsdoc/name.js b/node_modules/jsdoc/lib/jsdoc/name.js index aee46a8..7aa0c1c 100644 --- a/node_modules/jsdoc/lib/jsdoc/name.js +++ b/node_modules/jsdoc/lib/jsdoc/name.js @@ -1,59 +1,91 @@ /** A collection of functions relating to JSDoc symbol name manipulation. @module jsdoc/name - @requires jsdoc/tag/dictionary @author Michael Mathews @license Apache License 2.0 - See file 'LICENSE.md' in this project. */ 'use strict'; var _ = require('underscore'); +var escape = require('escape-string-regexp'); -// Longname used for doclets whose actual longname cannot be identified. -var ANONYMOUS_LONGNAME = exports.ANONYMOUS_LONGNAME = ''; -// Longname used for doclets in global scope. -var GLOBAL_LONGNAME = exports.GLOBAL_LONGNAME = ''; -var INNER = exports.INNER = '~'; -var INSTANCE = exports.INSTANCE = '#'; -var MODULE_PREFIX = exports.MODULE_PREFIX = 'module:'; -// Scope identifiers. -var SCOPE_NAMES = exports.SCOPE_NAMES = { - global: 'global', - inner: 'inner', - instance: 'instance', - 'static': 'static' +var hasOwnProp = Object.prototype.hasOwnProperty; + +/** + * Longnames that have a special meaning in JSDoc. + * + * @enum {string} + * @static + * @memberof module:jsdoc/name + */ +var LONGNAMES = exports.LONGNAMES = { + /** Longname used for doclets that do not have a longname, such as anonymous functions. */ + ANONYMOUS: '', + /** Longname that represents global scope. */ + GLOBAL: '' }; -var STATIC = exports.STATIC = '.'; + +// Module namespace prefix. +var MODULE_NAMESPACE = 'module:'; + +/** + * Names and punctuation marks that identify doclet scopes. + * + * @enum {string} + * @static + * @memberof module:jsdoc/name + */ +var SCOPE = exports.SCOPE = { + NAMES: { + GLOBAL: 'global', + INNER: 'inner', + INSTANCE: 'instance', + STATIC: 'static' + }, + PUNC: { + INNER: '~', + INSTANCE: '#', + STATIC: '.' + } +}; + +// For backwards compatibility, this enum must use lower-case keys var scopeToPunc = exports.scopeToPunc = { - 'inner': INNER, - 'instance': INSTANCE, - 'static': STATIC + 'inner': SCOPE.PUNC.INNER, + 'instance': SCOPE.PUNC.INSTANCE, + 'static': SCOPE.PUNC.STATIC }; var puncToScope = exports.puncToScope = _.invert(scopeToPunc); -var DEFAULT_SCOPE = SCOPE_NAMES.static; -var REGEXP_SCOPE_PUNC = '([' + INNER + INSTANCE + STATIC + '])'; +var DEFAULT_SCOPE = SCOPE.NAMES.STATIC; +var SCOPE_PUNC = _.values(SCOPE.PUNC); +var SCOPE_PUNC_STRING = '[' + SCOPE_PUNC.join() + ']'; +var REGEXP_LEADING_SCOPE = new RegExp('^(' + SCOPE_PUNC_STRING + ')'); +var REGEXP_TRAILING_SCOPE = new RegExp('(' + SCOPE_PUNC_STRING + ')$'); + +var DESCRIPTION = '(?:(?:[ \\t]*\\-\\s*|\\s+)(\\S[\\s\\S]*))?$'; +var REGEXP_DESCRIPTION = new RegExp(DESCRIPTION); +var REGEXP_NAME_DESCRIPTION = new RegExp('^(\\[[^\\]]+\\]|\\S+)' + DESCRIPTION); function nameIsLongname(name, memberof) { - var regexp = new RegExp('^' + memberof + REGEXP_SCOPE_PUNC); + var regexp = new RegExp('^' + escape(memberof) + SCOPE_PUNC_STRING); return regexp.test(name); } function prototypeToPunc(name) { - return name.replace(/(?:^|\.)prototype\.?/g, INSTANCE); + return name.replace(/(?:^|\.)prototype\.?/g, SCOPE.PUNC.INSTANCE); } +// TODO: deprecate exports.resolve in favor of a better name /** Resolves the longname, memberof, variation and name values of the given doclet. @param {module:jsdoc/doclet.Doclet} doclet */ exports.resolve = function(doclet) { var about = {}; - var leadingScope = new RegExp('^' + REGEXP_SCOPE_PUNC); var memberof = doclet.memberof || ''; var name = doclet.name ? String(doclet.name) : ''; - var trailingScope = new RegExp(REGEXP_SCOPE_PUNC + '$'); var parentDoc; @@ -67,7 +99,7 @@ exports.resolve = function(doclet) { // member of a var in an outer scope? if (name && !memberof && doclet.meta.code && doclet.meta.code.funcscope) { - name = doclet.longname = doclet.meta.code.funcscope + INNER + name; + name = doclet.longname = doclet.meta.code.funcscope + SCOPE.PUNC.INNER + name; } if (memberof || doclet.forceMemberof) { // @memberof tag given @@ -79,7 +111,7 @@ exports.resolve = function(doclet) { } // the name and memberof are identical and refer to a module, // like @name module:foo, @memberof module:foo (probably a member like 'var exports') - else if (name && name === memberof && name.indexOf(MODULE_PREFIX) === 0) { + else if (name && name === memberof && name.indexOf(MODULE_NAMESPACE) === 0) { about = exports.shorten(name, (doclet.forceMemberof ? memberof : undefined)); } // the name and memberof are identical, like @name foo, @memberof foo @@ -89,7 +121,7 @@ exports.resolve = function(doclet) { about = exports.shorten(name, (doclet.forceMemberof ? memberof : undefined)); } // like @memberof foo# or @memberof foo~ - else if (name && trailingScope.test(memberof) ) { + else if (name && REGEXP_TRAILING_SCOPE.test(memberof) ) { about = exports.shorten(memberof + name, (doclet.forceMemberof ? memberof : undefined)); } else if (name && doclet.scope) { @@ -113,30 +145,28 @@ exports.resolve = function(doclet) { doclet.setLongname(about.longname); } - if (doclet.scope === 'global') { // via @global tag? + if (doclet.scope === SCOPE.NAMES.GLOBAL) { // via @global tag? doclet.setLongname(doclet.name); delete doclet.memberof; } else if (about.scope) { - if (about.memberof === GLOBAL_LONGNAME) { // via @memberof ? - doclet.scope = 'global'; + if (about.memberof === LONGNAMES.GLOBAL) { // via @memberof ? + doclet.scope = SCOPE.NAMES.GLOBAL; } else { doclet.scope = puncToScope[about.scope]; } } - else { - if (doclet.name && doclet.memberof && !doclet.longname) { - if ( leadingScope.test(doclet.name) ) { - doclet.scope = puncToScope[RegExp.$1]; - doclet.name = doclet.name.substr(1); - } - else { - doclet.scope = DEFAULT_SCOPE; - } - - doclet.setLongname(doclet.memberof + scopeToPunc[doclet.scope] + doclet.name); + else if (doclet.name && doclet.memberof && !doclet.longname) { + if ( REGEXP_LEADING_SCOPE.test(doclet.name) ) { + doclet.scope = puncToScope[RegExp.$1]; + doclet.name = doclet.name.substr(1); } + else { + doclet.scope = DEFAULT_SCOPE; + } + + doclet.setLongname(doclet.memberof + scopeToPunc[doclet.scope] + doclet.name); } if (about.variation) { @@ -149,12 +179,6 @@ exports.resolve = function(doclet) { } }; -// TODO: make this a private method, or remove it if possible -RegExp.escape = RegExp.escape || function(str) { - var specials = new RegExp('[.*+?|()\\[\\]{}\\\\]', 'g'); // .*+?|()[]{}\ - return str.replace(specials, '\\$&'); -}; - /** @method module:jsdoc/name.applyNamespace @param {string} longname The full longname of the symbol. @@ -167,24 +191,61 @@ exports.applyNamespace = function(longname, ns) { longname = nameParts.longname; if ( !/^[a-zA-Z]+?:.+$/i.test(name) ) { - longname = longname.replace( new RegExp(RegExp.escape(name) + '$'), ns + ':' + name ); + longname = longname.replace( new RegExp(escape(name) + '$'), ns + ':' + name ); } return longname; }; -/** - Given a longname like "a.b#c(2)", slice it up into ["a.b", "#", 'c', '2'], - representing the memberof, the scope, the name, and variation. - @param {string} longname - @param {string} forcedMemberof - @returns {object} Representing the properties of the given name. - */ -exports.shorten = function(longname, forcedMemberof) { - // quoted strings in a longname are atomic, convert to tokens - var atoms = [], token; +// TODO: docs +exports.stripNamespace = function(longname) { + return longname.replace(/^[a-zA-Z]+:/, ''); +}; - // handle quoted names like foo["bar"] or foo['bar'] +/** + * Check whether a parent longname is an ancestor of a child longname. + * + * @param {string} parent - The parent longname. + * @param {string} child - The child longname. + * @return {boolean} `true` if the parent is an ancestor of the child; otherwise, `false`. + */ +exports.hasAncestor = function(parent, child) { + var hasAncestor = false; + var memberof = child; + + if (!parent || !child) { + return hasAncestor; + } + + // fast path for obvious non-ancestors + if (child.indexOf(parent) !== 0) { + return hasAncestor; + } + + do { + memberof = exports.shorten(memberof).memberof; + + if (memberof === parent) { + hasAncestor = true; + } + } while (!hasAncestor && memberof); + + return hasAncestor; +}; + +// TODO: docs +function atomize(longname, sliceChars, forcedMemberof) { + var i; + var memberof = ''; + var name = ''; + var parts; + var partsRegExp; + var scopePunc = ''; + var token; + var tokens = []; + var variation; + + // quoted strings in a longname are atomic, so we convert them to tokens longname = longname.replace(/(\[?["'].+?["']\]?)/g, function($) { var dot = ''; if ( /^\[/.test($) ) { @@ -192,34 +253,31 @@ exports.shorten = function(longname, forcedMemberof) { $ = $.replace( /^\[/g, '' ).replace( /\]$/g, '' ); } - token = '@{' + atoms.length + '}@'; - atoms.push($); + token = '@{' + tokens.length + '}@'; + tokens.push($); return dot + token; // foo["bar"] => foo.@{1}@ }); - var name = '', - scope = '', // ., ~, or # - memberof = '', - parts, - variation; - longname = prototypeToPunc(longname); - if (typeof forcedMemberof !== 'undefined') { + if (forcedMemberof !== undefined) { + partsRegExp = new RegExp('^(.*?)([' + sliceChars.join() + ']?)$'); name = longname.substr(forcedMemberof.length); - parts = forcedMemberof.match(/^(.*?)([#.~]?)$/); + parts = forcedMemberof.match(partsRegExp); - if (parts[1]) { memberof = parts[1] || forcedMemberof; } - if (parts[2]) { scope = parts[2]; } + if (parts[1]) { + memberof = parts[1] || forcedMemberof; + } + if (parts[2]) { + scopePunc = parts[2]; + } } - else { - parts = longname ? - (longname.match( /^(:?(.+)([#.~]))?(.+?)$/ ) || []).reverse() : - ['']; - - name = parts[0] || ''; // ensure name is always initialised to avoid error being thrown when calling replace on undefined [gh-24] - scope = parts[1] || ''; // ., ~, or # + else if (longname) { + parts = (longname.match(new RegExp('^(:?(.+)([' + sliceChars.join() + ']))?(.+?)$')) || []) + .reverse(); + name = parts[0] || ''; + scopePunc = parts[1] || ''; memberof = parts[2] || ''; } @@ -229,19 +287,168 @@ exports.shorten = function(longname, forcedMemberof) { variation = RegExp.$2; } - //// restore quoted strings back again - var i = atoms.length; + // restore quoted strings + i = tokens.length; while (i--) { - longname = longname.replace('@{' + i + '}@', atoms[i]); - memberof = memberof.replace('@{' + i + '}@', atoms[i]); - scope = scope.replace('@{' + i + '}@', atoms[i]); - name = name.replace('@{' + i + '}@', atoms[i]); + longname = longname.replace('@{' + i + '}@', tokens[i]); + memberof = memberof.replace('@{' + i + '}@', tokens[i]); + scopePunc = scopePunc.replace('@{' + i + '}@', tokens[i]); + name = name.replace('@{' + i + '}@', tokens[i]); } - //// - return {longname: longname, memberof: memberof, scope: scope, name: name, variation: variation}; + return { + longname: longname, + memberof: memberof, + scope: scopePunc, + name: name, + variation: variation + }; +} + +// TODO: deprecate exports.shorten in favor of a better name +/** + Given a longname like "a.b#c(2)", slice it up into an object + containing the memberof, the scope, the name, and variation. + @param {string} longname + @param {string} forcedMemberof + @returns {object} Representing the properties of the given name. + */ +exports.shorten = function(longname, forcedMemberof) { + return atomize(longname, SCOPE_PUNC, forcedMemberof); }; +// TODO: docs +exports.combine = function(parts) { + return '' + + (parts.memberof || '') + + (parts.scope || '') + + (parts.name || '') + + (parts.variation || ''); +}; + +// TODO: docs +exports.stripVariation = function(name) { + var parts = exports.shorten(name); + + parts.variation = ''; + + return exports.combine(parts); +}; + +function splitLongname(longname, options) { + var chunks = []; + var currentNameInfo; + var nameInfo = {}; + var previousName = longname; + var splitters = SCOPE_PUNC.concat('/'); + + options = _.defaults(options || {}, { + includeVariation: true + }); + + do { + if (!options.includeVariation) { + previousName = exports.stripVariation(previousName); + } + currentNameInfo = nameInfo[previousName] = atomize(previousName, splitters); + previousName = currentNameInfo.memberof; + chunks.push(currentNameInfo.scope + currentNameInfo.name); + } while (previousName); + + return { + chunks: chunks.reverse(), + nameInfo: nameInfo + }; +} + +// TODO: docs +exports.longnamesToTree = function longnamesToTree(longnames, doclets) { + var splitOptions = { includeVariation: false }; + var tree = {}; + + longnames.forEach(function(longname) { + var currentLongname = ''; + var currentParent = tree; + var nameInfo; + var processed; + + // don't try to add empty longnames to the tree + if (!longname) { + return; + } + + processed = splitLongname(longname, splitOptions); + nameInfo = processed.nameInfo; + + processed.chunks.forEach(function(chunk) { + currentLongname += chunk; + + if (currentParent !== tree) { + currentParent.children = currentParent.children || {}; + currentParent = currentParent.children; + } + + if (!hasOwnProp.call(currentParent, chunk)) { + currentParent[chunk] = nameInfo[currentLongname]; + } + + if (currentParent[chunk]) { + currentParent[chunk].doclet = doclets ? doclets[currentLongname] : null; + currentParent = currentParent[chunk]; + } + }); + }); + + return tree; +}; + +/** + Split a string that starts with a name and ends with a description into its parts. + Allows the defaultvalue (if present) to contain brackets. If the name is found to have + mismatched brackets, null is returned. + @param {string} nameDesc + @returns {object} Hash with "name" and "description" properties. + */ +function splitNameMatchingBrackets(nameDesc) { + var buffer = []; + var c; + var stack = 0; + var stringEnd = null; + + for (var i = 0; i < nameDesc.length; ++i) { + c = nameDesc[i]; + buffer.push(c); + + if (stringEnd) { + if (c === '\\' && i + 1 < nameDesc.length) { + buffer.push(nameDesc[++i]); + } else if (c === stringEnd) { + stringEnd = null; + } + } else if (c === '"' || c === "'") { + stringEnd = c; + } else if (c === '[') { + ++stack; + } else if (c === ']') { + if (--stack === 0) { + break; + } + } + } + + if (stack || stringEnd) { + return null; + } + + nameDesc.substr(i).match(REGEXP_DESCRIPTION); + return { + name: buffer.join(''), + description: RegExp.$1 + }; +} + + +// TODO: deprecate exports.splitName in favor of a better name /** Split a string that starts with a name and ends with a description into its parts. @param {string} nameDesc @@ -251,9 +458,19 @@ exports.splitName = function(nameDesc) { // like: name, [name], name text, [name] text, name - text, or [name] - text // the hyphen must be on the same line as the name; this prevents us from treating a Markdown // dash as a separator - nameDesc.match(/^(\[[^\]]+\]|\S+)((?:[ \t]*\-\s*|\s+)(\S[\s\S]*))?$/); + + // optional values get special treatment + var result = null; + if (nameDesc[0] === '[') { + result = splitNameMatchingBrackets(nameDesc); + if (result !== null) { + return result; + } + } + + nameDesc.match(REGEXP_NAME_DESCRIPTION); return { name: RegExp.$1, - description: RegExp.$3 + description: RegExp.$2 }; }; diff --git a/node_modules/jsdoc/lib/jsdoc/opts/argparser.js b/node_modules/jsdoc/lib/jsdoc/opts/argparser.js index c33db9d..e4fa0d0 100644 --- a/node_modules/jsdoc/lib/jsdoc/opts/argparser.js +++ b/node_modules/jsdoc/lib/jsdoc/opts/argparser.js @@ -7,6 +7,7 @@ 'use strict'; var _ = require('underscore'); +var util = require('util'); var hasOwnProp = Object.prototype.hasOwnProperty; @@ -14,6 +15,7 @@ var hasOwnProp = Object.prototype.hasOwnProperty; * Create an instance of the parser. * @classdesc A parser to interpret the key-value pairs entered on the command line. * @constructor + * @alias module:jsdoc/opts/argparser */ var ArgParser = function() { this._options = []; @@ -236,7 +238,6 @@ ArgParser.prototype.parse = function(args, defaults) { // like -t if (arg.charAt(0) === '-') { - // like --template if (arg.charAt(1) === '-') { name = longName = arg.slice(2); @@ -248,7 +249,7 @@ ArgParser.prototype.parse = function(args, defaults) { } if (option === null) { - throw new Error( 'Unknown command line option found: ' + name ); + throw new Error( util.format('Unknown command-line option "%s".', name) ); } if (option.hasValue) { @@ -256,7 +257,7 @@ ArgParser.prototype.parse = function(args, defaults) { i++; if (value === null || value.charAt(0) === '-') { - throw new Error( 'Command line option requires a value: ' + name ); + throw new Error( util.format('The command-line option "%s" requires a value.', name) ); } } else { diff --git a/node_modules/jsdoc/lib/jsdoc/opts/args.js b/node_modules/jsdoc/lib/jsdoc/opts/args.js index bddd565..1448bba 100644 --- a/node_modules/jsdoc/lib/jsdoc/opts/args.js +++ b/node_modules/jsdoc/lib/jsdoc/opts/args.js @@ -73,25 +73,26 @@ function parseQuery(str) { return result; } -argParser.addOption('t', 'template', true, 'The path to the template to use. Default: path/to/jsdoc/templates/default'); +argParser.addOption('a', 'access', true, 'Only display symbols with the given access: "public", "protected", "private" or "undefined", or "all" for all access levels. Default: all except "private"', true); argParser.addOption('c', 'configure', true, 'The path to the configuration file. Default: path/to/jsdoc/conf.json'); -argParser.addOption('e', 'encoding', true, 'Assume this encoding when reading all source files. Default: utf8'); -argParser.addOption('T', 'test', false, 'Run all tests and quit.'); argParser.addOption('d', 'destination', true, 'The path to the output folder. Use "console" to dump data to the console. Default: ./out/'); -argParser.addOption('p', 'private', false, 'Display symbols marked with the @private tag. Default: false'); -argParser.addOption('r', 'recurse', false, 'Recurse into subdirectories when scanning for source code files.'); +argParser.addOption('', 'debug', false, 'Log information for debugging JSDoc. On Rhino, launches the debugger when passed as the first option.'); +argParser.addOption('e', 'encoding', true, 'Assume this encoding when reading all source files. Default: utf8'); argParser.addOption('h', 'help', false, 'Print this message and quit.'); -argParser.addOption('X', 'explain', false, 'Dump all found doclet internals to console and quit.'); +argParser.addOption('', 'match', true, 'When running tests, only use specs whose names contain .', true); +argParser.addOption('', 'nocolor', false, 'When running tests, do not use color in console output.'); +argParser.addOption('p', 'private', false, 'Display symbols marked with the @private tag. Equivalent to "--access all". Default: false'); +argParser.addOption('P', 'package', true, 'The path to the project\'s package file. Default: path/to/sourcefiles/package.json'); +argParser.addOption('', 'pedantic', false, 'Treat errors as fatal errors, and treat warnings as errors. Default: false'); argParser.addOption('q', 'query', true, 'A query string to parse and store in env.opts.query. Example: foo=bar&baz=true', false, parseQuery); +argParser.addOption('r', 'recurse', false, 'Recurse into subdirectories when scanning for source files and tutorials.'); +argParser.addOption('R', 'readme', true, 'The path to the project\'s README file. Default: path/to/sourcefiles/README.md'); +argParser.addOption('t', 'template', true, 'The path to the template to use. Default: path/to/jsdoc/templates/default'); +argParser.addOption('T', 'test', false, 'Run all tests and quit.'); argParser.addOption('u', 'tutorials', true, 'Directory in which JSDoc should search for tutorials.'); argParser.addOption('v', 'version', false, 'Display the version number and quit.'); -argParser.addOption('', 'debug', false, 'Log information for debugging JSDoc. On Rhino, launches the debugger when passed as the first option.'); argParser.addOption('', 'verbose', false, 'Log detailed information to the console as JSDoc runs.'); -argParser.addOption('', 'pedantic', false, 'Treat errors as fatal errors, and treat warnings as errors. Default: false'); - -// Options specific to tests -argParser.addOption(null, 'match', true, 'Only run tests containing .', true); -argParser.addOption(null, 'nocolor', false, 'Do not use color in console output from tests.'); +argParser.addOption('X', 'explain', false, 'Dump all found doclet internals to console and quit.'); // Options that are no longer supported and should be ignored argParser.addIgnoredOption('l', 'lenient'); // removed in JSDoc 3.3.0 @@ -122,6 +123,7 @@ exports.help = function() { /** * Get a named option. + * @variation name * @param {string} name The name of the option. * @return {string} The value associated with the given name. *//** diff --git a/node_modules/jsdoc/lib/jsdoc/package.js b/node_modules/jsdoc/lib/jsdoc/package.js index 135c9ab..1a60a3b 100644 --- a/node_modules/jsdoc/lib/jsdoc/package.js +++ b/node_modules/jsdoc/lib/jsdoc/package.js @@ -1,70 +1,254 @@ -/** - @overview - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ 'use strict'; +var logger = require('jsdoc/util/logger'); + /** - @module jsdoc/package - @see http://wiki.commonjs.org/wiki/Packages/1.0 + * Provides access to information about a JavaScript package. + * + * @module jsdoc/package + * @see https://www.npmjs.org/doc/files/package.json.html + */ + +// Collect all of the license information from a `package.json` file. +function getLicenses(packageInfo) { + var licenses = packageInfo.licenses ? packageInfo.licenses.slice(0) : []; + + if (packageInfo.license) { + licenses.push({ type: packageInfo.license }); + } + + return licenses; +} + +/** + * Information about where to report bugs in the package. + * + * @typedef {Object} module:jsdoc/package.Package~BugInfo + * @property {string} email - The email address for reporting bugs. + * @property {string} url - The URL for reporting bugs. */ /** - @class - @classdesc Represents a JavaScript package. - @param {string} json - The contents of package.json. + * Information about a package's software license. + * + * @typedef {Object} module:jsdoc/package.Package~LicenseInfo + * @property {string} type - An identifier for the type of license. + * @property {string} url - The URL for the complete text of the license. + */ + +/** + * Information about a package author or contributor. + * + * @typedef {Object} module:jsdoc/package.Package~PersonInfo + * @property {string} name - The person's full name. + * @property {string} email - The person's email address. + * @property {string} url - The URL of the person's website. + */ + +/** + * Information about a package's version-control repository. + * + * @typedef {Object} module:jsdoc/package.Package~RepositoryInfo + * @property {string} type - The type of version-control system that the repository uses (for + * example, `git` or `svn`). + * @property {string} url - The URL for the repository. + */ + +/** + * Information about a JavaScript package. JSDoc can extract package information from + * `package.json` files that follow the + * [npm specification](https://www.npmjs.org/doc/files/package.json.html). + * + * **Note**: JSDoc does not validate or normalize the contents of `package.json` files. If your + * `package.json` file does not follow the npm specification, some properties of the `Package` + * object may not use the format documented here. + * + * @class + * @param {string} json - The contents of the `package.json` file. */ exports.Package = function(json) { - json = json || '{}'; + var packageInfo; - /** The source files associated with this package. - @type {Array} + /** + * The string identifier that is shared by all `Package` objects. + * + * @readonly + * @default + * @type {string} + */ + this.kind = 'package'; + + try { + packageInfo = JSON.parse(json || '{}'); + } + catch (e) { + logger.error('Unable to parse the package file: %s', e.message); + packageInfo = {}; + } + + if (packageInfo.name) { + /** + * The package name. + * + * @type {string} + */ + this.name = packageInfo.name; + } + + /** + * The unique longname for this `Package` object. + * + * @type {string} + */ + this.longname = this.kind + ':' + this.name; + + if (packageInfo.author) { + /** + * The author of this package. Contains either a + * {@link module:jsdoc/package.Package~PersonInfo PersonInfo} object or a string with + * information about the author. + * + * @type {(module:jsdoc/package.Package~PersonInfo|string)} + * @since 3.3.0 + */ + this.author = packageInfo.author; + } + + if (packageInfo.bugs) { + /** + * Information about where to report bugs in the project. May contain a URL, as a string, or + * an object with more detailed information. + * + * @type {(string|module:jsdoc/package.Package~BugInfo)} + * @since 3.3.0 + */ + this.bugs = packageInfo.bugs; + } + + if (packageInfo.contributors) { + /** + * The contributors to this package. + * + * @type {Array.<(module:jsdoc/package.Package~PersonInfo|string)>} + * @since 3.3.0 + */ + this.contributors = packageInfo.contributors; + } + + if (packageInfo.dependencies) { + /** + * The dependencies for this package. + * + * @type {Object} + * @since 3.3.0 + */ + this.dependencies = packageInfo.dependencies; + } + + if (packageInfo.description) { + /** + * A brief description of the package. + * + * @type {string} + */ + this.description = packageInfo.description; + } + + if (packageInfo.devDependencies) { + /** + * The development dependencies for this package. + * + * @type {Object} + * @since 3.3.0 + */ + this.devDependencies = packageInfo.devDependencies; + } + + if (packageInfo.engines) { + /** + * The JavaScript engines that this package supports. Each key is a string that identifies the + * engine (for example, `node`). Each value is a + * [semver](https://www.npmjs.org/doc/misc/semver.html)-compliant version number for the engine. + * + * @type {Object} + * @since 3.3.0 + */ + this.engines = packageInfo.engines; + } + + /** + * The source files associated with the package. + * + * New `Package` objects always contain an empty array, regardless of whether the `package.json` + * file includes a `files` property. + * + * After JSDoc parses your input files, it sets this property to a list of paths to your input + * files. + * + * @type {Array.} */ this.files = []; - /** The kind of this package. - @readonly - @default - @type {string} - */ - this.kind = 'package'; + if (packageInfo.homepage) { + /** + * The URL for the package's homepage. + * + * @type {string} + * @since 3.3.0 + */ + this.homepage = packageInfo.homepage; + } - json = JSON.parse(json); + if (packageInfo.keywords) { + /** + * Keywords to help users find the package. + * + * @type {Array.} + * @since 3.3.0 + */ + this.keywords = packageInfo.keywords; + } - /** The name of this package. - This value is found in the package.json file passed in as a command line option. - @type {string} - */ - this.name = json.name; + if (packageInfo.license || packageInfo.licenses) { + /** + * The licenses used by this package. Combines information from the `package.json` file's + * `license` property and the deprecated `licenses` property. + * + * @type {Array.} + */ + this.licenses = getLicenses(packageInfo); + } - /** The longname of this package. - @type {string} - */ - this.longname = this.kind + ':' + this.name; + if (packageInfo.main) { + /** + * The module ID that provides the primary entry point to the package. For example, if your + * package is a CommonJS module, and the value of this property is `foo`, users should be able + * to load your module with `require('foo')`. + * + * @type {string} + * @since 3.3.0 + */ + this.main = packageInfo.main; + } - /** The description of this package. - @type {string} - */ - this.description = json.description; + if (packageInfo.repository) { + /** + * The version-control repository for the package. + * + * @type {module:jsdoc/package.Package~RepositoryInfo} + * @since 3.3.0 + */ + this.repository = packageInfo.repository; + } - /** - The hash summary of the source file. - @type {string} - @since 3.2.0 - */ - this.version = json.version; - - /** - * The licenses of this package. - * @type {Array} - * @example - * "licenses": [ - * { - * "type": "GPLv2", - * "url": "http://www.example.com/licenses/gpl.html" - * } - * ] - */ - this.licenses = json.licenses; + if (packageInfo.version) { + /** + * The [semver](https://www.npmjs.org/doc/misc/semver.html)-compliant version number of the + * package. + * + * @type {string} + * @since 3.2.0 + */ + this.version = packageInfo.version; + } }; diff --git a/node_modules/jsdoc/lib/jsdoc/plugins.js b/node_modules/jsdoc/lib/jsdoc/plugins.js index a34fccc..92fb494 100644 --- a/node_modules/jsdoc/lib/jsdoc/plugins.js +++ b/node_modules/jsdoc/lib/jsdoc/plugins.js @@ -24,17 +24,17 @@ exports.installPlugins = function(plugins, parser) { plugin = require(plugins[i]); // allow user-defined plugins to... - //...register event handlers + // ...register event handlers if (plugin.handlers) { addHandlers(plugin.handlers, parser); } - //...define tags + // ...define tags if (plugin.defineTags) { plugin.defineTags(dictionary); } - //...add a Rhino node visitor (deprecated in JSDoc 3.3) + // ...add a Rhino node visitor (deprecated in JSDoc 3.3) if (plugin.nodeVisitor) { if ( !parser.addNodeVisitor ) { logger.error('Unable to add the Rhino node visitor from %s, because JSDoc ' + @@ -45,7 +45,7 @@ exports.installPlugins = function(plugins, parser) { } } - //...add a Mozilla Parser API node visitor + // ...add a Mozilla Parser API node visitor if (plugin.astNodeVisitor) { parser.addAstNodeVisitor(plugin.astNodeVisitor); } diff --git a/node_modules/jsdoc/lib/jsdoc/schema.js b/node_modules/jsdoc/lib/jsdoc/schema.js index 0444c6f..d7dc2b6 100644 --- a/node_modules/jsdoc/lib/jsdoc/schema.js +++ b/node_modules/jsdoc/lib/jsdoc/schema.js @@ -110,6 +110,11 @@ var TYPE_PROPERTY_SCHEMA = exports.TYPE_PROPERTY_SCHEMA = { items: { type: STRING } + }, + // type parser output + parsedType: { + type: OBJECT, + additionalProperties: true } } }; @@ -217,7 +222,8 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { // TODO: define this as an enumeration elsewhere enum: [ 'private', - 'protected' + 'protected', + 'public' ] }, alias: { @@ -329,14 +335,24 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { type: BOOLEAN, optional: true }, - implements: { + implementations: { type: ARRAY, optional: true, - uniqueItems: true, items: { type: STRING } }, + implements: { + type: ARRAY, + optional: true, + items: { + type: STRING + } + }, + inheritdoc: { + type: STRING, + optional: true + }, inherited: { type: BOOLEAN, optional: true @@ -363,6 +379,7 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { 'external', 'file', 'function', + 'interface', 'member', 'mixin', 'module', @@ -395,6 +412,11 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { }, // information about this doc meta: META_SCHEMA, + // was this doclet mixed in? + mixed: { + type: BOOLEAN, + optional: true + }, mixes: { type: ARRAY, optional: true, @@ -415,6 +437,15 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { optional: { type: BOOLEAN_OPTIONAL }, + // does this member explicitly override the parent? + override: { + type: BOOLEAN, + optional: true + }, + overrides: { + type: STRING, + optional: true + }, // are there function parameters associated with this doc? params: { type: ARRAY, @@ -559,18 +590,95 @@ var DOCLET_SCHEMA = exports.DOCLET_SCHEMA = { } }; +var CONTACT_INFO_SCHEMA = exports.CONTACT_INFO_SCHEMA = { + type: OBJECT, + additionalProperties: false, + properties: { + email: { + type: STRING, + optional: true + }, + name: { + type: STRING, + optional: true + }, + url: { + type: STRING, + optional: true, + format: 'uri' + } + } +}; + +var BUGS_SCHEMA = exports.BUGS_SCHEMA = { + type: OBJECT, + additionalProperties: false, + properties: { + email: { + type: STRING, + optional: true + }, + url: { + type: STRING, + optional: true, + format: 'uri' + } + } +}; + var PACKAGE_SCHEMA = exports.PACKAGE_SCHEMA = { type: OBJECT, additionalProperties: false, properties: { + author: { + anyOf: [STRING, CONTACT_INFO_SCHEMA], + optional: true + }, + bugs: { + anyOf: [STRING, BUGS_SCHEMA], + optional: true + }, + contributors: { + type: ARRAY, + optional: true, + minItems: 0, + items: { + anyOf: [STRING, CONTACT_INFO_SCHEMA] + } + }, + dependencies: { + type: OBJECT, + optional: true + }, description: { type: STRING, optional: true }, + devDependencies: { + type: OBJECT, + optional: true + }, + engines: { + type: OBJECT, + optional: true + }, files: { type: ARRAY, uniqueItems: true, - minItems: 1, + minItems: 0, + items: { + type: STRING + } + }, + homepage: { + type: STRING, + optional: true, + format: 'uri' + }, + keywords: { + type: ARRAY, + optional: true, + minItems: 0, items: { type: STRING } @@ -604,10 +712,30 @@ var PACKAGE_SCHEMA = exports.PACKAGE_SCHEMA = { optional: true, pattern: PACKAGE_REGEXP }, + main: { + type: STRING, + optional: true + }, name: { type: STRING, optional: true }, + repository: { + type: OBJECT, + optional: true, + additionalProperties: false, + properties: { + type: { + type: STRING, + optional: true + }, + // we don't use `format: 'uri'` here because repo URLs are atypical + url: { + type: STRING, + optional: true + } + } + }, version: { type: STRING, optional: true @@ -617,7 +745,6 @@ var PACKAGE_SCHEMA = exports.PACKAGE_SCHEMA = { var DOCLETS_SCHEMA = exports.DOCLETS_SCHEMA = { type: ARRAY, - uniqueItems: true, items: { anyOf: [DOCLET_SCHEMA, PACKAGE_SCHEMA] } diff --git a/node_modules/jsdoc/lib/jsdoc/src/astbuilder.js b/node_modules/jsdoc/lib/jsdoc/src/astbuilder.js index e31eba3..ed478e4 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/astbuilder.js +++ b/node_modules/jsdoc/lib/jsdoc/src/astbuilder.js @@ -1,6 +1,16 @@ 'use strict'; -var Syntax = require('jsdoc/src/syntax').Syntax; +var esprima = require('esprima'); +var jsdoc = { + src: { + syntax: require('jsdoc/src/syntax'), + Walker: require('jsdoc/src/walker').Walker + }, + util: { + logger: require('jsdoc/util/logger') + } +}; +var Syntax = jsdoc.src.syntax.Syntax; // TODO: should set e.stopPropagation == true for consistency with Rhino, right? var VISITOR_CONTINUE = true; @@ -110,16 +120,13 @@ function scrubComments(comments) { var AstBuilder = exports.AstBuilder = function() {}; function parse(source, filename, esprimaOpts) { - var esprima = require('esprima'); - var logger = require('jsdoc/util/logger'); - var ast; try { ast = esprima.parse(source, esprimaOpts); } catch (e) { - logger.error('Unable to parse %s: %s', filename, e.message); + jsdoc.util.logger.error('Unable to parse %s: %s', filename, e.message); } return ast; @@ -178,17 +185,16 @@ function CommentAttacher(comments, tokens) { this._tokens = tokens || []; this._tokenIndex = 0; - this._previousNodeEnd = 0; + this._previousNode = null; this._astRoot = null; - this._strayComments = []; - this._resetPendingComment() + this._resetPendingComments() ._resetCandidates(); } // TODO: docs -CommentAttacher.prototype._resetPendingComment = function() { - this._pendingComment = null; +CommentAttacher.prototype._resetPendingComments = function() { + this._pendingComments = []; this._pendingCommentRange = null; return this; @@ -214,7 +220,7 @@ CommentAttacher.prototype._nextToken = function() { // TODO: docs // find the index of the atom whose end position is closest to (but not after) the specified // position -CommentAttacher.prototype._nextIndexBefore = function(startIndex, atoms, position) { +CommentAttacher.prototype._nextIndexBefore = function(atoms, startIndex, position) { var atom; var newIndex = startIndex; @@ -237,7 +243,7 @@ CommentAttacher.prototype._nextIndexBefore = function(startIndex, atoms, positio CommentAttacher.prototype._advanceTokenIndex = function(node) { var position = node.range[0]; - this._tokenIndex = this._nextIndexBefore(this._tokenIndex, this._tokens, position); + this._tokenIndex = this._nextIndexBefore(this._tokens, this._tokenIndex, position); return this; }; @@ -245,33 +251,54 @@ CommentAttacher.prototype._advanceTokenIndex = function(node) { // TODO: docs CommentAttacher.prototype._fastForwardComments = function(node) { var position = node.range[0]; - var commentIndex = this._nextIndexBefore(0, this._comments, position); + var commentIndex = this._nextIndexBefore(this._comments, 0, position); - // all comments before the node (except the last one) are considered stray comments + // all comments before the node (except the last one) are pended if (commentIndex > 0) { - this._strayComments = this._strayComments.concat( this._comments.splice(0, + this._pendingComments = this._pendingComments.concat( this._comments.splice(0, commentIndex) ); } }; +CommentAttacher.prototype._attachPendingCommentsAsLeading = function(target) { + target.leadingComments = (target.leadingComments || []).concat(this._pendingComments); +}; + +CommentAttacher.prototype._attachPendingCommentsAsTrailing = function(target) { + target.trailingComments = (target.trailingComments || []).concat(this._pendingComments); +}; + // TODO: docs -CommentAttacher.prototype._attachPendingComment = function() { +CommentAttacher.prototype._attachPendingComments = function(currentNode) { var target; - if (!this._pendingComment) { + if (!this._pendingComments.length) { return this; } + // if there are one or more candidate nodes, attach the pending comments before the last + // candidate node if (this._candidates.length > 0) { target = this._candidates[this._candidates.length - 1]; - target.leadingComments = target.leadingComments || []; - target.leadingComments.push(this._pendingComment); + this._attachPendingCommentsAsLeading(target); } + // if we don't have a previous node, attach pending comments before the AST root; this should + // mean that we haven't encountered any other nodes yet, or that the source file contains + // JSDoc comments but not code + else if (!this._previousNode) { + target = this._astRoot; + this._attachPendingCommentsAsLeading(target); + } + // otherwise, the comments must come after the current node (or the last node of the AST, if + // we've run out of nodes) else { - this._strayComments.push(this._pendingComment); + this._attachPendingCommentsAsTrailing(currentNode || this._previousNode); } - this._resetPendingComment() + // update the previous node + this._previousNode = currentNode; + + this._resetPendingComments() ._resetCandidates(); return this; @@ -322,8 +349,8 @@ CommentAttacher.prototype.visit = function(node) { // now we can check whether the current node is in the right position to accept the next comment isEligible = this._isEligible(node); - // attach the pending comment, if there is one - this._attachPendingComment(); + // attach the pending comments, if any + this._attachPendingComments(node); // okay, now that we've done all that bookkeeping, we can check whether the current node accepts // leading comments and add it to the candidate list if needed @@ -334,8 +361,8 @@ CommentAttacher.prototype.visit = function(node) { } this._candidates.push(node); - // we have a candidate node, so pend the current comment if necessary - this._pendingComment = this._pendingComment || this._comments.splice(0, 1)[0]; + // we have a candidate node, so pend the current comment + this._pendingComments.push(this._comments.splice(0, 1)[0]); } return VISITOR_CONTINUE; @@ -343,44 +370,50 @@ CommentAttacher.prototype.visit = function(node) { // TODO: docs CommentAttacher.prototype.finish = function() { - // any remaining comments are stray comments - this._strayComments = this._strayComments.concat(this._comments); + var length = this._comments.length; - // deal with the pending comment, if there is one - this._attachPendingComment(); - - // attach stray comments to the AST root - if (this._strayComments.length) { - this._astRoot.trailingComments = this._strayComments.slice(0); + // any leftover comments are pended + if (length) { + this._pendingComments = this._pendingComments.concat( this._comments.splice(0, length) ); } + + // attach the pending comments, if any + this._attachPendingComments(); }; // TODO: docs // TODO: refactor to make this extensible /** + * @private * @param {string} filename - The full path to the source file. * @param {Object} ast - An abstract syntax tree that conforms to the Mozilla Parser API. */ AstBuilder.prototype._postProcess = function(filename, ast) { - var astnode = require('jsdoc/src/astnode'); - var Walker = require('jsdoc/src/walker').Walker; - var attachComments = !!ast.comments && !!ast.comments.length; - var commentAttacher = new CommentAttacher( scrubComments(ast.comments.slice(0)), ast.tokens ); - var visitor = { + var commentAttacher; + var scrubbed; + var visitor; + var walker; + + if (!attachComments) { + return; + } + + scrubbed = scrubComments(ast.comments.slice(0)); + commentAttacher = new CommentAttacher(scrubbed.slice(0), ast.tokens); + visitor = { visit: function(node) { - if (attachComments) { - attachComments = commentAttacher.visit(node); - } + return commentAttacher.visit(node); } }; + walker = new jsdoc.src.Walker(); - var walker = new Walker(); - walker.recurse(filename, ast, visitor); + walker.recurse(ast, visitor, filename); commentAttacher.finish(); - // remove the comment/token arrays; we no longer need then - ast.comments = []; + // replace the comments with the filtered comments + ast.comments = scrubbed; + // we no longer need the tokens ast.tokens = []; }; diff --git a/node_modules/jsdoc/lib/jsdoc/src/astnode.js b/node_modules/jsdoc/lib/jsdoc/src/astnode.js index 4127f19..a89e652 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/astnode.js +++ b/node_modules/jsdoc/lib/jsdoc/src/astnode.js @@ -1,20 +1,17 @@ // TODO: docs +/** @module jsdoc/src/astnode */ 'use strict'; -var doop = require('jsdoc/util/doop'); var Syntax = require('jsdoc/src/syntax').Syntax; var util = require('util'); // Counter for generating unique node IDs. var uid = 100000000; -// TODO: docs -// TODO: currently unused -var GLOBAL_NODE_ID = exports.GLOBAL_NODE_ID = require('jsdoc/name').GLOBAL_LONGNAME; - /** * Check whether an AST node represents a function. * + * @alias module:jsdoc/src/astnode.isFunction * @param {Object} node - The AST node to check. * @return {boolean} Set to `true` if the node is a function or `false` in all other cases. */ @@ -25,6 +22,7 @@ var isFunction = exports.isFunction = function(node) { /** * Check whether an AST node creates a new scope. * + * @alias module:jsdoc/src/astnode.isScope * @param {Object} node - The AST node to check. * @return {Boolean} Set to `true` if the node creates a new scope, or `false` in all other cases. */ @@ -66,30 +64,6 @@ var addNodeProperties = exports.addNodeProperties = function(node) { }; } - if (!node.knownVariables) { - newProperties.knownVariables = { - value: node.enclosingScope ? doop(node.enclosingScope.knownVariables) : {} - }; - } - - if (!node.ownedVariables) { - newProperties.ownedVariables = { - value: {} - }; - } - - if (!node.knownAliases) { - newProperties.knownAliases = { - value: node.enclosingScope ? doop(node.enclosingScope.knownAliases) : {} - }; - } - - if (!node.ownedAliases) { - newProperties.ownedAliases = { - value: {} - }; - } - if (debugEnabled && !node.parentId) { newProperties.parentId = { enumerable: true, @@ -113,21 +87,6 @@ var addNodeProperties = exports.addNodeProperties = function(node) { return node; }; -// TODO: docs -// TODO: currently unused -exports.makeGlobalNode = function() { - var node = { - name: GLOBAL_NODE_ID, - type: GLOBAL_NODE_ID - }; - - Object.defineProperty(node, 'nodeId', { - value: GLOBAL_NODE_ID - }); - - return addNodeProperties(node); -}; - // TODO: docs var nodeToString = exports.nodeToString = function(node) { var tempObject; @@ -138,8 +97,13 @@ var nodeToString = exports.nodeToString = function(node) { case Syntax.ArrayExpression: tempObject = []; node.elements.forEach(function(el, i) { + // handle sparse arrays. use `null` to represent missing values, consistent with + // JSON.stringify([,]). + if (!el) { + tempObject[i] = null; + } // preserve literal values so that the JSON form shows the correct type - if (el.type === Syntax.Literal) { + else if (el.type === Syntax.Literal) { tempObject[i] = el.value; } else { @@ -253,6 +217,7 @@ var isAssignment = exports.isAssignment = function(node) { // TODO: docs /** * Retrieve information about the node, including its name and type. + * @alias module:jsdoc/src/astnode.getInfo */ var getInfo = exports.getInfo = function(node) { var info = {}; @@ -336,56 +301,3 @@ var getInfo = exports.getInfo = function(node) { return info; }; - -// TODO: may want to use separate methods for known and owned variables/functions/aliases - -// TODO: docs -function _addVariable(node, name, value) { - node.knownVariables[name] = node.ownedVariables[name] = value; -} - -// TODO: docs -var addVariable = exports.addVariable = function(node, declarator) { - var name = declarator.id.name; - var value = (declarator.init || null); - _addVariable(node, name, value); - - return node; -}; - -// TODO: docs -var addAllVariables = exports.addAllVariables = function(node, declaration) { - for (var i = 0, l = declaration.declarations.length; i < l; i++) { - addVariable(node, declaration.declarations[i]); - } - - return node; -}; - -// TODO: docs -var addFunction = exports.addFunction = function(node, declaration) { - // TODO: should we store these separately, since they're hoisted above variable declarations? - // right now we appear to give functions and variables equal precedence, which is wrong - - // don't add anonymous functions - if (declaration.id) { - _addVariable(node, declaration.id.name, null); - } - - return node; -}; - -// TODO: docs -var addAlias = exports.addAlias = function(node, variableName, aliasName) { - [node.knownAliases, node.ownedAliases].forEach(function(target) { - if ( !Array.isArray(target[aliasName]) ) { - target[aliasName] = []; - } - - if (target[aliasName].indexOf(variableName) === -1) { - target[aliasName].push(variableName); - } - }); - - return node; -}; diff --git a/node_modules/jsdoc/lib/jsdoc/src/handlers.js b/node_modules/jsdoc/lib/jsdoc/src/handlers.js index f25368e..6773e9b 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/handlers.js +++ b/node_modules/jsdoc/lib/jsdoc/src/handlers.js @@ -3,6 +3,7 @@ */ 'use strict'; +var escape = require('escape-string-regexp'); var jsdoc = { doclet: require('jsdoc/doclet'), name: require('jsdoc/name'), @@ -13,22 +14,68 @@ var jsdoc = { var util = require('util'); var currentModule = null; +var SCOPE_NAMES = jsdoc.name.SCOPE.NAMES; +var SCOPE_PUNC = jsdoc.name.SCOPE.PUNC; +var unresolvedName = /^((?:module.)?exports|this)(\.|$)/; -var moduleRegExp = /^((?:module.)?exports|this)(\.|$)/; +function CurrentModule(doclet) { + this.doclet = doclet; + this.longname = doclet.longname; + this.originalName = doclet.meta.code.name || ''; +} -function getNewDoclet(comment, e) { - var Doclet = jsdoc.doclet.Doclet; +function filterByLongname(doclet) { + // you can't document prototypes + if ( /#$/.test(doclet.longname) ) { + return true; + } + + return false; +} + +function createDoclet(comment, e) { var doclet; var err; try { - doclet = new Doclet(comment, e); + doclet = new jsdoc.doclet.Doclet(comment, e); } catch (error) { err = new Error( util.format('cannot create a doclet for the comment "%s": %s', comment.replace(/[\r\n]/g, ''), error.message) ); jsdoc.util.logger.error(err); - doclet = new Doclet('', e); + doclet = new jsdoc.doclet.Doclet('', e); + } + + return doclet; +} + +/** + * Create a doclet for a `symbolFound` event. The doclet represents an actual symbol that is defined + * in the code. + * + * Here's why this function is useful. A JSDoc comment can define a symbol name by including: + * + * + A `@name` tag + * + Another tag that accepts a name, such as `@function` + * + * When the JSDoc comment defines a symbol name, we treat it as a "virtual comment" for a symbol + * that isn't actually present in the code. And if a virtual comment is attached to a symbol, it's + * possible that the comment and symbol have nothing to do with one another. + * + * To handle this case, this function checks the new doclet to see if we've already added a name + * property by parsing the JSDoc comment. If so, this method creates a replacement doclet that + * ignores the attached JSDoc comment and only looks at the code. + * + * @private + */ +function createSymbolDoclet(comment, e) { + var doclet = createDoclet(comment, e); + + if (doclet.name) { + // try again, without the comment + e.comment = '@undocumented'; + doclet = createDoclet(e.comment, e); } return doclet; @@ -36,192 +83,239 @@ function getNewDoclet(comment, e) { function setCurrentModule(doclet) { if (doclet.kind === 'module') { - currentModule = doclet.longname; + currentModule = new CurrentModule(doclet); } } -function setDefaultScopeMemberOf(doclet) { - // add @inner and @memberof tags unless the current module exports only this symbol - if (currentModule && currentModule !== doclet.name) { - // add @inner unless the current module exports only this symbol +function setModuleScopeMemberOf(doclet) { + // handle module symbols that are _not_ assigned to module.exports + if (currentModule && currentModule.longname !== doclet.name) { + // if we don't already know the scope, it must be an inner member if (!doclet.scope) { doclet.addTag('inner'); } - if (!doclet.memberof && doclet.scope !== 'global') { - doclet.addTag('memberof', currentModule); + // if the doclet isn't a memberof anything yet, and it's not a global, it must be a memberof + // the current module + if (!doclet.memberof && doclet.scope !== SCOPE_NAMES.GLOBAL) { + doclet.addTag('memberof', currentModule.longname); } } } +function setDefaultScope(doclet) { + // module doclets don't get a default scope + if (!doclet.scope && doclet.kind !== 'module') { + doclet.setScope(SCOPE_NAMES.GLOBAL); + } +} + +function addDoclet(parser, newDoclet) { + var e; + if (newDoclet) { + setCurrentModule(newDoclet); + e = { doclet: newDoclet }; + parser.emit('newDoclet', e); + + if ( !e.defaultPrevented && !filterByLongname(e.doclet) ) { + parser.addResult(e.doclet); + } + } +} + +function processAlias(parser, doclet, astNode) { + var memberofName; + + if (doclet.alias === '{@thisClass}') { + memberofName = parser.resolveThis(astNode); + + // "class" refers to the owner of the prototype, not the prototype itself + if ( /^(.+?)(\.prototype|#)$/.test(memberofName) ) { + memberofName = RegExp.$1; + } + doclet.alias = memberofName; + } + + doclet.addTag('name', doclet.alias); + doclet.postProcess(); +} + +// TODO: separate code that resolves `this` from code that resolves the module object +function findSymbolMemberof(parser, doclet, astNode, nameStartsWith, trailingPunc) { + var memberof = ''; + var nameAndPunc = nameStartsWith + (trailingPunc || ''); + var scopePunc = ''; + + // remove stuff that indicates module membership (but don't touch the name `module.exports`, + // which identifies the module object itself) + if (doclet.name !== 'module.exports') { + doclet.name = doclet.name.replace(nameAndPunc, ''); + } + + // like `bar` in: + // exports.bar = 1; + // module.exports.bar = 1; + // module.exports = MyModuleObject; MyModuleObject.bar = 1; + if (nameStartsWith !== 'this' && currentModule && doclet.name !== 'module.exports') { + memberof = currentModule.longname; + scopePunc = SCOPE_PUNC.STATIC; + } + // like: module.exports = 1; + else if (doclet.name === 'module.exports' && currentModule) { + doclet.addTag('name', currentModule.longname); + doclet.postProcess(); + } + else { + memberof = parser.resolveThis(astNode); + + // like the following at the top level of a module: + // this.foo = 1; + if (nameStartsWith === 'this' && currentModule && !memberof) { + memberof = currentModule.longname; + scopePunc = SCOPE_PUNC.STATIC; + } + else { + scopePunc = SCOPE_PUNC.INSTANCE; + } + } + + return { + memberof: memberof, + scopePunc: scopePunc + }; +} + +function addSymbolMemberof(parser, doclet, astNode) { + var basename; + var memberof; + var memberofInfo; + var moduleOriginalName = ''; + var resolveTargetRegExp; + var scopePunc; + var unresolved; + + if (!astNode) { + return; + } + + // check to see if the doclet name is an unresolved reference to the module object, or to `this` + // TODO: handle cases where the module object is shadowed in the current scope + if (currentModule) { + moduleOriginalName = '|' + currentModule.originalName; + } + resolveTargetRegExp = new RegExp('^((?:module.)?exports|this' + moduleOriginalName + + ')(\\.|$)'); + unresolved = resolveTargetRegExp.exec(doclet.name); + + if (unresolved) { + memberofInfo = findSymbolMemberof(parser, doclet, astNode, unresolved[1], unresolved[2]); + memberof = memberofInfo.memberof; + scopePunc = memberofInfo.scopePunc; + + if (memberof) { + doclet.name = doclet.name ? + memberof + scopePunc + doclet.name : + memberof; + } + } + else { + memberofInfo = parser.astnodeToMemberof(astNode); + if ( Array.isArray(memberofInfo) ) { + basename = memberofInfo[1]; + memberof = memberofInfo[0]; + } + else { + memberof = memberofInfo; + } + } + + // if we found a memberof name, apply it to the doclet + if (memberof) { + doclet.addTag('memberof', memberof); + if (basename) { + doclet.name = (doclet.name || '') + .replace(new RegExp('^' + escape(basename) + '.'), ''); + } + } + // otherwise, add the defaults for a module (if we're currently in a module) + else { + setModuleScopeMemberOf(doclet); + } +} + +function newSymbolDoclet(parser, docletSrc, e) { + var memberofName = null; + var newDoclet = createSymbolDoclet(docletSrc, e); + + // if there's an alias, use that as the symbol name + if (newDoclet.alias) { + processAlias(parser, newDoclet, e.astnode); + } + // otherwise, get the symbol name from the code + else if (e.code && e.code.name) { + newDoclet.addTag('name', e.code.name); + if (!newDoclet.memberof) { + addSymbolMemberof(parser, newDoclet, e.astnode); + } + + newDoclet.postProcess(); + } + else { + return false; + } + + // set the scope to global unless any of the following are true: + // a) the doclet is a memberof something + // b) the doclet represents a module + // c) we're in a module that exports only this symbol + if ( !newDoclet.memberof && newDoclet.kind !== 'module' && + (!currentModule || currentModule.longname !== newDoclet.name) ) { + newDoclet.scope = SCOPE_NAMES.GLOBAL; + } + + addDoclet(parser, newDoclet); + e.doclet = newDoclet; +} + /** * Attach these event handlers to a particular instance of a parser. * @param parser */ exports.attachTo = function(parser) { - function filter(doclet) { - // you can't document prototypes - if ( /#$/.test(doclet.longname) ) { - return true; - } - - return false; - } - - function addDoclet(newDoclet) { - var e; - if (newDoclet) { - setCurrentModule(newDoclet); - e = { doclet: newDoclet }; - parser.emit('newDoclet', e); - - if ( !e.defaultPrevented && !filter(e.doclet) ) { - parser.addResult(e.doclet); - } - } - } - - // TODO: for clarity, decompose into smaller functions - function newSymbolDoclet(docletSrc, e) { - var memberofName = null, - newDoclet = getNewDoclet(docletSrc, e); - - // A JSDoc comment can define a symbol name by including: - // - // + A `@name` tag - // + Another tag that accepts a name, such as `@function` - // - // When the JSDoc comment defines a symbol name, we treat it as a "virtual comment" for a - // symbol that isn't actually present in the code. And if a virtual comment is attached to - // a symbol, it's quite possible that the comment and symbol have nothing to do with one - // another. - // - // As a result, if we create a doclet for a `symbolFound` event, and we've already added a - // name attribute by parsing the JSDoc comment, we need to create a new doclet that ignores - // the attached JSDoc comment and only looks at the code. - if (newDoclet.name) { - // try again, without the comment - e.comment = '@undocumented'; - newDoclet = getNewDoclet(e.comment, e); - } - - if (newDoclet.alias) { - if (newDoclet.alias === '{@thisClass}') { - memberofName = parser.resolveThis(e.astnode); - - // "class" refers to the owner of the prototype, not the prototype itself - if ( /^(.+?)(\.prototype|#)$/.test(memberofName) ) { - memberofName = RegExp.$1; - } - newDoclet.alias = memberofName; - } - newDoclet.addTag('name', newDoclet.alias); - newDoclet.postProcess(); - } - else if (e.code && e.code.name) { // we need to get the symbol name from code - newDoclet.addTag('name', e.code.name); - if (!newDoclet.memberof && e.astnode) { - var basename = null, - scope = ''; - if ( moduleRegExp.test(newDoclet.name) ) { - var nameStartsWith = RegExp.$1; - - // remove stuff that indicates module membership (but don't touch the name - // `module.exports`, which identifies the module object itself) - if (newDoclet.name !== 'module.exports') { - newDoclet.name = newDoclet.name.replace(moduleRegExp, ''); - } - - // like /** @module foo */ exports.bar = 1; - // or /** @module foo */ module.exports.bar = 1; - // but not /** @module foo */ module.exports = 1; - if ( (nameStartsWith === 'exports' || nameStartsWith === 'module.exports') && - newDoclet.name !== 'module.exports' && currentModule ) { - memberofName = currentModule; - scope = 'static'; - } - else if (newDoclet.name === 'module.exports' && currentModule) { - newDoclet.addTag('name', currentModule); - newDoclet.postProcess(); - } - else { - // like /** @module foo */ exports = {bar: 1}; - // or /** blah */ this.foo = 1; - memberofName = parser.resolveThis(e.astnode); - scope = nameStartsWith === 'exports' ? 'static' : 'instance'; - - // like /** @module foo */ this.bar = 1; - if (nameStartsWith === 'this' && currentModule && !memberofName) { - memberofName = currentModule; - scope = 'static'; - } - } - - if (memberofName) { - if (newDoclet.name) { - newDoclet.name = memberofName + (scope === 'instance' ? '#' : '.') + - newDoclet.name; - } - else { newDoclet.name = memberofName; } - } - } - else { - memberofName = parser.astnodeToMemberof(e.astnode); - if( Array.isArray(memberofName) ) { - basename = memberofName[1]; - memberofName = memberofName[0]; - } - } - - if (memberofName) { - newDoclet.addTag('memberof', memberofName); - if (basename) { - newDoclet.name = (newDoclet.name || '') - .replace(new RegExp('^' + RegExp.escape(basename) + '.'), ''); - } - } - else { - setDefaultScopeMemberOf(newDoclet); - } - } - - newDoclet.postProcess(); - } - else { - return false; - } - - // set the scope to global unless a) the doclet is a memberof something or b) the current - // module exports only this symbol - if (!newDoclet.memberof && currentModule !== newDoclet.name) { - newDoclet.scope = 'global'; - } - - addDoclet.call(parser, newDoclet); - e.doclet = newDoclet; - } - - // handles JSDoc comments that include a @name tag -- the code is ignored in such a case + // Handle JSDoc "virtual comments" that include one of the following: + // + A `@name` tag + // + Another tag that accepts a name, such as `@function` parser.on('jsdocCommentFound', function(e) { - var newDoclet = getNewDoclet(e.comment, e); + var comments = e.comment.split(/@also\b/g); + var newDoclet; - if (!newDoclet.name) { - return false; // only interested in virtual comments (with a @name) here + for (var i = 0, l = comments.length; i < l; i++) { + newDoclet = createDoclet(comments[i], e); + + // we're only interested in virtual comments here + if (!newDoclet.name) { + continue; + } + + // add the default scope/memberof for a module (if we're in a module) + setModuleScopeMemberOf(newDoclet); + newDoclet.postProcess(); + + // if we _still_ don't have a scope, use the default + setDefaultScope(newDoclet); + + addDoclet(parser, newDoclet); + + e.doclet = newDoclet; } - - setDefaultScopeMemberOf(newDoclet); - newDoclet.postProcess(); - addDoclet.call(parser, newDoclet); - - e.doclet = newDoclet; }); - // handles named symbols in the code, may or may not have a JSDoc comment attached + // Handle named symbols in the code. May or may not have a JSDoc comment attached. parser.on('symbolFound', function(e) { - var subDoclets = e.comment.split(/@also\b/g); + var comments = e.comment.split(/@also\b/g); - for (var i = 0, l = subDoclets.length; i < l; i++) { - newSymbolDoclet.call(parser, subDoclets[i], e); + for (var i = 0, l = comments.length; i < l; i++) { + newSymbolDoclet(parser, comments[i], e); } }); diff --git a/node_modules/jsdoc/lib/jsdoc/src/parser.js b/node_modules/jsdoc/lib/jsdoc/src/parser.js index 121bf0f..048a68a 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/parser.js +++ b/node_modules/jsdoc/lib/jsdoc/src/parser.js @@ -1,57 +1,45 @@ -/*global env, Packages */ -/*eslint no-script-url:0 */ /** * @module jsdoc/src/parser */ 'use strict'; +var events = require('events'); +var fs = require('jsdoc/fs'); var jsdoc = { doclet: require('jsdoc/doclet'), name: require('jsdoc/name'), src: { astnode: require('jsdoc/src/astnode'), syntax: require('jsdoc/src/syntax') + }, + util: { + doop: require('jsdoc/util/doop'), + runtime: require('jsdoc/util/runtime') } }; var logger = require('jsdoc/util/logger'); +var path = require('jsdoc/path'); var util = require('util'); var hasOwnProp = Object.prototype.hasOwnProperty; var Syntax = jsdoc.src.syntax.Syntax; -// Prefix for JavaScript strings that were provided in lieu of a filename. -var SCHEMA = 'javascript:'; // TODO: docs var PARSERS = exports.PARSERS = { esprima: 'jsdoc/src/parser', rhino: 'rhino/jsdoc/src/parser' }; - -// TODO: docs -// TODO: not currently used -function makeGlobalDoclet(globalScope) { - var doclet = new jsdoc.doclet.Doclet('/** Auto-generated doclet for global scope */', {}); - - if (globalScope) { - // TODO: handle global aliases - Object.keys(globalScope.ownedVariables).forEach(function(variable) { - doclet.meta.vars = doclet.meta.vars || {}; - doclet.meta.vars[variable] = null; - }); - } - - return doclet; -} +/*eslint-disable no-script-url */ +// Prefix for JavaScript strings that were provided in lieu of a filename. +var SCHEMA = 'javascript:'; +/*eslint-enable no-script-url */ // TODO: docs exports.createParser = function(type) { - var path = require('jsdoc/path'); - var runtime = require('jsdoc/util/runtime'); - var modulePath; if (!type) { - type = runtime.isRhino() ? 'rhino' : 'esprima'; + type = jsdoc.util.runtime.isRhino() ? 'rhino' : 'esprima'; } if (PARSERS[type]) { @@ -72,6 +60,7 @@ exports.createParser = function(type) { // TODO: docs /** * @class + * @alias module:jsdoc/src/parser.Parser * @mixes module:events.EventEmitter * * @example Create a new parser. @@ -102,14 +91,14 @@ var Parser = exports.Parser = function(builderInstance, visitorInstance, walkerI } }); }; -util.inherits(Parser, require('events').EventEmitter); +util.inherits(Parser, events.EventEmitter); // TODO: docs Parser.prototype.clear = function() { this._resultBuffer = []; this.refs = {}; - this.refs[jsdoc.src.astnode.GLOBAL_NODE_ID] = {}; - this.refs[jsdoc.src.astnode.GLOBAL_NODE_ID].meta = {}; + this.refs[jsdoc.name.LONGNAMES.GLOBAL] = {}; + this.refs[jsdoc.name.LONGNAMES.GLOBAL].meta = {}; }; // TODO: update docs @@ -131,7 +120,7 @@ Parser.prototype.clear = function() { * var docs = jsdocParser.parse(myFiles); */ Parser.prototype.parse = function(sourceFiles, encoding) { - encoding = encoding || env.conf.encoding || 'utf8'; + encoding = encoding || global.env.conf.encoding || 'utf8'; var filename = ''; var sourceCode = ''; @@ -157,7 +146,7 @@ Parser.prototype.parse = function(sourceFiles, encoding) { else { filename = sourceFiles[i]; try { - sourceCode = require('jsdoc/fs').readFileSync(filename, encoding); + sourceCode = fs.readFileSync(filename, encoding); } catch(e) { logger.error('Unable to read and parse the source file %s: %s', filename, e); @@ -244,15 +233,19 @@ Parser.prototype._parseSourceCode = function(sourceCode, sourceName) { ast = this._astBuilder.build(sourceCode, sourceName); if (ast) { - this._walker.recurse(sourceName, ast, this._visitor); + this._walkAst(ast, this._visitor, sourceName); } - } this.emit('fileComplete', e); logger.info('complete.'); }; +/** @private */ +Parser.prototype._walkAst = function(ast, visitor, sourceName) { + this._walker.recurse(ast, visitor, sourceName); +}; + // TODO: docs Parser.prototype.addDocletRef = function(e) { var node; @@ -268,7 +261,7 @@ Parser.prototype.addDocletRef = function(e) { (node.type === Syntax.FunctionDeclaration || node.type === Syntax.FunctionExpression) && !this.refs[node.nodeId] ) { this.refs[node.nodeId] = { - longname: jsdoc.name.ANONYMOUS_LONGNAME, + longname: jsdoc.name.LONGNAMES.ANONYMOUS, meta: { code: e.code } @@ -322,10 +315,10 @@ Parser.prototype.astnodeToMemberof = function(node) { doclet = this._getDoclet(node.enclosingScope.nodeId); if (!doclet) { - result = jsdoc.name.ANONYMOUS_LONGNAME + jsdoc.name.INNER; + result = jsdoc.name.LONGNAMES.ANONYMOUS + jsdoc.name.SCOPE.PUNC.INNER; } else { - result = (doclet.longname || doclet.name) + jsdoc.name.INNER; + result = (doclet.longname || doclet.name) + jsdoc.name.SCOPE.PUNC.INNER; } } else { @@ -347,7 +340,7 @@ Parser.prototype.astnodeToMemberof = function(node) { } // do we know that it's a global? - doclet = this.refs[jsdoc.src.astnode.GLOBAL_NODE_ID]; + doclet = this.refs[jsdoc.name.LONGNAMES.GLOBAL]; if ( doclet && definedInScope(doclet, basename) ) { result = [doclet.meta.vars[basename], basename]; } @@ -378,16 +371,15 @@ Parser.prototype.resolveThis = function(node) { var result; // In general, if there's an enclosing scope, we use the enclosing scope to resolve `this`. - // For object properties, we use the node's parent (the object) instead. This is a consequence - // of the source-rewriting hackery that we use to support the `@lends` tag. + // For object properties, we use the node's parent (the object) instead. if (node.type !== Syntax.Property && node.enclosingScope) { doclet = this._getDoclet(node.enclosingScope.nodeId); if (!doclet) { - result = jsdoc.name.ANONYMOUS_LONGNAME; // TODO handle global this? + result = jsdoc.name.LONGNAMES.ANONYMOUS; // TODO handle global this? } - else if (doclet['this']) { - result = doclet['this']; + else if (doclet.this) { + result = doclet.this; } // like: Foo.constructor = function(n) { /** blah */ this.name = n; } else if (doclet.kind === 'function' && doclet.memberof) { @@ -424,21 +416,48 @@ Parser.prototype.resolveThis = function(node) { return result; }; -// TODO: docs /** - * Given 'var foo = { x: 1 }', find foo from x. + * Given an AST node representing an object property, find the doclets for the parent object or + * objects. + * + * If the object is part of a simple assignment (for example, `var foo = { x: 1 }`), this method + * returns a single doclet (in this case, the doclet for `foo`). + * + * If the object is part of a chained assignment (for example, `var foo = exports.FOO = { x: 1 }`, + * this method returns multiple doclets (in this case, the doclets for `foo` and `exports.FOO`). + * + * @param {Object} node - An AST node representing an object property. + * @return {Array.} An array of doclets for the parent object or objects, or + * an empty array if no doclets are found. */ -Parser.prototype.resolvePropertyParent = function(node) { +Parser.prototype.resolvePropertyParents = function(node) { + var currentAncestor = node.parent; + var nextAncestor = currentAncestor ? currentAncestor.parent : null; var doclet; + var doclets = []; - if (node.parent) { - doclet = this._getDoclet(node.parent.nodeId); + while (currentAncestor) { + doclet = this._getDoclet(currentAncestor.nodeId); + if (doclet) { + doclets.push(doclet); + } + + // if the next ancestor is an assignment expression (for example, `exports.FOO` in + // `var foo = exports.FOO = { x: 1 }`, keep walking upwards + if (nextAncestor && nextAncestor.type === Syntax.AssignmentExpression) { + nextAncestor = nextAncestor.parent; + currentAncestor = currentAncestor.parent; + } + // otherwise, we're done + else { + currentAncestor = null; + } } - return doclet; + return doclets; }; -// TODO docs +// TODO: docs /** * Resolve what function a var is limited to. * @param {astnode} node @@ -447,10 +466,14 @@ Parser.prototype.resolvePropertyParent = function(node) { Parser.prototype.resolveVar = function(node, basename) { var doclet; var result; - var scope = node.enclosingScope; - if (!scope) { + // HACK: return an empty string for function declarations so they don't end up in anonymous + // scope (see #685 and #693) + if (node.type === Syntax.FunctionDeclaration) { + result = ''; + } + else if (!scope) { result = ''; // global } else { @@ -468,24 +491,25 @@ Parser.prototype.resolveVar = function(node, basename) { // TODO: docs Parser.prototype.resolveEnum = function(e) { - var doclet = this.resolvePropertyParent(e.code.node.parent); + var doclets = this.resolvePropertyParents(e.code.node.parent); - if (doclet && doclet.isEnum) { - if (!doclet.properties) { - doclet.properties = []; + doclets.forEach(function(doclet) { + if (doclet && doclet.isEnum) { + doclet.properties = doclet.properties || []; + + // members of an enum inherit the enum's type + if (doclet.type && !e.doclet.type) { + // clone the type to prevent circular refs + e.doclet.type = jsdoc.util.doop(doclet.type); + } + + delete e.doclet.undocumented; + e.doclet.defaultvalue = e.doclet.meta.code.value; + + // add the doclet to the parent's properties + doclet.properties.push(e.doclet); } - - // members of an enum inherit the enum's type - if (doclet.type && !e.doclet.type) { - e.doclet.type = doclet.type; - } - - delete e.doclet.undocumented; - e.doclet.defaultvalue = e.doclet.meta.code.value; - - // add a copy of the doclet to the parent's properties - doclet.properties.push( require('jsdoc/util/doop').doop(e.doclet) ); - } + }); }; // TODO: document other events @@ -493,8 +517,8 @@ Parser.prototype.resolveEnum = function(e) { * Fired once for each JSDoc comment in the current source code. * @event jsdocCommentFound * @memberof module:jsdoc/src/parser.Parser - * @param {event} e - * @param {string} e.comment The text content of the JSDoc comment - * @param {number} e.lineno The line number associated with the found comment. - * @param {string} e.filename The file name associated with the found comment. + * @type {Object} + * @property {string} comment The text content of the JSDoc comment + * @property {number} lineno The line number associated with the found comment. + * @property {string} filename The file name associated with the found comment. */ diff --git a/node_modules/jsdoc/lib/jsdoc/src/visitor.js b/node_modules/jsdoc/lib/jsdoc/src/visitor.js index 7e97fa1..2572132 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/visitor.js +++ b/node_modules/jsdoc/lib/jsdoc/src/visitor.js @@ -7,6 +7,7 @@ var jsdoc = { doclet: require('jsdoc/doclet'), + name: require('jsdoc/name'), src: { astnode: require('jsdoc/src/astnode'), syntax: require('jsdoc/src/syntax') @@ -36,7 +37,7 @@ function getLeadingComment(node) { function makeVarsFinisher(scopeDoclet) { return function(e) { // no need to evaluate all things related to scopeDoclet again, just use it - if (scopeDoclet && e.doclet && e.doclet.alias) { + if ( scopeDoclet && e.doclet && (e.doclet.alias || e.doclet.memberof) ) { scopeDoclet.meta.vars[e.code.name] = e.doclet.longname; } }; @@ -69,6 +70,12 @@ function makeInlineParamsFinisher(parser) { return; } + // we only want to use the doclet if it's param-specific (but not, for example, if it's + // a param tagged with `@exports` in an AMD module) + if (e.doclet.kind !== 'param') { + return; + } + parentDoclet.params = parentDoclet.params || []; documentedParams = parentDoclet.params; knownParams = parentDoclet.meta.code.paramnames; @@ -76,9 +83,8 @@ function makeInlineParamsFinisher(parser) { while (true) { param = documentedParams[i]; - // is the param already documented? if so, we're done + // is the param already documented? if so, we don't need to use the doclet if (param && param.name === e.doclet.name) { - // the doclet is no longer needed e.doclet.undocumented = true; break; } @@ -176,13 +182,6 @@ Visitor.prototype.visit = function(node, filename) { this._visitors[i].call(this, node, this._parser, filename); } - // we also need to visit standalone comments, which are not attached to a node - if (node.type === Syntax.Program && node.comments && node.comments.length) { - for (i = 0, l = node.comments.length; i < l; i++) { - this.visitNodeComments.call(this, node.comments[i], this._parser, filename); - } - } - return true; }; @@ -200,8 +199,8 @@ function isValidJsdoc(commentSrc) { // TODO: docs function hasJsdocComments(node) { - return (node && node.leadingComments && node.leadingComments.length > 0) || - (node && node.trailingComments && node.trailingComments.length > 0); + return (node && node.leadingComments && node.leadingComments.length) || + (node && node.trailingComments && node.trailingComments.length); } // TODO: docs @@ -227,13 +226,10 @@ Visitor.prototype.visitNodeComments = function(node, parser, filename) { return true; } - comments = []; - if (node.type === BLOCK_COMMENT) { - comments.push(node); - } + comments = (node.type === BLOCK_COMMENT) ? [node] : []; if (node.leadingComments && node.leadingComments.length) { - comments = node.leadingComments.slice(0); + comments = comments.concat( node.leadingComments.slice(0) ); } if (node.trailingComments && node.trailingComments.length) { @@ -263,12 +259,6 @@ Visitor.prototype.visitNode = function(node, parser, filename) { var e = this.makeSymbolFoundEvent(node, parser, filename); - if (!node.nodeId) { - Object.defineProperty(node, 'nodeId', { - value: parser.getUniqueId() - }); - } - if (this._nodeVisitors && this._nodeVisitors.length) { for (i = 0, l = this._nodeVisitors.length; i < l; i++) { this._nodeVisitors[i].visitNode(node, e, parser, filename); @@ -294,10 +284,9 @@ Visitor.prototype.visitNode = function(node, parser, filename) { // TODO: docs // TODO: note that it's essential to call this function before you try to resolve names! -// TODO: may be able to get rid of this using knownAliases function trackVars(parser, node, e) { var enclosingScopeId = node.enclosingScope ? node.enclosingScope.nodeId : - jsdoc.src.astnode.GLOBAL_NODE_ID; + jsdoc.name.LONGNAMES.GLOBAL; var doclet = parser.refs[enclosingScopeId]; if (doclet) { @@ -351,20 +340,23 @@ Visitor.prototype.makeSymbolFoundEvent = function(node, parser, filename) { break; // like "bar" in: function foo(/** @type {string} */ bar) {} + // or "module" in: define("MyModule", function(/** @exports MyModule */ module) {} // This is an extremely common type of node; we only care about function parameters with - // inline type annotations. No need to fire events unless they're already commented. + // inline comments. No need to fire an event unless the node is already commented. case Syntax.Identifier: parent = node.parent; if ( node.leadingComments && parent && jsdoc.src.astnode.isFunction(parent) ) { extras.finishers = [makeInlineParamsFinisher(parser)]; e = new SymbolFound(node, filename, extras); + + trackVars(parser, node, e); } break; // like "obj.prop" in: /** @typedef {string} */ obj.prop; // Closure Compiler uses this pattern extensively for enums. - // No need to fire events for them unless they're already commented. + // No need to fire an event unless the node is already commented. case Syntax.MemberExpression: if (node.leadingComments) { e = new SymbolFound(node, filename, extras); diff --git a/node_modules/jsdoc/lib/jsdoc/src/walker.js b/node_modules/jsdoc/lib/jsdoc/src/walker.js index ce724c2..0e20499 100644 --- a/node_modules/jsdoc/lib/jsdoc/src/walker.js +++ b/node_modules/jsdoc/lib/jsdoc/src/walker.js @@ -478,41 +478,40 @@ var Walker = exports.Walker = function(walkerFuncs) { // TODO: docs Walker.prototype._recurse = function(filename, ast) { - // TODO: track variables/aliases during the walk + var self = this; var state = { filename: filename, nodes: [], scopes: [] }; - var walkers = this._walkers; - function cb(node, parent, state) { + function cb(node, parent, cbState) { var currentScope; var isScope = astnode.isScope(node); - // for efficiency, if the node has a knownVariables property, assume that we've already + // for efficiency, if the node has a `parent` property, assume that we've already // added the required properties - if (!node.knownVariables) { + if (typeof node.parent !== 'undefined') { astnode.addNodeProperties(node); } node.parent = parent || null; - currentScope = getCurrentScope(state.scopes); + currentScope = getCurrentScope(cbState.scopes); if (currentScope) { node.enclosingScope = currentScope; } if (isScope) { - state.scopes.push(node); + cbState.scopes.push(node); } - state.nodes.push(node); + cbState.nodes.push(node); - walkers[node.type](node, parent, state, cb); + self._walkers[node.type](node, parent, cbState, cb); if (isScope) { - state.scopes.pop(); + cbState.scopes.pop(); } } @@ -522,14 +521,17 @@ Walker.prototype._recurse = function(filename, ast) { }; // TODO: docs -// TODO: allow visitor.visit to prevent traversal of child nodes // TODO: skip the AST root node to be consistent with Rhino? -Walker.prototype.recurse = function(filename, ast, visitor) { +Walker.prototype.recurse = function(ast, visitor, filename) { + var shouldContinue; var state = this._recurse(filename, ast); if (visitor) { for (var i = 0, l = state.nodes.length; i < l; i++) { - visitor.visit.call(visitor, state.nodes[i], filename); + shouldContinue = visitor.visit.call(visitor, state.nodes[i], filename); + if (!shouldContinue) { + break; + } } } diff --git a/node_modules/jsdoc/lib/jsdoc/tag.js b/node_modules/jsdoc/lib/jsdoc/tag.js index 142592a..963c955 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag.js +++ b/node_modules/jsdoc/lib/jsdoc/tag.js @@ -25,15 +25,25 @@ var jsdoc = { } }; var path = require('jsdoc/path'); +var util = require('util'); -function trim(text, opts) { +// Check whether the text is the same as a symbol name with leading or trailing whitespace. If so, +// the whitespace must be preserved, and the text cannot be trimmed. +function mustPreserveWhitespace(text, meta) { + return meta && meta.code && meta.code.name === text && text.match(/(?:^\s+)|(?:\s+$)/); +} + +function trim(text, opts, meta) { var indentMatcher; var match; opts = opts || {}; text = text || ''; - if (opts.keepsWhitespace) { + if ( mustPreserveWhitespace(text, meta) ) { + text = util.format('"%s"', text); + } + else if (opts.keepsWhitespace) { text = text.replace(/^[\n\r\f]+|[\n\r\f]+$/g, ''); if (opts.removesIndent) { match = text.match(/^([ \t]+)/); @@ -50,7 +60,32 @@ function trim(text, opts) { return text; } -function processTagText(tag, tagDef) { +function addHiddenProperty(obj, propName, propValue) { + Object.defineProperty(obj, propName, { + value: propValue, + writable: true, + enumerable: !!global.env.opts.debug, + configurable: true + }); +} + +function parseType(tag, tagDef, meta) { + try { + return jsdoc.tag.type.parse(tag.text, tagDef.canHaveName, tagDef.canHaveType); + } + catch (e) { + jsdoc.util.logger.error( + 'Unable to parse a tag\'s type expression%s with tag title "%s" and text "%s": %s', + meta.filename ? ( ' for source file ' + path.join(meta.path, meta.filename) ) : '', + tag.originalTitle, + tag.text, + e.message + ); + return {}; + } +} + +function processTagText(tag, tagDef, meta) { var tagType; if (tagDef.onTagText) { @@ -61,7 +96,7 @@ function processTagText(tag, tagDef) { /** The value property represents the result of parsing the tag text. */ tag.value = {}; - tagType = jsdoc.tag.type.parse(tag.text, tagDef.canHaveName, tagDef.canHaveType); + tagType = parseType(tag, tagDef, meta); // It is possible for a tag to *not* have a type but still have // optional or defaultvalue, e.g. '@param [foo]'. @@ -71,11 +106,14 @@ function processTagText(tag, tagDef) { tag.value.type = { names: tagType.type }; + addHiddenProperty(tag.value.type, 'parsedType', tagType.parsedType); } - tag.value.optional = tagType.optional; - tag.value.nullable = tagType.nullable; - tag.value.variable = tagType.variable; - tag.value.defaultvalue = tagType.defaultvalue; + + ['optional', 'nullable', 'variable', 'defaultvalue'].forEach(function(prop) { + if (typeof tagType[prop] !== 'undefined') { + tag.value[prop] = tagType[prop]; + } + }); } if (tagType.text && tagType.text.length) { @@ -92,6 +130,19 @@ function processTagText(tag, tagDef) { } } +/** + * Replace the existing tag dictionary with a new tag dictionary. + * + * Used for testing only. Do not call this method directly. Instead, call + * {@link module:jsdoc/doclet._replaceDictionary}, which also updates this module's tag dictionary. + * + * @private + * @param {module:jsdoc/tag/dictionary.Dictionary} dict - The new tag dictionary. + */ +exports._replaceDictionary = function _replaceDictionary(dict) { + jsdoc.tag.dictionary = dict; +}; + /** Constructs a new tag object. Calls the tag validator. @class @@ -108,7 +159,7 @@ var Tag = exports.Tag = function(tagTitle, tagBody, meta) { this.originalTitle = trim(tagTitle); - /** The title part of the tag: @title text */ + /** The title of the tag (for example, `title` in `@title text`). */ this.title = jsdoc.tag.dictionary.normalise(this.originalTitle); tagDef = jsdoc.tag.dictionary.lookUp(this.title); @@ -117,23 +168,28 @@ var Tag = exports.Tag = function(tagTitle, tagBody, meta) { removesIndent: tagDef.removesIndent }; - /** The text part of the tag: @title text */ - this.text = trim(tagBody, trimOpts); + /** + * The text following the tag (for example, `text` in `@title text`). + * + * Whitespace is trimmed from the tag text as follows: + * + * + If the tag's `keepsWhitespace` option is falsy, all leading and trailing whitespace are + * removed. + * + If the tag's `keepsWhitespace` option is set to `true`, leading and trailing whitespace are + * not trimmed, unless the `removesIndent` option is also enabled. + * + If the tag's `removesIndent` option is set to `true`, any indentation that is shared by + * every line in the string is removed. This option is ignored unless `keepsWhitespace` is set + * to `true`. + * + * **Note**: If the tag text is the name of a symbol, and the symbol's name includes leading or + * trailing whitespace (for example, the property names in `{ ' ': true, ' foo ': false }`), + * the tag text is not trimmed. Instead, the tag text is wrapped in double quotes to prevent the + * whitespace from being trimmed. + */ + this.text = trim(tagBody, trimOpts, meta); if (this.text) { - try { - processTagText(this, tagDef); - } - catch (e) { - // probably a type-parsing error - jsdoc.util.logger.error( - 'Unable to create a Tag object%s with title "%s" and body "%s": %s', - meta.filename ? ( ' for source file ' + path.join(meta.path, meta.filename) ) : '', - tagTitle, - tagBody, - e.message - ); - } + processTagText(this, tagDef, meta); } jsdoc.tag.validator.validate(this, tagDef, meta); diff --git a/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js b/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js index 0a745b4..f613c49 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/dictionary.js @@ -1,23 +1,22 @@ -/** - @overview - @author Michael Mathews - @license Apache License 2.0 - See file 'LICENSE.md' in this project. - */ +/** @module jsdoc/tag/dictionary */ 'use strict'; +var definitions = require('jsdoc/tag/dictionary/definitions'); + var hasOwnProp = Object.prototype.hasOwnProperty; -var _tags = {}; -var _tagSynonyms = {}; -var _namespaces = []; var dictionary; /** @private */ -function TagDefinition(title, etc) { +function TagDefinition(dict, title, etc) { var self = this; etc = etc || {}; - this.title = dictionary.normalise(title); + this.title = dict.normalise(title); + + Object.defineProperty(this, '_dictionary', { + value: dict + }); Object.keys(etc).forEach(function(p) { self[p] = etc[p]; @@ -26,60 +25,98 @@ function TagDefinition(title, etc) { /** @private */ TagDefinition.prototype.synonym = function(synonymName) { - _tagSynonyms[synonymName.toLowerCase()] = this.title; + this._dictionary.defineSynonym(this.title, synonymName); return this; // chainable }; -/** @exports jsdoc/tag/dictionary */ -dictionary = { - /** @function */ - defineTag: function(title, opts) { - var def = new TagDefinition(title, opts); - // all the other dictionary functions use normalised names; we should too. - _tags[def.title] = def; +/** + * @class + * @alias module:jsdoc/tag/dictionary.Dictionary + */ +function Dictionary() { + this._tags = {}; + this._tagSynonyms = {}; + // The longnames for `Package` objects include a `package` namespace. There's no `package` tag, + // though, so we declare the namespace here. + this._namespaces = ['package']; +} - if (opts && opts.isNamespace) { - _namespaces.push(def.title); - } +/** @function */ +Dictionary.prototype._defineNamespace = function defineNamespace(title) { + title = this.normalise(title || ''); - return _tags[def.title]; - }, - - /** @function */ - lookUp: function(title) { - title = dictionary.normalise(title); - - if ( hasOwnProp.call(_tags, title) ) { - return _tags[title]; - } - - return false; - }, - - /** @function */ - isNamespace: function(kind) { - if (kind) { - kind = dictionary.normalise(kind); - if ( _namespaces.indexOf(kind) !== -1) { - return true; - } - } - - return false; - }, - - /** @function */ - normalise: function(title) { - var canonicalName = title.toLowerCase(); - - if ( hasOwnProp.call(_tagSynonyms, canonicalName) ) { - return _tagSynonyms[canonicalName]; - } - - return canonicalName; + if (title && this._namespaces.indexOf(title) === -1) { + this._namespaces.push(title); } + + return this; }; -require('jsdoc/tag/dictionary/definitions').defineTags(dictionary); +/** @function */ +Dictionary.prototype.defineTag = function defineTag(title, opts) { + var tagDef = new TagDefinition(this, title, opts); + this._tags[tagDef.title] = tagDef; + if (opts && opts.isNamespace) { + this._defineNamespace(tagDef.title); + } + + return this._tags[tagDef.title]; +}; + +/** @function */ +Dictionary.prototype.defineSynonym = function defineSynonym(title, synonym) { + this._tagSynonyms[synonym.toLowerCase()] = this.normalise(title); +}; + +/** @function */ +Dictionary.prototype.getNamespaces = function getNamespaces() { + return this._namespaces.slice(0); +}; + +/** @function */ +Dictionary.prototype.lookUp = function lookUp(title) { + title = this.normalise(title); + + if ( hasOwnProp.call(this._tags, title) ) { + return this._tags[title]; + } + + return false; +}; + +/** @function */ +Dictionary.prototype.isNamespace = function isNamespace(kind) { + if (kind) { + kind = this.normalise(kind); + if (this._namespaces.indexOf(kind) !== -1) { + return true; + } + } + + return false; +}; + +/** @function */ +Dictionary.prototype.normalise = function normalise(title) { + var canonicalName = title.toLowerCase(); + + if ( hasOwnProp.call(this._tagSynonyms, canonicalName) ) { + return this._tagSynonyms[canonicalName]; + } + + return canonicalName; +}; + +/** @function */ +Dictionary.prototype.normalize = Dictionary.prototype.normalise; + +// initialize the default dictionary +dictionary = new Dictionary(); +definitions.defineTags(dictionary); + +// make the constructor available for unit-testing purposes +dictionary.Dictionary = Dictionary; + +/** @type {module:jsdoc/tag/dictionary.Dictionary} */ module.exports = dictionary; diff --git a/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js b/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js index 66a3813..313d363 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/dictionary/definitions.js @@ -1,4 +1,3 @@ -/*global app, env */ /** Define tags that are known in JSDoc. @module jsdoc/tag/dictionary/definitions @@ -8,7 +7,7 @@ */ 'use strict'; -var hasOwnProp = Object.prototype.hasOwnProperty; +var _ = require('underscore'); var jsdoc = { name: require('jsdoc/name'), src: { @@ -18,21 +17,35 @@ var jsdoc = { type: require('jsdoc/tag/type') }, util: { + doop: require('jsdoc/util/doop'), logger: require('jsdoc/util/logger') } }; var path = require('jsdoc/path'); var Syntax = require('jsdoc/src/syntax').Syntax; -var GLOBAL_LONGNAME = jsdoc.name.GLOBAL_LONGNAME; -var MODULE_PREFIX = jsdoc.name.MODULE_PREFIX; +var hasOwnProp = Object.prototype.hasOwnProperty; + +var DEFINITIONS = { + closure: 'closureTags', + jsdoc: 'jsdocTags' +}; +var MODULE_NAMESPACE = 'module:'; + +// Clone a tag definition, excluding synonyms. +function cloneTagDef(tagDef, extras) { + var newTagDef = jsdoc.util.doop(tagDef); + delete newTagDef.synonyms; + + return (extras ? _.extend(newTagDef, extras) : newTagDef); +} function getSourcePaths() { - var sourcePaths = env.sourceFiles.slice(0) || []; + var sourcePaths = global.env.sourceFiles.slice(0) || []; - if (env.opts._) { - env.opts._.forEach(function(sourcePath) { - var resolved = path.resolve(env.pwd, sourcePath); + if (global.env.opts._) { + global.env.opts._.forEach(function(sourcePath) { + var resolved = path.resolve(global.env.pwd, sourcePath); if (sourcePaths.indexOf(resolved) === -1) { sourcePaths.push(resolved); } @@ -48,7 +61,8 @@ function filepathMinusPrefix(filepath) { var result = ''; if (filepath) { - // always use forward slashes + filepath = path.normalize(filepath); + // always use forward slashes in the result result = (filepath + path.sep).replace(commonPrefix, '') .replace(/\\/g, '/'); } @@ -76,7 +90,7 @@ function setDocletScopeToTitle(doclet, tag) { function setDocletNameToValue(doclet, tag) { if (tag.value && tag.value.description) { // as in a long tag - doclet.addTag( 'name', tag.value.description); + doclet.addTag('name', tag.value.description); } else if (tag.text) { // or a short tag doclet.addTag('name', tag.text); @@ -91,7 +105,7 @@ function setDocletNameToValueName(doclet, tag) { function setDocletDescriptionToValue(doclet, tag) { if (tag.value) { - doclet.addTag( 'description', tag.value ); + doclet.addTag('description', tag.value); } } @@ -124,15 +138,14 @@ function setDocletMemberof(doclet, tag) { function applyNamespace(docletOrNs, tag) { if (typeof docletOrNs === 'string') { // ns - tag.value = app.jsdoc.name.applyNamespace(tag.value, docletOrNs); + tag.value = jsdoc.name.applyNamespace(tag.value, docletOrNs); } else { // doclet if (!docletOrNs.name) { return; // error? } - //doclet.displayname = doclet.name; - docletOrNs.longname = app.jsdoc.name.applyNamespace(docletOrNs.name, tag.title); + docletOrNs.longname = jsdoc.name.applyNamespace(docletOrNs.name, tag.title); } } @@ -147,6 +160,11 @@ function setDocletNameToFilename(doclet, tag) { doclet.name = name; } +function parseTypeText(text) { + var tagType = jsdoc.tag.type.parse(text, false, true); + return tagType.typeExpression || text; +} + function parseBorrows(doclet, tag) { var m = /^(\S+)(?:\s+as\s+(\S+))?$/.exec(tag.text); if (m) { @@ -161,51 +179,48 @@ function parseBorrows(doclet, tag) { } } +function stripModuleNamespace(name) { + return name.replace(/^module\:/, ''); +} + function firstWordOf(string) { var m = /^(\S+)/.exec(string); if (m) { return m[1]; } else { return ''; } } -/** Populate the given dictionary with all known JSDoc tag definitions. - @param {module:jsdoc/tag/dictionary} dictionary -*/ -exports.defineTags = function(dictionary) { - dictionary.defineTag('abstract', { +// Core JSDoc tags that are shared with other tag dictionaries. +var baseTags = exports.baseTags = { + abstract: { mustNotHaveValue: true, onTagged: function(doclet, tag) { - // since "abstract" is reserved word in JavaScript let's use "virtual" in code + // we call this `virtual` because `abstract` is a reserved word doclet.virtual = true; - } - }) - .synonym('virtual'); - - dictionary.defineTag('access', { + }, + synonyms: ['virtual'] + }, + access: { mustHaveValue: true, onTagged: function(doclet, tag) { - // only valid values are private and protected, public is default - if ( /^(private|protected)$/i.test(tag.value) ) { + // only valid values are private, protected and public + if ( /^(private|protected|public)$/i.test(tag.value) ) { doclet.access = tag.value.toLowerCase(); } else { delete doclet.access; } } - }); - - dictionary.defineTag('alias', { + }, + alias: { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.alias = tag.value; } - }); - + }, // Special separator tag indicating that multiple doclets should be generated for the same // comment. Used internally (and by some JSDoc users, although it's not officially supported). - // // In the following example, the parser will replace `//**` with an `@also` tag: - // // /** // * Foo. // *//** @@ -213,84 +228,77 @@ exports.defineTags = function(dictionary) { // * @param {string} bar // */ // function foo(bar) {} - dictionary.defineTag('also', { + also: { onTagged: function(doclet, tag) { // let the parser handle it; we define the tag here to avoid "not a known tag" errors } - }); - - // this symbol inherits from the specified symbol - dictionary.defineTag('augments', { + }, + augments: { mustHaveValue: true, // Allow augments value to be specified as a normal type, e.g. {Type} - onTagText: function(text) { - - var tagType = jsdoc.tag.type.parse(text, false, true); - return tagType.typeExpression || text; - }, + onTagText: parseTypeText, onTagged: function(doclet, tag) { doclet.augment( firstWordOf(tag.value) ); - } - }) - .synonym('extends'); - - dictionary.defineTag('author', { + }, + synonyms: ['extends'] + }, + author: { mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.author) { doclet.author = []; } + doclet.author = doclet.author || []; doclet.author.push(tag.value); } - }); - + }, // this symbol has a member that should use the same docs as another symbol - dictionary.defineTag('borrows', { + borrows: { mustHaveValue: true, onTagged: function(doclet, tag) { var borrows = parseBorrows(doclet, tag); doclet.borrow(borrows.target, borrows.source); } - }); - - dictionary.defineTag('class', { + }, + class: { onTagged: function(doclet, tag) { doclet.addTag('kind', 'class'); - // handle special case where both @class and @constructor tags exist in same doclet - if (tag.originalTitle === 'class') { - var looksLikeDesc = (tag.value || '').match(/\S+\s+\S+/); // multiple words after @class? - if ( looksLikeDesc || /@construct(s|or)\b/i.test(doclet.comment) ) { - doclet.classdesc = tag.value; // treat the @class tag as a @classdesc tag instead - return; - } + // We treat the @class tag as a @classdesc tag if all of the following are true: + // - Both @class and @constructor tags are present + // - There's no @classdesc tag + // - There are multiple words after @class + if (tag.value && + tag.originalTitle === 'class' && + /@construct(?:s|or)\b/i.test(doclet.comment) && + !/@classdesc\b/i.test(doclet.comment) && + tag.value.match(/\S+\s+\S+/)) { + doclet.addTag('classdesc', tag.value); } - - setDocletNameToValue(doclet, tag); - } - }) - .synonym('constructor'); - - dictionary.defineTag('classdesc', { + else { + setDocletNameToValue(doclet, tag); + } + }, + synonyms: ['constructor'] + }, + classdesc: { onTagged: function(doclet, tag) { doclet.classdesc = tag.value; } - }); - - dictionary.defineTag('constant', { + }, + constant: { canHaveType: true, canHaveName: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValueName(doclet, tag); setDocletTypeToValueType(doclet, tag); - } - }) - .synonym('const'); - - dictionary.defineTag('constructs', { + }, + synonyms: ['const'] + }, + constructs: { onTagged: function(doclet, tag) { var ownerClassName; if (!tag.value) { - ownerClassName = '{@thisClass}'; // this can be resolved later in the handlers + // this can be resolved later in the handlers + ownerClassName = '{@thisClass}'; } else { ownerClassName = firstWordOf(tag.value); @@ -298,16 +306,14 @@ exports.defineTags = function(dictionary) { doclet.addTag('alias', ownerClassName); doclet.addTag('kind', 'class'); } - }); - - dictionary.defineTag('copyright', { + }, + copyright: { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.copyright = tag.value; } - }); - - dictionary.defineTag('default', { + }, + default: { onTagged: function(doclet, tag) { var type; var value; @@ -321,7 +327,7 @@ exports.defineTags = function(dictionary) { type = doclet.meta.code.type; value = doclet.meta.code.value; - switch(type) { + switch (type) { case Syntax.ArrayExpression: doclet.defaultvalue = nodeToString(doclet.meta.code.node); doclet.defaultvaluetype = 'array'; @@ -341,60 +347,54 @@ exports.defineTags = function(dictionary) { break; } } - } - }) - .synonym('defaultvalue'); - - dictionary.defineTag('deprecated', { + }, + synonyms: ['defaultvalue'] + }, + deprecated: { // value is optional onTagged: function(doclet, tag) { doclet.deprecated = tag.value || true; } - }); - - dictionary.defineTag('description', { - mustHaveValue: true - }) - .synonym('desc'); - - dictionary.defineTag('enum', { + }, + description: { + mustHaveValue: true, + synonyms: ['desc'] + }, + enum: { canHaveType: true, onTagged: function(doclet, tag) { doclet.kind = 'member'; doclet.isEnum = true; setDocletTypeToValueType(doclet, tag); } - }); - - dictionary.defineTag('event', { + }, + event: { isNamespace: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValue(doclet, tag); } - }); - - dictionary.defineTag('example', { + }, + example: { keepsWhitespace: true, removesIndent: true, mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.examples) { doclet.examples = []; } + doclet.examples = doclet.examples || []; doclet.examples.push(tag.value); } - }); - - dictionary.defineTag('exports', { + }, + exports: { mustHaveValue: true, onTagged: function(doclet, tag) { var modName = firstWordOf(tag.value); - doclet.addTag('alias', modName); + // in case the user wrote something like `/** @exports module:foo */`: + doclet.addTag( 'alias', stripModuleNamespace(modName) ); doclet.addTag('kind', 'module'); } - }); - - dictionary.defineTag('external', { + }, + external: { canHaveType: true, isNamespace: true, onTagged: function(doclet, tag) { @@ -406,139 +406,144 @@ exports.defineTags = function(dictionary) { else { setDocletNameToValue(doclet, tag); } - } - }) - .synonym('host'); - - dictionary.defineTag('file', { + }, + synonyms: ['host'] + }, + file: { onTagged: function(doclet, tag) { setNameToFile(doclet, tag); setDocletKindToTitle(doclet, tag); setDocletDescriptionToValue(doclet, tag); doclet.preserveName = true; - } - }) - .synonym('fileoverview') - .synonym('overview'); - - dictionary.defineTag('fires', { + }, + synonyms: ['fileoverview', 'overview'] + }, + fires: { mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.fires) { doclet.fires = []; } + doclet.fires = doclet.fires || []; applyNamespace('event', tag); doclet.fires.push(tag.value); - } - }) - .synonym('emits'); - - dictionary.defineTag('function', { + }, + synonyms: ['emits'] + }, + function: { onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValue(doclet, tag); - } - }) - .synonym('func') - .synonym('method'); - - dictionary.defineTag('global', { + }, + synonyms: ['func', 'method'] + }, + global: { mustNotHaveValue: true, onTagged: function(doclet, tag) { - doclet.scope = 'global'; + doclet.scope = jsdoc.name.SCOPE.NAMES.GLOBAL; delete doclet.memberof; } - }); - - dictionary.defineTag('ignore', { + }, + ignore: { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.ignore = true; } - }); - - dictionary.defineTag('inner', { + }, + implements: { + mustHaveValue: true, + onTagText: parseTypeText, onTagged: function(doclet, tag) { - setDocletScopeToTitle(doclet, tag); - } - }); - - dictionary.defineTag('instance', { + doclet.implements = doclet.implements || []; + doclet.implements.push(tag.value); + } + }, + inheritdoc: { + mustNotHaveValue: true, + onTagged: function(doclet, tag) { + // use an empty string so JSDoc can support `@inheritdoc Foo#bar` in the future + doclet.inheritdoc = ''; + } + }, + inner: { onTagged: function(doclet, tag) { setDocletScopeToTitle(doclet, tag); } - }); - - dictionary.defineTag('kind', { - mustHaveValue: true - }); - - dictionary.defineTag('lends', { + }, + instance: { onTagged: function(doclet, tag) { - doclet.alias = tag.value || GLOBAL_LONGNAME; + setDocletScopeToTitle(doclet, tag); + } + }, + interface: { + canHaveName: true, + onTagged: function(doclet, tag) { + doclet.addTag('kind', 'interface'); + if (tag.value) { + setDocletNameToValueName(doclet, tag); + } + } + }, + kind: { + mustHaveValue: true + }, + lends: { + onTagged: function(doclet, tag) { + doclet.alias = tag.value || jsdoc.name.LONGNAMES.GLOBAL; doclet.addTag('undocumented'); } - }); - - dictionary.defineTag('license', { + }, + license: { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.license = tag.value; } - }); - - dictionary.defineTag('listens', { + }, + listens: { mustHaveValue: true, onTagged: function (doclet, tag) { - if (!doclet.listens) { doclet.listens = []; } + doclet.listens = doclet.listens || []; applyNamespace('event', tag); doclet.listens.push(tag.value); - // TODO: verify that parameters match the event parameters? } - }); - - dictionary.defineTag('member', { + }, + member: { canHaveType: true, canHaveName: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValueName(doclet, tag); setDocletTypeToValueType(doclet, tag); - } - }) - .synonym('var'); - - dictionary.defineTag('memberof', { + }, + synonyms: ['var'] + }, + memberof: { mustHaveValue: true, onTagged: function(doclet, tag) { if (tag.originalTitle === 'memberof!') { doclet.forceMemberof = true; - if (tag.value === GLOBAL_LONGNAME) { + if (tag.value === jsdoc.name.LONGNAMES.GLOBAL) { doclet.addTag('global'); delete doclet.memberof; } } setDocletMemberof(doclet, tag); - } - }) - .synonym('memberof!'); - + }, + synonyms: ['memberof!'] + }, // this symbol mixes in all of the specified object's members - dictionary.defineTag('mixes', { + mixes: { mustHaveValue: true, onTagged: function(doclet, tag) { var source = firstWordOf(tag.value); doclet.mix(source); } - }); - - dictionary.defineTag('mixin', { + }, + mixin: { onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValue(doclet, tag); } - }); - - dictionary.defineTag('module', { + }, + module: { canHaveType: true, isNamespace: true, onTagged: function(doclet, tag) { @@ -547,76 +552,67 @@ exports.defineTags = function(dictionary) { if (!doclet.name) { setDocletNameToFilename(doclet, tag); } + // in case the user wrote something like `/** @module module:foo */`: + doclet.name = stripModuleNamespace(doclet.name); + setDocletTypeToValueType(doclet, tag); - } - }); - - dictionary.defineTag('name', { + } + }, + name: { mustHaveValue: true - }); - - dictionary.defineTag('namespace', { + }, + namespace: { canHaveType: true, onTagged: function(doclet, tag) { setDocletKindToTitle(doclet, tag); setDocletNameToValue(doclet, tag); setDocletTypeToValueType(doclet, tag); } - }); - - dictionary.defineTag('param', { - //mustHaveValue: true, // param name can be found in the source code if not provided + }, + param: { canHaveType: true, canHaveName: true, onTagged: function(doclet, tag) { - if (!doclet.params) { doclet.params = []; } + doclet.params = doclet.params || []; doclet.params.push(tag.value || {}); - } - }) - .synonym('argument') - .synonym('arg'); - - dictionary.defineTag('private', { + }, + synonyms: ['arg', 'argument'] + }, + private: { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.access = 'private'; } - }); - - dictionary.defineTag('property', { + }, + property: { mustHaveValue: true, canHaveType: true, canHaveName: true, onTagged: function(doclet, tag) { - if (!doclet.properties) { doclet.properties = []; } + doclet.properties = doclet.properties || []; doclet.properties.push(tag.value); - } - }) - .synonym('prop'); - - dictionary.defineTag('protected', { + }, + synonyms: ['prop'] + }, + protected: { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.access = 'protected'; } - }); - - dictionary.defineTag('public', { + }, + public: { mustNotHaveValue: true, onTagged: function(doclet, tag) { - delete doclet.access; // public is default + doclet.access = 'public'; } - }); - - // use this instead of old deprecated @final tag - dictionary.defineTag('readonly', { + }, + readonly: { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.readonly = true; } - }); - - dictionary.defineTag('requires', { + }, + requires: { mustHaveValue: true, onTagged: function(doclet, tag) { var requiresName; @@ -628,89 +624,78 @@ exports.defineTags = function(dictionary) { // otherwise, assume it's a module else { requiresName = firstWordOf(tag.value); - if (requiresName.indexOf(MODULE_PREFIX) !== 0) { - requiresName = MODULE_PREFIX + requiresName; + if (requiresName.indexOf(MODULE_NAMESPACE) !== 0) { + requiresName = MODULE_NAMESPACE + requiresName; } } - if (!doclet.requires) { doclet.requires = []; } + doclet.requires = doclet.requires || []; doclet.requires.push(requiresName); } - }); - - dictionary.defineTag('returns', { + }, + returns: { mustHaveValue: true, canHaveType: true, onTagged: function(doclet, tag) { - if (!doclet.returns) { doclet.returns = []; } + doclet.returns = doclet.returns || []; doclet.returns.push(tag.value); - } - }) - .synonym('return'); - - dictionary.defineTag('see', { + }, + synonyms: ['return'] + }, + see: { mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.see) { doclet.see = []; } + doclet.see = doclet.see || []; doclet.see.push(tag.value); } - }); - - dictionary.defineTag('since', { + }, + since: { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.since = tag.value; } - }); - - dictionary.defineTag('static', { + }, + static: { onTagged: function(doclet, tag) { setDocletScopeToTitle(doclet, tag); } - }); - - dictionary.defineTag('summary', { + }, + summary: { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.summary = tag.value; } - }); - - dictionary.defineTag('this', { + }, + 'this': { mustHaveValue: true, onTagged: function(doclet, tag) { - doclet['this'] = firstWordOf(tag.value); + doclet.this = firstWordOf(tag.value); } - }); - - dictionary.defineTag('todo', { + }, + todo: { mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.todo) { doclet.todo = []; } + doclet.todo = doclet.todo || []; doclet.todo.push(tag.value); } - }); - - dictionary.defineTag('throws', { + }, + throws: { mustHaveValue: true, canHaveType: true, onTagged: function(doclet, tag) { - if (!doclet.exceptions) { doclet.exceptions = []; } + doclet.exceptions = doclet.exceptions || []; doclet.exceptions.push(tag.value); - setDocletTypeToValueType(doclet, tag); - } - }) - .synonym('exception'); - - dictionary.defineTag('tutorial', { + }, + synonyms: ['exception'] + }, + tutorial: { mustHaveValue: true, onTagged: function(doclet, tag) { - if (!doclet.tutorials) { doclet.tutorials = []; } + doclet.tutorials = doclet.tutorials || []; doclet.tutorials.push(tag.value); } - }); - - dictionary.defineTag('type', { + }, + type: { mustHaveValue: true, mustNotHaveDescription: true, canHaveType: true, @@ -746,9 +731,8 @@ exports.defineTags = function(dictionary) { } } } - }); - - dictionary.defineTag('typedef', { + }, + typedef: { canHaveType: true, canHaveName: true, onTagged: function(doclet, tag) { @@ -769,29 +753,147 @@ exports.defineTags = function(dictionary) { setDocletTypeToValueType(doclet, tag); } } - } - }) - .synonym('callback'); - - dictionary.defineTag('undocumented', { + }, + synonyms: ['callback'] + }, + undocumented: { mustNotHaveValue: true, onTagged: function(doclet, tag) { doclet.undocumented = true; doclet.comment = ''; } - }); - - dictionary.defineTag('variation', { + }, + variation: { mustHaveValue: true, onTagged: function(doclet, tag) { - doclet.variation = tag.value; - } - }); + var value = tag.value; - dictionary.defineTag('version', { + if ( /^\((.+)\)$/.test(value) ) { + value = RegExp.$1; + } + + doclet.variation = value; + } + }, + version: { mustHaveValue: true, onTagged: function(doclet, tag) { doclet.version = tag.value; } - }); + } +}; + +// Tag dictionary for JSDoc. +var jsdocTags = exports.jsdocTags = baseTags; + +// Tag dictionary for Google Closure Compiler. +var closureTags = exports.closureTags = { + const: cloneTagDef(baseTags.constant), + constructor: cloneTagDef(baseTags.class), + deprecated: cloneTagDef(baseTags.deprecated), + enum: cloneTagDef(baseTags.enum), + extends: cloneTagDef(baseTags.augments), + final: cloneTagDef(baseTags.readonly), + implements: cloneTagDef(baseTags.implements), + inheritdoc: cloneTagDef(baseTags.inheritdoc), + interface: cloneTagDef(baseTags.interface, { + canHaveName: false, + mustNotHaveValue: true + }), + lends: cloneTagDef(baseTags.lends), + license: cloneTagDef(baseTags.license), + // Closure Compiler only + override: { + mustNotHaveValue: true, + onTagged: function(doclet, tag) { + doclet.override = true; + } + }, + param: cloneTagDef(baseTags.param), + private: { + canHaveType: true, + onTagged: function(doclet, tag) { + doclet.access = 'private'; + + if (tag.value && tag.value.type) { + setDocletTypeToValueType(doclet, tag); + } + } + }, + protected: { + canHaveType: true, + onTagged: function(doclet, tag) { + doclet.access = 'protected'; + + if (tag.value && tag.value.type) { + setDocletTypeToValueType(doclet, tag); + } + } + }, + return: cloneTagDef(baseTags.returns), + 'this': cloneTagDef(baseTags.this), + throws: cloneTagDef(baseTags.throws), + type: cloneTagDef(baseTags.type, { + mustNotHaveDescription: false + }), + typedef: cloneTagDef(baseTags.typedef) +}; + +function addTagDefinitions(dictionary, tagDefs) { + Object.keys(tagDefs).forEach(function(tagName) { + var tagDef; + + tagDef = tagDefs[tagName]; + dictionary.defineTag(tagName, tagDef); + + if (tagDef.synonyms) { + tagDef.synonyms.forEach(function(synonym) { + dictionary.defineSynonym(tagName, synonym); + }); + } + }); +} + +/** + * Populate the given dictionary with the appropriate JSDoc tag definitions. + * + * If the `tagDefinitions` parameter is omitted, JSDoc uses its configuration settings to decide + * which tags to add to the dictionary. + * + * If the `tagDefinitions` parameter is included, JSDoc adds only the tag definitions from the + * `tagDefinitions` object. The configuration settings are ignored. + * + * @param {module:jsdoc/tag/dictionary} dictionary + * @param {Object} [tagDefinitions] - A dictionary whose values define the rules for a JSDoc tag. + */ +exports.defineTags = function(dictionary, tagDefinitions) { + var dictionaries; + + if (!tagDefinitions) { + dictionaries = global.env.conf.tags.dictionaries; + + if (!dictionaries) { + jsdoc.util.logger.error('The configuration setting "tags.dictionaries" is undefined. ' + + 'Unable to load tag definitions.'); + return; + } + else { + dictionaries = dictionaries.slice(0).reverse(); + } + + dictionaries.forEach(function(dictName) { + var tagDefs = exports[DEFINITIONS[dictName]]; + + if (!tagDefs) { + jsdoc.util.logger.error('The configuration setting "tags.dictionaries" contains ' + + 'the unknown dictionary name %s. Ignoring the dictionary.', dictName); + return; + } + + addTagDefinitions(dictionary, tagDefs); + }); + } + else { + addTagDefinitions(dictionary, tagDefinitions); + } }; diff --git a/node_modules/jsdoc/lib/jsdoc/tag/type.js b/node_modules/jsdoc/lib/jsdoc/tag/type.js index b0ca81f..8597b2e 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/type.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/type.js @@ -153,9 +153,13 @@ function getTagInfo(tagValue, canHaveName, canHaveType) { */ function parseName(tagInfo) { // like '[foo]' or '[ foo ]' or '[foo=bar]' or '[ foo=bar ]' or '[ foo = bar ]' - if ( /^\[\s*(.+?)\s*\]$/.test(tagInfo.name) ) { - tagInfo.name = RegExp.$1; - tagInfo.optional = true; + // or 'foo=bar' or 'foo = bar' + if ( /^(\[)?\s*(.+?)\s*(\])?$/.test(tagInfo.name) ) { + tagInfo.name = RegExp.$2; + // were the "optional" brackets present? + if (RegExp.$1 && RegExp.$3) { + tagInfo.optional = true; + } // like 'foo=bar' or 'foo = bar' if ( /^(.+?)\s*=\s*(.+)$/.test(tagInfo.name) ) { @@ -176,7 +180,7 @@ function getTypeStrings(parsedType, isOutermostType) { var TYPES = catharsis.Types; - switch(parsedType.type) { + switch (parsedType.type) { case TYPES.AllLiteral: types.push('*'); break; @@ -196,7 +200,7 @@ function getTypeStrings(parsedType, isOutermostType) { // if this is the outermost type, we strip the modifiers; otherwise, we keep them if (isOutermostType) { applications = parsedType.applications.map(function(application) { - return getTypeStrings(application); + return catharsis.stringify(application); }).join(', '); typeString = util.format( '%s.<%s>', getTypeStrings(parsedType.expression), applications ); @@ -254,6 +258,7 @@ function parseTypeExpression(tagInfo) { } tagInfo.type = tagInfo.type.concat( getTypeStrings(parsedType, true) ); + tagInfo.parsedType = parsedType; // Catharsis and JSDoc use the same names for 'optional' and 'nullable'... ['optional', 'nullable'].forEach(function(key) { diff --git a/node_modules/jsdoc/lib/jsdoc/tag/validator.js b/node_modules/jsdoc/lib/jsdoc/tag/validator.js index 3d9103c..6a7f95b 100644 --- a/node_modules/jsdoc/lib/jsdoc/tag/validator.js +++ b/node_modules/jsdoc/lib/jsdoc/tag/validator.js @@ -25,6 +25,17 @@ function buildMessage(tagName, meta, desc) { * Validate the given tag. */ exports.validate = function(tag, tagDef, meta) { + // handle cases where the tag definition does not exist + if (!tagDef) { + // log an error if unknown tags are not allowed + if (!env.conf.tags.allowUnknownTags) { + logger.error( buildMessage(tag.title, meta, 'is not a known tag') ); + } + + // stop validation, since there's nothing to validate against + return; + } + // check for errors that make the tag useless if (!tagDef && !env.conf.tags.allowUnknownTags) { logger.error( buildMessage(tag.title, meta, 'is not a known tag') ); diff --git a/node_modules/jsdoc/lib/jsdoc/template.js b/node_modules/jsdoc/lib/jsdoc/template.js index b5317c9..dc56b6d 100644 --- a/node_modules/jsdoc/lib/jsdoc/template.js +++ b/node_modules/jsdoc/lib/jsdoc/template.js @@ -17,19 +17,18 @@ var _ = require('underscore'), /** @class @classdesc Underscore template helper. - @param {string} path - Templates directory. + @param {string} filepath - Templates directory. */ -exports.Template = function(path) { - this.path = path; +exports.Template = function(filepath) { + this.path = filepath; this.layout = null; this.cache = {}; // override default template tag settings this.settings = { - evaluate : /<\?js([\s\S]+?)\?>/g, + evaluate: /<\?js([\s\S]+?)\?>/g, interpolate: /<\?js=([\s\S]+?)\?>/g, - escape : /<\?js~([\s\S]+?)\?>/g + escape: /<\?js~([\s\S]+?)\?>/g }; - }; /** Loads template from given file. diff --git a/node_modules/jsdoc/lib/jsdoc/tutorial.js b/node_modules/jsdoc/lib/jsdoc/tutorial.js index a20b9c7..931a257 100644 --- a/node_modules/jsdoc/lib/jsdoc/tutorial.js +++ b/node_modules/jsdoc/lib/jsdoc/tutorial.js @@ -6,6 +6,9 @@ 'use strict'; var markdown = require('jsdoc/util/markdown'); +var util = require('util'); + +var hasOwnProp = Object.prototype.hasOwnProperty; /** Removes child tutorial from the parent. Does *not* unset child.parent though. @param {Tutorial} parent - parent tutorial. @@ -40,7 +43,7 @@ function addChild(parent, child) { @param {number} type - Source formating. */ exports.Tutorial = function(name, content, type) { - this.title = this.name = name; + this.title = this.name = this.longname = name; this.content = content; this.type = type; @@ -90,10 +93,7 @@ exports.Tutorial.prototype.parse = function() { // markdown case exports.TYPES.MARKDOWN: var mdParse = markdown.getParser(); - return mdParse(this.content) - .replace(/&/g, '&') // because markdown escapes these - .replace(/</g, '<') - .replace(/>/g, '>'); + return mdParse(this.content); // uhm... should we react somehow? // if not then this case can be merged with TYPES.HTML @@ -102,6 +102,35 @@ exports.Tutorial.prototype.parse = function() { } }; +/** + * @class + * @classdesc Represents the root tutorial. + * @extends {module:jsdoc/tutorial.Tutorial} + */ +exports.RootTutorial = function() { + exports.RootTutorial.super_.call(this, '', ''); + + this._tutorials = {}; +}; +util.inherits(exports.RootTutorial, exports.Tutorial); + +/** + * Retrieve a tutorial by name. + * @param {string} name - Tutorial name. + * @return {module:jsdoc/tutorial.Tutorial} Tutorial instance. + */ +exports.RootTutorial.prototype.getByName = function(name) { + return hasOwnProp.call(this._tutorials, name) && this._tutorials[name]; +}; + +/** + * Add a child tutorial to the root. + * @param {module:jsdoc/tutorial.Tutorial} child - Child tutorial. + */ +exports.RootTutorial.prototype._addTutorial = function(child) { + this._tutorials[child.name] = child; +}; + /** Tutorial source types. @enum {number} */ diff --git a/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js b/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js index 7c446e2..610405e 100644 --- a/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js +++ b/node_modules/jsdoc/lib/jsdoc/tutorial/resolver.js @@ -1,4 +1,3 @@ -/*global env: true */ /** @overview @author Rafał Wrzeszcz @@ -17,9 +16,9 @@ var tutorial = require('jsdoc/tutorial'); var hasOwnProp = Object.prototype.hasOwnProperty; +// TODO: make this an instance member of `RootTutorial`? var conf = {}; var finder = /^(.*)\.(x(?:ht)?ml|html?|md|markdown|json)$/i; -var tutorials = {}; /** checks if `conf` is the metadata for a single tutorial. * A tutorial's metadata has a property 'title' and/or a property 'children'. @@ -31,6 +30,12 @@ function isTutorialJSON(json) { return (hasOwnProp.call(json, 'title') || hasOwnProp.call(json, 'children')); } +/** + * Root tutorial. + * @type {module:jsdoc/tutorial.Root} + */ +exports.root = new tutorial.RootTutorial(); + /** Helper function that adds tutorial configuration to the `conf` variable. * This helps when multiple tutorial configurations are specified in one object, * or when a tutorial's children are specified as tutorial configurations as @@ -49,13 +54,16 @@ function isTutorialJSON(json) { * OR an object giving the configuration for the child tutorials. */ function addTutorialConf(name, meta) { - var names, i; + var i; + var l; + var names; + if (isTutorialJSON(meta)) { // if the children are themselves tutorial defintions as opposed to an // array of strings, add each child. if (hasOwnProp.call(meta, 'children') && !Array.isArray(meta.children)) { names = Object.keys(meta.children); - for (i = 0; i < names.length; ++i) { + for (i = 0, l = names.length; i < l; ++i) { addTutorialConf(names[i], meta.children[names[i]]); } // replace with an array of names. @@ -68,51 +76,40 @@ function addTutorialConf(name, meta) { conf[name] = meta; } } else { - // it's an object of tutorials, the keys are th etutorial names. + // keys are tutorial names, values are `Tutorial` instances names = Object.keys(meta); - for (i = 0; i < names.length; ++i) { + for (i = 0, l = names.length; i < l; ++i) { addTutorialConf(names[i], meta[names[i]]); } } } -/** Adds new tutorial. - @param {tutorial.Tutorial} current - New tutorial. +/** + * Add a tutorial. + * @param {module:jsdoc/tutorial.Tutorial} current - Tutorial to add. */ exports.addTutorial = function(current) { - if (hasOwnProp.call(tutorials, current.name)) { + if (exports.root.getByName(current.name)) { logger.warn('The tutorial %s is defined more than once. Only the first definition will be used.', current.name); } else { - tutorials[current.name] = current; - - // default temporary parent + // by default, the root tutorial is the parent current.setParent(exports.root); + + exports.root._addTutorial(current); } }; -/** Root tutorial. - @type tutorial.Tutorial +/** + * Load tutorials from the given path. + * @param {string} filepath - Tutorials directory. */ -exports.root = new tutorial.Tutorial('', ''); - -/** Additional instance method for root node. - @param {string} name - Tutorial name. - @return {tutorial.Tutorial} Tutorial instance. - */ -exports.root.getByName = function(name) { - return hasOwnProp.call(tutorials, name) && tutorials[name]; -}; - -/** Load tutorials from given path. - @param {string} _path - Tutorials directory. - */ -exports.load = function(_path) { - var match, - type, - name, - content, - current, - files = fs.ls(_path); +exports.load = function(filepath) { + var content; + var current; + var files = fs.ls(filepath, global.env.opts.recurse ? 10 : undefined); + var name; + var match; + var type; // tutorials handling files.forEach(function(file) { @@ -121,7 +118,7 @@ exports.load = function(_path) { // any filetype that can apply to tutorials if (match) { name = path.basename(match[1]); - content = fs.readFileSync(file, env.opts.encoding); + content = fs.readFileSync(file, global.env.opts.encoding); switch (match[2].toLowerCase()) { // HTML type @@ -160,34 +157,36 @@ exports.load = function(_path) { /** Resolves hierarchical structure. */ exports.resolve = function() { - var item, - current; - for (var name in conf) { - if ( hasOwnProp.call(conf, name) ) { - // TODO: should we complain about this? - if (!hasOwnProp.call(tutorials, name)) { - continue; - } + var item; + var current; - item = conf[name]; - current = tutorials[name]; + Object.keys(conf).forEach(function(name) { + current = exports.root.getByName(name); - // set title - if (item.title) { - current.title = item.title; - } - - // add children - if (item.children) { - item.children.forEach(function(child) { - if (!hasOwnProp.call(tutorials, child)) { - logger.error('Missing child tutorial: %s', child); - } - else { - tutorials[child].setParent(current); - } - }); - } + // TODO: should we complain about this? + if (!current) { + return; } - } + + item = conf[name]; + + // set title + if (item.title) { + current.title = item.title; + } + + // add children + if (item.children) { + item.children.forEach(function(child) { + var childTutorial = exports.root.getByName(child); + + if (!childTutorial) { + logger.error('Missing child tutorial: %s', child); + } + else { + childTutorial.setParent(current); + } + }); + } + }); }; diff --git a/node_modules/jsdoc/lib/jsdoc/util/doop.js b/node_modules/jsdoc/lib/jsdoc/util/doop.js index a9e1468..52b68e7 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/doop.js +++ b/node_modules/jsdoc/lib/jsdoc/util/doop.js @@ -1,28 +1,68 @@ +/*global Set */ + /** - Deep clone a simple object. + Deep clone a simple object. Ignores non-enumerable properties. @private */ 'use strict'; -function doop(o) { +var setDefined = typeof Set !== 'undefined'; + +function addItem(set, item) { + if (setDefined) { + set.add(item); + } + else if (set.indexOf(item) === -1) { + set.push(item); + } +} + +function hasItem(set, item) { + if (setDefined) { + return set.has(item); + } + else { + return set.indexOf(item) !== -1; + } +} + +// TODO: can we remove the circular-ref checking? pretty sure it's not needed anymore... +// if we need this here for some reason I'm forgetting, we should share code with jsdoc/util/dumper +function doop(o, seen) { var clone; + var descriptor; var props; var i; var l; + if (!seen) { + seen = setDefined ? new Set() : []; + } + if (o instanceof Object && o.constructor !== Function) { - if ( Array.isArray(o) ) { - clone = []; - for (i = 0, l = o.length; i < l; i++) { - clone[i] = (o[i] instanceof Object) ? doop(o[i]) : o[i]; - } + if ( hasItem(seen, o) ) { + clone = ''; } else { - clone = Object.create( Object.getPrototypeOf(o) ); - props = Object.getOwnPropertyNames(o); - for (i = 0, l = props.length; i < l; i++) { - Object.defineProperty(clone, props[i], - Object.getOwnPropertyDescriptor(o, props[i])); + addItem(seen, o); + + if ( Array.isArray(o) ) { + clone = []; + for (i = 0, l = o.length; i < l; i++) { + clone[i] = (o[i] instanceof Object) ? doop(o[i], seen) : o[i]; + } + } + else { + clone = Object.create( Object.getPrototypeOf(o) ); + props = Object.keys(o); + for (i = 0, l = props.length; i < l; i++) { + descriptor = Object.getOwnPropertyDescriptor(o, props[i]); + if (descriptor.value) { + descriptor.value = doop(descriptor.value, seen); + } + + Object.defineProperty(clone, props[i], descriptor); + } } } @@ -32,7 +72,12 @@ function doop(o) { return o; } -// for backwards compatibility -doop.doop = doop; +// Wrapper to avoid exposing the 'seen' parameter outside of this module. +function doopWrapper(o) { + return doop(o); +} -module.exports = doop; +// for backwards compatibility +doopWrapper.doop = doopWrapper; + +module.exports = doopWrapper; diff --git a/node_modules/jsdoc/lib/jsdoc/util/dumper.js b/node_modules/jsdoc/lib/jsdoc/util/dumper.js index 3d9c667..f4efa38 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/dumper.js +++ b/node_modules/jsdoc/lib/jsdoc/util/dumper.js @@ -8,42 +8,42 @@ 'use strict'; var util = require('util'); -var setDefined = typeof Set !== 'undefined'; + +var OBJECT_WALKER_KEY = 'hasBeenSeenByWalkerDumper'; +var SET_DEFINED = (typeof Set !== 'undefined'); function ObjectWalker() { - if (setDefined) { - this.seenItems = new Set(); - } else { - this.seenItems = []; - } + this.seenItems = SET_DEFINED ? new Set() : []; } ObjectWalker.prototype.seen = function(object) { var result; - if (setDefined) { - result = this.seenItems.has(object); - } else { - result = object.hasBeenSeenByWalkerDumper; + + if (SET_DEFINED) { + result = this.seenItems.has(object); + } + else { + result = object[OBJECT_WALKER_KEY]; } return result; }; ObjectWalker.prototype.markAsSeen = function(object) { - if (setDefined) { + if (SET_DEFINED) { this.seenItems.add(object); - } else { - object.hasBeenSeenByWalkerDumper = true; + } + else { + object[OBJECT_WALKER_KEY] = true; this.seenItems.push(object); } }; -ObjectWalker.prototype.cleanSeenFlag = function() { - if (setDefined) { - this.seenItems = new Set(); - } else { - this.seenItems.forEach(function(object) { - delete object.hasBeenSeenByWalkerDumper; - }); +ObjectWalker.prototype.removeSeenFlag = function(obj) { + if (SET_DEFINED) { + this.seenItems.delete(obj); + } + else { + delete obj[OBJECT_WALKER_KEY]; } }; @@ -85,10 +85,13 @@ ObjectWalker.prototype.walk = function(o) { else if ( Array.isArray(o) ) { result = this.checkCircularRefs(o, function(arr) { var newArray = []; + arr.forEach(function(item) { newArray.push( self.walk(item) ); }); + self.removeSeenFlag(arr); + return newArray; }); } @@ -107,11 +110,14 @@ ObjectWalker.prototype.walk = function(o) { else if ( this.isObject(o) && o !== null ) { result = this.checkCircularRefs(o, function(obj) { var newObj = {}; + Object.keys(obj).forEach(function(key) { - if (!setDefined && key === 'hasBeenSeenByWalkerDumper') { return; } + if (!SET_DEFINED && key === OBJECT_WALKER_KEY) { return; } newObj[key] = self.walk(obj[key]); }); + self.removeSeenFlag(obj); + return newObj; }); } @@ -128,8 +134,6 @@ ObjectWalker.prototype.walk = function(o) { */ exports.dump = function(object) { var walker = new ObjectWalker(); - var result = JSON.stringify(walker.walk(object), null, 4); - walker.cleanSeenFlag(); - return result; + return JSON.stringify(walker.walk(object), null, 4); }; diff --git a/node_modules/jsdoc/lib/jsdoc/util/logger.js b/node_modules/jsdoc/lib/jsdoc/util/logger.js index b8134d6..8d2976a 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/logger.js +++ b/node_modules/jsdoc/lib/jsdoc/util/logger.js @@ -47,21 +47,36 @@ var logger = module.exports = new Logger(); * Logging levels for the JSDoc logger. The default logging level is * {@link module:jsdoc/util/logger.LEVELS.ERROR}. * + * @alias module:jsdoc/util/logger.LEVELS * @enum * @type {number} */ var LEVELS = logger.LEVELS = { - /** Do not log any messages. */ + /** + * Do not log any messages. + * + * @alias module:jsdoc/util/logger.LEVELS.SILENT + */ SILENT: 0, - /** Log fatal errors that prevent JSDoc from running. */ + /** + * Log fatal errors that prevent JSDoc from running. + * + * @alias module:jsdoc/util/logger.LEVELS.FATAL + */ FATAL: 10, - /** Log all errors, including errors from which JSDoc can recover. */ + /** + * Log all errors, including errors from which JSDoc can recover. + * + * @alias module:jsdoc/util/logger.LEVELS.ERROR + */ ERROR: 20, /** * Log the following messages: * * + Warnings * + Errors + * + * @alias module:jsdoc/util/logger.LEVELS.WARN */ WARN: 30, /** @@ -70,6 +85,8 @@ var LEVELS = logger.LEVELS = { * + Informational messages * + Warnings * + Errors + * + * @alias module:jsdoc/util/logger.LEVELS.INFO */ INFO: 40, /** @@ -79,9 +96,15 @@ var LEVELS = logger.LEVELS = { * + Informational messages * + Warnings * + Errors + * + * @alias module:jsdoc/util/logger.LEVELS.DEBUG */ DEBUG: 50, - /** Log all messages. */ + /** + * Log all messages. + * + * @alias module:jsdoc/util/logger.LEVELS.VERBOSE + */ VERBOSE: 1000 }; @@ -139,6 +162,7 @@ function printToStdout() { /** * Log a message at log level {@link module:jsdoc/util/logger.LEVELS.DEBUG}. * + * @alias module:jsdoc/util/logger.debug * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -147,6 +171,7 @@ logger.debug = wrapLogFunction('debug', console.info); * Print a string at log level {@link module:jsdoc/util/logger.LEVELS.DEBUG}. The string is not * terminated by a newline. * + * @alias module:jsdoc/util/logger.printDebug * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -154,8 +179,7 @@ logger.printDebug = wrapLogFunction('debug', printToStdout); /** * Log a message at log level {@link module:jsdoc/util/logger.LEVELS.ERROR}. * - * @name module:jsdoc/util/logger.error - * @function + * @alias module:jsdoc/util/logger.error * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -163,8 +187,7 @@ logger.error = wrapLogFunction('error', console.error); /** * Log a message at log level {@link module:jsdoc/util/logger.LEVELS.FATAL}. * - * @name module:jsdoc/util/logger.error - * @function + * @alias module:jsdoc/util/logger.fatal * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -172,8 +195,7 @@ logger.fatal = wrapLogFunction('fatal', console.error); /** * Log a message at log level {@link module:jsdoc/util/logger.LEVELS.INFO}. * - * @name module:jsdoc/util/logger.info - * @function + * @alias module:jsdoc/util/logger.info * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -182,6 +204,7 @@ logger.info = wrapLogFunction('info', console.info); * Print a string at log level {@link module:jsdoc/util/logger.LEVELS.INFO}. The string is not * terminated by a newline. * + * @alias module:jsdoc/util/logger.printInfo * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -189,8 +212,7 @@ logger.printInfo = wrapLogFunction('info', printToStdout); /** * Log a message at log level {@link module:jsdoc/util/logger.LEVELS.VERBOSE}. * - * @name module:jsdoc/util/logger.verbose - * @function + * @alias module:jsdoc/util/logger.verbose * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -199,6 +221,7 @@ logger.verbose = wrapLogFunction('verbose', console.info); * Print a string at log level {@link module:jsdoc/util/logger.LEVELS.VERBOSE}. The string is not * terminated by a newline. * + * @alias module:jsdoc/util/logger.printVerbose * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -206,8 +229,7 @@ logger.printVerbose = wrapLogFunction('verbose', printToStdout); /** * Log a message at log level {@link module:jsdoc/util/logger.LEVELS.WARN}. * - * @name module:jsdoc/util/logger.warn - * @function + * @alias module:jsdoc/util/logger.warn * @param {string} message - The message to log. * @param {...*=} values - The values that will replace the message's placeholders. */ @@ -216,6 +238,7 @@ logger.warn = wrapLogFunction('warn', console.warn); /** * Set the log level. * + * @alias module:jsdoc/util/logger.setLevel * @param {module:jsdoc/util/logger.LEVELS} level - The log level to use. */ logger.setLevel = function setLevel(level) { @@ -225,6 +248,7 @@ logger.setLevel = function setLevel(level) { /** * Get the current log level. * + * @alias module:jsdoc/util/logger.getLevel * @return {module:jsdoc/util/logger.LEVELS} The current log level. */ logger.getLevel = function getLevel() { diff --git a/node_modules/jsdoc/lib/jsdoc/util/runtime.js b/node_modules/jsdoc/lib/jsdoc/util/runtime.js index d435eae..1a50a32 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/runtime.js +++ b/node_modules/jsdoc/lib/jsdoc/util/runtime.js @@ -81,7 +81,7 @@ function initializeNode(args) { } exports.initialize = function(args) { - switch(runtime) { + switch (runtime) { case RHINO: initializeRhino(args); break; diff --git a/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js b/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js index 709cd2f..793331b 100644 --- a/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js +++ b/node_modules/jsdoc/lib/jsdoc/util/templateHelper.js @@ -4,15 +4,20 @@ */ 'use strict'; +var catharsis = require('catharsis'); var dictionary = require('jsdoc/tag/dictionary'); +var name = require('jsdoc/name'); var util = require('util'); var hasOwnProp = Object.prototype.hasOwnProperty; +var MODULE_NAMESPACE = 'module:'; + var files = {}; +var ids = {}; // each container gets its own html file -var containers = ['class', 'module', 'external', 'namespace', 'mixin']; +var containers = ['class', 'module', 'external', 'namespace', 'mixin', 'interface']; var tutorials; @@ -23,9 +28,36 @@ exports.setTutorials = function(root) { tutorials = root; }; -exports.globalName = 'global'; +exports.globalName = name.SCOPE.NAMES.GLOBAL; exports.fileExtension = '.html'; -exports.scopeToPunc = require('jsdoc/name').scopeToPunc; +exports.scopeToPunc = name.scopeToPunc; + +var linkMap = { + // two-way lookup + longnameToUrl: {}, + urlToLongname: {}, + + // one-way lookup (IDs are only unique per file) + longnameToId: {} +}; + +// two-way lookup +var tutorialLinkMap = { + nameToUrl: {}, + urlToName: {} +}; + +var longnameToUrl = exports.longnameToUrl = linkMap.longnameToUrl; +var longnameToId = exports.longnameToId = linkMap.longnameToId; + +var registerLink = exports.registerLink = function(longname, fileUrl) { + linkMap.longnameToUrl[longname] = fileUrl; + linkMap.urlToLongname[fileUrl] = longname; +}; + +var registerId = exports.registerId = function(longname, fragment) { + linkMap.longnameToId[longname] = fragment; +}; function getNamespace(kind) { if (dictionary.isNamespace(kind)) { @@ -34,13 +66,33 @@ function getNamespace(kind) { return ''; } -function makeFilenameUnique(filename, str) { +function formatNameForLink(doclet, options) { + var newName = getNamespace(doclet.kind) + (doclet.name || '') + (doclet.variation || ''); + var scopePunc = exports.scopeToPunc[doclet.scope] || ''; + + // Only prepend the scope punctuation if it's not the same character that marks the start of a + // fragment ID. Using `#` in HTML5 fragment IDs is legal, but URLs like `foo.html##bar` are + // just confusing. + if (scopePunc !== '#') { + newName = scopePunc + newName; + } + + return newName; +} + +function makeUniqueFilename(filename, str) { var key = filename.toLowerCase(); var nonUnique = true; + // don't allow filenames to begin with an underscore + if (!filename.length || filename[0] === '_') { + filename = '-' + filename; + key = filename.toLowerCase(); + } + // append enough underscores to make the filename unique while (nonUnique) { - if ( files[key] && hasOwnProp.call(files, key) ) { + if ( hasOwnProp.call(files, key) ) { filename += '_'; key = filename.toLowerCase(); } else { @@ -52,25 +104,6 @@ function makeFilenameUnique(filename, str) { return filename; } -function cleanseFilename(str) { - str = str || ''; - - // allow for namespace prefix - // TODO: use prefixes in jsdoc/doclet - return str.replace(/^(event|module|external|package):/, '$1-') - // use - instead of ~ to denote 'inner' - .replace(/~/g, '-') - // use _ instead of # to denote 'instance' - .replace(/\#/g, '_') - // remove the variation, if any - .replace(/\([\s\S]*\)$/, ''); -} - -var htmlsafe = exports.htmlsafe = function(str) { - return str.replace(/&/g, '&') - .replace(/]/g, '_') + // use - instead of ~ to denote 'inner' + .replace(/~/g, '-') + // use _ instead of # to denote 'instance' + .replace(/\#/g, '_') + // use _ instead of / (for example, in module names) + .replace(/\//g, '_') + // remove the variation, if any + .replace(/\([\s\S]*\)$/, '') + // make sure we don't create hidden files, or files whose names start with a dash + .replace(/^[\.\-]/, ''); - // if the basename includes characters that we can't use in a filepath, remove everything up to - // and including the last bad character - var regexp = /[^$a-z0-9._\-](?=[$a-z0-9._\-]*$)/i; - var result = regexp.exec(basename); - if (result && result.index) { - basename = basename.substr(result.index + 1); - } - - // make sure we don't create hidden files on POSIX systems - basename = basename.replace(/^\./, ''); - // and in case we've now stripped the entire basename (uncommon, but possible): + // in case we've now stripped the entire basename (uncommon, but possible): basename = basename.length ? basename : '_'; - return makeFilenameUnique(basename, str) + exports.fileExtension; + return makeUniqueFilename(basename, str) + exports.fileExtension; }; -// two-way lookup -var linkMap = { - longnameToUrl: {}, - urlToLongname: {} -}; +/** + * Get a longname's filename if one has been registered; otherwise, generate a unique filename, then + * register the filename. + * @private + */ +function getFilename(longname) { + var fileUrl; -var tutorialLinkMap = { - nameToUrl: {}, - urlToName: {} -}; + if ( hasOwnProp.call(longnameToUrl, longname) ) { + fileUrl = longnameToUrl[longname]; + } + else { + fileUrl = getUniqueFilename(longname); + registerLink(longname, fileUrl); + } -var longnameToUrl = exports.longnameToUrl = linkMap.longnameToUrl; + return fileUrl; +} + +/** + * Check whether a symbol is the only symbol exported by a module (as in + * `module.exports = function() {};`). + * + * @private + * @param {module:jsdoc/doclet.Doclet} doclet - The doclet for the symbol. + * @return {boolean} `true` if the symbol is the only symbol exported by a module; otherwise, + * `false`. + */ +function isModuleExports(doclet) { + return doclet.longname && doclet.longname === doclet.name && + doclet.longname.indexOf(MODULE_NAMESPACE) === 0 && doclet.kind !== 'module'; +} + +function makeUniqueId(filename, id) { + var key; + var nonUnique = true; + + key = id.toLowerCase(); + + // HTML5 IDs cannot contain whitespace characters + id = id.replace(/\s/g, ''); + + // append enough underscores to make the identifier unique + while (nonUnique) { + if ( hasOwnProp.call(ids, filename) && hasOwnProp.call(ids[filename], key) ) { + id += '_'; + key = id.toLowerCase(); + } + else { + nonUnique = false; + } + } + + ids[filename] = ids[filename] || {}; + ids[filename][key] = id; + + return id; +} + +/** + * Get a doclet's ID if one has been registered; otherwise, generate a unique ID, then register + * the ID. + * @private + */ +function getId(longname, id) { + if ( hasOwnProp.call(longnameToId, longname) ) { + id = longnameToId[longname]; + } + else if (!id) { + // no ID required + return ''; + } + else { + id = makeUniqueId(longname, id); + registerId(longname, id); + } + + return id; +} + +/** + * Convert a doclet to an identifier that is unique for a specified filename. + * + * Identifiers are not considered unique if they are capitalized differently but are otherwise + * identical. + * + * @method + * @param {string} filename - The file in which the identifier will be used. + * @param {string} doclet - The doclet to convert. + * @return {string} A unique identifier based on the file and doclet. + */ +var getUniqueId = exports.getUniqueId = makeUniqueId; + +var htmlsafe = exports.htmlsafe = function(str) { + return str.replace(/&/g, '&') + .replace(/ 0; + return /^{.+}$/.test(expr) || /^.+\|.+$/.test(expr) || /^.+<.+>$/.test(expr); +} + +function fragmentHash(fragmentId) { + if (!fragmentId) { + return ''; + } + + return '#' + fragmentId; } /** @@ -171,13 +300,12 @@ function isComplexTypeExpression(expr) { * @return {string} The HTML link, or the link text if the link is not available. */ function buildLink(longname, linkText, options) { - var catharsis = require('catharsis'); - var classString = options.cssClass ? util.format(' class="%s"', options.cssClass) : ''; - var fragmentString = options.fragmentId ? '#' + options.fragmentId : ''; + var fileUrl; + var fragmentString = fragmentHash(options.fragmentId); var stripped; var text; - var url; + var parsedType; // handle cases like: @@ -185,7 +313,7 @@ function buildLink(longname, linkText, options) { // @see http://example.org stripped = longname ? longname.replace(/^<|>$/g, '') : ''; if ( hasUrlPrefix(stripped) ) { - url = stripped; + fileUrl = stripped; text = linkText || stripped; } // handle complex type expressions that may require multiple links @@ -195,17 +323,18 @@ function buildLink(longname, linkText, options) { return stringifyType(parsedType, options.cssClass, options.linkMap); } else { - url = hasOwnProp.call(options.linkMap, longname) ? options.linkMap[longname] : ''; + fileUrl = hasOwnProp.call(options.linkMap, longname) ? options.linkMap[longname] : ''; text = linkText || longname; } text = options.monospace ? '' + text + '' : text; - if (!url) { + if (!fileUrl) { return text; } else { - return util.format('%s', url, fragmentString, classString, text); + return util.format('%s', encodeURI(fileUrl + fragmentString), + classString, text); } } @@ -287,19 +416,20 @@ function splitLinkText(text) { } var tutorialToUrl = exports.tutorialToUrl = function(tutorial) { + var fileUrl; var node = tutorials.getByName(tutorial); + // no such tutorial if (!node) { require('jsdoc/util/logger').error( new Error('No such tutorial: ' + tutorial) ); return null; } - var url; // define the URL if necessary if (!hasOwnProp.call(tutorialLinkMap.nameToUrl, node.name)) { - url = 'tutorial-' + getUniqueFilename(node.name); - tutorialLinkMap.nameToUrl[node.name] = url; - tutorialLinkMap.urlToName[url] = node.name; + fileUrl = 'tutorial-' + getUniqueFilename(node.name); + tutorialLinkMap.nameToUrl[node.name] = fileUrl; + tutorialLinkMap.urlToName[fileUrl] = node.name; } return tutorialLinkMap.nameToUrl[node.name]; @@ -439,22 +569,6 @@ var find = exports.find = function(data, spec) { return data(spec).get(); }; -/** - * Check whether a symbol is the only symbol exported by a module (as in - * `module.exports = function() {};`). - * - * @private - * @param {module:jsdoc/doclet.Doclet} doclet - The doclet for the symbol. - * @return {boolean} `true` if the symbol is the only symbol exported by a module; otherwise, - * `false`. - */ -function isModuleExports(doclet) { - var MODULE_PREFIX = require('jsdoc/name').MODULE_PREFIX; - - return doclet.longname && doclet.longname === doclet.name && - doclet.longname.indexOf(MODULE_PREFIX) === 0 && doclet.kind !== 'module'; -} - /** * Retrieve all of the following types of members from a set of doclets: * @@ -480,10 +594,20 @@ exports.getMembers = function(data) { }), mixins: find( data, {kind: 'mixin'} ), modules: find( data, {kind: 'module'} ), - namespaces: find( data, {kind: 'namespace'} ) + namespaces: find( data, {kind: 'namespace'} ), + interfaces: find( data, {kind: 'interface'} ) }; - // functions that are also modules (as in "module.exports = function() {};") are not globals + // strip quotes from externals, since we allow quoted names that would normally indicate a + // namespace hierarchy (as in `@external "jquery.fn"`) + // TODO: we should probably be doing this for other types of symbols, here or elsewhere; see + // jsdoc3/jsdoc#396 + members.externals = members.externals.map(function(doclet) { + doclet.name = doclet.name.replace(/(^"|"$)/g, ''); + return doclet; + }); + + // functions that are also modules (as in `module.exports = function() {};`) are not globals members.globals = members.globals.filter(function(doclet) { return !isModuleExports(doclet); }); @@ -500,6 +624,10 @@ exports.getMembers = function(data) { exports.getAttribs = function(d) { var attribs = []; + if (!d) { + return attribs; + } + if (d.virtual) { attribs.push('abstract'); } @@ -508,7 +636,7 @@ exports.getAttribs = function(d) { attribs.push(d.access); } - if (d.scope && d.scope !== 'instance' && d.scope !== 'global') { + if (d.scope && d.scope !== 'instance' && d.scope !== name.SCOPE.NAMES.GLOBAL) { if (d.kind === 'function' || d.kind === 'member' || d.kind === 'constant') { attribs.push(d.scope); } @@ -615,6 +743,29 @@ exports.getSignatureReturns = function(d, cssClass) { return returnTypes; }; +/** + * Retrieve an ordered list of doclets for a symbol's ancestors. + * + * @param {TAFFY} data - The TaffyDB database to search. + * @param {Object} doclet - The doclet whose ancestors will be retrieved. + * @return {Array.} A array of ancestor doclets, sorted from most to + * least distant. + */ +exports.getAncestors = function(data, doclet) { + var ancestors = []; + var doc = doclet; + + while (doc) { + doc = find(data, {longname: doc.memberof})[0]; + + if (doc) { + ancestors.unshift(doc); + } + } + + return ancestors; +}; + /** * Retrieve links to a member's ancestors. * @@ -624,21 +775,20 @@ exports.getSignatureReturns = function(d, cssClass) { * @return {Array.} HTML links to a member's ancestors. */ exports.getAncestorLinks = function(data, doclet, cssClass) { - var ancestors = [], - doc = doclet.memberof; + var ancestors = exports.getAncestors(data, doclet); + var links = []; - while (doc) { - doc = find( data, {longname: doc}, false ); - if (doc) { doc = doc[0]; } - if (!doc) { break; } - ancestors.unshift( linkto(doc.longname, (exports.scopeToPunc[doc.scope] || '') + doc.name, - cssClass) ); - doc = doc.memberof; + ancestors.forEach(function(ancestor) { + var linkText = (exports.scopeToPunc[ancestor.scope] || '') + ancestor.name; + var link = linkto(ancestor.longname, linkText, cssClass); + links.push(link); + }); + + if (links.length) { + links[links.length - 1] += (exports.scopeToPunc[doclet.scope] || ''); } - if (ancestors.length) { - ancestors[ancestors.length - 1] += (exports.scopeToPunc[doclet.scope] || ''); - } - return ancestors; + + return links; }; /** @@ -684,51 +834,52 @@ exports.addEventListeners = function(data) { * + Members tagged `@ignore`. * + Members of anonymous classes. * + Members tagged `@private`, unless the `private` option is enabled. + * + Members tagged with anything other than specified by the `access` options. * @param {TAFFY} data The TaffyDB database to prune. * @return {TAFFY} The pruned database. */ exports.prune = function(data) { data({undocumented: true}).remove(); data({ignore: true}).remove(); - if (!env.opts.private) { data({access: 'private'}).remove(); } data({memberof: ''}).remove(); + if (!env.opts.access || (env.opts.access && env.opts.access.indexOf('all') === -1)) { + if (env.opts.access && env.opts.access.indexOf('public') === -1) { + data({access: 'public'}).remove(); + } + if (env.opts.access && env.opts.access.indexOf('protected') === -1) { + data({access: 'protected'}).remove(); + } + if (!env.opts.private && (!env.opts.access || (env.opts.access && env.opts.access.indexOf('private') === -1))) { + data({access: 'private'}).remove(); + } + if (env.opts.access && env.opts.access.indexOf('undefined') === -1) { + data({access: {isUndefined: true}}).remove(); + } + } + return data; }; -var registerLink = exports.registerLink = function(longname, url) { - linkMap.longnameToUrl[longname] = url; - linkMap.urlToLongname[url] = longname; -}; - /** - * Get a longname's filename if one has been registered; otherwise, generate a unique filename, then - * register the filename. - * @private + * Create a URL that points to the generated documentation for the doclet. + * + * If a doclet corresponds to an output file (for example, if the doclet represents a class), the + * URL will consist of a filename. + * + * If a doclet corresponds to a smaller portion of an output file (for example, if the doclet + * represents a method), the URL will consist of a filename and a fragment ID. + * + * @param {module:jsdoc/doclet.Doclet} doclet - The doclet that will be used to create the URL. + * @return {string} The URL to the generated documentation for the doclet. */ -function getFilename(longname) { - var url; - - if ( longnameToUrl[longname] && hasOwnProp.call(longnameToUrl, longname) ) { - url = longnameToUrl[longname]; - } else { - url = getUniqueFilename(longname); - registerLink(longname, url); - } - - return url; -} - -/** Turn a doclet into a URL. */ exports.createLink = function(doclet) { - var filename; - var fragment; - var match; var fakeContainer; - - var url = ''; - var INSTANCE = exports.scopeToPunc.instance; + var filename; + var fileUrl; + var fragment = ''; var longname = doclet.longname; + var match; // handle doclets in which doclet.longname implies that the doclet gets its own HTML file, but // doclet.kind says otherwise. this happens due to mistagged JSDoc (for example, a module that @@ -748,20 +899,37 @@ exports.createLink = function(doclet) { // mistagged version of a doclet that gets its own HTML file else if ( containers.indexOf(doclet.kind) === -1 && fakeContainer ) { filename = getFilename(doclet.memberof || longname); - if (doclet.name === doclet.longname) { - fragment = ''; - } - else { - fragment = doclet.name || ''; + if (doclet.name !== doclet.longname) { + fragment = formatNameForLink(doclet); + fragment = getId(longname, fragment); } } // the doclet is within another HTML file else { filename = getFilename(doclet.memberof || exports.globalName); - fragment = getNamespace(doclet.kind) + (doclet.name || ''); + if ( (doclet.name !== doclet.longname) || (doclet.scope === name.SCOPE.NAMES.GLOBAL) ) { + fragment = formatNameForLink(doclet); + fragment = getId(longname, fragment); + } } - url = fragment ? (filename + INSTANCE + fragment) : filename; + fileUrl = encodeURI( filename + fragmentHash(fragment) ); - return url; + return fileUrl; +}; + +// TODO: docs +exports.longnamesToTree = name.longnamesToTree; + +/** + * Replace the existing tag dictionary with a new tag dictionary. + * + * Used for testing only. Do not call this method directly. Instead, call + * {@link module:jsdoc/doclet._replaceDictionary}, which also updates this module's tag dictionary. + * + * @private + * @param {module:jsdoc/tag/dictionary.Dictionary} dict - The new tag dictionary. + */ +exports._replaceDictionary = function _replaceDictionary(dict) { + dictionary = dict; }; diff --git a/node_modules/jsdoc/node/fs.js b/node_modules/jsdoc/node/fs.js index c9b5932..bf652f2 100644 --- a/node_modules/jsdoc/node/fs.js +++ b/node_modules/jsdoc/node/fs.js @@ -8,6 +8,8 @@ var wrench = require('wrench'); var toDir = exports.toDir = function(_path) { var isDirectory; + _path = path.normalize(_path); + try { isDirectory = fs.statSync(_path).isDirectory(); } @@ -15,7 +17,7 @@ var toDir = exports.toDir = function(_path) { isDirectory = false; } - if (isDirectory){ + if (isDirectory) { return _path; } else { return path.dirname(_path); diff --git a/node_modules/jsdoc/node_modules/async/.gitmodules b/node_modules/jsdoc/node_modules/async/.gitmodules deleted file mode 100644 index a9aae98..0000000 --- a/node_modules/jsdoc/node_modules/async/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "deps/nodeunit"] - path = deps/nodeunit - url = git://github.com/caolan/nodeunit.git -[submodule "deps/UglifyJS"] - path = deps/UglifyJS - url = https://github.com/mishoo/UglifyJS.git -[submodule "deps/nodelint"] - path = deps/nodelint - url = https://github.com/tav/nodelint.git diff --git a/node_modules/jsdoc/node_modules/async/.npmignore b/node_modules/jsdoc/node_modules/async/.npmignore deleted file mode 100644 index 9bdfc97..0000000 --- a/node_modules/jsdoc/node_modules/async/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -deps -dist -test -nodelint.cfg \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/async/Makefile b/node_modules/jsdoc/node_modules/async/Makefile deleted file mode 100644 index bad647c..0000000 --- a/node_modules/jsdoc/node_modules/async/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -PACKAGE = asyncjs -NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node) -CWD := $(shell pwd) -NODEUNIT = $(CWD)/node_modules/nodeunit/bin/nodeunit -UGLIFY = $(CWD)/node_modules/uglify-js/bin/uglifyjs -NODELINT = $(CWD)/node_modules/nodelint/nodelint - -BUILDDIR = dist - -all: clean test build - -build: $(wildcard lib/*.js) - mkdir -p $(BUILDDIR) - $(UGLIFY) lib/async.js > $(BUILDDIR)/async.min.js - -test: - $(NODEUNIT) test - -clean: - rm -rf $(BUILDDIR) - -lint: - $(NODELINT) --config nodelint.cfg lib/async.js - -.PHONY: test build all diff --git a/node_modules/jsdoc/node_modules/async/README.md b/node_modules/jsdoc/node_modules/async/README.md deleted file mode 100644 index 1bbbc47..0000000 --- a/node_modules/jsdoc/node_modules/async/README.md +++ /dev/null @@ -1,1021 +0,0 @@ -# Async.js - -Async is a utility module which provides straight-forward, powerful functions -for working with asynchronous JavaScript. Although originally designed for -use with [node.js](http://nodejs.org), it can also be used directly in the -browser. - -Async provides around 20 functions that include the usual 'functional' -suspects (map, reduce, filter, forEach…) as well as some common patterns -for asynchronous control flow (parallel, series, waterfall…). All these -functions assume you follow the node.js convention of providing a single -callback as the last argument of your async function. - - -## Quick Examples - - async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file - }); - - async.filter(['file1','file2','file3'], path.exists, function(results){ - // results now equals an array of the existing files - }); - - async.parallel([ - function(){ ... }, - function(){ ... } - ], callback); - - async.series([ - function(){ ... }, - function(){ ... } - ]); - -There are many more functions available so take a look at the docs below for a -full list. This module aims to be comprehensive, so if you feel anything is -missing please create a GitHub issue for it. - - -## Download - -Releases are available for download from -[GitHub](http://github.com/caolan/async/downloads). -Alternatively, you can install using Node Package Manager (npm): - - npm install async - - -__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed - -__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped - - -## In the Browser - -So far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage: - - - - - -## Documentation - -### Collections - -* [forEach](#forEach) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [until](#until) -* [waterfall](#waterfall) -* [queue](#queue) -* [auto](#auto) -* [iterator](#iterator) -* [apply](#apply) -* [nextTick](#nextTick) - -### Utils - -* [memoize](#memoize) -* [unmemoize](#unmemoize) -* [log](#log) -* [dir](#dir) -* [noConflict](#noConflict) - - -## Collections - - -### forEach(arr, iterator, callback) - -Applies an iterator function to each item in an array, in parallel. -The iterator is called with an item from the list and a callback for when it -has finished. If the iterator passes an error to this callback, the main -callback for the forEach function is immediately called with the error. - -Note, that since this function applies the iterator to each item in parallel -there is no guarantee that the iterator functions will complete in order. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // assuming openFiles is an array of file names and saveFile is a function - // to save the modified contents of that file: - - async.forEach(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error - }); - ---------------------------------------- - - -### forEachSeries(arr, iterator, callback) - -The same as forEach only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. This means the iterator functions will complete in order. - - ---------------------------------------- - - -### forEachLimit(arr, limit, iterator, callback) - -The same as forEach only the iterator is applied to batches of items in the -array, in series. The next batch of iterators is only called once the current -one has completed processing. - -__Arguments__ - -* arr - An array to iterate over. -* limit - How many items should be in each batch. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // Assume documents is an array of JSON objects and requestApi is a - // function that interacts with a rate-limited REST api. - - async.forEachLimit(documents, 20, requestApi, function(err){ - // if any of the saves produced an error, err would equal that error - }); ---------------------------------------- - - -### map(arr, iterator, callback) - -Produces a new array of values by mapping each value in the given array through -the iterator function. The iterator is called with an item from the array and a -callback for when it has finished processing. The callback takes 2 arguments, -an error and the transformed item from the array. If the iterator passes an -error to this callback, the main callback for the map function is immediately -called with the error. - -Note, that since this function applies the iterator to each item in parallel -there is no guarantee that the iterator functions will complete in order, however -the results array will be in the same order as the original array. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed - with an error (which can be null) and a transformed item. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array of the - transformed items from the original array. - -__Example__ - - async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file - }); - ---------------------------------------- - - -### mapSeries(arr, iterator, callback) - -The same as map only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - - ---------------------------------------- - - -### filter(arr, iterator, callback) - -__Alias:__ select - -Returns a new array of all the values which pass an async truth test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. This operation is -performed in parallel, but the results array will be in the same order as the -original. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(results) - A callback which is called after all the iterator - functions have finished. - -__Example__ - - async.filter(['file1','file2','file3'], path.exists, function(results){ - // results now equals an array of the existing files - }); - ---------------------------------------- - - -### filterSeries(arr, iterator, callback) - -__alias:__ selectSeries - -The same as filter only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - ---------------------------------------- - - -### reject(arr, iterator, callback) - -The opposite of filter. Removes values that pass an async truth test. - ---------------------------------------- - - -### rejectSeries(arr, iterator, callback) - -The same as filter, only the iterator is applied to each item in the array -in series. - - ---------------------------------------- - - -### reduce(arr, memo, iterator, callback) - -__aliases:__ inject, foldl - -Reduces a list of values into a single value using an async iterator to return -each successive step. Memo is the initial state of the reduction. This -function only operates in series. For performance reasons, it may make sense to -split a call to this function into a parallel map, then use the normal -Array.prototype.reduce on the results. This function is for situations where -each step in the reduction needs to be async, if you can get the data before -reducing it then its probably a good idea to do so. - -__Arguments__ - -* arr - An array to iterate over. -* memo - The initial state of the reduction. -* iterator(memo, item, callback) - A function applied to each item in the - array to produce the next step in the reduction. The iterator is passed a - callback which accepts an optional error as its first argument, and the state - of the reduction as the second. If an error is passed to the callback, the - reduction is stopped and the main callback is immediately called with the - error. -* callback(err, result) - A callback which is called after all the iterator - functions have finished. Result is the reduced value. - -__Example__ - - async.reduce([1,2,3], 0, function(memo, item, callback){ - // pointless async: - process.nextTick(function(){ - callback(null, memo + item) - }); - }, function(err, result){ - // result is now equal to the last value of memo, which is 6 - }); - ---------------------------------------- - - -### reduceRight(arr, memo, iterator, callback) - -__Alias:__ foldr - -Same as reduce, only operates on the items in the array in reverse order. - - ---------------------------------------- - - -### detect(arr, iterator, callback) - -Returns the first value in a list that passes an async truth test. The -iterator is applied in parallel, meaning the first iterator to return true will -fire the detect callback with that result. That means the result might not be -the first item in the original array (in terms of order) that passes the test. - -If order within the original array is important then look at detectSeries. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(result) - A callback which is called as soon as any iterator returns - true, or after all the iterator functions have finished. Result will be - the first item in the array that passes the truth test (iterator) or the - value undefined if none passed. - -__Example__ - - async.detect(['file1','file2','file3'], path.exists, function(result){ - // result now equals the first file in the list that exists - }); - ---------------------------------------- - - -### detectSeries(arr, iterator, callback) - -The same as detect, only the iterator is applied to each item in the array -in series. This means the result is always the first in the original array (in -terms of array order) that passes the truth test. - - ---------------------------------------- - - -### sortBy(arr, iterator, callback) - -Sorts a list by the results of running each value through an async iterator. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed - with an error (which can be null) and a value to use as the sort criteria. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is the items from - the original array sorted by the values returned by the iterator calls. - -__Example__ - - async.sortBy(['file1','file2','file3'], function(file, callback){ - fs.stat(file, function(err, stats){ - callback(err, stats.mtime); - }); - }, function(err, results){ - // results is now the original array of files sorted by - // modified date - }); - - ---------------------------------------- - - -### some(arr, iterator, callback) - -__Alias:__ any - -Returns true if at least one element in the array satisfies an async test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. Once any iterator -call returns true, the main callback is immediately called. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(result) - A callback which is called as soon as any iterator returns - true, or after all the iterator functions have finished. Result will be - either true or false depending on the values of the async tests. - -__Example__ - - async.some(['file1','file2','file3'], path.exists, function(result){ - // if result is true then at least one of the files exists - }); - ---------------------------------------- - - -### every(arr, iterator, callback) - -__Alias:__ all - -Returns true if every element in the array satisfies an async test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(result) - A callback which is called after all the iterator - functions have finished. Result will be either true or false depending on - the values of the async tests. - -__Example__ - - async.every(['file1','file2','file3'], path.exists, function(result){ - // if result is true then every file exists - }); - ---------------------------------------- - - -### concat(arr, iterator, callback) - -Applies an iterator to each item in a list, concatenating the results. Returns the -concatenated list. The iterators are called in parallel, and the results are -concatenated as they return. There is no guarantee that the results array will -be returned in the original order of the arguments passed to the iterator function. - -__Arguments__ - -* arr - An array to iterate over -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed - with an error (which can be null) and an array of results. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array containing - the concatenated results of the iterator function. - -__Example__ - - async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ - // files is now a list of filenames that exist in the 3 directories - }); - ---------------------------------------- - - -### concatSeries(arr, iterator, callback) - -Same as async.concat, but executes in series instead of parallel. - - -## Control Flow - - -### series(tasks, [callback]) - -Run an array of functions in series, each one running once the previous -function has completed. If any functions in the series pass an error to its -callback, no more functions are run and the callback for the series is -immediately called with the value of the error. Once the tasks have completed, -the results are passed to the final callback as an array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final callback as an object -instead of an array. This can be a more readable way of handling results from -async.series. - - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed - a callback it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - async.series([ - function(callback){ - // do some stuff ... - callback(null, 'one'); - }, - function(callback){ - // do some more stuff ... - callback(null, 'two'); - }, - ], - // optional callback - function(err, results){ - // results is now equal to ['one', 'two'] - }); - - - // an example using an object instead of an array - async.series({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - }, - }, - function(err, results) { - // results is now equal to: {one: 1, two: 2} - }); - - ---------------------------------------- - - -### parallel(tasks, [callback]) - -Run an array of functions in parallel, without waiting until the previous -function has completed. If any of the functions pass an error to its -callback, the main callback is immediately called with the value of the error. -Once the tasks have completed, the results are passed to the final callback as an -array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final callback as an object -instead of an array. This can be a more readable way of handling results from -async.parallel. - - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed a - callback it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - async.parallel([ - function(callback){ - setTimeout(function(){ - callback(null, 'one'); - }, 200); - }, - function(callback){ - setTimeout(function(){ - callback(null, 'two'); - }, 100); - }, - ], - // optional callback - function(err, results){ - // the results array will equal ['one','two'] even though - // the second function had a shorter timeout. - }); - - - // an example using an object instead of an array - async.parallel({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - }, - }, - function(err, results) { - // results is now equals to: {one: 1, two: 2} - }); - - ---------------------------------------- - - -### whilst(test, fn, callback) - -Repeatedly call fn, while test returns true. Calls the callback when stopped, -or an error occurs. - -__Arguments__ - -* test() - synchronous truth test to perform before each execution of fn. -* fn(callback) - A function to call each time the test passes. The function is - passed a callback which must be called once it has completed with an optional - error as the first argument. -* callback(err) - A callback which is called after the test fails and repeated - execution of fn has stopped. - -__Example__ - - var count = 0; - - async.whilst( - function () { return count < 5; }, - function (callback) { - count++; - setTimeout(callback, 1000); - }, - function (err) { - // 5 seconds have passed - } - ); - - ---------------------------------------- - - -### until(test, fn, callback) - -Repeatedly call fn, until test returns true. Calls the callback when stopped, -or an error occurs. - -The inverse of async.whilst. - - ---------------------------------------- - - -### waterfall(tasks, [callback]) - -Runs an array of functions in series, each passing their results to the next in -the array. However, if any of the functions pass an error to the callback, the -next function is not executed and the main callback is immediately called with -the error. - -__Arguments__ - -* tasks - An array of functions to run, each function is passed a callback it - must call on completion. -* callback(err, [results]) - An optional callback to run once all the functions - have completed. This will be passed the results of the last task's callback. - - - -__Example__ - - async.waterfall([ - function(callback){ - callback(null, 'one', 'two'); - }, - function(arg1, arg2, callback){ - callback(null, 'three'); - }, - function(arg1, callback){ - // arg1 now equals 'three' - callback(null, 'done'); - } - ], function (err, result) { - // result now equals 'done' - }); - - ---------------------------------------- - - -### queue(worker, concurrency) - -Creates a queue object with the specified concurrency. Tasks added to the -queue will be processed in parallel (up to the concurrency limit). If all -workers are in progress, the task is queued until one is available. Once -a worker has completed a task, the task's callback is called. - -__Arguments__ - -* worker(task, callback) - An asynchronous function for processing a queued - task. -* concurrency - An integer for determining how many worker functions should be - run in parallel. - -__Queue objects__ - -The queue object returned by this function has the following properties and -methods: - -* length() - a function returning the number of items waiting to be processed. -* concurrency - an integer for determining how many worker functions should be - run in parallel. This property can be changed after a queue is created to - alter the concurrency on-the-fly. -* push(task, [callback]) - add a new task to the queue, the callback is called - once the worker has finished processing the task. - instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. -* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued -* empty - a callback that is called when the last item from the queue is given to a worker -* drain - a callback that is called when the last item from the queue has returned from the worker - -__Example__ - - // create a queue object with concurrency 2 - - var q = async.queue(function (task, callback) { - console.log('hello ' + task.name); - callback(); - }, 2); - - - // assign a callback - q.drain = function() { - console.log('all items have been processed'); - } - - // add some items to the queue - - q.push({name: 'foo'}, function (err) { - console.log('finished processing foo'); - }); - q.push({name: 'bar'}, function (err) { - console.log('finished processing bar'); - }); - - // add some items to the queue (batch-wise) - - q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { - console.log('finished processing bar'); - }); - - ---------------------------------------- - - -### auto(tasks, [callback]) - -Determines the best order for running functions based on their requirements. -Each function can optionally depend on other functions being completed first, -and each function is run as soon as its requirements are satisfied. If any of -the functions pass an error to their callback, that function will not complete -(so any other functions depending on it will not run) and the main callback -will be called immediately with the error. Functions also receive an object -containing the results of functions which have completed so far. - -__Arguments__ - -* tasks - An object literal containing named functions or an array of - requirements, with the function itself the last item in the array. The key - used for each function or array is used when specifying requirements. The - syntax is easier to understand by looking at the example. -* callback(err, results) - An optional callback which is called when all the - tasks have been completed. The callback will receive an error as an argument - if any tasks pass an error to their callback. If all tasks complete - successfully, it will receive an object containing their results. - -__Example__ - - async.auto({ - get_data: function(callback){ - // async code to get some data - }, - make_folder: function(callback){ - // async code to create a directory to store a file in - // this is run at the same time as getting the data - }, - write_file: ['get_data', 'make_folder', function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - callback(null, filename); - }], - email_link: ['write_file', function(callback, results){ - // once the file is written let's email a link to it... - // results.write_file contains the filename returned by write_file. - }] - }); - -This is a fairly trivial example, but to do this using the basic parallel and -series functions would look like this: - - async.parallel([ - function(callback){ - // async code to get some data - }, - function(callback){ - // async code to create a directory to store a file in - // this is run at the same time as getting the data - } - ], - function(results){ - async.series([ - function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - }, - email_link: function(callback){ - // once the file is written let's email a link to it... - } - ]); - }); - -For a complicated series of async tasks using the auto function makes adding -new tasks much easier and makes the code more readable. - - ---------------------------------------- - - -### iterator(tasks) - -Creates an iterator function which calls the next function in the array, -returning a continuation to call the next one after that. Its also possible to -'peek' the next iterator by doing iterator.next(). - -This function is used internally by the async module but can be useful when -you want to manually control the flow of functions in series. - -__Arguments__ - -* tasks - An array of functions to run, each function is passed a callback it - must call on completion. - -__Example__ - - var iterator = async.iterator([ - function(){ sys.p('one'); }, - function(){ sys.p('two'); }, - function(){ sys.p('three'); } - ]); - - node> var iterator2 = iterator(); - 'one' - node> var iterator3 = iterator2(); - 'two' - node> iterator3(); - 'three' - node> var nextfn = iterator2.next(); - node> nextfn(); - 'three' - - ---------------------------------------- - - -### apply(function, arguments..) - -Creates a continuation function with some arguments already applied, a useful -shorthand when combined with other control flow functions. Any arguments -passed to the returned function are added to the arguments originally passed -to apply. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to automatically apply when the - continuation is called. - -__Example__ - - // using apply - - async.parallel([ - async.apply(fs.writeFile, 'testfile1', 'test1'), - async.apply(fs.writeFile, 'testfile2', 'test2'), - ]); - - - // the same process without using apply - - async.parallel([ - function(callback){ - fs.writeFile('testfile1', 'test1', callback); - }, - function(callback){ - fs.writeFile('testfile2', 'test2', callback); - }, - ]); - -It's possible to pass any number of additional arguments when calling the -continuation: - - node> var fn = async.apply(sys.puts, 'one'); - node> fn('two', 'three'); - one - two - three - ---------------------------------------- - - -### nextTick(callback) - -Calls the callback on a later loop around the event loop. In node.js this just -calls process.nextTick, in the browser it falls back to setTimeout(callback, 0), -which means other higher priority events may precede the execution of the callback. - -This is used internally for browser-compatibility purposes. - -__Arguments__ - -* callback - The function to call on a later loop around the event loop. - -__Example__ - - var call_order = []; - async.nextTick(function(){ - call_order.push('two'); - // call_order now equals ['one','two] - }); - call_order.push('one') - - -## Utils - - -### memoize(fn, [hasher]) - -Caches the results of an async function. When creating a hash to store function -results against, the callback is omitted from the hash and an optional hash -function can be used. - -__Arguments__ - -* fn - the function you to proxy and cache results from. -* hasher - an optional function for generating a custom hash for storing - results, it has all the arguments applied to it apart from the callback, and - must be synchronous. - -__Example__ - - var slow_fn = function (name, callback) { - // do something - callback(null, result); - }; - var fn = async.memoize(slow_fn); - - // fn can now be used as if it were slow_fn - fn('some name', function () { - // callback - }); - - -### unmemoize(fn) - -Undoes a memoized function, reverting it to the original, unmemoized -form. Comes handy in tests. - -__Arguments__ - -* fn - the memoized function - - -### log(function, arguments) - -Logs the result of an async function to the console. Only works in node.js or -in browsers that support console.log and console.error (such as FF and Chrome). -If multiple arguments are returned from the async function, console.log is -called on each argument in order. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to apply to the function. - -__Example__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, 'hello ' + name); - }, 1000); - }; - - node> async.log(hello, 'world'); - 'hello world' - - ---------------------------------------- - - -### dir(function, arguments) - -Logs the result of an async function to the console using console.dir to -display the properties of the resulting object. Only works in node.js or -in browsers that support console.dir and console.error (such as FF and Chrome). -If multiple arguments are returned from the async function, console.dir is -called on each argument in order. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to apply to the function. - -__Example__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, {hello: name}); - }, 1000); - }; - - node> async.dir(hello, 'world'); - {hello: 'world'} - - ---------------------------------------- - - -### noConflict() - -Changes the value of async back to its original value, returning a reference to the -async object. diff --git a/node_modules/jsdoc/node_modules/async/index.js b/node_modules/jsdoc/node_modules/async/index.js deleted file mode 100644 index 8e23845..0000000 --- a/node_modules/jsdoc/node_modules/async/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// This file is just added for convenience so this repository can be -// directly checked out into a project's deps folder -module.exports = require('./lib/async'); diff --git a/node_modules/jsdoc/node_modules/async/lib/async.js b/node_modules/jsdoc/node_modules/async/lib/async.js deleted file mode 100644 index 7cc4f5e..0000000 --- a/node_modules/jsdoc/node_modules/async/lib/async.js +++ /dev/null @@ -1,692 +0,0 @@ -/*global setTimeout: false, console: false */ -(function () { - - var async = {}; - - // global on the server, window in the browser - var root = this, - previous_async = root.async; - - if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - else { - root.async = async; - } - - async.noConflict = function () { - root.async = previous_async; - return async; - }; - - //// cross-browser compatiblity functions //// - - var _forEach = function (arr, iterator) { - if (arr.forEach) { - return arr.forEach(iterator); - } - for (var i = 0; i < arr.length; i += 1) { - iterator(arr[i], i, arr); - } - }; - - var _map = function (arr, iterator) { - if (arr.map) { - return arr.map(iterator); - } - var results = []; - _forEach(arr, function (x, i, a) { - results.push(iterator(x, i, a)); - }); - return results; - }; - - var _reduce = function (arr, iterator, memo) { - if (arr.reduce) { - return arr.reduce(iterator, memo); - } - _forEach(arr, function (x, i, a) { - memo = iterator(memo, x, i, a); - }); - return memo; - }; - - var _keys = function (obj) { - if (Object.keys) { - return Object.keys(obj); - } - var keys = []; - for (var k in obj) { - if (obj.hasOwnProperty(k)) { - keys.push(k); - } - } - return keys; - }; - - //// exported async module functions //// - - //// nextTick implementation with browser-compatible fallback //// - if (typeof process === 'undefined' || !(process.nextTick)) { - async.nextTick = function (fn) { - setTimeout(fn, 0); - }; - } - else { - async.nextTick = process.nextTick; - } - - async.forEach = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - _forEach(arr, function (x) { - iterator(x, function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed === arr.length) { - callback(null); - } - } - }); - }); - }; - - async.forEachSeries = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - var iterate = function () { - iterator(arr[completed], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed === arr.length) { - callback(null); - } - else { - iterate(); - } - } - }); - }; - iterate(); - }; - - async.forEachLimit = function (arr, limit, iterator, callback) { - callback = callback || function () {}; - if (!arr.length || limit <= 0) { - return callback(); - } - var completed = 0; - var started = 0; - var running = 0; - - (function replenish () { - if (completed === arr.length) { - return callback(); - } - - while (running < limit && started < arr.length) { - started += 1; - running += 1; - iterator(arr[started - 1], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - running -= 1; - if (completed === arr.length) { - callback(); - } - else { - replenish(); - } - } - }); - } - })(); - }; - - - var doParallel = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.forEach].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.forEachSeries].concat(args)); - }; - }; - - - var _asyncMap = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (err, v) { - results[x.index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - }; - async.map = doParallel(_asyncMap); - async.mapSeries = doSeries(_asyncMap); - - - // reduce only has a series version, as doing reduce in parallel won't - // work in many situations. - async.reduce = function (arr, memo, iterator, callback) { - async.forEachSeries(arr, function (x, callback) { - iterator(memo, x, function (err, v) { - memo = v; - callback(err); - }); - }, function (err) { - callback(err, memo); - }); - }; - // inject alias - async.inject = async.reduce; - // foldl alias - async.foldl = async.reduce; - - async.reduceRight = function (arr, memo, iterator, callback) { - var reversed = _map(arr, function (x) { - return x; - }).reverse(); - async.reduce(reversed, memo, iterator, callback); - }; - // foldr alias - async.foldr = async.reduceRight; - - var _filter = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.filter = doParallel(_filter); - async.filterSeries = doSeries(_filter); - // select alias - async.select = async.filter; - async.selectSeries = async.filterSeries; - - var _reject = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (!v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.reject = doParallel(_reject); - async.rejectSeries = doSeries(_reject); - - var _detect = function (eachfn, arr, iterator, main_callback) { - eachfn(arr, function (x, callback) { - iterator(x, function (result) { - if (result) { - main_callback(x); - main_callback = function () {}; - } - else { - callback(); - } - }); - }, function (err) { - main_callback(); - }); - }; - async.detect = doParallel(_detect); - async.detectSeries = doSeries(_detect); - - async.some = function (arr, iterator, main_callback) { - async.forEach(arr, function (x, callback) { - iterator(x, function (v) { - if (v) { - main_callback(true); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(false); - }); - }; - // any alias - async.any = async.some; - - async.every = function (arr, iterator, main_callback) { - async.forEach(arr, function (x, callback) { - iterator(x, function (v) { - if (!v) { - main_callback(false); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(true); - }); - }; - // all alias - async.all = async.every; - - async.sortBy = function (arr, iterator, callback) { - async.map(arr, function (x, callback) { - iterator(x, function (err, criteria) { - if (err) { - callback(err); - } - else { - callback(null, {value: x, criteria: criteria}); - } - }); - }, function (err, results) { - if (err) { - return callback(err); - } - else { - var fn = function (left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }; - callback(null, _map(results.sort(fn), function (x) { - return x.value; - })); - } - }); - }; - - async.auto = function (tasks, callback) { - callback = callback || function () {}; - var keys = _keys(tasks); - if (!keys.length) { - return callback(null); - } - - var results = {}; - - var listeners = []; - var addListener = function (fn) { - listeners.unshift(fn); - }; - var removeListener = function (fn) { - for (var i = 0; i < listeners.length; i += 1) { - if (listeners[i] === fn) { - listeners.splice(i, 1); - return; - } - } - }; - var taskComplete = function () { - _forEach(listeners.slice(0), function (fn) { - fn(); - }); - }; - - addListener(function () { - if (_keys(results).length === keys.length) { - callback(null, results); - callback = function () {}; - } - }); - - _forEach(keys, function (k) { - var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; - var taskCallback = function (err) { - if (err) { - callback(err); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - taskComplete(); - } - }; - var requires = task.slice(0, Math.abs(task.length - 1)) || []; - var ready = function () { - return _reduce(requires, function (a, x) { - return (a && results.hasOwnProperty(x)); - }, true) && !results.hasOwnProperty(k); - }; - if (ready()) { - task[task.length - 1](taskCallback, results); - } - else { - var listener = function () { - if (ready()) { - removeListener(listener); - task[task.length - 1](taskCallback, results); - } - }; - addListener(listener); - } - }); - }; - - async.waterfall = function (tasks, callback) { - callback = callback || function () {}; - if (!tasks.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - var next = iterator.next(); - if (next) { - args.push(wrapIterator(next)); - } - else { - args.push(callback); - } - async.nextTick(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - async.parallel = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.map(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.forEach(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.series = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.mapSeries(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.forEachSeries(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.iterator = function (tasks) { - var makeCallback = function (index) { - var fn = function () { - if (tasks.length) { - tasks[index].apply(null, arguments); - } - return fn.next(); - }; - fn.next = function () { - return (index < tasks.length - 1) ? makeCallback(index + 1): null; - }; - return fn; - }; - return makeCallback(0); - }; - - async.apply = function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return fn.apply( - null, args.concat(Array.prototype.slice.call(arguments)) - ); - }; - }; - - var _concat = function (eachfn, arr, fn, callback) { - var r = []; - eachfn(arr, function (x, cb) { - fn(x, function (err, y) { - r = r.concat(y || []); - cb(err); - }); - }, function (err) { - callback(err, r); - }); - }; - async.concat = doParallel(_concat); - async.concatSeries = doSeries(_concat); - - async.whilst = function (test, iterator, callback) { - if (test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.whilst(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.queue = function (worker, concurrency) { - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - push: function (data, callback) { - if(data.constructor !== Array) { - data = [data]; - } - _forEach(data, function(task) { - q.tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - if (q.saturated && q.tasks.length == concurrency) { - q.saturated(); - } - async.nextTick(q.process); - }); - }, - process: function () { - if (workers < q.concurrency && q.tasks.length) { - var task = q.tasks.shift(); - if(q.empty && q.tasks.length == 0) q.empty(); - workers += 1; - worker(task.data, function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if(q.drain && q.tasks.length + workers == 0) q.drain(); - q.process(); - }); - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - } - }; - return q; - }; - - var _console_fn = function (name) { - return function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - fn.apply(null, args.concat([function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (typeof console !== 'undefined') { - if (err) { - if (console.error) { - console.error(err); - } - } - else if (console[name]) { - _forEach(args, function (x) { - console[name](x); - }); - } - } - }])); - }; - }; - async.log = _console_fn('log'); - async.dir = _console_fn('dir'); - /*async.info = _console_fn('info'); - async.warn = _console_fn('warn'); - async.error = _console_fn('error');*/ - - async.memoize = function (fn, hasher) { - var memo = {}; - var queues = {}; - hasher = hasher || function (x) { - return x; - }; - var memoized = function () { - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - var key = hasher.apply(null, args); - if (key in memo) { - callback.apply(null, memo[key]); - } - else if (key in queues) { - queues[key].push(callback); - } - else { - queues[key] = [callback]; - fn.apply(null, args.concat([function () { - memo[key] = arguments; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, arguments); - } - }])); - } - }; - memoized.unmemoized = fn; - return memoized; - }; - - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; - -}()); diff --git a/node_modules/jsdoc/node_modules/async/package.json b/node_modules/jsdoc/node_modules/async/package.json deleted file mode 100644 index 3fa84cf..0000000 --- a/node_modules/jsdoc/node_modules/async/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "async", - "description": "Higher-order functions and common patterns for asynchronous code", - "main": "./index", - "author": { - "name": "Caolan McMahon" - }, - "version": "0.1.22", - "repository": { - "type": "git", - "url": "http://github.com/caolan/async.git" - }, - "bugs": { - "url": "http://github.com/caolan/async/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/caolan/async/raw/master/LICENSE" - } - ], - "devDependencies": { - "nodeunit": ">0.0.0", - "uglify-js": "1.2.x", - "nodelint": ">0.0.0" - }, - "readme": "# Async.js\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [node.js](http://nodejs.org), it can also be used directly in the\nbrowser.\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (map, reduce, filter, forEach…) as well as some common patterns\nfor asynchronous control flow (parallel, series, waterfall…). All these\nfunctions assume you follow the node.js convention of providing a single\ncallback as the last argument of your async function.\n\n\n## Quick Examples\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n async.parallel([\n function(){ ... },\n function(){ ... }\n ], callback);\n\n async.series([\n function(){ ... },\n function(){ ... }\n ]);\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n\n## Download\n\nReleases are available for download from\n[GitHub](http://github.com/caolan/async/downloads).\nAlternatively, you can install using Node Package Manager (npm):\n\n npm install async\n\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed\n\n__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped\n\n\n## In the Browser\n\nSo far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\n\n \n \n\n\n## Documentation\n\n### Collections\n\n* [forEach](#forEach)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [until](#until)\n* [waterfall](#waterfall)\n* [queue](#queue)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n\n### forEach(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the forEach function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n // assuming openFiles is an array of file names and saveFile is a function\n // to save the modified contents of that file:\n\n async.forEach(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n\n---------------------------------------\n\n\n### forEachSeries(arr, iterator, callback)\n\nThe same as forEach only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n\n### forEachLimit(arr, limit, iterator, callback)\n\nThe same as forEach only the iterator is applied to batches of items in the\narray, in series. The next batch of iterators is only called once the current\none has completed processing.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - How many items should be in each batch.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n // Assume documents is an array of JSON objects and requestApi is a\n // function that interacts with a rate-limited REST api.\n\n async.forEachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n---------------------------------------\n\n\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as filter, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then its probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback which accepts an optional error as its first argument, and the state\n of the reduction as the second. If an error is passed to the callback, the\n reduction is stopped and the main callback is immediately called with the\n error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n async.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n }, function(err, result){\n // result is now equal to the last value of memo, which is 6\n });\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n async.detect(['file1','file2','file3'], path.exists, function(result){\n // result now equals the first file in the list that exists\n });\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and a value to use as the sort criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n async.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n }, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n });\n\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n async.some(['file1','file2','file3'], path.exists, function(result){\n // if result is true then at least one of the files exists\n });\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n async.every(['file1','file2','file3'], path.exists, function(result){\n // if result is true then every file exists\n });\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n });\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n },\n ],\n // optional callback\n function(err, results){\n // results is now equal to ['one', 'two']\n });\n\n\n // an example using an object instead of an array\n async.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n },\n },\n function(err, results) {\n // results is now equal to: {one: 1, two: 2}\n });\n\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed a\n callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n },\n ],\n // optional callback\n function(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n });\n\n\n // an example using an object instead of an array\n async.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n },\n },\n function(err, results) {\n // results is now equals to: {one: 1, two: 2}\n });\n\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback which must be called once it has completed with an optional\n error as the first argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n var count = 0;\n\n async.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n );\n\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a callback it\n must call on completion.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n async.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n ], function (err, result) {\n // result now equals 'done' \n });\n\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n // create a queue object with concurrency 2\n\n var q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n }, 2);\n\n\n // assign a callback\n q.drain = function() {\n console.log('all items have been processed');\n }\n\n // add some items to the queue\n\n q.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n });\n q.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n });\n\n // add some items to the queue (batch-wise)\n\n q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n });\n\n\n---------------------------------------\n\n\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The\n syntax is easier to understand by looking at the example.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. If all tasks complete\n successfully, it will receive an object containing their results.\n\n__Example__\n\n async.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n });\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n async.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n ],\n function(results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n email_link: function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n });\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. Its also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a callback it\n must call on completion.\n\n__Example__\n\n var iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n ]);\n\n node> var iterator2 = iterator();\n 'one'\n node> var iterator3 = iterator2();\n 'two'\n node> iterator3();\n 'three'\n node> var nextfn = iterator2.next();\n node> nextfn();\n 'three'\n\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n // using apply\n\n async.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n ]);\n\n\n // the same process without using apply\n\n async.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n },\n ]);\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n node> var fn = async.apply(sys.puts, 'one');\n node> fn('two', 'three');\n one\n two\n three\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setTimeout(callback, 0),\nwhich means other higher priority events may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n var call_order = [];\n async.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two]\n });\n call_order.push('one')\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n var slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n };\n var fn = async.memoize(slow_fn);\n\n // fn can now be used as if it were slow_fn\n fn('some name', function () {\n // callback\n });\n\n\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n var hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n };\n\n node> async.log(hello, 'world');\n 'hello world'\n\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n var hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n };\n\n node> async.dir(hello, 'world');\n {hello: 'world'}\n\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/caolan/async", - "_id": "async@0.1.22", - "_from": "async@~0.1.22", - "scripts": {} -} diff --git a/node_modules/jsdoc/node_modules/catharsis/README.md b/node_modules/jsdoc/node_modules/catharsis/README.md index ecd4945..a2bb3d8 100644 --- a/node_modules/jsdoc/node_modules/catharsis/README.md +++ b/node_modules/jsdoc/node_modules/catharsis/README.md @@ -226,6 +226,11 @@ pull request, please contact me in advance so I can help things go smoothly. ## Changelog ## ++ 0.8.6 (December 2014): Improved the description of the unknown type. ++ 0.8.5 (December 2014): Added support for postfix nullable/non-nullable operators combined with the +optional operator (for example, `foo?=`). ++ 0.8.4 (December 2014): JSDoc-style nested arrays (for example, `number[][]`) are now parsed +correctly when JSDoc-style type expressions are enabled. + 0.8.3 (October 2014): + Type applications are no longer required to include a period (`.`) as a separator, regardless of whether JSDoc-style type expressions are enabled. diff --git a/node_modules/jsdoc/node_modules/catharsis/lib/parser.js b/node_modules/jsdoc/node_modules/catharsis/lib/parser.js index dab624b..3c11c9d 100644 --- a/node_modules/jsdoc/node_modules/catharsis/lib/parser.js +++ b/node_modules/jsdoc/node_modules/catharsis/lib/parser.js @@ -1,4 +1,6004 @@ -module.exports=function(){function peg$subclass(child,parent){function ctor(){this.constructor=child}ctor.prototype=parent.prototype;child.prototype=new ctor}function SyntaxError(expected,found,offset,line,column){function buildMessage(expected,found){function stringEscape(s){function hex(ch){return ch.charCodeAt(0).toString(16).toUpperCase()}return s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(ch){return"\\x0"+hex(ch)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(ch){return"\\x"+hex(ch)}).replace(/[\u0180-\u0FFF]/g,function(ch){return"\\u0"+hex(ch)}).replace(/[\u1080-\uFFFF]/g,function(ch){return"\\u"+hex(ch)})}var expectedDesc,foundDesc;switch(expected.length){case 0:expectedDesc="end of input";break;case 1:expectedDesc=expected[0];break;default:expectedDesc=expected.slice(0,-1).join(", ")+" or "+expected[expected.length-1]}foundDesc=found?'"'+stringEscape(found)+'"':"end of input";return"Expected "+expectedDesc+" but "+foundDesc+" found."}this.expected=expected;this.found=found;this.offset=offset;this.line=line;this.column=column;this.name="SyntaxError";this.message=buildMessage(expected,found)}peg$subclass(SyntaxError,Error);function parse(input){var options=arguments.length>1?arguments[1]:{},peg$startRuleFunctions={TypeExpression:peg$parseTypeExpression},peg$startRuleFunction=peg$parseTypeExpression,peg$c0=null,peg$c1="",peg$c2=function(r,unk){var result=unk;if(r.repeatable){result=repeatable(result)}return result},peg$c3="?",peg$c4='"?"',peg$c5="!",peg$c6='"!"',peg$c7=function(r,prefix,expr){var result=expr;if(r.repeatable){result=repeatable(result)}return nullable(result,prefix)},peg$c8=function(expr,postfix){return nullable(expr,postfix)},peg$c9=function(prefix,expr){return nullable(expr,prefix)},peg$c10=function(expr){return repeatable(expr)},peg$c11=function(lit,opt){var result=lit;if(opt.optional){result.optional=true}return result},peg$c12=function(lit){return repeatable(lit)},peg$c13="*",peg$c14='"*"',peg$c15=function(){return{type:Types.AllLiteral}},peg$c16=function(){return{type:Types.NullLiteral}},peg$c17=function(){return{type:Types.UndefinedLiteral}},peg$c18="...",peg$c19='"..."',peg$c20=function(){return{repeatable:true}},peg$c21="=",peg$c22='"="',peg$c23=function(){return{optional:true}},peg$c24="[]",peg$c25='"[]"',peg$c26=function(name){var result;if(!options.jsdoc){return null}result={type:Types.TypeApplication,expression:{type:Types.NameExpression,name:"Array"},applications:[name]};result.applications[0].type=Types.NameExpression;return result},peg$c27=function(exp,appl,opt){var result={};var nameExp={type:Types.NameExpression,name:exp.name};if(appl.length){result.type=Types.TypeApplication;result.expression=nameExp;result.applications=appl}else{result=nameExp}if(opt.optional){result.optional=true}return result},peg$c28=function(name){if(!options.jsdoc){return null}return name},peg$c29=function(t){return repeatable(t)},peg$c30=function(exp,opt){var result={type:Types.NameExpression,name:exp.name,reservedWord:true};if(opt.optional){result.optional=true}return result},peg$c31=".",peg$c32='"."',peg$c33="<",peg$c34='"<"',peg$c35=">",peg$c36='">"',peg$c37=function(sep,l){return l},peg$c38=[],peg$c39=",",peg$c40='","',peg$c41=function(expr,list){var result=[expr];for(var i=0,l=list.length;ipos){peg$cachedPos=0;peg$cachedPosDetails={line:1,column:1,seenCR:false}}peg$cachedPos=pos;advance(peg$cachedPosDetails,peg$cachedPos)}return peg$cachedPosDetails}function peg$fail(expected){if(peg$currPospeg$maxFailPos){peg$maxFailPos=peg$currPos;peg$maxFailExpected=[]}peg$maxFailExpected.push(expected)}function peg$cleanupExpected(expected){var i=0;expected.sort();while(ipeg$currPos){s0=input.charAt(peg$currPos);peg$currPos++}else{s0=null;if(peg$silentFails===0){peg$fail(peg$c281)}}return s0}function peg$parseHexEscapeSequence(){var s0,s1,s2,s3,s4,s5;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===120){s1=peg$c279;peg$currPos++}else{s1=null;if(peg$silentFails===0){peg$fail(peg$c280)}}if(s1!==null){s2=peg$currPos;s3=peg$currPos;s4=peg$parseHexDigit();if(s4!==null){s5=peg$parseHexDigit();if(s5!==null){s4=[s4,s5];s3=s4}else{peg$currPos=s3;s3=peg$c0}}else{peg$currPos=s3;s3=peg$c0}if(s3!==null){s3=input.substring(s2,peg$currPos)}s2=s3;if(s2!==null){peg$reportedPos=s0;s1=peg$c227(s2);if(s1===null){peg$currPos=s0;s0=s1}else{s0=s1}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}return s0}function peg$parseLineContinuation(){var s0,s1,s2;s0=peg$currPos;if(input.charCodeAt(peg$currPos)===92){s1=peg$c223;peg$currPos++}else{s1=null;if(peg$silentFails===0){peg$fail(peg$c224)}}if(s1!==null){s2=peg$parseLineTerminatorSequence();if(s2!==null){peg$reportedPos=s0;s1=peg$c265(s2);if(s1===null){peg$currPos=s0;s0=s1}else{s0=s1}}else{peg$currPos=s0;s0=peg$c0}}else{peg$currPos=s0;s0=peg$c0}return s0}function peg$parse_(){var s0,s1; -peg$silentFails++;s0=[];s1=peg$parseWhitespace();while(s1!==null){s0.push(s1);s1=peg$parseWhitespace()}peg$silentFails--;if(s0===null){s1=null;if(peg$silentFails===0){peg$fail(peg$c282)}}return s0}function peg$parse__(){var s0,s1;peg$silentFails++;s0=peg$c1;peg$silentFails--;if(s0===null){s1=null;if(peg$silentFails===0){peg$fail(peg$c283)}}return s0}function peg$parseWhitespace(){var s0;if(peg$c284.test(input.charAt(peg$currPos))){s0=input.charAt(peg$currPos);peg$currPos++}else{s0=null;if(peg$silentFails===0){peg$fail(peg$c285)}}if(s0===null){s0=peg$parseUnicodeZs()}return s0}var Types=require("./types");function repeatable(obj){obj.repeatable=true;return obj}function nullable(obj,modifier){if(modifier){obj.nullable=modifier==="?"?true:false}return obj}peg$result=peg$startRuleFunction();if(peg$result!==null&&peg$currPos===input.length){return peg$result}else{peg$cleanupExpected(peg$maxFailExpected);peg$reportedPos=Math.max(peg$currPos,peg$maxFailPos);throw new SyntaxError(peg$maxFailExpected,peg$reportedPos 1 ? arguments[1] : {}, + + peg$startRuleFunctions = { TypeExpression: peg$parseTypeExpression }, + peg$startRuleFunction = peg$parseTypeExpression, + + peg$c0 = null, + peg$c1 = "", + peg$c2 = function(r, unk) { + var result = unk; + + if (r.repeatable) { + result = repeatable(result); + } + + return result; + }, + peg$c3 = "?", + peg$c4 = "\"?\"", + peg$c5 = "!", + peg$c6 = "\"!\"", + peg$c7 = function(r, prefix, expr) { + var result = expr; + + if (r.repeatable) { + result = repeatable(result); + } + + return nullable(result, prefix); + }, + peg$c8 = function(expr, optionalPre, postfix, optionalPost) { + var result = expr; + + // we only allow one optional operator + if (optionalPre.optional && optionalPost.optional) { + return null; + } + + // "non-nullable, yet optional" makes no sense, but we allow it + result = nullable(result, postfix); + + if (optionalPre.optional || optionalPost.optional) { + result = optional(result); + } + + return result; + }, + peg$c9 = function(expr, postfix) { + return nullable(expr, postfix); + }, + peg$c10 = function(prefix, expr) { + return nullable(expr, prefix); + }, + peg$c11 = function(expr) { + return repeatable(expr); + }, + peg$c12 = function(lit, opt) { + var result = lit; + + if (opt.optional) { + result.optional = true; + } + + return result; + }, + peg$c13 = function(lit) { + return repeatable(lit); + }, + peg$c14 = "*", + peg$c15 = "\"*\"", + peg$c16 = function() { + return { + type: Types.AllLiteral + }; + }, + peg$c17 = function() { + return { + type: Types.NullLiteral + }; + }, + peg$c18 = function() { + return { + type: Types.UndefinedLiteral + }; + }, + peg$c19 = "...", + peg$c20 = "\"...\"", + peg$c21 = function() { + return { + repeatable: true + }; + }, + peg$c22 = "=", + peg$c23 = "\"=\"", + peg$c24 = function() { + return { + optional: true + }; + }, + peg$c25 = [], + peg$c26 = "[]", + peg$c27 = "\"[]\"", + peg$c28 = function(name, brackets) { + var result; + + function nest(obj) { + return { + type: Types.TypeApplication, + expression: { + type: Types.NameExpression, + name: 'Array' + }, + applications: [obj] + }; + } + + // we only allow this if JSDoc parsing is enabled + if (!options.jsdoc) { + return null; + } + + result = nest(name); + result.applications[0].type = Types.NameExpression; + + for (var i = 0, l = brackets.length - 1; i < l; i++) { + result = nest(result); + } + + return result; + }, + peg$c29 = function(exp, appl, opt) { + var result = {}; + + var nameExp = { + type: Types.NameExpression, + name: exp.name + }; + + if (appl.length) { + result.type = Types.TypeApplication; + result.expression = nameExp; + result.applications = appl; + } else { + result = nameExp; + } + + if (opt.optional) { + result.optional = true; + } + + return result; + }, + peg$c30 = function(name) { + // we only allow this if JSDoc parsing is enabled + if (!options.jsdoc) { + return null; + } + + return name; + }, + peg$c31 = function(t) { + return repeatable(t); + }, + peg$c32 = function(exp, opt) { + var result = { + type: Types.NameExpression, + name: exp.name, + reservedWord: true + }; + + if (opt.optional) { + result.optional = true; + } + + return result; + }, + peg$c33 = ".", + peg$c34 = "\".\"", + peg$c35 = "<", + peg$c36 = "\"<\"", + peg$c37 = ">", + peg$c38 = "\">\"", + peg$c39 = function(sep, l) { + return l; + }, + peg$c40 = ",", + peg$c41 = "\",\"", + peg$c42 = function(expr, list) { + var result = [expr]; + for (var i = 0, l = list.length; i < l; i++) { + result.push(list[i][3]); + } + return result; + }, + peg$c43 = function() { + var result; + + // we only allow this if JSDoc parsing is enabled + if (!options.jsdoc) { + return null; + } + + result = { + type: Types.TypeApplication, + expression: { + type: Types.NameExpression, + name: 'Array' + }, + applications: [ + { + type: Types.FunctionType, + params: [] + } + ] + }; + + return result; + }, + peg$c44 = function(sig, opt) { + // signature is required unless JSDoc parsing is enabled + if (!sig && !options.jsdoc) { + return null; + } else if (typeof sig !== 'object') { + sig = { + params: [] + }; + } + + var result = { + type: Types.FunctionType + }; + + Object.keys(sig).forEach(function(key) { + result[key] = sig[key]; + }); + + if (opt.optional) { + result.optional = true; + } + + return result; + }, + peg$c45 = "(", + peg$c46 = "\"(\"", + peg$c47 = ")", + peg$c48 = "\")\"", + peg$c49 = ":", + peg$c50 = "\":\"", + peg$c51 = function(sig, returns) { + var result = {}; + + result.params = sig.params || []; + if (sig['new']) { + result['new'] = sig['new']; + } + if (sig['this']) { + result['this'] = sig['this'] + } + + if (returns && returns[3]) { + result.result = returns[3]; + } + + return result; + }, + peg$c52 = function(funcNew, funcThis, params) { + var result = { + params: params !== '' ? params[3] : [], + 'new': funcNew + }; + if (funcThis !== '') { + result['this'] = funcThis[3]; + } + + return result; + }, + peg$c53 = function(funcThis, funcNew, params) { + var result = { + params: params !== '' ? params[3] : [], + 'this': funcThis + }; + if (funcNew !== '') { + result['new'] = funcNew[3]; + } + + return result; + }, + peg$c54 = function(params) { + return { + params: params + }; + }, + peg$c55 = "new", + peg$c56 = "\"new\"", + peg$c57 = function(expr) { return expr; }, + peg$c58 = "this", + peg$c59 = "\"this\"", + peg$c60 = function(rp) { + return [rp]; + }, + peg$c61 = function(nrp, rp) { + var result = []; + if (nrp !== '') { + result = nrp; + } + if (rp[3]) { + result.push(rp[3]); + } + return result; + }, + peg$c62 = function(p, list) { + var result = [p]; + for (var i = 0, l = list.length; i < l; i++) { + result.push(list[i][3]); + } + return result; + }, + peg$c63 = function(op, list) { + var result = [op]; + for (var i = 0, l = list.length; i < l; i++) { + result.push(list[i][3]); + } + return result; + }, + peg$c64 = function(paramType) { return paramType; }, + peg$c65 = function(t) { + t.optional = true; + return t; + }, + peg$c66 = "[", + peg$c67 = "\"[\"", + peg$c68 = "]", + peg$c69 = "\"]\"", + peg$c70 = function(t) { + if (!options.jsdoc) { + return null; + } + + return repeatable(t); + }, + peg$c71 = function() { + return repeatable({}); + }, + peg$c72 = function(t, opt) { + var result = { + type: Types.TypeUnion, + elements: t + }; + + if (opt.optional) { + result.optional = true; + } + + return result; + }, + peg$c73 = function(tu) { + return repeatable(tu); + }, + peg$c74 = function(expr, list) { + var result = [expr]; + for (var i = 0, l = list.length; i < l; i++) { + result.push(list[i][1]); + } + return result; + }, + peg$c75 = function(expr, list) { + var result = [expr]; + + for (var i = 0, l = list.length; i < l; i++) { + result.push(list[i][1]); + } + + return result; + }, + peg$c76 = function(list) { + return { + type: Types.TypeUnion, + elements: list + }; + }, + peg$c77 = "|", + peg$c78 = "\"|\"", + peg$c79 = function() { + return ''; + }, + peg$c80 = "{", + peg$c81 = "\"{\"", + peg$c82 = "}", + peg$c83 = "\"}\"", + peg$c84 = function(list, opt) { + var result = { + type: Types.RecordType, + fields: list !== '' ? list : [] + }; + + if (opt.optional) { + result.optional = true; + } + + return result; + }, + peg$c85 = function(type, list) { + var result = [type]; + for (var i = 0, l = list.length; i < l; i++) { + result.push(list[i][3]); + } + return result; + }, + peg$c86 = function(key, expr) { + return { + type: Types.FieldType, + key: key, + value: expr[3] !== '' ? expr[3] : undefined + }; + }, + peg$c87 = function(t) { + if (!options.jsdoc) { + return null; + } + + return t; + }, + peg$c88 = function(lit) { + if (!options.jsdoc) { + return null; + } + + return { + name: '"' + lit.join('') + '"' + }; + }, + peg$c89 = function(lit) { + if (!options.jsdoc) { + return null; + } + + return { + name: "'" + lit.join('') + "'" + }; + }, + peg$c90 = function(id, props) { + return { + name: id + props + }; + }, + peg$c91 = function(rw) { + return { + name: rw + }; + }, + peg$c92 = function(lit) { + return '"' + lit + '"'; + }, + peg$c93 = function(lit) { + return "'" + lit + "'"; + }, + peg$c94 = "#", + peg$c95 = "\"#\"", + peg$c96 = "~", + peg$c97 = "\"~\"", + peg$c98 = "/", + peg$c99 = "\"/\"", + peg$c100 = function(sep, prop) { + // we only allow '.' unless JSDoc parsing is enabled + if (sep !== '.' && !options.jsdoc) { + return null; + } + + return sep + prop; + }, + peg$c101 = function(name) { return name; }, + peg$c102 = "$", + peg$c103 = "\"$\"", + peg$c104 = "_", + peg$c105 = "\"_\"", + peg$c106 = "-", + peg$c107 = "\"-\"", + peg$c108 = "\u200C", + peg$c109 = "\"\\u200C\"", + peg$c110 = "\u200D", + peg$c111 = "\"\\u200D\"", + peg$c112 = function(parts) { + if (!options.jsdoc) { + return null; + } + + parts = parts === '' ? [] : parts; + + return '(' + parts.join(', ') + ')'; + + }, + peg$c113 = function(params) { + if (!options.jsdoc) { + return null; + } + + params = params === '' ? [] : params; + + return '(' + params.join(', ') + ')'; + }, + peg$c114 = "break", + peg$c115 = "\"break\"", + peg$c116 = "case", + peg$c117 = "\"case\"", + peg$c118 = "catch", + peg$c119 = "\"catch\"", + peg$c120 = "continue", + peg$c121 = "\"continue\"", + peg$c122 = "debugger", + peg$c123 = "\"debugger\"", + peg$c124 = "default", + peg$c125 = "\"default\"", + peg$c126 = "delete", + peg$c127 = "\"delete\"", + peg$c128 = "do", + peg$c129 = "\"do\"", + peg$c130 = "else", + peg$c131 = "\"else\"", + peg$c132 = "finally", + peg$c133 = "\"finally\"", + peg$c134 = "for", + peg$c135 = "\"for\"", + peg$c136 = "if", + peg$c137 = "\"if\"", + peg$c138 = "in", + peg$c139 = "\"in\"", + peg$c140 = "instanceof", + peg$c141 = "\"instanceof\"", + peg$c142 = "return", + peg$c143 = "\"return\"", + peg$c144 = "switch", + peg$c145 = "\"switch\"", + peg$c146 = "throw", + peg$c147 = "\"throw\"", + peg$c148 = "try", + peg$c149 = "\"try\"", + peg$c150 = "typeof", + peg$c151 = "\"typeof\"", + peg$c152 = "var", + peg$c153 = "\"var\"", + peg$c154 = "void", + peg$c155 = "\"void\"", + peg$c156 = "while", + peg$c157 = "\"while\"", + peg$c158 = "with", + peg$c159 = "\"with\"", + peg$c160 = function(kw) { + return kw; + }, + peg$c161 = "class", + peg$c162 = "\"class\"", + peg$c163 = "const", + peg$c164 = "\"const\"", + peg$c165 = "enum", + peg$c166 = "\"enum\"", + peg$c167 = "export", + peg$c168 = "\"export\"", + peg$c169 = "extends", + peg$c170 = "\"extends\"", + peg$c171 = "import", + peg$c172 = "\"import\"", + peg$c173 = "super", + peg$c174 = "\"super\"", + peg$c175 = "implements", + peg$c176 = "\"implements\"", + peg$c177 = "interface", + peg$c178 = "\"interface\"", + peg$c179 = "let", + peg$c180 = "\"let\"", + peg$c181 = "package", + peg$c182 = "\"package\"", + peg$c183 = "private", + peg$c184 = "\"private\"", + peg$c185 = "protected", + peg$c186 = "\"protected\"", + peg$c187 = "public", + peg$c188 = "\"public\"", + peg$c189 = "static", + peg$c190 = "\"static\"", + peg$c191 = "yield", + peg$c192 = "\"yield\"", + peg$c193 = function(frw) { + return frw; + }, + peg$c194 = "\"", + peg$c195 = "\"\\\"\"", + peg$c196 = function(str) { + return str; + }, + peg$c197 = "'", + peg$c198 = "\"'\"", + peg$c199 = function(lit, digits, exp) { + return parseFloat(lit + '.' + digits + exp); + }, + peg$c200 = function(digits, exp) { + return parseFloat('.' + digits + exp); + }, + peg$c201 = function(lit, exp) { + return parseFloat(lit + exp); + }, + peg$c202 = "0", + peg$c203 = "\"0\"", + peg$c204 = /^[eE]/, + peg$c205 = "[eE]", + peg$c206 = /^[+\-]/, + peg$c207 = "[+\\-]", + peg$c208 = /^[xX]/, + peg$c209 = "[xX]", + peg$c210 = function(hex) { + return parseInt('0x' + hex, 16); + }, + peg$c211 = "null", + peg$c212 = "\"null\"", + peg$c213 = "undefined", + peg$c214 = "\"undefined\"", + peg$c215 = function() { + return { + type: Types.UnknownLiteral + }; + }, + peg$c216 = "true", + peg$c217 = "\"true\"", + peg$c218 = "false", + peg$c219 = "\"false\"", + peg$c220 = "Function", + peg$c221 = "\"Function\"", + peg$c222 = "function", + peg$c223 = "\"function\"", + peg$c224 = "\\", + peg$c225 = "\"\\\\\"", + peg$c226 = "u", + peg$c227 = "\"u\"", + peg$c228 = function(hex) { + return String.fromCharCode(parseInt('0x' + hex), 16); + }, + peg$c229 = /^[0-9]/, + peg$c230 = "[0-9]", + peg$c231 = /^[1-9]/, + peg$c232 = "[1-9]", + peg$c233 = /^[0-9a-fA-F]/, + peg$c234 = "[0-9a-fA-F]", + peg$c235 = "Unicode combining mark", + peg$c236 = /^[\u0903\u093E\u093F\u0940\u0949\u094A\u094B\u094C\u0982\u0983\u09BE\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E\u0A3F\u0A40\u0A83\u0ABE\u0ABF\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6\u0BC7\u0BC8\u0BCA\u0BCB\u0BCC\u0BD7\u0C01\u0C02\u0C03\u0C41\u0C42\u0C43\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC2\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E\u0D3F\u0D40\u0D46\u0D47\u0D48\u0D4A\u0D4B\u0D4C\u0D57\u0D82\u0D83\u0DCF\u0DD0\u0DD1\u0DD8\u0DD9\u0DDA\u0DDB\u0DDC\u0DDD\u0DDE\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062\u1063\u1064\u1067\u1068\u1069\u106A\u106B\u106C\u106D\u1083\u1084\u1087\u1088\u1089\u108A\u108B\u108C\u108F\u17B6\u17BE\u17BF\u17C0\u17C1\u17C2\u17C3\u17C4\u17C5\u17C7\u17C8\u1923\u1924\u1925\u1926\u1929\u192A\u192B\u1930\u1931\u1933\u1934\u1935\u1936\u1937\u1938\u19B0\u19B1\u19B2\u19B3\u19B4\u19B5\u19B6\u19B7\u19B8\u19B9\u19BA\u19BB\u19BC\u19BD\u19BE\u19BF\u19C0\u19C8\u19C9\u1A19\u1A1A\u1A1B\u1B04\u1B35\u1B3B\u1B3D\u1B3E\u1B3F\u1B40\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1C24\u1C25\u1C26\u1C27\u1C28\u1C29\u1C2A\u1C2B\u1C34\u1C35\uA823\uA824\uA827\uA880\uA881\uA8B4\uA8B5\uA8B6\uA8B7\uA8B8\uA8B9\uA8BA\uA8BB\uA8BC\uA8BD\uA8BE\uA8BF\uA8C0\uA8C1\uA8C2\uA8C3\uA952\uA953\uAA2F\uAA30\uAA33\uAA34\uAA4D]/, + peg$c237 = "[\\u0903\\u093E\\u093F\\u0940\\u0949\\u094A\\u094B\\u094C\\u0982\\u0983\\u09BE\\u09BF\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E\\u0A3F\\u0A40\\u0A83\\u0ABE\\u0ABF\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6\\u0BC7\\u0BC8\\u0BCA\\u0BCB\\u0BCC\\u0BD7\\u0C01\\u0C02\\u0C03\\u0C41\\u0C42\\u0C43\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0\\u0CC1\\u0CC2\\u0CC3\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E\\u0D3F\\u0D40\\u0D46\\u0D47\\u0D48\\u0D4A\\u0D4B\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF\\u0DD0\\u0DD1\\u0DD8\\u0DD9\\u0DDA\\u0DDB\\u0DDC\\u0DDD\\u0DDE\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062\\u1063\\u1064\\u1067\\u1068\\u1069\\u106A\\u106B\\u106C\\u106D\\u1083\\u1084\\u1087\\u1088\\u1089\\u108A\\u108B\\u108C\\u108F\\u17B6\\u17BE\\u17BF\\u17C0\\u17C1\\u17C2\\u17C3\\u17C4\\u17C5\\u17C7\\u17C8\\u1923\\u1924\\u1925\\u1926\\u1929\\u192A\\u192B\\u1930\\u1931\\u1933\\u1934\\u1935\\u1936\\u1937\\u1938\\u19B0\\u19B1\\u19B2\\u19B3\\u19B4\\u19B5\\u19B6\\u19B7\\u19B8\\u19B9\\u19BA\\u19BB\\u19BC\\u19BD\\u19BE\\u19BF\\u19C0\\u19C8\\u19C9\\u1A19\\u1A1A\\u1A1B\\u1B04\\u1B35\\u1B3B\\u1B3D\\u1B3E\\u1B3F\\u1B40\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24\\u1C25\\u1C26\\u1C27\\u1C28\\u1C29\\u1C2A\\u1C2B\\u1C34\\u1C35\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4\\uA8B5\\uA8B6\\uA8B7\\uA8B8\\uA8B9\\uA8BA\\uA8BB\\uA8BC\\uA8BD\\uA8BE\\uA8BF\\uA8C0\\uA8C1\\uA8C2\\uA8C3\\uA952\\uA953\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D]", + peg$c238 = "Unicode decimal number", + peg$c239 = /^[0123456789\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06F0\u06F1\u06F2\u06F3\u06F4\u06F5\u06F6\u06F7\u06F8\u06F9\u07C0\u07C1\u07C2\u07C3\u07C4\u07C5\u07C6\u07C7\u07C8\u07C9\u0966\u0967\u0968\u0969\u096A\u096B\u096C\u096D\u096E\u096F\u09E6\u09E7\u09E8\u09E9\u09EA\u09EB\u09EC\u09ED\u09EE\u09EF\u0A66\u0A67\u0A68\u0A69\u0A6A\u0A6B\u0A6C\u0A6D\u0A6E\u0A6F\u0AE6\u0AE7\u0AE8\u0AE9\u0AEA\u0AEB\u0AEC\u0AED\u0AEE\u0AEF\u0B66\u0B67\u0B68\u0B69\u0B6A\u0B6B\u0B6C\u0B6D\u0B6E\u0B6F\u0BE6\u0BE7\u0BE8\u0BE9\u0BEA\u0BEB\u0BEC\u0BED\u0BEE\u0BEF\u0C66\u0C67\u0C68\u0C69\u0C6A\u0C6B\u0C6C\u0C6D\u0C6E\u0C6F\u0CE6\u0CE7\u0CE8\u0CE9\u0CEA\u0CEB\u0CEC\u0CED\u0CEE\u0CEF\u0D66\u0D67\u0D68\u0D69\u0D6A\u0D6B\u0D6C\u0D6D\u0D6E\u0D6F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0ED0\u0ED1\u0ED2\u0ED3\u0ED4\u0ED5\u0ED6\u0ED7\u0ED8\u0ED9\u0F20\u0F21\u0F22\u0F23\u0F24\u0F25\u0F26\u0F27\u0F28\u0F29\u1040\u1041\u1042\u1043\u1044\u1045\u1046\u1047\u1048\u1049\u1090\u1091\u1092\u1093\u1094\u1095\u1096\u1097\u1098\u1099\u17E0\u17E1\u17E2\u17E3\u17E4\u17E5\u17E6\u17E7\u17E8\u17E9\u1810\u1811\u1812\u1813\u1814\u1815\u1816\u1817\u1818\u1819\u1946\u1947\u1948\u1949\u194A\u194B\u194C\u194D\u194E\u194F\u19D0\u19D1\u19D2\u19D3\u19D4\u19D5\u19D6\u19D7\u19D8\u19D9\u1B50\u1B51\u1B52\u1B53\u1B54\u1B55\u1B56\u1B57\u1B58\u1B59\u1BB0\u1BB1\u1BB2\u1BB3\u1BB4\u1BB5\u1BB6\u1BB7\u1BB8\u1BB9\u1C40\u1C41\u1C42\u1C43\u1C44\u1C45\u1C46\u1C47\u1C48\u1C49\u1C50\u1C51\u1C52\u1C53\u1C54\u1C55\u1C56\u1C57\u1C58\u1C59\uA620\uA621\uA622\uA623\uA624\uA625\uA626\uA627\uA628\uA629\uA8D0\uA8D1\uA8D2\uA8D3\uA8D4\uA8D5\uA8D6\uA8D7\uA8D8\uA8D9\uA900\uA901\uA902\uA903\uA904\uA905\uA906\uA907\uA908\uA909\uAA50\uAA51\uAA52\uAA53\uAA54\uAA55\uAA56\uAA57\uAA58\uAA59\uFF10\uFF11\uFF12\uFF13\uFF14\uFF15\uFF16\uFF17\uFF18\uFF19]/, + peg$c240 = "[0123456789\\u0660\\u0661\\u0662\\u0663\\u0664\\u0665\\u0666\\u0667\\u0668\\u0669\\u06F0\\u06F1\\u06F2\\u06F3\\u06F4\\u06F5\\u06F6\\u06F7\\u06F8\\u06F9\\u07C0\\u07C1\\u07C2\\u07C3\\u07C4\\u07C5\\u07C6\\u07C7\\u07C8\\u07C9\\u0966\\u0967\\u0968\\u0969\\u096A\\u096B\\u096C\\u096D\\u096E\\u096F\\u09E6\\u09E7\\u09E8\\u09E9\\u09EA\\u09EB\\u09EC\\u09ED\\u09EE\\u09EF\\u0A66\\u0A67\\u0A68\\u0A69\\u0A6A\\u0A6B\\u0A6C\\u0A6D\\u0A6E\\u0A6F\\u0AE6\\u0AE7\\u0AE8\\u0AE9\\u0AEA\\u0AEB\\u0AEC\\u0AED\\u0AEE\\u0AEF\\u0B66\\u0B67\\u0B68\\u0B69\\u0B6A\\u0B6B\\u0B6C\\u0B6D\\u0B6E\\u0B6F\\u0BE6\\u0BE7\\u0BE8\\u0BE9\\u0BEA\\u0BEB\\u0BEC\\u0BED\\u0BEE\\u0BEF\\u0C66\\u0C67\\u0C68\\u0C69\\u0C6A\\u0C6B\\u0C6C\\u0C6D\\u0C6E\\u0C6F\\u0CE6\\u0CE7\\u0CE8\\u0CE9\\u0CEA\\u0CEB\\u0CEC\\u0CED\\u0CEE\\u0CEF\\u0D66\\u0D67\\u0D68\\u0D69\\u0D6A\\u0D6B\\u0D6C\\u0D6D\\u0D6E\\u0D6F\\u0E50\\u0E51\\u0E52\\u0E53\\u0E54\\u0E55\\u0E56\\u0E57\\u0E58\\u0E59\\u0ED0\\u0ED1\\u0ED2\\u0ED3\\u0ED4\\u0ED5\\u0ED6\\u0ED7\\u0ED8\\u0ED9\\u0F20\\u0F21\\u0F22\\u0F23\\u0F24\\u0F25\\u0F26\\u0F27\\u0F28\\u0F29\\u1040\\u1041\\u1042\\u1043\\u1044\\u1045\\u1046\\u1047\\u1048\\u1049\\u1090\\u1091\\u1092\\u1093\\u1094\\u1095\\u1096\\u1097\\u1098\\u1099\\u17E0\\u17E1\\u17E2\\u17E3\\u17E4\\u17E5\\u17E6\\u17E7\\u17E8\\u17E9\\u1810\\u1811\\u1812\\u1813\\u1814\\u1815\\u1816\\u1817\\u1818\\u1819\\u1946\\u1947\\u1948\\u1949\\u194A\\u194B\\u194C\\u194D\\u194E\\u194F\\u19D0\\u19D1\\u19D2\\u19D3\\u19D4\\u19D5\\u19D6\\u19D7\\u19D8\\u19D9\\u1B50\\u1B51\\u1B52\\u1B53\\u1B54\\u1B55\\u1B56\\u1B57\\u1B58\\u1B59\\u1BB0\\u1BB1\\u1BB2\\u1BB3\\u1BB4\\u1BB5\\u1BB6\\u1BB7\\u1BB8\\u1BB9\\u1C40\\u1C41\\u1C42\\u1C43\\u1C44\\u1C45\\u1C46\\u1C47\\u1C48\\u1C49\\u1C50\\u1C51\\u1C52\\u1C53\\u1C54\\u1C55\\u1C56\\u1C57\\u1C58\\u1C59\\uA620\\uA621\\uA622\\uA623\\uA624\\uA625\\uA626\\uA627\\uA628\\uA629\\uA8D0\\uA8D1\\uA8D2\\uA8D3\\uA8D4\\uA8D5\\uA8D6\\uA8D7\\uA8D8\\uA8D9\\uA900\\uA901\\uA902\\uA903\\uA904\\uA905\\uA906\\uA907\\uA908\\uA909\\uAA50\\uAA51\\uAA52\\uAA53\\uAA54\\uAA55\\uAA56\\uAA57\\uAA58\\uAA59\\uFF10\\uFF11\\uFF12\\uFF13\\uFF14\\uFF15\\uFF16\\uFF17\\uFF18\\uFF19]", + peg$c241 = "Unicode punctuation connector", + peg$c242 = /^[_\u203F\u2040\u2054\uFE33\uFE34\uFE4D\uFE4E\uFE4F\uFF3F]/, + peg$c243 = "[_\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D\\uFE4E\\uFE4F\\uFF3F]", + peg$c244 = "Unicode uppercase letter", + peg$c245 = /^[ABCDEFGHIJKLMNOPQRSTUVWXYZ\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\xDD\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189\u018A\u018B\u018E\u018F\u0190\u0191\u0193\u0194\u0196\u0197\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1\u01B2\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6\u01F7\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243\u0244\u0245\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u0386\u0388\u0389\u038A\u038C\u038E\u038F\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03AA\u03AB\u03CF\u03D2\u03D3\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD\u03FE\u03FF\u0400\u0401\u0402\u0403\u0404\u0405\u0406\u0407\u0408\u0409\u040A\u040B\u040C\u040D\u040E\u040F\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0531\u0532\u0533\u0534\u0535\u0536\u0537\u0538\u0539\u053A\u053B\u053C\u053D\u053E\u053F\u0540\u0541\u0542\u0543\u0544\u0545\u0546\u0547\u0548\u0549\u054A\u054B\u054C\u054D\u054E\u054F\u0550\u0551\u0552\u0553\u0554\u0555\u0556\u10A0\u10A1\u10A2\u10A3\u10A4\u10A5\u10A6\u10A7\u10A8\u10A9\u10AA\u10AB\u10AC\u10AD\u10AE\u10AF\u10B0\u10B1\u10B2\u10B3\u10B4\u10B5\u10B6\u10B7\u10B8\u10B9\u10BA\u10BB\u10BC\u10BD\u10BE\u10BF\u10C0\u10C1\u10C2\u10C3\u10C4\u10C5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1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\u2C2E\u2C60\u2C62\u2C63\u2C64\u2C67\u2C69\u2C6B\u2C6D\u2C6E\u2C6F\u2C72\u2C75\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uFF21\uFF22\uFF23\uFF24\uFF25\uFF26\uFF27\uFF28\uFF29\uFF2A\uFF2B\uFF2C\uFF2D\uFF2E\uFF2F\uFF30\uFF31\uFF32\uFF33\uFF34\uFF35\uFF36\uFF37\uFF38\uFF39\uFF3A]/, + peg$c246 = "[ABCDEFGHIJKLMNOPQRSTUVWXYZ\\xC0\\xC1\\xC2\\xC3\\xC4\\xC5\\xC6\\xC7\\xC8\\xC9\\xCA\\xCB\\xCC\\xCD\\xCE\\xCF\\xD0\\xD1\\xD2\\xD3\\xD4\\xD5\\xD6\\xD8\\xD9\\xDA\\xDB\\xDC\\xDD\\xDE\\u0100\\u0102\\u0104\\u0106\\u0108\\u010A\\u010C\\u010E\\u0110\\u0112\\u0114\\u0116\\u0118\\u011A\\u011C\\u011E\\u0120\\u0122\\u0124\\u0126\\u0128\\u012A\\u012C\\u012E\\u0130\\u0132\\u0134\\u0136\\u0139\\u013B\\u013D\\u013F\\u0141\\u0143\\u0145\\u0147\\u014A\\u014C\\u014E\\u0150\\u0152\\u0154\\u0156\\u0158\\u015A\\u015C\\u015E\\u0160\\u0162\\u0164\\u0166\\u0168\\u016A\\u016C\\u016E\\u0170\\u0172\\u0174\\u0176\\u0178\\u0179\\u017B\\u017D\\u0181\\u0182\\u0184\\u0186\\u0187\\u0189\\u018A\\u018B\\u018E\\u018F\\u0190\\u0191\\u0193\\u0194\\u0196\\u0197\\u0198\\u019C\\u019D\\u019F\\u01A0\\u01A2\\u01A4\\u01A6\\u01A7\\u01A9\\u01AC\\u01AE\\u01AF\\u01B1\\u01B2\\u01B3\\u01B5\\u01B7\\u01B8\\u01BC\\u01C4\\u01C7\\u01CA\\u01CD\\u01CF\\u01D1\\u01D3\\u01D5\\u01D7\\u01D9\\u01DB\\u01DE\\u01E0\\u01E2\\u01E4\\u01E6\\u01E8\\u01EA\\u01EC\\u01EE\\u01F1\\u01F4\\u01F6\\u01F7\\u01F8\\u01FA\\u01FC\\u01FE\\u0200\\u0202\\u0204\\u0206\\u0208\\u020A\\u020C\\u020E\\u0210\\u0212\\u0214\\u0216\\u0218\\u021A\\u021C\\u021E\\u0220\\u0222\\u0224\\u0226\\u0228\\u022A\\u022C\\u022E\\u0230\\u0232\\u023A\\u023B\\u023D\\u023E\\u0241\\u0243\\u0244\\u0245\\u0246\\u0248\\u024A\\u024C\\u024E\\u0370\\u0372\\u0376\\u0386\\u0388\\u0389\\u038A\\u038C\\u038E\\u038F\\u0391\\u0392\\u0393\\u0394\\u0395\\u0396\\u0397\\u0398\\u0399\\u039A\\u039B\\u039C\\u039D\\u039E\\u039F\\u03A0\\u03A1\\u03A3\\u03A4\\u03A5\\u03A6\\u03A7\\u03A8\\u03A9\\u03AA\\u03AB\\u03CF\\u03D2\\u03D3\\u03D4\\u03D8\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2\\u03E4\\u03E6\\u03E8\\u03EA\\u03EC\\u03EE\\u03F4\\u03F7\\u03F9\\u03FA\\u03FD\\u03FE\\u03FF\\u0400\\u0401\\u0402\\u0403\\u0404\\u0405\\u0406\\u0407\\u0408\\u0409\\u040A\\u040B\\u040C\\u040D\\u040E\\u040F\\u0410\\u0411\\u0412\\u0413\\u0414\\u0415\\u0416\\u0417\\u0418\\u0419\\u041A\\u041B\\u041C\\u041D\\u041E\\u041F\\u0420\\u0421\\u0422\\u0423\\u0424\\u0425\\u0426\\u0427\\u0428\\u0429\\u042A\\u042B\\u042C\\u042D\\u042E\\u042F\\u0460\\u0462\\u0464\\u0466\\u0468\\u046A\\u046C\\u046E\\u0470\\u0472\\u0474\\u0476\\u0478\\u047A\\u047C\\u047E\\u0480\\u048A\\u048C\\u048E\\u0490\\u0492\\u0494\\u0496\\u0498\\u049A\\u049C\\u049E\\u04A0\\u04A2\\u04A4\\u04A6\\u04A8\\u04AA\\u04AC\\u04AE\\u04B0\\u04B2\\u04B4\\u04B6\\u04B8\\u04BA\\u04BC\\u04BE\\u04C0\\u04C1\\u04C3\\u04C5\\u04C7\\u04C9\\u04CB\\u04CD\\u04D0\\u04D2\\u04D4\\u04D6\\u04D8\\u04DA\\u04DC\\u04DE\\u04E0\\u04E2\\u04E4\\u04E6\\u04E8\\u04EA\\u04EC\\u04EE\\u04F0\\u04F2\\u04F4\\u04F6\\u04F8\\u04FA\\u04FC\\u04FE\\u0500\\u0502\\u0504\\u0506\\u0508\\u050A\\u050C\\u050E\\u0510\\u0512\\u0514\\u0516\\u0518\\u051A\\u051C\\u051E\\u0520\\u0522\\u0531\\u0532\\u0533\\u0534\\u0535\\u0536\\u0537\\u0538\\u0539\\u053A\\u053B\\u053C\\u053D\\u053E\\u053F\\u0540\\u0541\\u0542\\u0543\\u0544\\u0545\\u0546\\u0547\\u0548\\u0549\\u054A\\u054B\\u054C\\u054D\\u054E\\u054F\\u0550\\u0551\\u0552\\u0553\\u0554\\u0555\\u0556\\u10A0\\u10A1\\u10A2\\u10A3\\u10A4\\u10A5\\u10A6\\u10A7\\u10A8\\u10A9\\u10AA\\u10AB\\u10AC\\u10AD\\u10AE\\u10AF\\u10B0\\u10B1\\u10B2\\u10B3\\u10B4\\u10B5\\u10B6\\u10B7\\u10B8\\u10B9\\u10BA\\u10BB\\u10BC\\u10BD\\u10BE\\u10BF\\u10C0\\u10C1\\u10C2\\u10C3\\u10C4\\u10C5\\u1E00\\u1E02\\u1E04\\u1E06\\u1E08\\u1E0A\\u1E0C\\u1E0E\\u1E10\\u1E12\\u1E14\\u1E16\\u1E18\\u1E1A\\u1E1C\\u1E1E\\u1E20\\u1E22\\u1E24\\u1E26\\u1E28\\u1E2A\\u1E2C\\u1E2E\\u1E30\\u1E32\\u1E34\\u1E36\\u1E38\\u1E3A\\u1E3C\\u1E3E\\u1E40\\u1E42\\u1E44\\u1E46\\u1E48\\u1E4A\\u1E4C\\u1E4E\\u1E50\\u1E52\\u1E54\\u1E56\\u1E58\\u1E5A\\u1E5C\\u1E5E\\u1E60\\u1E62\\u1E64\\u1E66\\u1E68\\u1E6A\\u1E6C\\u1E6E\\u1E70\\u1E72\\u1E74\\u1E76\\u1E78\\u1E7A\\u1E7C\\u1E7E\\u1E80\\u1E82\\u1E84\\u1E86\\u1E88\\u1E8A\\u1E8C\\u1E8E\\u1E90\\u1E92\\u1E94\\u1E9E\\u1EA0\\u1EA2\\u1EA4\\u1EA6\\u1EA8\\u1EAA\\u1EAC\\u1EAE\\u1EB0\\u1EB2\\u1EB4\\u1EB6\\u1EB8\\u1EBA\\u1EBC\\u1EBE\\u1EC0\\u1EC2\\u1EC4\\u1EC6\\u1EC8\\u1ECA\\u1ECC\\u1ECE\\u1ED0\\u1ED2\\u1ED4\\u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\u2C2A\\u2C2B\\u2C2C\\u2C2D\\u2C2E\\u2C60\\u2C62\\u2C63\\u2C64\\u2C67\\u2C69\\u2C6B\\u2C6D\\u2C6E\\u2C6F\\u2C72\\u2C75\\u2C80\\u2C82\\u2C84\\u2C86\\u2C88\\u2C8A\\u2C8C\\u2C8E\\u2C90\\u2C92\\u2C94\\u2C96\\u2C98\\u2C9A\\u2C9C\\u2C9E\\u2CA0\\u2CA2\\u2CA4\\u2CA6\\u2CA8\\u2CAA\\u2CAC\\u2CAE\\u2CB0\\u2CB2\\u2CB4\\u2CB6\\u2CB8\\u2CBA\\u2CBC\\u2CBE\\u2CC0\\u2CC2\\u2CC4\\u2CC6\\u2CC8\\u2CCA\\u2CCC\\u2CCE\\u2CD0\\u2CD2\\u2CD4\\u2CD6\\u2CD8\\u2CDA\\u2CDC\\u2CDE\\u2CE0\\u2CE2\\uA640\\uA642\\uA644\\uA646\\uA648\\uA64A\\uA64C\\uA64E\\uA650\\uA652\\uA654\\uA656\\uA658\\uA65A\\uA65C\\uA65E\\uA662\\uA664\\uA666\\uA668\\uA66A\\uA66C\\uA680\\uA682\\uA684\\uA686\\uA688\\uA68A\\uA68C\\uA68E\\uA690\\uA692\\uA694\\uA696\\uA722\\uA724\\uA726\\uA728\\uA72A\\uA72C\\uA72E\\uA732\\uA734\\uA736\\uA738\\uA73A\\uA73C\\uA73E\\uA740\\uA742\\uA744\\uA746\\uA748\\uA74A\\uA74C\\uA74E\\uA750\\uA752\\uA754\\uA756\\uA758\\uA75A\\uA75C\\uA75E\\uA760\\uA762\\uA764\\uA766\\uA768\\uA76A\\uA76C\\uA76E\\uA779\\uA77B\\uA77D\\uA77E\\uA780\\uA782\\uA784\\uA786\\uA78B\\uFF21\\uFF22\\uFF23\\uFF24\\uFF25\\uFF26\\uFF27\\uFF28\\uFF29\\uFF2A\\uFF2B\\uFF2C\\uFF2D\\uFF2E\\uFF2F\\uFF30\\uFF31\\uFF32\\uFF33\\uFF34\\uFF35\\uFF36\\uFF37\\uFF38\\uFF39\\uFF3A]", + peg$c247 = "Unicode lowercase letter", + peg$c248 = /^[abcdefghijklmnopqrstuvwxyz\xAA\xB5\xBA\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E\u017F\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199\u019A\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD\u01BE\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233\u0234\u0235\u0236\u0237\u0238\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F\u0250\u0251\u0252\u0253\u0254\u0255\u0256\u0257\u0258\u0259\u025A\u025B\u025C\u025D\u025E\u025F\u0260\u0261\u0262\u0263\u0264\u0265\u0266\u0267\u0268\u0269\u026A\u026B\u026C\u026D\u026E\u026F\u0270\u0271\u0272\u0273\u0274\u0275\u0276\u0277\u0278\u0279\u027A\u027B\u027C\u027D\u027E\u027F\u0280\u0281\u0282\u0283\u0284\u0285\u0286\u0287\u0288\u0289\u028A\u028B\u028C\u028D\u028E\u028F\u0290\u0291\u0292\u0293\u0295\u0296\u0297\u0298\u0299\u029A\u029B\u029C\u029D\u029E\u029F\u02A0\u02A1\u02A2\u02A3\u02A4\u02A5\u02A6\u02A7\u02A8\u02A9\u02AA\u02AB\u02AC\u02AD\u02AE\u02AF\u0371\u0373\u0377\u037B\u037C\u037D\u0390\u03AC\u03AD\u03AE\u03AF\u03B0\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C2\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8\u03C9\u03CA\u03CB\u03CC\u03CD\u03CE\u03D0\u03D1\u03D5\u03D6\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF\u03F0\u03F1\u03F2\u03F3\u03F5\u03F8\u03FB\u03FC\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0450\u0451\u0452\u0453\u0454\u0455\u0456\u0457\u0458\u0459\u045A\u045B\u045C\u045D\u045E\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0561\u0562\u0563\u0564\u0565\u0566\u0567\u0568\u0569\u056A\u056B\u056C\u056D\u056E\u056F\u0570\u0571\u0572\u0573\u0574\u0575\u0576\u0577\u0578\u0579\u057A\u057B\u057C\u057D\u057E\u057F\u0580\u0581\u0582\u0583\u0584\u0585\u0586\u0587\u1D00\u1D01\u1D02\u1D03\u1D04\u1D05\u1D06\u1D07\u1D08\u1D09\u1D0A\u1D0B\u1D0C\u1D0D\u1D0E\u1D0F\u1D10\u1D11\u1D12\u1D13\u1D14\u1D15\u1D16\u1D17\u1D18\u1D19\u1D1A\u1D1B\u1D1C\u1D1D\u1D1E\u1D1F\u1D20\u1D21\u1D22\u1D23\u1D24\u1D25\u1D26\u1D27\u1D28\u1D29\u1D2A\u1D2B\u1D62\u1D63\u1D64\u1D65\u1D66\u1D67\u1D68\u1D69\u1D6A\u1D6B\u1D6C\u1D6D\u1D6E\u1D6F\u1D70\u1D71\u1D72\u1D73\u1D74\u1D75\u1D76\u1D77\u1D79\u1D7A\u1D7B\u1D7C\u1D7D\u1D7E\u1D7F\u1D80\u1D81\u1D82\u1D83\u1D84\u1D85\u1D86\u1D87\u1D88\u1D89\u1D8A\u1D8B\u1D8C\u1D8D\u1D8E\u1D8F\u1D90\u1D91\u1D92\u1D93\u1D94\u1D95\u1D96\u1D97\u1D98\u1D99\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95\u1E96\u1E97\u1E98\u1E99\u1E9A\u1E9B\u1E9C\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF\u1F00\u1F01\u1F02\u1F03\u1F04\u1F05\u1F06\u1F07\u1F10\u1F11\u1F12\u1F13\u1F14\u1F15\u1F20\u1F21\u1F22\u1F23\u1F24\u1F25\u1F26\u1F27\u1F30\u1F31\u1F32\u1F33\u1F34\u1F35\u1F36\u1F37\u1F40\u1F41\u1F42\u1F43\u1F44\u1F45\u1F50\u1F51\u1F52\u1F53\u1F54\u1F55\u1F56\u1F57\u1F60\u1F61\u1F62\u1F63\u1F64\u1F65\u1F66\u1F67\u1F70\u1F71\u1F72\u1F73\u1F74\u1F75\u1F76\u1F77\u1F78\u1F79\u1F7A\u1F7B\u1F7C\u1F7D\u1F80\u1F81\u1F82\u1F83\u1F84\u1F85\u1F86\u1F87\u1F90\u1F91\u1F92\u1F93\u1F94\u1F95\u1F96\u1F97\u1FA0\u1FA1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11\u2D12\u2D13\u2D14\u2D15\u2D16\u2D17\u2D18\u2D19\u2D1A\u2D1B\u2D1C\u2D1D\u2D1E\u2D1F\u2D20\u2D21\u2D22\u2D23\u2D24\u2D25\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F\uA730\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771\uA772\uA773\uA774\uA775\uA776\uA777\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uFB00\uFB01\uFB02\uFB03\uFB04\uFB05\uFB06\uFB13\uFB14\uFB15\uFB16\uFB17\uFF41\uFF42\uFF43\uFF44\uFF45\uFF46\uFF47\uFF48\uFF49\uFF4A\uFF4B\uFF4C\uFF4D\uFF4E\uFF4F\uFF50\uFF51\uFF52\uFF53\uFF54\uFF55\uFF56\uFF57\uFF58\uFF59\uFF5A]/, + peg$c249 = "[abcdefghijklmnopqrstuvwxyz\\xAA\\xB5\\xBA\\xDF\\xE0\\xE1\\xE2\\xE3\\xE4\\xE5\\xE6\\xE7\\xE8\\xE9\\xEA\\xEB\\xEC\\xED\\xEE\\xEF\\xF0\\xF1\\xF2\\xF3\\xF4\\xF5\\xF6\\xF8\\xF9\\xFA\\xFB\\xFC\\xFD\\xFE\\xFF\\u0101\\u0103\\u0105\\u0107\\u0109\\u010B\\u010D\\u010F\\u0111\\u0113\\u0115\\u0117\\u0119\\u011B\\u011D\\u011F\\u0121\\u0123\\u0125\\u0127\\u0129\\u012B\\u012D\\u012F\\u0131\\u0133\\u0135\\u0137\\u0138\\u013A\\u013C\\u013E\\u0140\\u0142\\u0144\\u0146\\u0148\\u0149\\u014B\\u014D\\u014F\\u0151\\u0153\\u0155\\u0157\\u0159\\u015B\\u015D\\u015F\\u0161\\u0163\\u0165\\u0167\\u0169\\u016B\\u016D\\u016F\\u0171\\u0173\\u0175\\u0177\\u017A\\u017C\\u017E\\u017F\\u0180\\u0183\\u0185\\u0188\\u018C\\u018D\\u0192\\u0195\\u0199\\u019A\\u019B\\u019E\\u01A1\\u01A3\\u01A5\\u01A8\\u01AA\\u01AB\\u01AD\\u01B0\\u01B4\\u01B6\\u01B9\\u01BA\\u01BD\\u01BE\\u01BF\\u01C6\\u01C9\\u01CC\\u01CE\\u01D0\\u01D2\\u01D4\\u01D6\\u01D8\\u01DA\\u01DC\\u01DD\\u01DF\\u01E1\\u01E3\\u01E5\\u01E7\\u01E9\\u01EB\\u01ED\\u01EF\\u01F0\\u01F3\\u01F5\\u01F9\\u01FB\\u01FD\\u01FF\\u0201\\u0203\\u0205\\u0207\\u0209\\u020B\\u020D\\u020F\\u0211\\u0213\\u0215\\u0217\\u0219\\u021B\\u021D\\u021F\\u0221\\u0223\\u0225\\u0227\\u0229\\u022B\\u022D\\u022F\\u0231\\u0233\\u0234\\u0235\\u0236\\u0237\\u0238\\u0239\\u023C\\u023F\\u0240\\u0242\\u0247\\u0249\\u024B\\u024D\\u024F\\u0250\\u0251\\u0252\\u0253\\u0254\\u0255\\u0256\\u0257\\u0258\\u0259\\u025A\\u025B\\u025C\\u025D\\u025E\\u025F\\u0260\\u0261\\u0262\\u0263\\u0264\\u0265\\u0266\\u0267\\u0268\\u0269\\u026A\\u026B\\u026C\\u026D\\u026E\\u026F\\u0270\\u0271\\u0272\\u0273\\u0274\\u0275\\u0276\\u0277\\u0278\\u0279\\u027A\\u027B\\u027C\\u027D\\u027E\\u027F\\u0280\\u0281\\u0282\\u0283\\u0284\\u0285\\u0286\\u0287\\u0288\\u0289\\u028A\\u028B\\u028C\\u028D\\u028E\\u028F\\u0290\\u0291\\u0292\\u0293\\u0295\\u0296\\u0297\\u0298\\u0299\\u029A\\u029B\\u029C\\u029D\\u029E\\u029F\\u02A0\\u02A1\\u02A2\\u02A3\\u02A4\\u02A5\\u02A6\\u02A7\\u02A8\\u02A9\\u02AA\\u02AB\\u02AC\\u02AD\\u02AE\\u02AF\\u0371\\u0373\\u0377\\u037B\\u037C\\u037D\\u0390\\u03AC\\u03AD\\u03AE\\u03AF\\u03B0\\u03B1\\u03B2\\u03B3\\u03B4\\u03B5\\u03B6\\u03B7\\u03B8\\u03B9\\u03BA\\u03BB\\u03BC\\u03BD\\u03BE\\u03BF\\u03C0\\u03C1\\u03C2\\u03C3\\u03C4\\u03C5\\u03C6\\u03C7\\u03C8\\u03C9\\u03CA\\u03CB\\u03CC\\u03CD\\u03CE\\u03D0\\u03D1\\u03D5\\u03D6\\u03D7\\u03D9\\u03DB\\u03DD\\u03DF\\u03E1\\u03E3\\u03E5\\u03E7\\u03E9\\u03EB\\u03ED\\u03EF\\u03F0\\u03F1\\u03F2\\u03F3\\u03F5\\u03F8\\u03FB\\u03FC\\u0430\\u0431\\u0432\\u0433\\u0434\\u0435\\u0436\\u0437\\u0438\\u0439\\u043A\\u043B\\u043C\\u043D\\u043E\\u043F\\u0440\\u0441\\u0442\\u0443\\u0444\\u0445\\u0446\\u0447\\u0448\\u0449\\u044A\\u044B\\u044C\\u044D\\u044E\\u044F\\u0450\\u0451\\u0452\\u0453\\u0454\\u0455\\u0456\\u0457\\u0458\\u0459\\u045A\\u045B\\u045C\\u045D\\u045E\\u045F\\u0461\\u0463\\u0465\\u0467\\u0469\\u046B\\u046D\\u046F\\u0471\\u0473\\u0475\\u0477\\u0479\\u047B\\u047D\\u047F\\u0481\\u048B\\u048D\\u048F\\u0491\\u0493\\u0495\\u0497\\u0499\\u049B\\u049D\\u049F\\u04A1\\u04A3\\u04A5\\u04A7\\u04A9\\u04AB\\u04AD\\u04AF\\u04B1\\u04B3\\u04B5\\u04B7\\u04B9\\u04BB\\u04BD\\u04BF\\u04C2\\u04C4\\u04C6\\u04C8\\u04CA\\u04CC\\u04CE\\u04CF\\u04D1\\u04D3\\u04D5\\u04D7\\u04D9\\u04DB\\u04DD\\u04DF\\u04E1\\u04E3\\u04E5\\u04E7\\u04E9\\u04EB\\u04ED\\u04EF\\u04F1\\u04F3\\u04F5\\u04F7\\u04F9\\u04FB\\u04FD\\u04FF\\u0501\\u0503\\u0505\\u0507\\u0509\\u050B\\u050D\\u050F\\u0511\\u0513\\u0515\\u0517\\u0519\\u051B\\u051D\\u051F\\u0521\\u0523\\u0561\\u0562\\u0563\\u0564\\u0565\\u0566\\u0567\\u0568\\u0569\\u056A\\u056B\\u056C\\u056D\\u056E\\u056F\\u0570\\u0571\\u0572\\u0573\\u0574\\u0575\\u0576\\u0577\\u0578\\u0579\\u057A\\u057B\\u057C\\u057D\\u057E\\u057F\\u0580\\u0581\\u0582\\u0583\\u0584\\u0585\\u0586\\u0587\\u1D00\\u1D01\\u1D02\\u1D03\\u1D04\\u1D05\\u1D06\\u1D07\\u1D08\\u1D09\\u1D0A\\u1D0B\\u1D0C\\u1D0D\\u1D0E\\u1D0F\\u1D10\\u1D11\\u1D12\\u1D13\\u1D14\\u1D15\\u1D16\\u1D17\\u1D18\\u1D19\\u1D1A\\u1D1B\\u1D1C\\u1D1D\\u1D1E\\u1D1F\\u1D20\\u1D21\\u1D22\\u1D23\\u1D24\\u1D25\\u1D26\\u1D27\\u1D28\\u1D29\\u1D2A\\u1D2B\\u1D62\\u1D63\\u1D64\\u1D65\\u1D66\\u1D67\\u1D68\\u1D69\\u1D6A\\u1D6B\\u1D6C\\u1D6D\\u1D6E\\u1D6F\\u1D70\\u1D71\\u1D72\\u1D73\\u1D74\\u1D75\\u1D76\\u1D77\\u1D79\\u1D7A\\u1D7B\\u1D7C\\u1D7D\\u1D7E\\u1D7F\\u1D80\\u1D81\\u1D82\\u1D83\\u1D84\\u1D85\\u1D86\\u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04\\u1F05\\u1F06\\u1F07\\u1F10\\u1F11\\u1F12\\u1F13\\u1F14\\u1F15\\u1F20\\u1F21\\u1F22\\u1F23\\u1F24\\u1F25\\u1F26\\u1F27\\u1F30\\u1F31\\u1F32\\u1F33\\u1F34\\u1F35\\u1F36\\u1F37\\u1F40\\u1F41\\u1F42\\u1F43\\u1F44\\u1F45\\u1F50\\u1F51\\u1F52\\u1F53\\u1F54\\u1F55\\u1F56\\u1F57\\u1F60\\u1F61\\u1F62\\u1F63\\u1F64\\u1F65\\u1F66\\u1F67\\u1F70\\u1F71\\u1F72\\u1F73\\u1F74\\u1F75\\u1F76\\u1F77\\u1F78\\u1F79\\u1F7A\\u1F7B\\u1F7C\\u1F7D\\u1F80\\u1F81\\u1F82\\u1F83\\u1F84\\u1F85\\u1F86\\u1F87\\u1F90\\u1F91\\u1F92\\u1F93\\u1F94\\u1F95\\u1F96\\u1F97\\u1FA0\\u1FA1\\u1FA2\\u1FA3\\u1FA4\\u1FA5\\u1FA6\\u1FA7\\u1FB0\\u1FB1\\u1FB2\\u1FB3\\u1FB4\\u1FB6\\u1FB7\\u1FBE\\u1FC2\\u1FC3\\u1FC4\\u1FC6\\u1FC7\\u1FD0\\u1FD1\\u1FD2\\u1FD3\\u1FD6\\u1FD7\\u1FE0\\u1FE1\\u1FE2\\u1FE3\\u1FE4\\u1FE5\\u1FE6\\u1FE7\\u1FF2\\u1FF3\\u1FF4\\u1FF6\\u1FF7\\u2071\\u207F\\u210A\\u210E\\u210F\\u2113\\u212F\\u2134\\u2139\\u213C\\u213D\\u2146\\u2147\\u2148\\u2149\\u214E\\u2184\\u2C30\\u2C31\\u2C32\\u2C33\\u2C34\\u2C35\\u2C36\\u2C37\\u2C38\\u2C39\\u2C3A\\u2C3B\\u2C3C\\u2C3D\\u2C3E\\u2C3F\\u2C40\\u2C41\\u2C42\\u2C43\\u2C44\\u2C45\\u2C46\\u2C47\\u2C48\\u2C49\\u2C4A\\u2C4B\\u2C4C\\u2C4D\\u2C4E\\u2C4F\\u2C50\\u2C51\\u2C52\\u2C53\\u2C54\\u2C55\\u2C56\\u2C57\\u2C58\\u2C59\\u2C5A\\u2C5B\\u2C5C\\u2C5D\\u2C5E\\u2C61\\u2C65\\u2C66\\u2C68\\u2C6A\\u2C6C\\u2C71\\u2C73\\u2C74\\u2C76\\u2C77\\u2C78\\u2C79\\u2C7A\\u2C7B\\u2C7C\\u2C81\\u2C83\\u2C85\\u2C87\\u2C89\\u2C8B\\u2C8D\\u2C8F\\u2C91\\u2C93\\u2C95\\u2C97\\u2C99\\u2C9B\\u2C9D\\u2C9F\\u2CA1\\u2CA3\\u2CA5\\u2CA7\\u2CA9\\u2CAB\\u2CAD\\u2CAF\\u2CB1\\u2CB3\\u2CB5\\u2CB7\\u2CB9\\u2CBB\\u2CBD\\u2CBF\\u2CC1\\u2CC3\\u2CC5\\u2CC7\\u2CC9\\u2CCB\\u2CCD\\u2CCF\\u2CD1\\u2CD3\\u2CD5\\u2CD7\\u2CD9\\u2CDB\\u2CDD\\u2CDF\\u2CE1\\u2CE3\\u2CE4\\u2D00\\u2D01\\u2D02\\u2D03\\u2D04\\u2D05\\u2D06\\u2D07\\u2D08\\u2D09\\u2D0A\\u2D0B\\u2D0C\\u2D0D\\u2D0E\\u2D0F\\u2D10\\u2D11\\u2D12\\u2D13\\u2D14\\u2D15\\u2D16\\u2D17\\u2D18\\u2D19\\u2D1A\\u2D1B\\u2D1C\\u2D1D\\u2D1E\\u2D1F\\u2D20\\u2D21\\u2D22\\u2D23\\u2D24\\u2D25\\uA641\\uA643\\uA645\\uA647\\uA649\\uA64B\\uA64D\\uA64F\\uA651\\uA653\\uA655\\uA657\\uA659\\uA65B\\uA65D\\uA65F\\uA663\\uA665\\uA667\\uA669\\uA66B\\uA66D\\uA681\\uA683\\uA685\\uA687\\uA689\\uA68B\\uA68D\\uA68F\\uA691\\uA693\\uA695\\uA697\\uA723\\uA725\\uA727\\uA729\\uA72B\\uA72D\\uA72F\\uA730\\uA731\\uA733\\uA735\\uA737\\uA739\\uA73B\\uA73D\\uA73F\\uA741\\uA743\\uA745\\uA747\\uA749\\uA74B\\uA74D\\uA74F\\uA751\\uA753\\uA755\\uA757\\uA759\\uA75B\\uA75D\\uA75F\\uA761\\uA763\\uA765\\uA767\\uA769\\uA76B\\uA76D\\uA76F\\uA771\\uA772\\uA773\\uA774\\uA775\\uA776\\uA777\\uA778\\uA77A\\uA77C\\uA77F\\uA781\\uA783\\uA785\\uA787\\uA78C\\uFB00\\uFB01\\uFB02\\uFB03\\uFB04\\uFB05\\uFB06\\uFB13\\uFB14\\uFB15\\uFB16\\uFB17\\uFF41\\uFF42\\uFF43\\uFF44\\uFF45\\uFF46\\uFF47\\uFF48\\uFF49\\uFF4A\\uFF4B\\uFF4C\\uFF4D\\uFF4E\\uFF4F\\uFF50\\uFF51\\uFF52\\uFF53\\uFF54\\uFF55\\uFF56\\uFF57\\uFF58\\uFF59\\uFF5A]", + peg$c250 = "Unicode titlecase letter", + peg$c251 = /^[\u01C5\u01C8\u01CB\u01F2\u1F88\u1F89\u1F8A\u1F8B\u1F8C\u1F8D\u1F8E\u1F8F\u1F98\u1F99\u1F9A\u1F9B\u1F9C\u1F9D\u1F9E\u1F9F\u1FA8\u1FA9\u1FAA\u1FAB\u1FAC\u1FAD\u1FAE\u1FAF\u1FBC\u1FCC]/, + peg$c252 = "[\\u01C5\\u01C8\\u01CB\\u01F2\\u1F88\\u1F89\\u1F8A\\u1F8B\\u1F8C\\u1F8D\\u1F8E\\u1F8F\\u1F98\\u1F99\\u1F9A\\u1F9B\\u1F9C\\u1F9D\\u1F9E\\u1F9F\\u1FA8\\u1FA9\\u1FAA\\u1FAB\\u1FAC\\u1FAD\\u1FAE\\u1FAF\\u1FBC\\u1FCC]", + peg$c253 = "Unicode modifier letter", + peg$c254 = /^[\u02B0\u02B1\u02B2\u02B3\u02B4\u02B5\u02B6\u02B7\u02B8\u02B9\u02BA\u02BB\u02BC\u02BD\u02BE\u02BF\u02C0\u02C1\u02C6\u02C7\u02C8\u02C9\u02CA\u02CB\u02CC\u02CD\u02CE\u02CF\u02D0\u02D1\u02E0\u02E1\u02E2\u02E3\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1C78\u1C79\u1C7A\u1C7B\u1C7C\u1C7D\u1D2C\u1D2D\u1D2E\u1D2F\u1D30\u1D31\u1D32\u1D33\u1D34\u1D35\u1D36\u1D37\u1D38\u1D39\u1D3A\u1D3B\u1D3C\u1D3D\u1D3E\u1D3F\u1D40\u1D41\u1D42\u1D43\u1D44\u1D45\u1D46\u1D47\u1D48\u1D49\u1D4A\u1D4B\u1D4C\u1D4D\u1D4E\u1D4F\u1D50\u1D51\u1D52\u1D53\u1D54\u1D55\u1D56\u1D57\u1D58\u1D59\u1D5A\u1D5B\u1D5C\u1D5D\u1D5E\u1D5F\u1D60\u1D61\u1D78\u1D9B\u1D9C\u1D9D\u1D9E\u1D9F\u1DA0\u1DA1\u1DA2\u1DA3\u1DA4\u1DA5\u1DA6\u1DA7\u1DA8\u1DA9\u1DAA\u1DAB\u1DAC\u1DAD\u1DAE\u1DAF\u1DB0\u1DB1\u1DB2\u1DB3\u1DB4\u1DB5\u1DB6\u1DB7\u1DB8\u1DB9\u1DBA\u1DBB\u1DBC\u1DBD\u1DBE\u1DBF\u2090\u2091\u2092\u2093\u2094\u2C7D\u2D6F\u2E2F\u3005\u3031\u3032\u3033\u3034\u3035\u303B\u309D\u309E\u30FC\u30FD\u30FE\uA015\uA60C\uA67F\uA717\uA718\uA719\uA71A\uA71B\uA71C\uA71D\uA71E\uA71F\uA770\uA788\uFF70\uFF9E\uFF9F]/, + peg$c255 = "[\\u02B0\\u02B1\\u02B2\\u02B3\\u02B4\\u02B5\\u02B6\\u02B7\\u02B8\\u02B9\\u02BA\\u02BB\\u02BC\\u02BD\\u02BE\\u02BF\\u02C0\\u02C1\\u02C6\\u02C7\\u02C8\\u02C9\\u02CA\\u02CB\\u02CC\\u02CD\\u02CE\\u02CF\\u02D0\\u02D1\\u02E0\\u02E1\\u02E2\\u02E3\\u02E4\\u02EC\\u02EE\\u0374\\u037A\\u0559\\u0640\\u06E5\\u06E6\\u07F4\\u07F5\\u07FA\\u0971\\u0E46\\u0EC6\\u10FC\\u17D7\\u1843\\u1C78\\u1C79\\u1C7A\\u1C7B\\u1C7C\\u1C7D\\u1D2C\\u1D2D\\u1D2E\\u1D2F\\u1D30\\u1D31\\u1D32\\u1D33\\u1D34\\u1D35\\u1D36\\u1D37\\u1D38\\u1D39\\u1D3A\\u1D3B\\u1D3C\\u1D3D\\u1D3E\\u1D3F\\u1D40\\u1D41\\u1D42\\u1D43\\u1D44\\u1D45\\u1D46\\u1D47\\u1D48\\u1D49\\u1D4A\\u1D4B\\u1D4C\\u1D4D\\u1D4E\\u1D4F\\u1D50\\u1D51\\u1D52\\u1D53\\u1D54\\u1D55\\u1D56\\u1D57\\u1D58\\u1D59\\u1D5A\\u1D5B\\u1D5C\\u1D5D\\u1D5E\\u1D5F\\u1D60\\u1D61\\u1D78\\u1D9B\\u1D9C\\u1D9D\\u1D9E\\u1D9F\\u1DA0\\u1DA1\\u1DA2\\u1DA3\\u1DA4\\u1DA5\\u1DA6\\u1DA7\\u1DA8\\u1DA9\\u1DAA\\u1DAB\\u1DAC\\u1DAD\\u1DAE\\u1DAF\\u1DB0\\u1DB1\\u1DB2\\u1DB3\\u1DB4\\u1DB5\\u1DB6\\u1DB7\\u1DB8\\u1DB9\\u1DBA\\u1DBB\\u1DBC\\u1DBD\\u1DBE\\u1DBF\\u2090\\u2091\\u2092\\u2093\\u2094\\u2C7D\\u2D6F\\u2E2F\\u3005\\u3031\\u3032\\u3033\\u3034\\u3035\\u303B\\u309D\\u309E\\u30FC\\u30FD\\u30FE\\uA015\\uA60C\\uA67F\\uA717\\uA718\\uA719\\uA71A\\uA71B\\uA71C\\uA71D\\uA71E\\uA71F\\uA770\\uA788\\uFF70\\uFF9E\\uFF9F]", + peg$c256 = "Unicode other letter", + peg$c257 = /^[\u01BB\u01C0\u01C1\u01C2\u01C3\u0294\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\u05F0\u05F1\u05F2\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\u063B\u063C\u063D\u063E\u063F\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u066E\u066F\u0671\u0672\u0673\u0674\u0675\u0676\u0677\u0678\u0679\u067A\u067B\u067C\u067D\u067E\u067F\u0680\u0681\u0682\u0683\u0684\u0685\u0686\u0687\u0688\u0689\u068A\u068B\u068C\u068D\u068E\u068F\u0690\u0691\u0692\u0693\u0694\u0695\u0696\u0697\u0698\u0699\u069A\u069B\u069C\u069D\u069E\u069F\u06A0\u06A1\u06A2\u06A3\u06A4\u06A5\u06A6\u06A7\u06A8\u06A9\u06AA\u06AB\u06AC\u06AD\u06AE\u06AF\u06B0\u06B1\u06B2\u06B3\u06B4\u06B5\u06B6\u06B7\u06B8\u06B9\u06BA\u06BB\u06BC\u06BD\u06BE\u06BF\u06C0\u06C1\u06C2\u06C3\u06C4\u06C5\u06C6\u06C7\u06C8\u06C9\u06CA\u06CB\u06CC\u06CD\u06CE\u06CF\u06D0\u06D1\u06D2\u06D3\u06D5\u06EE\u06EF\u06FA\u06FB\u06FC\u06FF\u0710\u0712\u0713\u0714\u0715\u0716\u0717\u0718\u0719\u071A\u071B\u071C\u071D\u071E\u071F\u0720\u0721\u0722\u0723\u0724\u0725\u0726\u0727\u0728\u0729\u072A\u072B\u072C\u072D\u072E\u072F\u074D\u074E\u074F\u0750\u0751\u0752\u0753\u0754\u0755\u0756\u0757\u0758\u0759\u075A\u075B\u075C\u075D\u075E\u075F\u0760\u0761\u0762\u0763\u0764\u0765\u0766\u0767\u0768\u0769\u076A\u076B\u076C\u076D\u076E\u076F\u0770\u0771\u0772\u0773\u0774\u0775\u0776\u0777\u0778\u0779\u077A\u077B\u077C\u077D\u077E\u077F\u0780\u0781\u0782\u0783\u0784\u0785\u0786\u0787\u0788\u0789\u078A\u078B\u078C\u078D\u078E\u078F\u0790\u0791\u0792\u0793\u0794\u0795\u0796\u0797\u0798\u0799\u079A\u079B\u079C\u079D\u079E\u079F\u07A0\u07A1\u07A2\u07A3\u07A4\u07A5\u07B1\u07CA\u07CB\u07CC\u07CD\u07CE\u07CF\u07D0\u07D1\u07D2\u07D3\u07D4\u07D5\u07D6\u07D7\u07D8\u07D9\u07DA\u07DB\u07DC\u07DD\u07DE\u07DF\u07E0\u07E1\u07E2\u07E3\u07E4\u07E5\u07E6\u07E7\u07E8\u07E9\u07EA\u0904\u0905\u0906\u0907\u0908\u0909\u090A\u090B\u090C\u090D\u090E\u090F\u0910\u0911\u0912\u0913\u0914\u0915\u0916\u0917\u0918\u0919\u091A\u091B\u091C\u091D\u091E\u091F\u0920\u0921\u0922\u0923\u0924\u0925\u0926\u0927\u0928\u0929\u092A\u092B\u092C\u092D\u092E\u092F\u0930\u0931\u0932\u0933\u0934\u0935\u0936\u0937\u0938\u0939\u093D\u0950\u0958\u0959\u095A\u095B\u095C\u095D\u095E\u095F\u0960\u0961\u0972\u097B\u097C\u097D\u097E\u097F\u0985\u0986\u0987\u0988\u0989\u098A\u098B\u098C\u098F\u0990\u0993\u0994\u0995\u0996\u0997\u0998\u0999\u099A\u099B\u099C\u099D\u099E\u099F\u09A0\u09A1\u09A2\u09A3\u09A4\u09A5\u09A6\u09A7\u09A8\u09AA\u09AB\u09AC\u09AD\u09AE\u09AF\u09B0\u09B2\u09B6\u09B7\u09B8\u09B9\u09BD\u09CE\u09DC\u09DD\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\u0F67\u0F68\u0F69\u0F6A\u0F6B\u0F6C\u0F88\u0F89\u0F8A\u0F8B\u1000\u1001\u1002\u1003\u1004\u1005\u1006\u1007\u1008\u1009\u100A\u100B\u100C\u100D\u100E\u100F\u1010\u1011\u1012\u1013\u1014\u1015\u1016\u1017\u1018\u1019\u101A\u101B\u101C\u101D\u101E\u101F\u1020\u1021\u1022\u1023\u1024\u1025\u1026\u1027\u1028\u1029\u102A\u103F\u1050\u1051\u1052\u1053\u1054\u1055\u105A\u105B\u105C\u105D\u1061\u1065\u1066\u106E\u106F\u1070\u1075\u1076\u1077\u1078\u1079\u107A\u107B\u107C\u107D\u107E\u107F\u1080\u1081\u108E\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10EF\u10F0\u10F1\u10F2\u10F3\u10F4\u10F5\u10F6\u10F7\u10F8\u10F9\u10FA\u1100\u1101\u1102\u1103\u1104\u1105\u1106\u1107\u1108\u1109\u110A\u110B\u110C\u110D\u110E\u110F\u1110\u1111\u1112\u1113\u1114\u1115\u1116\u1117\u1118\u1119\u111A\u111B\u111C\u111D\u111E\u111F\u1120\u1121\u1122\u1123\u1124\u1125\u1126\u1127\u1128\u1129\u112A\u112B\u112C\u112D\u112E\u112F\u1130\u1131\u1132\u1133\u1134\u1135\u1136\u1137\u1138\u1139\u113A\u113B\u113C\u113D\u113E\u113F\u1140\u1141\u1142\u1143\u1144\u1145\u1146\u1147\u1148\u1149\u114A\u114B\u114C\u114D\u114E\u114F\u1150\u1151\u1152\u1153\u1154\u1155\u1156\u1157\u1158\u1159\u115F\u1160\u1161\u1162\u1163\u1164\u1165\u1166\u1167\u1168\u1169\u116A\u116B\u116C\u116D\u116E\u116F\u1170\u1171\u1172\u1173\u1174\u1175\u1176\u1177\u1178\u1179\u117A\u117B\u117C\u117D\u117E\u117F\u1180\u1181\u1182\u1183\u1184\u1185\u1186\u1187\u1188\u1189\u118A\u118B\u118C\u118D\u118E\u118F\u1190\u1191\u1192\u1193\u1194\u1195\u1196\u1197\u1198\u1199\u119A\u119B\u119C\u119D\u119E\u119F\u11A0\u11A1\u11A2\u11A8\u11A9\u11AA\u11AB\u11AC\u11AD\u11AE\u11AF\u11B0\u11B1\u11B2\u11B3\u11B4\u11B5\u11B6\u11B7\u11B8\u11B9\u11BA\u11BB\u11BC\u11BD\u11BE\u11BF\u11C0\u11C1\u11C2\u11C3\u11C4\u11C5\u11C6\u11C7\u11C8\u11C9\u11CA\u11CB\u11CC\u11CD\u11CE\u11CF\u11D0\u11D1\u11D2\u11D3\u11D4\u11D5\u11D6\u11D7\u11D8\u11D9\u11DA\u11DB\u11DC\u11DD\u11DE\u11DF\u11E0\u11E1\u11E2\u11E3\u11E4\u11E5\u11E6\u11E7\u11E8\u11E9\u11EA\u11EB\u11EC\u11ED\u11EE\u11EF\u11F0\u11F1\u11F2\u11F3\u11F4\u11F5\u11F6\u11F7\u11F8\u11F9\u1200\u1201\u1202\u1203\u1204\u1205\u1206\u1207\u1208\u1209\u120A\u120B\u120C\u120D\u120E\u120F\u1210\u1211\u1212\u1213\u1214\u1215\u1216\u1217\u1218\u1219\u121A\u121B\u121C\u121D\u121E\u121F\u1220\u1221\u1222\u1223\u1224\u1225\u1226\u1227\u1228\u1229\u122A\u122B\u122C\u122D\u122E\u122F\u1230\u1231\u1232\u1233\u1234\u1235\u1236\u1237\u1238\u1239\u123A\u123B\u123C\u123D\u123E\u123F\u1240\u1241\u1242\u1243\u1244\u1245\u1246\u1247\u1248\u124A\u124B\u124C\u124D\u1250\u1251\u1252\u1253\u1254\u1255\u1256\u1258\u125A\u125B\u125C\u125D\u1260\u1261\u1262\u1263\u1264\u1265\u1266\u1267\u1268\u1269\u126A\u126B\u126C\u126D\u126E\u126F\u1270\u1271\u1272\u1273\u1274\u1275\u1276\u1277\u1278\u1279\u127A\u127B\u127C\u127D\u127E\u127F\u1280\u1281\u1282\u1283\u1284\u1285\u1286\u1287\u1288\u128A\u128B\u128C\u128D\u1290\u1291\u1292\u1293\u1294\u1295\u1296\u1297\u1298\u1299\u129A\u129B\u129C\u129D\u129E\u129F\u12A0\u12A1\u12A2\u12A3\u12A4\u12A5\u12A6\u12A7\u12A8\u12A9\u12AA\u12AB\u12AC\u12AD\u12AE\u12AF\u12B0\u12B2\u12B3\u12B4\u12B5\u12B8\u12B9\u12BA\u12BB\u12BC\u12BD\u12BE\u12C0\u12C2\u12C3\u12C4\u12C5\u12C8\u12C9\u12CA\u12CB\u12CC\u12CD\u12CE\u12CF\u12D0\u12D1\u12D2\u12D3\u12D4\u12D5\u12D6\u12D8\u12D9\u12DA\u12DB\u12DC\u12DD\u12DE\u12DF\u12E0\u12E1\u12E2\u12E3\u12E4\u12E5\u12E6\u12E7\u12E8\u12E9\u12EA\u12EB\u12EC\u12ED\u12EE\u12EF\u12F0\u12F1\u12F2\u12F3\u12F4\u12F5\u12F6\u12F7\u12F8\u12F9\u12FA\u12FB\u12FC\u12FD\u12FE\u12FF\u1300\u1301\u1302\u1303\u1304\u1305\u1306\u1307\u1308\u1309\u130A\u130B\u130C\u130D\u130E\u130F\u1310\u1312\u1313\u1314\u1315\u1318\u1319\u131A\u131B\u131C\u131D\u131E\u131F\u1320\u1321\u1322\u1323\u1324\u1325\u1326\u1327\u1328\u1329\u132A\u132B\u132C\u132D\u132E\u132F\u1330\u1331\u1332\u1333\u1334\u1335\u1336\u1337\u1338\u1339\u133A\u133B\u133C\u133D\u133E\u133F\u1340\u1341\u1342\u1343\u1344\u1345\u1346\u1347\u1348\u1349\u134A\u134B\u134C\u134D\u134E\u134F\u1350\u1351\u1352\u1353\u1354\u1355\u1356\u1357\u1358\u1359\u135A\u1380\u1381\u1382\u1383\u1384\u1385\u1386\u1387\u1388\u1389\u138A\u138B\u138C\u138D\u138E\u138F\u13A0\u13A1\u13A2\u13A3\u13A4\u13A5\u13A6\u13A7\u13A8\u13A9\u13AA\u13AB\u13AC\u13AD\u13AE\u13AF\u13B0\u13B1\u13B2\u13B3\u13B4\u13B5\u13B6\u13B7\u13B8\u13B9\u13BA\u13BB\u13BC\u13BD\u13BE\u13BF\u13C0\u13C1\u13C2\u13C3\u13C4\u13C5\u13C6\u13C7\u13C8\u13C9\u13CA\u13CB\u13CC\u13CD\u13CE\u13CF\u13D0\u13D1\u13D2\u13D3\u13D4\u13D5\u13D6\u13D7\u13D8\u13D9\u13DA\u13DB\u13DC\u13DD\u13DE\u13DF\u13E0\u13E1\u13E2\u13E3\u13E4\u13E5\u13E6\u13E7\u13E8\u13E9\u13EA\u13EB\u13EC\u13ED\u13EE\u13EF\u13F0\u13F1\u13F2\u13F3\u13F4\u1401\u1402\u1403\u1404\u1405\u1406\u1407\u1408\u1409\u140A\u140B\u140C\u140D\u140E\u140F\u1410\u1411\u1412\u1413\u1414\u1415\u1416\u1417\u1418\u1419\u141A\u141B\u141C\u141D\u141E\u141F\u1420\u1421\u1422\u1423\u1424\u1425\u1426\u1427\u1428\u1429\u142A\u142B\u142C\u142D\u142E\u142F\u1430\u1431\u1432\u1433\u1434\u1435\u1436\u1437\u1438\u1439\u143A\u143B\u143C\u143D\u143E\u143F\u1440\u1441\u1442\u1443\u1444\u1445\u1446\u1447\u1448\u1449\u144A\u144B\u144C\u144D\u144E\u144F\u1450\u1451\u1452\u1453\u1454\u1455\u1456\u1457\u1458\u1459\u145A\u145B\u145C\u145D\u145E\u145F\u1460\u1461\u1462\u1463\u1464\u1465\u1466\u1467\u1468\u1469\u146A\u146B\u146C\u146D\u146E\u146F\u1470\u1471\u1472\u1473\u1474\u1475\u1476\u1477\u1478\u1479\u147A\u147B\u147C\u147D\u147E\u147F\u1480\u1481\u1482\u1483\u1484\u1485\u1486\u1487\u1488\u1489\u148A\u148B\u148C\u148D\u148E\u148F\u1490\u1491\u1492\u1493\u1494\u1495\u1496\u1497\u1498\u1499\u149A\u149B\u149C\u149D\u149E\u149F\u14A0\u14A1\u14A2\u14A3\u14A4\u14A5\u14A6\u14A7\u14A8\u14A9\u14AA\u14AB\u14AC\u14AD\u14AE\u14AF\u14B0\u14B1\u14B2\u14B3\u14B4\u14B5\u14B6\u14B7\u14B8\u14B9\u14BA\u14BB\u14BC\u14BD\u14BE\u14BF\u14C0\u14C1\u14C2\u14C3\u14C4\u14C5\u14C6\u14C7\u14C8\u14C9\u14CA\u14CB\u14CC\u14CD\u14CE\u14CF\u14D0\u14D1\u14D2\u14D3\u14D4\u14D5\u14D6\u14D7\u14D8\u14D9\u14DA\u14DB\u14DC\u14DD\u14DE\u14DF\u14E0\u14E1\u14E2\u14E3\u14E4\u14E5\u14E6\u14E7\u14E8\u14E9\u14EA\u14EB\u14EC\u14ED\u14EE\u14EF\u14F0\u14F1\u14F2\u14F3\u14F4\u14F5\u14F6\u14F7\u14F8\u14F9\u14FA\u14FB\u14FC\u14FD\u14FE\u14FF\u1500\u1501\u1502\u1503\u1504\u1505\u1506\u1507\u1508\u1509\u150A\u150B\u150C\u150D\u150E\u150F\u1510\u1511\u1512\u1513\u1514\u1515\u1516\u1517\u1518\u1519\u151A\u151B\u151C\u151D\u151E\u151F\u1520\u1521\u1522\u1523\u1524\u1525\u1526\u1527\u1528\u1529\u152A\u152B\u152C\u152D\u152E\u152F\u1530\u1531\u1532\u1533\u1534\u1535\u1536\u1537\u1538\u1539\u153A\u153B\u153C\u153D\u153E\u153F\u1540\u1541\u1542\u1543\u1544\u1545\u1546\u1547\u1548\u1549\u154A\u154B\u154C\u154D\u154E\u154F\u1550\u1551\u1552\u1553\u1554\u1555\u1556\u1557\u1558\u1559\u155A\u155B\u155C\u155D\u155E\u155F\u1560\u1561\u1562\u1563\u1564\u1565\u1566\u1567\u1568\u1569\u156A\u156B\u156C\u156D\u156E\u156F\u1570\u1571\u1572\u1573\u1574\u1575\u1576\u1577\u1578\u1579\u157A\u157B\u157C\u157D\u157E\u157F\u1580\u1581\u1582\u1583\u1584\u1585\u1586\u1587\u1588\u1589\u158A\u158B\u158C\u158D\u158E\u158F\u1590\u1591\u1592\u1593\u1594\u1595\u1596\u1597\u1598\u1599\u159A\u159B\u159C\u159D\u159E\u159F\u15A0\u15A1\u15A2\u15A3\u15A4\u15A5\u15A6\u15A7\u15A8\u15A9\u15AA\u15AB\u15AC\u15AD\u15AE\u15AF\u15B0\u15B1\u15B2\u15B3\u15B4\u15B5\u15B6\u15B7\u15B8\u15B9\u15BA\u15BB\u15BC\u15BD\u15BE\u15BF\u15C0\u15C1\u15C2\u15C3\u15C4\u15C5\u15C6\u15C7\u15C8\u15C9\u15CA\u15CB\u15CC\u15CD\u15CE\u15CF\u15D0\u15D1\u15D2\u15D3\u15D4\u15D5\u15D6\u15D7\u15D8\u15D9\u15DA\u15DB\u15DC\u15DD\u15DE\u15DF\u15E0\u15E1\u15E2\u15E3\u15E4\u15E5\u15E6\u15E7\u15E8\u15E9\u15EA\u15EB\u15EC\u15ED\u15EE\u15EF\u15F0\u15F1\u15F2\u15F3\u15F4\u15F5\u15F6\u15F7\u15F8\u15F9\u15FA\u15FB\u15FC\u15FD\u15FE\u15FF\u1600\u1601\u1602\u1603\u1604\u1605\u1606\u1607\u1608\u1609\u160A\u160B\u160C\u160D\u160E\u160F\u1610\u1611\u1612\u1613\u1614\u1615\u1616\u1617\u1618\u1619\u161A\u161B\u161C\u161D\u161E\u161F\u1620\u1621\u1622\u1623\u1624\u1625\u1626\u1627\u1628\u1629\u162A\u162B\u162C\u162D\u162E\u162F\u1630\u1631\u1632\u1633\u1634\u1635\u1636\u1637\u1638\u1639\u163A\u163B\u163C\u163D\u163E\u163F\u1640\u1641\u1642\u1643\u1644\u1645\u1646\u1647\u1648\u1649\u164A\u164B\u164C\u164D\u164E\u164F\u1650\u1651\u1652\u1653\u1654\u1655\u1656\u1657\u1658\u1659\u165A\u165B\u165C\u165D\u165E\u165F\u1660\u1661\u1662\u1663\u1664\u1665\u1666\u1667\u1668\u1669\u166A\u166B\u166C\u166F\u1670\u1671\u1672\u1673\u1674\u1675\u1676\u1681\u1682\u1683\u1684\u1685\u1686\u1687\u1688\u1689\u168A\u168B\u168C\u168D\u168E\u168F\u1690\u1691\u1692\u1693\u1694\u1695\u1696\u1697\u1698\u1699\u169A\u16A0\u16A1\u16A2\u16A3\u16A4\u16A5\u16A6\u16A7\u16A8\u16A9\u16AA\u16AB\u16AC\u16AD\u16AE\u16AF\u16B0\u16B1\u16B2\u16B3\u16B4\u16B5\u16B6\u16B7\u16B8\u16B9\u16BA\u16BB\u16BC\u16BD\u16BE\u16BF\u16C0\u16C1\u16C2\u16C3\u16C4\u16C5\u16C6\u16C7\u16C8\u16C9\u16CA\u16CB\u16CC\u16CD\u16CE\u16CF\u16D0\u16D1\u16D2\u16D3\u16D4\u16D5\u16D6\u16D7\u16D8\u16D9\u16DA\u16DB\u16DC\u16DD\u16DE\u16DF\u16E0\u16E1\u16E2\u16E3\u16E4\u16E5\u16E6\u16E7\u16E8\u16E9\u16EA\u1700\u1701\u1702\u1703\u1704\u1705\u1706\u1707\u1708\u1709\u170A\u170B\u170C\u170E\u170F\u1710\u1711\u1720\u1721\u1722\u1723\u1724\u1725\u1726\u1727\u1728\u1729\u172A\u172B\u172C\u172D\u172E\u172F\u1730\u1731\u1740\u1741\u1742\u1743\u1744\u1745\u1746\u1747\u1748\u1749\u174A\u174B\u174C\u174D\u174E\u174F\u1750\u1751\u1760\u1761\u1762\u1763\u1764\u1765\u1766\u1767\u1768\u1769\u176A\u176B\u176C\u176E\u176F\u1770\u1780\u1781\u1782\u1783\u1784\u1785\u1786\u1787\u1788\u1789\u178A\u178B\u178C\u178D\u178E\u178F\u1790\u1791\u1792\u1793\u1794\u1795\u1796\u1797\u1798\u1799\u179A\u179B\u179C\u179D\u179E\u179F\u17A0\u17A1\u17A2\u17A3\u17A4\u17A5\u17A6\u17A7\u17A8\u17A9\u17AA\u17AB\u17AC\u17AD\u17AE\u17AF\u17B0\u17B1\u17B2\u17B3\u17DC\u1820\u1821\u1822\u1823\u1824\u1825\u1826\u1827\u1828\u1829\u182A\u182B\u182C\u182D\u182E\u182F\u1830\u1831\u1832\u1833\u1834\u1835\u1836\u1837\u1838\u1839\u183A\u183B\u183C\u183D\u183E\u183F\u1840\u1841\u1842\u1844\u1845\u1846\u1847\u1848\u1849\u184A\u184B\u184C\u184D\u184E\u184F\u1850\u1851\u1852\u1853\u1854\u1855\u1856\u1857\u1858\u1859\u185A\u185B\u185C\u185D\u185E\u185F\u1860\u1861\u1862\u1863\u1864\u1865\u1866\u1867\u1868\u1869\u186A\u186B\u186C\u186D\u186E\u186F\u1870\u1871\u1872\u1873\u1874\u1875\u1876\u1877\u1880\u1881\u1882\u1883\u1884\u1885\u1886\u1887\u1888\u1889\u188A\u188B\u188C\u188D\u188E\u188F\u1890\u1891\u1892\u1893\u1894\u1895\u1896\u1897\u1898\u1899\u189A\u189B\u189C\u189D\u189E\u189F\u18A0\u18A1\u18A2\u18A3\u18A4\u18A5\u18A6\u18A7\u18A8\u18AA\u1900\u1901\u1902\u1903\u1904\u1905\u1906\u1907\u1908\u1909\u190A\u190B\u190C\u190D\u190E\u190F\u1910\u1911\u1912\u1913\u1914\u1915\u1916\u1917\u1918\u1919\u191A\u191B\u191C\u1950\u1951\u1952\u1953\u1954\u1955\u1956\u1957\u1958\u1959\u195A\u195B\u195C\u195D\u195E\u195F\u1960\u1961\u1962\u1963\u1964\u1965\u1966\u1967\u1968\u1969\u196A\u196B\u196C\u196D\u1970\u1971\u1972\u1973\u1974\u1980\u1981\u1982\u1983\u1984\u1985\u1986\u1987\u1988\u1989\u198A\u198B\u198C\u198D\u198E\u198F\u1990\u1991\u1992\u1993\u1994\u1995\u1996\u1997\u1998\u1999\u199A\u199B\u199C\u199D\u199E\u199F\u19A0\u19A1\u19A2\u19A3\u19A4\u19A5\u19A6\u19A7\u19A8\u19A9\u19C1\u19C2\u19C3\u19C4\u19C5\u19C6\u19C7\u1A00\u1A01\u1A02\u1A03\u1A04\u1A05\u1A06\u1A07\u1A08\u1A09\u1A0A\u1A0B\u1A0C\u1A0D\u1A0E\u1A0F\u1A10\u1A11\u1A12\u1A13\u1A14\u1A15\u1A16\u1B05\u1B06\u1B07\u1B08\u1B09\u1B0A\u1B0B\u1B0C\u1B0D\u1B0E\u1B0F\u1B10\u1B11\u1B12\u1B13\u1B14\u1B15\u1B16\u1B17\u1B18\u1B19\u1B1A\u1B1B\u1B1C\u1B1D\u1B1E\u1B1F\u1B20\u1B21\u1B22\u1B23\u1B24\u1B25\u1B26\u1B27\u1B28\u1B29\u1B2A\u1B2B\u1B2C\u1B2D\u1B2E\u1B2F\u1B30\u1B31\u1B32\u1B33\u1B45\u1B46\u1B47\u1B48\u1B49\u1B4A\u1B4B\u1B83\u1B84\u1B85\u1B86\u1B87\u1B88\u1B89\u1B8A\u1B8B\u1B8C\u1B8D\u1B8E\u1B8F\u1B90\u1B91\u1B92\u1B93\u1B94\u1B95\u1B96\u1B97\u1B98\u1B99\u1B9A\u1B9B\u1B9C\u1B9D\u1B9E\u1B9F\u1BA0\u1BAE\u1BAF\u1C00\u1C01\u1C02\u1C03\u1C04\u1C05\u1C06\u1C07\u1C08\u1C09\u1C0A\u1C0B\u1C0C\u1C0D\u1C0E\u1C0F\u1C10\u1C11\u1C12\u1C13\u1C14\u1C15\u1C16\u1C17\u1C18\u1C19\u1C1A\u1C1B\u1C1C\u1C1D\u1C1E\u1C1F\u1C20\u1C21\u1C22\u1C23\u1C4D\u1C4E\u1C4F\u1C5A\u1C5B\u1C5C\u1C5D\u1C5E\u1C5F\u1C60\u1C61\u1C62\u1C63\u1C64\u1C65\u1C66\u1C67\u1C68\u1C69\u1C6A\u1C6B\u1C6C\u1C6D\u1C6E\u1C6F\u1C70\u1C71\u1C72\u1C73\u1C74\u1C75\u1C76\u1C77\u2135\u2136\u2137\u2138\u2D30\u2D31\u2D32\u2D33\u2D34\u2D35\u2D36\u2D37\u2D38\u2D39\u2D3A\u2D3B\u2D3C\u2D3D\u2D3E\u2D3F\u2D40\u2D41\u2D42\u2D43\u2D44\u2D45\u2D46\u2D47\u2D48\u2D49\u2D4A\u2D4B\u2D4C\u2D4D\u2D4E\u2D4F\u2D50\u2D51\u2D52\u2D53\u2D54\u2D55\u2D56\u2D57\u2D58\u2D59\u2D5A\u2D5B\u2D5C\u2D5D\u2D5E\u2D5F\u2D60\u2D61\u2D62\u2D63\u2D64\u2D65\u2D80\u2D81\u2D82\u2D83\u2D84\u2D85\u2D86\u2D87\u2D88\u2D89\u2D8A\u2D8B\u2D8C\u2D8D\u2D8E\u2D8F\u2D90\u2D91\u2D92\u2D93\u2D94\u2D95\u2D96\u2DA0\u2DA1\u2DA2\u2DA3\u2DA4\u2DA5\u2DA6\u2DA8\u2DA9\u2DAA\u2DAB\u2DAC\u2DAD\u2DAE\u2DB0\u2DB1\u2DB2\u2DB3\u2DB4\u2DB5\u2DB6\u2DB8\u2DB9\u2DBA\u2DBB\u2DBC\u2DBD\u2DBE\u2DC0\u2DC1\u2DC2\u2DC3\u2DC4\u2DC5\u2DC6\u2DC8\u2DC9\u2DCA\u2DCB\u2DCC\u2DCD\u2DCE\u2DD0\u2DD1\u2DD2\u2DD3\u2DD4\u2DD5\u2DD6\u2DD8\u2DD9\u2DDA\u2DDB\u2DDC\u2DDD\u2DDE\u3006\u303C\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051\u3052\u3053\u3054\u3055\u3056\u3057\u3058\u3059\u305A\u305B\u305C\u305D\u305E\u305F\u3060\u3061\u3062\u3063\u3064\u3065\u3066\u3067\u3068\u3069\u306A\u306B\u306C\u306D\u306E\u306F\u3070\u3071\u3072\u3073\u3074\u3075\u3076\u3077\u3078\u3079\u307A\u307B\u307C\u307D\u307E\u307F\u3080\u3081\u3082\u3083\u3084\u3085\u3086\u3087\u3088\u3089\u308A\u308B\u308C\u308D\u308E\u308F\u3090\u3091\u3092\u3093\u3094\u3095\u3096\u309F\u30A1\u30A2\u30A3\u30A4\u30A5\u30A6\u30A7\u30A8\u30A9\u30AA\u30AB\u30AC\u30AD\u30AE\u30AF\u30B0\u30B1\u30B2\u30B3\u30B4\u30B5\u30B6\u30B7\u30B8\u30B9\u30BA\u30BB\u30BC\u30BD\u30BE\u30BF\u30C0\u30C1\u30C2\u30C3\u30C4\u30C5\u30C6\u30C7\u30C8\u30C9\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D0\u30D1\u30D2\u30D3\u30D4\u30D5\u30D6\u30D7\u30D8\u30D9\u30DA\u30DB\u30DC\u30DD\u30DE\u30DF\u30E0\u30E1\u30E2\u30E3\u30E4\u30E5\u30E6\u30E7\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EE\u30EF\u30F0\u30F1\u30F2\u30F3\u30F4\u30F5\u30F6\u30F7\u30F8\u30F9\u30FA\u30FF\u3105\u3106\u3107\u3108\u3109\u310A\u310B\u310C\u310D\u310E\u310F\u3110\u3111\u3112\u3113\u3114\u3115\u3116\u3117\u3118\u3119\u311A\u311B\u311C\u311D\u311E\u311F\u3120\u3121\u3122\u3123\u3124\u3125\u3126\u3127\u3128\u3129\u312A\u312B\u312C\u312D\u3131\u3132\u3133\u3134\u3135\u3136\u3137\u3138\u3139\u313A\u313B\u313C\u313D\u313E\u313F\u3140\u3141\u3142\u3143\u3144\u3145\u3146\u3147\u3148\u3149\u314A\u314B\u314C\u314D\u314E\u314F\u3150\u3151\u3152\u3153\u3154\u3155\u3156\u3157\u3158\u3159\u315A\u315B\u315C\u315D\u315E\u315F\u3160\u3161\u3162\u3163\u3164\u3165\u3166\u3167\u3168\u3169\u316A\u316B\u316C\u316D\u316E\u316F\u3170\u3171\u3172\u3173\u3174\u3175\u3176\u3177\u3178\u3179\u317A\u317B\u317C\u317D\u317E\u317F\u3180\u3181\u3182\u3183\u3184\u3185\u3186\u3187\u3188\u3189\u318A\u318B\u318C\u318D\u318E\u31A0\u31A1\u31A2\u31A3\u31A4\u31A5\u31A6\u31A7\u31A8\u31A9\u31AA\u31AB\u31AC\u31AD\u31AE\u31AF\u31B0\u31B1\u31B2\u31B3\u31B4\u31B5\u31B6\u31B7\u31F0\u31F1\u31F2\u31F3\u31F4\u31F5\u31F6\u31F7\u31F8\u31F9\u31FA\u31FB\u31FC\u31FD\u31FE\u31FF\u3400\u4DB5\u4E00\u9FC3\uA000\uA001\uA002\uA003\uA004\uA005\uA006\uA007\uA008\uA009\uA00A\uA00B\uA00C\uA00D\uA00E\uA00F\uA010\uA011\uA012\uA013\uA014\uA016\uA017\uA018\uA019\uA01A\uA01B\uA01C\uA01D\uA01E\uA01F\uA020\uA021\uA022\uA023\uA024\uA025\uA026\uA027\uA028\uA029\uA02A\uA02B\uA02C\uA02D\uA02E\uA02F\uA030\uA031\uA032\uA033\uA034\uA035\uA036\uA037\uA038\uA039\uA03A\uA03B\uA03C\uA03D\uA03E\uA03F\uA040\uA041\uA042\uA043\uA044\uA045\uA046\uA047\uA048\uA049\uA04A\uA04B\uA04C\uA04D\uA04E\uA04F\uA050\uA051\uA052\uA053\uA054\uA055\uA056\uA057\uA058\uA059\uA05A\uA05B\uA05C\uA05D\uA05E\uA05F\uA060\uA061\uA062\uA063\uA064\uA065\uA066\uA067\uA068\uA069\uA06A\uA06B\uA06C\uA06D\uA06E\uA06F\uA070\uA071\uA072\uA073\uA074\uA075\uA076\uA077\uA078\uA079\uA07A\uA07B\uA07C\uA07D\uA07E\uA07F\uA080\uA081\uA082\uA083\uA084\uA085\uA086\uA087\uA088\uA089\uA08A\uA08B\uA08C\uA08D\uA08E\uA08F\uA090\uA091\uA092\uA093\uA094\uA095\uA096\uA097\uA098\uA099\uA09A\uA09B\uA09C\uA09D\uA09E\uA09F\uA0A0\uA0A1\uA0A2\uA0A3\uA0A4\uA0A5\uA0A6\uA0A7\uA0A8\uA0A9\uA0AA\uA0AB\uA0AC\uA0AD\uA0AE\uA0AF\uA0B0\uA0B1\uA0B2\uA0B3\uA0B4\uA0B5\uA0B6\uA0B7\uA0B8\uA0B9\uA0BA\uA0BB\uA0BC\uA0BD\uA0BE\uA0BF\uA0C0\uA0C1\uA0C2\uA0C3\uA0C4\uA0C5\uA0C6\uA0C7\uA0C8\uA0C9\uA0CA\uA0CB\uA0CC\uA0CD\uA0CE\uA0CF\uA0D0\uA0D1\uA0D2\uA0D3\uA0D4\uA0D5\uA0D6\uA0D7\uA0D8\uA0D9\uA0DA\uA0DB\uA0DC\uA0DD\uA0DE\uA0DF\uA0E0\uA0E1\uA0E2\uA0E3\uA0E4\uA0E5\uA0E6\uA0E7\uA0E8\uA0E9\uA0EA\uA0EB\uA0EC\uA0ED\uA0EE\uA0EF\uA0F0\uA0F1\uA0F2\uA0F3\uA0F4\uA0F5\uA0F6\uA0F7\uA0F8\uA0F9\uA0FA\uA0FB\uA0FC\uA0FD\uA0FE\uA0FF\uA100\uA101\uA102\uA103\uA104\uA105\uA106\uA107\uA108\uA109\uA10A\uA10B\uA10C\uA10D\uA10E\uA10F\uA110\uA111\uA112\uA113\uA114\uA115\uA116\uA117\uA118\uA119\uA11A\uA11B\uA11C\uA11D\uA11E\uA11F\uA120\uA121\uA122\uA123\uA124\uA125\uA126\uA127\uA128\uA129\uA12A\uA12B\uA12C\uA12D\uA12E\uA12F\uA130\uA131\uA132\uA133\uA134\uA135\uA136\uA137\uA138\uA139\uA13A\uA13B\uA13C\uA13D\uA13E\uA13F\uA140\uA141\uA142\uA143\uA144\uA145\uA146\uA147\uA148\uA149\uA14A\uA14B\uA14C\uA14D\uA14E\uA14F\uA150\uA151\uA152\uA153\uA154\uA155\uA156\uA157\uA158\uA159\uA15A\uA15B\uA15C\uA15D\uA15E\uA15F\uA160\uA161\uA162\uA163\uA164\uA165\uA166\uA167\uA168\uA169\uA16A\uA16B\uA16C\uA16D\uA16E\uA16F\uA170\uA171\uA172\uA173\uA174\uA175\uA176\uA177\uA178\uA179\uA17A\uA17B\uA17C\uA17D\uA17E\uA17F\uA180\uA181\uA182\uA183\uA184\uA185\uA186\uA187\uA188\uA189\uA18A\uA18B\uA18C\uA18D\uA18E\uA18F\uA190\uA191\uA192\uA193\uA194\uA195\uA196\uA197\uA198\uA199\uA19A\uA19B\uA19C\uA19D\uA19E\uA19F\uA1A0\uA1A1\uA1A2\uA1A3\uA1A4\uA1A5\uA1A6\uA1A7\uA1A8\uA1A9\uA1AA\uA1AB\uA1AC\uA1AD\uA1AE\uA1AF]/, + peg$c258 = "[\\u01BB\\u01C0\\u01C1\\u01C2\\u01C3\\u0294\\u05D0\\u05D1\\u05D2\\u05D3\\u05D4\\u05D5\\u05D6\\u05D7\\u05D8\\u05D9\\u05DA\\u05DB\\u05DC\\u05DD\\u05DE\\u05DF\\u05E0\\u05E1\\u05E2\\u05E3\\u05E4\\u05E5\\u05E6\\u05E7\\u05E8\\u05E9\\u05EA\\u05F0\\u05F1\\u05F2\\u0621\\u0622\\u0623\\u0624\\u0625\\u0626\\u0627\\u0628\\u0629\\u062A\\u062B\\u062C\\u062D\\u062E\\u062F\\u0630\\u0631\\u0632\\u0633\\u0634\\u0635\\u0636\\u0637\\u0638\\u0639\\u063A\\u063B\\u063C\\u063D\\u063E\\u063F\\u0641\\u0642\\u0643\\u0644\\u0645\\u0646\\u0647\\u0648\\u0649\\u064A\\u066E\\u066F\\u0671\\u0672\\u0673\\u0674\\u0675\\u0676\\u0677\\u0678\\u0679\\u067A\\u067B\\u067C\\u067D\\u067E\\u067F\\u0680\\u0681\\u0682\\u0683\\u0684\\u0685\\u0686\\u0687\\u0688\\u0689\\u068A\\u068B\\u068C\\u068D\\u068E\\u068F\\u0690\\u0691\\u0692\\u0693\\u0694\\u0695\\u0696\\u0697\\u0698\\u0699\\u069A\\u069B\\u069C\\u069D\\u069E\\u069F\\u06A0\\u06A1\\u06A2\\u06A3\\u06A4\\u06A5\\u06A6\\u06A7\\u06A8\\u06A9\\u06AA\\u06AB\\u06AC\\u06AD\\u06AE\\u06AF\\u06B0\\u06B1\\u06B2\\u06B3\\u06B4\\u06B5\\u06B6\\u06B7\\u06B8\\u06B9\\u06BA\\u06BB\\u06BC\\u06BD\\u06BE\\u06BF\\u06C0\\u06C1\\u06C2\\u06C3\\u06C4\\u06C5\\u06C6\\u06C7\\u06C8\\u06C9\\u06CA\\u06CB\\u06CC\\u06CD\\u06CE\\u06CF\\u06D0\\u06D1\\u06D2\\u06D3\\u06D5\\u06EE\\u06EF\\u06FA\\u06FB\\u06FC\\u06FF\\u0710\\u0712\\u0713\\u0714\\u0715\\u0716\\u0717\\u0718\\u0719\\u071A\\u071B\\u071C\\u071D\\u071E\\u071F\\u0720\\u0721\\u0722\\u0723\\u0724\\u0725\\u0726\\u0727\\u0728\\u0729\\u072A\\u072B\\u072C\\u072D\\u072E\\u072F\\u074D\\u074E\\u074F\\u0750\\u0751\\u0752\\u0753\\u0754\\u0755\\u0756\\u0757\\u0758\\u0759\\u075A\\u075B\\u075C\\u075D\\u075E\\u075F\\u0760\\u0761\\u0762\\u0763\\u0764\\u0765\\u0766\\u0767\\u0768\\u0769\\u076A\\u076B\\u076C\\u076D\\u076E\\u076F\\u0770\\u0771\\u0772\\u0773\\u0774\\u0775\\u0776\\u0777\\u0778\\u0779\\u077A\\u077B\\u077C\\u077D\\u077E\\u077F\\u0780\\u0781\\u0782\\u0783\\u0784\\u0785\\u0786\\u0787\\u0788\\u0789\\u078A\\u078B\\u078C\\u078D\\u078E\\u078F\\u0790\\u0791\\u0792\\u0793\\u0794\\u0795\\u0796\\u0797\\u0798\\u0799\\u079A\\u079B\\u079C\\u079D\\u079E\\u079F\\u07A0\\u07A1\\u07A2\\u07A3\\u07A4\\u07A5\\u07B1\\u07CA\\u07CB\\u07CC\\u07CD\\u07CE\\u07CF\\u07D0\\u07D1\\u07D2\\u07D3\\u07D4\\u07D5\\u07D6\\u07D7\\u07D8\\u07D9\\u07DA\\u07DB\\u07DC\\u07DD\\u07DE\\u07DF\\u07E0\\u07E1\\u07E2\\u07E3\\u07E4\\u07E5\\u07E6\\u07E7\\u07E8\\u07E9\\u07EA\\u0904\\u0905\\u0906\\u0907\\u0908\\u0909\\u090A\\u090B\\u090C\\u090D\\u090E\\u090F\\u0910\\u0911\\u0912\\u0913\\u0914\\u0915\\u0916\\u0917\\u0918\\u0919\\u091A\\u091B\\u091C\\u091D\\u091E\\u091F\\u0920\\u0921\\u0922\\u0923\\u0924\\u0925\\u0926\\u0927\\u0928\\u0929\\u092A\\u092B\\u092C\\u092D\\u092E\\u092F\\u0930\\u0931\\u0932\\u0933\\u0934\\u0935\\u0936\\u0937\\u0938\\u0939\\u093D\\u0950\\u0958\\u0959\\u095A\\u095B\\u095C\\u095D\\u095E\\u095F\\u0960\\u0961\\u0972\\u097B\\u097C\\u097D\\u097E\\u097F\\u0985\\u0986\\u0987\\u0988\\u0989\\u098A\\u098B\\u098C\\u098F\\u0990\\u0993\\u0994\\u0995\\u0996\\u0997\\u0998\\u0999\\u099A\\u099B\\u099C\\u099D\\u099E\\u099F\\u09A0\\u09A1\\u09A2\\u09A3\\u09A4\\u09A5\\u09A6\\u09A7\\u09A8\\u09AA\\u09AB\\u09AC\\u09AD\\u09AE\\u09AF\\u09B0\\u09B2\\u09B6\\u09B7\\u09B8\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF\\u09E0\\u09E1\\u09F0\\u09F1\\u0A05\\u0A06\\u0A07\\u0A08\\u0A09\\u0A0A\\u0A0F\\u0A10\\u0A13\\u0A14\\u0A15\\u0A16\\u0A17\\u0A18\\u0A19\\u0A1A\\u0A1B\\u0A1C\\u0A1D\\u0A1E\\u0A1F\\u0A20\\u0A21\\u0A22\\u0A23\\u0A24\\u0A25\\u0A26\\u0A27\\u0A28\\u0A2A\\u0A2B\\u0A2C\\u0A2D\\u0A2E\\u0A2F\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59\\u0A5A\\u0A5B\\u0A5C\\u0A5E\\u0A72\\u0A73\\u0A74\\u0A85\\u0A86\\u0A87\\u0A88\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\\u0F4B\\u0F4C\\u0F4D\\u0F4E\\u0F4F\\u0F50\\u0F51\\u0F52\\u0F53\\u0F54\\u0F55\\u0F56\\u0F57\\u0F58\\u0F59\\u0F5A\\u0F5B\\u0F5C\\u0F5D\\u0F5E\\u0F5F\\u0F60\\u0F61\\u0F62\\u0F63\\u0F64\\u0F65\\u0F66\\u0F67\\u0F68\\u0F69\\u0F6A\\u0F6B\\u0F6C\\u0F88\\u0F89\\u0F8A\\u0F8B\\u1000\\u1001\\u1002\\u1003\\u1004\\u1005\\u1006\\u1007\\u1008\\u1009\\u100A\\u100B\\u100C\\u100D\\u100E\\u100F\\u1010\\u1011\\u1012\\u1013\\u1014\\u1015\\u1016\\u1017\\u1018\\u1019\\u101A\\u101B\\u101C\\u101D\\u101E\\u101F\\u1020\\u1021\\u1022\\u1023\\u1024\\u1025\\u1026\\u1027\\u1028\\u1029\\u102A\\u103F\\u1050\\u1051\\u1052\\u1053\\u1054\\u1055\\u105A\\u105B\\u105C\\u105D\\u1061\\u1065\\u1066\\u106E\\u106F\\u1070\\u1075\\u1076\\u1077\\u1078\\u1079\\u107A\\u107B\\u107C\\u107D\\u107E\\u107F\\u1080\\u1081\\u108E\\u10D0\\u10D1\\u10D2\\u10D3\\u10D4\\u10D5\\u10D6\\u10D7\\u10D8\\u10D9\\u10DA\\u10DB\\u10DC\\u10DD\\u10DE\\u10DF\\u10E0\\u10E1\\u10E2\\u10E3\\u10E4\\u10E5\\u10E6\\u10E7\\u10E8\\u10E9\\u10EA\\u10EB\\u10EC\\u10ED\\u10EE\\u10EF\\u10F0\\u10F1\\u10F2\\u10F3\\u10F4\\u10F5\\u10F6\\u10F7\\u10F8\\u10F9\\u10FA\\u1100\\u1101\\u1102\\u1103\\u1104\\u1105\\u1106\\u1107\\u1108\\u1109\\u110A\\u110B\\u110C\\u110D\\u110E\\u110F\\u1110\\u1111\\u1112\\u1113\\u1114\\u1115\\u1116\\u1117\\u1118\\u1119\\u111A\\u111B\\u111C\\u111D\\u111E\\u111F\\u1120\\u1121\\u1122\\u1123\\u1124\\u1125\\u1126\\u1127\\u1128\\u1129\\u112A\\u112B\\u112C\\u112D\\u112E\\u112F\\u1130\\u1131\\u1132\\u1133\\u1134\\u1135\\u1136\\u1137\\u1138\\u1139\\u113A\\u113B\\u113C\\u113D\\u113E\\u113F\\u1140\\u1141\\u1142\\u1143\\u1144\\u1145\\u1146\\u1147\\u1148\\u1149\\u114A\\u114B\\u114C\\u114D\\u114E\\u114F\\u1150\\u1151\\u1152\\u1153\\u1154\\u1155\\u1156\\u1157\\u1158\\u1159\\u115F\\u1160\\u1161\\u1162\\u1163\\u1164\\u1165\\u1166\\u1167\\u1168\\u1169\\u116A\\u116B\\u116C\\u116D\\u116E\\u116F\\u1170\\u1171\\u1172\\u1173\\u1174\\u1175\\u1176\\u1177\\u1178\\u1179\\u117A\\u117B\\u117C\\u117D\\u117E\\u117F\\u1180\\u1181\\u1182\\u1183\\u1184\\u1185\\u1186\\u1187\\u1188\\u1189\\u118A\\u118B\\u118C\\u118D\\u118E\\u118F\\u1190\\u1191\\u1192\\u1193\\u1194\\u1195\\u1196\\u1197\\u1198\\u1199\\u119A\\u119B\\u119C\\u119D\\u119E\\u119F\\u11A0\\u11A1\\u11A2\\u11A8\\u11A9\\u11AA\\u11AB\\u11AC\\u11AD\\u11AE\\u11AF\\u11B0\\u11B1\\u11B2\\u11B3\\u11B4\\u11B5\\u11B6\\u11B7\\u11B8\\u11B9\\u11BA\\u11BB\\u11BC\\u11BD\\u11BE\\u11BF\\u11C0\\u11C1\\u11C2\\u11C3\\u11C4\\u11C5\\u11C6\\u11C7\\u11C8\\u11C9\\u11CA\\u11CB\\u11CC\\u11CD\\u11CE\\u11CF\\u11D0\\u11D1\\u11D2\\u11D3\\u11D4\\u11D5\\u11D6\\u11D7\\u11D8\\u11D9\\u11DA\\u11DB\\u11DC\\u11DD\\u11DE\\u11DF\\u11E0\\u11E1\\u11E2\\u11E3\\u11E4\\u11E5\\u11E6\\u11E7\\u11E8\\u11E9\\u11EA\\u11EB\\u11EC\\u11ED\\u11EE\\u11EF\\u11F0\\u11F1\\u11F2\\u11F3\\u11F4\\u11F5\\u11F6\\u11F7\\u11F8\\u11F9\\u1200\\u1201\\u1202\\u1203\\u1204\\u1205\\u1206\\u1207\\u1208\\u1209\\u120A\\u120B\\u120C\\u120D\\u120E\\u120F\\u1210\\u1211\\u1212\\u1213\\u1214\\u1215\\u1216\\u1217\\u1218\\u1219\\u121A\\u121B\\u121C\\u121D\\u121E\\u121F\\u1220\\u1221\\u1222\\u1223\\u1224\\u1225\\u1226\\u1227\\u1228\\u1229\\u122A\\u122B\\u122C\\u122D\\u122E\\u122F\\u1230\\u1231\\u1232\\u1233\\u1234\\u1235\\u1236\\u1237\\u1238\\u1239\\u123A\\u123B\\u123C\\u123D\\u123E\\u123F\\u1240\\u1241\\u1242\\u1243\\u1244\\u1245\\u1246\\u1247\\u1248\\u124A\\u124B\\u124C\\u124D\\u1250\\u1251\\u1252\\u1253\\u1254\\u1255\\u1256\\u1258\\u125A\\u125B\\u125C\\u125D\\u1260\\u1261\\u1262\\u1263\\u1264\\u1265\\u1266\\u1267\\u1268\\u1269\\u126A\\u126B\\u126C\\u126D\\u126E\\u126F\\u1270\\u1271\\u1272\\u1273\\u1274\\u1275\\u1276\\u1277\\u1278\\u1279\\u127A\\u127B\\u127C\\u127D\\u127E\\u127F\\u1280\\u1281\\u1282\\u1283\\u1284\\u1285\\u1286\\u1287\\u1288\\u128A\\u128B\\u128C\\u128D\\u1290\\u1291\\u1292\\u1293\\u1294\\u1295\\u1296\\u1297\\u1298\\u1299\\u129A\\u129B\\u129C\\u129D\\u129E\\u129F\\u12A0\\u12A1\\u12A2\\u12A3\\u12A4\\u12A5\\u12A6\\u12A7\\u12A8\\u12A9\\u12AA\\u12AB\\u12AC\\u12AD\\u12AE\\u12AF\\u12B0\\u12B2\\u12B3\\u12B4\\u12B5\\u12B8\\u12B9\\u12BA\\u12BB\\u12BC\\u12BD\\u12BE\\u12C0\\u12C2\\u12C3\\u12C4\\u12C5\\u12C8\\u12C9\\u12CA\\u12CB\\u12CC\\u12CD\\u12CE\\u12CF\\u12D0\\u12D1\\u12D2\\u12D3\\u12D4\\u12D5\\u12D6\\u12D8\\u12D9\\u12DA\\u12DB\\u12DC\\u12DD\\u12DE\\u12DF\\u12E0\\u12E1\\u12E2\\u12E3\\u12E4\\u12E5\\u12E6\\u12E7\\u12E8\\u12E9\\u12EA\\u12EB\\u12EC\\u12ED\\u12EE\\u12EF\\u12F0\\u12F1\\u12F2\\u12F3\\u12F4\\u12F5\\u12F6\\u12F7\\u12F8\\u12F9\\u12FA\\u12FB\\u12FC\\u12FD\\u12FE\\u12FF\\u1300\\u1301\\u1302\\u1303\\u1304\\u1305\\u1306\\u1307\\u1308\\u1309\\u130A\\u130B\\u130C\\u130D\\u130E\\u130F\\u1310\\u1312\\u1313\\u1314\\u1315\\u1318\\u1319\\u131A\\u131B\\u131C\\u131D\\u131E\\u131F\\u1320\\u1321\\u1322\\u1323\\u1324\\u1325\\u1326\\u1327\\u1328\\u1329\\u132A\\u132B\\u132C\\u132D\\u132E\\u132F\\u1330\\u1331\\u1332\\u1333\\u1334\\u1335\\u1336\\u1337\\u1338\\u1339\\u133A\\u133B\\u133C\\u133D\\u133E\\u133F\\u1340\\u1341\\u1342\\u1343\\u1344\\u1345\\u1346\\u1347\\u1348\\u1349\\u134A\\u134B\\u134C\\u134D\\u134E\\u134F\\u1350\\u1351\\u1352\\u1353\\u1354\\u1355\\u1356\\u1357\\u1358\\u1359\\u135A\\u1380\\u1381\\u1382\\u1383\\u1384\\u1385\\u1386\\u1387\\u1388\\u1389\\u138A\\u138B\\u138C\\u138D\\u138E\\u138F\\u13A0\\u13A1\\u13A2\\u13A3\\u13A4\\u13A5\\u13A6\\u13A7\\u13A8\\u13A9\\u13AA\\u13AB\\u13AC\\u13AD\\u13AE\\u13AF\\u13B0\\u13B1\\u13B2\\u13B3\\u13B4\\u13B5\\u13B6\\u13B7\\u13B8\\u13B9\\u13BA\\u13BB\\u13BC\\u13BD\\u13BE\\u13BF\\u13C0\\u13C1\\u13C2\\u13C3\\u13C4\\u13C5\\u13C6\\u13C7\\u13C8\\u13C9\\u13CA\\u13CB\\u13CC\\u13CD\\u13CE\\u13CF\\u13D0\\u13D1\\u13D2\\u13D3\\u13D4\\u13D5\\u13D6\\u13D7\\u13D8\\u13D9\\u13DA\\u13DB\\u13DC\\u13DD\\u13DE\\u13DF\\u13E0\\u13E1\\u13E2\\u13E3\\u13E4\\u13E5\\u13E6\\u13E7\\u13E8\\u13E9\\u13EA\\u13EB\\u13EC\\u13ED\\u13EE\\u13EF\\u13F0\\u13F1\\u13F2\\u13F3\\u13F4\\u1401\\u1402\\u1403\\u1404\\u1405\\u1406\\u1407\\u1408\\u1409\\u140A\\u140B\\u140C\\u140D\\u140E\\u140F\\u1410\\u1411\\u1412\\u1413\\u1414\\u1415\\u1416\\u1417\\u1418\\u1419\\u141A\\u141B\\u141C\\u141D\\u141E\\u141F\\u1420\\u1421\\u1422\\u1423\\u1424\\u1425\\u1426\\u1427\\u1428\\u1429\\u142A\\u142B\\u142C\\u142D\\u142E\\u142F\\u1430\\u1431\\u1432\\u1433\\u1434\\u1435\\u1436\\u1437\\u1438\\u1439\\u143A\\u143B\\u143C\\u143D\\u143E\\u143F\\u1440\\u1441\\u1442\\u1443\\u1444\\u1445\\u1446\\u1447\\u1448\\u1449\\u144A\\u144B\\u144C\\u144D\\u144E\\u144F\\u1450\\u1451\\u1452\\u1453\\u1454\\u1455\\u1456\\u1457\\u1458\\u1459\\u145A\\u145B\\u145C\\u145D\\u145E\\u145F\\u1460\\u1461\\u1462\\u1463\\u1464\\u1465\\u1466\\u1467\\u1468\\u1469\\u146A\\u146B\\u146C\\u146D\\u146E\\u146F\\u1470\\u1471\\u1472\\u1473\\u1474\\u1475\\u1476\\u1477\\u1478\\u1479\\u147A\\u147B\\u147C\\u147D\\u147E\\u147F\\u1480\\u1481\\u1482\\u1483\\u1484\\u1485\\u1486\\u1487\\u1488\\u1489\\u148A\\u148B\\u148C\\u148D\\u148E\\u148F\\u1490\\u1491\\u1492\\u1493\\u1494\\u1495\\u1496\\u1497\\u1498\\u1499\\u149A\\u149B\\u149C\\u149D\\u149E\\u149F\\u14A0\\u14A1\\u14A2\\u14A3\\u14A4\\u14A5\\u14A6\\u14A7\\u14A8\\u14A9\\u14AA\\u14AB\\u14AC\\u14AD\\u14AE\\u14AF\\u14B0\\u14B1\\u14B2\\u14B3\\u14B4\\u14B5\\u14B6\\u14B7\\u14B8\\u14B9\\u14BA\\u14BB\\u14BC\\u14BD\\u14BE\\u14BF\\u14C0\\u14C1\\u14C2\\u14C3\\u14C4\\u14C5\\u14C6\\u14C7\\u14C8\\u14C9\\u14CA\\u14CB\\u14CC\\u14CD\\u14CE\\u14CF\\u14D0\\u14D1\\u14D2\\u14D3\\u14D4\\u14D5\\u14D6\\u14D7\\u14D8\\u14D9\\u14DA\\u14DB\\u14DC\\u14DD\\u14DE\\u14DF\\u14E0\\u14E1\\u14E2\\u14E3\\u14E4\\u14E5\\u14E6\\u14E7\\u14E8\\u14E9\\u14EA\\u14EB\\u14EC\\u14ED\\u14EE\\u14EF\\u14F0\\u14F1\\u14F2\\u14F3\\u14F4\\u14F5\\u14F6\\u14F7\\u14F8\\u14F9\\u14FA\\u14FB\\u14FC\\u14FD\\u14FE\\u14FF\\u1500\\u1501\\u1502\\u1503\\u1504\\u1505\\u1506\\u1507\\u1508\\u1509\\u150A\\u150B\\u150C\\u150D\\u150E\\u150F\\u1510\\u1511\\u1512\\u1513\\u1514\\u1515\\u1516\\u1517\\u1518\\u1519\\u151A\\u151B\\u151C\\u151D\\u151E\\u151F\\u1520\\u1521\\u1522\\u1523\\u1524\\u1525\\u1526\\u1527\\u1528\\u1529\\u152A\\u152B\\u152C\\u152D\\u152E\\u152F\\u1530\\u1531\\u1532\\u1533\\u1534\\u1535\\u1536\\u1537\\u1538\\u1539\\u153A\\u153B\\u153C\\u153D\\u153E\\u153F\\u1540\\u1541\\u1542\\u1543\\u1544\\u1545\\u1546\\u1547\\u1548\\u1549\\u154A\\u154B\\u154C\\u154D\\u154E\\u154F\\u1550\\u1551\\u1552\\u1553\\u1554\\u1555\\u1556\\u1557\\u1558\\u1559\\u155A\\u155B\\u155C\\u155D\\u155E\\u155F\\u1560\\u1561\\u1562\\u1563\\u1564\\u1565\\u1566\\u1567\\u1568\\u1569\\u156A\\u156B\\u156C\\u156D\\u156E\\u156F\\u1570\\u1571\\u1572\\u1573\\u1574\\u1575\\u1576\\u1577\\u1578\\u1579\\u157A\\u157B\\u157C\\u157D\\u157E\\u157F\\u1580\\u1581\\u1582\\u1583\\u1584\\u1585\\u1586\\u1587\\u1588\\u1589\\u158A\\u158B\\u158C\\u158D\\u158E\\u158F\\u1590\\u1591\\u1592\\u1593\\u1594\\u1595\\u1596\\u1597\\u1598\\u1599\\u159A\\u159B\\u159C\\u159D\\u159E\\u159F\\u15A0\\u15A1\\u15A2\\u15A3\\u15A4\\u15A5\\u15A6\\u15A7\\u15A8\\u15A9\\u15AA\\u15AB\\u15AC\\u15AD\\u15AE\\u15AF\\u15B0\\u15B1\\u15B2\\u15B3\\u15B4\\u15B5\\u15B6\\u15B7\\u15B8\\u15B9\\u15BA\\u15BB\\u15BC\\u15BD\\u15BE\\u15BF\\u15C0\\u15C1\\u15C2\\u15C3\\u15C4\\u15C5\\u15C6\\u15C7\\u15C8\\u15C9\\u15CA\\u15CB\\u15CC\\u15CD\\u15CE\\u15CF\\u15D0\\u15D1\\u15D2\\u15D3\\u15D4\\u15D5\\u15D6\\u15D7\\u15D8\\u15D9\\u15DA\\u15DB\\u15DC\\u15DD\\u15DE\\u15DF\\u15E0\\u15E1\\u15E2\\u15E3\\u15E4\\u15E5\\u15E6\\u15E7\\u15E8\\u15E9\\u15EA\\u15EB\\u15EC\\u15ED\\u15EE\\u15EF\\u15F0\\u15F1\\u15F2\\u15F3\\u15F4\\u15F5\\u15F6\\u15F7\\u15F8\\u15F9\\u15FA\\u15FB\\u15FC\\u15FD\\u15FE\\u15FF\\u1600\\u1601\\u1602\\u1603\\u1604\\u1605\\u1606\\u1607\\u1608\\u1609\\u160A\\u160B\\u160C\\u160D\\u160E\\u160F\\u1610\\u1611\\u1612\\u1613\\u1614\\u1615\\u1616\\u1617\\u1618\\u1619\\u161A\\u161B\\u161C\\u161D\\u161E\\u161F\\u1620\\u1621\\u1622\\u1623\\u1624\\u1625\\u1626\\u1627\\u1628\\u1629\\u162A\\u162B\\u162C\\u162D\\u162E\\u162F\\u1630\\u1631\\u1632\\u1633\\u1634\\u1635\\u1636\\u1637\\u1638\\u1639\\u163A\\u163B\\u163C\\u163D\\u163E\\u163F\\u1640\\u1641\\u1642\\u1643\\u1644\\u1645\\u1646\\u1647\\u1648\\u1649\\u164A\\u164B\\u164C\\u164D\\u164E\\u164F\\u1650\\u1651\\u1652\\u1653\\u1654\\u1655\\u1656\\u1657\\u1658\\u1659\\u165A\\u165B\\u165C\\u165D\\u165E\\u165F\\u1660\\u1661\\u1662\\u1663\\u1664\\u1665\\u1666\\u1667\\u1668\\u1669\\u166A\\u166B\\u166C\\u166F\\u1670\\u1671\\u1672\\u1673\\u1674\\u1675\\u1676\\u1681\\u1682\\u1683\\u1684\\u1685\\u1686\\u1687\\u1688\\u1689\\u168A\\u168B\\u168C\\u168D\\u168E\\u168F\\u1690\\u1691\\u1692\\u1693\\u1694\\u1695\\u1696\\u1697\\u1698\\u1699\\u169A\\u16A0\\u16A1\\u16A2\\u16A3\\u16A4\\u16A5\\u16A6\\u16A7\\u16A8\\u16A9\\u16AA\\u16AB\\u16AC\\u16AD\\u16AE\\u16AF\\u16B0\\u16B1\\u16B2\\u16B3\\u16B4\\u16B5\\u16B6\\u16B7\\u16B8\\u16B9\\u16BA\\u16BB\\u16BC\\u16BD\\u16BE\\u16BF\\u16C0\\u16C1\\u16C2\\u16C3\\u16C4\\u16C5\\u16C6\\u16C7\\u16C8\\u16C9\\u16CA\\u16CB\\u16CC\\u16CD\\u16CE\\u16CF\\u16D0\\u16D1\\u16D2\\u16D3\\u16D4\\u16D5\\u16D6\\u16D7\\u16D8\\u16D9\\u16DA\\u16DB\\u16DC\\u16DD\\u16DE\\u16DF\\u16E0\\u16E1\\u16E2\\u16E3\\u16E4\\u16E5\\u16E6\\u16E7\\u16E8\\u16E9\\u16EA\\u1700\\u1701\\u1702\\u1703\\u1704\\u1705\\u1706\\u1707\\u1708\\u1709\\u170A\\u170B\\u170C\\u170E\\u170F\\u1710\\u1711\\u1720\\u1721\\u1722\\u1723\\u1724\\u1725\\u1726\\u1727\\u1728\\u1729\\u172A\\u172B\\u172C\\u172D\\u172E\\u172F\\u1730\\u1731\\u1740\\u1741\\u1742\\u1743\\u1744\\u1745\\u1746\\u1747\\u1748\\u1749\\u174A\\u174B\\u174C\\u174D\\u174E\\u174F\\u1750\\u1751\\u1760\\u1761\\u1762\\u1763\\u1764\\u1765\\u1766\\u1767\\u1768\\u1769\\u176A\\u176B\\u176C\\u176E\\u176F\\u1770\\u1780\\u1781\\u1782\\u1783\\u1784\\u1785\\u1786\\u1787\\u1788\\u1789\\u178A\\u178B\\u178C\\u178D\\u178E\\u178F\\u1790\\u1791\\u1792\\u1793\\u1794\\u1795\\u1796\\u1797\\u1798\\u1799\\u179A\\u179B\\u179C\\u179D\\u179E\\u179F\\u17A0\\u17A1\\u17A2\\u17A3\\u17A4\\u17A5\\u17A6\\u17A7\\u17A8\\u17A9\\u17AA\\u17AB\\u17AC\\u17AD\\u17AE\\u17AF\\u17B0\\u17B1\\u17B2\\u17B3\\u17DC\\u1820\\u1821\\u1822\\u1823\\u1824\\u1825\\u1826\\u1827\\u1828\\u1829\\u182A\\u182B\\u182C\\u182D\\u182E\\u182F\\u1830\\u1831\\u1832\\u1833\\u1834\\u1835\\u1836\\u1837\\u1838\\u1839\\u183A\\u183B\\u183C\\u183D\\u183E\\u183F\\u1840\\u1841\\u1842\\u1844\\u1845\\u1846\\u1847\\u1848\\u1849\\u184A\\u184B\\u184C\\u184D\\u184E\\u184F\\u1850\\u1851\\u1852\\u1853\\u1854\\u1855\\u1856\\u1857\\u1858\\u1859\\u185A\\u185B\\u185C\\u185D\\u185E\\u185F\\u1860\\u1861\\u1862\\u1863\\u1864\\u1865\\u1866\\u1867\\u1868\\u1869\\u186A\\u186B\\u186C\\u186D\\u186E\\u186F\\u1870\\u1871\\u1872\\u1873\\u1874\\u1875\\u1876\\u1877\\u1880\\u1881\\u1882\\u1883\\u1884\\u1885\\u1886\\u1887\\u1888\\u1889\\u188A\\u188B\\u188C\\u188D\\u188E\\u188F\\u1890\\u1891\\u1892\\u1893\\u1894\\u1895\\u1896\\u1897\\u1898\\u1899\\u189A\\u189B\\u189C\\u189D\\u189E\\u189F\\u18A0\\u18A1\\u18A2\\u18A3\\u18A4\\u18A5\\u18A6\\u18A7\\u18A8\\u18AA\\u1900\\u1901\\u1902\\u1903\\u1904\\u1905\\u1906\\u1907\\u1908\\u1909\\u190A\\u190B\\u190C\\u190D\\u190E\\u190F\\u1910\\u1911\\u1912\\u1913\\u1914\\u1915\\u1916\\u1917\\u1918\\u1919\\u191A\\u191B\\u191C\\u1950\\u1951\\u1952\\u1953\\u1954\\u1955\\u1956\\u1957\\u1958\\u1959\\u195A\\u195B\\u195C\\u195D\\u195E\\u195F\\u1960\\u1961\\u1962\\u1963\\u1964\\u1965\\u1966\\u1967\\u1968\\u1969\\u196A\\u196B\\u196C\\u196D\\u1970\\u1971\\u1972\\u1973\\u1974\\u1980\\u1981\\u1982\\u1983\\u1984\\u1985\\u1986\\u1987\\u1988\\u1989\\u198A\\u198B\\u198C\\u198D\\u198E\\u198F\\u1990\\u1991\\u1992\\u1993\\u1994\\u1995\\u1996\\u1997\\u1998\\u1999\\u199A\\u199B\\u199C\\u199D\\u199E\\u199F\\u19A0\\u19A1\\u19A2\\u19A3\\u19A4\\u19A5\\u19A6\\u19A7\\u19A8\\u19A9\\u19C1\\u19C2\\u19C3\\u19C4\\u19C5\\u19C6\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C\\u3041\\u3042\\u3043\\u3044\\u3045\\u3046\\u3047\\u3048\\u3049\\u304A\\u304B\\u304C\\u304D\\u304E\\u304F\\u3050\\u3051\\u3052\\u3053\\u3054\\u3055\\u3056\\u3057\\u3058\\u3059\\u305A\\u305B\\u305C\\u305D\\u305E\\u305F\\u3060\\u3061\\u3062\\u3063\\u3064\\u3065\\u3066\\u3067\\u3068\\u3069\\u306A\\u306B\\u306C\\u306D\\u306E\\u306F\\u3070\\u3071\\u3072\\u3073\\u3074\\u3075\\u3076\\u3077\\u3078\\u3079\\u307A\\u307B\\u307C\\u307D\\u307E\\u307F\\u3080\\u3081\\u3082\\u3083\\u3084\\u3085\\u3086\\u3087\\u3088\\u3089\\u308A\\u308B\\u308C\\u308D\\u308E\\u308F\\u3090\\u3091\\u3092\\u3093\\u3094\\u3095\\u3096\\u309F\\u30A1\\u30A2\\u30A3\\u30A4\\u30A5\\u30A6\\u30A7\\u30A8\\u30A9\\u30AA\\u30AB\\u30AC\\u30AD\\u30AE\\u30AF\\u30B0\\u30B1\\u30B2\\u30B3\\u30B4\\u30B5\\u30B6\\u30B7\\u30B8\\u30B9\\u30BA\\u30BB\\u30BC\\u30BD\\u30BE\\u30BF\\u30C0\\u30C1\\u30C2\\u30C3\\u30C4\\u30C5\\u30C6\\u30C7\\u30C8\\u30C9\\u30CA\\u30CB\\u30CC\\u30CD\\u30CE\\u30CF\\u30D0\\u30D1\\u30D2\\u30D3\\u30D4\\u30D5\\u30D6\\u30D7\\u30D8\\u30D9\\u30DA\\u30DB\\u30DC\\u30DD\\u30DE\\u30DF\\u30E0\\u30E1\\u30E2\\u30E3\\u30E4\\u30E5\\u30E6\\u30E7\\u30E8\\u30E9\\u30EA\\u30EB\\u30EC\\u30ED\\u30EE\\u30EF\\u30F0\\u30F1\\u30F2\\u30F3\\u30F4\\u30F5\\u30F6\\u30F7\\u30F8\\u30F9\\u30FA\\u30FF\\u3105\\u3106\\u3107\\u3108\\u3109\\u310A\\u310B\\u310C\\u310D\\u310E\\u310F\\u3110\\u3111\\u3112\\u3113\\u3114\\u3115\\u3116\\u3117\\u3118\\u3119\\u311A\\u311B\\u311C\\u311D\\u311E\\u311F\\u3120\\u3121\\u3122\\u3123\\u3124\\u3125\\u3126\\u3127\\u3128\\u3129\\u312A\\u312B\\u312C\\u312D\\u3131\\u3132\\u3133\\u3134\\u3135\\u3136\\u3137\\u3138\\u3139\\u313A\\u313B\\u313C\\u313D\\u313E\\u313F\\u3140\\u3141\\u3142\\u3143\\u3144\\u3145\\u3146\\u3147\\u3148\\u3149\\u314A\\u314B\\u314C\\u314D\\u314E\\u314F\\u3150\\u3151\\u3152\\u3153\\u3154\\u3155\\u3156\\u3157\\u3158\\u3159\\u315A\\u315B\\u315C\\u315D\\u315E\\u315F\\u3160\\u3161\\u3162\\u3163\\u3164\\u3165\\u3166\\u3167\\u3168\\u3169\\u316A\\u316B\\u316C\\u316D\\u316E\\u316F\\u3170\\u3171\\u3172\\u3173\\u3174\\u3175\\u3176\\u3177\\u3178\\u3179\\u317A\\u317B\\u317C\\u317D\\u317E\\u317F\\u3180\\u3181\\u3182\\u3183\\u3184\\u3185\\u3186\\u3187\\u3188\\u3189\\u318A\\u318B\\u318C\\u318D\\u318E\\u31A0\\u31A1\\u31A2\\u31A3\\u31A4\\u31A5\\u31A6\\u31A7\\u31A8\\u31A9\\u31AA\\u31AB\\u31AC\\u31AD\\u31AE\\u31AF\\u31B0\\u31B1\\u31B2\\u31B3\\u31B4\\u31B5\\u31B6\\u31B7\\u31F0\\u31F1\\u31F2\\u31F3\\u31F4\\u31F5\\u31F6\\u31F7\\u31F8\\u31F9\\u31FA\\u31FB\\u31FC\\u31FD\\u31FE\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000\\uA001\\uA002\\uA003\\uA004\\uA005\\uA006\\uA007\\uA008\\uA009\\uA00A\\uA00B\\uA00C\\uA00D\\uA00E\\uA00F\\uA010\\uA011\\uA012\\uA013\\uA014\\uA016\\uA017\\uA018\\uA019\\uA01A\\uA01B\\uA01C\\uA01D\\uA01E\\uA01F\\uA020\\uA021\\uA022\\uA023\\uA024\\uA025\\uA026\\uA027\\uA028\\uA029\\uA02A\\uA02B\\uA02C\\uA02D\\uA02E\\uA02F\\uA030\\uA031\\uA032\\uA033\\uA034\\uA035\\uA036\\uA037\\uA038\\uA039\\uA03A\\uA03B\\uA03C\\uA03D\\uA03E\\uA03F\\uA040\\uA041\\uA042\\uA043\\uA044\\uA045\\uA046\\uA047\\uA048\\uA049\\uA04A\\uA04B\\uA04C\\uA04D\\uA04E\\uA04F\\uA050\\uA051\\uA052\\uA053\\uA054\\uA055\\uA056\\uA057\\uA058\\uA059\\uA05A\\uA05B\\uA05C\\uA05D\\uA05E\\uA05F\\uA060\\uA061\\uA062\\uA063\\uA064\\uA065\\uA066\\uA067\\uA068\\uA069\\uA06A\\uA06B\\uA06C\\uA06D\\uA06E\\uA06F\\uA070\\uA071\\uA072\\uA073\\uA074\\uA075\\uA076\\uA077\\uA078\\uA079\\uA07A\\uA07B\\uA07C\\uA07D\\uA07E\\uA07F\\uA080\\uA081\\uA082\\uA083\\uA084\\uA085\\uA086\\uA087\\uA088\\uA089\\uA08A\\uA08B\\uA08C\\uA08D\\uA08E\\uA08F\\uA090\\uA091\\uA092\\uA093\\uA094\\uA095\\uA096\\uA097\\uA098\\uA099\\uA09A\\uA09B\\uA09C\\uA09D\\uA09E\\uA09F\\uA0A0\\uA0A1\\uA0A2\\uA0A3\\uA0A4\\uA0A5\\uA0A6\\uA0A7\\uA0A8\\uA0A9\\uA0AA\\uA0AB\\uA0AC\\uA0AD\\uA0AE\\uA0AF\\uA0B0\\uA0B1\\uA0B2\\uA0B3\\uA0B4\\uA0B5\\uA0B6\\uA0B7\\uA0B8\\uA0B9\\uA0BA\\uA0BB\\uA0BC\\uA0BD\\uA0BE\\uA0BF\\uA0C0\\uA0C1\\uA0C2\\uA0C3\\uA0C4\\uA0C5\\uA0C6\\uA0C7\\uA0C8\\uA0C9\\uA0CA\\uA0CB\\uA0CC\\uA0CD\\uA0CE\\uA0CF\\uA0D0\\uA0D1\\uA0D2\\uA0D3\\uA0D4\\uA0D5\\uA0D6\\uA0D7\\uA0D8\\uA0D9\\uA0DA\\uA0DB\\uA0DC\\uA0DD\\uA0DE\\uA0DF\\uA0E0\\uA0E1\\uA0E2\\uA0E3\\uA0E4\\uA0E5\\uA0E6\\uA0E7\\uA0E8\\uA0E9\\uA0EA\\uA0EB\\uA0EC\\uA0ED\\uA0EE\\uA0EF\\uA0F0\\uA0F1\\uA0F2\\uA0F3\\uA0F4\\uA0F5\\uA0F6\\uA0F7\\uA0F8\\uA0F9\\uA0FA\\uA0FB\\uA0FC\\uA0FD\\uA0FE\\uA0FF\\uA100\\uA101\\uA102\\uA103\\uA104\\uA105\\uA106\\uA107\\uA108\\uA109\\uA10A\\uA10B\\uA10C\\uA10D\\uA10E\\uA10F\\uA110\\uA111\\uA112\\uA113\\uA114\\uA115\\uA116\\uA117\\uA118\\uA119\\uA11A\\uA11B\\uA11C\\uA11D\\uA11E\\uA11F\\uA120\\uA121\\uA122\\uA123\\uA124\\uA125\\uA126\\uA127\\uA128\\uA129\\uA12A\\uA12B\\uA12C\\uA12D\\uA12E\\uA12F\\uA130\\uA131\\uA132\\uA133\\uA134\\uA135\\uA136\\uA137\\uA138\\uA139\\uA13A\\uA13B\\uA13C\\uA13D\\uA13E\\uA13F\\uA140\\uA141\\uA142\\uA143\\uA144\\uA145\\uA146\\uA147\\uA148\\uA149\\uA14A\\uA14B\\uA14C\\uA14D\\uA14E\\uA14F\\uA150\\uA151\\uA152\\uA153\\uA154\\uA155\\uA156\\uA157\\uA158\\uA159\\uA15A\\uA15B\\uA15C\\uA15D\\uA15E\\uA15F\\uA160\\uA161\\uA162\\uA163\\uA164\\uA165\\uA166\\uA167\\uA168\\uA169\\uA16A\\uA16B\\uA16C\\uA16D\\uA16E\\uA16F\\uA170\\uA171\\uA172\\uA173\\uA174\\uA175\\uA176\\uA177\\uA178\\uA179\\uA17A\\uA17B\\uA17C\\uA17D\\uA17E\\uA17F\\uA180\\uA181\\uA182\\uA183\\uA184\\uA185\\uA186\\uA187\\uA188\\uA189\\uA18A\\uA18B\\uA18C\\uA18D\\uA18E\\uA18F\\uA190\\uA191\\uA192\\uA193\\uA194\\uA195\\uA196\\uA197\\uA198\\uA199\\uA19A\\uA19B\\uA19C\\uA19D\\uA19E\\uA19F\\uA1A0\\uA1A1\\uA1A2\\uA1A3\\uA1A4\\uA1A5\\uA1A6\\uA1A7\\uA1A8\\uA1A9\\uA1AA\\uA1AB\\uA1AC\\uA1AD\\uA1AE\\uA1AF]", + peg$c259 = "Unicode letter number", + peg$c260 = /^[\u16EE\u16EF\u16F0\u2160\u2161\u2162\u2163\u2164\u2165\u2166\u2167\u2168\u2169\u216A\u216B\u216C\u216D\u216E\u216F\u2170\u2171\u2172\u2173\u2174\u2175\u2176\u2177\u2178\u2179\u217A\u217B\u217C\u217D\u217E\u217F\u2180\u2181\u2182\u2185\u2186\u2187\u2188\u3007\u3021\u3022\u3023\u3024\u3025\u3026\u3027\u3028\u3029\u3038\u3039\u303A]/, + peg$c261 = "[\\u16EE\\u16EF\\u16F0\\u2160\\u2161\\u2162\\u2163\\u2164\\u2165\\u2166\\u2167\\u2168\\u2169\\u216A\\u216B\\u216C\\u216D\\u216E\\u216F\\u2170\\u2171\\u2172\\u2173\\u2174\\u2175\\u2176\\u2177\\u2178\\u2179\\u217A\\u217B\\u217C\\u217D\\u217E\\u217F\\u2180\\u2181\\u2182\\u2185\\u2186\\u2187\\u2188\\u3007\\u3021\\u3022\\u3023\\u3024\\u3025\\u3026\\u3027\\u3028\\u3029\\u3038\\u3039\\u303A]", + peg$c262 = "Unicode separator, space", + peg$c263 = /^[ \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000]/, + peg$c264 = "[ \\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000]", + peg$c265 = function(c) { + return c; + }, + peg$c266 = function(seq) { + return seq; + }, + peg$c267 = "\n", + peg$c268 = "\"\\n\"", + peg$c269 = "\r", + peg$c270 = "\"\\r\"", + peg$c271 = "\u2028", + peg$c272 = "\"\\u2028\"", + peg$c273 = "\u2029", + peg$c274 = "\"\\u2029\"", + peg$c275 = "\r\n", + peg$c276 = "\"\\r\\n\"", + peg$c277 = function() { + return '0'; + }, + peg$c278 = /^['"\\bfnrtv]/, + peg$c279 = "['\"\\\\bfnrtv]", + peg$c280 = "x", + peg$c281 = "\"x\"", + peg$c282 = "any character", + peg$c283 = "whitespace", + peg$c284 = "empty", + peg$c285 = /^[\t\x0B\f \xA0\uFEFF]/, + peg$c286 = "[\\t\\x0B\\f \\xA0\\uFEFF]", + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function peg$computePosDetails(pos) { + function advance(details, pos) { + var p, ch; + + for (p = 0; p < pos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + peg$cachedPos = pos; + advance(peg$cachedPosDetails, peg$cachedPos); + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$cleanupExpected(expected) { + var i = 0; + + expected.sort(); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function peg$parseTypeExpression() { + var s0, s1, s2, s3, s4; + + s0 = peg$parseTypeUnionLegacySyntax(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseUnknownLiteral(); + if (s2 !== null) { + s3 = peg$currPos; + peg$silentFails++; + s4 = peg$parseBasicTypeExpression(); + peg$silentFails--; + if (s4 === null) { + s3 = peg$c1; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c2(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 63) { + s2 = peg$c3; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 33) { + s2 = peg$c5; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + } + if (s2 !== null) { + s3 = peg$parseBasicTypeExpressionNonRepeatable(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c7(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseBasicTypeExpression(); + if (s1 !== null) { + s2 = peg$parseOptional(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 63) { + s3 = peg$c3; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s3 === null) { + if (input.charCodeAt(peg$currPos) === 33) { + s3 = peg$c5; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + } + if (s3 !== null) { + s4 = peg$parseOptional(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c8(s1,s2,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseBasicTypeExpression(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 63) { + s2 = peg$c3; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 33) { + s2 = peg$c5; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + } + } + + return s0; + } + + function peg$parseBasicTypeExpression() { + var s0; + + s0 = peg$parseTypeUnion(); + if (s0 === null) { + s0 = peg$parseRestrictedTypeExpression(); + } + + return s0; + } + + function peg$parseRestrictedTypeExpression() { + var s0; + + s0 = peg$parseFunctionType(); + if (s0 === null) { + s0 = peg$parseRecordType(); + if (s0 === null) { + s0 = peg$parseLiteralType(); + if (s0 === null) { + s0 = peg$parseNameExpressionType(); + } + } + } + + return s0; + } + + function peg$parseBasicTypeExpressionNonRepeatable() { + var s0; + + s0 = peg$parseTypeUnionNonRepeatable(); + if (s0 === null) { + s0 = peg$parseRestrictedTypeExpressionNonRepeatable(); + } + + return s0; + } + + function peg$parseRestrictedTypeExpressionNonRepeatable() { + var s0; + + s0 = peg$parseFunctionTypeNonRepeatable(); + if (s0 === null) { + s0 = peg$parseRecordTypeNonRepeatable(); + if (s0 === null) { + s0 = peg$parseLiteralTypeNonRepeatable(); + if (s0 === null) { + s0 = peg$parseNameExpressionTypeNonRepeatable(); + } + } + } + + return s0; + } + + function peg$parseModifiedRestrictedTypeExpression() { + var s0; + + s0 = peg$parseModifiedRestrictedTypeExpressionRepeatable(); + if (s0 === null) { + s0 = peg$parseModifiedRestrictedTypeExpressionNonRepeatable(); + } + + return s0; + } + + function peg$parseModifiedRestrictedTypeExpressionNonRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 63) { + s1 = peg$c3; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s1 === null) { + if (input.charCodeAt(peg$currPos) === 33) { + s1 = peg$c5; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + s2 = peg$parseRestrictedTypeExpressionNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c10(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseRestrictedTypeExpressionNonRepeatable(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 63) { + s2 = peg$c3; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 33) { + s2 = peg$c5; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c9(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseModifiedRestrictedTypeExpressionRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseModifiedRestrictedTypeExpressionNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c11(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseLiteralType() { + var s0; + + s0 = peg$parseLiteralTypeRepeatable(); + if (s0 === null) { + s0 = peg$parseLiteralTypeNonRepeatable(); + } + + return s0; + } + + function peg$parseLiteralTypeNonRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseLiteral(); + if (s1 !== null) { + s2 = peg$parseOptional(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c12(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseLiteralTypeRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseLiteralTypeNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c13(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseLiteral() { + var s0, s1; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 42) { + s1 = peg$c14; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c15); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c16(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$parseUnknownLiteral(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseNullLiteral(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c17(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseUndefinedLiteral(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c18(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + } + + return s0; + } + + function peg$parseRepeatable() { + var s0, s1; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 3) === peg$c19) { + s1 = peg$c19; + peg$currPos += 3; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c21(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseOptional() { + var s0, s1; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c22; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c24(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseNameExpressionType() { + var s0; + + s0 = peg$parseNameExpressionTypeRepeatable(); + if (s0 === null) { + s0 = peg$parseNameExpressionTypeNonRepeatable(); + } + + return s0; + } + + function peg$parseNameExpressionTypeNonRepeatable() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseNameExpression(); + if (s1 === null) { + s1 = peg$parseReservedWordNameExpressionTypeNonRepeatable(); + } + if (s1 !== null) { + s2 = []; + if (input.substr(peg$currPos, 2) === peg$c26) { + s3 = peg$c26; + peg$currPos += 2; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c27); } + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + if (input.substr(peg$currPos, 2) === peg$c26) { + s3 = peg$c26; + peg$currPos += 2; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c27); } + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c28(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseNameExpression(); + if (s1 !== null) { + s2 = peg$parseTypeApplication(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseOptional(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c29(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseReservedWordNameExpressionTypeNonRepeatable(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c30(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseNameExpressionTypeRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseNameExpressionTypeNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseReservedWordNameExpressionType() { + var s0; + + s0 = peg$parseReservedWordNameExpressionTypeRepeatable(); + if (s0 === null) { + s0 = peg$parseReservedWordNameExpressionTypeNonRepeatable(); + } + + return s0; + } + + function peg$parseReservedWordNameExpressionTypeNonRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseReservedWordNameExpression(); + if (s1 !== null) { + s2 = peg$parseOptional(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c32(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseReservedWordNameExpressionTypeRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseReservedWordNameExpressionTypeNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseTypeApplication() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c33; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c34); } + } + if (s1 === null) { + s1 = peg$c1; + } + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 60) { + s2 = peg$c35; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c36); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parseTypeExpressionList(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + if (input.charCodeAt(peg$currPos) === 62) { + s6 = peg$c37; + peg$currPos++; + } else { + s6 = null; + if (peg$silentFails === 0) { peg$fail(peg$c38); } + } + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c39(s1,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseTypeExpressionList() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseTypeExpression(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTypeExpression(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseTypeExpression(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c42(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFunctionType() { + var s0; + + s0 = peg$parseFunctionTypeRepeatable(); + if (s0 === null) { + s0 = peg$parseFunctionTypeNonRepeatable(); + } + + return s0; + } + + function peg$parseFunctionTypeNonRepeatable() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parseFunctionLiteral(); + if (s1 !== null) { + if (input.substr(peg$currPos, 2) === peg$c26) { + s2 = peg$c26; + peg$currPos += 2; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c27); } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c43(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseFunctionLiteral(); + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseNameExpression(); + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parseFunctionSignatureType(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + s5 = peg$parseOptional(); + if (s5 === null) { + s5 = peg$c1; + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c44(s4,s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseFunctionTypeRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseFunctionTypeNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFunctionSignatureType() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c45; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseFunctionSignature(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c47; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s5 !== null) { + s6 = peg$currPos; + s7 = peg$parse_(); + if (s7 !== null) { + if (input.charCodeAt(peg$currPos) === 58) { + s8 = peg$c49; + peg$currPos++; + } else { + s8 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s8 !== null) { + s9 = peg$parse_(); + if (s9 !== null) { + s10 = peg$parseTypeExpression(); + if (s10 !== null) { + s7 = [s7, s8, s9, s10]; + s6 = s7; + } else { + peg$currPos = s6; + s6 = peg$c0; + } + } else { + peg$currPos = s6; + s6 = peg$c0; + } + } else { + peg$currPos = s6; + s6 = peg$c0; + } + } else { + peg$currPos = s6; + s6 = peg$c0; + } + if (s6 === null) { + s6 = peg$c1; + } + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c51(s3,s6); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFunctionSignature() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseFunctionSignatureNew(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c40; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseFunctionSignatureThis(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseParametersType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c52(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseFunctionSignatureThis(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c40; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseFunctionSignatureNew(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseParametersType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c53(s1,s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseParametersType(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c54(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseFunctionSignatureNew() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 3) === peg$c55) { + s1 = peg$c55; + peg$currPos += 3; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 58) { + s3 = peg$c49; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parseTypeExpression(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFunctionSignatureThis() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 4) === peg$c58) { + s1 = peg$c58; + peg$currPos += 4; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 58) { + s3 = peg$c49; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + s5 = peg$parseTypeExpression(); + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c57(s5); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseParametersType() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parseRestParameterType(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c60(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseNonRestParametersType(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c40; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseRestParameterType(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c61(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + + return s0; + } + + function peg$parseNonRestParametersType() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseParameterType(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseParameterType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseParameterType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c62(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseOptionalParametersType(); + } + + return s0; + } + + function peg$parseOptionalParametersType() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseOptionalParameterType(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseOptionalParameterType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseOptionalParameterType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c63(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseParameterType() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseTypeExpression(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c64(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseOptionalParameterType() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseParameterType(); + if (s1 !== null) { + s2 = peg$parseOptional(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c65(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseRestParameterType() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 91) { + s2 = peg$c66; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c67); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parseParameterType(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + if (input.charCodeAt(peg$currPos) === 93) { + s6 = peg$c68; + peg$currPos++; + } else { + s6 = null; + if (peg$silentFails === 0) { peg$fail(peg$c69); } + } + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseParameterType(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c70(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 91) { + s3 = peg$c66; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c67); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c71(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + + return s0; + } + + function peg$parseTypeUnion() { + var s0; + + s0 = peg$parseTypeUnionRepeatable(); + if (s0 === null) { + s0 = peg$parseTypeUnionNonRepeatable(); + } + + return s0; + } + + function peg$parseTypeUnionNonRepeatable() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 40) { + s2 = peg$c45; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parseTypeUnionList(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + if (input.charCodeAt(peg$currPos) === 41) { + s6 = peg$c47; + peg$currPos++; + } else { + s6 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s6 !== null) { + s7 = peg$parseOptional(); + if (s7 === null) { + s7 = peg$c1; + } + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c72(s4,s7); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseTypeUnionRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseTypeUnionNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c73(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseTypeUnionList() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parseTypeExpression(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseTypeUnionSeparator(); + if (s4 !== null) { + s5 = peg$parseTypeExpression(); + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseTypeUnionSeparator(); + if (s4 !== null) { + s5 = peg$parseTypeExpression(); + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c74(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseRestrictedTypeUnionList() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parseModifiedRestrictedTypeExpression(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parseTypeUnionSeparator(); + if (s4 !== null) { + s5 = peg$parseModifiedRestrictedTypeExpression(); + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parseTypeUnionSeparator(); + if (s4 !== null) { + s5 = peg$parseModifiedRestrictedTypeExpression(); + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + } else { + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c75(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseTypeUnionLegacySyntax() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 40) { + s3 = peg$c45; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parseRestrictedTypeUnionList(); + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 41) { + s7 = peg$c47; + peg$currPos++; + } else { + s7 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + peg$silentFails--; + if (s7 === null) { + s6 = peg$c1; + } else { + peg$currPos = s6; + s6 = peg$c0; + } + if (s6 !== null) { + peg$reportedPos = s0; + s1 = peg$c76(s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseTypeUnionSeparator() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 124) { + s2 = peg$c77; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c78); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c79(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseRecordType() { + var s0; + + s0 = peg$parseRecordTypeRepeatable(); + if (s0 === null) { + s0 = peg$parseRecordTypeNonRepeatable(); + } + + return s0; + } + + function peg$parseRecordTypeNonRepeatable() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 123) { + s2 = peg$c80; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c81); } + } + if (s2 !== null) { + s3 = peg$parse_(); + if (s3 !== null) { + s4 = peg$parseFieldTypeList(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + if (input.charCodeAt(peg$currPos) === 125) { + s6 = peg$c82; + peg$currPos++; + } else { + s6 = null; + if (peg$silentFails === 0) { peg$fail(peg$c83); } + } + if (s6 !== null) { + s7 = peg$parseOptional(); + if (s7 === null) { + s7 = peg$c1; + } + if (s7 !== null) { + peg$reportedPos = s0; + s1 = peg$c84(s4,s7); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseRecordTypeRepeatable() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseRepeatable(); + if (s1 !== null) { + s2 = peg$parseRecordTypeNonRepeatable(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c31(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFieldTypeList() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parseFieldType(); + if (s1 !== null) { + s2 = []; + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseFieldType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + while (s3 !== null) { + s2.push(s3); + s3 = peg$currPos; + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c40; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c41); } + } + if (s5 !== null) { + s6 = peg$parse_(); + if (s6 !== null) { + s7 = peg$parseFieldType(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c85(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFieldType() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parseFieldName(); + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== null) { + if (input.charCodeAt(peg$currPos) === 58) { + s4 = peg$c49; + peg$currPos++; + } else { + s4 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s4 !== null) { + s5 = peg$parse_(); + if (s5 !== null) { + s6 = peg$parseTypeExpression(); + if (s6 !== null) { + s3 = [s3, s4, s5, s6]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c86(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFieldName() { + var s0, s1; + + s0 = peg$parseNameExpressionTypeNonRepeatable(); + if (s0 === null) { + s0 = peg$parseReservedWordNameExpressionTypeNonRepeatable(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseTypeExpression(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c87(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } + } + + return s0; + } + + function peg$parseNameExpression() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseDoubleStringLiteral(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c88(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseSingleStringLiteral(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c89(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseIdentifier(); + if (s1 !== null) { + s2 = peg$parsePropertyChain(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c90(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + + return s0; + } + + function peg$parseReservedWordNameExpression() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parseReservedWord(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c91(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parsePropertyIdentifier() { + var s0, s1; + + s0 = peg$parseIdentifier(); + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseDoubleStringLiteral(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c92(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseSingleStringLiteral(); + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c93(s1); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + if (s0 === null) { + s0 = peg$parseNumericLiteral(); + if (s0 === null) { + s0 = peg$parseKeyword(); + if (s0 === null) { + s0 = peg$parseFutureReservedWord(); + } + } + } + } + } + + return s0; + } + + function peg$parsePropertyChain() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsePropertyChainItem(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parsePropertyChainItem(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parsePropertyChainItem() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c33; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c34); } + } + if (s1 === null) { + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c94; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c95); } + } + if (s1 === null) { + if (input.charCodeAt(peg$currPos) === 126) { + s1 = peg$c96; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c97); } + } + if (s1 === null) { + if (input.charCodeAt(peg$currPos) === 58) { + s1 = peg$c49; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c50); } + } + if (s1 === null) { + if (input.charCodeAt(peg$currPos) === 47) { + s1 = peg$c98; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c99); } + } + } + } + } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 60) { + s3 = peg$c35; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c36); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s3 = peg$parsePropertyIdentifier(); + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c100(s1,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseNamespaceExpression() { + var s0; + + s0 = peg$parseNameExpression(); + if (s0 === null) { + s0 = peg$parseStringLiteral(); + } + + return s0; + } + + function peg$parseIdentifier() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseReservedWord(); + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseIdentifierName(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c101(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseIdentifierName() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseIdentifierStart(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseIdentifierPart(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseIdentifierPart(); + } + if (s3 !== null) { + s4 = peg$parseIdentifierEnd(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseIdentifierStart() { + var s0; + + s0 = peg$parseUnicodeLetter(); + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 36) { + s0 = peg$c102; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c103); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 95) { + s0 = peg$c104; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c105); } + } + if (s0 === null) { + s0 = peg$parseUnicodeEscapeSequenceLiteral(); + } + } + } + + return s0; + } + + function peg$parseIdentifierPart() { + var s0; + + s0 = peg$parseIdentifierStart(); + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 45) { + s0 = peg$c106; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c107); } + } + if (s0 === null) { + s0 = peg$parseUnicodeMc(); + if (s0 === null) { + s0 = peg$parseUnicodeNd(); + if (s0 === null) { + s0 = peg$parseUnicodePc(); + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 8204) { + s0 = peg$c108; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c109); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 8205) { + s0 = peg$c110; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c111); } + } + } + } + } + } + } + } + + return s0; + } + + function peg$parseIdentifierEnd() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c45; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = []; + s4 = peg$parseIdentifierPart(); + while (s4 !== null) { + s3.push(s4); + s4 = peg$parseIdentifierPart(); + } + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c47; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c112(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 40) { + s1 = peg$c45; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + if (s1 !== null) { + s2 = peg$parse_(); + if (s2 !== null) { + s3 = peg$parseParametersType(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parse_(); + if (s4 !== null) { + if (input.charCodeAt(peg$currPos) === 41) { + s5 = peg$c47; + peg$currPos++; + } else { + s5 = null; + if (peg$silentFails === 0) { peg$fail(peg$c48); } + } + if (s5 !== null) { + peg$reportedPos = s0; + s1 = peg$c113(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseIdentifierPart(); + } + } + + return s0; + } + + function peg$parseReservedWord() { + var s0; + + s0 = peg$parseKeyword(); + if (s0 === null) { + s0 = peg$parseFutureReservedWord(); + if (s0 === null) { + s0 = peg$parseNullLiteral(); + if (s0 === null) { + s0 = peg$parseBooleanLiteral(); + } + } + } + + return s0; + } + + function peg$parseKeyword() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c114) { + s2 = peg$c114; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c115); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 4) === peg$c116) { + s2 = peg$c116; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c117); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 5) === peg$c118) { + s2 = peg$c118; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c119); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 8) === peg$c120) { + s2 = peg$c120; + peg$currPos += 8; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c121); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 8) === peg$c122) { + s2 = peg$c122; + peg$currPos += 8; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c123); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 7) === peg$c124) { + s2 = peg$c124; + peg$currPos += 7; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c125); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c126) { + s2 = peg$c126; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c127); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 2) === peg$c128) { + s2 = peg$c128; + peg$currPos += 2; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c129); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 4) === peg$c130) { + s2 = peg$c130; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c131); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 7) === peg$c132) { + s2 = peg$c132; + peg$currPos += 7; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c133); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 3) === peg$c134) { + s2 = peg$c134; + peg$currPos += 3; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c135); } + } + if (s2 === null) { + s2 = peg$parseFunctionLiteralLc(); + if (s2 === null) { + if (input.substr(peg$currPos, 2) === peg$c136) { + s2 = peg$c136; + peg$currPos += 2; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c137); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 2) === peg$c138) { + s2 = peg$c138; + peg$currPos += 2; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c139); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 10) === peg$c140) { + s2 = peg$c140; + peg$currPos += 10; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c141); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 3) === peg$c55) { + s2 = peg$c55; + peg$currPos += 3; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c56); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c142) { + s2 = peg$c142; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c143); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c144) { + s2 = peg$c144; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c145); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 4) === peg$c58) { + s2 = peg$c58; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c59); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 5) === peg$c146) { + s2 = peg$c146; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c147); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 3) === peg$c148) { + s2 = peg$c148; + peg$currPos += 3; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c149); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c150) { + s2 = peg$c150; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c151); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 3) === peg$c152) { + s2 = peg$c152; + peg$currPos += 3; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c153); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 4) === peg$c154) { + s2 = peg$c154; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c155); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 5) === peg$c156) { + s2 = peg$c156; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c157); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 4) === peg$c158) { + s2 = peg$c158; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c159); } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseIdentifierPart(); + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c160(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseFutureReservedWord() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.substr(peg$currPos, 5) === peg$c161) { + s2 = peg$c161; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c162); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 5) === peg$c163) { + s2 = peg$c163; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c164); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 4) === peg$c165) { + s2 = peg$c165; + peg$currPos += 4; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c166); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c167) { + s2 = peg$c167; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c168); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 7) === peg$c169) { + s2 = peg$c169; + peg$currPos += 7; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c170); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c171) { + s2 = peg$c171; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c172); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 5) === peg$c173) { + s2 = peg$c173; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c174); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 10) === peg$c175) { + s2 = peg$c175; + peg$currPos += 10; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c176); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 9) === peg$c177) { + s2 = peg$c177; + peg$currPos += 9; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c178); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 3) === peg$c179) { + s2 = peg$c179; + peg$currPos += 3; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c180); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 7) === peg$c181) { + s2 = peg$c181; + peg$currPos += 7; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c182); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 7) === peg$c183) { + s2 = peg$c183; + peg$currPos += 7; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c184); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 9) === peg$c185) { + s2 = peg$c185; + peg$currPos += 9; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c186); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c187) { + s2 = peg$c187; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c188); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 6) === peg$c189) { + s2 = peg$c189; + peg$currPos += 6; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c190); } + } + if (s2 === null) { + if (input.substr(peg$currPos, 5) === peg$c191) { + s2 = peg$c191; + peg$currPos += 5; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c192); } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + if (s2 !== null) { + s2 = input.substring(s1, peg$currPos); + } + s1 = s2; + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseIdentifierPart(); + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c193(s1); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseStringLiteral() { + var s0; + + s0 = peg$parseDoubleStringLiteral(); + if (s0 === null) { + s0 = peg$parseSingleStringLiteral(); + } + + return s0; + } + + function peg$parseDoubleStringLiteral() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 34) { + s1 = peg$c194; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c195); } + } + if (s1 !== null) { + s2 = []; + s3 = peg$parseDoubleStringCharacter(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseDoubleStringCharacter(); + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 34) { + s3 = peg$c194; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c195); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c196(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseSingleStringLiteral() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 39) { + s1 = peg$c197; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c198); } + } + if (s1 !== null) { + s2 = []; + s3 = peg$parseSingleStringCharacter(); + while (s3 !== null) { + s2.push(s3); + s3 = peg$parseSingleStringCharacter(); + } + if (s2 !== null) { + if (input.charCodeAt(peg$currPos) === 39) { + s3 = peg$c197; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c198); } + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c196(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseNumericLiteral() { + var s0; + + s0 = peg$parseDecimalLiteral(); + if (s0 === null) { + s0 = peg$parseHexIntegerLiteral(); + } + + return s0; + } + + function peg$parseDecimalLiteral() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseDecimalIntegerLiteral(); + if (s1 !== null) { + if (input.charCodeAt(peg$currPos) === 46) { + s2 = peg$c33; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c34); } + } + if (s2 !== null) { + s3 = peg$parseDecimalDigits(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s4 = peg$parseExponentPart(); + if (s4 === null) { + s4 = peg$c1; + } + if (s4 !== null) { + peg$reportedPos = s0; + s1 = peg$c199(s1,s3,s4); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 46) { + s1 = peg$c33; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c34); } + } + if (s1 !== null) { + s2 = peg$parseDecimalDigits(); + if (s2 !== null) { + s3 = peg$parseExponentPart(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c200(s2,s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$parseDecimalIntegerLiteral(); + if (s1 !== null) { + s2 = peg$parseExponentPart(); + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c201(s1,s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } + } + + return s0; + } + + function peg$parseDecimalIntegerLiteral() { + var s0, s1, s2, s3; + + if (input.charCodeAt(peg$currPos) === 48) { + s0 = peg$c202; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c203); } + } + if (s0 === null) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseNonZeroDigit(); + if (s2 !== null) { + s3 = peg$parseDecimalDigits(); + if (s3 === null) { + s3 = peg$c1; + } + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + } + + return s0; + } + + function peg$parseDecimalDigits() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseDecimalDigit(); + if (s2 !== null) { + while (s2 !== null) { + s1.push(s2); + s2 = peg$parseDecimalDigit(); + } + } else { + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseExponentPart() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parseExponentIndicator(); + if (s2 !== null) { + s3 = peg$parseSignedInteger(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseExponentIndicator() { + var s0; + + if (peg$c204.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c205); } + } + + return s0; + } + + function peg$parseSignedInteger() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (peg$c206.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c207); } + } + if (s2 === null) { + s2 = peg$c1; + } + if (s2 !== null) { + s3 = peg$parseDecimalDigits(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseHexIntegerLiteral() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 48) { + s1 = peg$c202; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c203); } + } + if (s1 !== null) { + if (peg$c208.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c209); } + } + if (s2 !== null) { + s3 = peg$currPos; + s4 = []; + s5 = peg$parseHexDigit(); + if (s5 !== null) { + while (s5 !== null) { + s4.push(s5); + s5 = peg$parseHexDigit(); + } + } else { + s4 = peg$c0; + } + if (s4 !== null) { + s4 = input.substring(s3, peg$currPos); + } + s3 = s4; + if (s3 !== null) { + peg$reportedPos = s0; + s1 = peg$c210(s3); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseNullLiteral() { + var s0; + + if (input.substr(peg$currPos, 4) === peg$c211) { + s0 = peg$c211; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c212); } + } + + return s0; + } + + function peg$parseUndefinedLiteral() { + var s0; + + if (input.substr(peg$currPos, 9) === peg$c213) { + s0 = peg$c213; + peg$currPos += 9; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c214); } + } + + return s0; + } + + function peg$parseUnknownLiteral() { + var s0, s1; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 63) { + s1 = peg$c3; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s1 !== null) { + peg$reportedPos = s0; + s1 = peg$c215(); + } + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + + return s0; + } + + function peg$parseBooleanLiteral() { + var s0; + + if (input.substr(peg$currPos, 4) === peg$c216) { + s0 = peg$c216; + peg$currPos += 4; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c217); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 5) === peg$c218) { + s0 = peg$c218; + peg$currPos += 5; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c219); } + } + } + + return s0; + } + + function peg$parseFunctionLiteral() { + var s0; + + s0 = peg$parseFunctionLiteralUc(); + if (s0 === null) { + s0 = peg$parseFunctionLiteralLc(); + } + + return s0; + } + + function peg$parseFunctionLiteralUc() { + var s0; + + if (input.substr(peg$currPos, 8) === peg$c220) { + s0 = peg$c220; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c221); } + } + + return s0; + } + + function peg$parseFunctionLiteralLc() { + var s0; + + if (input.substr(peg$currPos, 8) === peg$c222) { + s0 = peg$c222; + peg$currPos += 8; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c223); } + } + + return s0; + } + + function peg$parseUnicodeLetter() { + var s0; + + s0 = peg$parseUnicodeLu(); + if (s0 === null) { + s0 = peg$parseUnicodeLl(); + if (s0 === null) { + s0 = peg$parseUnicodeLt(); + if (s0 === null) { + s0 = peg$parseUnicodeLm(); + if (s0 === null) { + s0 = peg$parseUnicodeLo(); + if (s0 === null) { + s0 = peg$parseUnicodeLn(); + } + } + } + } + } + + return s0; + } + + function peg$parseUnicodeEscapeSequenceLiteral() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s2 = peg$c224; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s2 !== null) { + s3 = peg$parseUnicodeEscapeSequence(); + if (s3 !== null) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s1 = input.substring(s0, peg$currPos); + } + s0 = s1; + + return s0; + } + + function peg$parseUnicodeEscapeSequence() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 117) { + s1 = peg$c226; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c227); } + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$currPos; + s4 = peg$parseHexDigit(); + if (s4 !== null) { + s5 = peg$parseHexDigit(); + if (s5 !== null) { + s6 = peg$parseHexDigit(); + if (s6 !== null) { + s7 = peg$parseHexDigit(); + if (s7 !== null) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c228(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseDecimalDigit() { + var s0; + + if (peg$c229.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c230); } + } + + return s0; + } + + function peg$parseNonZeroDigit() { + var s0; + + if (peg$c231.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c232); } + } + + return s0; + } + + function peg$parseHexDigit() { + var s0; + + if (peg$c233.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c234); } + } + + return s0; + } + + function peg$parseUnicodeMc() { + var s0, s1; + + peg$silentFails++; + if (peg$c236.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c237); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c235); } + } + + return s0; + } + + function peg$parseUnicodeNd() { + var s0, s1; + + peg$silentFails++; + if (peg$c239.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c240); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c238); } + } + + return s0; + } + + function peg$parseUnicodePc() { + var s0, s1; + + peg$silentFails++; + if (peg$c242.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c243); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c241); } + } + + return s0; + } + + function peg$parseUnicodeLu() { + var s0, s1; + + peg$silentFails++; + if (peg$c245.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c246); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c244); } + } + + return s0; + } + + function peg$parseUnicodeLl() { + var s0, s1; + + peg$silentFails++; + if (peg$c248.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c249); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c247); } + } + + return s0; + } + + function peg$parseUnicodeLt() { + var s0, s1; + + peg$silentFails++; + if (peg$c251.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c252); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c250); } + } + + return s0; + } + + function peg$parseUnicodeLm() { + var s0, s1; + + peg$silentFails++; + if (peg$c254.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c255); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c253); } + } + + return s0; + } + + function peg$parseUnicodeLo() { + var s0, s1; + + peg$silentFails++; + if (peg$c257.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c258); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c256); } + } + + return s0; + } + + function peg$parseUnicodeLn() { + var s0, s1; + + peg$silentFails++; + if (peg$c260.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c261); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c259); } + } + + return s0; + } + + function peg$parseUnicodeZs() { + var s0, s1; + + peg$silentFails++; + if (peg$c263.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c264); } + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c262); } + } + + return s0; + } + + function peg$parseDoubleStringCharacter() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 34) { + s2 = peg$c194; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c195); } + } + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 92) { + s2 = peg$c224; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s2 === null) { + s2 = peg$parseLineTerminator(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseSourceCharacter(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c265(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s1 = peg$c224; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s1 !== null) { + s2 = peg$parseEscapeSequence(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c266(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseLineContinuation(); + } + } + + return s0; + } + + function peg$parseSingleStringCharacter() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 39) { + s2 = peg$c197; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c198); } + } + if (s2 === null) { + if (input.charCodeAt(peg$currPos) === 92) { + s2 = peg$c224; + peg$currPos++; + } else { + s2 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s2 === null) { + s2 = peg$parseLineTerminator(); + } + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseSourceCharacter(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c265(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s1 = peg$c224; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s1 !== null) { + s2 = peg$parseEscapeSequence(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c266(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseLineContinuation(); + } + } + + return s0; + } + + function peg$parseLineTerminatorSequence() { + var s0, s1, s2, s3; + + if (input.charCodeAt(peg$currPos) === 10) { + s0 = peg$c267; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c268); } + } + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 13) { + s1 = peg$c269; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c270); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + if (input.charCodeAt(peg$currPos) === 10) { + s3 = peg$c267; + peg$currPos++; + } else { + s3 = null; + if (peg$silentFails === 0) { peg$fail(peg$c268); } + } + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 8232) { + s0 = peg$c271; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c272); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 8233) { + s0 = peg$c273; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c274); } + } + if (s0 === null) { + if (input.substr(peg$currPos, 2) === peg$c275) { + s0 = peg$c275; + peg$currPos += 2; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c276); } + } + } + } + } + } + + return s0; + } + + function peg$parseLineTerminator() { + var s0; + + if (input.charCodeAt(peg$currPos) === 10) { + s0 = peg$c267; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c268); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 13) { + s0 = peg$c269; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c270); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 8232) { + s0 = peg$c271; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c272); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 8233) { + s0 = peg$c273; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c274); } + } + } + } + } + + return s0; + } + + function peg$parseEscapeSequence() { + var s0, s1, s2, s3; + + s0 = peg$parseCharacterEscapeSequence(); + if (s0 === null) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 48) { + s1 = peg$c202; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c203); } + } + if (s1 !== null) { + s2 = peg$currPos; + peg$silentFails++; + s3 = peg$parseDecimalDigit(); + peg$silentFails--; + if (s3 === null) { + s2 = peg$c1; + } else { + peg$currPos = s2; + s2 = peg$c0; + } + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c277(); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + if (s0 === null) { + s0 = peg$parseHexEscapeSequence(); + if (s0 === null) { + s0 = peg$parseUnicodeEscapeSequence(); + } + } + } + + return s0; + } + + function peg$parseCharacterEscapeSequence() { + var s0; + + s0 = peg$parseSingleEscapeCharacter(); + if (s0 === null) { + s0 = peg$parseNonEscapeCharacter(); + } + + return s0; + } + + function peg$parseSingleEscapeCharacter() { + var s0; + + if (peg$c278.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c279); } + } + + return s0; + } + + function peg$parseNonEscapeCharacter() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$currPos; + peg$silentFails++; + s2 = peg$parseEscapeCharacter(); + if (s2 === null) { + s2 = peg$parseLineTerminator(); + } + peg$silentFails--; + if (s2 === null) { + s1 = peg$c1; + } else { + peg$currPos = s1; + s1 = peg$c0; + } + if (s1 !== null) { + s2 = peg$parseSourceCharacter(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c265(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseEscapeCharacter() { + var s0; + + s0 = peg$parseSingleEscapeCharacter(); + if (s0 === null) { + s0 = peg$parseDecimalDigit(); + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 120) { + s0 = peg$c280; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c281); } + } + if (s0 === null) { + if (input.charCodeAt(peg$currPos) === 117) { + s0 = peg$c226; + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c227); } + } + } + } + } + + return s0; + } + + function peg$parseSourceCharacter() { + var s0; + + if (input.length > peg$currPos) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c282); } + } + + return s0; + } + + function peg$parseHexEscapeSequence() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 120) { + s1 = peg$c280; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c281); } + } + if (s1 !== null) { + s2 = peg$currPos; + s3 = peg$currPos; + s4 = peg$parseHexDigit(); + if (s4 !== null) { + s5 = peg$parseHexDigit(); + if (s5 !== null) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c0; + } + } else { + peg$currPos = s3; + s3 = peg$c0; + } + if (s3 !== null) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c228(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parseLineContinuation() { + var s0, s1, s2; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 92) { + s1 = peg$c224; + peg$currPos++; + } else { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c225); } + } + if (s1 !== null) { + s2 = peg$parseLineTerminatorSequence(); + if (s2 !== null) { + peg$reportedPos = s0; + s1 = peg$c266(s2); + if (s1 === null) { + peg$currPos = s0; + s0 = s1; + } else { + s0 = s1; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + } else { + peg$currPos = s0; + s0 = peg$c0; + } + + return s0; + } + + function peg$parse_() { + var s0, s1; + + peg$silentFails++; + s0 = []; + s1 = peg$parseWhitespace(); + while (s1 !== null) { + s0.push(s1); + s1 = peg$parseWhitespace(); + } + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c283); } + } + + return s0; + } + + function peg$parse__() { + var s0, s1; + + peg$silentFails++; + s0 = peg$c1; + peg$silentFails--; + if (s0 === null) { + s1 = null; + if (peg$silentFails === 0) { peg$fail(peg$c284); } + } + + return s0; + } + + function peg$parseWhitespace() { + var s0; + + if (peg$c285.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = null; + if (peg$silentFails === 0) { peg$fail(peg$c286); } + } + if (s0 === null) { + s0 = peg$parseUnicodeZs(); + } + + return s0; + } + + + var Types = require('./types'); + + function optional(obj) { + obj.optional = true; + return obj; + } + + function repeatable(obj) { + obj.repeatable = true; + return obj; + } + + function nullable(obj, modifier) { + if (modifier) { + obj.nullable = (modifier === '?' ? true : false); + } + + return obj; + } + + + peg$result = peg$startRuleFunction(); + + if (peg$result !== null && peg$currPos === input.length) { + return peg$result; + } else { + peg$cleanupExpected(peg$maxFailExpected); + peg$reportedPos = Math.max(peg$currPos, peg$maxFailPos); + + throw new SyntaxError( + peg$maxFailExpected, + peg$reportedPos < input.length ? input.charAt(peg$reportedPos) : null, + peg$reportedPos, + peg$computePosDetails(peg$reportedPos).line, + peg$computePosDetails(peg$reportedPos).column + ); + } + } + + return { + SyntaxError: SyntaxError, + parse : parse + }; +})(); diff --git a/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/LICENSE b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/LICENSE new file mode 100644 index 0000000..0d6b873 --- /dev/null +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative +Reporters & Editors + +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/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/README.md b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/README.md new file mode 100644 index 0000000..c2ba259 --- /dev/null +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/README.md @@ -0,0 +1,22 @@ + __ + /\ \ __ + __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ + /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ + \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ + \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ + \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ + \ \____/ + \/___/ + +Underscore.js is a utility-belt library for JavaScript that provides +support for the usual functional suspects (each, map, reduce, filter...) +without extending any core JavaScript objects. + +For Docs, License, Tests, and pre-packed downloads, see: +http://underscorejs.org + +Underscore is an open-sourced component of DocumentCloud: +https://github.com/documentcloud + +Many thanks to our contributors: +https://github.com/jashkenas/underscore/contributors diff --git a/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/package.json b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/package.json new file mode 100644 index 0000000..7b38533 --- /dev/null +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/package.json @@ -0,0 +1,50 @@ +{ + "name": "underscore", + "description": "JavaScript's functional programming helper library.", + "homepage": "http://underscorejs.org", + "keywords": [ + "util", + "functional", + "server", + "client", + "browser" + ], + "author": { + "name": "Jeremy Ashkenas", + "email": "jeremy@documentcloud.org" + }, + "repository": { + "type": "git", + "url": "git://github.com/jashkenas/underscore.git" + }, + "main": "underscore.js", + "version": "1.6.0", + "devDependencies": { + "docco": "0.6.x", + "phantomjs": "1.9.0-1", + "uglify-js": "2.4.x" + }, + "scripts": { + "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true", + "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js", + "doc": "docco underscore.js" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/jashkenas/underscore/master/LICENSE" + } + ], + "files": [ + "underscore.js", + "underscore-min.js", + "LICENSE" + ], + "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nUnderscore is an open-sourced component of DocumentCloud:\nhttps://github.com/documentcloud\n\nMany thanks to our contributors:\nhttps://github.com/jashkenas/underscore/contributors\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/jashkenas/underscore/issues" + }, + "_id": "underscore@1.6.0", + "_from": "underscore@1.6.0" +} diff --git a/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore-min.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore-min.js new file mode 100644 index 0000000..3434d6c --- /dev/null +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore-min.js @@ -0,0 +1,6 @@ +// Underscore.js 1.6.0 +// http://underscorejs.org +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. +(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.6.0";var A=j.each=j.forEach=function(n,t,e){if(null==n)return n;if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return;return n};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var O="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},j.find=j.detect=function(n,t,r){var e;return k(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var k=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:k(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,j.property(t))},j.where=function(n,t){return j.filter(n,j.matches(t))},j.findWhere=function(n,t){return j.find(n,j.matches(t))},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var e=-1/0,u=-1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;o>u&&(e=n,u=o)}),e},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var e=1/0,u=1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;u>o&&(e=n,u=o)}),e},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=j.values(n)),n[j.random(n.length-1)]):j.shuffle(n).slice(0,Math.max(0,t))};var E=function(n){return null==n?j.identity:j.isFunction(n)?n:j.property(n)};j.sortBy=function(n,t,r){return t=E(t),j.pluck(j.map(n,function(n,e,u){return{value:n,index:e,criteria:t.call(r,n,e,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=E(r),A(t,function(i,a){var o=r.call(e,i,a,t);n(u,o,i)}),u}};j.groupBy=F(function(n,t,r){j.has(n,t)?n[t].push(r):n[t]=[r]}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=E(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])t?[]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.partition=function(n,t){var r=[],e=[];return A(n,function(n){(t(n)?r:e).push(n)}),[r,e]},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.contains(t,n)})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===j&&(e[u]=arguments[r++]);for(;r=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u),e=u=null):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o,c=function(){var l=j.now()-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u),i=u=null))};return function(){i=this,u=arguments,a=j.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u),i=u=null),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return j.partial(t,n)},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=function(n){if(!j.isObject(n))return[];if(w)return w(n);var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.constant=function(n){return function(){return n}},j.property=function(n){return function(t){return t[n]}},j.matches=function(n){return function(t){if(t===n)return!0;for(var r in n)if(n[r]!==t[r])return!1;return!0}},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},j.now=Date.now||function(){return(new Date).getTime()};var T={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};T.unescape=j.invert(T.escape);var I={escape:new RegExp("["+j.keys(T.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(T.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(I[n],function(t){return T[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return j})}).call(this); +//# sourceMappingURL=underscore-min.map \ No newline at end of file diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/underscore.js b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore.js similarity index 72% rename from node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/underscore.js rename to node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore.js index 65b59c0..9a4cabe 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/underscore.js +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/node_modules/underscore/underscore.js @@ -1,6 +1,6 @@ -// Underscore.js 1.4.2 +// Underscore.js 1.6.0 // http://underscorejs.org -// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. (function() { @@ -8,7 +8,7 @@ // Baseline setup // -------------- - // Establish the root object, `window` in the browser, or `global` on the server. + // Establish the root object, `window` in the browser, or `exports` on the server. var root = this; // Save the previous value of the `_` variable. @@ -21,12 +21,12 @@ var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - unshift = ArrayProto.unshift, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; + var + push = ArrayProto.push, + slice = ArrayProto.slice, + concat = ArrayProto.concat, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; // All **ECMAScript 5** native function implementations that we hope to use // are declared here. @@ -61,11 +61,11 @@ } exports._ = _; } else { - root['_'] = _; + root._ = _; } // Current version. - _.VERSION = '1.4.2'; + _.VERSION = '1.6.0'; // Collection Functions // -------------------- @@ -74,20 +74,20 @@ // Handles objects with the built-in `forEach`, arrays, and raw objects. // Delegates to **ECMAScript 5**'s native `forEach` if available. var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; + if (obj == null) return obj; if (nativeForEach && obj.forEach === nativeForEach) { obj.forEach(iterator, context); } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { + for (var i = 0, length = obj.length; i < length; i++) { if (iterator.call(context, obj[i], i, obj) === breaker) return; } } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; } } + return obj; }; // Return the results of applying the iterator to each element. @@ -97,11 +97,13 @@ if (obj == null) return results; if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); + results.push(iterator.call(context, value, index, list)); }); return results; }; + var reduceError = 'Reduce of empty array with no initial value'; + // **Reduce** builds up a single result from a list of values, aka `inject`, // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { @@ -119,7 +121,7 @@ memo = iterator.call(context, memo, value, index, list); } }); - if (!initial) throw new TypeError('Reduce of empty array with no initial value'); + if (!initial) throw new TypeError(reduceError); return memo; }; @@ -130,7 +132,7 @@ if (obj == null) obj = []; if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { if (context) iterator = _.bind(iterator, context); - return arguments.length > 2 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); + return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); } var length = obj.length; if (length !== +length) { @@ -146,15 +148,15 @@ memo = iterator.call(context, memo, obj[index], index, list); } }); - if (!initial) throw new TypeError('Reduce of empty array with no initial value'); + if (!initial) throw new TypeError(reduceError); return memo; }; // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { + _.find = _.detect = function(obj, predicate, context) { var result; any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { + if (predicate.call(context, value, index, list)) { result = value; return true; } @@ -165,33 +167,33 @@ // Return all the elements that pass a truth test. // Delegates to **ECMAScript 5**'s native `filter` if available. // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { + _.filter = _.select = function(obj, predicate, context) { var results = []; if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); + if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context); each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; + if (predicate.call(context, value, index, list)) results.push(value); }); return results; }; // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { + _.reject = function(obj, predicate, context) { return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); + return !predicate.call(context, value, index, list); }, context); }; // Determine whether all of the elements match a truth test. // Delegates to **ECMAScript 5**'s native `every` if available. // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); + _.every = _.all = function(obj, predicate, context) { + predicate || (predicate = _.identity); var result = true; if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); + if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context); each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; + if (!(result = result && predicate.call(context, value, index, list))) return breaker; }); return !!result; }; @@ -199,13 +201,13 @@ // Determine if at least one element in the object matches a truth test. // Delegates to **ECMAScript 5**'s native `some` if available. // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); + var any = _.some = _.any = function(obj, predicate, context) { + predicate || (predicate = _.identity); var result = false; if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); + if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context); each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; + if (result || (result = predicate.call(context, value, index, list))) return breaker; }); return !!result; }; @@ -213,54 +215,55 @@ // Determine if the array or object contains a given value (using `===`). // Aliased as `include`. _.contains = _.include = function(obj, target) { - var found = false; - if (obj == null) return found; + if (obj == null) return false; if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - found = any(obj, function(value) { + return any(obj, function(value) { return value === target; }); - return found; }; // Invoke a method (with arguments) on every item in a collection. _.invoke = function(obj, method) { var args = slice.call(arguments, 2); + var isFunc = _.isFunction(method); return _.map(obj, function(value) { - return (_.isFunction(method) ? method : value[method]).apply(value, args); + return (isFunc ? method : value[method]).apply(value, args); }); }; // Convenience version of a common use case of `map`: fetching a property. _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); + return _.map(obj, _.property(key)); }; // Convenience version of a common use case of `filter`: selecting only objects - // with specific `key:value` pairs. + // containing specific `key:value` pairs. _.where = function(obj, attrs) { - if (_.isEmpty(attrs)) return []; - return _.filter(obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); + return _.filter(obj, _.matches(attrs)); + }; + + // Convenience version of a common use case of `find`: getting the first object + // containing specific `key:value` pairs. + _.findWhere = function(obj, attrs) { + return _.find(obj, _.matches(attrs)); }; // Return the maximum element or (element-based computation). // Can't optimize arrays of integers longer than 65,535 elements. - // See: https://bugs.webkit.org/show_bug.cgi?id=80797 + // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797) _.max = function(obj, iterator, context) { if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { return Math.max.apply(Math, obj); } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity}; + var result = -Infinity, lastComputed = -Infinity; each(obj, function(value, index, list) { var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); + if (computed > lastComputed) { + result = value; + lastComputed = computed; + } }); - return result.value; + return result; }; // Return the minimum element (or element-based computation). @@ -268,16 +271,19 @@ if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { return Math.min.apply(Math, obj); } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity}; + var result = Infinity, lastComputed = Infinity; each(obj, function(value, index, list) { var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); + if (computed < lastComputed) { + result = value; + lastComputed = computed; + } }); - return result.value; + return result; }; - // Shuffle an array. + // Shuffle an array, using the modern version of the + // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). _.shuffle = function(obj) { var rand; var index = 0; @@ -290,19 +296,32 @@ return shuffled; }; + // Sample **n** random values from a collection. + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `map`. + _.sample = function(obj, n, guard) { + if (n == null || guard) { + if (obj.length !== +obj.length) obj = _.values(obj); + return obj[_.random(obj.length - 1)]; + } + return _.shuffle(obj).slice(0, Math.max(0, n)); + }; + // An internal function to generate lookup iterators. var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; + if (value == null) return _.identity; + if (_.isFunction(value)) return value; + return _.property(value); }; // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); + _.sortBy = function(obj, iterator, context) { + iterator = lookupIterator(iterator); return _.pluck(_.map(obj, function(value, index, list) { return { - value : value, - index : index, - criteria : iterator.call(context, value, index, list) + value: value, + index: index, + criteria: iterator.call(context, value, index, list) }; }).sort(function(left, right) { var a = left.criteria; @@ -311,43 +330,46 @@ if (a > b || a === void 0) return 1; if (a < b || b === void 0) return -1; } - return left.index < right.index ? -1 : 1; + return left.index - right.index; }), 'value'); }; // An internal function used for aggregate "group by" operations. - var group = function(obj, value, context, behavior) { - var result = {}; - var iterator = lookupIterator(value); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; + var group = function(behavior) { + return function(obj, iterator, context) { + var result = {}; + iterator = lookupIterator(iterator); + each(obj, function(value, index) { + var key = iterator.call(context, value, index, obj); + behavior(result, key, value); + }); + return result; + }; }; // Groups the object's values by a criterion. Pass either a string attribute // to group by, or a function that returns the criterion. - _.groupBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - }; + _.groupBy = group(function(result, key, value) { + _.has(result, key) ? result[key].push(value) : result[key] = [value]; + }); + + // Indexes the object's values by a criterion, similar to `groupBy`, but for + // when you know that your index values will be unique. + _.indexBy = group(function(result, key, value) { + result[key] = value; + }); // Counts instances of an object that group by a certain criterion. Pass // either a string attribute to count by, or a function that returns the // criterion. - _.countBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; + _.countBy = group(function(result, key) { + _.has(result, key) ? result[key]++ : result[key] = 1; + }); // Use a comparator function to figure out the smallest index at which // an object should be inserted so as to maintain order. Uses binary search. _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); + iterator = lookupIterator(iterator); var value = iterator.call(context, obj); var low = 0, high = array.length; while (low < high) { @@ -357,10 +379,11 @@ return low; }; - // Safely convert anything iterable into a real, live array. + // Safely create a real, live array from anything iterable. _.toArray = function(obj) { if (!obj) return []; - if (obj.length === +obj.length) return slice.call(obj); + if (_.isArray(obj)) return slice.call(obj); + if (obj.length === +obj.length) return _.map(obj, _.identity); return _.values(obj); }; @@ -378,7 +401,9 @@ // allows it to work with `_.map`. _.first = _.head = _.take = function(array, n, guard) { if (array == null) return void 0; - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; + if ((n == null) || guard) return array[0]; + if (n < 0) return []; + return slice.call(array, 0, n); }; // Returns everything but the last entry of the array. Especially useful on @@ -393,11 +418,8 @@ // values in the array. The **guard** check allows it to work with `_.map`. _.last = function(array, n, guard) { if (array == null) return void 0; - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } + if ((n == null) || guard) return array[array.length - 1]; + return slice.call(array, Math.max(array.length - n, 0)); }; // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. @@ -410,13 +432,16 @@ // Trim out all falsy values from an array. _.compact = function(array) { - return _.filter(array, function(value){ return !!value; }); + return _.filter(array, _.identity); }; // Internal implementation of a recursive `flatten` function. var flatten = function(input, shallow, output) { + if (shallow && _.every(input, _.isArray)) { + return concat.apply(output, input); + } each(input, function(value) { - if (_.isArray(value)) { + if (_.isArray(value) || _.isArguments(value)) { shallow ? push.apply(output, value) : flatten(value, shallow, output); } else { output.push(value); @@ -425,7 +450,7 @@ return output; }; - // Return a completely flattened version of an array. + // Flatten out an array, either recursively (by default), or just one level. _.flatten = function(array, shallow) { return flatten(array, shallow, []); }; @@ -435,10 +460,25 @@ return _.difference(array, slice.call(arguments, 1)); }; + // Split an array into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(array, predicate) { + var pass = [], fail = []; + each(array, function(elem) { + (predicate(elem) ? pass : fail).push(elem); + }); + return [pass, fail]; + }; + // Produce a duplicate-free version of the array. If the array has already // been sorted, you have the option of using a faster algorithm. // Aliased as `unique`. _.uniq = _.unique = function(array, isSorted, iterator, context) { + if (_.isFunction(isSorted)) { + context = iterator; + iterator = isSorted; + isSorted = false; + } var initial = iterator ? _.map(array, iterator, context) : array; var results = []; var seen = []; @@ -454,7 +494,7 @@ // Produce an array that contains the union: each distinct element from all of // the passed-in arrays. _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); + return _.uniq(_.flatten(arguments, true)); }; // Produce an array that contains every item shared between all the @@ -463,7 +503,7 @@ var rest = slice.call(arguments, 1); return _.filter(_.uniq(array), function(item) { return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; + return _.contains(other, item); }); }); }; @@ -478,11 +518,10 @@ // Zip together multiple lists into a single array -- elements that share // an index go together. _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); + var length = _.max(_.pluck(arguments, 'length').concat(0)); var results = new Array(length); for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); + results[i] = _.pluck(arguments, '' + i); } return results; }; @@ -493,7 +532,7 @@ _.object = function(list, values) { if (list == null) return {}; var result = {}; - for (var i = 0, l = list.length; i < l; i++) { + for (var i = 0, length = list.length; i < length; i++) { if (values) { result[list[i]] = values[i]; } else { @@ -511,17 +550,17 @@ // for **isSorted** to use binary search. _.indexOf = function(array, item, isSorted) { if (array == null) return -1; - var i = 0, l = array.length; + var i = 0, length = array.length; if (isSorted) { if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); + i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted); } else { i = _.sortedIndex(array, item); return array[i] === item ? i : -1; } } if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < l; i++) if (array[i] === item) return i; + for (; i < length; i++) if (array[i] === item) return i; return -1; }; @@ -547,11 +586,11 @@ } step = arguments[2] || 1; - var len = Math.max(Math.ceil((stop - start) / step), 0); + var length = Math.max(Math.ceil((stop - start) / step), 0); var idx = 0; - var range = new Array(len); + var range = new Array(length); - while(idx < len) { + while(idx < length) { range[idx++] = start; start += step; } @@ -566,29 +605,46 @@ var ctor = function(){}; // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Binding with arguments is also known as `curry`. - // Delegates to **ECMAScript 5**'s native `Function.bind` if available. - // We check for `func.bind` first, to fail fast when `func` is undefined. - _.bind = function bind(func, context) { - var bound, args; - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if + // available. + _.bind = function(func, context) { + var args, bound; + if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); if (!_.isFunction(func)) throw new TypeError; args = slice.call(arguments, 2); return bound = function() { if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); ctor.prototype = func.prototype; var self = new ctor; + ctor.prototype = null; var result = func.apply(self, args.concat(slice.call(arguments))); if (Object(result) === result) return result; return self; }; }; - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. + // Partially apply a function by creating a version that has had some of its + // arguments pre-filled, without changing its dynamic `this` context. _ acts + // as a placeholder, allowing any combination of arguments to be pre-filled. + _.partial = function(func) { + var boundArgs = slice.call(arguments, 1); + return function() { + var position = 0; + var args = boundArgs.slice(); + for (var i = 0, length = args.length; i < length; i++) { + if (args[i] === _) args[i] = arguments[position++]; + } + while (position < arguments.length) args.push(arguments[position++]); + return func.apply(this, args); + }; + }; + + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. _.bindAll = function(obj) { var funcs = slice.call(arguments, 1); - if (funcs.length == 0) funcs = _.functions(obj); + if (funcs.length === 0) throw new Error('bindAll must be passed function names'); each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); return obj; }; @@ -617,25 +673,34 @@ }; // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, result; + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. + _.throttle = function(func, wait, options) { + var context, args, result; + var timeout = null; var previous = 0; + options || (options = {}); var later = function() { - previous = new Date; + previous = options.leading === false ? 0 : _.now(); timeout = null; result = func.apply(context, args); + context = args = null; }; return function() { - var now = new Date; + var now = _.now(); + if (!previous && options.leading === false) previous = now; var remaining = wait - (now - previous); context = this; args = arguments; if (remaining <= 0) { clearTimeout(timeout); + timeout = null; previous = now; result = func.apply(context, args); - } else if (!timeout) { + context = args = null; + } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } return result; @@ -647,17 +712,34 @@ // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. _.debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { + var timeout, args, context, timestamp, result; + + var later = function() { + var last = _.now() - timestamp; + if (last < wait) { + timeout = setTimeout(later, wait - last); + } else { timeout = null; - if (!immediate) result = func.apply(context, args); - }; + if (!immediate) { + result = func.apply(context, args); + context = args = null; + } + } + }; + + return function() { + context = this; + args = arguments; + timestamp = _.now(); var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); + if (!timeout) { + timeout = setTimeout(later, wait); + } + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + return result; }; }; @@ -679,11 +761,7 @@ // allowing you to adjust arguments, run code before and after, and // conditionally execute the original function. _.wrap = function(func, wrapper) { - return function() { - var args = [func]; - push.apply(args, arguments); - return wrapper.apply(this, args); - }; + return _.partial(wrapper, func); }; // Returns a function that is the composition of a list of functions, each @@ -701,7 +779,6 @@ // Returns a function that will only be executed after being called N times. _.after = function(times, func) { - if (times <= 0) return func(); return function() { if (--times < 1) { return func.apply(this, arguments); @@ -714,31 +791,43 @@ // Retrieve the names of an object's properties. // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); + _.keys = function(obj) { + if (!_.isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; + for (var key in obj) if (_.has(obj, key)) keys.push(key); return keys; }; // Retrieve the values of an object's properties. _.values = function(obj) { - var values = []; - for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); + var keys = _.keys(obj); + var length = keys.length; + var values = new Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[keys[i]]; + } return values; }; // Convert an object into a list of `[key, value]` pairs. _.pairs = function(obj) { - var pairs = []; - for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); + var keys = _.keys(obj); + var length = keys.length; + var pairs = new Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [keys[i], obj[keys[i]]]; + } return pairs; }; // Invert the keys and values of an object. The values must be serializable. _.invert = function(obj) { var result = {}; - for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + result[obj[keys[i]]] = keys[i]; + } return result; }; @@ -755,8 +844,10 @@ // Extend a given object with all the properties in passed-in object(s). _.extend = function(obj) { each(slice.call(arguments, 1), function(source) { - for (var prop in source) { - obj[prop] = source[prop]; + if (source) { + for (var prop in source) { + obj[prop] = source[prop]; + } } }); return obj; @@ -785,8 +876,10 @@ // Fill in a given object with default properties. _.defaults = function(obj) { each(slice.call(arguments, 1), function(source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; + if (source) { + for (var prop in source) { + if (obj[prop] === void 0) obj[prop] = source[prop]; + } } }); return obj; @@ -809,7 +902,7 @@ // Internal recursive comparison function for `isEqual`. var eq = function(a, b, aStack, bStack) { // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). if (a === b) return a !== 0 || 1 / a == 1 / b; // A strict comparison is necessary because `null == undefined`. if (a == null || b == null) return a === b; @@ -851,6 +944,14 @@ // unique nested structures. if (aStack[length] == a) return bStack[length] == b; } + // Objects with different constructors are not equivalent, but `Object`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && + _.isFunction(bCtor) && (bCtor instanceof bCtor)) + && ('constructor' in a && 'constructor' in b)) { + return false; + } // Add the first object to the stack of traversed objects. aStack.push(a); bStack.push(b); @@ -867,13 +968,6 @@ } } } else { - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor))) { - return false; - } // Deep compare objects. for (var key in a) { if (_.has(a, key)) { @@ -951,7 +1045,7 @@ // Is a given object a finite number? _.isFinite = function(obj) { - return _.isNumber(obj) && isFinite(obj); + return isFinite(obj) && !isNaN(parseFloat(obj)); }; // Is the given value `NaN`? (NaN is the only number which does not equal itself). @@ -995,9 +1089,35 @@ return value; }; + _.constant = function(value) { + return function () { + return value; + }; + }; + + _.property = function(key) { + return function(obj) { + return obj[key]; + }; + }; + + // Returns a predicate for checking whether an object has a given set of `key:value` pairs. + _.matches = function(attrs) { + return function(obj) { + if (obj === attrs) return true; //avoid comparing an object to itself. + for (var key in attrs) { + if (attrs[key] !== obj[key]) + return false; + } + return true; + } + }; + // Run a function **n** times. _.times = function(n, iterator, context) { - for (var i = 0; i < n; i++) iterator.call(context, i); + var accum = Array(Math.max(0, n)); + for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); + return accum; }; // Return a random integer between min and max (inclusive). @@ -1006,9 +1126,12 @@ max = min; min = 0; } - return min + (0 | Math.random() * (max - min + 1)); + return min + Math.floor(Math.random() * (max - min + 1)); }; + // A (possibly faster) way to get the current timestamp as an integer. + _.now = Date.now || function() { return new Date().getTime(); }; + // List of HTML entities for escaping. var entityMap = { escape: { @@ -1016,8 +1139,7 @@ '<': '<', '>': '>', '"': '"', - "'": ''', - '/': '/' + "'": ''' } }; entityMap.unescape = _.invert(entityMap.escape); @@ -1038,17 +1160,17 @@ }; }); - // If the value of the named property is a function then invoke it; - // otherwise, return it. + // If the value of the named `property` is a function then invoke it with the + // `object` as context; otherwise, return it. _.result = function(object, property) { - if (object == null) return null; + if (object == null) return void 0; var value = object[property]; return _.isFunction(value) ? value.call(object) : value; }; // Add your own custom functions to the Underscore object. _.mixin = function(obj) { - each(_.functions(obj), function(name){ + each(_.functions(obj), function(name) { var func = _[name] = obj[name]; _.prototype[name] = function() { var args = [this._wrapped]; @@ -1062,7 +1184,7 @@ // Useful for temporary DOM ids. var idCounter = 0; _.uniqueId = function(prefix) { - var id = idCounter++; + var id = ++idCounter + ''; return prefix ? prefix + id : id; }; @@ -1097,6 +1219,7 @@ // Underscore templating handles arbitrary delimiters, preserves whitespace, // and correctly escapes quotes within interpolated code. _.template = function(text, data, settings) { + var render; settings = _.defaults({}, settings, _.templateSettings); // Combine delimiters into one regular expression via alternation. @@ -1112,11 +1235,18 @@ text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { source += text.slice(index, offset) .replace(escaper, function(match) { return '\\' + escapes[match]; }); - source += - escape ? "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'" : - interpolate ? "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'" : - evaluate ? "';\n" + evaluate + "\n__p+='" : ''; + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } + if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } + if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } index = offset + match.length; + return match; }); source += "';\n"; @@ -1128,7 +1258,7 @@ source + "return __p;\n"; try { - var render = new Function(settings.variable || 'obj', '_', source); + render = new Function(settings.variable || 'obj', '_', source); } catch (e) { e.source = source; throw e; @@ -1198,4 +1328,16 @@ }); + // AMD registration happens at the end for compatibility with AMD loaders + // that may not enforce next-turn semantics on modules. Even though general + // practice for AMD registration is to be anonymous, underscore registers + // as a named module because, like jQuery, it is a base library that is + // popular enough to be bundled in a third party lib, but not be part of + // an AMD load request. Those cases could generate an error when an + // anonymous define() is called outside of a loader request. + if (typeof define === 'function' && define.amd) { + define('underscore', [], function() { + return _; + }); + } }).call(this); diff --git a/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/package.json b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/package.json index 41c958f..bcb3485 100644 --- a/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/package.json +++ b/node_modules/jsdoc/node_modules/catharsis/node_modules/underscore-contrib/package.json @@ -39,7 +39,7 @@ "shasum": "665b66c24783f8fa2b18c9f8cbb0e2c7d48c26c7", "tarball": "http://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz" }, - "_from": "underscore-contrib@~0.3.0", + "_from": "underscore-contrib@>=0.3.0 <0.4.0", "_npmVersion": "1.3.21", "_npmUser": { "name": "joshuacc", diff --git a/node_modules/jsdoc/node_modules/catharsis/package.json b/node_modules/jsdoc/node_modules/catharsis/package.json index 807990d..bc07687 100644 --- a/node_modules/jsdoc/node_modules/catharsis/package.json +++ b/node_modules/jsdoc/node_modules/catharsis/package.json @@ -1,5 +1,5 @@ { - "version": "0.8.3", + "version": "0.8.6", "name": "catharsis", "description": "A JavaScript parser for Google Closure Compiler and JSDoc type expressions.", "author": { @@ -18,18 +18,16 @@ "underscore-contrib": "~0.3.0" }, "devDependencies": { - "mocha": "~1.21.3", + "mocha": "~2.0.1", "pegjs": "https://github.com/dmajda/pegjs/tarball/76cc5d55b47ff3d5bbe1d435c6f843e2688cb729", "should": "~4.0.4", - "tv4": "https://github.com/geraintluff/tv4/tarball/eb7561072d44943306e5fd88b55b4a4c98cb6c75", - "uglify-js": "~2.4.15" + "tv4": "https://github.com/geraintluff/tv4/tarball/eb7561072d44943306e5fd88b55b4a4c98cb6c75" }, "engines": { "node": ">= 0.8" }, "scripts": { - "build": "pegjs ./lib/parser.pegjs", - "prepublish": "pegjs ./lib/parser.pegjs; ./node_modules/.bin/uglifyjs ./lib/parser.js -o ./lib/parser.js", + "prepublish": "pegjs ./lib/parser.pegjs", "test": "mocha" }, "licenses": [ @@ -38,11 +36,11 @@ "url": "http://github.com/hegemonic/catharsis/raw/master/LICENSE" } ], - "gitHead": "8795105b00acf02d0af464ad3432f47b53744934", + "gitHead": "44b6dc62df82a60ccd11eefe6b68cd9a6c8cbf4f", "homepage": "https://github.com/hegemonic/catharsis", - "_id": "catharsis@0.8.3", - "_shasum": "573ad3d285dcfc373221712bd382edda61b3a5d5", - "_from": "catharsis@~0.8.2", + "_id": "catharsis@0.8.6", + "_shasum": "5ca786ca4efe5ff4eb063c1db7ff84b7b309a55e", + "_from": "catharsis@>=0.8.6 <0.9.0", "_npmVersion": "1.4.28", "_npmUser": { "name": "hegemonic", @@ -55,10 +53,10 @@ } ], "dist": { - "shasum": "573ad3d285dcfc373221712bd382edda61b3a5d5", - "tarball": "http://registry.npmjs.org/catharsis/-/catharsis-0.8.3.tgz" + "shasum": "5ca786ca4efe5ff4eb063c1db7ff84b7b309a55e", + "tarball": "http://registry.npmjs.org/catharsis/-/catharsis-0.8.6.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.3.tgz", + "_resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.6.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/catharsis/res/en.json b/node_modules/jsdoc/node_modules/catharsis/res/en.json index 9afb501..77c160b 100644 --- a/node_modules/jsdoc/node_modules/catharsis/res/en.json +++ b/node_modules/jsdoc/node_modules/catharsis/res/en.json @@ -87,5 +87,5 @@ "many": "or <%= element %>) <%= suffix %>" } }, - "unknown": "unknown type" + "unknown": "unknown" } diff --git a/node_modules/jsdoc/node_modules/escape-string-regexp/index.js b/node_modules/jsdoc/node_modules/escape-string-regexp/index.js new file mode 100644 index 0000000..ac6572c --- /dev/null +++ b/node_modules/jsdoc/node_modules/escape-string-regexp/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return str.replace(matchOperatorsRe, '\\$&'); +}; diff --git a/node_modules/jsdoc/node_modules/escape-string-regexp/package.json b/node_modules/jsdoc/node_modules/escape-string-regexp/package.json new file mode 100644 index 0000000..ce28d77 --- /dev/null +++ b/node_modules/jsdoc/node_modules/escape-string-regexp/package.json @@ -0,0 +1,69 @@ +{ + "name": "escape-string-regexp", + "version": "1.0.2", + "description": "Escape RegExp special characters", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/escape-string-regexp" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.8.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "regex", + "regexp", + "re", + "regular", + "expression", + "escape", + "string", + "str", + "special", + "characters" + ], + "devDependencies": { + "mocha": "*" + }, + "gitHead": "0587ee0ee03ea3fcbfa3c15cf67b47f214e20987", + "bugs": { + "url": "https://github.com/sindresorhus/escape-string-regexp/issues" + }, + "homepage": "https://github.com/sindresorhus/escape-string-regexp", + "_id": "escape-string-regexp@1.0.2", + "_shasum": "4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1", + "_from": "escape-string-regexp@>=1.0.2 <1.1.0", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "dist": { + "shasum": "4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1", + "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/jsdoc/node_modules/escape-string-regexp/readme.md b/node_modules/jsdoc/node_modules/escape-string-regexp/readme.md new file mode 100644 index 0000000..808a963 --- /dev/null +++ b/node_modules/jsdoc/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,27 @@ +# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) + +> Escape RegExp special characters + + +## Install + +```sh +$ npm install --save escape-string-regexp +``` + + +## Usage + +```js +var escapeStringRegexp = require('escape-string-regexp'); + +var escapedString = escapeStringRegexp('how much $ for a unicorn?'); +//=> how much \$ for a unicorn\? + +new RegExp(escapedString); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/jsdoc/node_modules/esprima/package.json b/node_modules/jsdoc/node_modules/esprima/package.json index c4c1b81..b0ecc18 100644 --- a/node_modules/jsdoc/node_modules/esprima/package.json +++ b/node_modules/jsdoc/node_modules/esprima/package.json @@ -55,7 +55,7 @@ "url": "https://github.com/ariya/esprima/issues" }, "_id": "esprima@1.1.0-dev-harmony", - "_shasum": "a03eaca83ec1125aa3d4acddd2636b4dd707db67", - "_from": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c", - "_resolved": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c" + "_shasum": "5a458471e55360128b8e538e9e76944534dc4bb3", + "_resolved": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c", + "_from": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c" } diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/.gitattributes b/node_modules/jsdoc/node_modules/js2xmlparser/.gitattributes deleted file mode 100644 index 412eeda..0000000 --- a/node_modules/jsdoc/node_modules/js2xmlparser/.gitattributes +++ /dev/null @@ -1,22 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp -*.sln merge=union -*.csproj merge=union -*.vbproj merge=union -*.fsproj merge=union -*.dbproj merge=union - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore b/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore index 64e78fe..d7803d3 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore +++ b/node_modules/jsdoc/node_modules/js2xmlparser/.npmignore @@ -1,166 +1,169 @@ -.idea/ -node_modules - -################# -## Eclipse -################# - -*.pydevproject -.project -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.classpath -.settings/ -.loadpath - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# CDT-specific -.cproject - -# PDT-specific -.buildpath - - -################# -## Visual Studio -################# - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates - -# Build results -[Dd]ebug/ -[Rr]elease/ -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.vspscc -.builds -*.dotCover - -## TODO: If you have NuGet Package Restore enabled, uncomment this -#packages/ - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf - -# Visual Studio profiler -*.psess -*.vsp - -# ReSharper is a .NET coding add-in -_ReSharper* - -# Installshield output folder -[Ee]xpress - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish - -# Others -[Bb]in -[Oo]bj -sql -TestResults -*.Cache -ClientBin -stylecop.* -~$* -*.dbmdl -Generated_Code #added for RIA/Silverlight projects - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML - - - -############ -## Windows -############ - -# Windows image file caches -Thumbs.db - -# Folder config file -Desktop.ini - - -############# -## Python -############# - -*.py[co] - -# Packages -*.egg -*.egg-info -dist -build -eggs -parts -bin -var -sdist -develop-eggs -.installed.cfg - -# Installer logs -pip-log.txt - -# Unit test / coverage reports -.coverage -.tox - -#Translations -*.mo - -#Mr Developer -.mr.developer.cfg - -# Mac crap -.DS_Store +.idea/ +node_modules + +# already tracked, but should be added to generated .npmignore +.gitattributes + +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.vspscc +.builds +*.dotCover + +## TODO: If you have NuGet Package Restore enabled, uncomment this +#packages/ + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp + +# ReSharper is a .NET coding add-in +_ReSharper* + +# Installshield output folder +[Ee]xpress + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish + +# Others +[Bb]in +[Oo]bj +sql +TestResults +*.Cache +ClientBin +stylecop.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML + + + +############ +## Windows +############ + +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +# Mac crap +.DS_Store diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/CHANGES.md b/node_modules/jsdoc/node_modules/js2xmlparser/CHANGES.md index 0d94d68..01e9e62 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/CHANGES.md +++ b/node_modules/jsdoc/node_modules/js2xmlparser/CHANGES.md @@ -1,35 +1,46 @@ -## 0.1.5 ## - -* Bug fixes -* Minor changes to examples - -## 0.1.4 ## - -* Removed callFunctions option (functionality already provided by convertMap option) -* Removed wrapArray option (functionality already provided by existing array functionality) -* Escape numbers when at tbe beginning of an element name -* Edits to documentation -* Added tests -* Added copyright headers to individual JS files - -## 0.1.3 ## - -* Fixed crash when undefined objects are converted to strings -* Added callFunctions option -* Added wrapArray option -* Added useCDATA option -* Added convertMap option -* Added copyright year and "and other contributors" to license - -## 0.1.2 ## - -* Fixed crash when null objects are converted to strings - -## 0.1.1 ## - -* Fixed accidental truncation of XML when pretty-printing is disabled -* Removed copyright year from license - -## 0.1.0 ## - -* Initial release +## 0.1.7 ## + +* Added .gitattributes to .gitignore file +* Minor tweaks to examples + +## 0.1.6 ## + +* Addition of alias string option +* Minor changes to examples +* Minor fixes to tests + +## 0.1.5 ## + +* Bug fixes +* Minor changes to examples + +## 0.1.4 ## + +* Removed callFunctions option (functionality already provided by convertMap option) +* Removed wrapArray option (functionality already provided by existing array functionality) +* Escape numbers when at tbe beginning of an element name +* Edits to documentation +* Added tests +* Added copyright headers to individual JS files + +## 0.1.3 ## + +* Fixed crash when undefined objects are converted to strings +* Added callFunctions option +* Added wrapArray option +* Added useCDATA option +* Added convertMap option +* Added copyright year and "and other contributors" to license + +## 0.1.2 ## + +* Fixed crash when null objects are converted to strings + +## 0.1.1 ## + +* Fixed accidental truncation of XML when pretty-printing is disabled +* Removed copyright year from license + +## 0.1.0 ## + +* Initial release diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md b/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md index 1b76d2f..3194743 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md +++ b/node_modules/jsdoc/node_modules/js2xmlparser/LICENSE.md @@ -1,16 +1,16 @@ -js2xmlparser is licensed under the MIT license: - -> Copyright © 2012 Michael Kourlas and other contributors -> -> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -> documentation files (the "Software"), to deal in the Software without restriction, including without limitation the -> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit -> persons to whom the Software is furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the -> Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -> WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +js2xmlparser is licensed under the MIT license: + +> Copyright © 2012 Michael Kourlas and other contributors +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +> documentation files (the "Software"), to deal in the Software without restriction, including without limitation the +> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +> persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +> Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +> WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR > OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/README.md b/node_modules/jsdoc/node_modules/js2xmlparser/README.md index 01f89dd..156b000 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/README.md +++ b/node_modules/jsdoc/node_modules/js2xmlparser/README.md @@ -1,196 +1,243 @@ -# js2xmlparser # - -## Overview ## - -js2xmlparser is a Node.js module that parses JavaScript objects into XML. - -## Features ## - -Since XML is a data-interchange format, js2xmlparser is designed primarily for JSON-type objects, arrays and primitive -data types, like many of the other JavaScript to XML parsers currently available for Node.js. - -However, js2xmlparser is capable of parsing any object, including native JavaScript objects such as Date and RegExp, by -taking advantage of each object's toString function. Functions are a special case where the return value of the function -itself is used instead of the toString function, if available. - -js2xmlparser also supports a number of constructs unique to XML: - -* attributes (through a unique attribute property in objects) -* mixed content (through a unique value property in objects) -* multiple elements with the same name (through arrays) - -js2xmlparser can also pretty-print the XML it outputs with the option of customizing the indent string. - -## Installation ## - -The easiest way to install js2xmlparser is to use npm: `npm install js2xmlparser`. - -Alternatively, you may download the source from GitHub and copy it to a folder named "js2xmlparser" within your -"node_modules" directory. - -## Usage ## - -The js2xmlparser module contains one function which takes the following arguments: - -* `root` - the XML root element's name (string, mandatory) -* `data` - the data to be converted to XML; while the data object can contain arrays, it cannot itself be an array - (object or JSON string, mandatory) -* `options` - module options (object, optional) - * `declaration` - XML declaration options (object, optional) - * `include` - specifies whether an XML declaration should be included (boolean, optional, default: true) - * `encoding` - value of XML encoding attribute in declaration; a value of null represents no encoding attribute - (string, optional, default: "UTF-8") - * `attributeString` - the name of the property representing an element's attributes; note that any property with a - name equal to the attribute string is ignored except in the context of XML attributes (string, optional, default: - "@") - * `valueString` - the name of the property representing an element's value; note that any property with a name equal - to the value string is ignored except in the context of supplying a value for a tag containing attributes (string, - optional, default: "#") - * `prettyPrinting` - pretty-printing options (object, optional) - * `enabled` - specifies whether pretty-printing is enabled (boolean, optional, default: true) - * `indentString` - indent string (string, optional, default: "\t") - * `convertMap` - maps object types (as given by the `Object.prototype.toString.call` method) to functions to convert - those objects to a particular string representation; `*` can be used as a wildcard for all types of objects - (object, optional, default: {}) - * `useCDATA` - specifies whether strings should be enclosed in CDATA tags; otherwise, illegal XML characters will - be escaped (boolean, optional, default: false) - -## Examples ## - -The following example illustrates the basic usage of js2xmlparser: - - var js2xmlparser = require("js2xmlparser"); - - var data = { - "firstName": "John", - "lastName": "Smith" - }; - - console.log(js2xmlparser("person", data)); - - > - > - > John - > Smith - > - -Here's a more complex example that builds on the first: - - var js2xmlparser = require("js2xmlparser"); - - var data = { - "@": { - "type": "individual" - }, - "firstName": "John", - "lastName": "Smith", - "dateOfBirth": new Date(1964, 7, 26), - "address": { - "@": { - "type": "home" - }, - "streetAddress": "3212 22nd St", - "city": "Chicago", - "state": "Illinois", - "zip": 10000 - }, - "phone": [ - { - "@": { - "type": "home" - }, - "#": "123-555-4567" - }, - { - "@": { - "type": "cell" - }, - "#": "456-555-7890" - } - ], - "email": function() {return "john@smith.com";}, - "notes": "John's profile is not complete." - }; - - console.log(js2xmlparser("person", data)); - - > - > - > John - > Smith - > Wed Aug 26 1964 00:00:00 GMT-0400 (Eastern Daylight Time) - >
      - > 3212 22nd St - > Chicago - > Illinois - > 10000 - >
      - > 123-555-4567 - > 456-555-7890 - > john@smith.com - > John's profile is not complete. - >
      - -Here's an example that uses the convert map feature: - - var js2xmlparser = require("js2xmlparser"); - - var data = { - "email": function() {return "john@smith.com";}, - "dateOfBirth": new Date(1964, 7, 26) - } - - var options = { - convertMap: { - "[object Date]": function(date) { - return date.toISOString(); - }, - "[object Function]": function(func) { - return func.toString(); - } - } - }; - - console.log(js2xmlparser("person", data, options)); - - > - > - > function () {return "john@smith.com";} - > 1964-08-26T04:00:00.000Z - > - -Here's an example that wraps strings in CDATA tags instead of escaping invalid characters. - - var js2xmlparser = require("js2xmlparser"); - - var data = { - "notes": { - "@": { - "type": "status" - }, - "#": "John's profile is not complete." - } - }; - - var options = { - useCDATA: true - }; - - console.log(js2xmlparser("person", data, options)); - - > - > - > - > - -## Tests ## - -js2xmlparser comes with a set of tests that evaluate and verify the package's core functionality. To run the tests: - -* Install the test dependencies with `npm install`. -* Run the tests with `mocha`. - -## License ## - -js2xmlparser is licensed under the [MIT license](http://opensource.org/licenses/MIT). Please see the LICENSE.md file -for more information. +# js2xmlparser # + +## Overview ## + +js2xmlparser is a Node.js module that parses JavaScript objects into XML. + +## Features ## + +Since XML is a data-interchange format, js2xmlparser is designed primarily for JSON-type objects, arrays and primitive +data types, like many of the other JavaScript to XML parsers currently available for Node.js. + +However, js2xmlparser is capable of parsing any object, including native JavaScript objects such as Date and RegExp, by +taking advantage of each object's toString function. Functions are a special case where the return value of the function +itself is used instead of the toString function, if available. + +js2xmlparser also supports a number of constructs unique to XML: + +* attributes (through a unique attribute property in objects) +* mixed content (through a unique value property in objects) +* multiple elements with the same name (through arrays) + +js2xmlparser can also pretty-print the XML it outputs with the option of customizing the indent string. + +## Installation ## + +The easiest way to install js2xmlparser is to use npm: `npm install js2xmlparser`. + +Alternatively, you may download the source from GitHub and copy it to a folder named "js2xmlparser" within your +"node_modules" directory. + +## Usage ## + +The js2xmlparser module contains one function which takes the following arguments: + +* `root` - the XML root element's name (string, mandatory) +* `data` - the data to be converted to XML; while the data object can contain arrays, it cannot itself be an array + (object or JSON string, mandatory) +* `options` - module options (object, optional) + * `declaration` - XML declaration options (object, optional) + * `include` - specifies whether an XML declaration should be included (boolean, optional, default: true) + * `encoding` - value of XML encoding attribute in declaration; a value of null represents no encoding attribute + (string, optional, default: "UTF-8") + * `attributeString` - the name of the property representing an element's attributes; note that any property with a + name equal to the attribute string is ignored except in the context of XML attributes (string, optional, default: + "@") + * `valueString` - the name of the property representing an element's value; note that any property with a name equal + to the value string is ignored except in the context of supplying a value for a tag containing attributes (string, + optional, default: "#") + * `aliasString` - the name of the property representing an element's alias; the name of the containing element will + be replaced with the alias (string, optional, default: "=") + * `prettyPrinting` - pretty-printing options (object, optional) + * `enabled` - specifies whether pretty-printing is enabled (boolean, optional, default: true) + * `indentString` - indent string (string, optional, default: "\t") + * `convertMap` - maps object types (as given by the `Object.prototype.toString.call` method) to functions to convert + those objects to a particular string representation; `*` can be used as a wildcard for all types of objects + (object, optional, default: {}) + * `useCDATA` - specifies whether strings should be enclosed in CDATA tags; otherwise, illegal XML characters will + be escaped (boolean, optional, default: false) + +## Examples ## + +The following example illustrates the basic usage of js2xmlparser: + + var js2xmlparser = require("js2xmlparser"); + + var data = { + "firstName": "John", + "lastName": "Smith" + }; + + console.log(js2xmlparser("person", data)); + + > + > + > John + > Smith + > + +This is a more complex example that builds on the first: + + var js2xmlparser = require("js2xmlparser"); + + var data = { + "@": { + "type": "individual" + }, + "firstName": "John", + "lastName": "Smith", + "dateOfBirth": new Date(1964, 7, 26), + "address": { + "@": { + "type": "home" + }, + "streetAddress": "3212 22nd St", + "city": "Chicago", + "state": "Illinois", + "zip": 10000 + }, + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567", + "=": "telephone" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ], + "email": function() {return "john@smith.com";}, + "notes": "John's profile is not complete." + }; + + console.log(js2xmlparser("person", data)); + + > + > + > John + > Smith + > Wed Aug 26 1964 00:00:00 GMT-0400 (Eastern Daylight Time) + >
      + > 3212 22nd St + > Chicago + > Illinois + > 10000 + >
      + > 123-555-4567 + > 123-555-4567 + > 456-555-7890 + > john@smith.com + > John's profile is not complete. + >
      + +This example uses the alias string feature: + + var js2xmlparser = require("js2xmlparser"); + + var data = { + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567", + "=": "telephone" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ] + }; + + console.log(js2xmlparser("person", data)); + + > + > + > 123-555-4567 + > 123-555-4567 + > 456-555-7890 + > + +The following an example that uses the convert map feature: + + var js2xmlparser = require("js2xmlparser"); + + var data = { + "email": function() {return "john@smith.com";}, + "dateOfBirth": new Date(1964, 7, 26) + } + + var options = { + convertMap: { + "[object Date]": function(date) { + return date.toISOString(); + }, + "[object Function]": function(func) { + return func.toString(); + } + } + }; + + console.log(js2xmlparser("person", data, options)); + + > + > + > function () {return "john@smith.com";} + > 1964-08-26T04:00:00.000Z + > + +Here's an example that wraps strings in CDATA tags instead of escaping invalid characters: + + var js2xmlparser = require("js2xmlparser"); + + var data = { + "notes": { + "@": { + "type": "status" + }, + "#": "John's profile is not complete." + } + }; + + var options = { + useCDATA: true + }; + + console.log(js2xmlparser("person", data, options)); + + > + > + > + > + +## Tests ## + +js2xmlparser comes with a set of tests that evaluate and verify the package's core functionality. To run the tests: + +* Install the test dependencies with `npm install`. +* Run the tests with `mocha`. + +## License ## + +js2xmlparser is licensed under the [MIT license](http://opensource.org/licenses/MIT). Please see the LICENSE.md file +for more information. diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js b/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js index dfd9ba4..890352e 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js +++ b/node_modules/jsdoc/node_modules/js2xmlparser/example/example.js @@ -1,116 +1,154 @@ -/* jshint node:true */ - -/** - * js2xmlparser - * Copyright © 2012 Michael Kourlas and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS - * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -(function() { - "use strict"; - - var js2xmlparser = require("../lib/js2xmlparser.js"); - - console.log("EXAMPLE 1"); - console.log("========="); - - var example1 = { - "firstName": "John", - "lastName": "Smith" - }; - - console.log(js2xmlparser("person", example1)); - console.log(); - - console.log("EXAMPLE 2"); - console.log("========="); - - var example2 = { - "@": { - "type": "individual" - }, - "firstName": "John", - "lastName": "Smith", - "dateOfBirth": new Date(1964, 7, 26), - "address": { - "@": { - "type": "home" - }, - "streetAddress": "3212 22nd St", - "city": "Chicago", - "state": "Illinois", - "zip": 10000 - }, - "phone": [ - { - "@": { - "type": "home" - }, - "#": "123-555-4567" - }, - { - "@": { - "type": "cell" - }, - "#": "456-555-7890" - } - ], - "email": function() {return "john@smith.com";}, - "notes": "John's profile is not complete." - }; - - console.log(js2xmlparser("person", example2)); - console.log(); - - console.log("EXAMPLE 3"); - console.log("========="); - - var example3 = { - "email": function() {return "john@smith.com";}, - "dateOfBirth": new Date(1964, 7, 26) - }; - - var example3Options = { - convertMap: { - "[object Date]": function(date) { - return date.toISOString(); - }, - "[object Function]": function(func) { - return func.toString(); - } - } - }; - - console.log(js2xmlparser("person", example3, example3Options)); - console.log(); - - console.log("EXAMPLE 4"); - console.log("========="); - - var example4 = { - "notes": { - "@": { - "type": "status" - }, - "#":"John's profile is not complete." - } - }; - - var example4Options = { - useCDATA: true - }; - - console.log(js2xmlparser("person", example4, example4Options)); -})(); +/* jshint node:true */ + +/** + * js2xmlparser + * Copyright © 2012 Michael Kourlas and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS + * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +(function () { + "use strict"; + + var js2xmlparser = require("../lib/js2xmlparser.js"); + + console.log("EXAMPLE 1"); + console.log("========="); + + var example1 = { + "firstName": "John", + "lastName": "Smith" + }; + + console.log(js2xmlparser("person", example1)); + console.log(); + + console.log("EXAMPLE 2"); + console.log("========="); + + var example2 = { + "@": { + "type": "individual" + }, + "firstName": "John", + "lastName": "Smith", + "dateOfBirth": new Date(1964, 7, 26), + "address": { + "@": { + "type": "home" + }, + "streetAddress": "3212 22nd St", + "city": "Chicago", + "state": "Illinois", + "zip": 10000 + }, + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ], + "email": function () {return "john@smith.com";}, + "comment": "John's profile is not complete." + }; + + console.log(js2xmlparser("person", example2)); + console.log(); + + console.log("EXAMPLE 3"); + console.log("========="); + + var example3 = { + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567", + "=": "telephone" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ] + }; + + console.log(js2xmlparser("person", example3)); + console.log(); + + console.log("EXAMPLE 4"); + console.log("========="); + + var example4 = { + "email": function () { + return "john@smith.com"; + }, + "dateOfBirth": new Date(1964, 7, 26) + }; + + var example4Options = { + convertMap: { + "[object Date]": function (date) { + return date.toISOString(); + }, + "[object Function]": function (func) { + return func.toString(); + } + } + }; + + console.log(js2xmlparser("person", example4, example4Options)); + console.log(); + + console.log("EXAMPLE 5"); + console.log("========="); + + var example5 = { + "comment": { + "@": { + "type": "status" + }, + "#": "John's profile is not complete." + } + }; + + var example5Options = { + useCDATA: true + }; + + console.log(js2xmlparser("person", example5, example5Options)); +})(); diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js b/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js index f96c97b..e00748a 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js +++ b/node_modules/jsdoc/node_modules/js2xmlparser/lib/js2xmlparser.js @@ -1,328 +1,353 @@ -/* jshint node:true */ - -/** - * js2xmlparser - * Copyright © 2012 Michael Kourlas and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS - * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -(function() { - "use strict"; - - var xmlDeclaration = true; - var xmlVersion = "1.0"; - var xmlEncoding = "UTF-8"; - var attributeString = "@"; - var valueString = "#"; - var prettyPrinting = true; - var indentString = "\t"; - var convertMap = {}; - var useCDATA = false; - - module.exports = function (root, data, options) { - return toXML(init(root, data, options)); - }; - - // Initialization - var init = function(root, data, options) { - // Set option defaults - setOptionDefaults(); - - // Error checking for root element - if (typeof root !== "string") { - throw new Error("root element must be a string"); - } - else if (root === "") { - throw new Error("root element cannot be empty"); - } - - // Error checking and variable initialization for options - if (typeof options === "object" && options !== null) { - if ("declaration" in options) { - if ("include" in options.declaration) { - if (typeof options.declaration.include === "boolean") { - xmlDeclaration = options.declaration.include; - } - else { - throw new Error("declaration.include option must be a boolean"); - } - } - - if ("encoding" in options.declaration) { - if (typeof options.declaration.encoding === "string" || options.declaration.encoding === null) { - xmlEncoding = options.declaration.encoding; - } - else { - throw new Error("declaration.encoding option must be a string or null"); - } - } - } - if ("attributeString" in options) { - if (typeof options.attributeString === "string") { - attributeString = options.attributeString; - } - else { - throw new Error("attributeString option must be a string"); - } - } - if ("valueString" in options) { - if (typeof options.valueString === "string") { - valueString = options.valueString; - } - else { - throw new Error("valueString option must be a string"); - } - } - if ("prettyPrinting" in options) { - if ("enabled" in options.prettyPrinting) { - if (typeof options.prettyPrinting.enabled === "boolean") { - prettyPrinting = options.prettyPrinting.enabled; - } - else { - throw new Error("prettyPrinting.enabled option must be a boolean"); - } - } - - if ("indentString" in options.prettyPrinting) { - if (typeof options.prettyPrinting.indentString === "string") { - indentString = options.prettyPrinting.indentString; - } - else { - throw new Error("prettyPrinting.indentString option must be a string"); - } - } - } - if ("convertMap" in options) { - if (Object.prototype.toString.call(options.convertMap) === "[object Object]") { - convertMap = options.convertMap; - } - else { - throw new Error("convertMap option must be an object"); - } - } - if ("useCDATA" in options) { - if (typeof options.useCDATA === "boolean") { - useCDATA = options.useCDATA; - } - else { - throw new Error("useCDATA option must be a boolean"); - } - } - } - - // Error checking and variable initialization for data - if (typeof data !== "string" && typeof data !== "object" && typeof data !== "number" && - typeof data !== "boolean" && data !== null) { - throw new Error("data must be an object (excluding arrays) or a JSON string"); - } - - if (data === null) { - throw new Error("data must be an object (excluding arrays) or a JSON string"); - } - - if (Object.prototype.toString.call(data) === "[object Array]") { - throw new Error("data must be an object (excluding arrays) or a JSON string"); - } - - if (typeof data === "string") { - data = JSON.parse(data); - } - - var tempData = {}; - tempData[root] = data; // Add root element to object - - return tempData; - }; - - // Convert object to XML - var toXML = function(object) { - // Initialize arguments, if necessary - var xml = arguments[1] || ""; - var level = arguments[2] || 0; - - var i = null; - var tempObject = {}; - - for (var property in object) { - if (object.hasOwnProperty(property)) { - // Element name cannot start with a number - var elementName = property; - if (/^\d/.test(property)) { - elementName = "_" + property; - } - - // Arrays - if (Object.prototype.toString.call(object[property]) === "[object Array]") { - // Create separate XML elements for each array element - for (i = 0; i < object[property].length; i++) { - tempObject = {}; - tempObject[property] = object[property][i]; - - xml = toXML(tempObject, xml, level); - } - } - // JSON-type objects with properties - else if (Object.prototype.toString.call(object[property]) === "[object Object]") { - xml += addIndent("<" + elementName, level); - - // Add attributes - var lengthExcludingAttributes = Object.keys(object[property]).length; - if (Object.prototype.toString.call(object[property][attributeString]) === "[object Object]") { - lengthExcludingAttributes -= 1; - for (var attribute in object[property][attributeString]) { - if (object[property][attributeString].hasOwnProperty(attribute)) { - xml += " " + attribute + "=\"" + - toString(object[property][attributeString][attribute], true) + "\""; - } - } - } - else if (typeof object[property][attributeString] !== "undefined") { - // Fix for the case where an object contains a single property with the attribute string as its - // name, but this property contains no attributes; in that case, lengthExcludingAttributes - // should be set to zero to ensure that the object is considered an empty object for the - // purposes of the following if statement. - lengthExcludingAttributes -= 1; - } - - if (lengthExcludingAttributes === 0) { // Empty object - xml += addBreak("/>"); - } - else if (lengthExcludingAttributes === 1 && valueString in object[property]) { // Value string only - xml += addBreak(">" + toString(object[property][valueString], false) + ""); - } - else { // Object with properties - xml += addBreak(">"); - - // Create separate object for each property and pass to this function - for (var subProperty in object[property]) { - if (object[property].hasOwnProperty(subProperty) && subProperty !== attributeString && subProperty !== valueString) { - tempObject = {}; - tempObject[subProperty] = object[property][subProperty]; - - xml = toXML(tempObject, xml, level + 1); - } - } - - xml += addBreak(addIndent("", level)); - } - } - // Everything else - else { - xml += addBreak(addIndent("<" + elementName + ">" + toString(object[property], false) + "", level)); - } - } - } - - // Finalize XML at end of process - if (level === 0) { - // Strip trailing whitespace - xml = xml.replace(/\s+$/g, ""); - - // Add XML declaration - if (xmlDeclaration) { - if (xmlEncoding === null) { - xml = addBreak("") + xml; - } - else { - xml = addBreak("") + xml; - } - } - } - - return xml; - }; - - // Add indenting to data for pretty printing - var addIndent = function(data, level) { - if (prettyPrinting) { - - var indent = ""; - for (var i = 0; i < level; i++) { - indent += indentString; - } - data = indent + data; - } - - return data; - }; - - // Add line break to data for pretty printing - var addBreak = function(data) { - return prettyPrinting ? data + "\n" : data; - }; - - // Convert anything into a valid XML string representation - var toString = function(data, isAttribute) { - // Recursive function used to handle nested functions - var functionHelper = function(data) { - if (Object.prototype.toString.call(data) === "[object Function]") { - return functionHelper(data()); - } - else { - return data; - } - }; - - // Convert map - if (Object.prototype.toString.call(data) in convertMap) { - data = convertMap[Object.prototype.toString.call(data)](data); - } - else if ("*" in convertMap) { - data = convertMap["*"](data); - } - // Functions - else if (Object.prototype.toString.call(data) === "[object Function]") { - data = functionHelper(data()); - } - // Empty objects - else if (Object.prototype.toString.call(data) === "[object Object]" && Object.keys(data).length === 0) { - data = ""; - } - - // Cast data to string - if (typeof data !== "string") { - data = (data === null || typeof data === "undefined") ? "" : data.toString(); - } - - // Output as CDATA instead of escaping if option set (and only if not an attribute value) - if (useCDATA && !isAttribute) { - data = "/gm, "]]]]>") + "]]>"; - } - else { - // Escape illegal XML characters - data = data.replace(/&/gm, "&") - .replace(//gm, ">") - .replace(/"/gm, """) - .replace(/'/gm, "'"); - } - - return data; - }; - - // Revert options back to their default settings - var setOptionDefaults = function() { - useCDATA = false; - convertMap = {}; - xmlDeclaration = true; - xmlVersion = "1.0"; - xmlEncoding = "UTF-8"; - attributeString = "@"; - valueString = "#"; - prettyPrinting = true; - indentString = "\t"; - }; -})(); +/* jshint node:true */ + +/** + * js2xmlparser + * Copyright © 2012 Michael Kourlas and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS + * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +(function () { + "use strict"; + + var xmlDeclaration = true; + var xmlVersion = "1.0"; + var xmlEncoding = "UTF-8"; + var attributeString = "@"; + var aliasString = "="; + var valueString = "#"; + var prettyPrinting = true; + var indentString = "\t"; + var convertMap = {}; + var useCDATA = false; + + module.exports = function (root, data, options) { + return toXML(init(root, data, options)); + }; + + // Initialization + var init = function (root, data, options) { + // Set option defaults + setOptionDefaults(); + + // Error checking for root element + if (typeof root !== "string") { + throw new Error("root element must be a string"); + } + else if (root === "") { + throw new Error("root element cannot be empty"); + } + + // Error checking and variable initialization for options + if (typeof options === "object" && options !== null) { + if ("declaration" in options) { + if ("include" in options.declaration) { + if (typeof options.declaration.include === "boolean") { + xmlDeclaration = options.declaration.include; + } + else { + throw new Error("declaration.include option must be a boolean"); + } + } + + if ("encoding" in options.declaration) { + if (typeof options.declaration.encoding === "string" || options.declaration.encoding === null) { + xmlEncoding = options.declaration.encoding; + } + else { + throw new Error("declaration.encoding option must be a string or null"); + } + } + } + if ("attributeString" in options) { + if (typeof options.attributeString === "string") { + attributeString = options.attributeString; + } + else { + throw new Error("attributeString option must be a string"); + } + } + if ("valueString" in options) { + if (typeof options.valueString === "string") { + valueString = options.valueString; + } + else { + throw new Error("valueString option must be a string"); + } + } + if ("aliasString" in options) { + if (typeof options.aliasString === "string") { + aliasString = options.aliasString; + } + else { + throw new Error("aliasString option must be a string"); + } + } + if ("prettyPrinting" in options) { + if ("enabled" in options.prettyPrinting) { + if (typeof options.prettyPrinting.enabled === "boolean") { + prettyPrinting = options.prettyPrinting.enabled; + } + else { + throw new Error("prettyPrinting.enabled option must be a boolean"); + } + } + + if ("indentString" in options.prettyPrinting) { + if (typeof options.prettyPrinting.indentString === "string") { + indentString = options.prettyPrinting.indentString; + } + else { + throw new Error("prettyPrinting.indentString option must be a string"); + } + } + } + if ("convertMap" in options) { + if (Object.prototype.toString.call(options.convertMap) === "[object Object]") { + convertMap = options.convertMap; + } + else { + throw new Error("convertMap option must be an object"); + } + } + if ("useCDATA" in options) { + if (typeof options.useCDATA === "boolean") { + useCDATA = options.useCDATA; + } + else { + throw new Error("useCDATA option must be a boolean"); + } + } + } + + // Error checking and variable initialization for data + if (typeof data !== "string" && typeof data !== "object" && typeof data !== "number" && + typeof data !== "boolean" && data !== null) { + throw new Error("data must be an object (excluding arrays) or a JSON string"); + } + + if (data === null) { + throw new Error("data must be an object (excluding arrays) or a JSON string"); + } + + if (Object.prototype.toString.call(data) === "[object Array]") { + throw new Error("data must be an object (excluding arrays) or a JSON string"); + } + + if (typeof data === "string") { + data = JSON.parse(data); + } + + var tempData = {}; + tempData[root] = data; // Add root element to object + + return tempData; + }; + + // Convert object to XML + var toXML = function (object) { + // Initialize arguments, if necessary + var xml = arguments[1] || ""; + var level = arguments[2] || 0; + + var i = null; + var tempObject = {}; + + for (var property in object) { + if (object.hasOwnProperty(property)) { + // Element name cannot start with a number + var elementName = property; + if (/^\d/.test(property)) { + elementName = "_" + property; + } + + // Skip alias string property + if (elementName === aliasString) { + continue; + } + + // When alias string property is present, use as alias for element name + if (Object.prototype.toString.call(object[property]) === "[object Object]" && + aliasString in object[property]) { + elementName = object[property][aliasString]; + } + + // Arrays + if (Object.prototype.toString.call(object[property]) === "[object Array]") { + // Create separate XML elements for each array element + for (i = 0; i < object[property].length; i++) { + tempObject = {}; + tempObject[property] = object[property][i]; + + xml = toXML(tempObject, xml, level); + } + } + // JSON-type objects with properties + else if (Object.prototype.toString.call(object[property]) === "[object Object]") { + xml += addIndent("<" + elementName, level); + + // Add attributes + var lengthExcludingAttributes = Object.keys(object[property]).length; + if (Object.prototype.toString.call(object[property][attributeString]) === "[object Object]") { + lengthExcludingAttributes -= 1; + for (var attribute in object[property][attributeString]) { + if (object[property][attributeString].hasOwnProperty(attribute)) { + xml += " " + attribute + "=\"" + + toString(object[property][attributeString][attribute], true) + "\""; + } + } + } + else if (typeof object[property][attributeString] !== "undefined") { + // Fix for the case where an object contains a single property with the attribute string as its + // name, but this property contains no attributes; in that case, lengthExcludingAttributes + // should be set to zero to ensure that the object is considered an empty object for the + // purposes of the following if statement. + lengthExcludingAttributes -= 1; + } + + if (lengthExcludingAttributes === 0) { // Empty object + xml += addBreak("/>"); + } + else if ((lengthExcludingAttributes === 1 || + (lengthExcludingAttributes === 2 && aliasString in object[property])) && + valueString in object[property]) { // Value string only + xml += addBreak(">" + toString(object[property][valueString], false) + ""); + } + else { // Object with properties + xml += addBreak(">"); + + // Create separate object for each property and pass to this function + for (var subProperty in object[property]) { + if (object[property].hasOwnProperty(subProperty) && subProperty !== attributeString && + subProperty !== valueString) { + tempObject = {}; + tempObject[subProperty] = object[property][subProperty]; + + xml = toXML(tempObject, xml, level + 1); + } + } + + xml += addBreak(addIndent("", level)); + } + } + // Everything else + else { + xml += addBreak(addIndent("<" + elementName + ">" + toString(object[property], false) + "", level)); + } + } + } + + // Finalize XML at end of process + if (level === 0) { + // Strip trailing whitespace + xml = xml.replace(/\s+$/g, ""); + + // Add XML declaration + if (xmlDeclaration) { + if (xmlEncoding === null) { + xml = addBreak("") + xml; + } + else { + xml = addBreak("") + xml; + } + } + } + + return xml; + }; + + // Add indenting to data for pretty printing + var addIndent = function (data, level) { + if (prettyPrinting) { + + var indent = ""; + for (var i = 0; i < level; i++) { + indent += indentString; + } + data = indent + data; + } + + return data; + }; + + // Add line break to data for pretty printing + var addBreak = function (data) { + return prettyPrinting ? data + "\n" : data; + }; + + // Convert anything into a valid XML string representation + var toString = function (data, isAttribute) { + // Recursive function used to handle nested functions + var functionHelper = function (data) { + if (Object.prototype.toString.call(data) === "[object Function]") { + return functionHelper(data()); + } + else { + return data; + } + }; + + // Convert map + if (Object.prototype.toString.call(data) in convertMap) { + data = convertMap[Object.prototype.toString.call(data)](data); + } + else if ("*" in convertMap) { + data = convertMap["*"](data); + } + // Functions + else if (Object.prototype.toString.call(data) === "[object Function]") { + data = functionHelper(data()); + } + // Empty objects + else if (Object.prototype.toString.call(data) === "[object Object]" && Object.keys(data).length === 0) { + data = ""; + } + + // Cast data to string + if (typeof data !== "string") { + data = (data === null || typeof data === "undefined") ? "" : data.toString(); + } + + // Output as CDATA instead of escaping if option set (and only if not an attribute value) + if (useCDATA && !isAttribute) { + data = "/gm, "]]]]>") + "]]>"; + } + else { + // Escape illegal XML characters + data = data.replace(/&/gm, "&") + .replace(//gm, ">") + .replace(/"/gm, """) + .replace(/'/gm, "'"); + } + + return data; + }; + + // Revert options back to their default settings + var setOptionDefaults = function () { + useCDATA = false; + convertMap = {}; + xmlDeclaration = true; + xmlVersion = "1.0"; + xmlEncoding = "UTF-8"; + attributeString = "@"; + aliasString = "="; + valueString = "#"; + prettyPrinting = true; + indentString = "\t"; + }; +})(); diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/package.json b/node_modules/jsdoc/node_modules/js2xmlparser/package.json index da979c6..2aea7a7 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/package.json +++ b/node_modules/jsdoc/node_modules/js2xmlparser/package.json @@ -13,7 +13,7 @@ "xml" ], "homepage": "http://www.kourlas.net", - "version": "0.1.5", + "version": "0.1.7", "author": { "name": "Michael Kourlas", "email": "michael@kourlas.net" @@ -28,13 +28,15 @@ "should": "*" }, "license": "MIT", + "gitHead": "787d4a0f624f805a24fe334ad79d6cf127b0c146", "bugs": { "url": "https://github.com/michaelkourlas/node-js2xmlparser/issues" }, - "_id": "js2xmlparser@0.1.5", - "_shasum": "b42b3ac5a74bb282ff06cc93dfa67fb98a22959d", - "_from": "js2xmlparser@~0.1.0", - "_npmVersion": "1.4.9", + "_id": "js2xmlparser@0.1.7", + "scripts": {}, + "_shasum": "c8a4bf9ba00577c4b2ce0bd6e714ee8341a586ae", + "_from": "js2xmlparser@>=0.1.7 <0.2.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "michaelkourlas", "email": "michael@kourlas.net" @@ -46,10 +48,10 @@ } ], "dist": { - "shasum": "b42b3ac5a74bb282ff06cc93dfa67fb98a22959d", - "tarball": "http://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.5.tgz" + "shasum": "c8a4bf9ba00577c4b2ce0bd6e714ee8341a586ae", + "tarball": "http://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.7.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.5.tgz", + "_resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-0.1.7.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/js2xmlparser/test/test.js b/node_modules/jsdoc/node_modules/js2xmlparser/test/test.js index 2a67e62..4b3c675 100644 --- a/node_modules/jsdoc/node_modules/js2xmlparser/test/test.js +++ b/node_modules/jsdoc/node_modules/js2xmlparser/test/test.js @@ -1,1259 +1,1408 @@ -/* jshint node:true */ - -/* globals describe, it */ - -/** - * js2xmlparser - * Copyright © 2012 Michael Kourlas and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS - * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -(function () { - "use strict"; - - var js2xmlparser = require("../lib/js2xmlparser"); - var should = require("should"); - var util = require("util"); - - var defaultRoot = "base"; - var defaultData = { - hello: "world" - }; - var defaultOptions = { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - } - }; - - describe("js2xmlparser", function () { - describe("root", function () { - it("should raise an error when root is undefined", function () { - var res; - try { - res = js2xmlparser(undefined, defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when root is null", function () { - var res; - try { - res = js2xmlparser(null, defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when root is an object", function () { - var res; - try { - res = js2xmlparser({}, defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when root is an array", function () { - var res; - try { - res = js2xmlparser([], defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when root is a boolean", function () { - var res; - try { - res = js2xmlparser(true, defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when root is a number", function () { - var res; - try { - res = js2xmlparser(2, defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when root is an empty string", function () { - var res; - try { - res = js2xmlparser("", defaultData, defaultOptions); - } catch (e) { - e.should.match(/root element cannot be empty/); - } - should.not.exist(res); - }); - - it("should create XML with 'base' as the root element when root is 'base'", function () { - var res = js2xmlparser(defaultRoot, defaultData, defaultOptions); - res.should.startWith(""); - }); - }); - - describe("options", function () { - describe("declaration", function () { - describe("include", function () { - it("should raise an error when options.declaration is defined and options.declaration.include is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: undefined - } - }); - } catch (e) { - e.should.match(/declaration.include option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.include is null", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: null - } - }); - } catch (e) { - e.should.match(/declaration.include option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.include is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: {} - } - }); - } catch (e) { - e.should.match(/declaration.include option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.include is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: [] - } - }); - } catch (e) { - e.should.match(/declaration.include option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.include is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: 2 - } - }); - } catch (e) { - e.should.match(/declaration.include option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.include is a string", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: "string" - } - }); - } catch (e) { - e.should.match(/declaration.include option must be a boolean/); - } - should.not.exist(res); - }); - - it("should create XML with declaration when options.declaration.include is not specified", function () { - var res = js2xmlparser(defaultRoot, defaultData, {}); - res.should.startWith(""); - }); - - it("should create XML with declaration when options.declaration.include is true", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: true - } - }); - res.should.startWith(""); - }); - - it("should create XML without declaration when options.declaration.include is false", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - } - }); - res.should.startWith(""); - }); - }); - - describe("encoding", function () { - it("should raise an error when options.declaration is defined and options.declaration.encoding is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: undefined - } - }); - } catch (e) { - e.should.match(/declaration.encoding option must be a string or null/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.encoding is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: {} - } - }); - } catch (e) { - e.should.match(/declaration.encoding option must be a string or null/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.encoding is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: [] - } - }); - } catch (e) { - e.should.match(/declaration.encoding option must be a string or null/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.encoding is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: 2 - } - }); - } catch (e) { - e.should.match(/declaration.encoding option must be a string or null/); - } - should.not.exist(res); - }); - - it("should raise an error when options.declaration is defined and options.declaration.encoding is a boolean", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: true - } - }); - } catch (e) { - e.should.match(/declaration.encoding option must be a string or null/); - } - should.not.exist(res); - }); - - it("should create XML declaration with encoding 'UTF-8' when options.declaration.encoding is not specified", function () { - var res = js2xmlparser(defaultRoot, defaultData, {}); - res.should.startWith(""); - }); - - it("should create XML declaration with encoding 'UTF-16' when options.declaration.encoding is 'UTF-16'", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: "UTF-16" - } - }); - res.should.startWith(""); - }); - - it("should create XML declaration without encoding attribute when options.declaration.encoding is null", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - encoding: null - } - }); - res.should.startWith(""); - }); - }); - }); - - describe("attributeString", function () { - it("should raise an error when options is defined and options.attributeString is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - attributeString: undefined - }); - } catch (e) { - e.should.match(/attributeString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.attributeString is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - attributeString: {} - }); - } catch (e) { - e.should.match(/attributeString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.attributeString is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - attributeString: [] - }); - } catch (e) { - e.should.match(/attributeString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.attributeString is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - attributeString: 2 - }); - } catch (e) { - e.should.match(/attributeString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.attributeString is a boolean", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - attributeString: true - }); - } catch (e) { - e.should.match(/attributeString option must be a string/); - } - should.not.exist(res); - }); - - it("should create XML with attribute string '@' when options.attributeString is not specified", function () { - var res = js2xmlparser(defaultRoot, { - a: { - "@": { - b: "c" - } - } - }, defaultOptions); - res.should.equal("
      "); - }); - - it("should create XML with attribute string '__attr' when options.attributeString is '__attr'", function () { - var res = js2xmlparser(defaultRoot, { - a: { - "__attr": { - b: "c" - } - } - }, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - attributeString: "__attr" - }); - res.should.equal(""); - }); - }); - - describe("valueString", function () { - it("should raise an error when options is defined and options.valueString is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - valueString: undefined - }); - } catch (e) { - e.should.match(/valueString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.valueString is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - valueString: {} - }); - } catch (e) { - e.should.match(/valueString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.valueString is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - valueString: [] - }); - } catch (e) { - e.should.match(/valueString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.valueString is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - valueString: 2 - }); - } catch (e) { - e.should.match(/valueString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.valueString is a boolean", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - valueString: true - }); - } catch (e) { - e.should.match(/valueString option must be a string/); - } - should.not.exist(res); - }); - - it("should create XML with value string '@' when options.valueString is not specified", function () { - var res = js2xmlparser(defaultRoot, { - a: { - "@": { - b: "c" - }, - "#": "d" - } - }, defaultOptions); - res.should.equal("d"); - }); - - it("should create XML with value string '__val' when options.valueString is '__val'", function () { - var res = js2xmlparser(defaultRoot, { - a: { - "@": { - b: "c" - }, - "__val": "d" - } - }, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - valueString: "__val" - }); - res.should.equal("d"); - }); - }); - - describe("prettyPrinting", function () { - describe("enabled", function () { - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: undefined - } - }); - } catch (e) { - e.should.match(/prettyPrinting.enabled option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is null", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: null - } - }); - } catch (e) { - e.should.match(/prettyPrinting.enabled option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: {} - } - }); - } catch (e) { - e.should.match(/prettyPrinting.enabled option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: [] - } - }); - } catch (e) { - e.should.match(/prettyPrinting.enabled option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: 2 - } - }); - } catch (e) { - e.should.match(/prettyPrinting.enabled option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is a string", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: "string" - } - }); - } catch (e) { - e.should.match(/prettyPrinting.enabled option must be a boolean/); - } - should.not.exist(res); - }); - - it("should create XML with pretty printing when options.prettyPrinting.enabled is not specified", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - } - }); - res.should.equal("\n\tworld\n"); - }); - - it("should create XML with pretty printing when options.prettyPrinting.enabled is true", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: true - }, - declaration: { - include: false - } - }); - res.should.equal("\n\tworld\n"); - }); - - it("should create XML without pretty printing when options.prettyPrinting.enabled is false", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - enabled: false - }, - declaration: { - include: false - } - }); - res.should.equal("world"); - }); - }); - - describe("indentString", function () { - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - indentString: undefined - } - }); - } catch (e) { - e.should.match(/prettyPrinting.indentString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - indentString: {} - } - }); - } catch (e) { - e.should.match(/prettyPrinting.indentString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - indentString: [] - } - }); - } catch (e) { - e.should.match(/prettyPrinting.indentString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - indentString: 2 - } - }); - } catch (e) { - e.should.match(/prettyPrinting.indentString option must be a string/); - } - should.not.exist(res); - }); - - it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is a boolean", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - prettyPrinting: { - indentString: true - } - }); - } catch (e) { - e.should.match(/prettyPrinting.indentString option must be a string/); - } - should.not.exist(res); - }); - - it("should pretty print with indent string '\t' when options.prettyPrinting.indentString is not specified", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - } - }); - res.should.equal("\n\tworld\n"); - }); - - it("should pretty print with indent string ' ' when options.valueString is ' '", function () { - var res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - indentString: ' ' - } - }); - res.should.equal("\n world\n"); - }); - }); - }); - - describe("convertMap", function () { - it("should raise an error when options is defined and options.convertMap is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: undefined - }); - } catch (e) { - e.should.match(/convertMap option must be an object/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.convertMap is null", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: null - }); - } catch (e) { - e.should.match(/convertMap option must be an object/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.convertMap is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: [] - }); - } catch (e) { - e.should.match(/convertMap option must be an object/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.convertMap is a boolean", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: true - }); - } catch (e) { - e.should.match(/convertMap option must be an object/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.convertMap is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: 2 - }); - } catch (e) { - e.should.match(/convertMap option must be an object/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.convertMap is a string", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: "test" - }); - } catch (e) { - e.should.match(/convertMap option must be an object/); - } - should.not.exist(res); - }); - - it("should correctly parse XML using convert maps", function () { - var res = js2xmlparser(defaultRoot, { - "a": "b", - "c": 1 - }, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: { - "[object Number]": function (num) { - return num + 1; - }, - "[object String]": function (str) { - return str + "a"; - } - } - }); - res.should.equal("ba2"); - }); - }); - - describe("useCDATA", function () { - it("should raise an error when options is defined and options.useCDATA is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - useCDATA: undefined - }); - } catch (e) { - e.should.match(/useCDATA option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.useCDATA is null", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - useCDATA: null - }); - } catch (e) { - e.should.match(/useCDATA option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.useCDATA is an object", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - useCDATA: {} - }); - } catch (e) { - e.should.match(/useCDATA option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.useCDATA is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - useCDATA: [] - }); - } catch (e) { - e.should.match(/useCDATA option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.useCDATA is a number", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - useCDATA: 2 - }); - } catch (e) { - e.should.match(/useCDATA option must be a boolean/); - } - should.not.exist(res); - }); - - it("should raise an error when options is defined and options.useCDATA is a string", function () { - var res; - try { - res = js2xmlparser(defaultRoot, defaultData, { - useCDATA: "string" - }); - } catch (e) { - e.should.match(/useCDATA option must be a boolean/); - } - should.not.exist(res); - }); - - it("should create XML without CDATA strings when options.CDATA is not specified", function () { - var res = js2xmlparser(defaultRoot, { - "a": "b'c" - }, defaultOptions); - res.should.equal("b'c"); - }); - - it("should create XML without CDATA strings when options.CDATA is false", function () { - var res = js2xmlparser(defaultRoot, { - "a": "b'c" - }, { - useCDATA: false, - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - } - }); - res.should.equal("b'c"); - }); - - it("should create XML without CDATA strings when options.CDATA is true", function () { - var res = js2xmlparser(defaultRoot, { - "a": "b'c" - }, { - useCDATA: true, - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - } - }); - res.should.equal(""); - }); - }); - }); - - describe("data", function () { - it("should raise an error when data is undefined", function () { - var res; - try { - res = js2xmlparser(defaultRoot, undefined, defaultOptions); - } catch (e) { - e.should.match(/data must be an object (excluding arrays) or a JSON string/); - } - should.not.exist(res); - }); - - it("should raise an error when data is null", function () { - var res; - try { - res = js2xmlparser(defaultRoot, null, defaultOptions); - } catch (e) { - e.should.match(/data must be an object (excluding arrays) or a JSON string/); - } - should.not.exist(res); - }); - - it("should raise an error when data is an array", function () { - var res; - try { - res = js2xmlparser(defaultRoot, [], defaultOptions); - } catch (e) { - e.should.match(/data must be an object (excluding arrays) or a JSON string/); - } - should.not.exist(res); - }); - - it("should raise an error when data is a non-JSON string", function () { - var res; - try { - res = js2xmlparser(defaultRoot, "test", defaultOptions); - } catch (e) { - e.should.match(/data must be an object (excluding arrays) or a JSON string/); - } - should.not.exist(res); - }); - - it("should correctly parse a number", function () { - var res = js2xmlparser(defaultRoot, 2, defaultOptions); - res.should.equal("2"); - }); - - it("should correctly parse a boolean", function () { - var res = js2xmlparser(defaultRoot, true, defaultOptions); - res.should.equal("true"); - }); - - it("should correctly parse a JSON string", function () { - var res = js2xmlparser(defaultRoot, "{\"hello\":\"world\"}", defaultOptions); - res.should.equal("world"); - }); - - it("should correctly parse an empty object", function () { - var res = js2xmlparser(defaultRoot, {}, defaultOptions); - res.should.equal(""); - }); - - it("should correctly parse a simple object", function () { - var res = js2xmlparser(defaultRoot, { - a: "b", - c: "d" - }, defaultOptions); - res.should.equal("bd"); - }); - - it("should correctly parse attributes", function () { - var res = js2xmlparser(defaultRoot, { - "@": { - a: "b", - "@": "c" - }, - d: { - "@": { - e: "f" - } - }, - g: { - "@": { - h: "i" - }, - j: "k", - l: { - "@": "m" - } - } - }, defaultOptions); - res.should.equal("k"); - }); - - it("should correctly parse value strings", function () { - var res = js2xmlparser(defaultRoot, { - "#": "1", - a: { - "#": "b" - }, - c: { - "#": "d", - e: { - f: "g" - }, - "h": { - "#": { - "i": "j", - "#": "k" - } - } - }, - l: { - "@": { - m: "n" - }, - "#": "o" - } - }, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - } - }); - res.should.equal("bg[object Object]o"); - }); - - it("should correctly parse arrays", function () { - var res = js2xmlparser(defaultRoot, { - a: ["b", "c", "d"], - e: ["f", "g", ["h", "i"], "j"], - k: { - l: ["m", "n", "o"] - } - }, defaultOptions); - res.should.equal("bcdfghijm" + - "no"); - }); - - it("should correctly parse example 1", function () { - var res = js2xmlparser("person", { - "firstName": "John", - "lastName": "Smith" - }, defaultOptions); - res.should.equal("JohnSmith"); - }); - - it("should correctly parse example 2", function () { - var res = js2xmlparser("person", { - "@": { - "type": "individual" - }, - "firstName": "John", - "lastName": "Smith", - "dateOfBirth": new Date(1964, 7, 26), - "address": { - "@": { - "type": "home" - }, - "streetAddress": "3212 22nd St", - "city": "Chicago", - "state": "Illinois", - "zip": 10000 - }, - "phone": [ - { - "@": { - "type": "home" - }, - "#": "123-555-4567" - }, - { - "@": { - "type": "cell" - }, - "#": "456-555-7890" - } - ], - "email": function () { - return "john@smith.com"; - }, - "notes": "John's profile is not complete." - }, defaultOptions); - res.should.equal("JohnSmith" + - ""+new Date(1964, 7, 26)+"
      3212 22nd StChicagoIllinois" + - "10000
      123-555-4567" + - "456-555-7890john@smith.comJohn's profile is not complete." + - "
      "); - }); - - it("should correctly parse example 2 with pretty printing", function () { - var res = js2xmlparser("person", { - "@": { - "type": "individual" - }, - "firstName": "John", - "lastName": "Smith", - "dateOfBirth": new Date(1964, 7, 26), - "address": { - "@": { - "type": "home" - }, - "streetAddress": "3212 22nd St", - "city": "Chicago", - "state": "Illinois", - "zip": 10000 - }, - "phone": [ - { - "@": { - "type": "home" - }, - "#": "123-555-4567" - }, - { - "@": { - "type": "cell" - }, - "#": "456-555-7890" - } - ], - "email": function () { - return "john@smith.com"; - }, - "notes": "John's profile is not complete." - }, { - declaration: { - include: false - } - }); - res.should.equal("\n\tJohn\n\tSmith" + - "\n\t"+ new Date(1964, 7, 26) + - "\n\t
      \n\t\t3212 22nd St" + - "\n\t\tChicago\n\t\tIllinois\n\t\t10000\n\t
      " + - "\n\t123-555-4567\n\t456-555-7890\n\t" + - "john@smith.com\n\tJohn's profile is not complete.\n
      "); - }); - - it("should correctly parse example 3", function () { - var res = js2xmlparser("person", { - "email": function() {return "john@smith.com";}, - "dateOfBirth": new Date(1964, 7, 26) - }, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - convertMap: { - "[object Date]": function (date) { - return date.toISOString(); - }, - "[object Function]": function(func) { - return func.toString(); - } - } - }); - res.should.equal("function () {return "john@smith.com";}" + - "1964-08-26T04:00:00.000Z"); - }); - - it("should correctly parse example 4", function () { - var res = js2xmlparser("person", { - "notes": { - "@": { - "type": "status" - }, - "#":"John's profile is not complete." - } - }, { - declaration: { - include: false - }, - prettyPrinting: { - enabled: false - }, - useCDATA: true - }); - res.should.equal("" + - ""); - }); - }); - }); -})(); +/* jshint node:true */ + +/* globals describe, it */ + +/** + * js2xmlparser + * Copyright © 2012 Michael Kourlas and other contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS + * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +(function () { + "use strict"; + + var js2xmlparser = require("../lib/js2xmlparser"); + var should = require("should"); + var util = require("util"); + + var defaultRoot = "base"; + var defaultData = { + hello: "world" + }; + var defaultOptions = { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + } + }; + + describe("js2xmlparser", function () { + describe("root", function () { + it("should raise an error when root is undefined", function () { + var res; + try { + res = js2xmlparser(undefined, defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when root is null", function () { + var res; + try { + res = js2xmlparser(null, defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when root is an object", function () { + var res; + try { + res = js2xmlparser({}, defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when root is an array", function () { + var res; + try { + res = js2xmlparser([], defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when root is a boolean", function () { + var res; + try { + res = js2xmlparser(true, defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when root is a number", function () { + var res; + try { + res = js2xmlparser(2, defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when root is an empty string", function () { + var res; + try { + res = js2xmlparser("", defaultData, defaultOptions); + } catch (e) { + e.should.match(/root element cannot be empty/); + } + should.not.exist(res); + }); + + it("should create XML with 'base' as the root element when root is 'base'", function () { + var res = js2xmlparser(defaultRoot, defaultData, defaultOptions); + res.should.startWith(""); + }); + }); + + describe("options", function () { + describe("declaration", function () { + describe("include", function () { + it("should raise an error when options.declaration is defined and options.declaration.include is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: undefined + } + }); + } catch (e) { + e.should.match(/declaration.include option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.include is null", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: null + } + }); + } catch (e) { + e.should.match(/declaration.include option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.include is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: {} + } + }); + } catch (e) { + e.should.match(/declaration.include option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.include is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: [] + } + }); + } catch (e) { + e.should.match(/declaration.include option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.include is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: 2 + } + }); + } catch (e) { + e.should.match(/declaration.include option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.include is a string", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: "string" + } + }); + } catch (e) { + e.should.match(/declaration.include option must be a boolean/); + } + should.not.exist(res); + }); + + it("should create XML with declaration when options.declaration.include is not specified", function () { + var res = js2xmlparser(defaultRoot, defaultData, {}); + res.should.startWith(""); + }); + + it("should create XML with declaration when options.declaration.include is true", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: true + } + }); + res.should.startWith(""); + }); + + it("should create XML without declaration when options.declaration.include is false", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + } + }); + res.should.startWith(""); + }); + }); + + describe("encoding", function () { + it("should raise an error when options.declaration is defined and options.declaration.encoding is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: undefined + } + }); + } catch (e) { + e.should.match(/declaration.encoding option must be a string or null/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.encoding is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: {} + } + }); + } catch (e) { + e.should.match(/declaration.encoding option must be a string or null/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.encoding is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: [] + } + }); + } catch (e) { + e.should.match(/declaration.encoding option must be a string or null/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.encoding is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: 2 + } + }); + } catch (e) { + e.should.match(/declaration.encoding option must be a string or null/); + } + should.not.exist(res); + }); + + it("should raise an error when options.declaration is defined and options.declaration.encoding is a boolean", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: true + } + }); + } catch (e) { + e.should.match(/declaration.encoding option must be a string or null/); + } + should.not.exist(res); + }); + + it("should create XML declaration with encoding 'UTF-8' when options.declaration.encoding is not specified", function () { + var res = js2xmlparser(defaultRoot, defaultData, {}); + res.should.startWith(""); + }); + + it("should create XML declaration with encoding 'UTF-16' when options.declaration.encoding is 'UTF-16'", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: "UTF-16" + } + }); + res.should.startWith(""); + }); + + it("should create XML declaration without encoding attribute when options.declaration.encoding is null", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + encoding: null + } + }); + res.should.startWith(""); + }); + }); + }); + + describe("attributeString", function () { + it("should raise an error when options is defined and options.attributeString is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + attributeString: undefined + }); + } catch (e) { + e.should.match(/attributeString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.attributeString is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + attributeString: {} + }); + } catch (e) { + e.should.match(/attributeString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.attributeString is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + attributeString: [] + }); + } catch (e) { + e.should.match(/attributeString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.attributeString is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + attributeString: 2 + }); + } catch (e) { + e.should.match(/attributeString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.attributeString is a boolean", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + attributeString: true + }); + } catch (e) { + e.should.match(/attributeString option must be a string/); + } + should.not.exist(res); + }); + + it("should create XML with attribute string '@' when options.attributeString is not specified", function () { + var res = js2xmlparser(defaultRoot, { + a: { + "@": { + b: "c" + } + } + }, defaultOptions); + res.should.equal(""); + }); + + it("should create XML with attribute string '__attr' when options.attributeString is '__attr'", function () { + var res = js2xmlparser(defaultRoot, { + a: { + "__attr": { + b: "c" + } + } + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + attributeString: "__attr" + }); + res.should.equal(""); + }); + }); + + describe("valueString", function () { + it("should raise an error when options is defined and options.valueString is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + valueString: undefined + }); + } catch (e) { + e.should.match(/valueString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.valueString is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + valueString: {} + }); + } catch (e) { + e.should.match(/valueString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.valueString is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + valueString: [] + }); + } catch (e) { + e.should.match(/valueString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.valueString is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + valueString: 2 + }); + } catch (e) { + e.should.match(/valueString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.valueString is a boolean", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + valueString: true + }); + } catch (e) { + e.should.match(/valueString option must be a string/); + } + should.not.exist(res); + }); + + it("should create XML with value string '@' when options.valueString is not specified", function () { + var res = js2xmlparser(defaultRoot, { + a: { + "@": { + b: "c" + }, + "#": "d" + } + }, defaultOptions); + res.should.equal("d"); + }); + + it("should create XML with value string '__val' when options.valueString is '__val'", function () { + var res = js2xmlparser(defaultRoot, { + a: { + "@": { + b: "c" + }, + "__val": "d" + } + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + valueString: "__val" + }); + res.should.equal("d"); + }); + }); + + describe("prettyPrinting", function () { + describe("enabled", function () { + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: undefined + } + }); + } catch (e) { + e.should.match(/prettyPrinting.enabled option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is null", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: null + } + }); + } catch (e) { + e.should.match(/prettyPrinting.enabled option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: {} + } + }); + } catch (e) { + e.should.match(/prettyPrinting.enabled option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: [] + } + }); + } catch (e) { + e.should.match(/prettyPrinting.enabled option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: 2 + } + }); + } catch (e) { + e.should.match(/prettyPrinting.enabled option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.enabled is a string", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: "string" + } + }); + } catch (e) { + e.should.match(/prettyPrinting.enabled option must be a boolean/); + } + should.not.exist(res); + }); + + it("should create XML with pretty printing when options.prettyPrinting.enabled is not specified", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + } + }); + res.should.equal("\n\tworld\n"); + }); + + it("should create XML with pretty printing when options.prettyPrinting.enabled is true", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: true + }, + declaration: { + include: false + } + }); + res.should.equal("\n\tworld\n"); + }); + + it("should create XML without pretty printing when options.prettyPrinting.enabled is false", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + enabled: false + }, + declaration: { + include: false + } + }); + res.should.equal("world"); + }); + }); + + describe("indentString", function () { + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + indentString: undefined + } + }); + } catch (e) { + e.should.match(/prettyPrinting.indentString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + indentString: {} + } + }); + } catch (e) { + e.should.match(/prettyPrinting.indentString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + indentString: [] + } + }); + } catch (e) { + e.should.match(/prettyPrinting.indentString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + indentString: 2 + } + }); + } catch (e) { + e.should.match(/prettyPrinting.indentString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options.prettyPrinting is defined and options.prettyPrinting.indentString is a boolean", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + prettyPrinting: { + indentString: true + } + }); + } catch (e) { + e.should.match(/prettyPrinting.indentString option must be a string/); + } + should.not.exist(res); + }); + + it("should pretty print with indent string '\t' when options.prettyPrinting.indentString is not specified", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + } + }); + res.should.equal("\n\tworld\n"); + }); + + it("should pretty print with indent string ' ' when options.valueString is ' '", function () { + var res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + indentString: ' ' + } + }); + res.should.equal("\n world\n"); + }); + }); + }); + + describe("convertMap", function () { + it("should raise an error when options is defined and options.convertMap is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: undefined + }); + } catch (e) { + e.should.match(/convertMap option must be an object/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.convertMap is null", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: null + }); + } catch (e) { + e.should.match(/convertMap option must be an object/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.convertMap is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: [] + }); + } catch (e) { + e.should.match(/convertMap option must be an object/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.convertMap is a boolean", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: true + }); + } catch (e) { + e.should.match(/convertMap option must be an object/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.convertMap is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: 2 + }); + } catch (e) { + e.should.match(/convertMap option must be an object/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.convertMap is a string", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: "test" + }); + } catch (e) { + e.should.match(/convertMap option must be an object/); + } + should.not.exist(res); + }); + + it("should correctly parse XML using convert maps", function () { + var res = js2xmlparser(defaultRoot, { + "a": "b", + "c": 1 + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: { + "[object Number]": function (num) { + return num + 1; + }, + "[object String]": function (str) { + return str + "a"; + } + } + }); + res.should.equal("ba2"); + }); + }); + + describe("useCDATA", function () { + it("should raise an error when options is defined and options.useCDATA is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + useCDATA: undefined + }); + } catch (e) { + e.should.match(/useCDATA option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.useCDATA is null", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + useCDATA: null + }); + } catch (e) { + e.should.match(/useCDATA option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.useCDATA is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + useCDATA: {} + }); + } catch (e) { + e.should.match(/useCDATA option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.useCDATA is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + useCDATA: [] + }); + } catch (e) { + e.should.match(/useCDATA option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.useCDATA is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + useCDATA: 2 + }); + } catch (e) { + e.should.match(/useCDATA option must be a boolean/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.useCDATA is a string", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + useCDATA: "string" + }); + } catch (e) { + e.should.match(/useCDATA option must be a boolean/); + } + should.not.exist(res); + }); + + it("should create XML without CDATA strings when options.CDATA is not specified", function () { + var res = js2xmlparser(defaultRoot, { + "a": "b'c" + }, defaultOptions); + res.should.equal("b'c"); + }); + + it("should create XML without CDATA strings when options.CDATA is false", function () { + var res = js2xmlparser(defaultRoot, { + "a": "b'c" + }, { + useCDATA: false, + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + } + }); + res.should.equal("b'c"); + }); + + it("should create XML without CDATA strings when options.CDATA is true", function () { + var res = js2xmlparser(defaultRoot, { + "a": "b'c" + }, { + useCDATA: true, + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + } + }); + res.should.equal(""); + }); + }); + + describe("aliasString", function () { + + it("should raise an error when options is defined and options.aliasString is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + aliasString: undefined + }); + } catch (e) { + e.should.match(/aliasString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.aliasString is an object", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + aliasString: {} + }); + } catch (e) { + e.should.match(/aliasString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.aliasString is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + aliasString: [] + }); + } catch (e) { + e.should.match(/aliasString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.aliasString is a number", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + aliasString: 2 + }); + } catch (e) { + e.should.match(/aliasString option must be a string/); + } + should.not.exist(res); + }); + + it("should raise an error when options is defined and options.aliasString is a boolean", function () { + var res; + try { + res = js2xmlparser(defaultRoot, defaultData, { + aliasString: true + }); + } catch (e) { + e.should.match(/aliasString option must be a string/); + } + should.not.exist(res); + }); + + it("should create XML with alias string '=' when options.aliasString is not specified", function () { + var res = js2xmlparser(defaultRoot, { + a: { + "=": "b" + } + }, defaultOptions); + res.should.equal(""); + }); + + it("should create XML with alias string '__alias' when options.aliasString is '__alias'", function () { + var res = js2xmlparser(defaultRoot, { + a: { + "__alias": "b" + } + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + aliasString: "__alias" + }); + res.should.equal(""); + }); + + it("should create XML with options.aliasString and data is an array", function () { + var res = js2xmlparser(defaultRoot, { + a: [{ + "=": "b" + }, { + "=": "c" + }] + }, defaultOptions); + res.should.equal(""); + }); + + }); + }); + + describe("data", function () { + it("should raise an error when data is undefined", function () { + var res; + try { + res = js2xmlparser(defaultRoot, undefined, defaultOptions); + } catch (e) { + e.should.match(/data must be an object (excluding arrays) or a JSON string/); + } + should.not.exist(res); + }); + + it("should raise an error when data is null", function () { + var res; + try { + res = js2xmlparser(defaultRoot, null, defaultOptions); + } catch (e) { + e.should.match(/data must be an object (excluding arrays) or a JSON string/); + } + should.not.exist(res); + }); + + it("should raise an error when data is an array", function () { + var res; + try { + res = js2xmlparser(defaultRoot, [], defaultOptions); + } catch (e) { + e.should.match(/data must be an object (excluding arrays) or a JSON string/); + } + should.not.exist(res); + }); + + it("should raise an error when data is a non-JSON string", function () { + var res; + try { + res = js2xmlparser(defaultRoot, "test", defaultOptions); + } catch (e) { + e.should.match(/data must be an object (excluding arrays) or a JSON string/); + } + should.not.exist(res); + }); + + it("should correctly parse a number", function () { + var res = js2xmlparser(defaultRoot, 2, defaultOptions); + res.should.equal("2"); + }); + + it("should correctly parse a boolean", function () { + var res = js2xmlparser(defaultRoot, true, defaultOptions); + res.should.equal("true"); + }); + + it("should correctly parse a JSON string", function () { + var res = js2xmlparser(defaultRoot, "{\"hello\":\"world\"}", defaultOptions); + res.should.equal("world"); + }); + + it("should correctly parse an empty object", function () { + var res = js2xmlparser(defaultRoot, {}, defaultOptions); + res.should.equal(""); + }); + + it("should correctly parse a simple object", function () { + var res = js2xmlparser(defaultRoot, { + a: "b", + c: "d" + }, defaultOptions); + res.should.equal("bd"); + }); + + it("should correctly parse attributes", function () { + var res = js2xmlparser(defaultRoot, { + "@": { + a: "b", + "@": "c" + }, + d: { + "@": { + e: "f" + } + }, + g: { + "@": { + h: "i" + }, + j: "k", + l: { + "@": "m" + } + } + }, defaultOptions); + res.should.equal("k"); + }); + + it("should correctly parse value strings", function () { + var res = js2xmlparser(defaultRoot, { + "#": "1", + a: { + "#": "b" + }, + c: { + "#": "d", + e: { + f: "g" + }, + "h": { + "#": { + "i": "j", + "#": "k" + } + } + }, + l: { + "@": { + m: "n" + }, + "#": "o" + } + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + } + }); + res.should.equal("bg[object Object]o"); + }); + + it("should correctly parse arrays", function () { + var res = js2xmlparser(defaultRoot, { + a: ["b", "c", "d"], + e: ["f", "g", ["h", "i"], "j"], + k: { + l: ["m", "n", "o"] + } + }, defaultOptions); + res.should.equal("bcdfghijm" + + "no"); + }); + + it("should correctly parse example 1", function () { + var res = js2xmlparser("person", { + "firstName": "John", + "lastName": "Smith" + }, defaultOptions); + res.should.equal("JohnSmith"); + }); + + it("should correctly parse example 2", function () { + var res = js2xmlparser("person", { + "@": { + "type": "individual" + }, + "firstName": "John", + "lastName": "Smith", + "dateOfBirth": new Date(1964, 7, 26), + "address": { + "@": { + "type": "home" + }, + "streetAddress": "3212 22nd St", + "city": "Chicago", + "state": "Illinois", + "zip": 10000 + }, + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ], + "email": function () { + return "john@smith.com"; + }, + "notes": "John's profile is not complete." + }, defaultOptions); + res.should.equal("JohnSmith" + + "" + new Date(1964, 7, 26) + "
      3212 22nd StChicagoIllinois" + + "10000
      123-555-4567123-555-4567456-555-7890" + + "john@smith.comJohn's profile is not complete.
      "); + }); + + it("should correctly parse example 2 with pretty printing", function () { + var res = js2xmlparser("person", { + "@": { + "type": "individual" + }, + "firstName": "John", + "lastName": "Smith", + "dateOfBirth": new Date(1964, 7, 26), + "address": { + "@": { + "type": "home" + }, + "streetAddress": "3212 22nd St", + "city": "Chicago", + "state": "Illinois", + "zip": 10000 + }, + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ], + "email": function () { + return "john@smith.com"; + }, + "notes": "John's profile is not complete." + }, { + declaration: { + include: false + } + }); + res.should.equal("\n\tJohn\n\tSmith" + + "\n\t" + new Date(1964, 7, 26) + + "\n\t
      \n\t\t3212 22nd St" + + "\n\t\tChicago\n\t\tIllinois\n\t\t10000\n\t
      " + + "\n\t123-555-4567\n\t123-555-4567" + + "\n\t456-555-7890\n\tjohn@smith.com\n\t" + + "John's profile is not complete.\n
      "); + }); + + it("should correctly parse example 3", function () { + var res = js2xmlparser("person", { + "phone": [ + { + "@": { + "type": "home" + }, + "#": "123-555-4567" + }, + { + "@": { + "type": "work" + }, + "#": "123-555-4567", + "=": "telephone" + }, + { + "@": { + "type": "cell" + }, + "#": "456-555-7890" + } + ] + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + } + }); + res.should.equal("123-555-4567" + + "123-555-4567456-555-7890"); + }); + + it("should correctly parse example 4", function () { + var res = js2xmlparser("person", { + "email": function () {return "john@smith.com";}, + "dateOfBirth": new Date(Date.UTC(1964, 7, 26)) + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + convertMap: { + "[object Date]": function (date) { + return date.toISOString(); + }, + "[object Function]": function (func) { + return func.toString(); + } + } + }); + res.should.equal("function () {return "john@smith.com";}" + + "1964-08-26T00:00:00.000Z"); + }); + + it("should correctly parse example 5", function () { + var res = js2xmlparser("person", { + "notes": { + "@": { + "type": "status" + }, + "#": "John's profile is not complete." + } + }, { + declaration: { + include: false + }, + prettyPrinting: { + enabled: false + }, + useCDATA: true + }); + res.should.equal("" + + ""); + }); + }); + }); +})(); diff --git a/node_modules/jsdoc/node_modules/marked/Makefile b/node_modules/jsdoc/node_modules/marked/Makefile index 20ac2d4..d9349f0 100644 --- a/node_modules/jsdoc/node_modules/marked/Makefile +++ b/node_modules/jsdoc/node_modules/marked/Makefile @@ -1,6 +1,6 @@ all: @cp lib/marked.js marked.js - @uglifyjs -o marked.min.js marked.js + @uglifyjs --comments '/\*[^\0]+?Copyright[^\0]+?\*/' -o marked.min.js lib/marked.js clean: @rm marked.js diff --git a/node_modules/jsdoc/node_modules/marked/README.md b/node_modules/jsdoc/node_modules/marked/README.md index 441c1eb..b9817cd 100644 --- a/node_modules/jsdoc/node_modules/marked/README.md +++ b/node_modules/jsdoc/node_modules/marked/README.md @@ -39,6 +39,26 @@ marked.setOptions({ console.log(marked('I am using __markdown__.')); ``` +### Browser + +```html + + + + + Marked in the browser + + + +
      + + + +``` + ## marked(markdownString [,options] [,callback]) ### markdownString diff --git a/node_modules/jsdoc/node_modules/marked/bower.json b/node_modules/jsdoc/node_modules/marked/bower.json new file mode 100644 index 0000000..3eab311 --- /dev/null +++ b/node_modules/jsdoc/node_modules/marked/bower.json @@ -0,0 +1,24 @@ +{ + "name": "marked", + "version": "0.3.2", + "homepage": "https://github.com/chjj/marked", + "authors": [ + "Christopher Jeffrey " + ], + "description": "A markdown parser built for speed", + "keywords": [ + "markdown", + "markup", + "html" + ], + "main": "lib/marked.js", + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "app/bower_components", + "test", + "tests" + ] +} diff --git a/node_modules/jsdoc/node_modules/marked/lib/marked.js b/node_modules/jsdoc/node_modules/marked/lib/marked.js index e2f08c9..0b7180f 100644 --- a/node_modules/jsdoc/node_modules/marked/lib/marked.js +++ b/node_modules/jsdoc/node_modules/marked/lib/marked.js @@ -20,7 +20,7 @@ var block = { lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/, + html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, table: noop, paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, @@ -868,7 +868,7 @@ Renderer.prototype.link = function(href, title, text) { } catch (e) { return ''; } - if (prot.indexOf('javascript:') === 0) { + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) { return ''; } } @@ -1154,8 +1154,13 @@ function marked(src, opt, callback) { pending = tokens.length; - var done = function() { - var out, err; + var done = function(err) { + if (err) { + opt.highlight = highlight; + return callback(err); + } + + var out; try { out = Parser.parse(tokens, opt); @@ -1184,6 +1189,7 @@ function marked(src, opt, callback) { return --pending || done(); } return highlight(token.text, token.lang, function(err, code) { + if (err) return done(err); if (code == null || code === token.text) { return --pending || done(); } @@ -1253,7 +1259,7 @@ marked.inlineLexer = InlineLexer.output; marked.parse = marked; -if (typeof exports === 'object') { +if (typeof module !== 'undefined' && typeof exports === 'object') { module.exports = marked; } else if (typeof define === 'function' && define.amd) { define(function() { return marked; }); diff --git a/node_modules/jsdoc/node_modules/marked/marked.min.js b/node_modules/jsdoc/node_modules/marked/marked.min.js new file mode 100644 index 0000000..a5164c4 --- /dev/null +++ b/node_modules/jsdoc/node_modules/marked/marked.min.js @@ -0,0 +1,6 @@ +/** + * marked - a markdown parser + * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) + * https://github.com/chjj/marked + */ +(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:cap[1]==="pre"||cap[1]==="script"||cap[1]==="style",text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=escape(this.smartypants(cap[0]));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
      "+(escaped?code:escape(code,true))+"\n
      "}return'
      '+(escaped?code:escape(code,true))+"\n
      \n"};Renderer.prototype.blockquote=function(quote){return"
      \n"+quote+"
      \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
      \n":"
      \n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
    1. "+text+"
    2. \n"};Renderer.prototype.paragraph=function(text){return"

      "+text+"

      \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
      \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
      ":"
      "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0){return""}}var out='
      ";return out};Renderer.prototype.image=function(href,title,text){var out=''+text+'":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:

      "+escape(e.message+"",true)+"
      "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/marked/package.json b/node_modules/jsdoc/node_modules/marked/package.json index e1b1c58..2c8e237 100644 --- a/node_modules/jsdoc/node_modules/marked/package.json +++ b/node_modules/jsdoc/node_modules/marked/package.json @@ -4,7 +4,7 @@ "author": { "name": "Christopher Jeffrey" }, - "version": "0.3.2", + "version": "0.3.3", "main": "./lib/marked.js", "bin": { "marked": "./bin/marked" @@ -41,13 +41,12 @@ "test": "node test", "bench": "node test --bench" }, - "_id": "marked@0.3.2", - "dist": { - "shasum": "015db158864438f24a64bdd61a0428b418706d09", - "tarball": "http://registry.npmjs.org/marked/-/marked-0.3.2.tgz" - }, - "_from": "marked@~0.3.1", - "_npmVersion": "1.4.3", + "gitHead": "2b5802f258c5e23e48366f2377fbb4c807f47658", + "_id": "marked@0.3.3", + "_shasum": "08bad9cac13736f6cceddc202344f1b0bf255390", + "_from": "marked@>=0.3.2 <0.4.0", + "_npmVersion": "2.3.0", + "_nodeVersion": "0.10.35", "_npmUser": { "name": "chjj", "email": "chjjeffrey@gmail.com" @@ -58,8 +57,11 @@ "email": "chjjeffrey@gmail.com" } ], + "dist": { + "shasum": "08bad9cac13736f6cceddc202344f1b0bf255390", + "tarball": "http://registry.npmjs.org/marked/-/marked-0.3.3.tgz" + }, "directories": {}, - "_shasum": "015db158864438f24a64bdd61a0428b418706d09", - "_resolved": "https://registry.npmjs.org/marked/-/marked-0.3.2.tgz", + "_resolved": "https://registry.npmjs.org/marked/-/marked-0.3.3.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/requizzle/README.md b/node_modules/jsdoc/node_modules/requizzle/README.md index 64795a3..dd75746 100644 --- a/node_modules/jsdoc/node_modules/requizzle/README.md +++ b/node_modules/jsdoc/node_modules/requizzle/README.md @@ -161,6 +161,8 @@ Fair enough. ## Changelog ## ++ 0.2.1 (December 2014): The `requirePaths` option no longer inserts an extra line break into the +source file. + 0.2.0 (June 2014): The `requirePaths` option can now contain `before` and `after` properties. Paths in the `before` property will be searched first; paths in the `after` property will be searched last. @@ -168,6 +170,7 @@ searched last. paths first rather than last. + 0.1.0 (June 2014): Initial release. + ## Acknowledgements ## Requizzle is very loosely adapted from Johannes Ewald's [rewire](https://github.com/jhnns/rewire) diff --git a/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/requirepaths.js b/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/requirepaths.js index 1f5de10..eb0ebf0 100644 --- a/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/requirepaths.js +++ b/node_modules/jsdoc/node_modules/requizzle/lib/wrappers/requirepaths.js @@ -41,7 +41,7 @@ function requirePaths(parentModule, opts) { exports.before = function before(targetPath, parentModule, opts) { var resolvedPaths = requirePaths(parentModule, opts); return 'module.paths = ' + JSON.stringify(resolvedPaths.before) + '.concat(module.paths)' + - '.concat(' + JSON.stringify(resolvedPaths.after) + ');\n'; + '.concat(' + JSON.stringify(resolvedPaths.after) + '); '; }; exports.after = function after(targetPath, parentModule, opts) { diff --git a/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/LICENSE b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/LICENSE new file mode 100644 index 0000000..0d6b873 --- /dev/null +++ b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative +Reporters & Editors + +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/jsdoc/node_modules/requizzle/node_modules/underscore/README.md b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/README.md new file mode 100644 index 0000000..c2ba259 --- /dev/null +++ b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/README.md @@ -0,0 +1,22 @@ + __ + /\ \ __ + __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ + /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ + \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ + \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ + \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ + \ \____/ + \/___/ + +Underscore.js is a utility-belt library for JavaScript that provides +support for the usual functional suspects (each, map, reduce, filter...) +without extending any core JavaScript objects. + +For Docs, License, Tests, and pre-packed downloads, see: +http://underscorejs.org + +Underscore is an open-sourced component of DocumentCloud: +https://github.com/documentcloud + +Many thanks to our contributors: +https://github.com/jashkenas/underscore/contributors diff --git a/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/package.json b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/package.json new file mode 100644 index 0000000..70d4f93 --- /dev/null +++ b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/package.json @@ -0,0 +1,50 @@ +{ + "name": "underscore", + "description": "JavaScript's functional programming helper library.", + "homepage": "http://underscorejs.org", + "keywords": [ + "util", + "functional", + "server", + "client", + "browser" + ], + "author": { + "name": "Jeremy Ashkenas", + "email": "jeremy@documentcloud.org" + }, + "repository": { + "type": "git", + "url": "git://github.com/jashkenas/underscore.git" + }, + "main": "underscore.js", + "version": "1.6.0", + "devDependencies": { + "docco": "0.6.x", + "phantomjs": "1.9.0-1", + "uglify-js": "2.4.x" + }, + "scripts": { + "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true", + "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js", + "doc": "docco underscore.js" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/jashkenas/underscore/master/LICENSE" + } + ], + "files": [ + "underscore.js", + "underscore-min.js", + "LICENSE" + ], + "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nUnderscore is an open-sourced component of DocumentCloud:\nhttps://github.com/documentcloud\n\nMany thanks to our contributors:\nhttps://github.com/jashkenas/underscore/contributors\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/jashkenas/underscore/issues" + }, + "_id": "underscore@1.6.0", + "_from": "underscore@>=1.6.0 <1.7.0" +} diff --git a/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore-min.js b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore-min.js new file mode 100644 index 0000000..3434d6c --- /dev/null +++ b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore-min.js @@ -0,0 +1,6 @@ +// Underscore.js 1.6.0 +// http://underscorejs.org +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. +(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.6.0";var A=j.each=j.forEach=function(n,t,e){if(null==n)return n;if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return;return n};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var O="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},j.find=j.detect=function(n,t,r){var e;return k(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var k=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:k(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,j.property(t))},j.where=function(n,t){return j.filter(n,j.matches(t))},j.findWhere=function(n,t){return j.find(n,j.matches(t))},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var e=-1/0,u=-1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;o>u&&(e=n,u=o)}),e},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var e=1/0,u=1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;u>o&&(e=n,u=o)}),e},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=j.values(n)),n[j.random(n.length-1)]):j.shuffle(n).slice(0,Math.max(0,t))};var E=function(n){return null==n?j.identity:j.isFunction(n)?n:j.property(n)};j.sortBy=function(n,t,r){return t=E(t),j.pluck(j.map(n,function(n,e,u){return{value:n,index:e,criteria:t.call(r,n,e,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=E(r),A(t,function(i,a){var o=r.call(e,i,a,t);n(u,o,i)}),u}};j.groupBy=F(function(n,t,r){j.has(n,t)?n[t].push(r):n[t]=[r]}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=E(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])t?[]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.partition=function(n,t){var r=[],e=[];return A(n,function(n){(t(n)?r:e).push(n)}),[r,e]},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.contains(t,n)})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===j&&(e[u]=arguments[r++]);for(;r=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u),e=u=null):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o,c=function(){var l=j.now()-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u),i=u=null))};return function(){i=this,u=arguments,a=j.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u),i=u=null),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return j.partial(t,n)},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=function(n){if(!j.isObject(n))return[];if(w)return w(n);var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.constant=function(n){return function(){return n}},j.property=function(n){return function(t){return t[n]}},j.matches=function(n){return function(t){if(t===n)return!0;for(var r in n)if(n[r]!==t[r])return!1;return!0}},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},j.now=Date.now||function(){return(new Date).getTime()};var T={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};T.unescape=j.invert(T.escape);var I={escape:new RegExp("["+j.keys(T.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(T.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(I[n],function(t){return T[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return j})}).call(this); +//# sourceMappingURL=underscore-min.map \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore.js b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore.js new file mode 100644 index 0000000..9a4cabe --- /dev/null +++ b/node_modules/jsdoc/node_modules/requizzle/node_modules/underscore/underscore.js @@ -0,0 +1,1343 @@ +// Underscore.js 1.6.0 +// http://underscorejs.org +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. + +(function() { + + // Baseline setup + // -------------- + + // Establish the root object, `window` in the browser, or `exports` on the server. + var root = this; + + // Save the previous value of the `_` variable. + var previousUnderscore = root._; + + // Establish the object that gets returned to break out of a loop iteration. + var breaker = {}; + + // Save bytes in the minified (but not gzipped) version: + var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; + + // Create quick reference variables for speed access to core prototypes. + var + push = ArrayProto.push, + slice = ArrayProto.slice, + concat = ArrayProto.concat, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + + // All **ECMAScript 5** native function implementations that we hope to use + // are declared here. + var + nativeForEach = ArrayProto.forEach, + nativeMap = ArrayProto.map, + nativeReduce = ArrayProto.reduce, + nativeReduceRight = ArrayProto.reduceRight, + nativeFilter = ArrayProto.filter, + nativeEvery = ArrayProto.every, + nativeSome = ArrayProto.some, + nativeIndexOf = ArrayProto.indexOf, + nativeLastIndexOf = ArrayProto.lastIndexOf, + nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeBind = FuncProto.bind; + + // Create a safe reference to the Underscore object for use below. + var _ = function(obj) { + if (obj instanceof _) return obj; + if (!(this instanceof _)) return new _(obj); + this._wrapped = obj; + }; + + // Export the Underscore object for **Node.js**, with + // backwards-compatibility for the old `require()` API. If we're in + // the browser, add `_` as a global object via a string identifier, + // for Closure Compiler "advanced" mode. + if (typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = _; + } + exports._ = _; + } else { + root._ = _; + } + + // Current version. + _.VERSION = '1.6.0'; + + // Collection Functions + // -------------------- + + // The cornerstone, an `each` implementation, aka `forEach`. + // Handles objects with the built-in `forEach`, arrays, and raw objects. + // Delegates to **ECMAScript 5**'s native `forEach` if available. + var each = _.each = _.forEach = function(obj, iterator, context) { + if (obj == null) return obj; + if (nativeForEach && obj.forEach === nativeForEach) { + obj.forEach(iterator, context); + } else if (obj.length === +obj.length) { + for (var i = 0, length = obj.length; i < length; i++) { + if (iterator.call(context, obj[i], i, obj) === breaker) return; + } + } else { + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; + } + } + return obj; + }; + + // Return the results of applying the iterator to each element. + // Delegates to **ECMAScript 5**'s native `map` if available. + _.map = _.collect = function(obj, iterator, context) { + var results = []; + if (obj == null) return results; + if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); + each(obj, function(value, index, list) { + results.push(iterator.call(context, value, index, list)); + }); + return results; + }; + + var reduceError = 'Reduce of empty array with no initial value'; + + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. + _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { + var initial = arguments.length > 2; + if (obj == null) obj = []; + if (nativeReduce && obj.reduce === nativeReduce) { + if (context) iterator = _.bind(iterator, context); + return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); + } + each(obj, function(value, index, list) { + if (!initial) { + memo = value; + initial = true; + } else { + memo = iterator.call(context, memo, value, index, list); + } + }); + if (!initial) throw new TypeError(reduceError); + return memo; + }; + + // The right-associative version of reduce, also known as `foldr`. + // Delegates to **ECMAScript 5**'s native `reduceRight` if available. + _.reduceRight = _.foldr = function(obj, iterator, memo, context) { + var initial = arguments.length > 2; + if (obj == null) obj = []; + if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { + if (context) iterator = _.bind(iterator, context); + return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); + } + var length = obj.length; + if (length !== +length) { + var keys = _.keys(obj); + length = keys.length; + } + each(obj, function(value, index, list) { + index = keys ? keys[--length] : --length; + if (!initial) { + memo = obj[index]; + initial = true; + } else { + memo = iterator.call(context, memo, obj[index], index, list); + } + }); + if (!initial) throw new TypeError(reduceError); + return memo; + }; + + // Return the first value which passes a truth test. Aliased as `detect`. + _.find = _.detect = function(obj, predicate, context) { + var result; + any(obj, function(value, index, list) { + if (predicate.call(context, value, index, list)) { + result = value; + return true; + } + }); + return result; + }; + + // Return all the elements that pass a truth test. + // Delegates to **ECMAScript 5**'s native `filter` if available. + // Aliased as `select`. + _.filter = _.select = function(obj, predicate, context) { + var results = []; + if (obj == null) return results; + if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context); + each(obj, function(value, index, list) { + if (predicate.call(context, value, index, list)) results.push(value); + }); + return results; + }; + + // Return all the elements for which a truth test fails. + _.reject = function(obj, predicate, context) { + return _.filter(obj, function(value, index, list) { + return !predicate.call(context, value, index, list); + }, context); + }; + + // Determine whether all of the elements match a truth test. + // Delegates to **ECMAScript 5**'s native `every` if available. + // Aliased as `all`. + _.every = _.all = function(obj, predicate, context) { + predicate || (predicate = _.identity); + var result = true; + if (obj == null) return result; + if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context); + each(obj, function(value, index, list) { + if (!(result = result && predicate.call(context, value, index, list))) return breaker; + }); + return !!result; + }; + + // Determine if at least one element in the object matches a truth test. + // Delegates to **ECMAScript 5**'s native `some` if available. + // Aliased as `any`. + var any = _.some = _.any = function(obj, predicate, context) { + predicate || (predicate = _.identity); + var result = false; + if (obj == null) return result; + if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context); + each(obj, function(value, index, list) { + if (result || (result = predicate.call(context, value, index, list))) return breaker; + }); + return !!result; + }; + + // Determine if the array or object contains a given value (using `===`). + // Aliased as `include`. + _.contains = _.include = function(obj, target) { + if (obj == null) return false; + if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; + return any(obj, function(value) { + return value === target; + }); + }; + + // Invoke a method (with arguments) on every item in a collection. + _.invoke = function(obj, method) { + var args = slice.call(arguments, 2); + var isFunc = _.isFunction(method); + return _.map(obj, function(value) { + return (isFunc ? method : value[method]).apply(value, args); + }); + }; + + // Convenience version of a common use case of `map`: fetching a property. + _.pluck = function(obj, key) { + return _.map(obj, _.property(key)); + }; + + // Convenience version of a common use case of `filter`: selecting only objects + // containing specific `key:value` pairs. + _.where = function(obj, attrs) { + return _.filter(obj, _.matches(attrs)); + }; + + // Convenience version of a common use case of `find`: getting the first object + // containing specific `key:value` pairs. + _.findWhere = function(obj, attrs) { + return _.find(obj, _.matches(attrs)); + }; + + // Return the maximum element or (element-based computation). + // Can't optimize arrays of integers longer than 65,535 elements. + // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797) + _.max = function(obj, iterator, context) { + if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { + return Math.max.apply(Math, obj); + } + var result = -Infinity, lastComputed = -Infinity; + each(obj, function(value, index, list) { + var computed = iterator ? iterator.call(context, value, index, list) : value; + if (computed > lastComputed) { + result = value; + lastComputed = computed; + } + }); + return result; + }; + + // Return the minimum element (or element-based computation). + _.min = function(obj, iterator, context) { + if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { + return Math.min.apply(Math, obj); + } + var result = Infinity, lastComputed = Infinity; + each(obj, function(value, index, list) { + var computed = iterator ? iterator.call(context, value, index, list) : value; + if (computed < lastComputed) { + result = value; + lastComputed = computed; + } + }); + return result; + }; + + // Shuffle an array, using the modern version of the + // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). + _.shuffle = function(obj) { + var rand; + var index = 0; + var shuffled = []; + each(obj, function(value) { + rand = _.random(index++); + shuffled[index - 1] = shuffled[rand]; + shuffled[rand] = value; + }); + return shuffled; + }; + + // Sample **n** random values from a collection. + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `map`. + _.sample = function(obj, n, guard) { + if (n == null || guard) { + if (obj.length !== +obj.length) obj = _.values(obj); + return obj[_.random(obj.length - 1)]; + } + return _.shuffle(obj).slice(0, Math.max(0, n)); + }; + + // An internal function to generate lookup iterators. + var lookupIterator = function(value) { + if (value == null) return _.identity; + if (_.isFunction(value)) return value; + return _.property(value); + }; + + // Sort the object's values by a criterion produced by an iterator. + _.sortBy = function(obj, iterator, context) { + iterator = lookupIterator(iterator); + return _.pluck(_.map(obj, function(value, index, list) { + return { + value: value, + index: index, + criteria: iterator.call(context, value, index, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index - right.index; + }), 'value'); + }; + + // An internal function used for aggregate "group by" operations. + var group = function(behavior) { + return function(obj, iterator, context) { + var result = {}; + iterator = lookupIterator(iterator); + each(obj, function(value, index) { + var key = iterator.call(context, value, index, obj); + behavior(result, key, value); + }); + return result; + }; + }; + + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + _.groupBy = group(function(result, key, value) { + _.has(result, key) ? result[key].push(value) : result[key] = [value]; + }); + + // Indexes the object's values by a criterion, similar to `groupBy`, but for + // when you know that your index values will be unique. + _.indexBy = group(function(result, key, value) { + result[key] = value; + }); + + // Counts instances of an object that group by a certain criterion. Pass + // either a string attribute to count by, or a function that returns the + // criterion. + _.countBy = group(function(result, key) { + _.has(result, key) ? result[key]++ : result[key] = 1; + }); + + // Use a comparator function to figure out the smallest index at which + // an object should be inserted so as to maintain order. Uses binary search. + _.sortedIndex = function(array, obj, iterator, context) { + iterator = lookupIterator(iterator); + var value = iterator.call(context, obj); + var low = 0, high = array.length; + while (low < high) { + var mid = (low + high) >>> 1; + iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; + } + return low; + }; + + // Safely create a real, live array from anything iterable. + _.toArray = function(obj) { + if (!obj) return []; + if (_.isArray(obj)) return slice.call(obj); + if (obj.length === +obj.length) return _.map(obj, _.identity); + return _.values(obj); + }; + + // Return the number of elements in an object. + _.size = function(obj) { + if (obj == null) return 0; + return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; + }; + + // Array Functions + // --------------- + + // Get the first element of an array. Passing **n** will return the first N + // values in the array. Aliased as `head` and `take`. The **guard** check + // allows it to work with `_.map`. + _.first = _.head = _.take = function(array, n, guard) { + if (array == null) return void 0; + if ((n == null) || guard) return array[0]; + if (n < 0) return []; + return slice.call(array, 0, n); + }; + + // Returns everything but the last entry of the array. Especially useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. The **guard** check allows it to work with + // `_.map`. + _.initial = function(array, n, guard) { + return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); + }; + + // Get the last element of an array. Passing **n** will return the last N + // values in the array. The **guard** check allows it to work with `_.map`. + _.last = function(array, n, guard) { + if (array == null) return void 0; + if ((n == null) || guard) return array[array.length - 1]; + return slice.call(array, Math.max(array.length - n, 0)); + }; + + // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. + // Especially useful on the arguments object. Passing an **n** will return + // the rest N values in the array. The **guard** + // check allows it to work with `_.map`. + _.rest = _.tail = _.drop = function(array, n, guard) { + return slice.call(array, (n == null) || guard ? 1 : n); + }; + + // Trim out all falsy values from an array. + _.compact = function(array) { + return _.filter(array, _.identity); + }; + + // Internal implementation of a recursive `flatten` function. + var flatten = function(input, shallow, output) { + if (shallow && _.every(input, _.isArray)) { + return concat.apply(output, input); + } + each(input, function(value) { + if (_.isArray(value) || _.isArguments(value)) { + shallow ? push.apply(output, value) : flatten(value, shallow, output); + } else { + output.push(value); + } + }); + return output; + }; + + // Flatten out an array, either recursively (by default), or just one level. + _.flatten = function(array, shallow) { + return flatten(array, shallow, []); + }; + + // Return a version of the array that does not contain the specified value(s). + _.without = function(array) { + return _.difference(array, slice.call(arguments, 1)); + }; + + // Split an array into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(array, predicate) { + var pass = [], fail = []; + each(array, function(elem) { + (predicate(elem) ? pass : fail).push(elem); + }); + return [pass, fail]; + }; + + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // Aliased as `unique`. + _.uniq = _.unique = function(array, isSorted, iterator, context) { + if (_.isFunction(isSorted)) { + context = iterator; + iterator = isSorted; + isSorted = false; + } + var initial = iterator ? _.map(array, iterator, context) : array; + var results = []; + var seen = []; + each(initial, function(value, index) { + if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { + seen.push(value); + results.push(array[index]); + } + }); + return results; + }; + + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + _.union = function() { + return _.uniq(_.flatten(arguments, true)); + }; + + // Produce an array that contains every item shared between all the + // passed-in arrays. + _.intersection = function(array) { + var rest = slice.call(arguments, 1); + return _.filter(_.uniq(array), function(item) { + return _.every(rest, function(other) { + return _.contains(other, item); + }); + }); + }; + + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + _.difference = function(array) { + var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); + return _.filter(array, function(value){ return !_.contains(rest, value); }); + }; + + // Zip together multiple lists into a single array -- elements that share + // an index go together. + _.zip = function() { + var length = _.max(_.pluck(arguments, 'length').concat(0)); + var results = new Array(length); + for (var i = 0; i < length; i++) { + results[i] = _.pluck(arguments, '' + i); + } + return results; + }; + + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + _.object = function(list, values) { + if (list == null) return {}; + var result = {}; + for (var i = 0, length = list.length; i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + }; + + // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), + // we need this function. Return the position of the first occurrence of an + // item in an array, or -1 if the item is not included in the array. + // Delegates to **ECMAScript 5**'s native `indexOf` if available. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + _.indexOf = function(array, item, isSorted) { + if (array == null) return -1; + var i = 0, length = array.length; + if (isSorted) { + if (typeof isSorted == 'number') { + i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted); + } else { + i = _.sortedIndex(array, item); + return array[i] === item ? i : -1; + } + } + if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); + for (; i < length; i++) if (array[i] === item) return i; + return -1; + }; + + // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. + _.lastIndexOf = function(array, item, from) { + if (array == null) return -1; + var hasIndex = from != null; + if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { + return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); + } + var i = (hasIndex ? from : array.length); + while (i--) if (array[i] === item) return i; + return -1; + }; + + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](http://docs.python.org/library/functions.html#range). + _.range = function(start, stop, step) { + if (arguments.length <= 1) { + stop = start || 0; + start = 0; + } + step = arguments[2] || 1; + + var length = Math.max(Math.ceil((stop - start) / step), 0); + var idx = 0; + var range = new Array(length); + + while(idx < length) { + range[idx++] = start; + start += step; + } + + return range; + }; + + // Function (ahem) Functions + // ------------------ + + // Reusable constructor function for prototype setting. + var ctor = function(){}; + + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if + // available. + _.bind = function(func, context) { + var args, bound; + if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + if (!_.isFunction(func)) throw new TypeError; + args = slice.call(arguments, 2); + return bound = function() { + if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); + ctor.prototype = func.prototype; + var self = new ctor; + ctor.prototype = null; + var result = func.apply(self, args.concat(slice.call(arguments))); + if (Object(result) === result) return result; + return self; + }; + }; + + // Partially apply a function by creating a version that has had some of its + // arguments pre-filled, without changing its dynamic `this` context. _ acts + // as a placeholder, allowing any combination of arguments to be pre-filled. + _.partial = function(func) { + var boundArgs = slice.call(arguments, 1); + return function() { + var position = 0; + var args = boundArgs.slice(); + for (var i = 0, length = args.length; i < length; i++) { + if (args[i] === _) args[i] = arguments[position++]; + } + while (position < arguments.length) args.push(arguments[position++]); + return func.apply(this, args); + }; + }; + + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. + _.bindAll = function(obj) { + var funcs = slice.call(arguments, 1); + if (funcs.length === 0) throw new Error('bindAll must be passed function names'); + each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); + return obj; + }; + + // Memoize an expensive function by storing its results. + _.memoize = function(func, hasher) { + var memo = {}; + hasher || (hasher = _.identity); + return function() { + var key = hasher.apply(this, arguments); + return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); + }; + }; + + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + _.delay = function(func, wait) { + var args = slice.call(arguments, 2); + return setTimeout(function(){ return func.apply(null, args); }, wait); + }; + + // Defers a function, scheduling it to run after the current call stack has + // cleared. + _.defer = function(func) { + return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); + }; + + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. + _.throttle = function(func, wait, options) { + var context, args, result; + var timeout = null; + var previous = 0; + options || (options = {}); + var later = function() { + previous = options.leading === false ? 0 : _.now(); + timeout = null; + result = func.apply(context, args); + context = args = null; + }; + return function() { + var now = _.now(); + if (!previous && options.leading === false) previous = now; + var remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }; + + // Returns a function, that, as long as it continues to be invoked, will not + // be triggered. The function will be called after it stops being called for + // N milliseconds. If `immediate` is passed, trigger the function on the + // leading edge, instead of the trailing. + _.debounce = function(func, wait, immediate) { + var timeout, args, context, timestamp, result; + + var later = function() { + var last = _.now() - timestamp; + if (last < wait) { + timeout = setTimeout(later, wait - last); + } else { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + context = args = null; + } + } + }; + + return function() { + context = this; + args = arguments; + timestamp = _.now(); + var callNow = immediate && !timeout; + if (!timeout) { + timeout = setTimeout(later, wait); + } + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + + return result; + }; + }; + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = function(func) { + var ran = false, memo; + return function() { + if (ran) return memo; + ran = true; + memo = func.apply(this, arguments); + func = null; + return memo; + }; + }; + + // Returns the first function passed as an argument to the second, + // allowing you to adjust arguments, run code before and after, and + // conditionally execute the original function. + _.wrap = function(func, wrapper) { + return _.partial(wrapper, func); + }; + + // Returns a function that is the composition of a list of functions, each + // consuming the return value of the function that follows. + _.compose = function() { + var funcs = arguments; + return function() { + var args = arguments; + for (var i = funcs.length - 1; i >= 0; i--) { + args = [funcs[i].apply(this, args)]; + } + return args[0]; + }; + }; + + // Returns a function that will only be executed after being called N times. + _.after = function(times, func) { + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } + }; + }; + + // Object Functions + // ---------------- + + // Retrieve the names of an object's properties. + // Delegates to **ECMAScript 5**'s native `Object.keys` + _.keys = function(obj) { + if (!_.isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + for (var key in obj) if (_.has(obj, key)) keys.push(key); + return keys; + }; + + // Retrieve the values of an object's properties. + _.values = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var values = new Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[keys[i]]; + } + return values; + }; + + // Convert an object into a list of `[key, value]` pairs. + _.pairs = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var pairs = new Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [keys[i], obj[keys[i]]]; + } + return pairs; + }; + + // Invert the keys and values of an object. The values must be serializable. + _.invert = function(obj) { + var result = {}; + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + result[obj[keys[i]]] = keys[i]; + } + return result; + }; + + // Return a sorted list of the function names available on the object. + // Aliased as `methods` + _.functions = _.methods = function(obj) { + var names = []; + for (var key in obj) { + if (_.isFunction(obj[key])) names.push(key); + } + return names.sort(); + }; + + // Extend a given object with all the properties in passed-in object(s). + _.extend = function(obj) { + each(slice.call(arguments, 1), function(source) { + if (source) { + for (var prop in source) { + obj[prop] = source[prop]; + } + } + }); + return obj; + }; + + // Return a copy of the object only containing the whitelisted properties. + _.pick = function(obj) { + var copy = {}; + var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); + each(keys, function(key) { + if (key in obj) copy[key] = obj[key]; + }); + return copy; + }; + + // Return a copy of the object without the blacklisted properties. + _.omit = function(obj) { + var copy = {}; + var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); + for (var key in obj) { + if (!_.contains(keys, key)) copy[key] = obj[key]; + } + return copy; + }; + + // Fill in a given object with default properties. + _.defaults = function(obj) { + each(slice.call(arguments, 1), function(source) { + if (source) { + for (var prop in source) { + if (obj[prop] === void 0) obj[prop] = source[prop]; + } + } + }); + return obj; + }; + + // Create a (shallow-cloned) duplicate of an object. + _.clone = function(obj) { + if (!_.isObject(obj)) return obj; + return _.isArray(obj) ? obj.slice() : _.extend({}, obj); + }; + + // Invokes interceptor with the obj, and then returns obj. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + _.tap = function(obj, interceptor) { + interceptor(obj); + return obj; + }; + + // Internal recursive comparison function for `isEqual`. + var eq = function(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a == 1 / b; + // A strict comparison is necessary because `null == undefined`. + if (a == null || b == null) return a === b; + // Unwrap any wrapped objects. + if (a instanceof _) a = a._wrapped; + if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className != toString.call(b)) return false; + switch (className) { + // Strings, numbers, dates, and booleans are compared by value. + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return a == String(b); + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for + // other numeric values. + return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a == +b; + // RegExps are compared by their source patterns and flags. + case '[object RegExp]': + return a.source == b.source && + a.global == b.global && + a.multiline == b.multiline && + a.ignoreCase == b.ignoreCase; + } + if (typeof a != 'object' || typeof b != 'object') return false; + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] == a) return bStack[length] == b; + } + // Objects with different constructors are not equivalent, but `Object`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && + _.isFunction(bCtor) && (bCtor instanceof bCtor)) + && ('constructor' in a && 'constructor' in b)) { + return false; + } + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + var size = 0, result = true; + // Recursively compare objects and arrays. + if (className == '[object Array]') { + // Compare array lengths to determine if a deep comparison is necessary. + size = a.length; + result = size == b.length; + if (result) { + // Deep compare the contents, ignoring non-numeric properties. + while (size--) { + if (!(result = eq(a[size], b[size], aStack, bStack))) break; + } + } + } else { + // Deep compare objects. + for (var key in a) { + if (_.has(a, key)) { + // Count the expected number of properties. + size++; + // Deep compare each member. + if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; + } + } + // Ensure that both objects contain the same number of properties. + if (result) { + for (key in b) { + if (_.has(b, key) && !(size--)) break; + } + result = !size; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return result; + }; + + // Perform a deep comparison to check if two objects are equal. + _.isEqual = function(a, b) { + return eq(a, b, [], []); + }; + + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + _.isEmpty = function(obj) { + if (obj == null) return true; + if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; + for (var key in obj) if (_.has(obj, key)) return false; + return true; + }; + + // Is a given value a DOM element? + _.isElement = function(obj) { + return !!(obj && obj.nodeType === 1); + }; + + // Is a given value an array? + // Delegates to ECMA5's native Array.isArray + _.isArray = nativeIsArray || function(obj) { + return toString.call(obj) == '[object Array]'; + }; + + // Is a given variable an object? + _.isObject = function(obj) { + return obj === Object(obj); + }; + + // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. + each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { + _['is' + name] = function(obj) { + return toString.call(obj) == '[object ' + name + ']'; + }; + }); + + // Define a fallback version of the method in browsers (ahem, IE), where + // there isn't any inspectable "Arguments" type. + if (!_.isArguments(arguments)) { + _.isArguments = function(obj) { + return !!(obj && _.has(obj, 'callee')); + }; + } + + // Optimize `isFunction` if appropriate. + if (typeof (/./) !== 'function') { + _.isFunction = function(obj) { + return typeof obj === 'function'; + }; + } + + // Is a given object a finite number? + _.isFinite = function(obj) { + return isFinite(obj) && !isNaN(parseFloat(obj)); + }; + + // Is the given value `NaN`? (NaN is the only number which does not equal itself). + _.isNaN = function(obj) { + return _.isNumber(obj) && obj != +obj; + }; + + // Is a given value a boolean? + _.isBoolean = function(obj) { + return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; + }; + + // Is a given value equal to null? + _.isNull = function(obj) { + return obj === null; + }; + + // Is a given variable undefined? + _.isUndefined = function(obj) { + return obj === void 0; + }; + + // Shortcut function for checking if an object has a given property directly + // on itself (in other words, not on a prototype). + _.has = function(obj, key) { + return hasOwnProperty.call(obj, key); + }; + + // Utility Functions + // ----------------- + + // Run Underscore.js in *noConflict* mode, returning the `_` variable to its + // previous owner. Returns a reference to the Underscore object. + _.noConflict = function() { + root._ = previousUnderscore; + return this; + }; + + // Keep the identity function around for default iterators. + _.identity = function(value) { + return value; + }; + + _.constant = function(value) { + return function () { + return value; + }; + }; + + _.property = function(key) { + return function(obj) { + return obj[key]; + }; + }; + + // Returns a predicate for checking whether an object has a given set of `key:value` pairs. + _.matches = function(attrs) { + return function(obj) { + if (obj === attrs) return true; //avoid comparing an object to itself. + for (var key in attrs) { + if (attrs[key] !== obj[key]) + return false; + } + return true; + } + }; + + // Run a function **n** times. + _.times = function(n, iterator, context) { + var accum = Array(Math.max(0, n)); + for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); + return accum; + }; + + // Return a random integer between min and max (inclusive). + _.random = function(min, max) { + if (max == null) { + max = min; + min = 0; + } + return min + Math.floor(Math.random() * (max - min + 1)); + }; + + // A (possibly faster) way to get the current timestamp as an integer. + _.now = Date.now || function() { return new Date().getTime(); }; + + // List of HTML entities for escaping. + var entityMap = { + escape: { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + } + }; + entityMap.unescape = _.invert(entityMap.escape); + + // Regexes containing the keys and values listed immediately above. + var entityRegexes = { + escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), + unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') + }; + + // Functions for escaping and unescaping strings to/from HTML interpolation. + _.each(['escape', 'unescape'], function(method) { + _[method] = function(string) { + if (string == null) return ''; + return ('' + string).replace(entityRegexes[method], function(match) { + return entityMap[method][match]; + }); + }; + }); + + // If the value of the named `property` is a function then invoke it with the + // `object` as context; otherwise, return it. + _.result = function(object, property) { + if (object == null) return void 0; + var value = object[property]; + return _.isFunction(value) ? value.call(object) : value; + }; + + // Add your own custom functions to the Underscore object. + _.mixin = function(obj) { + each(_.functions(obj), function(name) { + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return result.call(this, func.apply(_, args)); + }; + }); + }; + + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + _.uniqueId = function(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + }; + + // By default, Underscore uses ERB-style template delimiters, change the + // following template settings to use alternative delimiters. + _.templateSettings = { + evaluate : /<%([\s\S]+?)%>/g, + interpolate : /<%=([\s\S]+?)%>/g, + escape : /<%-([\s\S]+?)%>/g + }; + + // When customizing `templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + _.template = function(text, data, settings) { + var render; + settings = _.defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = new RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset) + .replace(escaper, function(match) { return '\\' + escapes[match]; }); + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } + if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } + if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + index = offset + match.length; + return match; + }); + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + "return __p;\n"; + + try { + render = new Function(settings.variable || 'obj', '_', source); + } catch (e) { + e.source = source; + throw e; + } + + if (data) return render(data, _); + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled function source as a convenience for precompilation. + template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; + + return template; + }; + + // Add a "chain" function, which will delegate to the wrapper. + _.chain = function(obj) { + return _(obj).chain(); + }; + + // OOP + // --------------- + // If Underscore is called as a function, it returns a wrapped object that + // can be used OO-style. This wrapper holds altered versions of all the + // underscore functions. Wrapped objects may be chained. + + // Helper function to continue chaining intermediate results. + var result = function(obj) { + return this._chain ? _(obj).chain() : obj; + }; + + // Add all of the Underscore functions to the wrapper object. + _.mixin(_); + + // Add all mutator Array functions to the wrapper. + each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + method.apply(obj, arguments); + if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; + return result.call(this, obj); + }; + }); + + // Add all accessor Array functions to the wrapper. + each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + return result.call(this, method.apply(this._wrapped, arguments)); + }; + }); + + _.extend(_.prototype, { + + // Start chaining a wrapped Underscore object. + chain: function() { + this._chain = true; + return this; + }, + + // Extracts the result from a wrapped and chained object. + value: function() { + return this._wrapped; + } + + }); + + // AMD registration happens at the end for compatibility with AMD loaders + // that may not enforce next-turn semantics on modules. Even though general + // practice for AMD registration is to be anonymous, underscore registers + // as a named module because, like jQuery, it is a base library that is + // popular enough to be bundled in a third party lib, but not be part of + // an AMD load request. Those cases could generate an error when an + // anonymous define() is called outside of a loader request. + if (typeof define === 'function' && define.amd) { + define('underscore', [], function() { + return _; + }); + } +}).call(this); diff --git a/node_modules/jsdoc/node_modules/requizzle/package.json b/node_modules/jsdoc/node_modules/requizzle/package.json index 23abcfd..96c4105 100644 --- a/node_modules/jsdoc/node_modules/requizzle/package.json +++ b/node_modules/jsdoc/node_modules/requizzle/package.json @@ -1,6 +1,6 @@ { "name": "requizzle", - "version": "0.2.0", + "version": "0.2.1", "description": "Swizzle a little something into your require() calls.", "main": "index.js", "scripts": { @@ -38,11 +38,12 @@ "dependencies": { "underscore": "~1.6.0" }, - "gitHead": "696c5ca079822fba78522f56b223404600481434", - "_id": "requizzle@0.2.0", - "_shasum": "ea93c7b441ce168052391860b55a7b508c391cbd", - "_from": "requizzle@~0.2.0", - "_npmVersion": "1.4.13", + "gitHead": "be5b922edf3e08e487bf374d6add13f8da581abf", + "_id": "requizzle@0.2.1", + "_shasum": "6943c3530c4d9a7e46f1cddd51c158fc670cdbde", + "_from": "requizzle@>=0.2.0 <0.3.0", + "_npmVersion": "2.1.9", + "_nodeVersion": "0.10.33", "_npmUser": { "name": "hegemonic", "email": "jeffrey.l.williams@gmail.com" @@ -54,10 +55,10 @@ } ], "dist": { - "shasum": "ea93c7b441ce168052391860b55a7b508c391cbd", - "tarball": "http://registry.npmjs.org/requizzle/-/requizzle-0.2.0.tgz" + "shasum": "6943c3530c4d9a7e46f1cddd51c158fc670cdbde", + "tarball": "http://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.0.tgz", + "_resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/strip-json-comments/package.json b/node_modules/jsdoc/node_modules/strip-json-comments/package.json index 400cae0..ccceb2c 100644 --- a/node_modules/jsdoc/node_modules/strip-json-comments/package.json +++ b/node_modules/jsdoc/node_modules/strip-json-comments/package.json @@ -1,6 +1,6 @@ { "name": "strip-json-comments", - "version": "0.1.3", + "version": "1.0.2", "description": "Strip comments from JSON. Lets you use comments in your JSON files!", "keywords": [ "json", @@ -37,7 +37,7 @@ }, "repository": { "type": "git", - "url": "git://github.com/sindresorhus/strip-json-comments" + "url": "https://github.com/sindresorhus/strip-json-comments" }, "scripts": { "test": "mocha" @@ -48,15 +48,16 @@ "engines": { "node": ">=0.8.0" }, - "gitHead": "cbd5aede7ccbe5d5a9065b1d47070fd99ad579af", + "gitHead": "142dd671c71f90fb7fdba440184b1bb64543acb3", "bugs": { "url": "https://github.com/sindresorhus/strip-json-comments/issues" }, "homepage": "https://github.com/sindresorhus/strip-json-comments", - "_id": "strip-json-comments@0.1.3", - "_shasum": "164c64e370a8a3cc00c9e01b539e569823f0ee54", - "_from": "strip-json-comments@~0.1.3", - "_npmVersion": "1.4.13", + "_id": "strip-json-comments@1.0.2", + "_shasum": "5a48ab96023dbac1b7b8d0ffabf6f63f1677be9f", + "_from": "strip-json-comments@>=1.0.2 <1.1.0", + "_npmVersion": "2.1.2", + "_nodeVersion": "0.10.32", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" @@ -68,10 +69,10 @@ } ], "dist": { - "shasum": "164c64e370a8a3cc00c9e01b539e569823f0ee54", - "tarball": "http://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz" + "shasum": "5a48ab96023dbac1b7b8d0ffabf6f63f1677be9f", + "tarball": "http://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz", + "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.2.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/strip-json-comments/readme.md b/node_modules/jsdoc/node_modules/strip-json-comments/readme.md index ad6a178..3365232 100644 --- a/node_modules/jsdoc/node_modules/strip-json-comments/readme.md +++ b/node_modules/jsdoc/node_modules/strip-json-comments/readme.md @@ -11,7 +11,7 @@ This is now possible: } ``` -It will remove single-line comments `//` and mult-line comments `/**/`. +It will remove single-line comments `//` and multi-line comments `/**/`. Also available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin and a [require hook](https://github.com/uTest/autostrip-json-comments). @@ -63,9 +63,9 @@ $ npm install --global strip-json-comments ```sh $ strip-json-comments --help -strip-json-comments > +strip-json-comments input-file > output-file # or -cat | strip-json-comments > +strip-json-comments < input-file > output-file ``` diff --git a/node_modules/jsdoc/node_modules/strip-json-comments/strip-json-comments.js b/node_modules/jsdoc/node_modules/strip-json-comments/strip-json-comments.js index 2e7fdef..a47976f 100644 --- a/node_modules/jsdoc/node_modules/strip-json-comments/strip-json-comments.js +++ b/node_modules/jsdoc/node_modules/strip-json-comments/strip-json-comments.js @@ -34,6 +34,9 @@ } else if (insideComment === 'single' && currentChar + nextChar === '\r\n') { insideComment = false; i++; + ret += currentChar; + ret += nextChar; + continue; } else if (insideComment === 'single' && currentChar === '\n') { insideComment = false; } else if (!insideComment && currentChar + nextChar === '/*') { diff --git a/node_modules/jsdoc/node_modules/taffydb/package.json b/node_modules/jsdoc/node_modules/taffydb/package.json index 1165f20..91e3c1f 100644 --- a/node_modules/jsdoc/node_modules/taffydb/package.json +++ b/node_modules/jsdoc/node_modules/taffydb/package.json @@ -16,6 +16,6 @@ "homepage": "https://github.com/hegemonic/taffydb", "_id": "taffydb@2.6.2", "_shasum": "3c549d2f5712d7d1d109ad6bb1a4084f1b7add4e", - "_from": "https://github.com/hegemonic/taffydb/tarball/master", - "_resolved": "https://github.com/hegemonic/taffydb/tarball/master" + "_resolved": "https://github.com/hegemonic/taffydb/tarball/7d100bcee0e997ee4977e273cdce60bd8933050e", + "_from": "https://github.com/hegemonic/taffydb/tarball/7d100bcee0e997ee4977e273cdce60bd8933050e" } diff --git a/node_modules/jsdoc/node_modules/underscore/package.json b/node_modules/jsdoc/node_modules/underscore/package.json index a121112..11c7175 100644 --- a/node_modules/jsdoc/node_modules/underscore/package.json +++ b/node_modules/jsdoc/node_modules/underscore/package.json @@ -18,14 +18,15 @@ "url": "git://github.com/jashkenas/underscore.git" }, "main": "underscore.js", - "version": "1.6.0", + "version": "1.7.0", "devDependencies": { "docco": "0.6.x", - "phantomjs": "1.9.0-1", - "uglify-js": "2.4.x" + "phantomjs": "1.9.7-1", + "uglify-js": "2.4.x", + "eslint": "0.6.x" }, "scripts": { - "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true", + "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true && eslint underscore.js test/*.js test/vendor/runner.js", "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js", "doc": "docco underscore.js" }, @@ -40,11 +41,29 @@ "underscore-min.js", "LICENSE" ], - "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nUnderscore is an open-sourced component of DocumentCloud:\nhttps://github.com/documentcloud\n\nMany thanks to our contributors:\nhttps://github.com/jashkenas/underscore/contributors\n", - "readmeFilename": "README.md", + "gitHead": "da996e665deb0b69b257e80e3e257c04fde4191c", "bugs": { "url": "https://github.com/jashkenas/underscore/issues" }, - "_id": "underscore@1.6.0", - "_from": "underscore@~1.6.0" + "_id": "underscore@1.7.0", + "_shasum": "6bbaf0877500d36be34ecaa584e0db9fef035209", + "_from": "underscore@>=1.7.0 <1.8.0", + "_npmVersion": "1.4.24", + "_npmUser": { + "name": "jashkenas", + "email": "jashkenas@gmail.com" + }, + "maintainers": [ + { + "name": "jashkenas", + "email": "jashkenas@gmail.com" + } + ], + "dist": { + "shasum": "6bbaf0877500d36be34ecaa584e0db9fef035209", + "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/underscore/underscore-min.js b/node_modules/jsdoc/node_modules/underscore/underscore-min.js index 3434d6c..11f1d96 100644 --- a/node_modules/jsdoc/node_modules/underscore/underscore-min.js +++ b/node_modules/jsdoc/node_modules/underscore/underscore-min.js @@ -1,6 +1,6 @@ -// Underscore.js 1.6.0 +// Underscore.js 1.7.0 // http://underscorejs.org // (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. -(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.6.0";var A=j.each=j.forEach=function(n,t,e){if(null==n)return n;if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return;return n};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var O="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},j.find=j.detect=function(n,t,r){var e;return k(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var k=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:k(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,j.property(t))},j.where=function(n,t){return j.filter(n,j.matches(t))},j.findWhere=function(n,t){return j.find(n,j.matches(t))},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var e=-1/0,u=-1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;o>u&&(e=n,u=o)}),e},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var e=1/0,u=1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;u>o&&(e=n,u=o)}),e},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=j.values(n)),n[j.random(n.length-1)]):j.shuffle(n).slice(0,Math.max(0,t))};var E=function(n){return null==n?j.identity:j.isFunction(n)?n:j.property(n)};j.sortBy=function(n,t,r){return t=E(t),j.pluck(j.map(n,function(n,e,u){return{value:n,index:e,criteria:t.call(r,n,e,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=E(r),A(t,function(i,a){var o=r.call(e,i,a,t);n(u,o,i)}),u}};j.groupBy=F(function(n,t,r){j.has(n,t)?n[t].push(r):n[t]=[r]}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=E(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])t?[]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.partition=function(n,t){var r=[],e=[];return A(n,function(n){(t(n)?r:e).push(n)}),[r,e]},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.contains(t,n)})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===j&&(e[u]=arguments[r++]);for(;r=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u),e=u=null):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o,c=function(){var l=j.now()-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u),i=u=null))};return function(){i=this,u=arguments,a=j.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u),i=u=null),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return j.partial(t,n)},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=function(n){if(!j.isObject(n))return[];if(w)return w(n);var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.constant=function(n){return function(){return n}},j.property=function(n){return function(t){return t[n]}},j.matches=function(n){return function(t){if(t===n)return!0;for(var r in n)if(n[r]!==t[r])return!1;return!0}},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},j.now=Date.now||function(){return(new Date).getTime()};var T={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};T.unescape=j.invert(T.escape);var I={escape:new RegExp("["+j.keys(T.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(T.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(I[n],function(t){return T[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return j})}).call(this); +(function(){var n=this,t=n._,r=Array.prototype,e=Object.prototype,u=Function.prototype,i=r.push,a=r.slice,o=r.concat,l=e.toString,c=e.hasOwnProperty,f=Array.isArray,s=Object.keys,p=u.bind,h=function(n){return n instanceof h?n:this instanceof h?void(this._wrapped=n):new h(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=h),exports._=h):n._=h,h.VERSION="1.7.0";var g=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}};h.iteratee=function(n,t,r){return null==n?h.identity:h.isFunction(n)?g(n,t,r):h.isObject(n)?h.matches(n):h.property(n)},h.each=h.forEach=function(n,t,r){if(null==n)return n;t=g(t,r);var e,u=n.length;if(u===+u)for(e=0;u>e;e++)t(n[e],e,n);else{var i=h.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},h.map=h.collect=function(n,t,r){if(null==n)return[];t=h.iteratee(t,r);for(var e,u=n.length!==+n.length&&h.keys(n),i=(u||n).length,a=Array(i),o=0;i>o;o++)e=u?u[o]:o,a[o]=t(n[e],e,n);return a};var v="Reduce of empty array with no initial value";h.reduce=h.foldl=h.inject=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length,o=0;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[o++]:o++]}for(;a>o;o++)u=i?i[o]:o,r=t(r,n[u],u,n);return r},h.reduceRight=h.foldr=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[--a]:--a]}for(;a--;)u=i?i[a]:a,r=t(r,n[u],u,n);return r},h.find=h.detect=function(n,t,r){var e;return t=h.iteratee(t,r),h.some(n,function(n,r,u){return t(n,r,u)?(e=n,!0):void 0}),e},h.filter=h.select=function(n,t,r){var e=[];return null==n?e:(t=h.iteratee(t,r),h.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e)},h.reject=function(n,t,r){return h.filter(n,h.negate(h.iteratee(t)),r)},h.every=h.all=function(n,t,r){if(null==n)return!0;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,!t(n[u],u,n))return!1;return!0},h.some=h.any=function(n,t,r){if(null==n)return!1;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,t(n[u],u,n))return!0;return!1},h.contains=h.include=function(n,t){return null==n?!1:(n.length!==+n.length&&(n=h.values(n)),h.indexOf(n,t)>=0)},h.invoke=function(n,t){var r=a.call(arguments,2),e=h.isFunction(t);return h.map(n,function(n){return(e?t:n[t]).apply(n,r)})},h.pluck=function(n,t){return h.map(n,h.property(t))},h.where=function(n,t){return h.filter(n,h.matches(t))},h.findWhere=function(n,t){return h.find(n,h.matches(t))},h.max=function(n,t,r){var e,u,i=-1/0,a=-1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],e>i&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(u>a||u===-1/0&&i===-1/0)&&(i=n,a=u)});return i},h.min=function(n,t,r){var e,u,i=1/0,a=1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],i>e&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(a>u||1/0===u&&1/0===i)&&(i=n,a=u)});return i},h.shuffle=function(n){for(var t,r=n&&n.length===+n.length?n:h.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=h.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},h.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=h.values(n)),n[h.random(n.length-1)]):h.shuffle(n).slice(0,Math.max(0,t))},h.sortBy=function(n,t,r){return t=h.iteratee(t,r),h.pluck(h.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var m=function(n){return function(t,r,e){var u={};return r=h.iteratee(r,e),h.each(t,function(e,i){var a=r(e,i,t);n(u,e,a)}),u}};h.groupBy=m(function(n,t,r){h.has(n,r)?n[r].push(t):n[r]=[t]}),h.indexBy=m(function(n,t,r){n[r]=t}),h.countBy=m(function(n,t,r){h.has(n,r)?n[r]++:n[r]=1}),h.sortedIndex=function(n,t,r,e){r=h.iteratee(r,e,1);for(var u=r(t),i=0,a=n.length;a>i;){var o=i+a>>>1;r(n[o])t?[]:a.call(n,0,t)},h.initial=function(n,t,r){return a.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},h.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:a.call(n,Math.max(n.length-t,0))},h.rest=h.tail=h.drop=function(n,t,r){return a.call(n,null==t||r?1:t)},h.compact=function(n){return h.filter(n,h.identity)};var y=function(n,t,r,e){if(t&&h.every(n,h.isArray))return o.apply(e,n);for(var u=0,a=n.length;a>u;u++){var l=n[u];h.isArray(l)||h.isArguments(l)?t?i.apply(e,l):y(l,t,r,e):r||e.push(l)}return e};h.flatten=function(n,t){return y(n,t,!1,[])},h.without=function(n){return h.difference(n,a.call(arguments,1))},h.uniq=h.unique=function(n,t,r,e){if(null==n)return[];h.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=h.iteratee(r,e));for(var u=[],i=[],a=0,o=n.length;o>a;a++){var l=n[a];if(t)a&&i===l||u.push(l),i=l;else if(r){var c=r(l,a,n);h.indexOf(i,c)<0&&(i.push(c),u.push(l))}else h.indexOf(u,l)<0&&u.push(l)}return u},h.union=function(){return h.uniq(y(arguments,!0,!0,[]))},h.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!h.contains(t,i)){for(var a=1;r>a&&h.contains(arguments[a],i);a++);a===r&&t.push(i)}}return t},h.difference=function(n){var t=y(a.call(arguments,1),!0,!0,[]);return h.filter(n,function(n){return!h.contains(t,n)})},h.zip=function(n){if(null==n)return[];for(var t=h.max(arguments,"length").length,r=Array(t),e=0;t>e;e++)r[e]=h.pluck(arguments,e);return r},h.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},h.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=h.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}for(;u>e;e++)if(n[e]===t)return e;return-1},h.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=n.length;for("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1));--e>=0;)if(n[e]===t)return e;return-1},h.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var d=function(){};h.bind=function(n,t){var r,e;if(p&&n.bind===p)return p.apply(n,a.call(arguments,1));if(!h.isFunction(n))throw new TypeError("Bind must be called on a function");return r=a.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(a.call(arguments)));d.prototype=n.prototype;var u=new d;d.prototype=null;var i=n.apply(u,r.concat(a.call(arguments)));return h.isObject(i)?i:u}},h.partial=function(n){var t=a.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===h&&(e[u]=arguments[r++]);for(;r=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=h.bind(n[r],n);return n},h.memoize=function(n,t){var r=function(e){var u=r.cache,i=t?t.apply(this,arguments):e;return h.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},h.delay=function(n,t){var r=a.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},h.defer=function(n){return h.delay.apply(h,[n,1].concat(a.call(arguments,1)))},h.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var l=function(){o=r.leading===!1?0:h.now(),a=null,i=n.apply(e,u),a||(e=u=null)};return function(){var c=h.now();o||r.leading!==!1||(o=c);var f=t-(c-o);return e=this,u=arguments,0>=f||f>t?(clearTimeout(a),a=null,o=c,i=n.apply(e,u),a||(e=u=null)):a||r.trailing===!1||(a=setTimeout(l,f)),i}},h.debounce=function(n,t,r){var e,u,i,a,o,l=function(){var c=h.now()-a;t>c&&c>0?e=setTimeout(l,t-c):(e=null,r||(o=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,a=h.now();var c=r&&!e;return e||(e=setTimeout(l,t)),c&&(o=n.apply(i,u),i=u=null),o}},h.wrap=function(n,t){return h.partial(t,n)},h.negate=function(n){return function(){return!n.apply(this,arguments)}},h.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},h.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},h.before=function(n,t){var r;return function(){return--n>0?r=t.apply(this,arguments):t=null,r}},h.once=h.partial(h.before,2),h.keys=function(n){if(!h.isObject(n))return[];if(s)return s(n);var t=[];for(var r in n)h.has(n,r)&&t.push(r);return t},h.values=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},h.pairs=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},h.invert=function(n){for(var t={},r=h.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},h.functions=h.methods=function(n){var t=[];for(var r in n)h.isFunction(n[r])&&t.push(r);return t.sort()},h.extend=function(n){if(!h.isObject(n))return n;for(var t,r,e=1,u=arguments.length;u>e;e++){t=arguments[e];for(r in t)c.call(t,r)&&(n[r]=t[r])}return n},h.pick=function(n,t,r){var e,u={};if(null==n)return u;if(h.isFunction(t)){t=g(t,r);for(e in n){var i=n[e];t(i,e,n)&&(u[e]=i)}}else{var l=o.apply([],a.call(arguments,1));n=new Object(n);for(var c=0,f=l.length;f>c;c++)e=l[c],e in n&&(u[e]=n[e])}return u},h.omit=function(n,t,r){if(h.isFunction(t))t=h.negate(t);else{var e=h.map(o.apply([],a.call(arguments,1)),String);t=function(n,t){return!h.contains(e,t)}}return h.pick(n,t,r)},h.defaults=function(n){if(!h.isObject(n))return n;for(var t=1,r=arguments.length;r>t;t++){var e=arguments[t];for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n},h.clone=function(n){return h.isObject(n)?h.isArray(n)?n.slice():h.extend({},n):n},h.tap=function(n,t){return t(n),n};var b=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof h&&(n=n._wrapped),t instanceof h&&(t=t._wrapped);var u=l.call(n);if(u!==l.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]===n)return e[i]===t;var a=n.constructor,o=t.constructor;if(a!==o&&"constructor"in n&&"constructor"in t&&!(h.isFunction(a)&&a instanceof a&&h.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c,f;if("[object Array]"===u){if(c=n.length,f=c===t.length)for(;c--&&(f=b(n[c],t[c],r,e)););}else{var s,p=h.keys(n);if(c=p.length,f=h.keys(t).length===c)for(;c--&&(s=p[c],f=h.has(t,s)&&b(n[s],t[s],r,e)););}return r.pop(),e.pop(),f};h.isEqual=function(n,t){return b(n,t,[],[])},h.isEmpty=function(n){if(null==n)return!0;if(h.isArray(n)||h.isString(n)||h.isArguments(n))return 0===n.length;for(var t in n)if(h.has(n,t))return!1;return!0},h.isElement=function(n){return!(!n||1!==n.nodeType)},h.isArray=f||function(n){return"[object Array]"===l.call(n)},h.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},h.each(["Arguments","Function","String","Number","Date","RegExp"],function(n){h["is"+n]=function(t){return l.call(t)==="[object "+n+"]"}}),h.isArguments(arguments)||(h.isArguments=function(n){return h.has(n,"callee")}),"function"!=typeof/./&&(h.isFunction=function(n){return"function"==typeof n||!1}),h.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},h.isNaN=function(n){return h.isNumber(n)&&n!==+n},h.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===l.call(n)},h.isNull=function(n){return null===n},h.isUndefined=function(n){return n===void 0},h.has=function(n,t){return null!=n&&c.call(n,t)},h.noConflict=function(){return n._=t,this},h.identity=function(n){return n},h.constant=function(n){return function(){return n}},h.noop=function(){},h.property=function(n){return function(t){return t[n]}},h.matches=function(n){var t=h.pairs(n),r=t.length;return function(n){if(null==n)return!r;n=new Object(n);for(var e=0;r>e;e++){var u=t[e],i=u[0];if(u[1]!==n[i]||!(i in n))return!1}return!0}},h.times=function(n,t,r){var e=Array(Math.max(0,n));t=g(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},h.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},h.now=Date.now||function(){return(new Date).getTime()};var _={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},w=h.invert(_),j=function(n){var t=function(t){return n[t]},r="(?:"+h.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};h.escape=j(_),h.unescape=j(w),h.result=function(n,t){if(null==n)return void 0;var r=n[t];return h.isFunction(r)?n[t]():r};var x=0;h.uniqueId=function(n){var t=++x+"";return n?n+t:t},h.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var A=/(.)^/,k={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\u2028|\u2029/g,F=function(n){return"\\"+k[n]};h.template=function(n,t,r){!t&&r&&(t=r),t=h.defaults({},t,h.templateSettings);var e=RegExp([(t.escape||A).source,(t.interpolate||A).source,(t.evaluate||A).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,a,o){return i+=n.slice(u,o).replace(O,F),u=o+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=new Function(t.variable||"obj","_",i)}catch(o){throw o.source=i,o}var l=function(n){return a.call(this,n,h)},c=t.variable||"obj";return l.source="function("+c+"){\n"+i+"}",l},h.chain=function(n){var t=h(n);return t._chain=!0,t};var E=function(n){return this._chain?h(n).chain():n};h.mixin=function(n){h.each(h.functions(n),function(t){var r=h[t]=n[t];h.prototype[t]=function(){var n=[this._wrapped];return i.apply(n,arguments),E.call(this,r.apply(h,n))}})},h.mixin(h),h.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=r[n];h.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],E.call(this,r)}}),h.each(["concat","join","slice"],function(n){var t=r[n];h.prototype[n]=function(){return E.call(this,t.apply(this._wrapped,arguments))}}),h.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return h})}).call(this); //# sourceMappingURL=underscore-min.map \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/underscore/underscore.js b/node_modules/jsdoc/node_modules/underscore/underscore.js index 9a4cabe..b4f49a0 100644 --- a/node_modules/jsdoc/node_modules/underscore/underscore.js +++ b/node_modules/jsdoc/node_modules/underscore/underscore.js @@ -1,4 +1,4 @@ -// Underscore.js 1.6.0 +// Underscore.js 1.7.0 // http://underscorejs.org // (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. @@ -14,9 +14,6 @@ // Save the previous value of the `_` variable. var previousUnderscore = root._; - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - // Save bytes in the minified (but not gzipped) version: var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; @@ -31,15 +28,6 @@ // All **ECMAScript 5** native function implementations that we hope to use // are declared here. var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, nativeIsArray = Array.isArray, nativeKeys = Object.keys, nativeBind = FuncProto.bind; @@ -53,8 +41,7 @@ // Export the Underscore object for **Node.js**, with // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. + // the browser, add `_` as a global object. if (typeof exports !== 'undefined') { if (typeof module !== 'undefined' && module.exports) { exports = module.exports = _; @@ -65,98 +52,125 @@ } // Current version. - _.VERSION = '1.6.0'; + _.VERSION = '1.7.0'; + + // Internal function that returns an efficient (for current engines) version + // of the passed-in callback, to be repeatedly applied in other Underscore + // functions. + var createCallback = function(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + case 2: return function(value, other) { + return func.call(context, value, other); + }; + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; + } + return function() { + return func.apply(context, arguments); + }; + }; + + // A mostly-internal function to generate callbacks that can be applied + // to each element in a collection, returning the desired result — either + // identity, an arbitrary callback, a property matcher, or a property accessor. + _.iteratee = function(value, context, argCount) { + if (value == null) return _.identity; + if (_.isFunction(value)) return createCallback(value, context, argCount); + if (_.isObject(value)) return _.matches(value); + return _.property(value); + }; // Collection Functions // -------------------- // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { + // Handles raw objects in addition to array-likes. Treats all + // sparse array-likes as if they were dense. + _.each = _.forEach = function(obj, iteratee, context) { if (obj == null) return obj; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, length = obj.length; i < length; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; + iteratee = createCallback(iteratee, context); + var i, length = obj.length; + if (length === +length) { + for (i = 0; i < length; i++) { + iteratee(obj[i], i, obj); } } else { var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; + for (i = 0, length = keys.length; i < length; i++) { + iteratee(obj[keys[i]], keys[i], obj); } } return obj; }; - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results.push(iterator.call(context, value, index, list)); - }); + // Return the results of applying the iteratee to each element. + _.map = _.collect = function(obj, iteratee, context) { + if (obj == null) return []; + iteratee = _.iteratee(iteratee, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + results = Array(length), + currentKey; + for (var index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); + } return results; }; var reduceError = 'Reduce of empty array with no initial value'; // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; + // or `foldl`. + _.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) { if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); + iteratee = createCallback(iteratee, context, 4); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index = 0, currentKey; + if (arguments.length < 3) { + if (!length) throw new TypeError(reduceError); + memo = obj[keys ? keys[index++] : index++]; + } + for (; index < length; index++) { + currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); return memo; }; // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; + _.reduceRight = _.foldr = function(obj, iteratee, memo, context) { if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); + iteratee = createCallback(iteratee, context, 4); + var keys = obj.length !== + obj.length && _.keys(obj), + index = (keys || obj).length, + currentKey; + if (arguments.length < 3) { + if (!index) throw new TypeError(reduceError); + memo = obj[keys ? keys[--index] : --index]; } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; + while (index--) { + currentKey = keys ? keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); return memo; }; // Return the first value which passes a truth test. Aliased as `detect`. _.find = _.detect = function(obj, predicate, context) { var result; - any(obj, function(value, index, list) { - if (predicate.call(context, value, index, list)) { + predicate = _.iteratee(predicate, context); + _.some(obj, function(value, index, list) { + if (predicate(value, index, list)) { result = value; return true; } @@ -165,61 +179,58 @@ }; // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. // Aliased as `select`. _.filter = _.select = function(obj, predicate, context) { var results = []; if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context); - each(obj, function(value, index, list) { - if (predicate.call(context, value, index, list)) results.push(value); + predicate = _.iteratee(predicate, context); + _.each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); }); return results; }; // Return all the elements for which a truth test fails. _.reject = function(obj, predicate, context) { - return _.filter(obj, function(value, index, list) { - return !predicate.call(context, value, index, list); - }, context); + return _.filter(obj, _.negate(_.iteratee(predicate)), context); }; // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. // Aliased as `all`. _.every = _.all = function(obj, predicate, context) { - predicate || (predicate = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context); - each(obj, function(value, index, list) { - if (!(result = result && predicate.call(context, value, index, list))) return breaker; - }); - return !!result; + if (obj == null) return true; + predicate = _.iteratee(predicate, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index, currentKey; + for (index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; + } + return true; }; // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. // Aliased as `any`. - var any = _.some = _.any = function(obj, predicate, context) { - predicate || (predicate = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context); - each(obj, function(value, index, list) { - if (result || (result = predicate.call(context, value, index, list))) return breaker; - }); - return !!result; + _.some = _.any = function(obj, predicate, context) { + if (obj == null) return false; + predicate = _.iteratee(predicate, context); + var keys = obj.length !== +obj.length && _.keys(obj), + length = (keys || obj).length, + index, currentKey; + for (index = 0; index < length; index++) { + currentKey = keys ? keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; }; // Determine if the array or object contains a given value (using `===`). // Aliased as `include`. _.contains = _.include = function(obj, target) { if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); + if (obj.length !== +obj.length) obj = _.values(obj); + return _.indexOf(obj, target) >= 0; }; // Invoke a method (with arguments) on every item in a collection. @@ -248,51 +259,67 @@ return _.find(obj, _.matches(attrs)); }; - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797) - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - var result = -Infinity, lastComputed = -Infinity; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - if (computed > lastComputed) { - result = value; - lastComputed = computed; + // Return the maximum element (or element-based computation). + _.max = function(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = obj.length === +obj.length ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value > result) { + result = value; + } } - }); + } else { + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = value; + lastComputed = computed; + } + }); + } return result; }; // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - var result = Infinity, lastComputed = Infinity; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - if (computed < lastComputed) { - result = value; - lastComputed = computed; + _.min = function(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null && obj != null) { + obj = obj.length === +obj.length ? obj : _.values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value < result) { + result = value; + } } - }); + } else { + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index, list) { + computed = iteratee(value, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = value; + lastComputed = computed; + } + }); + } return result; }; - // Shuffle an array, using the modern version of the + // Shuffle a collection, using the modern version of the // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); + var set = obj && obj.length === +obj.length ? obj : _.values(obj); + var length = set.length; + var shuffled = Array(length); + for (var index = 0, rand; index < length; index++) { + rand = _.random(0, index); + if (rand !== index) shuffled[index] = shuffled[rand]; + shuffled[rand] = set[index]; + } return shuffled; }; @@ -307,21 +334,14 @@ return _.shuffle(obj).slice(0, Math.max(0, n)); }; - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - if (value == null) return _.identity; - if (_.isFunction(value)) return value; - return _.property(value); - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, iterator, context) { - iterator = lookupIterator(iterator); + // Sort the object's values by a criterion produced by an iteratee. + _.sortBy = function(obj, iteratee, context) { + iteratee = _.iteratee(iteratee, context); return _.pluck(_.map(obj, function(value, index, list) { return { value: value, index: index, - criteria: iterator.call(context, value, index, list) + criteria: iteratee(value, index, list) }; }).sort(function(left, right) { var a = left.criteria; @@ -336,12 +356,12 @@ // An internal function used for aggregate "group by" operations. var group = function(behavior) { - return function(obj, iterator, context) { + return function(obj, iteratee, context) { var result = {}; - iterator = lookupIterator(iterator); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); + iteratee = _.iteratee(iteratee, context); + _.each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); }); return result; }; @@ -349,32 +369,32 @@ // Groups the object's values by a criterion. Pass either a string attribute // to group by, or a function that returns the criterion. - _.groupBy = group(function(result, key, value) { - _.has(result, key) ? result[key].push(value) : result[key] = [value]; + _.groupBy = group(function(result, value, key) { + if (_.has(result, key)) result[key].push(value); else result[key] = [value]; }); // Indexes the object's values by a criterion, similar to `groupBy`, but for // when you know that your index values will be unique. - _.indexBy = group(function(result, key, value) { + _.indexBy = group(function(result, value, key) { result[key] = value; }); // Counts instances of an object that group by a certain criterion. Pass // either a string attribute to count by, or a function that returns the // criterion. - _.countBy = group(function(result, key) { - _.has(result, key) ? result[key]++ : result[key] = 1; + _.countBy = group(function(result, value, key) { + if (_.has(result, key)) result[key]++; else result[key] = 1; }); // Use a comparator function to figure out the smallest index at which // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = lookupIterator(iterator); - var value = iterator.call(context, obj); + _.sortedIndex = function(array, obj, iteratee, context) { + iteratee = _.iteratee(iteratee, context, 1); + var value = iteratee(obj); var low = 0, high = array.length; while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; + var mid = low + high >>> 1; + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; } return low; }; @@ -390,7 +410,18 @@ // Return the number of elements in an object. _.size = function(obj) { if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; + return obj.length === +obj.length ? obj.length : _.keys(obj).length; + }; + + // Split a collection into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(obj, predicate, context) { + predicate = _.iteratee(predicate, context); + var pass = [], fail = []; + _.each(obj, function(value, key, obj) { + (predicate(value, key, obj) ? pass : fail).push(value); + }); + return [pass, fail]; }; // Array Functions @@ -401,7 +432,7 @@ // allows it to work with `_.map`. _.first = _.head = _.take = function(array, n, guard) { if (array == null) return void 0; - if ((n == null) || guard) return array[0]; + if (n == null || guard) return array[0]; if (n < 0) return []; return slice.call(array, 0, n); }; @@ -411,14 +442,14 @@ // the array, excluding the last N. The **guard** check allows it to work with // `_.map`. _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); }; // Get the last element of an array. Passing **n** will return the last N // values in the array. The **guard** check allows it to work with `_.map`. _.last = function(array, n, guard) { if (array == null) return void 0; - if ((n == null) || guard) return array[array.length - 1]; + if (n == null || guard) return array[array.length - 1]; return slice.call(array, Math.max(array.length - n, 0)); }; @@ -427,7 +458,7 @@ // the rest N values in the array. The **guard** // check allows it to work with `_.map`. _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); + return slice.call(array, n == null || guard ? 1 : n); }; // Trim out all falsy values from an array. @@ -436,23 +467,26 @@ }; // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { + var flatten = function(input, shallow, strict, output) { if (shallow && _.every(input, _.isArray)) { return concat.apply(output, input); } - each(input, function(value) { - if (_.isArray(value) || _.isArguments(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); + for (var i = 0, length = input.length; i < length; i++) { + var value = input[i]; + if (!_.isArray(value) && !_.isArguments(value)) { + if (!strict) output.push(value); + } else if (shallow) { + push.apply(output, value); } else { - output.push(value); + flatten(value, shallow, strict, output); } - }); + } return output; }; // Flatten out an array, either recursively (by default), or just one level. _.flatten = function(array, shallow) { - return flatten(array, shallow, []); + return flatten(array, shallow, false, []); }; // Return a version of the array that does not contain the specified value(s). @@ -460,68 +494,77 @@ return _.difference(array, slice.call(arguments, 1)); }; - // Split an array into two arrays: one whose elements all satisfy the given - // predicate, and one whose elements all do not satisfy the predicate. - _.partition = function(array, predicate) { - var pass = [], fail = []; - each(array, function(elem) { - (predicate(elem) ? pass : fail).push(elem); - }); - return [pass, fail]; - }; - // Produce a duplicate-free version of the array. If the array has already // been sorted, you have the option of using a faster algorithm. // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; + _.uniq = _.unique = function(array, isSorted, iteratee, context) { + if (array == null) return []; + if (!_.isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; isSorted = false; } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; + if (iteratee != null) iteratee = _.iteratee(iteratee, context); + var result = []; var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); + for (var i = 0, length = array.length; i < length; i++) { + var value = array[i]; + if (isSorted) { + if (!i || seen !== value) result.push(value); + seen = value; + } else if (iteratee) { + var computed = iteratee(value, i, array); + if (_.indexOf(seen, computed) < 0) { + seen.push(computed); + result.push(value); + } + } else if (_.indexOf(result, value) < 0) { + result.push(value); } - }); - return results; + } + return result; }; // Produce an array that contains the union: each distinct element from all of // the passed-in arrays. _.union = function() { - return _.uniq(_.flatten(arguments, true)); + return _.uniq(flatten(arguments, true, true, [])); }; // Produce an array that contains every item shared between all the // passed-in arrays. _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.contains(other, item); - }); - }); + if (array == null) return []; + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = array.length; i < length; i++) { + var item = array[i]; + if (_.contains(result, item)) continue; + for (var j = 1; j < argsLength; j++) { + if (!_.contains(arguments[j], item)) break; + } + if (j === argsLength) result.push(item); + } + return result; }; // Take the difference between one array and a number of other arrays. // Only the elements present in just the first array will remain. _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); + var rest = flatten(slice.call(arguments, 1), true, true, []); + return _.filter(array, function(value){ + return !_.contains(rest, value); + }); }; // Zip together multiple lists into a single array -- elements that share // an index go together. - _.zip = function() { - var length = _.max(_.pluck(arguments, 'length').concat(0)); - var results = new Array(length); + _.zip = function(array) { + if (array == null) return []; + var length = _.max(arguments, 'length').length; + var results = Array(length); for (var i = 0; i < length; i++) { - results[i] = _.pluck(arguments, '' + i); + results[i] = _.pluck(arguments, i); } return results; }; @@ -542,10 +585,8 @@ return result; }; - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. + // Return the position of the first occurrence of an item in an array, + // or -1 if the item is not included in the array. // If the array is large and already in sort order, pass `true` // for **isSorted** to use binary search. _.indexOf = function(array, item, isSorted) { @@ -553,26 +594,23 @@ var i = 0, length = array.length; if (isSorted) { if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted); + i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted; } else { i = _.sortedIndex(array, item); return array[i] === item ? i : -1; } } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); for (; i < length; i++) if (array[i] === item) return i; return -1; }; - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. _.lastIndexOf = function(array, item, from) { if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); + var idx = array.length; + if (typeof from == 'number') { + idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1); } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; + while (--idx >= 0) if (array[idx] === item) return idx; return -1; }; @@ -584,15 +622,13 @@ stop = start || 0; start = 0; } - step = arguments[2] || 1; + step = step || 1; var length = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(length); + var range = Array(length); - while(idx < length) { - range[idx++] = start; - start += step; + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; } return range; @@ -602,7 +638,7 @@ // ------------------ // Reusable constructor function for prototype setting. - var ctor = function(){}; + var Ctor = function(){}; // Create a function bound to a given object (assigning `this`, and arguments, // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if @@ -610,17 +646,18 @@ _.bind = function(func, context) { var args, bound; if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError; + if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); args = slice.call(arguments, 2); - return bound = function() { + bound = function() { if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); - ctor.prototype = func.prototype; - var self = new ctor; - ctor.prototype = null; + Ctor.prototype = func.prototype; + var self = new Ctor; + Ctor.prototype = null; var result = func.apply(self, args.concat(slice.call(arguments))); - if (Object(result) === result) return result; + if (_.isObject(result)) return result; return self; }; + return bound; }; // Partially apply a function by creating a version that has had some of its @@ -643,27 +680,34 @@ // are the method names to be bound. Useful for ensuring that all callbacks // defined on an object belong to it. _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) throw new Error('bindAll must be passed function names'); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); + var i, length = arguments.length, key; + if (length <= 1) throw new Error('bindAll must be passed function names'); + for (i = 1; i < length; i++) { + key = arguments[i]; + obj[key] = _.bind(obj[key], obj); + } return obj; }; // Memoize an expensive function by storing its results. _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); + var memoize = function(key) { + var cache = memoize.cache; + var address = hasher ? hasher.apply(this, arguments) : key; + if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; }; + memoize.cache = {}; + return memoize; }; // Delays a function for the given number of milliseconds, and then calls // it with the arguments supplied. _.delay = function(func, wait) { var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); + return setTimeout(function(){ + return func.apply(null, args); + }, wait); }; // Defers a function, scheduling it to run after the current call stack has @@ -681,12 +725,12 @@ var context, args, result; var timeout = null; var previous = 0; - options || (options = {}); + if (!options) options = {}; var later = function() { previous = options.leading === false ? 0 : _.now(); timeout = null; result = func.apply(context, args); - context = args = null; + if (!timeout) context = args = null; }; return function() { var now = _.now(); @@ -694,12 +738,12 @@ var remaining = wait - (now - previous); context = this; args = arguments; - if (remaining <= 0) { + if (remaining <= 0 || remaining > wait) { clearTimeout(timeout); timeout = null; previous = now; result = func.apply(context, args); - context = args = null; + if (!timeout) context = args = null; } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } @@ -716,13 +760,14 @@ var later = function() { var last = _.now() - timestamp; - if (last < wait) { + + if (last < wait && last > 0) { timeout = setTimeout(later, wait - last); } else { timeout = null; if (!immediate) { result = func.apply(context, args); - context = args = null; + if (!timeout) context = args = null; } } }; @@ -732,9 +777,7 @@ args = arguments; timestamp = _.now(); var callNow = immediate && !timeout; - if (!timeout) { - timeout = setTimeout(later, wait); - } + if (!timeout) timeout = setTimeout(later, wait); if (callNow) { result = func.apply(context, args); context = args = null; @@ -744,19 +787,6 @@ }; }; - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - // Returns the first function passed as an argument to the second, // allowing you to adjust arguments, run code before and after, and // conditionally execute the original function. @@ -764,16 +794,23 @@ return _.partial(wrapper, func); }; + // Returns a negated version of the passed-in predicate. + _.negate = function(predicate) { + return function() { + return !predicate.apply(this, arguments); + }; + }; + // Returns a function that is the composition of a list of functions, each // consuming the return value of the function that follows. _.compose = function() { - var funcs = arguments; + var args = arguments; + var start = args.length - 1; return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; + var i = start; + var result = args[start].apply(this, arguments); + while (i--) result = args[i].call(this, result); + return result; }; }; @@ -786,6 +823,23 @@ }; }; + // Returns a function that will only be executed before being called N times. + _.before = function(times, func) { + var memo; + return function() { + if (--times > 0) { + memo = func.apply(this, arguments); + } else { + func = null; + } + return memo; + }; + }; + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = _.partial(_.before, 2); + // Object Functions // ---------------- @@ -803,7 +857,7 @@ _.values = function(obj) { var keys = _.keys(obj); var length = keys.length; - var values = new Array(length); + var values = Array(length); for (var i = 0; i < length; i++) { values[i] = obj[keys[i]]; } @@ -814,7 +868,7 @@ _.pairs = function(obj) { var keys = _.keys(obj); var length = keys.length; - var pairs = new Array(length); + var pairs = Array(length); for (var i = 0; i < length; i++) { pairs[i] = [keys[i], obj[keys[i]]]; } @@ -843,45 +897,62 @@ // Extend a given object with all the properties in passed-in object(s). _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; + if (!_.isObject(obj)) return obj; + var source, prop; + for (var i = 1, length = arguments.length; i < length; i++) { + source = arguments[i]; + for (prop in source) { + if (hasOwnProperty.call(source, prop)) { + obj[prop] = source[prop]; } } - }); + } return obj; }; // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; + _.pick = function(obj, iteratee, context) { + var result = {}, key; + if (obj == null) return result; + if (_.isFunction(iteratee)) { + iteratee = createCallback(iteratee, context); + for (key in obj) { + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; + } + } else { + var keys = concat.apply([], slice.call(arguments, 1)); + obj = new Object(obj); + for (var i = 0, length = keys.length; i < length; i++) { + key = keys[i]; + if (key in obj) result[key] = obj[key]; + } + } + return result; }; // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; + _.omit = function(obj, iteratee, context) { + if (_.isFunction(iteratee)) { + iteratee = _.negate(iteratee); + } else { + var keys = _.map(concat.apply([], slice.call(arguments, 1)), String); + iteratee = function(value, key) { + return !_.contains(keys, key); + }; } - return copy; + return _.pick(obj, iteratee, context); }; // Fill in a given object with default properties. _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] === void 0) obj[prop] = source[prop]; - } + if (!_.isObject(obj)) return obj; + for (var i = 1, length = arguments.length; i < length; i++) { + var source = arguments[i]; + for (var prop in source) { + if (obj[prop] === void 0) obj[prop] = source[prop]; } - }); + } return obj; }; @@ -903,7 +974,7 @@ var eq = function(a, b, aStack, bStack) { // Identical objects are equal. `0 === -0`, but they aren't identical. // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a == 1 / b; + if (a === b) return a !== 0 || 1 / a === 1 / b; // A strict comparison is necessary because `null == undefined`. if (a == null || b == null) return a === b; // Unwrap any wrapped objects. @@ -911,29 +982,27 @@ if (b instanceof _) b = b._wrapped; // Compare `[[Class]]` names. var className = toString.call(a); - if (className != toString.call(b)) return false; + if (className !== toString.call(b)) return false; switch (className) { - // Strings, numbers, dates, and booleans are compared by value. + // Strings, numbers, regular expressions, dates, and booleans are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') case '[object String]': // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is // equivalent to `new String("5")`. - return a == String(b); + return '' + a === '' + b; case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; case '[object Date]': case '[object Boolean]': // Coerce dates and booleans to numeric primitive values. Dates are compared by their // millisecond representations. Note that invalid dates with millisecond representations // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; + return +a === +b; } if (typeof a != 'object' || typeof b != 'object') return false; // Assume equality for cyclic structures. The algorithm for detecting cyclic @@ -942,25 +1011,29 @@ while (length--) { // Linear search. Performance is inversely proportional to the number of // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; + if (aStack[length] === a) return bStack[length] === b; } // Objects with different constructors are not equivalent, but `Object`s // from different frames are. var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor)) - && ('constructor' in a && 'constructor' in b)) { + if ( + aCtor !== bCtor && + // Handle Object.create(x) cases + 'constructor' in a && 'constructor' in b && + !(_.isFunction(aCtor) && aCtor instanceof aCtor && + _.isFunction(bCtor) && bCtor instanceof bCtor) + ) { return false; } // Add the first object to the stack of traversed objects. aStack.push(a); bStack.push(b); - var size = 0, result = true; + var size, result; // Recursively compare objects and arrays. - if (className == '[object Array]') { + if (className === '[object Array]') { // Compare array lengths to determine if a deep comparison is necessary. size = a.length; - result = size == b.length; + result = size === b.length; if (result) { // Deep compare the contents, ignoring non-numeric properties. while (size--) { @@ -969,21 +1042,17 @@ } } else { // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. + var keys = _.keys(a), key; + size = keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + result = _.keys(b).length === size; + if (result) { + while (size--) { + // Deep compare each member + key = keys[size]; if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; } } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } } // Remove the first object from the stack of traversed objects. aStack.pop(); @@ -1000,7 +1069,7 @@ // An "empty" object has no enumerable own-properties. _.isEmpty = function(obj) { if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; + if (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) return obj.length === 0; for (var key in obj) if (_.has(obj, key)) return false; return true; }; @@ -1013,18 +1082,19 @@ // Is a given value an array? // Delegates to ECMA5's native Array.isArray _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; + return toString.call(obj) === '[object Array]'; }; // Is a given variable an object? _.isObject = function(obj) { - return obj === Object(obj); + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; }; // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { + _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; + return toString.call(obj) === '[object ' + name + ']'; }; }); @@ -1032,14 +1102,14 @@ // there isn't any inspectable "Arguments" type. if (!_.isArguments(arguments)) { _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); + return _.has(obj, 'callee'); }; } - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { + // Optimize `isFunction` if appropriate. Work around an IE 11 bug. + if (typeof /./ !== 'function') { _.isFunction = function(obj) { - return typeof obj === 'function'; + return typeof obj == 'function' || false; }; } @@ -1050,12 +1120,12 @@ // Is the given value `NaN`? (NaN is the only number which does not equal itself). _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; + return _.isNumber(obj) && obj !== +obj; }; // Is a given value a boolean? _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; }; // Is a given value equal to null? @@ -1071,7 +1141,7 @@ // Shortcut function for checking if an object has a given property directly // on itself (in other words, not on a prototype). _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); + return obj != null && hasOwnProperty.call(obj, key); }; // Utility Functions @@ -1084,17 +1154,19 @@ return this; }; - // Keep the identity function around for default iterators. + // Keep the identity function around for default iteratees. _.identity = function(value) { return value; }; _.constant = function(value) { - return function () { + return function() { return value; }; }; + _.noop = function(){}; + _.property = function(key) { return function(obj) { return obj[key]; @@ -1103,20 +1175,23 @@ // Returns a predicate for checking whether an object has a given set of `key:value` pairs. _.matches = function(attrs) { + var pairs = _.pairs(attrs), length = pairs.length; return function(obj) { - if (obj === attrs) return true; //avoid comparing an object to itself. - for (var key in attrs) { - if (attrs[key] !== obj[key]) - return false; + if (obj == null) return !length; + obj = new Object(obj); + for (var i = 0; i < length; i++) { + var pair = pairs[i], key = pair[0]; + if (pair[1] !== obj[key] || !(key in obj)) return false; } return true; - } + }; }; // Run a function **n** times. - _.times = function(n, iterator, context) { + _.times = function(n, iteratee, context) { var accum = Array(Math.max(0, n)); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); + iteratee = createCallback(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); return accum; }; @@ -1130,54 +1205,44 @@ }; // A (possibly faster) way to get the current timestamp as an integer. - _.now = Date.now || function() { return new Date().getTime(); }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - } + _.now = Date.now || function() { + return new Date().getTime(); }; - entityMap.unescape = _.invert(entityMap.escape); - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') + // List of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' }; + var unescapeMap = _.invert(escapeMap); // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); + var createEscaper = function(map) { + var escaper = function(match) { + return map[match]; }; - }); + // Regexes for identifying a key that needs to be escaped + var source = '(?:' + _.keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; + }; + _.escape = createEscaper(escapeMap); + _.unescape = createEscaper(unescapeMap); // If the value of the named `property` is a function then invoke it with the // `object` as context; otherwise, return it. _.result = function(object, property) { if (object == null) return void 0; var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name) { - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); + return _.isFunction(value) ? object[property]() : value; }; // Generate a unique integer id (unique within the entire client session). @@ -1208,22 +1273,26 @@ '\\': '\\', '\r': 'r', '\n': 'n', - '\t': 't', '\u2028': 'u2028', '\u2029': 'u2029' }; - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; + var escaper = /\\|'|\r|\n|\u2028|\u2029/g; + + var escapeChar = function(match) { + return '\\' + escapes[match]; + }; // JavaScript micro-templating, similar to John Resig's implementation. // Underscore templating handles arbitrary delimiters, preserves whitespace, // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; + // NB: `oldSettings` only exists for backwards compatibility. + _.template = function(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; settings = _.defaults({}, settings, _.templateSettings); // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ + var matcher = RegExp([ (settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source @@ -1233,19 +1302,18 @@ var index = 0; var source = "__p+='"; text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); + source += text.slice(index, offset).replace(escaper, escapeChar); + index = offset + match.length; if (escape) { source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { + } else if (interpolate) { source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { + } else if (evaluate) { source += "';\n" + evaluate + "\n__p+='"; } - index = offset + match.length; + + // Adobe VMs need the match returned to produce the correct offest. return match; }); source += "';\n"; @@ -1255,29 +1323,31 @@ source = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; + source + 'return __p;\n'; try { - render = new Function(settings.variable || 'obj', '_', source); + var render = new Function(settings.variable || 'obj', '_', source); } catch (e) { e.source = source; throw e; } - if (data) return render(data, _); var template = function(data) { return render.call(this, data, _); }; - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; + // Provide the compiled source as a convenience for precompilation. + var argument = settings.variable || 'obj'; + template.source = 'function(' + argument + '){\n' + source + '}'; return template; }; - // Add a "chain" function, which will delegate to the wrapper. + // Add a "chain" function. Start chaining a wrapped Underscore object. _.chain = function(obj) { - return _(obj).chain(); + var instance = _(obj); + instance._chain = true; + return instance; }; // OOP @@ -1291,42 +1361,44 @@ return this._chain ? _(obj).chain() : obj; }; + // Add your own custom functions to the Underscore object. + _.mixin = function(obj) { + _.each(_.functions(obj), function(name) { + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return result.call(this, func.apply(_, args)); + }; + }); + }; + // Add all of the Underscore functions to the wrapper object. _.mixin(_); // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { var obj = this._wrapped; method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; + if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; return result.call(this, obj); }; }); // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { + _.each(['concat', 'join', 'slice'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { return result.call(this, method.apply(this._wrapped, arguments)); }; }); - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); + // Extracts the result from a wrapped and chained object. + _.prototype.value = function() { + return this._wrapped; + }; // AMD registration happens at the end for compatibility with AMD loaders // that may not enforce next-turn semantics on modules. Even though general @@ -1340,4 +1412,4 @@ return _; }); } -}).call(this); +}.call(this)); diff --git a/node_modules/jsdoc/node_modules/wrench/.npmignore b/node_modules/jsdoc/node_modules/wrench/.npmignore index 93f1361..05ade97 100644 --- a/node_modules/jsdoc/node_modules/wrench/.npmignore +++ b/node_modules/jsdoc/node_modules/wrench/.npmignore @@ -1,2 +1,3 @@ node_modules npm-debug.log +.idea diff --git a/node_modules/jsdoc/node_modules/wrench/lib/wrench.js b/node_modules/jsdoc/node_modules/wrench/lib/wrench.js index 00f4166..01f5e95 100644 --- a/node_modules/jsdoc/node_modules/wrench/lib/wrench.js +++ b/node_modules/jsdoc/node_modules/wrench/lib/wrench.js @@ -12,8 +12,8 @@ */ var fs = require("fs"), - _path = require("path"); - + _path = require("path"), + isWindows = !!process.platform.match(/^win/); /* wrench.readdirSyncRecursive("directory_path"); * @@ -28,7 +28,7 @@ exports.readdirSyncRecursive = function(baseDir) { curFiles, nextDirs, isDir = function(fname){ - return fs.statSync( _path.join(baseDir, fname) ).isDirectory(); + return fs.existsSync(_path.join(baseDir, fname)) ? fs.statSync( _path.join(baseDir, fname) ).isDirectory() : false; }, prependBaseDir = function(fname){ return _path.join(baseDir, fname); @@ -71,15 +71,16 @@ exports.readdirRecursive = function(baseDir, fn) { var waitCount = 0; function readdirRecursive(curDir) { - var files = [], - curFiles, - nextDirs, - prependcurDir = function(fname){ - return _path.join(curDir, fname); - }; + var prependcurDir = function(fname){ + return _path.join(curDir, fname); + }; waitCount++; fs.readdir(curDir, function(e, curFiles) { + if (e) { + fn(e); + return; + } waitCount--; curFiles = curFiles.map(prependcurDir); @@ -120,7 +121,9 @@ exports.readdirRecursive = function(baseDir, fn) { -/* wrench.rmdirSyncRecursive("directory_path", forceDelete, failSilent); + + +/* wrench.rmdirSyncRecursive("directory_path", failSilent); * * Recursively dives through directories and obliterates everything about it. This is a * Sync-function, which blocks things until it's done. No idea why anybody would want an @@ -132,44 +135,110 @@ exports.rmdirSyncRecursive = function(path, failSilent) { try { files = fs.readdirSync(path); } catch (err) { + if(failSilent) return; throw new Error(err.message); } /* Loop through and delete everything in the sub-tree after checking it */ for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(path + "/" + files[i]); + var file = _path.join(path, files[i]); + var currFile = fs.lstatSync(file); - if(currFile.isDirectory()) // Recursive function back to the beginning - exports.rmdirSyncRecursive(path + "/" + files[i]); + if(currFile.isDirectory()) { + // Recursive function back to the beginning + exports.rmdirSyncRecursive(file); + } else if(currFile.isSymbolicLink()) { + // Unlink symlinks + if (isWindows) { + fs.chmodSync(file, 666) // Windows needs this unless joyent/node#3006 is resolved.. + } - else if(currFile.isSymbolicLink()) // Unlink symlinks - fs.unlinkSync(path + "/" + files[i]); + fs.unlinkSync(file); + } else { + // Assume it's a file - perhaps a try/catch belongs here? + if (isWindows) { + fs.chmodSync(file, 666) // Windows needs this unless joyent/node#3006 is resolved.. + } - else // Assume it's a file - perhaps a try/catch belongs here? - fs.unlinkSync(path + "/" + files[i]); + fs.unlinkSync(file); + } } /* Now that we know everything in the sub-tree has been deleted, we can delete the main - directory. Huzzah for the shopkeep. */ + directory. Huzzah for the shopkeep. */ return fs.rmdirSync(path); }; + + +function isFileIncluded(opts, dir, filename) { + + function isMatch(filter) { + if (typeof filter === 'function') { + return filter(filename, dir) === true; + } + else { + // Maintain backwards compatibility and use just the filename + return filename.match(filter); + } + } + + if (opts.include || opts.exclude) { + if (opts.exclude) { + if (isMatch(opts.exclude)) { + return false; + } + } + + if (opts.include) { + if (isMatch(opts.include)) { + return true; + } + else { + return false; + } + } + + return true; + } + else if (opts.filter) { + var filter = opts.filter; + + if (!opts.whitelist) { + // if !opts.whitelist is false every file or directory + // which does match opts.filter will be ignored + return isMatch(filter) ? false : true; + } else { + // if opts.whitelist is true every file or directory + // which doesn't match opts.filter will be ignored + return !isMatch(filter) ? false : true; + } + } + + return true; +} + /* wrench.copyDirSyncRecursive("directory_to_copy", "new_directory_location", opts); * * Recursively dives through a directory and moves all its files to a new location. This is a * Synchronous function, which blocks things until it's done. If you need/want to do this in - * an Asynchronous manner, look at wrench.copyDirRecursively() below. + * an Asynchronous manner, look at wrench.copyDirRecursively() below. Specify forceDelete to force directory overwrite. * * Note: Directories should be passed to this function without a trailing slash. */ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) { + opts = opts || {}; - if (!opts || !opts.preserve) { - try { - if(fs.statSync(newDirLocation).isDirectory()) exports.rmdirSyncRecursive(newDirLocation); - } catch(e) { } - } + try { + if(fs.statSync(newDirLocation).isDirectory()) { + if(opts.forceDelete) { + exports.rmdirSyncRecursive(newDirLocation); + } else { + return new Error('You are trying to delete a directory that already exists. Specify forceDelete in the opts argument to override this. Bailing~'); + } + } + } catch(e) { } /* Create the directory where all our junk is moving to; read the mode of the source directory and mirror it */ var checkDir = fs.statSync(sourceDir); @@ -181,20 +250,58 @@ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) { } var files = fs.readdirSync(sourceDir); + var hasFilter = opts.filter || opts.include || opts.exclude; + var preserveFiles = opts.preserveFiles === true; + var preserveTimestamps = opts.preserveTimestamps === true; for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(sourceDir + "/" + files[i]); + // ignores all files or directories which match the RegExp in opts.filter + if(typeof opts !== 'undefined') { + if (hasFilter) { + if (!isFileIncluded(opts, sourceDir, files[i])) { + continue; + } + } + + if (opts.excludeHiddenUnix && /^\./.test(files[i])) continue; + } + + var currFile = fs.lstatSync(_path.join(sourceDir, files[i])); + + var fCopyFile = function(srcFile, destFile) { + if(typeof opts !== 'undefined' && opts.preserveFiles && fs.existsSync(destFile)) return; + + var contents = fs.readFileSync(srcFile); + fs.writeFileSync(destFile, contents); + var stat = fs.lstatSync(srcFile); + fs.chmodSync(destFile, stat.mode); + if (preserveTimestamps) { + fs.utimesSync(destFile, stat.atime, stat.mtime) + } + }; if(currFile.isDirectory()) { /* recursion this thing right on back. */ - exports.copyDirSyncRecursive(sourceDir + "/" + files[i], newDirLocation + "/" + files[i], opts); + exports.copyDirSyncRecursive(_path.join(sourceDir, files[i]), _path.join(newDirLocation, files[i]), opts); } else if(currFile.isSymbolicLink()) { - var symlinkFull = fs.readlinkSync(sourceDir + "/" + files[i]); - fs.symlinkSync(symlinkFull, newDirLocation + "/" + files[i]); + var symlinkFull = fs.readlinkSync(_path.join(sourceDir, files[i])); + symlinkFull = _path.resolve(fs.realpathSync(sourceDir), symlinkFull); + + if (typeof opts !== 'undefined' && !opts.inflateSymlinks) { + fs.symlinkSync(symlinkFull, _path.join(newDirLocation, files[i])); + continue; + } + + var tmpCurrFile = fs.lstatSync(symlinkFull); + if (tmpCurrFile.isDirectory()) { + exports.copyDirSyncRecursive(symlinkFull, _path.join(newDirLocation, files[i]), opts); + } else { + /* At this point, we've hit a file actually worth copying... so copy it on over. */ + fCopyFile(symlinkFull, _path.join(newDirLocation, files[i])); + } } else { /* At this point, we've hit a file actually worth copying... so copy it on over. */ - var contents = fs.readFileSync(sourceDir + "/" + files[i]); - fs.writeFileSync(newDirLocation + "/" + files[i], contents); + fCopyFile(_path.join(sourceDir, files[i]), _path.join(newDirLocation, files[i])); } } }; @@ -210,14 +317,14 @@ exports.chmodSyncRecursive = function(sourceDir, filemode) { var files = fs.readdirSync(sourceDir); for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(sourceDir + "/" + files[i]); + var currFile = fs.lstatSync(_path.join(sourceDir, files[i])); if(currFile.isDirectory()) { /* ...and recursion this thing right on back. */ - exports.chmodSyncRecursive(sourceDir + "/" + files[i], filemode); + exports.chmodSyncRecursive(_path.join(sourceDir, files[i]), filemode); } else { /* At this point, we've hit a file actually worth copying... so copy it on over. */ - fs.chmod(sourceDir + "/" + files[i], filemode); + fs.chmod(_path.join(sourceDir, files[i]), filemode); } } @@ -237,14 +344,14 @@ exports.chownSyncRecursive = function(sourceDir, uid, gid) { var files = fs.readdirSync(sourceDir); for(var i = 0; i < files.length; i++) { - var currFile = fs.lstatSync(sourceDir + "/" + files[i]); + var currFile = fs.lstatSync(_path.join(sourceDir, files[i])); if(currFile.isDirectory()) { /* ...and recursion this thing right on back. */ - exports.chownSyncRecursive(sourceDir + "/" + files[i], uid, gid); + exports.chownSyncRecursive(_path.join(sourceDir, files[i]), uid, gid); } else { /* At this point, we've hit a file actually worth chowning... so own it. */ - fs.chownSync(sourceDir + "/" + files[i], uid, gid); + fs.chownSync(_path.join(sourceDir, files[i]), uid, gid); } } @@ -258,9 +365,17 @@ exports.chownSyncRecursive = function(sourceDir, uid, gid) { * * Recursively dives through directories and obliterates everything about it. */ -exports.rmdirRecursive = function rmdirRecursive(dir, clbk){ - fs.readdir(dir, function(err, files){ - if (err) return clbk(err); +exports.rmdirRecursive = function rmdirRecursive(dir, failSilent, clbk){ + if(clbk === null || typeof clbk == 'undefined') + clbk = function(err) {}; + + fs.readdir(dir, function(err, files) { + if(err && typeof failSilent === 'boolean' && !failSilent) + return clbk(err); + + if(typeof failSilent === 'function') + clbk = failSilent; + (function rmFile(err){ if (err) return clbk(err); @@ -269,7 +384,7 @@ exports.rmdirRecursive = function rmdirRecursive(dir, clbk){ return fs.rmdir(dir, clbk); var file = dir+'/'+filename; - fs.stat(file, function(err, stat){ + fs.lstat(file, function(err, stat){ if (err) return clbk(err); if (stat.isDirectory()) rmdirRecursive(file, rmFile); @@ -280,18 +395,30 @@ exports.rmdirRecursive = function rmdirRecursive(dir, clbk){ }); }; -/* wrench.copyDirRecursive("directory_to_copy", "new_location", callback); +/* wrench.copyDirRecursive("directory_to_copy", "new_location", {forceDelete: bool}, callback); * * Recursively dives through a directory and moves all its files to a new - * location. + * location. Specify forceDelete to force directory overwrite. * * Note: Directories should be passed to this function without a trailing slash. */ -exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, clbk) { - fs.stat(newDir, function(err, newDirStat){ - if (!err) return exports.rmdirRecursive(newDir, function(err){ - copyDirRecursive(srcDir, newDir, clbk); - }); +exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, opts, clbk) { + var originalArguments = Array.prototype.slice.apply(arguments); + srcDir = _path.normalize(srcDir); + newDir = _path.normalize(newDir); + + fs.stat(newDir, function(err, newDirStat) { + if(!err) { + if(typeof opts !== 'undefined' && typeof opts !== 'function' && opts.forceDelete) + return exports.rmdirRecursive(newDir, function(err) { + copyDirRecursive.apply(this, originalArguments); + }); + else + return clbk(new Error('You are trying to delete a directory that already exists. Specify forceDelete in an options object to override this.')); + } + + if(typeof opts === 'function') + clbk = opts; fs.stat(srcDir, function(err, srcDirStat){ if (err) return clbk(err); @@ -304,20 +431,23 @@ exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, clbk) { var filename = files.shift(); if (filename === null || typeof filename == 'undefined') - return clbk(); + return clbk(null); var file = srcDir+'/'+filename, newFile = newDir+'/'+filename; fs.stat(file, function(err, fileStat){ + if (err) return clbk(err); if (fileStat.isDirectory()) - copyDirRecursive(file, newFile, copyFiles); + copyDirRecursive(file, newFile, copyFiles, clbk); else if (fileStat.isSymbolicLink()) fs.readlink(file, function(err, link){ + if (err) return clbk(err); fs.symlink(link, newFile, copyFiles); }); else fs.readFile(file, function(err, data){ + if (err) return clbk(err); fs.writeFile(newFile, data, copyFiles); }); }); @@ -330,15 +460,13 @@ exports.copyDirRecursive = function copyDirRecursive(srcDir, newDir, clbk) { var mkdirSyncRecursive = function(path, mode) { var self = this; + path = _path.normalize(path) try { fs.mkdirSync(path, mode); } catch(err) { if(err.code == "ENOENT") { - var slashIdx = path.lastIndexOf("/"); - if(slashIdx < 0) { - slashIdx = path.lastIndexOf("\\"); - } + var slashIdx = path.lastIndexOf(_path.sep); if(slashIdx > 0) { var parentPath = path.substring(0, slashIdx); @@ -364,6 +492,10 @@ exports.LineReader = function(filename, bufferSize) { }; exports.LineReader.prototype = { + close: function() { + return fs.closeSync(this.fd); + }, + getBufferAndSetCurrentPosition: function(position) { var res = fs.readSync(this.fd, this.bufferSize, position, "ascii"); @@ -383,13 +515,13 @@ exports.LineReader.prototype = { if(this.currentPosition === -1) return false; } - if(this.buffer.indexOf("\n") > -1) return true; + if(this.buffer.indexOf("\n") > -1 || this.buffer.length !== 0) return true; return false; }, getNextLine: function() { var lineEnd = this.buffer.indexOf("\n"), - result = this.buffer.substring(0, lineEnd); + result = this.buffer.substring(0, lineEnd != -1 ? lineEnd : this.buffer.length); this.buffer = this.buffer.substring(result.length + 1, this.buffer.length); return result; diff --git a/node_modules/jsdoc/node_modules/wrench/lib/x.js b/node_modules/jsdoc/node_modules/wrench/lib/x.js deleted file mode 100644 index 3ddffd6..0000000 --- a/node_modules/jsdoc/node_modules/wrench/lib/x.js +++ /dev/null @@ -1 +0,0 @@ -require('./wrench').mkdirsSyncRecursive('x/lol/b', 777); diff --git a/node_modules/jsdoc/node_modules/wrench/package.json b/node_modules/jsdoc/node_modules/wrench/package.json index c3ad49b..02745c3 100644 --- a/node_modules/jsdoc/node_modules/wrench/package.json +++ b/node_modules/jsdoc/node_modules/wrench/package.json @@ -1,14 +1,14 @@ { "name": "wrench", "description": "Recursive filesystem (and other) operations that Node *should* have.", - "version": "1.3.9", + "version": "1.5.8", "author": { "name": "Ryan McGrath", "email": "ryan@venodesigns.net" }, "repository": { "type": "git", - "url": "git://github.com/ryanmcgrath/wrench-js.git" + "url": "https://ryanmcgrath@github.com/ryanmcgrath/wrench-js.git" }, "bugs": { "url": "http://github.com/ryanmcgrath/wrench-js/issues" @@ -33,29 +33,25 @@ "url": "http://github.com/ryanmcgrath/wrench-js/raw/master/LICENSE" } ], + "homepage": "https://github.com/ryanmcgrath/wrench-js", + "_id": "wrench@1.5.8", + "dist": { + "shasum": "7a31c97f7869246d76c5cf2f5c977a1c4c8e5ab5", + "tarball": "http://registry.npmjs.org/wrench/-/wrench-1.5.8.tgz" + }, + "_from": "wrench@>=1.5.8 <1.6.0", + "_npmVersion": "1.3.21", "_npmUser": { "name": "ryanmcgrath", "email": "ryan@venodesigns.net" }, - "_id": "wrench@1.3.9", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.12", - "_nodeVersion": "v0.6.14", - "_defaultsLoaded": true, - "dist": { - "shasum": "6f13ec35145317eb292ca5f6531391b244111411", - "tarball": "http://registry.npmjs.org/wrench/-/wrench-1.3.9.tgz" - }, "maintainers": [ { "name": "ryanmcgrath", "email": "ryan@venodesigns.net" } ], - "_shasum": "6f13ec35145317eb292ca5f6531391b244111411", - "_from": "wrench@~1.3.9", - "_resolved": "https://registry.npmjs.org/wrench/-/wrench-1.3.9.tgz", - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/ryanmcgrath/wrench-js" + "_shasum": "7a31c97f7869246d76c5cf2f5c977a1c4c8e5ab5", + "_resolved": "https://registry.npmjs.org/wrench/-/wrench-1.5.8.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/node_modules/wrench/readme.md b/node_modules/jsdoc/node_modules/wrench/readme.md index 393e3da..2d646d0 100644 --- a/node_modules/jsdoc/node_modules/wrench/readme.md +++ b/node_modules/jsdoc/node_modules/wrench/readme.md @@ -8,6 +8,29 @@ That said, here's my attempt at a re-usable solution, at least until something more formalized gets integrated into Node.js (*hint hint*). wrench.js is fairly simple to use - check out the documentation/examples below: +Possibly Breaking Change in v1.5.0 +----------------------------------------------------------------------------- +In previous versions of Wrench, we went against the OS-default behavior of not +deleting a directory unless the operation is forced. In 1.5.0, this has been +changed to be the behavior people expect there to be - if you try to copy over +a directory that already exists, you'll get an Error returned or thrown stating +that you need to force it. + +Something like this will do the trick: + +``` javascript +wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', { + forceDelete: true +}); +``` + +If you desire the older behavior of Wrench... hit up your package.json. If you +happen to find bugs in the 1.5.0 release please feel free to file them on the +GitHub issues tracker for this project, or send me a pull request and I'll get to +it as fast as I can. Thanks! + +**If this breaks enough projects I will consider rolling it back. Please hit me up if this seems to be the case.** + Installation ----------------------------------------------------------------------------- @@ -38,13 +61,31 @@ wrench.chmodSyncRecursive('my_directory_name', 0755); wrench.chownSyncRecursive("directory", uid, gid); // Deep-copy an existing directory -wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up'); +wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end_up', { + forceDelete: bool, // Whether to overwrite existing directory or not + excludeHiddenUnix: bool, // Whether to copy hidden Unix files or not (preceding .) + preserveFiles: bool, // If we're overwriting something and the file already exists, keep the existing + preserveTimestamps: bool, // Preserve the mtime and atime when copying files + inflateSymlinks: bool, // Whether to follow symlinks or not when copying files + filter: regexpOrFunction, // A filter to match files against; if matches, do nothing (exclude). + whitelist: bool, // if true every file or directory which doesn't match filter will be ignored + include: regexpOrFunction, // An include filter (either a regexp or a function) + exclude: regexpOrFunction // An exclude filter (either a regexp or a function) +}); + +// Note: If a RegExp is provided then then it will be matched against the filename. If a function is +// provided then the signature should be the following: +// function(filename, dir) { return result; } // Read lines in from a file until you hit the end var f = new wrench.LineReader('x.txt'); while(f.hasNextLine()) { - util.puts(x.getNextLine()); + util.puts(f.getNextLine()); } + +// Note: You will need to close that above line reader at some point, otherwise +// you will run into a "too many open files" error. f.close() or fs.closeSync(f.fd) are +// your friends, as only you know when it is safe to close. ``` ### Asynchronous operations @@ -55,6 +96,8 @@ wrench.readdirRecursive('my_directory_name', function(error, curFiles) { // curFiles is what you want }); +// If you're feeling somewhat masochistic +wrench.copyDirRecursive(srcDir, newDir, {forceDelete: bool /* See sync version */}, callbackfn); ``` Questions, comments? Hit me up. (ryan [at] venodesigns.net | http://twitter.com/ryanmcgrath) diff --git a/node_modules/jsdoc/node_modules/wrench/tests/copydirsync_unix.js b/node_modules/jsdoc/node_modules/wrench/tests/copydirsync_unix.js new file mode 100644 index 0000000..c48bb62 --- /dev/null +++ b/node_modules/jsdoc/node_modules/wrench/tests/copydirsync_unix.js @@ -0,0 +1,242 @@ +var testCase = require('nodeunit').testCase; +var fs = require('fs'); +var wrench = require('../lib/wrench'); +var path = require('path'); + +function checkResultHidden(test, files) { + var check = [ + '.hidden', + '.hidden.txt', + 'bar.txt', + 'foo', + path.join('.hidden', 'dolor.md'), + path.join('foo', 'bar'), + path.join('foo', 'dolor.md'), + path.join('foo', 'lorem.txt'), + path.join('foo', 'bar', 'ipsum.js') + ]; + + test.deepEqual(files, check); +} + +function checkResultShown(test, files) { + var check = [ + 'bar.txt', + 'foo', + path.join('foo', 'bar'), + path.join('foo', 'dolor.md'), + path.join('foo', 'lorem.txt'), + path.join('foo', 'bar', 'ipsum.js') + ]; + + test.deepEqual(files, check); +} + +function checkResultInflate(test, files) { + var check = [ + '.hidden', + 'bar.txt', + 'test', + path.join('.hidden', 'dolor.md') + ]; + + test.deepEqual(files, check); + + test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/.hidden')).isSymbolicLink(), false); + test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/bar.txt')).isSymbolicLink(), false); +} + +function checkResultInflateAbsolute(test, files) { + var check = [ + '.hidden', + 'absolute-bar.txt', + 'bar.txt', + 'test', + path.join('.hidden', 'dolor.md') + ]; + + test.deepEqual(files, check); + + test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/.hidden')).isSymbolicLink(), false); + test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/bar.txt')).isSymbolicLink(), false); +} + +function checkResultDontInflate(test, files) { + var check = [ + '.hidden', + 'bar.txt', + 'test', + path.join('.hidden', 'dolor.md') + ]; + + test.deepEqual(files, check); + + test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/.hidden')).isSymbolicLink(), true); + test.deepEqual(fs.lstatSync(path.join(__dirname, 'testdir/bar.txt')).isSymbolicLink(), true); +} + +function checkResultPreserveFiles(test, files) { + checkResultHidden(test, files); + var contents = fs.readFileSync(path.join(__dirname, path.join('testdir2', '.hidden.txt')), "utf8"); + test.deepEqual(contents, 'hidden file'); + contents = fs.readFileSync(path.join(__dirname, path.join('testdir2', 'bar.txt')), "utf8"); + test.deepEqual(contents, 'shown file'); +} + +function checkResultOverwriteFiles(test, files) { + checkResultHidden(test, files); + var contents = fs.readFileSync(path.join(__dirname, path.join('testdir2', '.hidden.txt')), "utf8"); + test.deepEqual(contents, 'just some text for .hidden.txt'); + contents = fs.readFileSync(path.join(__dirname, path.join('testdir2', 'bar.txt')), "utf8"); + test.deepEqual(contents, 'just some text for bar.txt'); +} + +module.exports = testCase({ + test_copyDirSyncRecursiveWithoutOptions: function(test) { + var dir = path.join(__dirname, 'shown'); + var testdir = path.join(__dirname, 'testdir'); + + wrench.copyDirSyncRecursive(dir, testdir); + + wrench.rmdirSyncRecursive(testdir); + test.done(); + }, + test_copyDirSyncRecursiveHidden: function(test) { + var dir = path.join(__dirname, 'shown'); + var testdir = path.join(__dirname, 'testdir'); + + test.ok(fs.existsSync(dir), 'Folders should exist'); + + wrench.copyDirSyncRecursive(dir, testdir, { excludeHiddenUnix: false }); + + var files = wrench.readdirSyncRecursive(testdir); + + checkResultHidden(test, files); + + wrench.rmdirSyncRecursive(testdir); + + test.done(); + }, + test_copyDirSyncRecursiveShown: function(test) { + var dir = path.join(__dirname, 'shown'); + var testdir = path.join(__dirname, 'testdir'); + + test.ok(fs.existsSync(dir), 'Folders should exist'); + + wrench.copyDirSyncRecursive(dir, testdir, { excludeHiddenUnix: true }); + + var files = wrench.readdirSyncRecursive(testdir); + + checkResultShown(test, files); + + wrench.rmdirSyncRecursive(testdir); + + test.done(); + }, + test_copyDirSyncRecursiveInflate: function(test) { + var dir = path.join(__dirname, 'withsymlinks'); + var testdir = path.join(__dirname, 'testdir'); + + test.ok(fs.existsSync(dir), 'Folders should exist'); + + wrench.copyDirSyncRecursive(dir, testdir, { excludeHiddenUnix: false, inflateSymlinks: true }); + + var files = wrench.readdirSyncRecursive(testdir); + + checkResultInflate(test, files); + + wrench.rmdirSyncRecursive(testdir); + + test.done(); + }, + test_copyDirSyncRecursiveInflateAbsoluteSymlinks: function(test) { + var dir = path.join(__dirname, 'withsymlinks'); + var testdir = path.join(__dirname, 'testdir'); + + fs.symlinkSync( + path.resolve(__dirname, 'shown/bar.txt'), + path.join(dir, 'absolute-bar.txt') + ); + + wrench.mkdirSyncRecursive(testdir, 0777); + wrench.copyDirSyncRecursive(dir, testdir, { forceDelete: true, excludeHiddenUnix: false, inflateSymlinks: true }); + + var files = wrench.readdirSyncRecursive(testdir); + + checkResultInflateAbsolute(test, files); + + wrench.rmdirSyncRecursive(testdir); + fs.unlinkSync(path.join(dir, 'absolute-bar.txt')); + + test.done(); + }, + test_copyDirSyncRecursiveDontInflate: function(test) { + var dir = path.join(__dirname, 'withsymlinks'); + var testdir = path.join(__dirname, 'testdir'); + + test.ok(fs.existsSync(dir), 'Folders should exist'); + + wrench.copyDirSyncRecursive(dir, testdir, { excludeHiddenUnix: false, inflateSymlinks: false }); + + var files = wrench.readdirSyncRecursive(testdir); + + checkResultDontInflate(test, files); + + wrench.rmdirSyncRecursive(testdir); + + test.done(); + }, + test_copyDirSyncRecursivePreserveFiles: function(test) { + var dir = path.join(__dirname, 'shown'), + testdir1 = path.join(__dirname, 'testdir1'), + testdir2 = path.join(__dirname, 'testdir2'); + + test.ok(fs.existsSync(dir), 'Folders should exist'); + + // wrench.mkdirSyncRecursive(testdir1, 0777); + wrench.copyDirSyncRecursive(dir, testdir1, { excludeHiddenUnix: false }); + wrench.copyDirSyncRecursive(dir, testdir2, { excludeHiddenUnix: false }); + + fs.writeFileSync(path.join(testdir1, ".hidden.txt"), 'just some text for .hidden.txt'); + fs.writeFileSync(path.join(testdir1, "bar.txt"), 'just some text for bar.txt'); + + wrench.copyDirSyncRecursive(testdir1, testdir2, { excludeHiddenUnix: false, preserveFiles: true }); + + var files = wrench.readdirSyncRecursive(testdir2); + + checkResultPreserveFiles(test, files); + + wrench.rmdirSyncRecursive(testdir1); + wrench.rmdirSyncRecursive(testdir2); + + test.done(); + }, + test_copyDirSyncRecursiveOverwriteFiles: function(test) { + var dir = path.join(__dirname, 'shown'), + testdir1 = path.join(__dirname, 'testdir1'), + testdir2 = path.join(__dirname, 'testdir2'); + + test.ok(fs.existsSync(dir), 'Folders should exist'); + + // wrench.mkdirSyncRecursive(testdir1, 0777); + wrench.copyDirSyncRecursive(dir, testdir1, { excludeHiddenUnix: false }); + wrench.copyDirSyncRecursive(dir, testdir2, { excludeHiddenUnix: false }); + + fs.writeFileSync(path.join(testdir1, ".hidden.txt"), 'just some text for .hidden.txt'); + fs.writeFileSync(path.join(testdir1, "bar.txt"), 'just some text for bar.txt'); + + wrench.copyDirSyncRecursive(testdir1, testdir2, { forceDelete: true, excludeHiddenUnix: false, preserveFiles: false }); + + var files = wrench.readdirSyncRecursive(testdir2); + + checkResultOverwriteFiles(test, files); + + wrench.rmdirSyncRecursive(testdir1); + wrench.rmdirSyncRecursive(testdir2); + + test.done(); + } + +}); + +// vim: et ts=4 sw=4 diff --git a/node_modules/jsdoc/node_modules/wrench/tests/mkdir.js b/node_modules/jsdoc/node_modules/wrench/tests/mkdir.js index e728516..933887b 100644 --- a/node_modules/jsdoc/node_modules/wrench/tests/mkdir.js +++ b/node_modules/jsdoc/node_modules/wrench/tests/mkdir.js @@ -7,11 +7,11 @@ module.exports = testCase({ test_mkdirSyncRecursive: function(test) { var dir = __dirname + '/_tmp/foo/bar'; - test.equals(path.existsSync(dir), false, 'Dir shouldn\'t exist - clean it up manually?'); + test.equals(fs.existsSync(dir), false, 'Dir shouldn\'t exist - clean it up manually?'); wrench.mkdirSyncRecursive(dir, 0777); - test.equals(path.existsSync(dir), true, 'Dir should exist now'); + test.equals(fs.existsSync(dir), true, 'Dir should exist now'); // clean up while (dir != __dirname) { diff --git a/node_modules/jsdoc/node_modules/wrench/tests/readdir.js b/node_modules/jsdoc/node_modules/wrench/tests/readdir.js index c314229..5e8abf0 100644 --- a/node_modules/jsdoc/node_modules/wrench/tests/readdir.js +++ b/node_modules/jsdoc/node_modules/wrench/tests/readdir.js @@ -23,7 +23,7 @@ module.exports = testCase({ test_readdirSyncRecursive: function(test) { var dir = path.join(__dirname, 'readdir'); - test.ok(path.existsSync(dir), 'Folders should exist'); + test.ok(fs.existsSync(dir), 'Folders should exist'); var files = wrench.readdirSyncRecursive(dir); @@ -33,7 +33,7 @@ module.exports = testCase({ test_readdirRecursive: function(test) { var dir = path.join(__dirname, 'readdir'); - test.ok(path.existsSync(dir), 'Folders should exist'); + test.ok(fs.existsSync(dir), 'Folders should exist'); var allFiles = []; @@ -46,6 +46,15 @@ module.exports = testCase({ checkResult(test, allFiles); } }); + }, + + test_readdirRecursiveWithNonExistentDirectory: function(test) { + wrench.readdirRecursive('', function (e, files) { + test.ok(e); + test.equal(e.code, 'ENOENT'); + test.equal(files, null); + test.done(); + }); } }); diff --git a/node_modules/jsdoc/node_modules/wrench/tests/rmdirSyncRecursive.js b/node_modules/jsdoc/node_modules/wrench/tests/rmdirSyncRecursive.js new file mode 100644 index 0000000..3415e84 --- /dev/null +++ b/node_modules/jsdoc/node_modules/wrench/tests/rmdirSyncRecursive.js @@ -0,0 +1,74 @@ +var testCase = require('nodeunit').testCase; +var fs = require('fs'); +var wrench = require('../lib/wrench'); +var path = require('path'); + +module.exports = testCase({ + test_rmdirSyncRecursive: function(test) { + var dir = __dirname + '/_tmp2/foo/bar'; + + wrench.mkdirSyncRecursive(dir, '777'); + + var f1Path = path.join(dir, 'test1.txt'); + var f2Path = path.join(path.dirname(dir), 'test2.txt'); + var f3Path = path.join(path.dirname(path.dirname(dir)), 'test3.txt'); + + fs.writeFileSync(f1Path, 'foo bar baz'); + fs.writeFileSync(f2Path, 'foo bar baz'); + fs.writeFileSync(f3Path, 'foo bar baz'); + + fs.chmodSync(f1Path, '444'); + fs.chmodSync(f2Path, '444'); + fs.chmodSync(f3Path, '444'); + + test.equals(fs.existsSync(dir), true, 'Dir should exist - mkdirSyncRecursive not working?'); + test.equals(fs.existsSync(f1Path), true, 'File should exist'); + test.equals(fs.existsSync(f2Path), true, 'File should exist'); + test.equals(fs.existsSync(f3Path), true, 'File should exist'); + + wrench.rmdirSyncRecursive(dir); + + test.equals(fs.existsSync(dir), false, 'Dir should not exist now...'); + test.equals(fs.existsSync(f1Path), false, 'File should not exist'); + test.equals(fs.existsSync(f2Path), true, 'File should exist'); + test.equals(fs.existsSync(f3Path), true, 'File should exist'); + + wrench.rmdirSyncRecursive(path.dirname(path.dirname(dir))); + + test.done(); + }, + + test_rmdirSyncRecursiveFromRoot: function(test) { + var dir = __dirname + '/_tmp3/foo/bar'; + + wrench.mkdirSyncRecursive(dir, '777'); + + var f1Path = path.join(dir, 'test1.txt'); + var f2Path = path.join(path.dirname(dir), 'test2.txt'); + var f3Path = path.join(path.dirname(path.dirname(dir)), 'test3.txt'); + + fs.writeFileSync(f1Path, 'foo bar baz'); + fs.writeFileSync(f2Path, 'foo bar baz'); + fs.writeFileSync(f3Path, 'foo bar baz'); + + fs.chmodSync(f1Path, '444'); + fs.chmodSync(f2Path, '444'); + fs.chmodSync(f3Path, '444'); + + test.equals(fs.existsSync(dir), true, 'Dir should exist - mkdirSyncRecursive not working?'); + test.equals(fs.existsSync(f1Path), true, 'File should exist'); + test.equals(fs.existsSync(f2Path), true, 'File should exist'); + test.equals(fs.existsSync(f3Path), true, 'File should exist'); + + wrench.rmdirSyncRecursive(path.dirname(path.dirname(dir))); + + test.equals(fs.existsSync(dir), false, 'Dir should not exist now...'); + test.equals(fs.existsSync(f1Path), false, 'File should not exist'); + test.equals(fs.existsSync(f2Path), false, 'File should not exist'); + test.equals(fs.existsSync(f3Path), false, 'File should not exist'); + + test.done(); + } +}); + +// vim: et ts=4 sw=4 diff --git a/node_modules/jsdoc/node_modules/wrench/tests/runner.js b/node_modules/jsdoc/node_modules/wrench/tests/runner.js index a5cc8f7..e321a15 100644 --- a/node_modules/jsdoc/node_modules/wrench/tests/runner.js +++ b/node_modules/jsdoc/node_modules/wrench/tests/runner.js @@ -3,5 +3,7 @@ module.exports = { group_mkdir: require('./mkdir'), - group_readdir: require('./readdir') + group_readdir: require('./readdir'), + group_copydir: require('./copydirsync_unix'), + group_rmdir: require('./rmdirSyncRecursive') }; diff --git a/node_modules/jsdoc/node_modules/wrench/tests/shown/.hidden.txt b/node_modules/jsdoc/node_modules/wrench/tests/shown/.hidden.txt new file mode 100644 index 0000000..b96b725 --- /dev/null +++ b/node_modules/jsdoc/node_modules/wrench/tests/shown/.hidden.txt @@ -0,0 +1 @@ +hidden file \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/wrench/tests/shown/.hidden/dolor.md b/node_modules/jsdoc/node_modules/wrench/tests/shown/.hidden/dolor.md new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/jsdoc/node_modules/wrench/tests/shown/bar.txt b/node_modules/jsdoc/node_modules/wrench/tests/shown/bar.txt new file mode 100644 index 0000000..3d36c5c --- /dev/null +++ b/node_modules/jsdoc/node_modules/wrench/tests/shown/bar.txt @@ -0,0 +1 @@ +shown file \ No newline at end of file diff --git a/node_modules/jsdoc/node_modules/wrench/tests/shown/foo/bar/ipsum.js b/node_modules/jsdoc/node_modules/wrench/tests/shown/foo/bar/ipsum.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/jsdoc/node_modules/wrench/tests/shown/foo/dolor.md b/node_modules/jsdoc/node_modules/wrench/tests/shown/foo/dolor.md new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/jsdoc/node_modules/wrench/tests/shown/foo/lorem.txt b/node_modules/jsdoc/node_modules/wrench/tests/shown/foo/lorem.txt new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/jsdoc/node_modules/wrench/tests/withsymlinks/test b/node_modules/jsdoc/node_modules/wrench/tests/withsymlinks/test new file mode 100644 index 0000000..dba6882 --- /dev/null +++ b/node_modules/jsdoc/node_modules/wrench/tests/withsymlinks/test @@ -0,0 +1 @@ +aaa bbb ccc ddd \ No newline at end of file diff --git a/node_modules/jsdoc/package.json b/node_modules/jsdoc/package.json index 8f4c100..2a042b6 100644 --- a/node_modules/jsdoc/package.json +++ b/node_modules/jsdoc/package.json @@ -1,37 +1,34 @@ { "name": "jsdoc", - "version": "3.3.0-alpha9", - "revision": "1403969163513", + "version": "3.3.0-beta1", + "revision": "1421862103679", "description": "An API documentation generator for JavaScript.", "keywords": [ "documentation", "javascript" ], - "licenses": [ - { - "type": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], + "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/jsdoc3/jsdoc" }, "dependencies": { - "async": "~0.1.22", - "catharsis": "~0.8.2", + "async": "~0.9.0", + "catharsis": "~0.8.6", + "escape-string-regexp": "~1.0.2", "esprima": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c", - "js2xmlparser": "~0.1.0", - "marked": "~0.3.1", + "js2xmlparser": "~0.1.7", + "marked": "~0.3.2", "requizzle": "~0.2.0", - "strip-json-comments": "~0.1.3", - "taffydb": "https://github.com/hegemonic/taffydb/tarball/master", - "underscore": "~1.6.0", - "wrench": "~1.3.9" + "strip-json-comments": "~1.0.2", + "taffydb": "https://github.com/hegemonic/taffydb/tarball/7d100bcee0e997ee4977e273cdce60bd8933050e", + "underscore": "~1.7.0", + "wrench": "~1.5.8" }, "devDependencies": { - "gulp": "~3.6.2", - "gulp-eslint": "~0.1.6", + "eslint": "~0.11.0", + "gulp": "~3.8.5", + "gulp-eslint": "~0.1.7", "gulp-json-editor": "~2.0.2", "istanbul": "~0.2.1", "tv4": "https://github.com/hegemonic/tv4/tarball/own-properties" @@ -67,21 +64,20 @@ "email": "jeffrey.l.williams@gmail.com" } ], - "gitHead": "f5da3b7c9603bdcc80bff7c187d592f3d9fcf450", "homepage": "https://github.com/jsdoc3/jsdoc", - "_id": "jsdoc@3.3.0-alpha9", - "_shasum": "8527b69bfcf5eaf2a6ae82ac01686151bba31660", - "_from": "jsdoc@3.3.0-alpha9", - "_npmVersion": "1.4.16", + "_id": "jsdoc@3.3.0-beta1", + "_shasum": "3a5e90ec832e5d5ae2c6b54701e1ea3f122153e9", + "_from": "jsdoc@*", + "_npmVersion": "1.4.9", "_npmUser": { "name": "hegemonic", "email": "jeffrey.l.williams@gmail.com" }, "dist": { - "shasum": "8527b69bfcf5eaf2a6ae82ac01686151bba31660", - "tarball": "http://registry.npmjs.org/jsdoc/-/jsdoc-3.3.0-alpha9.tgz" + "shasum": "3a5e90ec832e5d5ae2c6b54701e1ea3f122153e9", + "tarball": "http://registry.npmjs.org/jsdoc/-/jsdoc-3.3.0-beta1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.3.0-alpha9.tgz", + "_resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.3.0-beta1.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/jsdoc/package.json.orig b/node_modules/jsdoc/package.json.orig index bd8fc9d..14ad192 100644 --- a/node_modules/jsdoc/package.json.orig +++ b/node_modules/jsdoc/package.json.orig @@ -1,30 +1,26 @@ { "name": "jsdoc", <<<<<<< HEAD - "version": "3.3.0-alpha8", - "revision": "1402517102726", + "version": "3.3.0-alpha13", + "revision": "1419376892674", ======= "version": "3.3.0-dev", - "revision": "1403969163513", ->>>>>>> origin/master + "revision": "1421032593200", +>>>>>>> master "description": "An API documentation generator for JavaScript.", "keywords": [ "documentation", "javascript" ], - "licenses": [ - { - "type": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], + "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/jsdoc3/jsdoc" }, "dependencies": { "async": "~0.1.22", - "catharsis": "~0.8.2", + "catharsis": "~0.8.6", + "escape-string-regexp": "~1.0.0", "esprima": "https://github.com/ariya/esprima/tarball/49a2eccb243f29bd653b11e9419241a9d726af7c", "js2xmlparser": "~0.1.0", "marked": "~0.3.1", @@ -35,8 +31,9 @@ "wrench": "~1.3.9" }, "devDependencies": { - "gulp": "~3.6.2", - "gulp-eslint": "~0.1.6", + "eslint": "~0.11.0", + "gulp": "~3.8.5", + "gulp-eslint": "~0.1.7", "gulp-json-editor": "~2.0.2", "istanbul": "~0.2.1", "tv4": "https://github.com/hegemonic/tv4/tarball/own-properties" diff --git a/node_modules/jsdoc/plugins/commentConvert.js b/node_modules/jsdoc/plugins/commentConvert.js index cac6d87..64347e0 100644 --- a/node_modules/jsdoc/plugins/commentConvert.js +++ b/node_modules/jsdoc/plugins/commentConvert.js @@ -5,6 +5,8 @@ */ 'use strict'; +/*eslint spaced-line-comment: 0 */ + exports.handlers = { /// /// Convert ///-style comments into jsdoc comments. @@ -18,4 +20,4 @@ exports.handlers = { return replacement; }); } -}; \ No newline at end of file +}; diff --git a/node_modules/jsdoc/plugins/escapeHtml.js b/node_modules/jsdoc/plugins/escapeHtml.js index d587405..a900bfa 100644 --- a/node_modules/jsdoc/plugins/escapeHtml.js +++ b/node_modules/jsdoc/plugins/escapeHtml.js @@ -13,8 +13,8 @@ exports.handlers = { newDoclet: function(e) { if (e.doclet.description) { e.doclet.description = e.doclet.description - .replace(/&/g,'&') - .replace(/'); } } diff --git a/node_modules/jsdoc/plugins/markdown.js b/node_modules/jsdoc/plugins/markdown.js index 7c7df69..7c50b72 100644 --- a/node_modules/jsdoc/plugins/markdown.js +++ b/node_modules/jsdoc/plugins/markdown.js @@ -1,4 +1,3 @@ -/*global env: true */ /** * @overview Translate doclet descriptions from MarkDown into HTML. * @module plugins/markdown @@ -7,22 +6,28 @@ */ 'use strict'; -var conf = env.conf.markdown; -var defaultTags = [ 'classdesc', 'description', 'params', 'properties', 'returns', 'see']; +var config = global.env.conf.markdown || {}; +var defaultTags = [ + 'author', + 'classdesc', + 'description', + 'exceptions', + 'params', + 'properties', + 'returns', + 'see' +]; var hasOwnProp = Object.prototype.hasOwnProperty; var parse = require('jsdoc/util/markdown').getParser(); var tags = []; var excludeTags = []; function shouldProcessString(tagName, text) { - var shouldProcess = false; + var shouldProcess = true; - if (tagName !== 'see') { - shouldProcess = true; - } - // we only want to process `@see` tags that contain Markdown links - else if (tagName === 'see' && text.indexOf('[') !== -1) { - shouldProcess = true; + // we only want to process `@author` and `@see` tags that contain Markdown links + if ( (tagName === 'author' || tagName === 'see') && text.indexOf('[') === -1 ) { + shouldProcess = false; } return shouldProcess; @@ -58,12 +63,12 @@ function process(doclet) { } // set up the list of "tags" (properties) to process -if (conf && conf.tags) { - tags = conf.tags.slice(); +if (config.tags) { + tags = config.tags.slice(); } // set up the list of default tags to exclude from processing -if (conf && conf.excludeTags) { - excludeTags = conf.excludeTags.slice(); +if (config.excludeTags) { + excludeTags = config.excludeTags.slice(); } defaultTags.forEach(function(tag) { if (excludeTags.indexOf(tag) === -1 && tags.indexOf(tag) === -1) { diff --git a/node_modules/jsdoc/plugins/partial.js b/node_modules/jsdoc/plugins/partial.js index 2718adc..feaa100 100644 --- a/node_modules/jsdoc/plugins/partial.js +++ b/node_modules/jsdoc/plugins/partial.js @@ -1,4 +1,3 @@ -/*global env: true */ /** @overview Adds support for reusable partial jsdoc files. @module plugins/partial @@ -10,21 +9,21 @@ var fs = require('jsdoc/fs'); var path = require('path'); exports.handlers = { - /// - /// Include a partial jsdoc - /// @param e - /// @param e.filename - /// @param e.source - /// - /// @example - /// @partial "partial_doc.jsdoc" - /// + /** + * Include a partial jsdoc + * + * @param e + * @param e.filename + * @param e.source + * @example + * @partial "partial_doc.jsdoc" + */ beforeParse: function(e) { e.source = e.source.replace(/(@partial \".*\")+/g, function($) { - var pathArg = $.match(/\".*\"/)[0].replace(/"/g,''); - var fullPath = path.join(e.filename , '..', pathArg); + var pathArg = $.match(/\".*\"/)[0].replace(/"/g, ''); + var fullPath = path.join(e.filename, '..', pathArg); - var partialData = fs.readFileSync(fullPath, env.opts.encoding); + var partialData = fs.readFileSync(fullPath, global.env.opts.encoding); return partialData; }); diff --git a/node_modules/jsdoc/plugins/railsTemplate.js b/node_modules/jsdoc/plugins/railsTemplate.js index 6a408f6..270381c 100644 --- a/node_modules/jsdoc/plugins/railsTemplate.js +++ b/node_modules/jsdoc/plugins/railsTemplate.js @@ -17,4 +17,4 @@ exports.handlers = { e.source = e.source.replace(/<%.*%>/g, ''); } } -}; \ No newline at end of file +}; diff --git a/node_modules/jsdoc/plugins/shout.js b/node_modules/jsdoc/plugins/shout.js index 34ed07c..05c5d9f 100644 --- a/node_modules/jsdoc/plugins/shout.js +++ b/node_modules/jsdoc/plugins/shout.js @@ -14,4 +14,4 @@ exports.handlers = { e.doclet.description = e.doclet.description.toUpperCase(); } } -}; \ No newline at end of file +}; diff --git a/node_modules/jsdoc/plugins/sourcetag.js b/node_modules/jsdoc/plugins/sourcetag.js index 2385426..c773283 100644 --- a/node_modules/jsdoc/plugins/sourcetag.js +++ b/node_modules/jsdoc/plugins/sourcetag.js @@ -23,7 +23,6 @@ exports.handlers = { tag, value; - //console.log(e.doclet); // any user-defined tags in this doclet? if (typeof tags !== 'undefined') { // only interested in the @source tags diff --git a/node_modules/jsdoc/plugins/summarize.js b/node_modules/jsdoc/plugins/summarize.js new file mode 100644 index 0000000..da72f73 --- /dev/null +++ b/node_modules/jsdoc/plugins/summarize.js @@ -0,0 +1,61 @@ +/** + * @overview This plugin creates a summary tag, if missing, from the first sentence in the + * description. + * @module plugins/summarize + * @author Mads Bondo Dydensborg + */ +'use strict'; + +exports.handlers = { + /** + * Autogenerate summaries, if missing, from the description, if present. + */ + newDoclet: function(e) { + var endTag; + var tags; + var stack; + + // If the summary is missing, grab the first sentence from the description + // and use that. + if (e.doclet && !e.doclet.summary && e.doclet.description) { + // The summary may end with `.$`, `. `, or `.<` (a period followed by an HTML tag). + e.doclet.summary = e.doclet.description.split(/\.$|\.\s|\.]+>/g) || []; + stack = []; + + tags.forEach(function(tag) { + var idx = tag.indexOf('/'); + + if (idx === -1) { + // start tag -- push onto the stack + stack.push(tag); + } else if (idx === 1) { + // end tag -- pop off of the stack + stack.pop(); + } + + // otherwise, it's a self-closing tag; don't modify the stack + }); + + // stack should now contain only the start tags that lack end tags, + // with the most deeply nested start tag at the top + while (stack.length > 0) { + // pop the unmatched tag off the stack + endTag = stack.pop(); + // get just the tag name + endTag = endTag.substring(1, endTag.search(/[ >]/)); + // append the end tag + e.doclet.summary += ''; + } + + // and, finally, if the summary starts and ends with a

      tag, remove it; let the + // template decide whether to wrap the summary in a

      tag + e.doclet.summary = e.doclet.summary.replace(/^

      (.*)<\/p>$/i, '$1'); + } + } +}; diff --git a/node_modules/jsdoc/plugins/test/fixtures/markdown.js b/node_modules/jsdoc/plugins/test/fixtures/markdown.js new file mode 100644 index 0000000..babd67f --- /dev/null +++ b/node_modules/jsdoc/plugins/test/fixtures/markdown.js @@ -0,0 +1,25 @@ +'use strict'; + +/** + * @see [Nowhere](http://nowhere.com) + */ +function foo() {} + +/** + * @see AnObject#myProperty + */ +function bar() {} + +/** + * @author [Mr. Macintosh](http://www.folklore.org/StoryView.py?story=Mister_Macintosh.txt) + * @classdesc My class. + * @description My class. + * @exception {Error} Some error. + * @param {string} myParam - My parameter. + * @property {string} value - Value of myParam. + * @return {MyClass} Class instance. + * @see [Example Inc.](http://example.com) + */ +function MyClass(myParam) { + this.value = myParam; +} diff --git a/node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js b/node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js deleted file mode 100644 index 6aba419..0000000 --- a/node_modules/jsdoc/plugins/test/fixtures/seetag-markdown.js +++ /dev/null @@ -1,11 +0,0 @@ -/** -* @see [Nowhere](http://nowhere.com) -*/ -function foo() { -} - -/** -* @see AnObject#myProperty -*/ -function bar() { -} diff --git a/node_modules/jsdoc/plugins/test/fixtures/underscore.js b/node_modules/jsdoc/plugins/test/fixtures/underscore.js new file mode 100644 index 0000000..a953c17 --- /dev/null +++ b/node_modules/jsdoc/plugins/test/fixtures/underscore.js @@ -0,0 +1,22 @@ +'use strict'; + +/** This doclet will be shown by default, just like normal. */ +function normal() {} + +/** This doclet will be hidden by default because it begins with an underscore. */ +function _hidden() {} + +/** + * Klass class + * @class + */ +function Klass() { + /** This is a private property of the class, and should not. */ + this._privateProp = null; + + /** + * This is a property explicitly marked as private. + * @private + */ + this.privateProp = null; +} diff --git a/node_modules/jsdoc/plugins/test/specs/markdown.js b/node_modules/jsdoc/plugins/test/specs/markdown.js index c9d89cc..e2f4477 100644 --- a/node_modules/jsdoc/plugins/test/specs/markdown.js +++ b/node_modules/jsdoc/plugins/test/specs/markdown.js @@ -1,29 +1,49 @@ -/*global describe: true, env: true, expect: true, it: true, jasmine: true */ +'use strict'; var path = require('jsdoc/path'); -describe("markdown plugin", function() { - //TODO -}); - -describe("markdown see tag support", function() { +describe('markdown plugin', function() { var pluginPath = 'plugins/markdown'; - var pluginPathResolved = path.join(env.dirname, pluginPath); + var pluginPathResolved = path.join(global.env.dirname, pluginPath); var plugin = require(pluginPathResolved); - var docSet = jasmine.getDocSetFromFile('plugins/test/fixtures/seetag-markdown.js'); - var foo = docSet.getByLongname('foo')[0]; - var bar = docSet.getByLongname('bar')[0]; + var docSet = jasmine.getDocSetFromFile('plugins/test/fixtures/markdown.js'); - it ('should parse @see tags containing links', function() { - plugin.handlers.newDoclet({doclet:foo}); - expect(typeof foo).toEqual('object'); - expect(foo.see[0]).toEqual('

      Nowhere

      '); + // TODO: more tests; refactor the plugin so multiple settings can be tested + + it('should process the correct tags by default', function() { + var myClass = docSet.getByLongname('MyClass')[0]; + + plugin.handlers.newDoclet({ doclet: myClass }); + [ + myClass.author[0], + myClass.classdesc, + myClass.description, + myClass.exceptions[0].description, + myClass.params[0].description, + myClass.properties[0].description, + myClass.returns[0].description, + myClass.see + ].forEach(function(value) { + // if we processed the value, it should be wrapped in a

      tag + expect( /^

      (?:.+)<\/p>$/.test(value) ).toBe(true); + }); }); - it ('should not parse @see tags that do not contain links', function() { - plugin.handlers.newDoclet({doclet:bar}); - expect(typeof bar).toEqual('object'); - expect(bar.see[0]).toEqual('AnObject#myProperty'); + describe('@see tag support', function() { + var foo = docSet.getByLongname('foo')[0]; + var bar = docSet.getByLongname('bar')[0]; + + it('should parse @see tags containing links', function() { + plugin.handlers.newDoclet({ doclet: foo }); + expect(typeof foo).toEqual('object'); + expect(foo.see[0]).toEqual('

      Nowhere

      '); + }); + + it('should not parse @see tags that do not contain links', function() { + plugin.handlers.newDoclet({ doclet: bar }); + expect(typeof bar).toEqual('object'); + expect(bar.see[0]).toEqual('AnObject#myProperty'); + }); }); }); diff --git a/node_modules/jsdoc/plugins/test/specs/sourcetag.js b/node_modules/jsdoc/plugins/test/specs/sourcetag.js index ab154bf..5c6568b 100644 --- a/node_modules/jsdoc/plugins/test/specs/sourcetag.js +++ b/node_modules/jsdoc/plugins/test/specs/sourcetag.js @@ -1,21 +1,23 @@ -/*global describe: true, env: true, expect: true, it: true, jasmine: true */ -describe("sourcetag plugin", function() { +/*global describe, expect, it, jasmine */ +'use strict'; + +describe('sourcetag plugin', function() { var parser = jasmine.createParser(); var path = require('jsdoc/path'); var docSet; var pluginPath = 'plugins/sourcetag'; - var pluginPathResolved = path.join(env.dirname, pluginPath); + var pluginPathResolved = path.join(global.env.dirname, pluginPath); var plugin = require(pluginPathResolved); require('jsdoc/plugins').installPlugins([pluginPathResolved], parser); docSet = jasmine.getDocSetFromFile(pluginPath + '.js', parser); it("should set the lineno and filename of the doclet's meta property", function() { - var doclet = docSet.getByLongname("module:plugins/sourcetag.handlers.newDoclet"); + var doclet = docSet.getByLongname('module:plugins/sourcetag.handlers.newDoclet'); expect(doclet[0].meta).toBeDefined(); - expect(doclet[0].meta.filename).toEqual("sourcetag.js"); + expect(doclet[0].meta.filename).toEqual('sourcetag.js'); expect(doclet[0].meta.lineno).toEqual(13); }); }); diff --git a/node_modules/jsdoc/plugins/test/specs/summarize.js b/node_modules/jsdoc/plugins/test/specs/summarize.js new file mode 100644 index 0000000..9fb5ab8 --- /dev/null +++ b/node_modules/jsdoc/plugins/test/specs/summarize.js @@ -0,0 +1,112 @@ +/*global describe, expect, it */ +'use strict'; + +var summarize = require('../../summarize'); + +describe('summarize', function() { + it('should export handlers', function() { + expect(summarize.handlers).toBeDefined(); + expect(typeof summarize.handlers).toBe('object'); + }); + + it('should export a newDoclet handler', function() { + expect(summarize.handlers.newDoclet).toBeDefined(); + expect(typeof summarize.handlers.newDoclet).toBe('function'); + }); + + describe('newDoclet handler', function() { + var handler = summarize.handlers.newDoclet; + + it('should not blow up if the doclet is missing', function() { + function noDoclet() { + return handler({}); + } + + expect(noDoclet).not.toThrow(); + }); + + it('should not change the summary if it is already defined', function() { + var doclet = { + summary: 'This is a summary.', + description: 'Descriptions are good.' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).not.toBe(doclet.description); + }); + + it('should not do anything if the description is missing', function() { + var doclet = {}; + handler({ doclet: doclet }); + + expect(doclet.summary).not.toBeDefined(); + }); + + it('should use the first sentence as the summary', function() { + var doclet = { + description: 'This sentence is the summary. This sentence is not.' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).toBe('This sentence is the summary.'); + }); + + it('should not add an extra period if there is only one sentence in the description', + function() { + var doclet = { + description: 'This description has only one sentence.' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).toBe('This description has only one sentence.'); + }); + + it('should use the entire description, plus a period, as the summary if the description ' + + 'does not contain a period', function() { + var doclet = { + description: 'This is a description' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).toBe('This is a description.'); + }); + + it('should use the entire description as the summary if the description contains only ' + + 'one sentence', function() { + var doclet = { + description: 'This is a description.' + }; + handler({ doclet: doclet }); + + expect(doclet.description).toBe('This is a description.'); + }); + + it('should work when an HTML tag immediately follows the first sentence', function() { + var doclet = { + description: 'This sentence is the summary.This sentence is small.' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).toBe('This sentence is the summary.'); + }); + + it('should generate valid HTML if a tag is opened, but not closed, in the summary', + function() { + var doclet = { + description: 'This description has a tag. The tag straddles sentences.' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).toBe('This description has a tag.'); + }); + + it('should not include a

      tag in the summary', function() { + var doclet = { + description: '

      This description contains HTML.

      And plenty of it!

      ' + }; + handler({ doclet: doclet }); + + expect(doclet.summary).toBe('This description contains HTML.'); + }); + }); +}); diff --git a/node_modules/jsdoc/plugins/test/specs/underscore.js b/node_modules/jsdoc/plugins/test/specs/underscore.js new file mode 100644 index 0000000..cba70ae --- /dev/null +++ b/node_modules/jsdoc/plugins/test/specs/underscore.js @@ -0,0 +1,35 @@ +'use strict'; + +describe('underscore plugin', function () { + var parser = jasmine.createParser(); + var path = require('jsdoc/path'); + + var docSet; + + var pluginPath = 'plugins/underscore'; + var fixturePath = 'plugins/test/fixtures/underscore'; + var pluginPathResolved = path.join(env.dirname, pluginPath); + var plugin = require(pluginPathResolved); + + require('jsdoc/plugins').installPlugins([pluginPathResolved], parser); + docSet = jasmine.getDocSetFromFile(fixturePath + '.js', parser); + + it('should not mark normal, public properties as private', function() { + // Base line tests + var normal = docSet.getByLongname('normal'); + expect(normal[0].access).toBeUndefined(); + + var realPrivate = docSet.getByLongname('Klass#privateProp'); + expect(realPrivate[0].access).toEqual('private'); + }); + + it('should hide doclet for symbols beginning with an underscore under normal circumstances', function () { + var hidden = docSet.getByLongname('_hidden'); + expect(hidden[0].access).toEqual('private'); + }); + + it('picks up "this"', function() { + var privateUnderscore = docSet.getByLongname('Klass#_privateProp'); + expect(privateUnderscore[0].access).toEqual('private'); + }); +}); diff --git a/node_modules/jsdoc/plugins/underscore.js b/node_modules/jsdoc/plugins/underscore.js new file mode 100644 index 0000000..e5cf112 --- /dev/null +++ b/node_modules/jsdoc/plugins/underscore.js @@ -0,0 +1,21 @@ +'use strict'; + +/** + * Removes all symbols that begin with an underscore from the doc output. If + * you're using underscores to denote private variables in modules, this + * automatically hides them. + * + * @module plugins/underscore + * @author Daniel Ellis + */ + +exports.handlers = { + newDoclet: function(e) { + var doclet = e.doclet; + + // Ignore comment blocks for all symbols that begin with underscore + if (doclet.name.charAt(0) === '_' || doclet.name.substr(0, 6) === 'this._') { + doclet.access = 'private'; + } + } +}; diff --git a/node_modules/jsdoc/templates/default/README.md b/node_modules/jsdoc/templates/default/README.md index a7bd96b..bc74d34 100644 --- a/node_modules/jsdoc/templates/default/README.md +++ b/node_modules/jsdoc/templates/default/README.md @@ -1 +1,12 @@ The default template for JSDoc 3 uses: [the Taffy Database library](http://taffydb.com/) and the [Underscore Template library](http://documentcloud.github.com/underscore/#template). + + +## Generating Typeface Fonts + +The default template uses the [OpenSans](https://www.google.com/fonts/specimen/Open+Sans) typeface. The font files can be regenerated as follows: + +1. Open the [OpenSans page at Font Squirrel](). +2. Click on the 'Webfont Kit' tab. +3. Either leave the subset drop-down as 'Western Latin (Default)', or, if we decide we need more glyphs, than change it to 'No Subsetting'. +4. Click the 'DOWNLOAD @FONT-FACE KIT' button. +5. For each typeface variant we plan to use, copy the 'eot', 'svg' and 'woff' files into the 'templates/default/static/fonts' directory. diff --git a/node_modules/jsdoc/templates/default/publish.js b/node_modules/jsdoc/templates/default/publish.js index c7ac385..b85fbb5 100644 --- a/node_modules/jsdoc/templates/default/publish.js +++ b/node_modules/jsdoc/templates/default/publish.js @@ -1,6 +1,7 @@ /*global env: true */ 'use strict'; +var doop = require('jsdoc/util/doop'); var fs = require('jsdoc/fs'); var helper = require('jsdoc/util/templateHelper'); var logger = require('jsdoc/util/logger'); @@ -18,7 +19,7 @@ var hasOwnProp = Object.prototype.hasOwnProperty; var data; var view; -var outdir = env.opts.destination; +var outdir = path.normalize(env.opts.destination); function find(spec) { return helper.find(data, spec); @@ -104,7 +105,7 @@ function addParamAttributes(params) { function buildItemTypeStrings(item) { var types = []; - if (item.type && item.type.names) { + if (item && item.type && item.type.names) { item.type.names.forEach(function(name) { types.push( linkto(name, htmlsafe(name)) ); }); @@ -262,17 +263,63 @@ function attachModuleSymbols(doclets, modules) { // build a lookup table doclets.forEach(function(symbol) { - symbols[symbol.longname] = symbol; + symbols[symbol.longname] = symbols[symbol.longname] || []; + symbols[symbol.longname].push(symbol); }); return modules.map(function(module) { if (symbols[module.longname]) { - module.module = symbols[module.longname]; - module.module.name = module.module.name.replace('module:', '(require("') + '"))'; + module.modules = symbols[module.longname] + // Only show symbols that have a description. Make an exception for classes, because + // we want to show the constructor-signature heading no matter what. + .filter(function(symbol) { + return symbol.description || symbol.kind === 'class'; + }) + .map(function(symbol) { + symbol = doop(symbol); + + if (symbol.kind === 'class' || symbol.kind === 'function') { + symbol.name = symbol.name.replace('module:', '(require("') + '"))'; + } + + return symbol; + }); } }); } +function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) { + var nav = ''; + + if (items.length) { + var itemsNav = ''; + + items.forEach(function(item) { + if ( !hasOwnProp.call(item, 'longname') ) { + itemsNav += '
    3. ' + linktoFn('', item.name) + '
    4. '; + } + else if ( !hasOwnProp.call(itemsSeen, item.longname) ) { + itemsNav += '
    5. ' + linktoFn(item.longname, item.name.replace(/^module:/, '')) + '
    6. '; + itemsSeen[item.longname] = true; + } + }); + + if (itemsNav !== '') { + nav += '

      ' + itemHeading + '

        ' + itemsNav + '
      '; + } + } + + return nav; +} + +function linktoTutorial(longName, name) { + return tutoriallink(name); +} + +function linktoExternal(longName, name) { + return linkto(longName, name.replace(/(^"|"$)/g, '')); +} + /** * Create the navigation sidebar. * @param {object} members The members that will be used to create the sidebar. @@ -284,100 +331,26 @@ function attachModuleSymbols(doclets, modules) { * @param {array} members.namespaces * @param {array} members.tutorials * @param {array} members.events + * @param {array} members.interfaces * @return {string} The HTML for the navigation sidebar. */ function buildNav(members) { - var nav = '

      Index

      ', - seen = {}, - hasClassList = false, - classNav = '', - globalNav = ''; + var nav = '

      Home

      '; + var seen = {}; + var seenTutorials = {}; - if (members.modules.length) { - nav += '

      Modules

        '; - members.modules.forEach(function(m) { - if ( !hasOwnProp.call(seen, m.longname) ) { - nav += '
      • ' + linkto(m.longname, m.name) + '
      • '; - } - seen[m.longname] = true; - }); - - nav += '
      '; - } - - if (members.externals.length) { - nav += '

      Externals

        '; - members.externals.forEach(function(e) { - if ( !hasOwnProp.call(seen, e.longname) ) { - nav += '
      • ' + linkto( e.longname, e.name.replace(/(^"|"$)/g, '') ) + '
      • '; - } - seen[e.longname] = true; - }); - - nav += '
      '; - } - - if (members.classes.length) { - members.classes.forEach(function(c) { - if ( !hasOwnProp.call(seen, c.longname) ) { - classNav += '
    7. ' + linkto(c.longname, c.name) + '
    8. '; - } - seen[c.longname] = true; - }); - - if (classNav !== '') { - nav += '

      Classes

        '; - nav += classNav; - nav += '
      '; - } - } - - if (members.events.length) { - nav += '

      Events

        '; - members.events.forEach(function(e) { - if ( !hasOwnProp.call(seen, e.longname) ) { - nav += '
      • ' + linkto(e.longname, e.name) + '
      • '; - } - seen[e.longname] = true; - }); - - nav += '
      '; - } - - if (members.namespaces.length) { - nav += '

      Namespaces

        '; - members.namespaces.forEach(function(n) { - if ( !hasOwnProp.call(seen, n.longname) ) { - nav += '
      • ' + linkto(n.longname, n.name) + '
      • '; - } - seen[n.longname] = true; - }); - - nav += '
      '; - } - - if (members.mixins.length) { - nav += '

      Mixins

        '; - members.mixins.forEach(function(m) { - if ( !hasOwnProp.call(seen, m.longname) ) { - nav += '
      • ' + linkto(m.longname, m.name) + '
      • '; - } - seen[m.longname] = true; - }); - - nav += '
      '; - } - - if (members.tutorials.length) { - nav += '

      Tutorials

        '; - members.tutorials.forEach(function(t) { - nav += '
      • ' + tutoriallink(t.name) + '
      • '; - }); - - nav += '
      '; - } + nav += buildMemberNav(members.modules, 'Modules', {}, linkto); + nav += buildMemberNav(members.externals, 'Externals', seen, linktoExternal); + nav += buildMemberNav(members.classes, 'Classes', seen, linkto); + nav += buildMemberNav(members.events, 'Events', seen, linkto); + nav += buildMemberNav(members.namespaces, 'Namespaces', seen, linkto); + nav += buildMemberNav(members.mixins, 'Mixins', seen, linkto); + nav += buildMemberNav(members.tutorials, 'Tutorials', seenTutorials, linktoTutorial); + nav += buildMemberNav(members.interfaces, 'Interfaces', seen, linkto); if (members.globals.length) { + var globalNav = ''; + members.globals.forEach(function(g) { if ( g.kind !== 'typedef' && !hasOwnProp.call(seen, g.longname) ) { globalNav += '
    9. ' + linkto(g.longname, g.name) + '
    10. '; @@ -406,10 +379,10 @@ exports.publish = function(taffyData, opts, tutorials) { data = taffyData; var conf = env.conf.templates || {}; - conf['default'] = conf['default'] || {}; + conf.default = conf.default || {}; - var templatePath = opts.template; - view = new template.Template(templatePath + '/tmpl'); + var templatePath = path.normalize(opts.template); + view = new template.Template( path.join(templatePath, 'tmpl') ); // claim some special filenames in advance, so the All-Powerful Overseer of Filename Uniqueness // doesn't try to hand them out later @@ -420,9 +393,9 @@ exports.publish = function(taffyData, opts, tutorials) { helper.registerLink('global', globalUrl); // set up templating - view.layout = conf['default'].layoutFile ? - path.getResourcePath(path.dirname(conf['default'].layoutFile), - path.basename(conf['default'].layoutFile) ) : + view.layout = conf.default.layoutFile ? + path.getResourcePath(path.dirname(conf.default.layoutFile), + path.basename(conf.default.layoutFile) ) : 'layout.tmpl'; // set up tutorials for helper @@ -443,7 +416,7 @@ exports.publish = function(taffyData, opts, tutorials) { if (example.match(/^\s*([\s\S]+?)<\/caption>(\s*[\n\r])([\s\S]+)$/i)) { caption = RegExp.$1; - code = RegExp.$3; + code = RegExp.$3; } return { @@ -475,7 +448,7 @@ exports.publish = function(taffyData, opts, tutorials) { // update outdir if necessary, then create outdir var packageInfo = ( find({kind: 'package'}) || [] ) [0]; if (packageInfo && packageInfo.name) { - outdir = path.join(outdir, packageInfo.name, packageInfo.version); + outdir = path.join( outdir, packageInfo.name, (packageInfo.version || '') ); } fs.mkPath(outdir); @@ -493,9 +466,13 @@ exports.publish = function(taffyData, opts, tutorials) { var staticFilePaths; var staticFileFilter; var staticFileScanner; - if (conf['default'].staticFiles) { - staticFilePaths = conf['default'].staticFiles.paths || []; - staticFileFilter = new (require('jsdoc/src/filter')).Filter(conf['default'].staticFiles); + if (conf.default.staticFiles) { + // The canonical property name is `include`. We accept `paths` for backwards compatibility + // with a bug in JSDoc 3.2.x. + staticFilePaths = conf.default.staticFiles.include || + conf.default.staticFiles.paths || + []; + staticFileFilter = new (require('jsdoc/src/filter')).Filter(conf.default.staticFiles); staticFileScanner = new (require('jsdoc/src/scanner')).Scanner(); staticFilePaths.forEach(function(filePath) { @@ -565,7 +542,7 @@ exports.publish = function(taffyData, opts, tutorials) { members.tutorials = tutorials.children; // output pretty-printed source files by default - var outputSourceFiles = conf['default'] && conf['default'].outputSourceFiles !== false ? true : + var outputSourceFiles = conf.default && conf.default.outputSourceFiles !== false ? true : false; // add template helpers @@ -578,8 +555,7 @@ exports.publish = function(taffyData, opts, tutorials) { // once for all view.nav = buildNav(members); - attachModuleSymbols( find({ kind: ['class', 'function'], longname: {left: 'module:'} }), - members.modules ); + attachModuleSymbols( find({ longname: {left: 'module:'} }), members.modules ); // generate the pretty-printed source files first so other pages can link to them if (outputSourceFiles) { @@ -592,7 +568,7 @@ exports.publish = function(taffyData, opts, tutorials) { var files = find({kind: 'file'}), packages = find({kind: 'package'}); - generate('Index', + generate('Home', packages.concat( [{kind: 'mainpage', readme: opts.readme, longname: (opts.mainpagetitle) ? opts.mainpagetitle : 'Main Page'}] ).concat(files), @@ -604,18 +580,19 @@ exports.publish = function(taffyData, opts, tutorials) { var namespaces = taffy(members.namespaces); var mixins = taffy(members.mixins); var externals = taffy(members.externals); + var interfaces = taffy(members.interfaces); Object.keys(helper.longnameToUrl).forEach(function(longname) { - var myClasses = helper.find(classes, {longname: longname}); - if (myClasses.length) { - generate('Class: ' + myClasses[0].name, myClasses, helper.longnameToUrl[longname]); - } - var myModules = helper.find(modules, {longname: longname}); if (myModules.length) { generate('Module: ' + myModules[0].name, myModules, helper.longnameToUrl[longname]); } + var myClasses = helper.find(classes, {longname: longname}); + if (myClasses.length) { + generate('Class: ' + myClasses[0].name, myClasses, helper.longnameToUrl[longname]); + } + var myNamespaces = helper.find(namespaces, {longname: longname}); if (myNamespaces.length) { generate('Namespace: ' + myNamespaces[0].name, myNamespaces, helper.longnameToUrl[longname]); @@ -630,6 +607,11 @@ exports.publish = function(taffyData, opts, tutorials) { if (myExternals.length) { generate('External: ' + myExternals[0].name, myExternals, helper.longnameToUrl[longname]); } + + var myInterfaces = helper.find(interfaces, {longname: longname}); + if (myInterfaces.length) { + generate('Interface: ' + myInterfaces[0].name, myInterfaces, helper.longnameToUrl[longname]); + } }); // TODO: move the tutorial functions to templateHelper.js diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.eot b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.eot new file mode 100644 index 0000000000000000000000000000000000000000..5d20d916338a5890a033952e2e07ba7380f5a7d3 GIT binary patch literal 19544 zcmZsBRZtvE7wqD@i!HFY1b24`kj35I-CYBL;O-Dy7Y*)i!Ciy9OMu`K2ubeuzujAP z&(u^;b@!=xJ5w`f^ppUAR7C&)@xOr#_z%&6s7NTth=|AtfF4A^f1HxqH6mcokP-l6 z{7?U16e0j9|A(M9nJ@pt|2J>}ssJ~DHNfRRlP19YKlJ?100c+?Tmeo1tN+$S0Gx`?s1CFN7eMUDk_WsHBTfGwNlSoSO;j5Y2+U^b7c?fa0Y^S_)w3$t3v&# z{~&TTlM zt?Lt*SHuem8SrEC@7zaU<-qSuQW-60?>}hkJOK8c63ZzHHJk8oZ^lJI@4J}J-UW#v z``};wWo2yOy5j-i>^G*aArwT)Vs*SHt6!%SuA2O<_J=(LpNDHvxaKhxXh#=~9&&Ym z(3h3}YEDIOIJiClxPx>szhB_|HF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HLF}4ntk)hHGA?L9ExfEv&1Ua3!5{ain#8Cm@-+Ea| zW4yEmUr0!%p}P%=)+dpJPDWLmPtM2S#aKAI;&DGXI@{;$;=1N-!(?WV%;v-S#dz`o j!x{jHm-dM!L@tgKC!1~`DFP}XH6$TyA!EyeVAY!l>$s0Q literal 0 HcmV?d00001 diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.svg b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.svg new file mode 100644 index 0000000..3ed7be4 --- /dev/null +++ b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.woff b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Bold-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..1205787b0ed50db71ebd4f8a7f85d106721ff258 GIT binary patch literal 22432 zcmZsB1B@t5ubU^O|H%}V|IzIVNI zUovCM*w)bDm$Uix&jbJf0&20h={9zAA^05!;@9Ta9)O418En_g!QA$j%|T zg7y+LH+25>h2!|O`Oo%0Aeh^Dn*DMD0007R000ge0Uny~7N&+K0045Wzx^z~U;{Kx zUbpxqf4R$F{l9sTz@vgjSlGIF007AU#s~B}CU7TXuFRs1z45P|qR4N2OTXCll}{hH zHT3wsuJV8Pgy25_69Vzr8QPlua=-Bb&i}^9U_Kjd;b8CV0sx?j@XNjYjt5W_dcEY} zWcur?{$H$r|HFd_(WSeo(QnM^|9*9_|6rl7So13Ze*rMbn?LiP91}v%{ZCFUVQhP> z8ylDy80-QYL4qL|7#V={y9-PL9W(yUI~b4<0Kj9tDn(W%NgQM3r-SAi%{IQ-av{#b zm?Dp*nUWE(`7{EcC}s)ta^1+9Uj`lvS<-m^uZMv8f-v%ehSe}U)}pB5vjGC6Uy~pm zo)<1qh;kgVTrs$D``1)&z8ke|;_(>$1Je!j%!vOnt{S4G>G`aABr9vrN*+4@PrG+q zdH3aZlXjCg-utrN?)PA6A(Aic*r{P)fItNfh`QJTc? z3wgp|$4hT`N(iVlzs(@58kfEk!62o^Q$flqq@=t{xl6XxO=$TCkbN0bkG!jwEbQN4 zG2V(|AGxWwXsuk-^?T%XAZ@~-ovUcv=&a}s0@$uWPKYo9;IKW2M`U||9p*tE=o13y zAO}3UTRRB4eo~B3#8#jJ2h?E$oa*=!uF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+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.woff b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-BoldItalic-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..ed760c0628b6a0026041f5b8bba466a0471fd2e0 GIT binary patch literal 23048 zcmZsC18^o?(C!;28{4*R+s4MWZQHh;Y;4=c#x^##ar4z*x9Z-izo(w+)6aCD(=$_Z zX6j6jo4lA900{6SnvekG|8#os|JeVv|9=q^Q;`J#fXaVZod00t3i={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t#ZMNBho0x?G)PHa;vXG>TT$m4_b# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.woff b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Italic-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..ff652e64356b538c001423b6aedefcf1ee66cd17 GIT binary patch literal 23188 zcmZsB1B@t5(Cyl`ZQHu*-MhAJ+qP}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0 HcmV?d00001 diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.svg b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.svg new file mode 100644 index 0000000..11a472c --- /dev/null +++ b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.woff b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Light-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..e786074813a27d0a7a249047832988d5bf0fe756 GIT binary patch literal 22248 zcmZsh1B_-}@aEgLZQHi(Y1_7KW7@WDOqPg|;+~g#c zTn|MF2_RsgpQU~Rg!-RNT>BsYzy1HaBqY@2fq;N3epI~wFj1RzkQ5V__|b-ce1ac{ zfboIAB$X6Zf3!m&Ah2Q}Am}`LXG{@E)n6h&KoF5XF+o366qrO7DylNF00BY5{rLJn z7#4V@A(_}2IsRz2Klw#KKp-%vH*Cr#?yf{Xb&!5yn10}+rURcbceJqk(S&|_y#3h3 z7+7y%3nQ1GTm-(K7^wdZl7+38`HvGnn`na|ZCO>gXKYf5#e%Pm@MS-(3 z^8E2tq<-><{sR;j#M$1+&g@6C{E0dHIb*DcNj9~kgNrK=keb?$_WDx~4Q1c$gXgoLPPM$A|b23vuQ89}D~g&=h~s?0Y}FgUqqZGapfmNBxwIuVFm(k ze2_5J1XP7GNR!Ub>HZ>jTD#<+>v|6A@Ps=rubqHZd2a9KgyVR&^O181UPYR$*uv^8jHMb|3VJelk8s&^2FN|ruFH*b0P-=Pxx z)n&d4)334G1?Ye~Q~-z$@yO0)EPiZm>;@5h&oDPs1QBS&9@GP>1JDlZFdytO5p0Mf z0mF?w6vH4nRycA8NUE&3+j`oFx2aVo;#l_bC3x_^QC zOIwCIWC%j+h!TDPjSlof`zj7nbHRVUC^89-V-ah|_Am14(ubnMne6_`PxvYvvpOVTMneb_yNnzE-NHsp$uk~E4o=th_|)1p<|5PC5H40YZHHZK-0b~`fdbVqJ0;h^LkIPchf2cz+yFG$aT z@DGbUJX0g2nIZ6P_yO?_upuT84MViLL9EyzcI!?A&RvR4?ajT7?&c*9@UShNC>D%g zbkUyp_`i6o+|@2C0Lra`zc3u!ksLzWwU(G7!V%!{ad_BVPb}tVi}J+a_!{n}qp>W~|28eomjC7^3R6XCBh(RU@wByCnk>!cC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P0({T{M@$YS2+qt{rPXGV5 z>xQ?i#oe93R)MjNjsn98u7Qy72Ekr{;2QJ+2yVei;2DPp;1#;{#~b(Z$z5`nyCaI0 z_~XUP|KbNoltdGaff$UKFcV80@g$H)63L{HN*d{8kVzKVW(;E)$9N_%kx5Ku3R9WJbY?J++~YA1c*r9@hQIfWCp_f@ zzVOd>@{;Ggz|UvCvWYnan9DqBsbe4Y%%_1Mjf7ahLKg9f#VnzTr7UL|7unBBRON ztxB8Ht}IhJl;z5Q^PCYiHCNN(ya8V*SW{iq=#P|iPei-YVKcZx!TRRJt@iP_BKw5Z zl~$$A+;Xk>&S-A)R2moUsumK}PumdA-uop!jAWOIa z4pB?622)yCurwR6C|O`;Ac|F3umUAvumMG5BVw=uBSf+b0R}3v3 literal 0 HcmV?d00001 diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.eot b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.eot new file mode 100644 index 0000000000000000000000000000000000000000..8f445929ffb03b50e98c2a2f7d831a0cb1b276a2 GIT binary patch literal 20535 zcmafZQ+ypx)a^O(iEWkGpb^r^29l-Wqjp_f>jr{-V1ptU^$o%)F{~gc(*CGHf4?y-E zz@Umba~?D9tFJR*Yv3jyddFod66X@Z0 z)6zUH6Vjr5hyB_yGNvf4)aw}K1E&#TQCt}D(zF?Y-wd8MxAavjpjWyH)H<$mm zxurwpRxdtGJjFhQ3#qJnt(hrQl)<;Zhb`-nJ`KW{OrW(;)CJ`y(J*misumjvqlS?C z<*p?0EEdIh&1&u);?5OH`X|1A)|#iW@j8v4s~HozYh zm{I0F|A2VHy?A4$90G;jE{Z6cv|W&kPRumH12QGg=(vztfiNlX!bxK*dC(lcV2BSI z(DBi12_+(#d#rev6tzFq_V$!C+c~W!t)QN4@6QBEWN}o*B2WOd5X;jLs%T;rsSI84 zg!0Jg7qRGQ0Qn)1B>tu_7+GzMPyU|>&3wkfs_O;#r0z2kBy38B-`KKUMUs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iMVX6}x1vi}OxYEkW;#A8(e~=5_ zt1$bx#=WQDtP;>H;Fmqxv*ScU8ONU|5IWQsszeB~hE8ZQ2>fCAO7%3S9uj-Rs|K-1 z=Wo;0>zW>#QMbh`rcAU#K1OY({*k55Fs%alIs7L(3YBByf}@bRLi~HGBbZMcR^-Y} zufzh^g(L^=Y@ifRI3jtK2<#!FGHkjER6M_))<^q#?4Alu-io<1EX_tvp zg3A!%#SprzJSDuTQ_O_))H8Ku+b&%~qAWmWKY>)}6bdueZ&`qVWEZ1=Y!LC_-N+yc Z%0#`NexefPFV?Xj51H#Y#AC7WXn+Jg($4?@ literal 0 HcmV?d00001 diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.svg b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.svg new file mode 100644 index 0000000..431d7e3 --- /dev/null +++ b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.svg @@ -0,0 +1,1835 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.woff b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-LightItalic-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..43e8b9e6cc061ff17fd2903075cbde12715512b3 GIT binary patch literal 23400 zcmZ^}18`?e^d=nJb~3STXQGL1+qNgRZQHhO+n(6?g`2m&|5saEwcEFzI(?pdPWS2V zs@A=3a$;gYz(7Aq%Nz*xKbeL0|LOnb|IZ{QrYr*l1YGvR;{69BS5Sbsh^W{PH}s};C5xs-P6IW9C4Fm)c^Z$WI+_ zKQcZN)>FvL!0E>qLGZ^0>VJS_X6<46!~FpQ65av=a!IPXxTrTbF)#)KQY8JcVfg_& zkYSRf`49QSssHG|en5%<2CiXlQ!y~@gw>Vptzt$wgxsPKit}n&C^eeb)HbU-}ZJ+KkZVV`{6!+%7Y0f))BOK zH2Lw>{NaG&{=rYh?Cy_YwQWe{ zPm`CO&kC-(_gf(w6)-|{nERgZ6RsvdyBDG14<$j7ef=mZG#)(n>lL4E#HZjlVc1)u zE$o?o=hs&I8f%}n#!Jd5QQsI^F^s|XdjMN+=vx7U80tLS<>49BYcJ}2Zb7;_b4nCJ zI9d41UOqA%q|^$a44I?u9?(!IlvO}R(7HzO$8%uu_(8b?NqPGw{Ccr70u!NJ)vkg7 zhp7B?S$&K~Wvl`^BfprjTy+h>;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6pUf>;G1)xX335Dgc5)GN zU2x@x);bWiF2(bLmQ(wn89qQA_5#~{jJg~1QQS4L7sGmNv08;qZsWSLAb z*< + diff --git a/node_modules/jsdoc/templates/default/tmpl/container.tmpl b/node_modules/jsdoc/templates/default/tmpl/container.tmpl index 173b043..c52d297 100644 --- a/node_modules/jsdoc/templates/default/tmpl/container.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/container.tmpl @@ -1,8 +1,16 @@ + @@ -12,25 +20,37 @@
      -

      - - - - - -

      - -
      + +

      + + + + + +

      + +
      + + + + +
      + +
      diff --git a/node_modules/jsdoc/templates/default/tmpl/details.tmpl b/node_modules/jsdoc/templates/default/tmpl/details.tmpl index 1ee86d2..d1ff696 100644 --- a/node_modules/jsdoc/templates/default/tmpl/details.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/details.tmpl @@ -9,17 +9,18 @@ if (data.defaultvalue && (data.defaultvaluetype === 'object' || data.defaultvalu defaultObjectClass = ' class="object-value"'; } ?> + + +
      Properties:
      + + + + +
      - - -
      Properties:
      - -
      - -
      Version:
      @@ -28,20 +29,55 @@ if (data.defaultvalue && (data.defaultvaluetype === 'object' || data.defaultvalu
      Since:
      -
      +
      - +
      Inherited From:
      • -
      + + + + +
      Overrides:
      +
      • + +
      + + + +
      Implementations:
      +
        + +
      • + +
      + + + +
      Implements:
      +
        + +
      • + +
      + + + +
      Mixes In:
      + +
        + +
      • + +
      Deprecated:
      • Yes
        diff --git a/node_modules/jsdoc/templates/default/tmpl/exceptions.tmpl b/node_modules/jsdoc/templates/default/tmpl/exceptions.tmpl index 78c4e25..9cef6c7 100644 --- a/node_modules/jsdoc/templates/default/tmpl/exceptions.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/exceptions.tmpl @@ -8,6 +8,7 @@ +
        @@ -18,6 +19,7 @@
        +
        diff --git a/node_modules/jsdoc/templates/default/tmpl/layout.tmpl b/node_modules/jsdoc/templates/default/tmpl/layout.tmpl index 92cd6ee..389831f 100644 --- a/node_modules/jsdoc/templates/default/tmpl/layout.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/layout.tmpl @@ -26,7 +26,7 @@ -
        +
        Documentation generated by JSDoc on diff --git a/node_modules/jsdoc/templates/default/tmpl/members.tmpl b/node_modules/jsdoc/templates/default/tmpl/members.tmpl index 0f99998..154c17b 100644 --- a/node_modules/jsdoc/templates/default/tmpl/members.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/members.tmpl @@ -2,40 +2,37 @@ var data = obj; var self = this; ?> -
        -

        +

        - -

        - -
        -
        - -
        - -
        - + +

        + - -
        Type:
        -
          -
        • - -
        • -
        - + +
        + +
        + - + +
        Type:
        +
          +
        • + +
        • +
        + - -
        Fires:
        -
          -
        • -
        - + - -
        Example 1? 's':'' ?>
        - - -
        + +
        Fires:
        +
          +
        • +
        + + + +
        Example 1? 's':'' ?>
        + + diff --git a/node_modules/jsdoc/templates/default/tmpl/method.tmpl b/node_modules/jsdoc/templates/default/tmpl/method.tmpl index ff51758..be60b8d 100644 --- a/node_modules/jsdoc/templates/default/tmpl/method.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/method.tmpl @@ -2,96 +2,104 @@ var data = obj; var self = this; ?> -
        -

        + + +

        Constructor

        + + +

        -
        -
        + - -
        - -
        - + +
        + +
        + - -
        Type:
        -
          -
        • - -
        • -
        - + +
        Extends:
        + + - -
        This:
        -
        - + +
        Type:
        +
          +
        • + +
        • +
        + - -
        Parameters:
        - - + +
        This:
        +
        + - + +
        Parameters:
        + + - -
        Requires:
        -
          -
        • -
        - + - -
        Fires:
        -
          -
        • -
        - + +
        Requires:
        +
          +
        • +
        + - -
        Listens to Events:
        -
          -
        • -
        - + +
        Fires:
        +
          +
        • +
        + - -
        Listeners of This Event:
        -
          -
        • -
        - + +
        Listens to Events:
        +
          +
        • +
        + - -
        Throws:
        - 1) { ?>
          -
        • -
        - - + +
        Listeners of This Event:
        +
          +
        • +
        + - -
        Returns:
        - 1) { ?>
          -
        • -
        - - + +
        Throws:
        + 1) { ?>
          +
        • +
        + + - -
        Example 1? 's':'' ?>
        - - -
        + +
        Returns:
        + 1) { ?>
          +
        • +
        + + + + +
        Example 1? 's':'' ?>
        + + diff --git a/node_modules/jsdoc/templates/default/tmpl/params.tmpl b/node_modules/jsdoc/templates/default/tmpl/params.tmpl index 66ab045..336fb5a 100644 --- a/node_modules/jsdoc/templates/default/tmpl/params.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/params.tmpl @@ -4,12 +4,21 @@ /* sort subparams under their parent params (like opts.classname) */ var parentParam = null; params.forEach(function(param, i) { - if (!param) { return; } - if ( parentParam && param.name && param.name.indexOf(parentParam.name + '.') === 0 ) { - param.name = param.name.substr(parentParam.name.length+1); - parentParam.subparams = parentParam.subparams || []; - parentParam.subparams.push(param); - params[i] = null; + var paramRegExp; + + if (!param) { + return; + } + + if (parentParam && parentParam.name && param.name) { + paramRegExp = new RegExp('^(?:' + parentParam.name + '(?:\\[\\])*)\\.(.+)$'); + + if ( paramRegExp.test(param.name) ) { + param.name = RegExp.$1; + parentParam.subparams = parentParam.subparams || []; + parentParam.subparams.push(param); + params[i] = null; + } } else { parentParam = param; @@ -109,4 +118,4 @@ - \ No newline at end of file + diff --git a/node_modules/jsdoc/templates/default/tmpl/properties.tmpl b/node_modules/jsdoc/templates/default/tmpl/properties.tmpl index 58f412f..40e0909 100644 --- a/node_modules/jsdoc/templates/default/tmpl/properties.tmpl +++ b/node_modules/jsdoc/templates/default/tmpl/properties.tmpl @@ -1,5 +1,6 @@ -
        Properties
        +
        Properties
        - \ No newline at end of file + diff --git a/node_modules/jsdoc/templates/haruki/publish.js b/node_modules/jsdoc/templates/haruki/publish.js index cf9ec01..21f6847 100644 --- a/node_modules/jsdoc/templates/haruki/publish.js +++ b/node_modules/jsdoc/templates/haruki/publish.js @@ -17,7 +17,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) { len; if (element.kind === 'namespace') { - if (! parentNode.namespaces) { + if (!parentNode.namespaces) { parentNode.namespaces = []; } @@ -33,7 +33,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) { graft(thisNamespace, childNodes, element.longname, element.name); } else if (element.kind === 'mixin') { - if (! parentNode.mixins) { + if (!parentNode.mixins) { parentNode.mixins = []; } @@ -49,7 +49,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) { graft(thisMixin, childNodes, element.longname, element.name); } else if (element.kind === 'function') { - if (! parentNode.functions) { + if (!parentNode.functions) { parentNode.functions = []; } @@ -91,7 +91,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) { } } else if (element.kind === 'member') { - if (! parentNode.properties) { + if (!parentNode.properties) { parentNode.properties = []; } parentNode.properties.push({ @@ -104,7 +104,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) { } else if (element.kind === 'event') { - if (! parentNode.events) { + if (!parentNode.events) { parentNode.events = []; } @@ -146,7 +146,7 @@ function graft(parentNode, childNodes, parentLongname, parentName) { } } else if (element.kind === 'class') { - if (! parentNode.classes) { + if (!parentNode.classes) { parentNode.classes = []; } @@ -197,7 +197,6 @@ function graft(parentNode, childNodes, parentLongname, parentName) { @param {object} opts */ exports.publish = function(data, opts) { - var root = {}, docs; @@ -218,5 +217,4 @@ exports.publish = function(data, opts) { else { console.log('This template only supports output to the console. Use the option "-d console" when you run JSDoc.'); } - }; diff --git a/node_modules/mysql/Changes.md b/node_modules/mysql/Changes.md index f0d2b3b..a8c79c5 100644 --- a/node_modules/mysql/Changes.md +++ b/node_modules/mysql/Changes.md @@ -4,6 +4,11 @@ This file is a manually maintained list of changes for each release. Feel free to add your changes here when sending pull requests. Also send corrections if you spot any mistakes. +## v2.5.4 (2014-12-16) + +* Fix error if falsy error thrown in callback handler #960 +* Fix various error code strings #954 + ## v2.5.3 (2014-11-06) * Fix `pool.query` streaming interface not emitting connection errors #941 diff --git a/node_modules/mysql/Readme.md b/node_modules/mysql/Readme.md index 6508a13..15a45c7 100644 --- a/node_modules/mysql/Readme.md +++ b/node_modules/mysql/Readme.md @@ -152,7 +152,7 @@ When establishing a connection, you can set the following options: then the default collation for that charset is used. (Default: `'UTF8_GENERAL_CI'`) * `timezone`: The timezone used to store local dates. (Default: `'local'`) * `connectTimeout`: The milliseconds before a timeout occurs during the initial connection - to the MySQL server. (Default: 10 seconds) + to the MySQL server. (Default: `10000`) * `stringifyObjects`: Stringify objects instead of converting to values. See issue [#501](https://github.com/felixge/node-mysql/issues/501). (Default: `'false'`) * `insecureAuth`: Allow connecting to MySQL instances that ask for the old @@ -328,7 +328,7 @@ addition to those options pools accept a few extras: * `acquireTimeout`: The milliseconds before a timeout occurs during the connection acquisition. This is slightly different from `connectTimeout`, because acquiring - a pool connection does not always involve making a connection. (Default: 10 seconds) + a pool connection does not always involve making a connection. (Default: `10000`) * `waitForConnections`: Determines the pool's action when no connections are available and the limit has been reached. If `true`, the pool will queue the connection request and call it when one becomes available. If `false`, the @@ -732,8 +732,10 @@ The query object provides a convenience method `.stream([options])` that wraps query events into a [Readable](http://nodejs.org/api/stream.html#stream_class_stream_readable) Streams2 object. This stream can easily be piped downstream and provides automatic pause/resume, based on downstream congestion and the optional -`highWaterMark`. The `objectMode` parameter of the stream is set to `true` by -default. +`highWaterMark`. The `objectMode` parameter of the stream is set to `true` +and cannot be changed (if you need a byte stream, you will need to use a +transform stream, like [objstream](https://www.npmjs.com/package/objstream) for +example). For example, piping query results into another stream (with a max buffer of 5 objects) is simply: diff --git a/node_modules/mysql/lib/protocol/Parser.js b/node_modules/mysql/lib/protocol/Parser.js index bf8e65a..869bfbd 100644 --- a/node_modules/mysql/lib/protocol/Parser.js +++ b/node_modules/mysql/lib/protocol/Parser.js @@ -77,7 +77,7 @@ Parser.prototype.write = function(buffer) { this._onPacket(this._packetHeader); hadException = false; } catch (err) { - if (typeof err.code !== 'string' || err.code.substr(0, 7) !== 'PARSER_') { + if (!err || typeof err.code !== 'string' || err.code.substr(0, 7) !== 'PARSER_') { // Rethrow unknown errors throw err; } diff --git a/node_modules/mysql/lib/protocol/constants/errors.js b/node_modules/mysql/lib/protocol/constants/errors.js index 8856456..ebbbeec 100644 --- a/node_modules/mysql/lib/protocol/constants/errors.js +++ b/node_modules/mysql/lib/protocol/constants/errors.js @@ -348,7 +348,7 @@ exports.ER_INCORRECT_GLOBAL_LOCAL_VAR = 12 exports.ER_WRONG_FK_DEF = 1239; exports.ER_KEY_REF_DO_NOT_MATCH_TABLE_REF = 1240; exports.ER_OPERAND_COLUMNS = 1241; -exports.ER_SUBQUERY_NO_ = 1242; +exports.ER_SUBQUERY_NO_1_ROW = 1242; exports.ER_UNKNOWN_STMT_HANDLER = 1243; exports.ER_CORRUPT_HELP_DB = 1244; exports.ER_CYCLIC_REFERENCE = 1245; @@ -373,10 +373,10 @@ exports.ER_WARN_NULL_TO_NOTNULL = 12 exports.ER_WARN_DATA_OUT_OF_RANGE = 1264; exports.WARN_DATA_TRUNCATED = 1265; exports.ER_WARN_USING_OTHER_HANDLER = 1266; -exports.ER_CANT_AGGREGATE_ = 1267; +exports.ER_CANT_AGGREGATE_2COLLATIONS = 1267; exports.ER_DROP_USER = 1268; exports.ER_REVOKE_GRANTS = 1269; -exports.ER_CANT_AGGREGATE_ = 1270; +exports.ER_CANT_AGGREGATE_3COLLATIONS = 1270; exports.ER_CANT_AGGREGATE_NCOLLATIONS = 1271; exports.ER_VARIABLE_IS_NOT_STRUCT = 1272; exports.ER_UNKNOWN_COLLATION = 1273; @@ -497,7 +497,7 @@ exports.ER_LOGGING_PROHIBIT_CHANGING_OF = 13 exports.ER_NO_FILE_MAPPING = 1388; exports.ER_WRONG_MAGIC = 1389; exports.ER_PS_MANY_PARAM = 1390; -exports.ER_KEY_PART_ = 1391; +exports.ER_KEY_PART_0 = 1391; exports.ER_VIEW_CHECKSUM = 1392; exports.ER_VIEW_MULTIUPDATE = 1393; exports.ER_VIEW_NO_INSERT_FIELD_LIST = 1394; @@ -557,8 +557,8 @@ exports.ER_VIEW_FRM_NO_USER = 14 exports.ER_VIEW_OTHER_USER = 1448; exports.ER_NO_SUCH_USER = 1449; exports.ER_FORBID_SCHEMA_CHANGE = 1450; -exports.ER_ROW_IS_REFERENCED_ = 1451; -exports.ER_NO_REFERENCED_ROW_ = 1452; +exports.ER_ROW_IS_REFERENCED_2 = 1451; +exports.ER_NO_REFERENCED_ROW_2 = 1452; exports.ER_SP_BAD_VAR_SHADOW = 1453; exports.ER_TRG_NO_DEFINER = 1454; exports.ER_OLD_FILE_FORMAT = 1455; @@ -681,7 +681,7 @@ exports.ER_EVENT_SET_VAR_ERROR = 15 exports.ER_PARTITION_MERGE_ERROR = 1572; exports.ER_CANT_ACTIVATE_LOG = 1573; exports.ER_RBR_NOT_AVAILABLE = 1574; -exports.ER_BASE = 1575; +exports.ER_BASE64_DECODE_ERROR = 1575; exports.ER_EVENT_RECURSION_FORBIDDEN = 1576; exports.ER_EVENTS_DB_ERROR = 1577; exports.ER_ONLY_INTEGERS_ALLOWED = 1578; @@ -834,7 +834,7 @@ exports.ER_BINLOG_UNSAFE_INSERT_TWO_KEYS = 17 exports.ER_TABLE_IN_FK_CHECK = 1725; exports.ER_UNSUPPORTED_ENGINE = 1726; exports.ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST = 1727; -exports.ER_CANNOT_LOAD_FROM_TABLE_V = 1728; +exports.ER_CANNOT_LOAD_FROM_TABLE_V2 = 1728; exports.ER_MASTER_DELAY_VALUE_OUT_OF_RANGE = 1729; exports.ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT = 1730; exports.ER_PARTITION_EXCHANGE_DIFFERENT_OPTION = 1731; @@ -885,7 +885,7 @@ exports.ER_GNO_EXHAUSTED = 17 exports.ER_BAD_SLAVE_AUTO_POSITION = 1776; exports.ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON = 1777; exports.ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET = 1778; -exports.ER_GTID_MODE_ = 1779; +exports.ER_GTID_MODE_2_OR_3_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON = 1779; exports.ER_GTID_MODE_REQUIRES_BINLOG = 1780; exports.ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF = 1781; exports.ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON = 1782; @@ -911,7 +911,7 @@ exports.ER_UNKNOWN_ALTER_LOCK = 18 exports.ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS = 1802; exports.ER_MTS_RECOVERY_FAILURE = 1803; exports.ER_MTS_RESET_WORKERS = 1804; -exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V = 1805; +exports.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 = 1805; exports.ER_SLAVE_SILENT_RETRY_TRANSACTION = 1806; exports.ER_DISCARD_FK_CHECKS_RUNNING = 1807; exports.ER_TABLE_SCHEMA_MISMATCH = 1808; @@ -1335,7 +1335,7 @@ exports[1238] = 'ER_INCORRECT_GLOBAL_LOCAL_VAR'; exports[1239] = 'ER_WRONG_FK_DEF'; exports[1240] = 'ER_KEY_REF_DO_NOT_MATCH_TABLE_REF'; exports[1241] = 'ER_OPERAND_COLUMNS'; -exports[1242] = 'ER_SUBQUERY_NO_'; +exports[1242] = 'ER_SUBQUERY_NO_1_ROW'; exports[1243] = 'ER_UNKNOWN_STMT_HANDLER'; exports[1244] = 'ER_CORRUPT_HELP_DB'; exports[1245] = 'ER_CYCLIC_REFERENCE'; @@ -1360,10 +1360,10 @@ exports[1263] = 'ER_WARN_NULL_TO_NOTNULL'; exports[1264] = 'ER_WARN_DATA_OUT_OF_RANGE'; exports[1265] = 'WARN_DATA_TRUNCATED'; exports[1266] = 'ER_WARN_USING_OTHER_HANDLER'; -exports[1267] = 'ER_CANT_AGGREGATE_'; +exports[1267] = 'ER_CANT_AGGREGATE_2COLLATIONS'; exports[1268] = 'ER_DROP_USER'; exports[1269] = 'ER_REVOKE_GRANTS'; -exports[1270] = 'ER_CANT_AGGREGATE_'; +exports[1270] = 'ER_CANT_AGGREGATE_3COLLATIONS'; exports[1271] = 'ER_CANT_AGGREGATE_NCOLLATIONS'; exports[1272] = 'ER_VARIABLE_IS_NOT_STRUCT'; exports[1273] = 'ER_UNKNOWN_COLLATION'; @@ -1484,7 +1484,7 @@ exports[1387] = 'ER_LOGGING_PROHIBIT_CHANGING_OF'; exports[1388] = 'ER_NO_FILE_MAPPING'; exports[1389] = 'ER_WRONG_MAGIC'; exports[1390] = 'ER_PS_MANY_PARAM'; -exports[1391] = 'ER_KEY_PART_'; +exports[1391] = 'ER_KEY_PART_0'; exports[1392] = 'ER_VIEW_CHECKSUM'; exports[1393] = 'ER_VIEW_MULTIUPDATE'; exports[1394] = 'ER_VIEW_NO_INSERT_FIELD_LIST'; @@ -1544,8 +1544,8 @@ exports[1447] = 'ER_VIEW_FRM_NO_USER'; exports[1448] = 'ER_VIEW_OTHER_USER'; exports[1449] = 'ER_NO_SUCH_USER'; exports[1450] = 'ER_FORBID_SCHEMA_CHANGE'; -exports[1451] = 'ER_ROW_IS_REFERENCED_'; -exports[1452] = 'ER_NO_REFERENCED_ROW_'; +exports[1451] = 'ER_ROW_IS_REFERENCED_2'; +exports[1452] = 'ER_NO_REFERENCED_ROW_2'; exports[1453] = 'ER_SP_BAD_VAR_SHADOW'; exports[1454] = 'ER_TRG_NO_DEFINER'; exports[1455] = 'ER_OLD_FILE_FORMAT'; @@ -1668,7 +1668,7 @@ exports[1571] = 'ER_EVENT_SET_VAR_ERROR'; exports[1572] = 'ER_PARTITION_MERGE_ERROR'; exports[1573] = 'ER_CANT_ACTIVATE_LOG'; exports[1574] = 'ER_RBR_NOT_AVAILABLE'; -exports[1575] = 'ER_BASE'; +exports[1575] = 'ER_BASE64_DECODE_ERROR'; exports[1576] = 'ER_EVENT_RECURSION_FORBIDDEN'; exports[1577] = 'ER_EVENTS_DB_ERROR'; exports[1578] = 'ER_ONLY_INTEGERS_ALLOWED'; @@ -1821,7 +1821,7 @@ exports[1724] = 'ER_BINLOG_UNSAFE_INSERT_TWO_KEYS'; exports[1725] = 'ER_TABLE_IN_FK_CHECK'; exports[1726] = 'ER_UNSUPPORTED_ENGINE'; exports[1727] = 'ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST'; -exports[1728] = 'ER_CANNOT_LOAD_FROM_TABLE_V'; +exports[1728] = 'ER_CANNOT_LOAD_FROM_TABLE_V2'; exports[1729] = 'ER_MASTER_DELAY_VALUE_OUT_OF_RANGE'; exports[1730] = 'ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT'; exports[1731] = 'ER_PARTITION_EXCHANGE_DIFFERENT_OPTION'; @@ -1872,7 +1872,7 @@ exports[1775] = 'ER_GNO_EXHAUSTED'; exports[1776] = 'ER_BAD_SLAVE_AUTO_POSITION'; exports[1777] = 'ER_AUTO_POSITION_REQUIRES_GTID_MODE_ON'; exports[1778] = 'ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET'; -exports[1779] = 'ER_GTID_MODE_'; +exports[1779] = 'ER_GTID_MODE_2_OR_3_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON'; exports[1780] = 'ER_GTID_MODE_REQUIRES_BINLOG'; exports[1781] = 'ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF'; exports[1782] = 'ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON'; @@ -1898,7 +1898,7 @@ exports[1801] = 'ER_UNKNOWN_ALTER_LOCK'; exports[1802] = 'ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS'; exports[1803] = 'ER_MTS_RECOVERY_FAILURE'; exports[1804] = 'ER_MTS_RESET_WORKERS'; -exports[1805] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V'; +exports[1805] = 'ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2'; exports[1806] = 'ER_SLAVE_SILENT_RETRY_TRANSACTION'; exports[1807] = 'ER_DISCARD_FK_CHECKS_RUNNING'; exports[1808] = 'ER_TABLE_SCHEMA_MISMATCH'; diff --git a/node_modules/mysql/node_modules/bignumber.js/package.json b/node_modules/mysql/node_modules/bignumber.js/package.json index 228299c..acae2a0 100644 --- a/node_modules/mysql/node_modules/bignumber.js/package.json +++ b/node_modules/mysql/node_modules/bignumber.js/package.json @@ -56,5 +56,6 @@ ], "directories": {}, "_shasum": "3d19ac321f8db4ba07aace23ebd4ac976fae6bfa", - "_resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-1.4.1.tgz" + "_resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-1.4.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/mysql/node_modules/readable-stream/node_modules/core-util-is/package.json b/node_modules/mysql/node_modules/readable-stream/node_modules/core-util-is/package.json index cb9aa92..9aaf597 100644 --- a/node_modules/mysql/node_modules/readable-stream/node_modules/core-util-is/package.json +++ b/node_modules/mysql/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -31,5 +31,6 @@ "readmeFilename": "README.md", "homepage": "https://github.com/isaacs/core-util-is", "_id": "core-util-is@1.0.1", - "_from": "core-util-is@~1.0.0" + "_from": "core-util-is@>=1.0.0 <1.1.0", + "scripts": {} } diff --git a/node_modules/mysql/node_modules/readable-stream/node_modules/inherits/package.json b/node_modules/mysql/node_modules/readable-stream/node_modules/inherits/package.json index c532ca6..9013262 100644 --- a/node_modules/mysql/node_modules/readable-stream/node_modules/inherits/package.json +++ b/node_modules/mysql/node_modules/readable-stream/node_modules/inherits/package.json @@ -29,5 +29,5 @@ }, "homepage": "https://github.com/isaacs/inherits", "_id": "inherits@2.0.1", - "_from": "inherits@~2.0.1" + "_from": "inherits@>=2.0.1 <2.1.0" } diff --git a/node_modules/mysql/node_modules/readable-stream/node_modules/string_decoder/package.json b/node_modules/mysql/node_modules/readable-stream/node_modules/string_decoder/package.json index a8c586b..0364d54 100644 --- a/node_modules/mysql/node_modules/readable-stream/node_modules/string_decoder/package.json +++ b/node_modules/mysql/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -28,7 +28,7 @@ }, "_id": "string_decoder@0.10.31", "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_from": "string_decoder@~0.10.x", + "_from": "string_decoder@>=0.10.0 <0.11.0", "_npmVersion": "1.4.23", "_npmUser": { "name": "rvagg", diff --git a/node_modules/mysql/node_modules/readable-stream/package.json b/node_modules/mysql/node_modules/readable-stream/package.json index 2e4e8fc..307cd42 100644 --- a/node_modules/mysql/node_modules/readable-stream/package.json +++ b/node_modules/mysql/node_modules/readable-stream/package.json @@ -40,7 +40,7 @@ "homepage": "https://github.com/isaacs/readable-stream", "_id": "readable-stream@1.1.13", "_shasum": "f6eef764f514c89e2b9e23146a75ba106756d23e", - "_from": "readable-stream@~1.1.13", + "_from": "readable-stream@>=1.1.13 <1.2.0", "_npmVersion": "1.4.23", "_npmUser": { "name": "rvagg", diff --git a/node_modules/mysql/node_modules/require-all/package.json b/node_modules/mysql/node_modules/require-all/package.json index c7667e8..9c6f717 100644 --- a/node_modules/mysql/node_modules/require-all/package.json +++ b/node_modules/mysql/node_modules/require-all/package.json @@ -29,8 +29,6 @@ "semver": "~2.1.0" }, "optionalDependencies": {}, - "readme": "# require-all\n\nAn easy way to require all files within a directory.\n\n## Usage\n\n```js\nvar controllers = require('require-all')({\n dirname : __dirname + '/controllers',\n filter : /(.+Controller)\\.js$/,\n excludeDirs : /^\\.(git|svn)$/\n});\n\n// controllers now is an object with references to all modules matching the filter\n// for example:\n// { HomeController: function HomeController() {...}, ...}\n```\n\n## Advanced usage\n\nIf your objective is to simply require all .js and .json files in a directory you can just pass a string to require-all:\n\n``` js\nvar libs = require('require-all')(__dirname + '/lib');\n```\n", - "readmeFilename": "Readme.md", "bugs": { "url": "https://github.com/felixge/node-require-all/issues" }, @@ -61,5 +59,7 @@ ], "directories": {}, "_shasum": "a7d4307d90e422fcb9f04af018c149920074e4b3", - "_resolved": "https://registry.npmjs.org/require-all/-/require-all-0.0.8.tgz" + "_resolved": "https://registry.npmjs.org/require-all/-/require-all-0.0.8.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/felixge/node-require-all" } diff --git a/node_modules/mysql/package.json b/node_modules/mysql/package.json index 054a309..b9ee9c2 100644 --- a/node_modules/mysql/package.json +++ b/node_modules/mysql/package.json @@ -1,7 +1,7 @@ { "name": "mysql", "description": "A node.js driver for mysql. It is written in JavaScript, does not require compiling, and is 100% MIT licensed.", - "version": "2.5.3", + "version": "2.5.4", "license": "MIT", "author": { "name": "Felix Geisendörfer", @@ -33,7 +33,7 @@ "require-all": "0.0.8" }, "devDependencies": { - "istanbul": "0.3.2", + "istanbul": "0.3.5", "rimraf": "2.2.8", "mkdirp": "0.5.0", "urun": "0.0.8", @@ -47,14 +47,14 @@ "test-cov": "node test/run-cov.js", "test-travis": "node test/run-cov.js lcovonly" }, - "gitHead": "9d7b4868d37a8ede0a14fdd573c1053a6feb1dd8", + "gitHead": "e2ef977f94245194d9abcea00b03693038b68938", "bugs": { "url": "https://github.com/felixge/node-mysql/issues" }, - "_id": "mysql@2.5.3", - "_shasum": "82dd5c9e9831e7ffe2466d347c8c1dfcfcece23b", - "_from": "mysql@2.5.3", - "_npmVersion": "1.4.21", + "_id": "mysql@2.5.4", + "_shasum": "9f5675fdba3f18a08275d01107b68b56038c6c99", + "_from": "mysql@>=2.5.2 <3.0.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "dougwilson", "email": "doug@somethingdoug.com" @@ -98,9 +98,10 @@ } ], "dist": { - "shasum": "82dd5c9e9831e7ffe2466d347c8c1dfcfcece23b", - "tarball": "http://registry.npmjs.org/mysql/-/mysql-2.5.3.tgz" + "shasum": "9f5675fdba3f18a08275d01107b68b56038c6c99", + "tarball": "http://registry.npmjs.org/mysql/-/mysql-2.5.4.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/mysql/-/mysql-2.5.3.tgz" + "_resolved": "https://registry.npmjs.org/mysql/-/mysql-2.5.4.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/mysql2/Changelog.md b/node_modules/mysql2/Changelog.md index aa84625..907743e 100644 --- a/node_modules/mysql2/Changelog.md +++ b/node_modules/mysql2/Changelog.md @@ -1,9 +1,26 @@ -Backlog: - - Multiple results support in binary protocol #27 - - Apply timezone from config to DATETIME values with no tz #15 - - custom typeCast handlers in generated parser #39 +0.15.0 - 1/10/2015 + - connection.threadId + - connection.changeUser() #63 + - named placeholders #117 + - new prepared statements api #132 #139 + - support LOAD INFILE #64 #142 + - refactored faster packet parser #140 + - lazy parse rarely used column definition fields #137 -HEAD +0.14.1 - 9/12/2014 + - stream connection option now can be a function #80 + - bugfix/prepared statements: fix case when no columns + in statement header but there are columns in results #130 + +0.14.0 - 26/11/2014 + - added connection.pause() and connection.resume() #129 + +0.13.0 + - connection errors sent to all commands in queue + - server-side authentication support #122 + - server.listen() is now chainable (returns server) + - allow to login using sha1(password) #124 + - Query.sql as alias to Query.query #121 0.12.5 - 30/07/2014 - add 'execute' pool method similar to Pool##query #114 @@ -30,7 +47,7 @@ HEAD - 'dateStrings' connection option support #99 - use anonymous function for packet routing instead of .bind() 3-5% speed improvement - - GEOMETRY type support in bimary protocol #97 + - GEOMETRY type support in binary protocol #97 0.12.0 - 29/04/2014 diff --git a/node_modules/mysql2/README.md b/node_modules/mysql2/README.md index 6f606b3..41cdec8 100644 --- a/node_modules/mysql2/README.md +++ b/node_modules/mysql2/README.md @@ -1,6 +1,6 @@ #node-mysql2 -[![Build Status](https://secure.travis-ci.org/sidorares/node-mysql2.png)](http://travis-ci.org/sidorares/node-mysql2) [![](https://gemnasium.com/sidorares/node-mysql2.png)](https://gemnasium.com/npms/mysql2) [TODO](https://github.com/cainus/node-coveralls): [![](https://coveralls.io/repos/sidorares/node-mysql2/badge.png)](https://coveralls.io/r/sidorares/node-mysql2) +[![Build Status](https://travis-ci.org/sidorares/node-mysql2.svg?branch=master)](https://travis-ci.org/sidorares/node-mysql2) [![](https://gemnasium.com/sidorares/node-mysql2.png)](https://gemnasium.com/npms/mysql2) [TODO](https://github.com/cainus/node-coveralls): [![](https://coveralls.io/repos/sidorares/node-mysql2/badge.png)](https://coveralls.io/r/sidorares/node-mysql2) Mysql client for node.js. Written in native JavaScript and aims to be mostly api compatible with [node-mysql](https://github.com/felixge/node-mysql) @@ -12,6 +12,7 @@ Mysql client for node.js. Written in native JavaScript and aims to be mostly api In addition to client-side query/escape and connection pooling + - [fast](https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b) - MySQL server API for proxies and mocks - SSL and compression - prepared statements @@ -21,6 +22,124 @@ Mysql client for node.js. Written in native JavaScript and aims to be mostly api See [node-mysql](https://github.com/felixge/node-mysql) documentation. If you see api incompatibilities, please report via github issue. +Below is a list of extensions not supported by node-mysql: + +### Named placeholders + +You can use named placeholders for parameters by setting `namedPlaceholders` config value or query/execute time option. Named placeholders are converted to unnamed `?` on the client (mysql protocol does not support named parameters). If you reference parameter multiple times under the same name it is sent to server multiple times. + +```js + connection.config.namedPlaceholders = true; + connection.execute('select :x + :y as z', { x: 1, y: 2}, function(err, rows) { + // statement prepared as "select ? + ? as z" and executed with [1,2] values + // rows returned: [ { z: 3 } ] + }); + + connection.execute('select :x + :x as z', { x: 1 }, function(err, rows) { + // select ? + ? as z, execute with [1, 1] + }); + + connection.query('select :x + :x as z', { x: 1 }, function(err, rows) { + // query select 1 + 1 as z + }); +``` + +### Prepared statements + +#### Automatic creation, cached and re-used by connection + +Similar to `connection.query()`. + +```js +connection.execute('select 1 + ? + ? as result', [5, 6], function(err, rows) { + // rows: [ { result: 12 } ] + // internally 'select 1 + ? + ? as result' is prepared first. On subsequent calls cached statement is re-used +}); + +// close cached statement for 'select 1 + ? + ? as result'. noop if not in cache +connection.unprepare('select 1 + ? + ? as result'); +``` + +#### Manual prepare / execute + +```js +connection.prepare('select ? + ? as tests', function(err, statement) { + // statement.parameters - array of column definitions, length === number of params, here 2 + // statement.columns - array of result column definitions. Can be empty if result schema is dynamic / not known + // statement.id + // statement.query + + statement.execute([1, 2], function(err, rows, columns) { + // -> [ { tests: 3 } ] + }); + + // note that there is no callback here. There is no statement close ack at protocol level. + statement.close(); +}); +``` +Note that you should not use statement after connection reset (`changeUser()` or disconnect). Statement scope is connection, you need to prepare statement for each new connection in order to use it. + +### Receiving rows as array of columns instead of hash with column name as key: + +```js +var options = {sql: 'select A,B,C,D from foo', rowsAsArray: true}; +connection.query(options, function(err, results) { + /* results will be an array of arrays like this now: + [[ + 'field A value', + 'field B value', + 'field C value', + 'field D value', + ], ...] + */ +}); +``` + +### Sending tabular data with 'load infile' and local stream: + +In addition to sending local fs files you can send any stream using `infileStreamFactory` query option. If set, it has to be a function that return a readable stream. It gets file path from query as a parameter. + +```js +// local file +connection.query('LOAD DATA LOCAL INFILE "/tmp/data.csv" INTO TABLE test FIELDS TERMINATED BY ? (id, title)', onInserted1); +// local stream +var sql = 'LOAD DATA LOCAL INFILE "mystream" INTO TABLE test FIELDS TERMINATED BY ? (id, title)'; +connection.query({ + sql: sql, + infileStreamFactory: function(path) { return getStream(); } +}, onInserted2); +``` + +### Connecting using custom stream: + +```js +var net = require('net'); +var mysql = require('mysql2'); +var shape = require('shaper'); +var connection = mysql.createConnection({ + user: 'test', + database: 'test', + stream: net.connect('/tmp/mysql.sock').pipe(shape(10)) // emulate 10 bytes/sec link +}); +connection.query('SELECT 1+1 as test1', console.log); +``` +`stream` also can be a function. In that case function result has to be duplex stream, and it is used for connection transport. This is required if you connect pool using custom transport as new pooled connection needs new stream. [Example](https://github.com/sidorares/node-mysql2/issues/80) connecting over socks5 proxy: + +```js +var mysql = require('mysql2'); +var SocksConnection = require('socksjs'); +var pool = mysql.createPool({ + database: 'test', + user: 'foo', + password: 'bar' + stream: function(cb) { + cb(null, new SocksConnection({ host: 'remote.host', port: 3306}, { host: 'localhost', port: 1080 })); + } + }); +``` + +In addition to password `createConnection()`, `createPool()` and `changeUser()` accept `passwordSha1` option. This is useful when implementing proxies as plaintext password might be not available. + ## Known incompatibilities with node-mysql All numeric types converted to numbers. In contrast to node-mysql `zeroFill` flag is ignored in type conversion @@ -28,11 +147,6 @@ You need to check corresponding field zeroFill flag and convert to string manual DECIMAL and NEWDECIMAL types always returned as string -## Known not yet supported features - -`LOAD DATA INFILE` and `SELECT INTO OUTFILE` -`client.changeUser()` - ## Examples Simple select: @@ -75,7 +189,7 @@ connection.query('SELECT 1+1 as test1', console.log); You can use 'Amazon RDS' string as value to ssl property to connect to Amazon RDS mysql over ssl (in that case http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert is used) -``` +```js var mysql = require('mysql2'); var connection = mysql.createConnection({ user: 'foo', @@ -89,36 +203,7 @@ conn.query('show status like \'Ssl_cipher\'', function(err, res) { conn.end(); }); ``` -Receiving rows as array of columns instead of hash with column name as key: -```js -var options = {sql: 'select A,B,C,D from foo', rowsAsArray: true}; -connection.query(options, function(err, results) { - /* results will be an array of arrays like this now: - [[ - 'field A value', - 'field B value', - 'field C value', - 'field D value', - ], ...] - */ -}); - -``` - -Connecting using custom stream: - -```js -var net = require('net'); -var mysql = require('mysql2'); -var shape = require('shaper'); -var connection = mysql.createConnection({ - user: 'test', - database: 'test', - stream: net.connect('/tmp/mysql.sock').pipe(shape(10)) // emulate 10 bytes/sec link -}); -connection.query('SELECT 1+1 as test1', console.log); -``` Simple mysql proxy server: @@ -207,7 +292,9 @@ events: - [contributors](https://github.com/sidorares/node-mysql2/graphs/contributors) ## Benchmarks - - see [node-mysql-benchmarks](https://github.com/mscdex/node-mysql-benchmarks) + - https://gist.github.com/sidorares/ffe9ee9c423f763e3b6b + - `npm run benchmarks` + - [node-mysql-benchmarks](https://github.com/mscdex/node-mysql-benchmarks) - try to run example [benchmarks](https://github.com/sidorares/node-mysql2/tree/master/benchmarks) on your system ## Examples using MySQL server API: @@ -222,8 +309,7 @@ events: - [node-mysql](https://github.com/felixge/node-mysql) - most popular node.js mysql client library - [node-mariasql](https://github.com/mscdex/node-mariasql/) - bindings to libmariasql. One of the fastest clients - [node-libmysqlclident](https://github.com/Sannis/node-mysql-libmysqlclient) - bindings to libmysqlclient - - [mysql-co](https://github.com/sidorares/mysql-co) - wrappers to use mysql2 with generators and [co library](https://github.com/visionmedia/co) - - [mysql-utilities](https://github.com/tshemsedinov/node-mysql-utilities) - useful utilities on top of mysql connection + - [go-mysql](https://github.com/siddontang/go-mysql) - Mysql Go client (prepared statements, binlog protocol, server) ## Contributing diff --git a/node_modules/mysql2/benchmarks/run-unit.js b/node_modules/mysql2/benchmarks/run-unit.js new file mode 100755 index 0000000..326e56b --- /dev/null +++ b/node_modules/mysql2/benchmarks/run-unit.js @@ -0,0 +1,134 @@ +#!/usr/bin/env node +var progress = require('progress'); + +var fs = require('fs'); +var nWarmup = 2; +var nRepeats = 32 + nWarmup; +var path = require('path'); + +var prevResults = {}; +try { + var r = require('./results.json'); + r.forEach(function(rr) { + prevResults[rr.path] = rr + }); +} catch(e) { + // no prev results? +} + +function stats(times) { + var avg = 0; + for(var i=0; i < times.length; ++i) { + avg += times[i]/times.length; + } + var v = 0; + for(var i=0; i < times.length; ++i) { + v += (times[i] - avg)*(times[i] - avg) / times.length; + } + var stdev = Math.sqrt(v); + return { + avg: avg, + stdev: stdev, + stdevrel: stdev/avg + }; +} + +function runFolder(name, done) { + fs.readdir(name, function(err, list) { + if (err) + return done(err); + runFileList(name, list, done); + }); +} + +function benchmarkModule(m, modulePath, done) { + + var results = []; + var bar = new progress(m.comment + ' [:bar] ', { + total: nRepeats, + clear: true + }); + function repeat(w, n) { + bar.tick(); + if (n === 0) { + var result = {}; + var s = stats(results); + var unsDigits = Math.floor(Math.floor(s.stdev).toString().length * 0.8); + var pow = Math.pow(10, unsDigits); + var avg = Math.round(s.avg / pow)*pow; + var uns = Math.round(s.stdev / pow)*pow; + console.log('%s: %s ±%s', m.comment, avg, uns); + result.time = s.avg; + result.timeStdev = s.stdev; + result.comment = m.comment; + result.path = path.relative(__dirname, modulePath); + if (m.toSpeed) { + var speed = m.toSpeed(s.avg, s.stdev); + var speedDigits = Math.floor(Math.floor(speed.error).toString().length * 0.8); + pow = Math.pow(10, speedDigits); + console.log(' = %s ±%s %s', + Math.round(speed.value / pow)*pow, + Math.round(speed.error / pow)*pow, speed.units); + var prev = prevResults[result.path]; + if (prev) { + if (speed.value > prev.speed.value + prev.speed.error) { + console.log('Faster then prev result: %s ±%s %s', prev.speed.value, prev.speed.units) + } else if (speed.value < prev.speed.value - prev.speed.error) { + console.log('Slower then prev result: %s ±%s %s', prev.speed.value, prev.speed.units) + } + } + result.speed = speed; + } + return done(null, result); + } + var start = process.hrtime(); + setImmediate(function() { + m(function() { + var end = process.hrtime(start); + if (w <= 0) + results.push(end[0]*1e9 + end[1]); + repeat(w-1, n-1); + }); + }); + } + repeat(nWarmup-1, nRepeats-1, done); +} + +function runFileList(base, list, done) { + var index = -1; + var results; + function runOne(err, res) { + if (err) return done(err); + ++index; + if (res) { + if (!results) + results = []; + if (Array.isArray(res)) + results = results.concat(res); + else + results.push(res); + } + if (index >= list.length) { + return done(null, results); + } + var fname = base + '/' + list[index]; + fs.stat(fname, function(err, stat) { + if (err) return done(err); + if (stat.isDirectory()) + return runFolder(fname, runOne); + + else if (fname.slice(-3) == '.js') { + var m = require(fname); + return benchmarkModule(m, fname, runOne); + } + runOne(); + }); + } + runOne(); +} + +//var name = process.argv[2] || __dirname + '/unit'; +runFolder(__dirname + '/unit', function(err, results) { + //console.log(results); + fs.writeFileSync(__dirname + '/results.json', JSON.stringify(results)); +}); diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition0 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition0 new file mode 100644 index 0000000000000000000000000000000000000000..b4472919b4207dfc185b90678dcc3dd14dc4420d GIT binary patch literal 43 qcmZQhNljzTtt>9gVJR(6ErJjp`NbtHAc9AcVG9ET!@p(+APE35e+=3H literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition1 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition1 new file mode 100644 index 0000000000000000000000000000000000000000..a96ad6c9c534db6bfd4ebb9c4951f646c1e5e2ae GIT binary patch literal 43 ncmZQhNljzTtt>9gVJR(6ErJlCAQp(=QDiV+U|{&y>;NPIEV>L> literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition10 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition10 new file mode 100644 index 0000000000000000000000000000000000000000..fb69d663cabc2ff4f55fd79faea60afbbd4c2b7e GIT binary patch literal 61 zcmZQhNljzTtt>9gVJR(6Edmp~!5O6`Df#7j@dZVhWvDzJMFwUD28Mr(j6f0qlqM54 literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition11 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition11 new file mode 100644 index 0000000000000000000000000000000000000000..2c7b6e92540e744df6e8664bcd6ed54acbbb0e51 GIT binary patch literal 59 xcmZQhNljzTtt>9gVJR(6Edmof0Y&-Asl~9gVJR(6EdmpqZkai$@dZVhWe66JA_Fr61H(T?Mj#0Q*-a02 literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition13 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition13 new file mode 100644 index 0000000000000000000000000000000000000000..8bb1bcc93004ebff62f69a652d1db4a398a6cb2f GIT binary patch literal 55 wcmZQhNljzTtt>9gVJR(6Edmo9gVJR(6Edmq#L8)n}MX7nosm1XHMVV#jd>%yxW(Ed^e~gSk5&-KU B6ovo* literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition15 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition15 new file mode 100644 index 0000000000000000000000000000000000000000..c5d29c0a4f3d2c26daa1625182b46a2ddd96ad06 GIT binary patch literal 55 wcmZQhNljzTtt>9gVJR(6Edmo9gVJR(6Edmo9gVJR(6Edmof!5R7G@hM611x1-9gVJR(6Edmo9gVJR(6Edmpw&PAz-C8_ZxxdrhhiAg!B@dZVhW!Ob|6d9Nq7#RLB HG6G2eGYT1G literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition2 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition2 new file mode 100644 index 0000000000000000000000000000000000000000..0369fbe5896965bc9d8f98d51bb297b7a089f092 GIT binary patch literal 51 ucmZQhNljzTtt>9gVJR(6Edmo90g1)M<@rS^a0ZVeLp1{f!@ou#!2kfhnh((c literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition20 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition20 new file mode 100644 index 0000000000000000000000000000000000000000..54258216b96269438e118ba3da5d7f6e5e0a9bbd GIT binary patch literal 67 zcmZQhNljzTtt>9gVJR(6Edmn)KKaSn@g<2#IjP0*1x1-<7y>+s49pA+4F4Dzfg}JN CG8IYy literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition21 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition21 new file mode 100644 index 0000000000000000000000000000000000000000..242f96e9df8cffddc9d6c1e9675e6986cde6e8be GIT binary patch literal 59 xcmZQhNljzTtt>9gVJR(6Edmoft`(`tr6sBH1x1-9gVJR(6Edmq#L8%2f@x?ibWvTH6MVV#jd>%yxW(Ed^e~gSk5&-TJ B6r2D6 literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition23 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition23 new file mode 100644 index 0000000000000000000000000000000000000000..e40244b1f6cf1de9430ea368f4fa176ff6f1d8b7 GIT binary patch literal 67 zcmZQhNljzTtt>9gVJR(6Edmn)L8%2f@yR)vsd**w1x1-<7y>+s49pA+4F4Dzfg}JQ Cq!nfW literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition24 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition24 new file mode 100644 index 0000000000000000000000000000000000000000..6dc797ba80a1d4a69903dc9e638272c0b04bc2c3 GIT binary patch literal 67 zcmZQhNljzTtt>9gVJR(6Edmn)&PAz-C8_acnW^RR1x1-<7y>+s49pA+4F4Dzfg}JP CXBA)o literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition25 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition25 new file mode 100644 index 0000000000000000000000000000000000000000..06f8e4162ca8727b61a2ca20aebfd9c5e8e17801 GIT binary patch literal 63 zcmZQhNljzTtt>9gVJR(6EdmpK!5R7G@nxB*9gVJR(6Edmq5&PAz-C8_a6`K2Y9d8zRQMVV#T#CQ}Lm>C!t{xLEF FNdU#?7yJMK literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition27 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition27 new file mode 100644 index 0000000000000000000000000000000000000000..33ece3fd74e6e886e6c17fe0f7e86b0c53e258b0 GIT binary patch literal 71 zcmZQhNljzTtt>9gVJR(6EdmoljyWZ%Me#-Xr6rkpsqqCxnPpgncoZ3!85kJ;F){*4 E0FjUvLI3~& literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition28 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition28 new file mode 100644 index 0000000000000000000000000000000000000000..15bc68e42bfe93d2bb3076011a04f0f00d7fcfc4 GIT binary patch literal 67 zcmZQhNljzTtt>9gVJR(6Edmn)&PAz-C8_Zsf%t-=%rXoC9z_Ob1_p+IjEq1M03T%) AXaE2J literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition29 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition29 new file mode 100644 index 0000000000000000000000000000000000000000..bc5b16a428e30f44f1230d630044dcba5f9d4078 GIT binary patch literal 55 wcmZQhNljzTtt>9gVJR(6Edmo9gVJR(6EdmqV!Kpc^$tCdxMVV#DY#v1hW(Ed^e~gSk5&$p;5jp?> literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition30 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition30 new file mode 100644 index 0000000000000000000000000000000000000000..6ecf2df71df409b1ecb5192755896e0fb2ed0225 GIT binary patch literal 59 xcmZQhNljzTtt>9gVJR(6EdmofAw`+#>8VBW1x1-9gVJR(6Edmo_&PAz-C8_ZxiAg!B#RZAUsqqCxnPoVHc@!C#85kJ; IF){*40BjQ)9smFU literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition32 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition32 new file mode 100644 index 0000000000000000000000000000000000000000..3e80ec9d5136d17a5f5d42c2841a072b76a06e27 GIT binary patch literal 51 ucmZQhNljzTtt>9gVJR(6Edmo9#l<=CC6xuKa0ZVegERvJ!#_qwAPE4z><=;k literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition33 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition33 new file mode 100644 index 0000000000000000000000000000000000000000..835877d2f50dedc2b26f499a2edbb8799c5ea884 GIT binary patch literal 55 ycmZQhNljzTtt>9gVJR(6Edmo<#l<=C$(aQisYOUk9(#uW{}~wmOcY>XU;qFjMH5B< literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition34 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition34 new file mode 100644 index 0000000000000000000000000000000000000000..9a58bd917ccf64e4d8d46da45df4153ba1435c1e GIT binary patch literal 57 zcmZQhNljzTtt>9gVJR(6EdmqV6{ZH3@tMWNrKv^8Y#w`t|Nj{n{!A2LU|;|MFEJAk literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition35 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition35 new file mode 100644 index 0000000000000000000000000000000000000000..9287dea25164bf18e40a857a3fbcaf74bf3ac8fc GIT binary patch literal 59 zcmZQhNljzTtt>9gVJR(6Edmof6{ZH3@x`S{S*gh-s2qES|Nj{n{!A2LU|;|MR_qhJ literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition36 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition36 new file mode 100644 index 0000000000000000000000000000000000000000..117d8a5c122b75f0dfb45bfe6a3b4db63d92087b GIT binary patch literal 61 zcmZQhNljzTtt>9gVJR(6Edmp~xrr6=g{7&*C7Jno#i%?Udj@U>1_owDAi)3tm2wiO literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition37 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition37 new file mode 100644 index 0000000000000000000000000000000000000000..5d938453f0f795316faa073ee3be30a12a392739 GIT binary patch literal 57 xcmZQhNljzTtt>9gVJR(6EdmqVxrr6=r3ER8C8@>8Y#w_CZUzPhW9gVJR(6Edmq#xrr6=$@zJCsmUdo`FX|Yd>(rSZUzPhW9gVJR(6EdmoFxrr6=AYOcOeqLT`a!F=>UNKfd9(x9E1_lOZMIgZd E00|NpVgLXD literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition4 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition4 new file mode 100644 index 0000000000000000000000000000000000000000..24c9b85fe35a4027201fc750d157c742037d7f32 GIT binary patch literal 57 wcmZQhNljzTtt>9gVJR(6EdmqVo_RoKNqj+3W*IV@N0EVpF literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition40 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition40 new file mode 100644 index 0000000000000000000000000000000000000000..5cc69b4be380f083c4c0f7262763517b30f0c0e2 GIT binary patch literal 47 scmZQhNljzTtt>9gVJR(6Edmp41v#bZnR!r(N0H$G0|Udq1|Y!z0D1Qgi2wiq literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition41 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition41 new file mode 100644 index 0000000000000000000000000000000000000000..97474b73598908632f3b3c93287138bc5e378f4e GIT binary patch literal 77 zcmZQhNljzTtt>9gVJR(6EdmpwiKQhOsd*)t$%!SI`FZihB}JKe>DWbi6dC^hXJYs> HfdL2rV00XT literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition42 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition42 new file mode 100644 index 0000000000000000000000000000000000000000..65f5c41bf1196c768568fe1f9383b5157c041a12 GIT binary patch literal 67 zcmZQhNljzTtt>9gVJR(6Edmn)1&PJQ<@rS^@u?LBnMJ877y>+s49pA+4F4Dzfg}Jg CQWeSo literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition5 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition5 new file mode 100644 index 0000000000000000000000000000000000000000..ae50e8edff6f2fe39791622acac6de26376bf1db GIT binary patch literal 57 xcmZQhNljzTtt>9gVJR(6EdmqVp#>?4C8_ZRMVV#DY#v1hW(Ed^e~gSk5&$sj5kLR{ literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition6 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition6 new file mode 100644 index 0000000000000000000000000000000000000000..8767eb78a3ae993ecf1ba44b597753cd7d12800b GIT binary patch literal 57 xcmZQhNljzTtt>9gVJR(6EdmqVE~z=GC8_ZRMVV#DY#v1hW(Ed^e~gSk5&$g-5g-5n literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition7 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition7 new file mode 100644 index 0000000000000000000000000000000000000000..92bc5e7913f006c239ebcaeb0dc470d6a720855e GIT binary patch literal 57 xcmZQhNljzTtt>9gVJR(6EdmqV&PAz-C8_ZRMVV#DY#v1hW(Ed^e~gSk5&$h;5h4Hp literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition8 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition8 new file mode 100644 index 0000000000000000000000000000000000000000..b7400df3b25d371f045dc66ee226e52a3b804a64 GIT binary patch literal 53 vcmZQhNljzTtt>9gVJR(6EdmpqE=BnT@dZVhWe66JA_Fr61H(T?Mj#0Q-CGZ! literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/fixtures/column_definition9 b/node_modules/mysql2/benchmarks/unit/fixtures/column_definition9 new file mode 100644 index 0000000000000000000000000000000000000000..f1cbde258fd4b5909c57a557857ef90f1de18b2b GIT binary patch literal 57 xcmZQhNljzTtt>9gVJR(6EdmqVL8&?Ui7D{~MVV#DY#v1hW(Ed^e~gSk5&$k<5hwrv literal 0 HcmV?d00001 diff --git a/node_modules/mysql2/benchmarks/unit/packet_parser.js b/node_modules/mysql2/benchmarks/unit/packet_parser.js new file mode 100644 index 0000000..703d4e7 --- /dev/null +++ b/node_modules/mysql2/benchmarks/unit/packet_parser.js @@ -0,0 +1,47 @@ +var p = new Buffer(65535*10); +var offset = 0; +var plen = 17; +while(1) { + if (p.length - offset >= plen+4) { + p[offset] = plen; + p[offset+1] = 0; + p[offset+2] = 0; + p[offset+3] = 123; // packet id + offset += plen + 4; + } else { + p[offset] = p.length - offset - 4; + p[offset+1] = 0; + p[offset+2] = 0; + p[offset+3] = 123; // packet id + break; + } +} + +var PP = require('../../lib/packet_parser.js'); + +var count = 0; +var cc = 0; + +function handler(packet) { + //console.log(packet.length(), packet.sequenceId); + cc += packet.sequenceId + count++; +} + +var chunks = []; +var csize = parseInt(process.argv[2]); +for (var o=0; o + csize < p.length; o += csize) { + chunks.push(p.slice(o, o+csize)); +} + +var start = process.hrtime(); +for (var i=0; i < 50; ++i) { + var packetParser = new PP(handler); + for (var j=0; j < chunks.length; ++j) { + packetParser.execute(chunks[j]); + } +} +var end = process.hrtime(start); +var dur = end[0]*1e9 + end[1]; + +console.log(1e9*count/dur, count, cc); diff --git a/node_modules/mysql2/benchmarks/unit/packets/column_definition.js b/node_modules/mysql2/benchmarks/unit/packets/column_definition.js new file mode 100644 index 0000000..24e1447 --- /dev/null +++ b/node_modules/mysql2/benchmarks/unit/packets/column_definition.js @@ -0,0 +1,56 @@ +var fs = require('fs'); +var ColumnDefinition = require('../../../lib/packets/column_definition.js'); +var Packet = require('../../../lib/packets/packet.js'); +var fixtureFile = __dirname + '/../fixtures/column_definition'; + +function prepareFixture() { + var Packets = require('../../../lib/packets/index.js'); + var packetInd = 0; + Packets.ColumnDefinition = function(packet) { + fs.writeFileSync(fixtureFile + packetInd, packet.buffer.slice(packet.start, packet.end)); + packetInd++; + var c = new ColumnDefinition(packet); + //console.log('packet', c); + return c; + }; + var connection = require('../../../test/common.js').createConnection(); + connection.query('select * from mysql.user', function() {}); + connection.end(); +} + +//prepareFixture(); +//return; + +var npackets = 43; +var packets = []; +var packet; + +for (var i=0; i < npackets; ++i) { + var buf = fs.readFileSync(fixtureFile + i); + packet = new Packet(0, buf, 0, buf.length); + packets.push(packet); +} + +var c; +var repeats = 10000; + +function bench(done) { + for (var i=0; i < repeats; ++i) { + for (var j=0; j < npackets; ++j) { + packets[j].offset = 0; + c =new ColumnDefinition(packets[j]); + } + } + done(); +} + +module.exports = bench; +module.exports.comment = "read " + npackets + " column definitions (select * from mysql.user) x " + repeats; +module.exports.toSpeed = function(timeAvg, timeStdev) { + var value = 43*repeats*1e9 / timeAvg; + return { + value: value, + error: value*(timeStdev / timeAvg), + units: 'columns/second' + } +} diff --git a/node_modules/mysql2/benchmarks/unit/simple/buffer-to-string.js b/node_modules/mysql2/benchmarks/unit/simple/buffer-to-string.js new file mode 100644 index 0000000..2a7ccc3 --- /dev/null +++ b/node_modules/mysql2/benchmarks/unit/simple/buffer-to-string.js @@ -0,0 +1,24 @@ +var a = new Buffer(10000); +a.fill(120); // 'x' +var l = 5; +var s = ''; +var repeats = 10000; + +module.exports = function(next) { + for (var n=0; n < repeats; ++n) { + for (var i=0; i < a.length - l; ++i) { + s = s.toString('utf8', i, i+l); + } + } + next(); +}; + +module.exports.comment = 'read ' + l + ' chars strings from ' + a.length + ' bytes buffer x ' + repeats; +module.exports.toSpeed = function(time, timeError) { + var value = 1e9*a.length*l*repeats / time; + return { + value: value, + error: value*(timeError/time), + units: 'chars/second' + }; +}; diff --git a/node_modules/mysql2/debug.md b/node_modules/mysql2/debug.md deleted file mode 100644 index e63acbf..0000000 --- a/node_modules/mysql2/debug.md +++ /dev/null @@ -1,39 +0,0 @@ -# Debugging driver issues - -You can enable debug output using `debug` config option: - -```js -var conn = mysql.createConnection({ - port: 3306, - host: '1.2.3.4', - debug: true // <--- -} -``` -Also you can make additional information available during initialization if you -sert enfironment variable `NODE_DEBUG` - -## Interpreting debug log - -``` -Add command: Connection -Add command: query - ==> Connection#handshakeInit(0,,78) - <== Connection#handshakeInit(1,HandshakeResponse,67) - ==> Connection#handshakeResult(2,maybeOK,7) -Sending query command: select * from mil limit 10 - <== query#start(0,Query,31) - ==> query#resultsetHeader(1,,1) - ==> query#readField(2,,36) - ==> query#fieldsEOF(3,EOF,5) - ==> query#row(4,,2) - ==> query#row(5,,2) - ==> query#row(6,,2) - ==> query#row(7,,2) - ==> query#row(8,,2) - ==> query#row(9,,2) - ==> query#row(10,,2) - ==> query#row(11,,2) - ==> query#row(12,,2) - ==> query#row(13,,3) - ==> query#row(14,EOF,5) - ``` diff --git a/node_modules/mysql2/dump.rdb b/node_modules/mysql2/dump.rdb deleted file mode 100644 index e17870ca877a46b9ef802e381a0dfeff512c0058..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5178 zcmciFeQ+D)od@uJkt{pJ@q1ij5_h=>WOw9dB*12}gj=wa~e1xoc_GTE#Lk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2=C!jrU=2%28CO*M^)sisdtk<|jqX3-p^OGgL=Z$iqK`yHJrgxXd4s`V-cQjMquwB#bzF+9 zgI#d}WD3y!PQWLlV2n?Lh$tpOY&0pshSW`>M>=IBTPmKwFPCLM zFPw7a)V1~Ut!wI~Ed-+I-p*GaLF^!hmD=T(Mm|#eW5R*#xOL;HhpKciyt^nv7i|hr z%yx~bxS>|Mn2 zydGs^;1etvjoA>}lj`lIaw!59;Yb72&Mgo%))J&1R$o8Ab%K`Ed=-#rd>7f%nIfv5^M$ z-Nl;wW{)k_UdZj{A|rX+kWuzOiw=u|6t``Xs)9_^9L&#h?(y2X<$76{YDCEw8 zW*M`qTv9sYCN5}yh)OBGUgb_sz^87#YAPfh5ZQmMHt(i=IyW=qbWs+aL8mkJ?zGO# z16z*#Gy7fnqXxA@kdjh@ZOjX1)NFRl<_FCf%Lels%os!KtTXK2=KtD^=<+7BeY7=! z#U{i8m%uqGF}}s4-JVx77b;F3AHPuh-vweEwHR)6<%b!S$L<;KbA8zc3S}w8(mn@{ zTAT8d+f{n6eP}3m&ub!L&zrlJ_`k`Ax1fxfeWEZJ$=7c|4EcZEQm7cjd$VHv$Dm#VHT}j)EOM$tI`g4T}bKxc};@w>&?dF>DaXOd&S5n zs7}A-DT2$zCnk>AtVu>;?GWbcvB{tu3c!QcP@ diff --git a/node_modules/mysql2/examples/connect-over-socks.js b/node_modules/mysql2/examples/connect-over-socks.js new file mode 100644 index 0000000..66ae19b --- /dev/null +++ b/node_modules/mysql2/examples/connect-over-socks.js @@ -0,0 +1,33 @@ +var SocksConnection = require('socksjs'); +var mysql = require('../index.js'); + +//var socksProxy = new SocksConnection({ port: 3306 }); +//var conn = mysql.createConnection({ +// stream: socksProxy, +//}); + +//conn.query("select 1+1", function(err, rows, fields) { +// console.log(err, rows, fields); +//}); + + +var conn1 = mysql.createPool({ + debug: 1, + stream: function() { + return new SocksConnection({ port: 3306 }); + } +}); + + +conn1.execute("select sleep(1.1) as www", function(err, rows, fields) { + console.log(err, rows, fields); +}); + + +conn1.execute("select sleep(1) as qqq", function(err, rows, fields) { + console.log(err, rows, fields); +}); + +conn1.execute("select sleep(1) as qqq", function(err, rows, fields) { + console.log(err, rows, fields); +}); diff --git a/node_modules/mysql2/examples/execute.js b/node_modules/mysql2/examples/execute.js index 5590541..fc88892 100644 --- a/node_modules/mysql2/examples/execute.js +++ b/node_modules/mysql2/examples/execute.js @@ -2,4 +2,11 @@ var mysql = require('../test/common').createConnection(); mysql.execute("select ?+1 as qqq, ? as rrr, ? as yyy", [1, null, 3], function(err, rows, fields) { //mysql.execute("select ?+?+? as qqq, ? as rrr", [1, 2, 5, "test"], function(err, rows, fields) { console.log(err, rows, fields); + mysql.execute("select ?+1 as qqq, ? as rrr, ? as yyy", [3, null, 3], function(err, rows, fields) { + console.log(err, rows, fields); + mysql.unprepare("select ?+1 as qqq, ? as rrr, ? as yyy"); + mysql.execute("select ?+1 as qqq, ? as rrr, ? as yyy", [3, null, 3], function(err, rows, fields) { + console.log(err, rows, fields); + }); + }); }); diff --git a/node_modules/mysql2/examples/pass-sha.js b/node_modules/mysql2/examples/pass-sha.js new file mode 100644 index 0000000..ee585ff --- /dev/null +++ b/node_modules/mysql2/examples/pass-sha.js @@ -0,0 +1,8 @@ +var mysql = require('../index.js').createConnection({ + user: 'testuser', + //password: 'testpassword' + passwordSha1: Buffer('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex') +}); +mysql.execute("select ?+1 as qqq, ? as rrr, ? as yyy", [1, null, 3], function(err, rows, fields) { + console.log(err, rows, fields); +}); diff --git a/node_modules/mysql2/examples/prepare.js b/node_modules/mysql2/examples/prepare.js new file mode 100644 index 0000000..7f1f5bb --- /dev/null +++ b/node_modules/mysql2/examples/prepare.js @@ -0,0 +1,5 @@ +var mysql = require('../test/common').createConnection(); + +mysql.prepare("SELECT * from mysql.user into outfile '/tmp/mysql.user.txt'", function(err, stmt) { + console.log(stmt); +}); diff --git a/node_modules/mysql2/examples/server.js b/node_modules/mysql2/examples/server.js index db95785..aa64256 100644 --- a/node_modules/mysql2/examples/server.js +++ b/node_modules/mysql2/examples/server.js @@ -1,18 +1,33 @@ var mysql = require('../index.js'); -var flags = require('../lib/constants/client'); +var flags = require('../lib/constants/client.js'); +var auth = require('../lib/auth_41.js'); + +function authenticate(params, cb) { + console.log(params); + var doubleSha = auth.doubleSha1('pass123'); + var isValid = auth.verifyToken(params.authPluginData1, params.authPluginData2, params.authToken, doubleSha); + if (isValid) + cb(null); + else + // for list of codes lib/constants/errors.js + cb(null, { message: 'wrong password dude', code: 1045}); +} var server = mysql.createServer(); server.listen(3333); server.on('connection', function(conn) { + // we can deny connection here: - // conn.writeError({ message: 'secret', errno: 123 }); + // conn.writeError({ message: 'secret', code: 123 }); + // conn.close(); conn.serverHandshake({ protocolVersion: 10, serverVersion: '5.6.10', //'node.js rocks', connectionId: 1234, statusFlags: 2, characterSet: 8, - capabilityFlags: 0xffffff + capabilityFlags: 0xffffff, + authCallback: authenticate }); conn.on('field_list', function(table, fields) { @@ -37,5 +52,6 @@ server.on('connection', function(conn) { conn.writeTextRow(['test тест テスト փորձարկում পরীক্ষা kiểm tra ']); conn.writeTextRow(['ტესტი પરીક્ષણ מבחן פּרובירן اختبار परीक्षण']); conn.writeEof(); + conn.close(); }); }); diff --git a/node_modules/mysql2/examples/sprocedure.js b/node_modules/mysql2/examples/sprocedure.js deleted file mode 100644 index 73fd4bf..0000000 --- a/node_modules/mysql2/examples/sprocedure.js +++ /dev/null @@ -1,11 +0,0 @@ -var mysql = require('../test/common').createConnection(); -//var create_proc = "mysql.query('DROP PROCEDURE IF EXISTS p; CREATE PROCEDURE p(IN i INT) BEGIN SELECT i as f; END;');"; -var create_proc = "CREATE PROCEDURE `get_user1`(IN supplied_user_id INT) BEGIN select * from mil1 ua where ua.id = supplied_user_id; END"; -mysql.query(create_proc, function(err, rows, fields) { - console.log('Error:', err, rows, fields); -}); - -mysql.execute('CALL get_user1(?)', [ 1 ], function (err, rows) { - console.log(JSON.stringify(err, rows, null, 2)); - mysql.end(); -}); diff --git a/node_modules/mysql2/fixtures/ssl-profiles.json b/node_modules/mysql2/fixtures/ssl-profiles.json new file mode 100644 index 0000000..0629d5e --- /dev/null +++ b/node_modules/mysql2/fixtures/ssl-profiles.json @@ -0,0 +1,5 @@ +{ + "Amazon RDS": { + "ca": "-----BEGIN CERTIFICATE-----\nMIIDQzCCAqygAwIBAgIJAOd1tlfiGoEoMA0GCSqGSIb3DQEBBQUAMHUxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRMw\nEQYDVQQKEwpBbWF6b24uY29tMQwwCgYDVQQLEwNSRFMxHDAaBgNVBAMTE2F3cy5h\nbWF6b24uY29tL3Jkcy8wHhcNMTAwNDA1MjI0NDMxWhcNMTUwNDA0MjI0NDMxWjB1\nMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHU2Vh\ndHRsZTETMBEGA1UEChMKQW1hem9uLmNvbTEMMAoGA1UECxMDUkRTMRwwGgYDVQQD\nExNhd3MuYW1hem9uLmNvbS9yZHMvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\ngQDKhXGU7tizxUR5WaFoMTFcxNxa05PEjZaIOEN5ctkWrqYSRov0/nOMoZjqk8bC\nmed9vPFoQGD0OTakPs0jVe3wwmR735hyVwmKIPPsGlaBYj1O6llIpZeQVyupNx56\nUzqtiLaDzh1KcmfqP3qP2dInzBfJQKjiRudo1FWnpPt33QIDAQABo4HaMIHXMB0G\nA1UdDgQWBBT/H3x+cqSkR/ePSIinPtc4yWKe3DCBpwYDVR0jBIGfMIGcgBT/H3x+\ncqSkR/ePSIinPtc4yWKe3KF5pHcwdTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldh\nc2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxEzARBgNVBAoTCkFtYXpvbi5jb20x\nDDAKBgNVBAsTA1JEUzEcMBoGA1UEAxMTYXdzLmFtYXpvbi5jb20vcmRzL4IJAOd1\ntlfiGoEoMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAvguZy/BDT66x\nGfgnJlyQwnFSeVLQm9u/FIvz4huGjbq9dqnD6h/Gm56QPFdyMEyDiZWaqY6V08lY\nLTBNb4kcIc9/6pc0/ojKciP5QJRm6OiZ4vgG05nF4fYjhU7WClUx7cxq1fKjNc2J\nUCmmYqgiVkAGWRETVo+byOSDZ4swb10=\n-----END CERTIFICATE-----\n" + } +} diff --git a/node_modules/mysql2/index.js b/node_modules/mysql2/index.js index a3e80f9..6509cde 100644 --- a/node_modules/mysql2/index.js +++ b/node_modules/mysql2/index.js @@ -18,7 +18,6 @@ module.exports.createPool = function(config) { }; exports.createPoolCluster = function(config) { - var PoolConfig = require('./lib/pool_config.js'); var PoolCluster = require('./lib/pool_cluster.js'); return new PoolCluster(config); }; diff --git a/node_modules/mysql2/inflate-test.js b/node_modules/mysql2/inflate-test.js deleted file mode 100644 index e984fb6..0000000 --- a/node_modules/mysql2/inflate-test.js +++ /dev/null @@ -1,3 +0,0 @@ -var b = new Buffer('23 30 38 53 30 31 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64'.replace(/ /g, ''), 'hex'); -require('zlib').inflateRaw(b, console.log); -debugger diff --git a/node_modules/mysql2/lib/auth_41.js b/node_modules/mysql2/lib/auth_41.js new file mode 100644 index 0000000..f55df86 --- /dev/null +++ b/node_modules/mysql2/lib/auth_41.js @@ -0,0 +1,75 @@ +/* +4.1 authentication: (http://bazaar.launchpad.net/~mysql/mysql-server/5.5/view/head:/sql/password.c) + + SERVER: public_seed=create_random_string() + send(public_seed) + + CLIENT: recv(public_seed) + hash_stage1=sha1("password") + hash_stage2=sha1(hash_stage1) + reply=xor(hash_stage1, sha1(public_seed,hash_stage2) + + // this three steps are done in scramble() + + send(reply) + + + SERVER: recv(reply) + hash_stage1=xor(reply, sha1(public_seed,hash_stage2)) + candidate_hash2=sha1(hash_stage1) + check(candidate_hash2==hash_stage2) + +server stores sha1(sha1(password)) ( hash_stag2) +*/ + +var crypto = require('crypto'); + +function sha1(msg, msg1, msg2) { + var hash = crypto.createHash('sha1'); + hash.update(msg); + if (msg1) + hash.update(msg1); + if (msg2) + hash.update(msg2); + return hash.digest(); +} + +function xor(a, b) { + if (!Buffer.isBuffer(a)) + a = new Buffer(a, 'binary'); + if (!Buffer.isBuffer(b)) + b = new Buffer(b, 'binary'); + var result = new Buffer(a.length); + for (var i = 0; i < a.length; i++) { + result[i] = (a[i] ^ b[i]); + } + return result; +} + +function token(password, scramble1, scramble2) { + // TODO: use buffers (not sure why strings here) + if (!password) { + return new Buffer(0); + } + var stage1 = sha1(password); + return module.exports.calculateTokenFromPasswordSha(stage1, scramble1, scramble2); +} + +module.exports.calculateTokenFromPasswordSha = function(passwordSha, scramble1, scramble2) { + var stage2 = sha1(passwordSha); + var stage3 = sha1(scramble1, scramble2, stage2); + return xor(stage3, passwordSha); +}; + +module.exports.calculateToken = token; + +module.exports.verifyToken = function(publicSeed1, publicSeed2, token, doubleSha) { + var hashStage1 =xor(token, sha1(publicSeed1, publicSeed2, doubleSha)); + var candidateHash2 = sha1(hashStage1); + // TODO better way to compare buffers? + return candidateHash2.toString('hex') == doubleSha.toString('hex'); +} + +module.exports.doubleSha1 = function(password) { + return sha1(sha1(password)); +} diff --git a/node_modules/mysql2/lib/commands/change_user.js b/node_modules/mysql2/lib/commands/change_user.js new file mode 100644 index 0000000..901c8b2 --- /dev/null +++ b/node_modules/mysql2/lib/commands/change_user.js @@ -0,0 +1,45 @@ +var util = require('util'); + +var Command = require('./command.js'); +var Packets = require('../packets/index.js'); +var ClientConstants = require('../constants/client.js'); + +function ChangeUser(options, callback) +{ + this.onResult = callback; + this._user = options.user; + this._password = options.password; + this._database = options.database; + this._passwordSha1 = options.passwordSha1; + this._charsetNumber = options.charsetNumber; + this._currentConfig = options.currentConfig; + Command.call(this); +} +util.inherits(ChangeUser, Command); + +ChangeUser.prototype.start = function(packet, connection) { + var packet = new Packets.ChangeUser({ + user : this._user, + database : this._database, + charsetNumber : this._charsetNumber, + password : this._password, + passwordSha1 : this._passwordSha1, + authPluginData1 : connection._handshakePacket.authPluginData1, + authPluginData2 : connection._handshakePacket.authPluginData2 + }); + this._currentConfig.user = this._user; + this._currentConfig.password = this._password; + this._currentConfig.database = this._database; + this._currentConfig.charsetNumber = this._charsetNumber; + // reset prepared statements cache as all statements become invalid after changeUser + connection._statements = {}; + connection.writePacket(packet.toPacket()); + return ChangeUser.prototype.changeOk; +}; + +ChangeUser.prototype.changeOk = function(okPacket, connection) { + if (this.onResult) + this.onResult(null); + return null; +}; +module.exports = ChangeUser; diff --git a/node_modules/mysql2/lib/commands/client_handshake.js b/node_modules/mysql2/lib/commands/client_handshake.js index 9427612..dc1f86a 100644 --- a/node_modules/mysql2/lib/commands/client_handshake.js +++ b/node_modules/mysql2/lib/commands/client_handshake.js @@ -1,7 +1,8 @@ -var Command = require('./command'); +var util = require('util'); + +var Command = require('./command.js'); var Packets = require('../packets/index.js'); -var util = require('util'); -var ClientConstants = require('../constants/client'); +var ClientConstants = require('../constants/client.js'); function ClientHandshake(clientFlags) { @@ -29,17 +30,18 @@ function flagNames(flags) { return res; } -ClientHandshake.prototype.sendCredentials = function(connection, packetIndex) { +ClientHandshake.prototype.sendCredentials = function(connection) { if (connection.config.debug) { console.log('Sending handshake packet: flags:%d=(%s)', this.clientFlags, flagNames(this.clientFlags).join(', ')); } var handshakeResponse = new Packets.HandshakeResponse({ flags : this.clientFlags, - password: connection.config.password, user : connection.config.user, database: connection.config.database, - charsetNumber: connection.config.charsetNumber, + password: connection.config.password, + passwordSha1 : connection.config.passwordSha1, + charsetNumber : connection.config.charsetNumber, authPluginData1: this.handshake.authPluginData1, authPluginData2: this.handshake.authPluginData2, compress: connection.config.compress @@ -72,16 +74,16 @@ ClientHandshake.prototype.handshakeInit = function(helloPacket, connection) { if (connection.config.ssl) { if (!serverSSLSupport) - throw new Error('Server does not support secure connnection'); + command.emit('error', new Error('Server does not support secure connnection')); // send ssl upgrade request and immediately upgrade connection to secure this.clientFlags |= ClientConstants.SSL; this.sendSSLRequest(connection); connection.startTLS(function() { // after connection is secure - command.sendCredentials(connection, 2); + command.sendCredentials(connection); }); } else { - this.sendCredentials(connection, 1); + this.sendCredentials(connection); } return ClientHandshake.prototype.handshakeResult; }; diff --git a/node_modules/mysql2/lib/commands/close_statement.js b/node_modules/mysql2/lib/commands/close_statement.js new file mode 100644 index 0000000..3ec988a --- /dev/null +++ b/node_modules/mysql2/lib/commands/close_statement.js @@ -0,0 +1,18 @@ +var util = require('util'); + +var Command = require('./command'); +var Packets = require('../packets/index.js'); + +function CloseStatement(id) +{ + Command.call(this); + this.id = id; +} +util.inherits(CloseStatement, Command); + +CloseStatement.prototype.start = function(packet, connection) { + connection.writePacket(new Packets.CloseStatement(this.id).toPacket(1)); + return null; +}; + +module.exports = CloseStatement; diff --git a/node_modules/mysql2/lib/commands/execute.js b/node_modules/mysql2/lib/commands/execute.js index ae1f14f..15ba770 100644 --- a/node_modules/mysql2/lib/commands/execute.js +++ b/node_modules/mysql2/lib/commands/execute.js @@ -1,132 +1,49 @@ -var Command = require('./command'); -var Packets = require('../packets/index.js'); var util = require('util'); -var compileParser = require('../compile_binary_parser'); + +var Command = require('./command.js'); +var Packets = require('../packets/index.js'); + +var compileParser = require('../compile_binary_parser.js'); function Execute(options, callback) { Command.call(this); - this.query = options.sql; + this.statement = options.statement; - this.onResult = callback; // TODO check felixge multi-result api - this.fieldCount = 0; - this.parameterCount = 0; - this.fields = []; - this.parameterDefinitions = []; + this.onResult = callback; + this.parameters = options.values; this.resultFields = []; this.resultFieldCount = 0; this.insertId = 0; - this.parameters = options.values; this.rows = []; - this.statementInfo = null; this.options = options; } util.inherits(Execute, Command); -Execute.prototype.start = function(packet, connection) { - var cachedStatement = connection.statements[statementKey(this.query, this.options)]; - if (!cachedStatement) { // prepare first - connection.writePacket(new Packets.PrepareStatement(this.query).toPacket(1)); - } else { - this.statementInfo = cachedStatement; - return this.doExecute(connection); +Execute.prototype.buildParserFromFields = function(fields, connection) { + var parserKey; + if (!this.statement.parser) { + // compile row parser + parserKey = connection.keyFromFields(fields, this.options); + this.statement.parser = connection.binaryProtocolParsers[parserKey]; + if (!this.statement.parser) { + this.statement.parser = compileParser(fields, this.options, connection.config); + connection.binaryProtocolParsers[parserKey] = this.statement.parser; + } } - return Execute.prototype.prepareHeader; -}; - -function PreparedStatementInfo(id) { - this.id = id; - this.parser = null; } -Execute.prototype.prepareHeader = function(packet, connection) { - var header = new Packets.PreparedStatementHeader(packet); - this.fieldCount = header.fieldCount; - this.parameterCount = header.parameterCount; - this.statementInfo = new PreparedStatementInfo(header.id); - - connection.statements[statementKey(this.query, this.options)] = this.statementInfo; - if (this.parameterCount > 0) - return Execute.prototype.readParameter; - else if (this.fieldCount > 0) - return Execute.prototype.readField; - else - return this.doExecute(connection); -}; - -Execute.prototype.readParameter = function(packet, connection) { - var def = new Packets.ColumnDefinition(packet); - this.parameterDefinitions.push(def); - if (this.parameterDefinitions.length == this.parameterCount) - return Execute.prototype.parametersEOF; - return this.readParameter; -}; - function statementKey(query, options) { return (typeof options.nestTables) + '/' + options.nestTables + '/' + options.rowsAsHash + query; } -// TODO: move to connection.js? -function getFieldsKey(fields, options) { - var res = (typeof options.nestTables) + '/' + options.nestTables + '/' + options.rowsAsHash; - for (var i=0; i < fields.length; ++i) - res += '/' + fields[i].name + ':' + fields[i].columnType + ':' + fields[i].flags; - return res; -} - -Execute.prototype.readField = function(packet, connection) { - var def = new Packets.ColumnDefinition(packet); - this.fields.push(def); - var parserKey = ''; - - // TODO: api to allow to flag "I'm not going to change schema for this statement" - // this way we can ignore column definitions in binary response and use - // definition from prepare phase. Note that it's what happens currently - // e.i if you do execute("select * from foo") and later add/remove/rename rows to foo - // (without reconnecting) you are in trouble - - if (this.fields.length == this.fieldCount) { - if (!this.statementInfo.parser) { - // compile row parser - parserKey = getFieldsKey(this.fields, this.options); - // try cached first - this.statementInfo.fields = this.fields; - this.statementInfo.parser = connection.binaryProtocolParsers[parserKey]; - if (!this.statementInfo.parser) { - this.statementInfo.parser = compileParser(this.fields, this.options, connection.config); - connection.binaryProtocolParsers[parserKey] = this.statementInfo.parser; - } - } - return Execute.prototype.fieldsEOF; - } - return Execute.prototype.readField; -}; - -Execute.prototype.parametersEOF = function(packet, connection) { - // check EOF - if (!packet.isEOF()) - throw "Expected EOF packet"; - if (this.fieldCount > 0) - return Execute.prototype.readField; - else - return this.doExecute(connection); -}; - -Execute.prototype.fieldsEOF = function(packet, connection) { - // check EOF - if (!packet.isEOF()) - throw "Expected EOF packet"; - return this.doExecute(connection); -}; - -Execute.prototype.doExecute = function(connection) -{ - connection.sequenceId = 0; - var executePacket = new Packets.Execute(this.statementInfo.id, this.parameters); +Execute.prototype.start = function(packet, connection) { + var cachedStatement = connection._statements[statementKey(this.query, this.options)]; + var executePacket = new Packets.Execute(this.statement.id, this.parameters); connection.writePacket(executePacket.toPacket(1)); return Execute.prototype.resultsetHeader; }; @@ -135,6 +52,10 @@ Execute.prototype.resultsetHeader = function(packet) { var self = this; var header = new Packets.ResultSetHeader(packet); this.resultFieldCount = header.fieldCount; + // we'll re-create row parser if schema reported by + // prepare is different from one in result set + if (this.statement.columns.length != this.resultFieldCount) + this.statement.parser = null; this.insertId = header.insertId; if (this.resultFieldCount === 0) { if (this.onResult) @@ -146,9 +67,16 @@ Execute.prototype.resultsetHeader = function(packet) { return Execute.prototype.readResultField; }; -Execute.prototype.readResultField = function(packet) { +Execute.prototype.readResultField = function(packet, connection) { var def; - if (this.statementInfo.parser) // ignore result fields definition, we are reusing fields from prepare response + + // TODO: this used to be performance optimisation (don't parse column def if we + // already have one in statement info, but since we can't 100% trust statement info + // column defs it's probably bettery to always use fields from result header. + // config option to ignore this? + + // ignore result fields definition, we are reusing fields from prepare response + if (this.statement.parser) this.resultFields.push(null); else { def = new Packets.ColumnDefinition(packet); @@ -160,25 +88,33 @@ Execute.prototype.readResultField = function(packet) { return Execute.prototype.readResultField; }; -Execute.prototype.resultFieldsEOF = function(packet) { +Execute.prototype.resultFieldsEOF = function(packet, connection) { // check EOF if (!packet.isEOF()) - throw "Expected EOF packet"; + return connection.protocolError("Expected EOF packet"); + + if (!this.statement.parser) + this.buildParserFromFields(this.resultFields, connection) return Execute.prototype.row; }; -Execute.prototype.row = function(packet) +Execute.prototype.row = function(packet, connection) { var self = this; // TODO: refactor to share code with Query::row if (packet.isEOF()) { + + // TODO: multiple statements + //packet.eofStatusFlags() & ServerStatus.SERVER_MORE_RESULTS_EXISTS; + if (this.onResult) process.nextTick(function() { - self.onResult(null, self.rows, self.statementInfo.fields); + self.onResult(null, self.rows, self.resultFields); }) return null; } - var r = new this.statementInfo.parser(packet); + + var r = new this.statement.parser(packet); if (this.onResult) this.rows.push(r); else diff --git a/node_modules/mysql2/lib/commands/index.js b/node_modules/mysql2/lib/commands/index.js index dd984d4..1ecc761 100644 --- a/node_modules/mysql2/lib/commands/index.js +++ b/node_modules/mysql2/lib/commands/index.js @@ -1,4 +1,4 @@ -"client_handshake server_handshake query execute ping register_slave binlog_dump".split(' ').forEach(function(name) { - var ctor = require('./' + name); +"client_handshake server_handshake query prepare close_statement execute ping register_slave binlog_dump change_user".split(' ').forEach(function(name) { + var ctor = require('./' + name + '.js'); module.exports[ctor.name] = ctor; }); diff --git a/node_modules/mysql2/lib/commands/prepare.js b/node_modules/mysql2/lib/commands/prepare.js new file mode 100644 index 0000000..982428a --- /dev/null +++ b/node_modules/mysql2/lib/commands/prepare.js @@ -0,0 +1,112 @@ +var util = require('util'); + +var Packets = require('../packets/index.js'); +var Command = require('./command.js'); +var CloseStatement = require('./close_statement.js') +var Execute = require('./execute.js') + +function Prepare(options, callback) +{ + Command.call(this); + this.query = options.sql; + this.onResult = callback; + + this.id = 0; + this.fieldCount = 0; + this.parameterCount = 0; + this.fields = []; + this.parameterDefinitions = []; + this.options = options; +} +util.inherits(Prepare, Command); + +Prepare.prototype.start = function(packet, connection) { + connection.writePacket(new Packets.PrepareStatement(this.query).toPacket(1)); + return Prepare.prototype.prepareHeader; +}; + +function PreparedStatementInfo(query, id, columns, parameters, connection) { + this.query = query; + this.id = id; + this.columns = columns; + this.parameters = parameters; + this.rowParser = null; + this._connection = connection +} + +PreparedStatementInfo.prototype.close = function() { + return this._connection.addCommand(new CloseStatement(this.id)); +}; + +PreparedStatementInfo.prototype.execute = function(parameters, callback) { + if (typeof parameters == 'function') { + callback = parameters; + parameters = []; + } + return this._connection.addCommand(new Execute({ statement: this, values: parameters}, callback)); +}; + +Prepare.prototype.prepareHeader = function(packet, connection) { + var header = new Packets.PreparedStatementHeader(packet); + this.id = header.id; + this.fieldCount = header.fieldCount; + this.parameterCount = header.parameterCount; + if (this.parameterCount > 0) + return Prepare.prototype.readParameter; + else if (this.fieldCount > 0) + return Prepare.prototype.readField; + else + return this.prepareDone(connection); +}; + +Prepare.prototype.readParameter = function(packet) { + var def = new Packets.ColumnDefinition(packet); + this.parameterDefinitions.push(def); + if (this.parameterDefinitions.length == this.parameterCount) + return Prepare.prototype.parametersEOF; + return this.readParameter; +}; + +Prepare.prototype.readField = function(packet, connection) { + var def = new Packets.ColumnDefinition(packet); + this.fields.push(def); + if (this.fields.length == this.fieldCount) + return Prepare.prototype.fieldsEOF; + return Prepare.prototype.readField; +}; + +Prepare.prototype.parametersEOF = function(packet, connection) { + if (!packet.isEOF()) + return connection.protocolError("Expected EOF packet after parameters"); + if (this.fieldCount > 0) + return Prepare.prototype.readField; + else + return this.prepareDone(connection); +}; + +Prepare.prototype.fieldsEOF = function(packet, connection) { + if (!packet.isEOF()) + return connection.protocolError("Expected EOF packet after fields"); + return this.prepareDone(connection); +}; + +Prepare.prototype.prepareDone = function(connection) +{ + var self = this; + if (this.onResult) + process.nextTick(function() { + self.onResult( + null, + new PreparedStatementInfo( + self.query, + self.id, + self.fields, + self.parameterDefinitions, + connection + ) + ); + }); + return null; +}; + +module.exports = Prepare; diff --git a/node_modules/mysql2/lib/commands/query.js b/node_modules/mysql2/lib/commands/query.js index 71fdf17..a94617d 100644 --- a/node_modules/mysql2/lib/commands/query.js +++ b/node_modules/mysql2/lib/commands/query.js @@ -1,13 +1,19 @@ -var Command = require('./command'); +var fs = require('fs'); +var util = require('util'); + +var Command = require('./command.js'); var Packets = require('../packets/index.js'); -var util = require('util'); var compileParser = require('../compile_text_parser.js'); var ServerStatus = require('../constants/server_status.js'); +var EmptyPacket = new Packets.Packet(0, new Buffer(4), 0, 4); + function Query(sql, options, callback) { Command.call(this); this.query = sql; + // node-mysql compatibility: query.sql as alias to query.query #121 + this.sql = this.query; this.options = options; this.onResult = callback; this._fieldCount = 0; @@ -16,6 +22,8 @@ function Query(sql, options, callback) this._rows = []; this._receivedFieldsCount = 0; this._resultIndex = 0; + this._localStream = null; + this._streamFactory = options.infileStreamFactory; } util.inherits(Query, Command); @@ -52,6 +60,26 @@ Query.prototype.done = function() { return null; }; +Query.prototype.doneInsert = function(rs) { + if (this._localStreamError) { + if (this.onResult) { + this.onResult(this._localStreamError, rs); + } else { + this.emit('error', this._localStreamError); + } + return null; + } + this._rows.push(rs); + this._fields.push(void(0)); + this.emit('result', rs, this._resultIndex); + this.emit('fields', void(0), this._resultIndex); + if (rs.serverStatus & ServerStatus.SERVER_MORE_RESULTS_EXISTS) { + this._resultIndex++; + return Query.prototype.resultsetHeader; + } + return this.done(); +}; + Query.prototype.resultsetHeader = function(packet, connection) { var rs = new Packets.ResultSetHeader(packet, connection.config.bigNumberStrings); this._fieldCount = rs.fieldCount; @@ -59,15 +87,13 @@ Query.prototype.resultsetHeader = function(packet, connection) { console.log(' Resultset header received, expecting ' + rs.fieldCount + ' column definition packets'); } if (this._fieldCount === 0) { - this._rows.push(rs); - this._fields.push(void(0)); - this.emit('result', rs, this._resultIndex); - this.emit('fields', void(0), this._resultIndex); - if (rs.serverStatus & ServerStatus.SERVER_MORE_RESULTS_EXISTS) { - this._resultIndex++; - return Query.prototype.resultsetHeader; - } - return this.done(); + return this.doneInsert(rs); + } + if (this._fieldCount === null) { + this._localStream = this._findOrCreateReadStream(rs.infileName); + // start streaming, after last packet expect OK + this._streamLocalInfile(connection); + return Query.prototype.infileOk; } this._receivedFieldsCount = 0; @@ -84,6 +110,39 @@ function getFieldsKey(fields, options) { return res; } +// some code taken from https://github.com/felixge/node-mysql/pull/668 +Query.prototype._findOrCreateReadStream = function(path) { + if (this._streamFactory) + return this._streamFactory(path); + return fs.createReadStream(path, { + 'flag': 'r', + 'encoding': null, + 'autoClose': true + }); +}; + +Query.prototype._streamLocalInfile = function(connection) { + var command = this; + connection.stream.on('pause', function() { + command._localStream.pause(); + }); + connection.stream.on('drain', function() { + command._localStream.resume(); + }); + this._localStream.on('data', function (data) { + var dataWithHeader = new Buffer(data.length + 4); + data.copy(dataWithHeader, 4); + connection.writePacket(new Packets.Packet(0, dataWithHeader, 0, dataWithHeader.length)); + }); + this._localStream.on('end', function (data) { + connection.writePacket(EmptyPacket); + }); + this._localStream.on('error', function(err) { + command._localStreamError = err; + command._localStream.emit('end'); + }); +} + Query.prototype.readField = function(packet, connection) { this._receivedFieldsCount++; @@ -130,7 +189,7 @@ Query.prototype.row = function(packet) { if (packet.isEOF()) { var status = packet.eofStatusFlags(); - var moreResults = packet.eofStatusFlags() & ServerStatus.SERVER_MORE_RESULTS_EXISTS; + var moreResults = status & ServerStatus.SERVER_MORE_RESULTS_EXISTS; if (moreResults) { this._resultIndex++; return Query.prototype.resultsetHeader; @@ -147,4 +206,9 @@ Query.prototype.row = function(packet) return Query.prototype.row; }; +Query.prototype.infileOk = function(packet, connection) { + var rs = new Packets.ResultSetHeader(packet, connection.config.bigNumberStrings); + return this.doneInsert(rs); +} + module.exports = Query; diff --git a/node_modules/mysql2/lib/commands/server_handshake.js b/node_modules/mysql2/lib/commands/server_handshake.js index 46de993..e29f382 100644 --- a/node_modules/mysql2/lib/commands/server_handshake.js +++ b/node_modules/mysql2/lib/commands/server_handshake.js @@ -1,8 +1,11 @@ -var Command = require('./command'); +var util = require('util'); + +var ClientConstants = require('../constants/client.js'); +var CommandCode = require('../constants/commands.js'); + +var Command = require('./command.js'); var Packets = require('../packets/index.js'); -var util = require('util'); -var ClientConstants = require('../constants/client'); -var CommandCode = require('../constants/commands'); +var auth41 = require('../auth_41.js'); function ServerHandshake(args) { @@ -21,16 +24,46 @@ util.inherits(ServerHandshake, Command); ServerHandshake.prototype.start = function(packet, connection) { var serverHelloPacket = new Packets.Handshake(this.args); + this.serverHello = serverHelloPacket; serverHelloPacket.setScrambleData(function(err) { + if (err) + return connection.emit('error', new Error('Error generating random bytes')); connection.writePacket(serverHelloPacket.toPacket(0)); }); return ServerHandshake.prototype.readClientReply; }; ServerHandshake.prototype.readClientReply = function(packet, connection) { - // TODO connection.writeOk(); - var ok = new Buffer([0x07, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00]); - connection.write(ok); + // check auth here + var clientHelloReply = new Packets.HandshakeResponse.fromPacket(packet); + if (this.args.authCallback) { + try { + this.args.authCallback({ + user: clientHelloReply.user, + database: clientHelloReply.database, + address: connection.stream.remoteAddress, + authPluginData1: this.serverHello.authPluginData1, + authPluginData2: this.serverHello.authPluginData2, + authToken: clientHelloReply.authToken, + }, function(err, mysqlError) { + //if (err) + if (!mysqlError) + connection.writeOk(); + else { + // TODO create constants / errorToCode + // 1045 = ER_ACCESS_DENIED_ERROR + connection.writeError({ message: mysqlError.message || '', code: mysqlError.code || 1045 }); + connection.close(); + } + }); + } catch(err) { + throw err; + // TODO + // connection.writeError(err) + } + } else { + connection.writeOk(); + } return ServerHandshake.prototype.dispatchCommands; }; diff --git a/node_modules/mysql2/lib/compile_binary_parser.js b/node_modules/mysql2/lib/compile_binary_parser.js index 725b49d..6aaa0c3 100644 --- a/node_modules/mysql2/lib/compile_binary_parser.js +++ b/node_modules/mysql2/lib/compile_binary_parser.js @@ -1,8 +1,9 @@ -var FieldFlags = require('./constants/field_flags'); -var Charsets = require('./constants/charsets'); -var Types = require('./constants/types'); var vm = require('vm'); -var srcEscape = require('./helpers').srcEscape; + +var FieldFlags = require('./constants/field_flags.js'); +var Charsets = require('./constants/charsets.js'); +var Types = require('./constants/types.js'); +var srcEscape = require('./helpers').srcEscape; var typeNames = []; for (var t in Types) { @@ -16,7 +17,7 @@ function compile(fields, options, config) { result.push('(function(){ return function BinaryRow(packet) {'); if (options.rowsAsArray) - result.push(' var result = new Array(' + fields.length + ')'); + result.push(' var result = new Array(' + fields.length + ');'); var resultTables = {}; var resultTablesArray = []; @@ -80,7 +81,7 @@ function compile(fields, options, config) { result.push('}; })()'); var src = result.join('\n'); if (config.debug) { - console.log('Compiled text protocol row parser:'); + console.log('Compiled binary protocol row parser:'); var cardinal = require('cardinal'); console.log(cardinal.highlight(src)); } diff --git a/node_modules/mysql2/lib/connection.js b/node_modules/mysql2/lib/connection.js index 4926441..607cb70 100644 --- a/node_modules/mysql2/lib/connection.js +++ b/node_modules/mysql2/lib/connection.js @@ -1,15 +1,17 @@ var net = require('net'); var util = require('util'); var EventEmitter = require('events').EventEmitter; -var Queue = require('fastqueue'); +var Queue = require('double-ended-queue'); -var PacketParser = require('./packet_parser'); -var Packet = require('./packets/packet'); +var PacketParser = require('./packet_parser.js'); +var Packet = require('./packets/packet.js'); var Packets = require('./packets/index.js'); var Commands = require('./commands/index.js'); -var SqlString = require('./sql_string'); +var SqlString = require('./sql_string.js'); +var ConnectionConfig = require('./connection_config.js'); var _connectionId = 0; +var noop = function() {}; function Connection(opts) { @@ -29,14 +31,21 @@ function Connection(opts) else this.stream = net.connect(opts.config.port, opts.config.host); } else { - this.stream = opts.config.stream; + // if stream is a function, treat it as "stream agent / factory" + if (typeof opts.config.stream == 'function') + this.stream = opts.config.stream(opts); + else + this.stream = opts.config.stream; } this._internalId = _connectionId++; this._commands = new Queue(); this._command = null; - this.statements = {}; + this._paused = false; + this._paused_packets = new Queue(); + + this._statements = {}; // TODO: make it lru cache // https://github.com/mercadolibre/node-simple-lru-cache @@ -57,6 +66,9 @@ function Connection(opts) var connection = this; this.sequenceId = 0; + this.threadId = null; + this._handshakePacket = null; + this.stream.on('error', function(err) { connection.emit('error', err); }); @@ -80,12 +92,12 @@ function Connection(opts) // }; //} else { this.stream.on('data', function(data) { - connection.packetParser.execute(data, 0, data.length); + connection.packetParser.execute(data); }); //} this._protocolError = null; this.stream.on('end', function() { - // we need to set this flag everywhere where we want connaction to close + // we need to set this flag everywhere where we want connection to close if (connection._closing) return; @@ -94,6 +106,14 @@ function Connection(opts) var err = new Error('Connection lost: The server closed the connection.'); err.fatal = true; err.code = connection._protocolError; + + var command; + if (connection._command && connection._command.onResult) + connection._command.onResult(err); + while (command = connection._commands.shift()) + if (command.onResult) + command.onResult(err); + connection.emit('error', err); }); @@ -101,6 +121,10 @@ function Connection(opts) if (!this.config.isServer) { handshakeCommand = new Commands.ClientHandshake(this.config.clientFlags); handshakeCommand.on('error', function(e) { connection.emit('error', e); }); + handshakeCommand.on('end', function() { + connection._handshakePacket = handshakeCommand.handshake; + connection.threadId = handshakeCommand.handshake.connectionId; + }); this.addCommand(handshakeCommand); } } @@ -234,7 +258,7 @@ Connection.prototype.startInflate = function() { var zlib = require('zlib'); var inflateStream = zlib.createInflate(); var uncompressedPacketParser = connection.packetParser; - connection.packetParser = new PacketParser(function(compressedPacket) { + connection.packetParser = new PacketParser(function(packet) { var inflatedLength = packet.readInt24(); if (inflatedLength !== 0) { inflateStream.write(packet.readBuffer(packet.length() - 3)); @@ -265,13 +289,20 @@ Connection.prototype.pipe = function() { }; Connection.prototype.handlePacket = function(packet) { + + if (this._paused) + { + this._paused_packets.push(packet); + return; + } + // TODO: check packet sequenceId here - var packetType = ''; if (packet) this.sequenceId = packet.sequenceId + 1; if (this.config.debug) { if (packet) { console.log(this._internalId + ' ' + this.connectionId + ' ==> ' + this._command._commandName + '#' + this._command.stateName() + '(' + [packet.sequenceId, packet.type(), packet.length()].join(',') + ')'); + console.log(' raw: ' + packet.buffer.slice(packet.offset, packet.offset + packet.length).toString('hex')); } } var done = this._command.execute(packet, this); @@ -301,7 +332,7 @@ Connection.prototype.format = function(sql, values) { if (typeof this.config.queryFormat == "function") { return this.config.queryFormat.call(this, sql, values, this.config.timezone); } - return SqlString.format(sql, values, this.config.timezone); + return SqlString.format(sql, values, this.config.stringifyObjects, this.config.timezone); }; Connection.prototype.escape = function(value) { @@ -316,6 +347,18 @@ function _domainify(callback) { return callback; } +var convertNamedPlaceholders = null; +Connection.prototype._resolveNamedPlaceholders = function(options) { + var unnamed; + if (this.config.namedPlaceholders || options.namedPlaceholders) { + if (convertNamedPlaceholders == null) + convertNamedPlaceholders = require('named-placeholders')(); + unnamed = convertNamedPlaceholders(options.sql, options.values); + options.sql = unnamed[0]; + options.values = unnamed[1]; + } +} + Connection.prototype.query = function query(sql, values, cb) { // copy-paste from node-mysql/lib/Connection.js:createQuery var options = {}; @@ -337,10 +380,64 @@ Connection.prototype.query = function query(sql, values, cb) { options.sql = sql; options.values = values; } + + this._resolveNamedPlaceholders(options); var rawSql = this.format(options.sql, options.values || []); return this.addCommand(new Commands.Query(rawSql, options, _domainify(cb))); }; +Connection.prototype.pause = function pause() { + this._paused = true; + this.stream.pause(); +}; + +Connection.prototype.resume= function resume() { + var packet; + this._paused = false; + while( packet = this._paused_packets.shift() ) { + this.handlePacket(packet); + // don't resume if packet hander paused connection + if (this._paused) + return; + } + this.stream.resume(); +}; + +Connection.prototype.keyFromFields = function keyFromFields(fields, options) { + var res = (typeof options.nestTables) + '/' + options.nestTables + '/' + options.rowsAsHash; + for (var i=0; i < fields.length; ++i) + res += '/' + fields[i].name + ':' + fields[i].columnType + ':' + fields[i].flags; + return res; +} + +function statementKey(options) { + return (typeof options.nestTables) + + '/' + options.nestTables + '/' + options.rowsAsHash + + options.sql; +} + +// TODO: named placeholders support +Connection.prototype.prepare = function prepare(options, cb) { + if (typeof options == 'string') + options = { sql: options }; + return this.addCommand(new Commands.Prepare(options, _domainify(cb))); +}; + +Connection.prototype.unprepare = function execute(sql) { + var options = {}; + if (typeof sql === 'object') { + options = sql; + } else + options.sql = sql; + var key = statementKey(options); + var stmt = this._statements[key]; + if (stmt) { + this._statements[key] = null; + stmt.close(); + } + return stmt; +} + Connection.prototype.execute = function execute(sql, values, cb) { var options = {}; if (typeof sql === 'object') { @@ -361,8 +458,58 @@ Connection.prototype.execute = function execute(sql, values, cb) { options.sql = sql; options.values = values; } + cb = _domainify(cb); + this._resolveNamedPlaceholders(options); - return this.addCommand(new Commands.Execute(options, _domainify(cb))); + var connection = this; + var key = statementKey(options); + var statement = connection._statements[key]; + + options.statement = statement; + var executeCommand = new Commands.Execute(options, cb); + + if (!statement) { + connection.prepare(options, function executeStatement(err, stmt) { + if (err) { + if (cb) + cb(err); + else + executeCommand.emit('error', err); + return + } + executeCommand.statement = stmt; + connection._statements[key] = stmt; + connection.addCommand(executeCommand); + }); + } else { + connection.addCommand(executeCommand); + } + return executeCommand; +}; + +Connection.prototype.changeUser = function changeUser(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + + var charsetNumber = (options.charset) + ? ConnectionConfig.getCharsetNumber(options.charset) + : this.config.charsetNumber; + + return this.addCommand(new Commands.ChangeUser({ + user : options.user || this.config.user, + password : options.password || this.config.password, + passwordSha1 : options.passwordSha1 || this.config.passwordSha1, + database : options.database || this.config.database, + timeout : options.timeout, + charsetNumber : charsetNumber, + currentConfig : this.config + }, _domainify(function(err) { + if (err) + err.fatal = true; + if (callback) callback(err); + }))); }; // transaction helpers @@ -390,6 +537,16 @@ Connection.prototype._binlogDump = function binlogDump(opts, cb) { return this.addCommand(new Commands.BinlogDump(opts, _domainify(cb))); }; +// currently just alias to close +Connection.prototype.destroy = function() { + this.close(); +} + +Connection.prototype.close = function() { + this._closing = true; + this.stream.end(); +} + Connection.prototype.createBinlogStream = function(opts) { // TODO: create proper stream class // TODO: use through2 @@ -411,8 +568,7 @@ Connection.prototype.createBinlogStream = function(opts) { stream.push(null); // if non-blocking, then close stream to prevent errors if (opts.flags && (opts.flags & 0x01)) { - connection._closing = true; - connection.stream.end(); + connection.close(); } }); // TODO: pipe errors as well @@ -494,16 +650,22 @@ Connection.prototype.serverHandshake = function serverHandshake(args) { // TODO: domainify Connection.prototype.end = function(callback) { + var connection = this; // TODO: implement COM_QUIT command - var self = this; var endCmd = { connection: this }; endCmd.execute = function() { - self._closing = true; - this.connection.stream.end(); + this.connection.close(); if (callback) callback(); }; - return this.addCommand(endCmd); + this.addCommand(endCmd); + // trigger error if more commands enqueued after end command + connection.addCommand = function() { + if (connection._closing) { + this.emit(new Error('addCommand() called on closing connection')); + } + }; + return endCmd; //return this.addCommand(new Commands.Quit(callback)); }; diff --git a/node_modules/mysql2/lib/connection.js.orig b/node_modules/mysql2/lib/connection.js.orig new file mode 100644 index 0000000..e73c3b0 --- /dev/null +++ b/node_modules/mysql2/lib/connection.js.orig @@ -0,0 +1,674 @@ +var net = require('net'); +var util = require('util'); +var EventEmitter = require('events').EventEmitter; +var Queue = require('double-ended-queue'); + +var PacketParser = require('./packet_parser.js'); +var Packet = require('./packets/packet.js'); +var Packets = require('./packets/index.js'); +var Commands = require('./commands/index.js'); +var SqlString = require('./sql_string.js'); +var ConnectionConfig = require('./connection_config.js'); + +var _connectionId = 0; +<<<<<<< HEAD +var noop = function() {}; +======= +var convertNamedParameters; +>>>>>>> allow to use named placeholders in .execute() + +function Connection(opts) +{ + EventEmitter.call(this); + this.config = opts.config; + + // TODO: fill defaults + // if no params, connect to /var/lib/mysql/mysql.sock ( /tmp/mysql.sock on OSX ) + // if host is given, connect to host:3306 + + // TODO: use `/usr/local/mysql/bin/mysql_config --socket` output? as default socketPath + // if there is no host/port and no socketPath parameters? + + if (!opts.config.stream) { + if (opts.config.socketPath) + this.stream = net.connect(opts.config.socketPath); + else + this.stream = net.connect(opts.config.port, opts.config.host); + } else { + // if stream is a function, treat it as "stream agent / factory" + if (typeof opts.config.stream == 'function') + this.stream = opts.config.stream(opts); + else + this.stream = opts.config.stream; + } + this._internalId = _connectionId++; + + this._commands = new Queue(); + this._command = null; + + this._paused = false; + this._paused_packets = new Queue(); + + this._statements = {}; + + // TODO: make it lru cache + // https://github.com/mercadolibre/node-simple-lru-cache + // or https://github.com/rsms/js-lru + // or https://github.com/monsur/jscache + // or https://github.com/isaacs/node-lru-cache + // + // key is field.name + ':' + field.columnType + ':' field.flags + '/' + this.textProtocolParsers = {}; + + // TODO: not sure if cache should be separate (same key as with textProtocolParsers) + // or part of prepared statements cache (key is sql query) + this.binaryProtocolParsers = {}; + + this.serverCapabilityFlags = 0; + this.authorized = false; + + var connection = this; + this.sequenceId = 0; + + this.threadId = null; + this._handshakePacket = null; + + this.stream.on('error', function(err) { + connection.emit('error', err); + }); + + // big TODO: benchmark if it all worth using 'ondata' and onPacket callbacks directly + // compositing streams would be much more easier. + // also, look for existing length-prefixed streams to reuse instead of packet_parser + // https://github.com/squaremo/node-spb - currently only fixed 4 byte prefix + // ...? + + // see https://gist.github.com/khoomeister/4985691#use-that-instead-of-bind + this.packetParser = new PacketParser(function(p) { connection.handlePacket(p) }); + + // TODO: this code used to be an optimized version of handler + // DOES NOT WORK IN NODE 11 + // TODO: measure if we actually get something here + // if yes, re-enable for node 10 + //if (this.stream instanceof net.Stream) { + // this.stream.ondata = function(data, start, end) { + // connection.packetParser.execute(data, start, end); + // }; + //} else { + this.stream.on('data', function(data) { + connection.packetParser.execute(data); + }); + //} + this._protocolError = null; + this.stream.on('end', function() { + // we need to set this flag everywhere where we want connection to close + if (connection._closing) + return; + + if (!connection._protocolError) // no particular error message before disconnect + connection._protocolError = 'PROTOCOL_CONNECTION_LOST' + var err = new Error('Connection lost: The server closed the connection.'); + err.fatal = true; + err.code = connection._protocolError; + + var command; + if (connection._command && connection._command.onResult) + connection._command.onResult(err); + while (command = connection._commands.shift()) + if (command.onResult) + command.onResult(err); + + connection.emit('error', err); + + }); + var handshakeCommand; + if (!this.config.isServer) { + handshakeCommand = new Commands.ClientHandshake(this.config.clientFlags); + handshakeCommand.on('error', function(e) { connection.emit('error', e); }); + handshakeCommand.on('end', function() { + connection._handshakePacket = handshakeCommand.handshake; + connection.threadId = handshakeCommand.handshake.connectionId; + }); + this.addCommand(handshakeCommand); + } +} +util.inherits(Connection, EventEmitter); + +Connection.prototype.write = function(buffer) { + this.stream.write(buffer); +}; + +// TODO: replace function in runtime instead of having if() here +// Needs benchmark. +Connection.prototype.writePacket = function(packet) { + packet.writeHeader(this.sequenceId); + if (this.config.debug) { + console.log(this._internalId + ' ' + this.connectionId + ' <== ' + this._command._commandName + '#' + this._command.stateName() + '(' + [this.sequenceId, packet._name, packet.length()].join(',') + ')'); + } + this.sequenceId++; + if (this.sequenceId == 256) + this.sequenceId = 0 + if (!this.config.compress || !this.authorized) { + this.write(packet.buffer); + } else { + var packetLen = packet.length(); + var compressHeader = new Buffer(7); + + // TODO: currently all outgoing packets are sent uncompressed (header + deflated length=0 as uncompressed flag) + // Need to implement deflation of outgoing packet. Also need to decide when not to compress small packets + // http://dev.mysql.com/doc/internals/en/compression.html#uncompressed-payload suggest not to compress packets less than 50 bytes + + // Write uncompressed packet + compressHeader.fill(0); + compressHeader.writeUInt8(packetLen & 0xff, 0); + compressHeader.writeUInt16LE(packetLen >> 8, 1); + this.write(compressHeader); + this.write(packet.buffer); + } +}; + +Connection.prototype.startTLS = function(onSecure) { + var connection = this; + var crypto = require('crypto'); + var tls = require('tls'); + var config = this.config; + var stream = this.stream; + + // special case for Amazon RDS: use http://s3.amazonaws.com/rds-downloads/mysql-ssl-ca-cert.pem CA cert if ssl option set to "Amazon RDS" + if (config.ssl === 'Amazon RDS') { + var fs = require('fs'); + var path = require('path'); + fs.readFile(path.resolve(__dirname, '../fixtures/mysql-ssl-ca-cert.pem'), function(err, ca) { + if (err) throw err; + config.ssl = { ca: ca }; + after(); + }); + } else + after(); + + function after() { + var credentials = crypto.createCredentials({ + key: config.ssl.key, + cert: config.ssl.cert, + passphrase: config.ssl.passphrase, + ca: config.ssl.ca + }); + var securePair = tls.createSecurePair(credentials, false); + if (stream.ondata) + stream.ondata = null; + stream.removeAllListeners('data'); + stream.pipe(securePair.encrypted); + securePair.encrypted.pipe(stream); + securePair.cleartext.on('data', function(data) { + connection.packetParser.execute(data.parent, data.offset, data.offset + data.length); + }); + connection.write = function(buffer) { + securePair.cleartext.write(buffer); + }; + securePair.on('secure', onSecure); + } +}; + +// TODO: this does not work if uncompressed packet is split by compressed +// packet boundary. +// My assumption about compressedPacket to contain one or more complete +// compressed packets was wrong. It can wrap any chunk of data. +// This will be rmoved in favor of connection.startInflate +// currently Handshake command overwrites connection.handlePacket with handleCompressedPacket +// before expecting first compressed packet +var zlib = require('zlib'); +Connection.prototype.handleCompressedPacket = function(packet) { + var connection = this; + var inflatedLength = packet.readInt24(); + if (inflatedLength !== 0) { + var compressedBody = packet.readBuffer(packet.length() - 3); + zlib.inflate(compressedBody, function(err, packets) { + if (err) + return connection.emit('error', err); + var offset = packets.offset; + var end = offset + packets.length; + var buffer = packets.parent; + var len = 0; + var id = 0; + // single compressed packet can contain multiple uncompressed + while (offset < end) { + len = buffer.readUInt16LE(offset) + (buffer[offset+2] << 16); + id = buffer[offset+3]; + connection.handlePacket(new Packet(id, buffer, offset + 4, offset + 4 + len)); + offset += 4 + len; + } + }); + } else { + inflatedLength = packet.readInt24(); + var sequenceId = packet.readInt8(); + connection.handlePacket(new Packet(sequenceId, packet.buffer, packet.offset, packet.offset + inflatedLength)); + } +}; + +// TODO: consider using @creationix simple-streams +// https://gist.github.com/creationix/5498108 +// https://github.com/creationix/min-stream-uv +// https://github.com/creationix/min-stream-helpers + + +// TODO: try with Stream2 streams +// +// changes stream -> packetParser to +// stream -> compressedPacketParser -> inflateStream -> packetParser +// note that in the caseof ssl this should become +// stream -> securePair.encrypted -> securePair.cleartext -> compressedPacketParser -> inflateStream -> packetParser +Connection.prototype.startInflate = function() { + var connection = this; + var zlib = require('zlib'); + var inflateStream = zlib.createInflate(); + var uncompressedPacketParser = connection.packetParser; + connection.packetParser = new PacketParser(function(packet) { + var inflatedLength = packet.readInt24(); + if (inflatedLength !== 0) { + inflateStream.write(packet.readBuffer(packet.length() - 3)); + } else { + uncompressedPacketParser.execute(packet.buffer, packet.offset, packet.end); + } + }); + inflateStream.on('data', function(buff) { + uncompressedPacketParser.execute(buff.parent, buff.offset, buff.offset + buff.length); + }); + if (this.stream.ondata) + this.stream.ondata = null; + this.stream.removeAllListeners('data'); + this.pipe(); +}; + +Connection.prototype.pipe = function() { + var connection = this; + if (this.stream instanceof net.Stream) { + this.stream.ondata = function(data, start, end) { + connection.packetParser.execute(data, start, end); + }; + } else { + this.stream.on('data', function(data) { + connection.packetParser.execute(data.parent, data.offset, data.offset + data.length); + }); + } +}; + +Connection.prototype.handlePacket = function(packet) { + + if (this._paused) + { + this._paused_packets.push(packet); + return; + } + + // TODO: check packet sequenceId here + if (packet) + this.sequenceId = packet.sequenceId + 1; + if (this.config.debug) { + if (packet) { + console.log(this._internalId + ' ' + this.connectionId + ' ==> ' + this._command._commandName + '#' + this._command.stateName() + '(' + [packet.sequenceId, packet.type(), packet.length()].join(',') + ')'); + console.log(' raw: ' + packet.buffer.slice(packet.offset, packet.offset + packet.length).toString('hex')); + } + } + var done = this._command.execute(packet, this); + if (done) { + this.sequenceId = 0; + this._command = this._commands.shift(); + if (this._command) + this.handlePacket(); + } +}; + +Connection.prototype.addCommand = function(cmd) { + if (this.config.debug) { + console.log('Add command: ' + arguments.callee.caller.name); + cmd._commandName = arguments.callee.caller.name; + } + if (!this._command) { + this._command = cmd; + this.handlePacket(); + } else { + this._commands.push(cmd); + } + return cmd; +}; + +Connection.prototype.format = function(sql, values) { + if (typeof this.config.queryFormat == "function") { + return this.config.queryFormat.call(this, sql, values, this.config.timezone); + } + return SqlString.format(sql, values, this.config.stringifyObjects, this.config.timezone); +}; + +Connection.prototype.escape = function(value) { + return SqlString.escape(value, false, this.config.timezone); +}; + +function _domainify(callback) { + var domain = process.domain; + if (domain && callback) + return process.domain.bind(callback); + else + return callback; +} + +Connection.prototype.query = function query(sql, values, cb) { + // copy-paste from node-mysql/lib/Connection.js:createQuery + var options = {}; + if (typeof sql === 'object') { + // query(options, cb) + options = sql; + if (typeof values === 'function') { + cb = values; + } else { + options.values = values; + } + } else if (typeof values === 'function') { + // query(sql, cb) + cb = values; + options.sql = sql; + options.values = undefined; + } else { + // query(sql, values, cb) + options.sql = sql; + options.values = values; + } + var rawSql = this.format(options.sql, options.values || []); + return this.addCommand(new Commands.Query(rawSql, options, _domainify(cb))); +}; + +Connection.prototype.pause = function pause() { + this._paused = true; + this.stream.pause(); +}; + +Connection.prototype.resume= function resume() { + var packet; + this._paused = false; + while( packet = this._paused_packets.shift() ) { + this.handlePacket(packet); + // don't resume if packet hander paused connection + if (this._paused) + return; + } + this.stream.resume(); +}; + +Connection.prototype.keyFromFields = function keyFromFields(fields, options) { + var res = (typeof options.nestTables) + '/' + options.nestTables + '/' + options.rowsAsHash; + for (var i=0; i < fields.length; ++i) + res += '/' + fields[i].name + ':' + fields[i].columnType + ':' + fields[i].flags; + return res; +} + +function statementKey(options) { + return (typeof options.nestTables) + + '/' + options.nestTables + '/' + options.rowsAsHash + + options.sql; +} + +// TODO: named placeholders support +Connection.prototype.prepare = function prepare(options, cb) { + if (typeof options == 'string') + options = { sql: options }; + return this.addCommand(new Commands.Prepare(options, _domainify(cb))); +}; + +Connection.prototype.unprepare = function execute(sql) { + var options = {}; + if (typeof sql === 'object') { + options = sql; + } else + options.sql = sql; + var key = statementKey(options); + var stmt = this._statements[key]; + if (stmt) { + this._statements[key] = null; + stmt.close(); + } + return stmt; +} + +Connection.prototype.execute = function execute(sql, values, cb) { + var options = {}; + var unnamed; + if (typeof sql === 'object') { + // execute(options, cb) + options = sql; + if (typeof values === 'function') { + cb = values; + } else { + options.values = values; + } + } else if (typeof values === 'function') { + // execute(sql, cb) + cb = values; + options.sql = sql; + options.values = undefined; + } else { + // execute(sql, values, cb) + options.sql = sql; + options.values = values; + } + cb = _domainify(cb); + + var connection = this; + var key = statementKey(options); + var statement = connection._statements[key]; + + options.statement = statement; + var executeCommand = new Commands.Execute(options, cb); + + if (!statement) { + connection.prepare(options, function executeStatement(err, stmt) { + if (err) { + if (cb) + cb(err); + else + executeCommand.emit('error', err); + return + } + executeCommand.statement = stmt; + connection._statements[key] = stmt; + connection.addCommand(executeCommand); + }); + } else { + connection.addCommand(executeCommand); + } + return executeCommand; +}; + +<<<<<<< HEAD +Connection.prototype.changeUser = function changeUser(options, callback) { + if (!callback && typeof options === 'function') { + callback = options; + options = {}; + } + + var charsetNumber = (options.charset) + ? ConnectionConfig.getCharsetNumber(options.charset) + : this.config.charsetNumber; + + return this.addCommand(new Commands.ChangeUser({ + user : options.user || this.config.user, + password : options.password || this.config.password, + passwordSha1 : options.passwordSha1 || this.config.passwordSha1, + database : options.database || this.config.database, + timeout : options.timeout, + charsetNumber : charsetNumber, + currentConfig : this.config + }, _domainify(function(err) { + if (err) + err.fatal = true; + if (callback) callback(err); + }))); +======= + if (this.config.namedParameters) { + if (!convertNamedParameters) + convertNamedParameters = require('named-placeholders')(); + unnamed = convertNamedParameters(options.sql, options.values); + debugger; + options.sql = unnamed[0]; + options.values = unnamed[1]; + } + return this.addCommand(new Commands.Execute(options, _domainify(cb))); +>>>>>>> allow to use named placeholders in .execute() +}; + +// transaction helpers +Connection.prototype.beginTransaction = function(cb) { + return this.query('START TRANSACTION', cb); +} + +Connection.prototype.commit = function(cb) { + return this.query('COMMIT', cb); +} + +Connection.prototype.rollback = function(cb) { + return this.query('ROLLBACK', cb); +} + +Connection.prototype.ping = function ping(cb) { + return this.addCommand(new Commands.Ping(_domainify(cb))); +}; + +Connection.prototype._registerSlave = function registerSlave(opts, cb) { + return this.addCommand(new Commands.RegisterSlave(opts, _domainify(cb))); +}; + +Connection.prototype._binlogDump = function binlogDump(opts, cb) { + return this.addCommand(new Commands.BinlogDump(opts, _domainify(cb))); +}; + +// currently just alias to close +Connection.prototype.destroy = function() { + this.close(); +} + +Connection.prototype.close = function() { + this._closing = true; + this.stream.end(); +} + +Connection.prototype.createBinlogStream = function(opts) { + // TODO: create proper stream class + // TODO: use through2 + var test = 1; + var Readable = require('stream').Readable; + var stream = new Readable({objectMode: true}); + stream._read = function() { + return { + data: test++ + } + }; + var connection = this; + connection._registerSlave(opts, function(err) { + var dumpCmd = connection._binlogDump(opts); + dumpCmd.on('event', function(ev) { + stream.push(ev); + }); + dumpCmd.on('eof', function() { + stream.push(null); + // if non-blocking, then close stream to prevent errors + if (opts.flags && (opts.flags & 0x01)) { + connection.close(); + } + }); + // TODO: pipe errors as well + }) + return stream; +} + +Connection.prototype.connect = function(cb) { + if (!cb) return; + var connectCalled = 0; + + // TODO domainify this callback as well. Note that domain has to be captured + // at the top of function due to nested callback + function callbackOnce(isErrorHandler) { + return function(param) { + if (!connectCalled) { + if (isErrorHandler) + cb(param); + else + cb(null, param); + } + connectCalled = 1; + }; + } + this.once('error', callbackOnce(true) ); + this.once('connect', callbackOnce(false)); +}; + +// =================================== +// outgoing server connection methods +// =================================== + +Connection.prototype.writeColumns = function(columns) { + var connection = this; + this.writePacket(Packets.ResultSetHeader.toPacket(columns.length)); + columns.forEach(function(column) { + connection.writePacket(Packets.ColumnDefinition.toPacket(column)); + }); + this.writeEof(); +}; + +// row is array of columns, not hash +Connection.prototype.writeTextRow = function(column) { + this.writePacket(Packets.TextRow.toPacket(column)); +}; + +Connection.prototype.writeTextResult = function(rows, columns) { + var connection = this; + connection.writeColumns(columns); + rows.forEach(function(row) { + var arrayRow = new Array(columns.length); + columns.forEach(function(column) { + arrayRow.push(row[column.name]); + }); + connection.writeTextRow(arrayRow); + }); + connection.writeEof(); +}; + +Connection.prototype.writeEof = function(warnings, statusFlags) { + this.writePacket(Packets.EOF.toPacket(warnings, statusFlags)); +}; + +Connection.prototype.writeOk = function(args) { + if (!args) + args = { affectedRows: 0 }; + this.writePacket(Packets.OK.toPacket(args)); +}; + +Connection.prototype.writeError = function(args) { + this.writePacket(Packets.Error.toPacket(args)); +}; + +Connection.prototype.serverHandshake = function serverHandshake(args) { + return this.addCommand(new Commands.ServerHandshake(args)); +}; + +// =============================================================== + +// TODO: domainify +Connection.prototype.end = function(callback) { + var connection = this; + // TODO: implement COM_QUIT command + var endCmd = { connection: this }; + endCmd.execute = function() { + this.connection.close(); + if (callback) + callback(); + }; + this.addCommand(endCmd); + // trigger error if more commands enqueued after end command + connection.addCommand = function() { + if (connection._closing) { + this.emit(new Error('addCommand() called on closing connection')); + } + }; + return endCmd; + //return this.addCommand(new Commands.Quit(callback)); +}; + +module.exports = Connection; diff --git a/node_modules/mysql2/lib/connection_config.js b/node_modules/mysql2/lib/connection_config.js index 457055d..541ec21 100644 --- a/node_modules/mysql2/lib/connection_config.js +++ b/node_modules/mysql2/lib/connection_config.js @@ -1,6 +1,7 @@ var urlParse = require('url').parse; var ClientConstants = require('./constants/client'); var Charsets = require('./constants/charsets'); +var SSLProfiles = null; module.exports = ConnectionConfig; function ConnectionConfig(options) { @@ -13,24 +14,33 @@ function ConnectionConfig(options) { this.host = options.host || 'localhost'; this.port = options.port || 3306; + this.localAddress = options.localAddress; this.socketPath = options.socketPath; this.user = options.user || undefined; this.password = options.password || undefined; + this.passwordSha1 = options.passwordSha1 || undefined; this.database = options.database; + this.connectTimeout = (options.connectTimeout === undefined) + ? (10 * 1000) + : options.connectTimeout; this.insecureAuth = options.insecureAuth || false; this.supportBigNumbers = options.supportBigNumbers || false; this.bigNumberStrings = options.bigNumberStrings || false; + this.dateStrings = options.dateStrings || false; this.debug = options.debug; + this.trace = options.trace !== false; + this.stringifyObjects = options.stringifyObjects || false; this.timezone = options.timezone || 'local'; this.flags = options.flags || ''; this.queryFormat = options.queryFormat; this.pool = options.pool || undefined; + this.ssl = (typeof options.ssl === 'string') + ? ConnectionConfig.getSSLProfile(options.ssl) + : (options.ssl || false); this.multipleStatements = options.multipleStatements || false; - this.typeCast = (options.typeCast === undefined) ? true : options.typeCast; - this.ssl = options.ssl; - this.compress = options.compress || false; - this.dateStrings = options.dateStrings || false; - + this.typeCast = (options.typeCast === undefined) + ? true + : options.typeCast; if (this.timezone[0] == " ") { // "+" is a url encoded char for space so it @@ -39,6 +49,11 @@ function ConnectionConfig(options) { this.timezone = "+" + this.timezone.substr(1); } + if (this.ssl) { + // Default rejectUnauthorized to true + this.ssl.rejectUnauthorized = this.ssl.rejectUnauthorized !== false; + } + this.maxPacketSize = 0; this.charsetNumber = (options.charset) ? ConnectionConfig.getCharsetNumber(options.charset) @@ -83,8 +98,28 @@ ConnectionConfig.getDefaultFlags = function(options) { return defaultFlags; }; -ConnectionConfig.getCharsetNumber = function(charset) { - return Charsets[charset]; +ConnectionConfig.getCharsetNumber = function getCharsetNumber(charset) { + var num = Charsets[charset.toUpperCase()]; + + if (num === undefined) { + throw new TypeError('Unknown charset \'' + charset + '\''); + } + + return num; +}; + +ConnectionConfig.getSSLProfile = function getSSLProfile(name) { + if (!SSLProfiles) { + SSLProfiles = require('./../fixtures/ssl-profiles.json'); + } + + var ssl = SSLProfiles[name]; + + if (ssl === undefined) { + throw new TypeError('Unknown SSL profile \'' + name + '\''); + } + + return ssl; }; ConnectionConfig.parseUrl = function(url) { diff --git a/node_modules/mysql2/lib/packet_parser.js b/node_modules/mysql2/lib/packet_parser.js index 0bd3283..78012a3 100644 --- a/node_modules/mysql2/lib/packet_parser.js +++ b/node_modules/mysql2/lib/packet_parser.js @@ -1,7 +1,5 @@ -var Packet = require('./packets/packet'); +var Packet = require('./packets/packet.js'); -// as this is very low level parser, EventEmitter is not used -// onPayload(sequenceId, payload) is called for each mysql packet function PacketParser(onPacket) { // array of last payload chunks @@ -9,75 +7,97 @@ function PacketParser(onPacket) this.buffer = []; // total length of chunks on buffer this.bufferLength = 0; - this.headerLen = 0; - this.headerBuff = Buffer(4); - this.state = 'head0'; + // incomplete header state: number of header bytes received + this.headerLen = 0; // expected payload length - this.length = 0; - this.sequenceId = 0; + this.length = 0; + this.onPacket = onPacket; + this.execute = PacketParser.prototype.executeStart; } -PacketParser.prototype.execute = function(chunk, start, end) { +function readPacketLength(b,off) { + var b0 = b[off]; + var b1 = b[off+1]; + var b2 = b[off+2]; + if (b1 + b2 === 0) + return b0; + return b0 + (b1<<8) + (b2<<16); +} - // node 0.11 has different ondata signature - if (!start && !end) { - start = 0; - end = chunk.length; - } +// +PacketParser.prototype.executeStart = function(chunk) { + var start = 0; + var end = chunk.length; + // if (start-end === 0) return; - while (start < chunk.length) { - if (this.state == 'head0' && (end - start) > 3) { - this.length = chunk[start] + (chunk[start+1] << 8) + (chunk[start+2] << 16); - this.sequenceId = chunk[start+3]; - var packetLength = this.length + 4; - if (end - start > packetLength) { // more than one packet in chunk - this.onPacket(new Packet(this.sequenceId, chunk, start + 4, start + packetLength)); - start += packetLength; - } else if (end - start == packetLength) { - return this.onPacket(new Packet(this.sequenceId, chunk, start + 4, start + packetLength)); - } else { // payload is incomplete - this.buffer = [chunk.slice(start + 4, end)]; - this.bufferLength = end - start - 4; - this.state = 'payload'; - return; - } - } else if (this.state == 'payload') { - var remainingPayload = this.length - this.bufferLength; - if (end - start >= remainingPayload) { // last chunk for payload - var payload = new Buffer(this.length); - var offset = 0; - for (var i=0; i < this.buffer.length; ++i) { - this.buffer[i].copy(payload, offset); - offset += this.buffer[i].length; - } - chunk.copy(payload, offset, start, start + remainingPayload); - this.onPacket(new Packet(this.sequenceId, payload, 0, this.length)); - this.buffer = []; - this.bufferLength = 0; - start += remainingPayload; - this.state = 'head0'; - } else { - this.buffer.push(chunk.slice(start, end)); - this.bufferLength += end - start; - return; - } - } else { // length < 4 or state != header0 - if (end - start + this.headerLen < 4) { - chunk.copy(this.headerBuff, this.headerLen, start, end); - this.headerLen += end - start; - this.state = 'head_'; - return; - } - chunk.copy(this.headerBuff, this.headerLen, start, start + 4 - this.headerLen); - start += 4 - this.headerLen; - this.length = this.headerBuff[0] + (this.headerBuff[1] << 8) + (this.headerBuff[2] << 16); - this.headerLen = 0; - this.state = 'payload'; + while (end - start >= 3) { + this.length = readPacketLength(chunk, start); + if (end - start >= this.length + 4) { // at least one more full packet + this.onPacket(new Packet(chunk[start+3], chunk, start + 4, start + 4 + this.length)); + start += 4 + this.length; + } else { // payload is incomplete + this.buffer = [chunk.slice(start + 3, end)]; + this.bufferLength = end - start - 3; + this.execute = PacketParser.prototype.executePayload; + return; } } -}; + if (end - start > 0) { // there is start of length header, but it's not full 3 bytes + this.headerLen = end - start; // 1 or 2 bytes + this.length = chunk[start]; + if (this.headerLen == 2) { + this.length += chunk[start] >> 8; + this.execute = PacketParser.prototype.executeHeader3; + } else { + this.execute = PacketParser.prototype.executeHeader2; + } + } +} + +PacketParser.prototype.executePayload = function(chunk) { + var start = 0; + var end = chunk.length; + var remainingPayload = this.length - this.bufferLength + 1; + + if (end - start >= remainingPayload) { // last chunk for payload + var payload = new Buffer(this.length + 1); + var offset = 0; + for (var i=0; i < this.buffer.length; ++i) { + this.buffer[i].copy(payload, offset); + offset += this.buffer[i].length; + } + chunk.copy(payload, offset, start, start + remainingPayload); + this.onPacket(new Packet(payload[0], payload, 1, this.length + 1)); + this.buffer = []; + this.bufferLength = 0; + this.execute = PacketParser.prototype.executeStart; + start += remainingPayload; + if (end - start > 0) + return this.execute(chunk.slice(start, end)); + } else { + this.buffer.push(chunk); + this.bufferLength += chunk.length; + } +} + +PacketParser.prototype.executeHeader2 = function(chunk) { + this.length += chunk[0] >> 8; + if (chunk.length > 1) { + this.length += chunk[1] >> 16; + this.execute = PacketParser.prototype.executePayload; + return this.executePayload(chunk.slice(2)); + } else { + this.execute = PacketParser.prototype.executeHeader3; + } +} + +PacketParser.prototype.executeHeader3 = function(chunk) { + this.length += chunk[0] >> 16; + this.execute = PacketParser.prototype.executePayload; + return this.executePayload(chunk.slice(1)); +} module.exports = PacketParser; diff --git a/node_modules/mysql2/lib/packets/binlog_dump.js b/node_modules/mysql2/lib/packets/binlog_dump.js index b56baac..3ca14f9 100644 --- a/node_modules/mysql2/lib/packets/binlog_dump.js +++ b/node_modules/mysql2/lib/packets/binlog_dump.js @@ -20,7 +20,7 @@ BinlogDump.prototype.toPacket = function() var length = 15 + // TODO: should be ascii? Buffer.byteLength(this.filename, 'utf8'); var buffer = new Buffer(length); - var packet = new Packet(0, buffer); + var packet = new Packet(0, buffer, 0, length); packet.offset = 4; packet.writeInt8(CommandCodes.BINLOG_DUMP); packet.writeInt32(this.binlogPos); @@ -30,4 +30,4 @@ BinlogDump.prototype.toPacket = function() return packet; }; -module.exports = BinlogDump; \ No newline at end of file +module.exports = BinlogDump; diff --git a/node_modules/mysql2/lib/packets/change_user.js b/node_modules/mysql2/lib/packets/change_user.js new file mode 100644 index 0000000..d5888aa --- /dev/null +++ b/node_modules/mysql2/lib/packets/change_user.js @@ -0,0 +1,50 @@ +var CommandCode = require('../constants/commands.js'); +var Packet = require('../packets/packet.js'); + +var auth41 = require('../auth_41.js'); + +function ChangeUser(opts) +{ + this.user = opts.user || ''; + this.database = opts.database || ''; + this.password = opts.password || ''; + this.passwordSha1 = opts.passwordSha1; + this.authPluginData1 = opts.authPluginData1; + this.authPluginData2 = opts.authPluginData2; + var authToken; + if (this.passwordSha1) { + authToken = auth41.calculateTokenFromPasswordSha(this.passwordSha1, this.authPluginData1, this.authPluginData2); + } else { + authToken = auth41.calculateToken(this.password, this.authPluginData1, this.authPluginData2); + } + this.authToken = authToken; + this.charsetNumber = opts.charsetNumber; +} + +// TODO +//ChangeUser.fromPacket = function(packet) +//}; + +ChangeUser.prototype.toPacket = function() +{ + if (typeof this.user != 'string') + throw new Error('"user" connection config prperty must be a string'); + if (typeof this.database != 'string') + throw new Error('"database" connection config prperty must be a string'); + + var length = 4 + 1 + (1 + this.authToken.length) + (2 + this.user.length + this.database.length) + 2; + + var buffer = new Buffer(length); + var packet = new Packet(0, buffer, 0, length); + packet.offset = 4; + + packet.writeInt8(CommandCode.CHANGE_USER); + packet.writeNullTerminatedString(this.user); + packet.writeInt8(this.authToken.length); + packet.writeBuffer(this.authToken); + packet.writeNullTerminatedString(this.database); + packet.writeInt16(this.charsetNumber); + return packet; +}; + +module.exports = ChangeUser; diff --git a/node_modules/mysql2/lib/packets/close_statement.js b/node_modules/mysql2/lib/packets/close_statement.js new file mode 100644 index 0000000..5a51449 --- /dev/null +++ b/node_modules/mysql2/lib/packets/close_statement.js @@ -0,0 +1,19 @@ +var Packet = require('../packets/packet'); +var CommandCodes = require('../constants/commands'); + +function CloseStatement(id) +{ + this.id = id; +} + +// note: no response sent back +CloseStatement.prototype.toPacket = function() +{ + var packet = new Packet(0, new Buffer(9)); + packet.offset = 4; + packet.writeInt8(CommandCodes.STMT_CLOSE); + packet.writeInt32(this.id); + return packet; +}; + +module.exports = CloseStatement; diff --git a/node_modules/mysql2/lib/packets/column_definition.js b/node_modules/mysql2/lib/packets/column_definition.js index c27932c..7957d0c 100644 --- a/node_modules/mysql2/lib/packets/column_definition.js +++ b/node_modules/mysql2/lib/packets/column_definition.js @@ -1,13 +1,44 @@ var Packet = require('../packets/packet'); +// creating JS string is relatively expencive (compared to +// reading few bytes from buffer) because all string properties +// except for name are unlikely to be used we postpone +// string conversion until property access +// +// TODO: watch for integration benchmarks (one with real network buffer) +// there could be bad side effect as keeping reference to a buffer makes it +// sit in the memory longer (usually until final .query() callback) +// Latest v8 perform much better in regard to bugger -> string convertion, +// at some poinyt of time this optimisation might become unnecessary +// see https://github.com/sidorares/node-mysql2/pull/137 +// function ColumnDefinition(packet) { - this.catalog = packet.readLengthCodedString(); - this.schema = packet.readLengthCodedString(); - this.table = packet.readLengthCodedString(); - this.orgTable = packet.readLengthCodedString(); + this._buf = packet.buffer; + + this._catalogLength = packet.readLengthCodedNumber(); + this._catalogStart = packet.offset; + packet.offset += this._catalogLength; + + this._schemaLength = packet.readLengthCodedNumber(); + this._schemaStart = packet.offset; + packet.offset += this._schemaLength; + + this._tableLength = packet.readLengthCodedNumber(); + this._tableStart = packet.offset; + packet.offset += this._tableLength; + + this._orgTableLength = packet.readLengthCodedNumber(); + this._orgTableStart = packet.offset; + packet.offset += this._orgTableLength; + + // name is always used, don't make it lazy this.name = packet.readLengthCodedString(); - this.orgName = packet.readLengthCodedString(); + + this._orgNameLength = packet.readLengthCodedNumber(); + this._orgNameStart = packet.offset; + packet.offset += this._orgNameLength; + packet.skip(1); // length of the following fields (always 0x0c) this.characterSet = packet.readInt16(); this.columnLength = packet.readInt32(); @@ -16,6 +47,36 @@ function ColumnDefinition(packet) this.decimals = packet.readInt8(); } +var addString = function(name) { + Object.defineProperty(ColumnDefinition.prototype, name, { get: function() { + var start = this['_' + name + 'Start']; + var end = start + this['_' + name + 'Length']; + return this._buf.utf8Slice(start, end); + }}); +}; + +addString('catalog'); +addString('schema'); +addString('table'); +addString('orgTable'); +addString('orgName'); + +ColumnDefinition.prototype.inspect = function() { + return { + catalog : this.catalog, + schema : this.schema, + name : this.name, + orgName : this.orgName, + table : this.table, + orgTable : this.orgTable, + characterSet: this.characterSet, + columnLength: this.columnLength, + columnType : this.columnType, + flags : this.flags, + decimals : this.decimals + }; +}; + ColumnDefinition.toPacket = function(column, sequenceId) { var length = 0; @@ -31,7 +92,7 @@ ColumnDefinition.toPacket = function(column, sequenceId) function writeField(name) { packet.writeLengthCodedString(column[name]); } - var packet = new Packet(sequenceId, buffer); + var packet = new Packet(sequenceId, buffer, 0, length); packet.offset = 4; fields.forEach(writeField); packet.writeInt8 (0x0c); diff --git a/node_modules/mysql2/lib/packets/execute.js b/node_modules/mysql2/lib/packets/execute.js index 68a9c4e..b21f326 100644 --- a/node_modules/mysql2/lib/packets/execute.js +++ b/node_modules/mysql2/lib/packets/execute.js @@ -51,7 +51,7 @@ Execute.prototype.toPacket = function() } var buffer = new Buffer(length); - var packet = new Packet(0, buffer); + var packet = new Packet(0, buffer, 0, length); packet.offset = 4; packet.writeInt8(CommandCodes.STMT_EXECUTE); packet.writeInt32(this.id); diff --git a/node_modules/mysql2/lib/packets/handshake.js b/node_modules/mysql2/lib/packets/handshake.js index 0f8ee03..337338c 100644 --- a/node_modules/mysql2/lib/packets/handshake.js +++ b/node_modules/mysql2/lib/packets/handshake.js @@ -46,8 +46,8 @@ Handshake.prototype.setScrambleData = function(cb) { Handshake.prototype.toPacket = function(sequenceId) { var buffer, packet; var length = 68 + Buffer.byteLength(this.serverVersion, 'utf8'); - buffer = new Buffer(length+4); - packet = new Packet(sequenceId, buffer); + buffer = new Buffer(length + 4); + packet = new Packet(sequenceId, buffer, 0, length + 4); packet.offset = 4; packet.writeInt8(this.protocolVersion); packet.writeString(this.serverVersion); diff --git a/node_modules/mysql2/lib/packets/handshake_response.js b/node_modules/mysql2/lib/packets/handshake_response.js index ee7861b..cfc9359 100644 --- a/node_modules/mysql2/lib/packets/handshake_response.js +++ b/node_modules/mysql2/lib/packets/handshake_response.js @@ -1,54 +1,45 @@ -var ClientConstants = require('../constants/client'); -var Charsets = require('../constants/charsets'); -var crypto = require('crypto'); -var Packet = require('../packets/packet'); +var ClientConstants = require('../constants/client.js'); +var Charsets = require('../constants/charsets.js'); +var Packet = require('../packets/packet.js'); -function sha1(msg, msg1, msg2) { - var hash = crypto.createHash('sha1'); - hash.update(msg); - if (msg1) - hash.update(msg1); - if (msg2) - hash.update(msg2); - return hash.digest('binary'); -} - -function xor(a, b) { - if (!Buffer.isBuffer(a)) - a = new Buffer(a, 'binary'); - if (!Buffer.isBuffer(b)) - b = new Buffer(b, 'binary'); - var result = new Buffer(a.length); - for (var i = 0; i < a.length; i++) { - result[i] = (a[i] ^ b[i]); - } - return result; -} - -function token(password, scramble1, scramble2) { - var scramble = Buffer(scramble1.toString('binary') + scramble2.toString('binary')); - if (!password) { - return new Buffer(0); - } - var stage1 = sha1(Buffer(password, "utf8").toString('binary')); - var stage2 = sha1(stage1); - var stage3 = sha1(scramble1, scramble2, stage2); - return xor(stage3, stage1); -} +var auth41 = require('../auth_41.js'); function HandshakeResponse(handshake) { this.user = handshake.user || ''; this.database = handshake.database || ''; this.password = handshake.password || ''; + this.passwordSha1 = handshake.passwordSha1; this.authPluginData1 = handshake.authPluginData1; this.authPluginData2 = handshake.authPluginData2; this.compress = handshake.compress; this.clientFlags = handshake.flags; - this.authToken = token(this.password, this.authPluginData1, this.authPluginData2); + // TODO: pre-4.1 auth support + var authToken; + if (this.passwordSha1) + authToken = auth41.calculateTokenFromPasswordSha(this.passwordSha1, this.authPluginData1, this.authPluginData2); + else + authToken = auth41.calculateToken(this.password, this.authPluginData1, this.authPluginData2); + this.authToken = authToken; this.charsetNumber = handshake.charsetNumber; } +HandshakeResponse.fromPacket = function(packet) +{ + var args = {}; + //packet.skip(4); + args.clientFlags = packet.readInt32(); + args.maxPacketSize = packet.readInt32(); + args.charsetNumber = packet.readInt8(); + packet.skip(23); + args.user = packet.readNullTerminatedString(); + var authTokenLength = packet.readInt8(); + args.authToken = packet.readBuffer(authTokenLength); + args.database = packet.readNullTerminatedString(); + //return new HandshakeResponse(args); + return args; +}; + HandshakeResponse.prototype.toPacket = function() { if (typeof this.user != 'string') @@ -59,7 +50,7 @@ HandshakeResponse.prototype.toPacket = function() var length = 36 + 23 + this.user.length + this.database.length; var buffer = new Buffer(length); - var packet = new Packet(0, buffer); + var packet = new Packet(0, buffer, 0, length); buffer.fill(0); packet.offset = 4; diff --git a/node_modules/mysql2/lib/packets/index.js b/node_modules/mysql2/lib/packets/index.js index 0ccf978..a6464b9 100644 --- a/node_modules/mysql2/lib/packets/index.js +++ b/node_modules/mysql2/lib/packets/index.js @@ -1,5 +1,5 @@ -"binlog_dump register_slave ssl_request handshake handshake_response query resultset_header column_definition text_row binary_row prepare_statement prepared_statement_header execute".split(' ').forEach(function(name) { - var ctor = require('./' + name); +'binlog_dump register_slave ssl_request handshake handshake_response query resultset_header column_definition text_row binary_row prepare_statement close_statement prepared_statement_header execute change_user'.split(' ').forEach(function(name) { + var ctor = require('./' + name + '.js'); module.exports[ctor.name] = ctor; // monkey-patch it to include name if debug is on if (process.env.NODE_DEBUG) { @@ -16,6 +16,7 @@ // simple packets: var Packet = require('./packet'); +module.exports.Packet = Packet; module.exports.OK = function OK() { }; @@ -25,7 +26,7 @@ module.exports.OK.toPacket = function(args) { if (args.insertId) length += Packet.lengthCodedNumberLength(args.insertId); var buffer = new Buffer(length); - var packet = new Packet(0, buffer); + var packet = new Packet(0, buffer, 0, length); packet.offset = 4; packet.writeInt8(0); packet.writeLengthCodedNumber(args.affectedRows); @@ -44,7 +45,7 @@ module.exports.EOF.toPacket = function(warnings, statusFlags) { warnings = 0; if (typeof statusFlags == 'undefined') statusFlags = 0; - var packet = new Packet(0, new Buffer(9)); + var packet = new Packet(0, new Buffer(9), 0, 9); packet.offset = 4; packet.writeInt8(0xfe); packet.writeInt16(warnings); @@ -57,7 +58,8 @@ module.exports.Error = function Error() { }; module.exports.Error.toPacket = function(args) { - var packet = new Packet(0, new Buffer(13 + Buffer.byteLength(args.message, 'utf8'))); + var length = 13 + Buffer.byteLength(args.message, 'utf8'); + var packet = new Packet(0, new Buffer(length), 0, length); packet.offset = 4; packet.writeInt8(0xff); packet.writeInt16(args.code); diff --git a/node_modules/mysql2/lib/packets/packet.js b/node_modules/mysql2/lib/packets/packet.js index d53ea56..640b671 100644 --- a/node_modules/mysql2/lib/packets/packet.js +++ b/node_modules/mysql2/lib/packets/packet.js @@ -1,5 +1,5 @@ //var BigNumber = require("bignumber.js"); -var ErrorCodeToName = require('../constants/errors').codeToName; +var ErrorCodeToName = require('../constants/errors.js').codeToName; var bn = require('bn.js'); @@ -7,9 +7,9 @@ function Packet(id, buffer, start, end) { this.sequenceId = id; this.buffer = buffer; - this.offset = start || 0; - this.start = start || 0; - this.end = end || this.buffer.length; + this.start = start; + this.offset = start; + this.end = end; } // ============================== @@ -37,9 +37,7 @@ Packet.prototype.haveMoreData = function() { }; Packet.prototype.skip = function(num) { - if (!num) - throw "Bad param in skip!"; // for some reason I keep doing skip(0) to indicate "skip one byte which should be 0" - this.offset += num; + this.offset += num; }; Packet.prototype.readInt8 = function() @@ -105,18 +103,24 @@ Packet.prototype.eofWarningCount = function() { }; Packet.prototype.readLengthCodedNumber = function(bigNumberStrings) { + var byte1 = this.buffer[this.offset++]; + if (byte1 < 251) + return byte1; + return this.readLengthCodedNumberExt(byte1, bigNumberStrings); +} + +Packet.prototype.readLengthCodedNumberExt = function(tag, bigNumberStrings) { var word0, word1; var res; - var byte1 = this.readInt8(); - if (byte1 < 0xfb) - return byte1; - if (byte1 == 0xfc) { + if (tag == 0xfb) + return null; + if (tag == 0xfc) { return this.readInt8() + (this.readInt8() << 8); } - if (byte1 == 0xfd) { + if (tag == 0xfd) { return this.readInt8() + (this.readInt8() << 8) + (this.readInt8() << 16); } - if (byte1 == 0xfe) { + if (tag == 0xfe) { // TODO: check version // Up to MySQL 3.22, 0xfe was followed by a 4-byte integer. word0 = this.readInt32(); @@ -129,8 +133,6 @@ Packet.prototype.readLengthCodedNumber = function(bigNumberStrings) { res = (new bn(word1)).ishln(32).iaddn(word0); return bigNumberStrings ? res.toString() : res; } - if (byte1 == 0xfb) - return null; console.trace(); throw "Should not reach here: " + byte1; @@ -590,7 +592,7 @@ Packet.prototype.writeHeader = function(sequenceId) Packet.prototype.clone = function() { var buffer = this.buffer.slice(this.start, this.end); - var other = new Packet(this.sequenceId, this.buffer); + var other = new Packet(this.sequenceId, this.buffer, 0, this.buffer.length); return other; }; diff --git a/node_modules/mysql2/lib/packets/prepare_statement.js b/node_modules/mysql2/lib/packets/prepare_statement.js index c07aa79..009303b 100644 --- a/node_modules/mysql2/lib/packets/prepare_statement.js +++ b/node_modules/mysql2/lib/packets/prepare_statement.js @@ -10,7 +10,7 @@ PrepareStatement.prototype.toPacket = function() { var length = 5 + Buffer.byteLength(this.query, 'utf8'); var buffer = new Buffer(length); - var packet = new Packet(0, buffer); + var packet = new Packet(0, buffer, 0, length); packet.offset = 4; packet.writeInt8(CommandCodes.STMT_PREPARE); packet.writeString(this.query); diff --git a/node_modules/mysql2/lib/packets/query.js b/node_modules/mysql2/lib/packets/query.js index a42a881..9bb45b9 100644 --- a/node_modules/mysql2/lib/packets/query.js +++ b/node_modules/mysql2/lib/packets/query.js @@ -1,5 +1,5 @@ -var Packet = require('../packets/packet'); -var CommandCode = require('../constants/commands'); +var Packet = require('../packets/packet.js'); +var CommandCode = require('../constants/commands.js'); function Query(sql) { @@ -10,7 +10,7 @@ Query.prototype.toPacket = function() { var length = 5 + Buffer.byteLength(this.query, 'utf8'); var buffer = new Buffer(length); - var packet = new Packet(0, buffer); + var packet = new Packet(0, buffer, 0, length); packet.offset = 4; packet.writeInt8(CommandCode.QUERY); packet.writeString(this.query); diff --git a/node_modules/mysql2/lib/packets/register_slave.js b/node_modules/mysql2/lib/packets/register_slave.js index 808c8a2..bd16f40 100644 --- a/node_modules/mysql2/lib/packets/register_slave.js +++ b/node_modules/mysql2/lib/packets/register_slave.js @@ -22,7 +22,7 @@ RegisterSlave.prototype.toPacket = function() Buffer.byteLength(this.slaveUser, 'utf8') + Buffer.byteLength(this.slavePassword, 'utf8') + 3 + 4; var buffer = new Buffer(length); - var packet = new Packet(0, buffer); + var packet = new Packet(0, buffer, 0, length); packet.offset = 4; packet.writeInt8(CommandCodes.REGISTER_SLAVE); packet.writeInt32(this.serverId); @@ -34,7 +34,7 @@ RegisterSlave.prototype.toPacket = function() packet.writeString(this.slavePassword); packet.writeInt16(this.slavePort); packet.writeInt32(this.replicationRank); - packet.writeInt32(this.masterId); + packet.writeInt32(this.masterId); return packet; }; diff --git a/node_modules/mysql2/lib/packets/resultset_header.js b/node_modules/mysql2/lib/packets/resultset_header.js index c3b2c75..5715ff6 100644 --- a/node_modules/mysql2/lib/packets/resultset_header.js +++ b/node_modules/mysql2/lib/packets/resultset_header.js @@ -13,6 +13,9 @@ function ResultSetHeader(packet, bigNumberStrings) this.serverStatus = packet.readInt16(); this.warningStatus = packet.readInt16(); } + if (this.fieldCount === null) { + this.infileName = packet.readString(); + } // snippet from mysql-native: // res.affected_rows = this.lcnum(); @@ -29,7 +32,7 @@ ResultSetHeader.toPacket = function(fieldCount, insertId, sequenceId) { if (typeof(insertId) != 'undefined') length += Packet.lengthCodedNumberLength(insertId); var buffer = new Buffer(length); - var packet = new Packet(0, buffer); + var packet = new Packet(0, buffer, 0, length); packet.offset = 4; packet.writeLengthCodedNumber(fieldCount); if (typeof(insertId) != 'undefined') diff --git a/node_modules/mysql2/lib/packets/ssl_request.js b/node_modules/mysql2/lib/packets/ssl_request.js index 761a0d3..f65a90f 100644 --- a/node_modules/mysql2/lib/packets/ssl_request.js +++ b/node_modules/mysql2/lib/packets/ssl_request.js @@ -10,8 +10,8 @@ function SSLRequest(flags) SSLRequest.prototype.toPacket = function() { var length = 36; - var buffer = new Buffer(36); - var packet = new Packet(0, buffer); + var buffer = new Buffer(length); + var packet = new Packet(0, buffer, 0, length); buffer.fill(0); packet.offset = 4; diff --git a/node_modules/mysql2/lib/packets/text_row.js b/node_modules/mysql2/lib/packets/text_row.js index 44e2931..f6185ef 100644 --- a/node_modules/mysql2/lib/packets/text_row.js +++ b/node_modules/mysql2/lib/packets/text_row.js @@ -25,12 +25,12 @@ TextRow.toPacket = function(column) { length += str.length; }); buffer = new Buffer(length+4); - packet = new Packet(sequenceId, buffer); + packet = new Packet(sequenceId, buffer, 0, length+4); packet.offset = 4; column.forEach(function(val) { - if (val === null) return packet.writeNull(); - if (typeof val == 'undefined') return packet.writeInt8(0); - packet.writeLengthCodedString(val.toString(10)); + if (val === null) return packet.writeNull(); + if (typeof val == 'undefined') return packet.writeInt8(0); + packet.writeLengthCodedString(val.toString(10)); }); return packet; }; diff --git a/node_modules/mysql2/lib/pool.js b/node_modules/mysql2/lib/pool.js index c99097c..315e334 100644 --- a/node_modules/mysql2/lib/pool.js +++ b/node_modules/mysql2/lib/pool.js @@ -1,5 +1,4 @@ var mysql = require('../index.js'); -var Connection = mysql.Connection; var EventEmitter = require('events').EventEmitter; var Util = require('util'); diff --git a/node_modules/mysql2/lib/results_stream.js b/node_modules/mysql2/lib/results_stream.js index 5405243..de214fc 100644 --- a/node_modules/mysql2/lib/results_stream.js +++ b/node_modules/mysql2/lib/results_stream.js @@ -3,8 +3,7 @@ var Readable = require('stream').Readable; // copy-paste from https://github.com/felixge/node-mysql/blob/master/lib/protocol/sequences/Query.js module.exports = function (command, connectionStream) { command.stream = function(options) { - var self = this, - stream; + var stream; options = options || {}; options.objectMode = true; @@ -20,7 +19,7 @@ module.exports = function (command, connectionStream) { }); this.on("error",function(err) { - stream.emit('error',err); // Pass on any errors + stream.emit("error",err); // Pass on any errors }); this.on("end", function() { @@ -28,7 +27,7 @@ module.exports = function (command, connectionStream) { }); this.on("fields",function(fields,i) { - stream.emit('fields",fields',i); // replicate old emitter + stream.emit("fields",fields,i); // replicate old emitter }); return stream; diff --git a/node_modules/mysql2/lib/server.js b/node_modules/mysql2/lib/server.js index c632920..f05579e 100644 --- a/node_modules/mysql2/lib/server.js +++ b/node_modules/mysql2/lib/server.js @@ -2,9 +2,6 @@ var net = require('net'); var util = require('util'); var EventEmitter = require('events').EventEmitter; -var PacketParser = require('./packet_parser'); -var Packet = require('./packets/packet'); -var Commands = require('./commands/index.js'); var Connection = require('./connection'); var ConnectionConfig = require('./connection_config'); @@ -25,7 +22,10 @@ Server.prototype._handleConnection = function(socket) { }; Server.prototype.listen = function(port, host, backlog, callback) { - this._server.listen(port, host, backlog, callback); + this._server.listen.apply(this._server, arguments); + return this; }; + + module.exports = Server; diff --git a/node_modules/mysql2/lib/sql_string.js b/node_modules/mysql2/lib/sql_string.js index b7eb304..c9883da 100644 --- a/node_modules/mysql2/lib/sql_string.js +++ b/node_modules/mysql2/lib/sql_string.js @@ -1,6 +1,12 @@ var SqlString = exports; SqlString.escapeId = function (val, forbidQualified) { + if (Array.isArray(val)) { + return val.map(function(v) { + return SqlString.escapeId(v, forbidQualified); + }).join(', '); + } + if (forbidQualified) { return '`' + val.replace(/`/g, '``') + '`'; } @@ -18,7 +24,7 @@ SqlString.escape = function(val, stringifyObjects, timeZone) { } if (val instanceof Date) { - val = SqlString.dateToString(val, timeZone || "Z"); + val = SqlString.dateToString(val, timeZone || 'local'); } if (Buffer.isBuffer(val)) { @@ -53,13 +59,13 @@ SqlString.escape = function(val, stringifyObjects, timeZone) { SqlString.arrayToList = function(array, timeZone) { return array.map(function(v) { - if (Array.isArray(v)) return '(' + SqlString.arrayToList(v) + ')'; + if (Array.isArray(v)) return '(' + SqlString.arrayToList(v, timeZone) + ')'; return SqlString.escape(v, true, timeZone); }).join(', '); }; -SqlString.format = function(sql, values, timeZone) { - values = [].concat(values); +SqlString.format = function(sql, values, stringifyObjects, timeZone) { + values = values == null ? [] : [].concat(values); return sql.replace(/\?\??/g, function(match) { if (!values.length) { @@ -69,7 +75,7 @@ SqlString.format = function(sql, values, timeZone) { if (match == "??") { return SqlString.escapeId(values.shift()); } - return SqlString.escape(values.shift(), false, timeZone); + return SqlString.escape(values.shift(), stringifyObjects, timeZone); }); }; @@ -84,7 +90,7 @@ SqlString.dateToString = function(date, timeZone) { dt.setTime(dt.getTime() + (tz * 60000)); } } - + var year = dt.getFullYear(); var month = zeroPad(dt.getMonth() + 1, 2); var day = zeroPad(dt.getDate(), 2); @@ -96,19 +102,8 @@ SqlString.dateToString = function(date, timeZone) { return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second + '.' + millisecond; }; -SqlString.bufferToString = function(buffer) { - var hex = ''; - try { - hex = buffer.toString('hex'); - } catch (err) { - // node v0.4.x does not support hex / throws unknown encoding error - for (var i = 0; i < buffer.length; i++) { - var byte = buffer[i]; - hex += zeroPad(byte.toString(16)); - } - } - - return "X'" + hex+ "'"; +SqlString.bufferToString = function bufferToString(buffer) { + return "X'" + buffer.toString('hex') + "'"; }; SqlString.objectToValues = function(object, timeZone) { diff --git a/node_modules/mysql2/load.js b/node_modules/mysql2/load.js new file mode 100644 index 0000000..fe3753d --- /dev/null +++ b/node_modules/mysql2/load.js @@ -0,0 +1,5 @@ +var mysql = require('./index.js'); + +var c = mysql.createConnection({user: 'root', debug: 1, database: 'test'}); +//c.query('select 1+1 into outfile ?', [ process.stdout ], console.log); +c.query('LOAD DATA LOCAL INFILE "/tmp/ttt.csv" INTO TABLE insert_test', console.log); diff --git a/node_modules/mysql2/node_modules/bn.js/1.js b/node_modules/mysql2/node_modules/bn.js/1.js deleted file mode 100644 index a9eac63..0000000 --- a/node_modules/mysql2/node_modules/bn.js/1.js +++ /dev/null @@ -1,17 +0,0 @@ -var bn = require('./'); - -var p = new bn('ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f', 16); -var a = new bn('79be667e f9dcbbac 55a06295 ce870b07 029bfcdb 2dce28d9 59f2815b 16f81798', 16); - -var c = a.sqr(); -var m = bn.red('p25519'); -var am = a.toRed(m); - -var t = 0; -console.log(a.sqr()); -console.time('montSqr'); -for (var i = 0; i < 1000000; i++) { - t += am.redSqr().length; -} -console.timeEnd('montSqr'); -console.log(t); diff --git a/node_modules/mysql2/node_modules/bn.js/lib/bn.js b/node_modules/mysql2/node_modules/bn.js/lib/bn.js index 05d14f9..cc3b6ef 100644 --- a/node_modules/mysql2/node_modules/bn.js/lib/bn.js +++ b/node_modules/mysql2/node_modules/bn.js/lib/bn.js @@ -22,7 +22,7 @@ function inherits(ctor, superCtor) { // BN -function BN(number, base) { +function BN(number, base, endian) { // May be `new BN(bn)` ? if (number !== null && typeof number === 'object' && @@ -37,49 +37,43 @@ function BN(number, base) { // Reduction context this.red = null; + if (base === 'le' || base === 'be') { + endian = base; + base = 10; + } + if (number !== null) - this._init(number || 0, base || 10); + this._init(number || 0, base || 10, endian || 'be'); } -module.exports = BN; +if (typeof module === 'object') + module.exports = BN; BN.BN = BN; BN.wordSize = 26; -BN.prototype._init = function init(number, base) { +BN.prototype._init = function init(number, base, endian) { if (typeof number === 'number') { if (number < 0) { this.sign = true; number = -number; } - this.words = [ number & 0x3ffffff ]; - this.length = 1; + if (number < 0x4000000) { + this.words = [ number & 0x3ffffff ]; + this.length = 1; + } else { + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff + ]; + this.length = 2; + } return; } else if (typeof number === 'object') { - // Perhaps a Uint8Array - assert(typeof number.length === 'number'); - this.length = Math.ceil(number.length / 3); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) - this.words[i] = 0; - - // Assume big-endian - var off = 0; - for (var i = number.length - 1, j = 0; i >= 0; i -= 3) { - var w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - - return this.strip(); + return this._initArray(number, base, endian); } if (base === 'hex') base = 16; - assert(base <= 16); + assert(base === (base | 0) && base >= 2 && base <= 36); number = number.toString().replace(/\s+/g, ''); var start = 0; @@ -97,6 +91,41 @@ BN.prototype._init = function init(number, base) { this.strip(); }; +BN.prototype._initArray = function _initArray(number, base, endian) { + // Perhaps a Uint8Array + assert(typeof number.length === 'number'); + this.length = Math.ceil(number.length / 3); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) + this.words[i] = 0; + + var off = 0; + if (endian === 'be') { + for (var i = number.length - 1, j = 0; i >= 0; i -= 3) { + var w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } else if (endian === 'le') { + for (var i = 0, j = 0; i < number.length; i += 3) { + var w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } + return this.strip(); +}; + BN.prototype._parseHex = function parseHex(number, start) { // Create possibly bigger array to ensure that it fits the number this.length = Math.ceil((number.length - start) / 6); @@ -198,67 +227,96 @@ BN.prototype.inspect = function inspect() { }; /* -function _zero(n) { - var code = ''; - for (var i = n - 1; i > 0; i--) { - var pad = ''; - for (var j = 0; j < n - i; j++) - pad += '0'; - code += 'if (w.length === ' + i + ') return \'' + pad + '\' + w;\n'; - } - code += 'return w'; - return new Function('w', code); +var zeros = []; +var groupSizes = []; +var groupBases = []; + +var s = ''; +var i = -1; +while (++i < BN.wordSize) { + zeros[i] = s; + s += '0'; +} +groupSizes[0] = 0; +groupSizes[1] = 0; +groupBases[0] = 0; +groupBases[1] = 0; +var base = 2 - 1; +while (++base < 36 + 1) { + var groupSize = 0; + var groupBase = 1; + // TODO: <= + while (groupBase < (1 << BN.wordSize) / base) { + groupBase *= base; + groupSize += 1; + } + groupSizes[base] = groupSize; + groupBases[base] = groupBase; } -var zero6 = _zero(6); -var zero14 = _zero(14); */ -// Sadly chrome apps could not contain `new Function()` calls -function zero6(w) { - if (w.length === 5) return '0' + w; - if (w.length === 4) return '00' + w; - if (w.length === 3) return '000' + w; - if (w.length === 2) return '0000' + w; - if (w.length === 1) return '00000' + w; - return w; -} +var zeros = [ + '', + '0', + '00', + '000', + '0000', + '00000', + '000000', + '0000000', + '00000000', + '000000000', + '0000000000', + '00000000000', + '000000000000', + '0000000000000', + '00000000000000', + '000000000000000', + '0000000000000000', + '00000000000000000', + '000000000000000000', + '0000000000000000000', + '00000000000000000000', + '000000000000000000000', + '0000000000000000000000', + '00000000000000000000000', + '000000000000000000000000', + '0000000000000000000000000' +]; -function zero14(w) { - if (w.length === 13) return '0' + w; - if (w.length === 12) return '00' + w; - if (w.length === 11) return '000' + w; - if (w.length === 10) return '0000' + w; - if (w.length === 9) return '00000' + w; - if (w.length === 8) return '000000' + w; - if (w.length === 7) return '0000000' + w; - if (w.length === 6) return '00000000' + w; - if (w.length === 5) return '000000000' + w; - if (w.length === 4) return '0000000000' + w; - if (w.length === 3) return '00000000000' + w; - if (w.length === 2) return '000000000000' + w; - if (w.length === 1) return '0000000000000' + w; - return w; -} +var groupSizes = [ + 0, 0, + 25, 16, 12, 11, 10, 9, 8, + 8, 7, 7, 7, 7, 6, 6, + 6, 6, 6, 6, 6, 5, 5, + 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5 +]; -// Precomputed divisor for `.toString(10)` = 10 ^ 14 -var div10 = new BN(null); -div10.words = [ 0x7a4000, 0x16bcc4 ]; -div10.length = 2; +var groupBases = [ + 0, 0, + 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, + 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, + 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, + 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, + 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 +]; -BN.prototype.toString = function toString(base) { +BN.prototype.toString = function toString(base, padding) { base = base || 10; if (base === 16 || base === 'hex') { var out = ''; var off = 0; + var padding = padding | 0 || 1; var carry = 0; for (var i = 0; i < this.length; i++) { var w = this.words[i]; var word = (((w << off) | carry) & 0xffffff).toString(16); carry = (w >>> (24 - off)) & 0xffffff; if (carry !== 0 || i !== this.length - 1) - out = zero6(word) + out; + out = zeros[6 - word.length] + word + out; else out = word + out; off += 2; @@ -269,19 +327,25 @@ BN.prototype.toString = function toString(base) { } if (carry !== 0) out = carry.toString(16) + out; + while (out.length % padding !== 0) + out = '0' + out; if (this.sign) out = '-' + out; return out; - } else if (base === 10) { + } else if (base === (base | 0) && base >= 2 && base <= 36) { + // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); + var groupSize = groupSizes[base]; + // var groupBase = Math.pow(base, groupSize); + var groupBase = groupBases[base]; var out = ''; var c = this.clone(); c.sign = false; while (c.cmpn(0) !== 0) { - var r = c.modn(1000000); - c = c.idivn(1000000); + var r = c.modn(groupBase).toString(base); + c = c.idivn(groupBase); if (c.cmpn(0) !== 0) - out = zero6(r + '') + out; + out = zeros[groupSize - r.length] + r + out; else out = r + out; } @@ -291,7 +355,7 @@ BN.prototype.toString = function toString(base) { out = '-' + out; return out; } else { - assert(false, 'Only 16 and 10 base are supported'); + assert(false, 'Base should be between 2 and 36'); } }; @@ -573,8 +637,7 @@ function _genCombMulTo(alen, blen) { } */ -// Multiply `this` by `num` and store data in out -BN.prototype.mulTo = function mulTo(num, out) { +BN.prototype._smallMulTo = function _smallMulTo(num, out) { out.sign = num.sign !== this.sign; out.length = this.length + num.length; @@ -587,15 +650,15 @@ BN.prototype.mulTo = function mulTo(num, out) { var maxJ = Math.min(k, num.length - 1); for (var j = Math.max(0, k - this.length + 1); j <= maxJ; j++) { var i = k - j; - var a = this.words[i]; - var b = num.words[j]; + var a = this.words[i] | 0; + var b = num.words[j] | 0; var r = a * b; var lo = r & 0x3ffffff; - ncarry += (r / 0x4000000) | 0; - lo += rword; + ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; + lo = (lo + rword) | 0; rword = lo & 0x3ffffff; - ncarry += lo >>> 26; + ncarry = (ncarry + (lo >>> 26)) | 0; } out.words[k] = rword; carry = ncarry; @@ -609,6 +672,56 @@ BN.prototype.mulTo = function mulTo(num, out) { return out.strip(); }; +BN.prototype._bigMulTo = function _bigMulTo(num, out) { + out.sign = num.sign !== this.sign; + out.length = this.length + num.length; + + var carry = 0; + var hncarry = 0; + for (var k = 0; k < out.length - 1; k++) { + // Sum all words with the same `i + j = k` and accumulate `ncarry`, + // note that ncarry could be >= 0x3ffffff + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 0x3ffffff; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - this.length + 1); j <= maxJ; j++) { + var i = k - j; + var a = this.words[i] | 0; + var b = num.words[j] | 0; + var r = a * b; + + var lo = r & 0x3ffffff; + ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; + lo = (lo + rword) | 0; + rword = lo & 0x3ffffff; + ncarry = (ncarry + (lo >>> 26)) | 0; + + hncarry += ncarry >>> 26; + ncarry &= 0x3ffffff; + } + out.words[k] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k] = carry; + } else { + out.length--; + } + + return out.strip(); +}; + +BN.prototype.mulTo = function mulTo(num, out) { + var res; + if (this.length + num.length < 63) + res = this._smallMulTo(num, out); + else + res = this._bigMulTo(num, out); + return res; +}; + // Multiply `this` by `num` BN.prototype.mul = function mul(num) { var out = new BN(null); @@ -778,6 +891,24 @@ BN.prototype.shrn = function shrn(bits) { return this.clone().ishrn(bits); }; +// Test if n bit is set +BN.prototype.testn = function testn(bit) { + assert(typeof bit === 'number' && bit >= 0); + var r = bit % 26; + var s = (bit - r) / 26; + var q = 1 << r; + + // Fast case: bit is much higher than all existing words + if (this.length <= s) { + return false; + } + + // Check bit and return + var w = this.words[s]; + + return !!(w & q); +}; + // Return only lowers bits of number (in-place) BN.prototype.imaskn = function imaskn(bits) { assert(typeof bits === 'number' && bits >= 0); @@ -807,7 +938,21 @@ BN.prototype.maskn = function maskn(bits) { BN.prototype.iaddn = function iaddn(num) { assert(typeof num === 'number'); if (num < 0) - return this.isubn(num); + return this.isubn(-num); + + // Possible sign change + if (this.sign) { + if (this.length === 1 && this.words[0] < num) { + this.words[0] = num - this.words[0]; + this.sign = false; + return this; + } + + this.sign = false; + this.isubn(num); + this.sign = true; + return this; + } this.words[0] += num; // Carry @@ -826,9 +971,16 @@ BN.prototype.iaddn = function iaddn(num) { // Subtract plain number `num` from `this` BN.prototype.isubn = function isubn(num) { assert(typeof num === 'number'); - assert(this.cmpn(num) >= 0, 'Sign change is not supported in isubn'); if (num < 0) return this.iaddn(-num); + + if (this.sign) { + this.sign = false; + this.iaddn(num); + this.sign = true; + return this; + } + this.words[0] -= num; // Carry @@ -848,6 +1000,16 @@ BN.prototype.subn = function subn(num) { return this.clone().isubn(num); }; +BN.prototype.iabs = function iabs() { + this.sign = false; + + return this +}; + +BN.prototype.abs = function abs() { + return this.clone().iabs(); +}; + BN.prototype._wordDiv = function _wordDiv(num, mode) { var shift = this.length - num.length; @@ -1035,20 +1197,23 @@ BN.prototype._egcd = function _egcd(x1, p) { a = a.clone(); var x2 = new BN(0); + while (b.isEven()) + b.ishrn(1); + var delta = b.clone(); while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { while (a.isEven()) { a.ishrn(1); if (x1.isEven()) x1.ishrn(1); else - x1.iadd(p).ishrn(1); + x1.iadd(delta).ishrn(1); } while (b.isEven()) { b.ishrn(1); if (x2.isEven()) x2.ishrn(1); else - x2.iadd(p).ishrn(1); + x2.iadd(delta).ishrn(1); } if (a.cmp(b) >= 0) { a.isub(b); @@ -1064,6 +1229,44 @@ BN.prototype._egcd = function _egcd(x1, p) { return x2; }; +BN.prototype.gcd = function gcd(num) { + if (this.cmpn(0) === 0) + return num.clone(); + if (num.cmpn(0) === 0) + return this.clone(); + + var a = this.clone(); + var b = num.clone(); + a.sign = false; + b.sign = false; + + // Remove common factor of two + for (var shift = 0; a.isEven() && b.isEven(); shift++) { + a.ishrn(1); + b.ishrn(1); + } + + while (a.isEven()) + a.ishrn(1); + + do { + while (b.isEven()) + b.ishrn(1); + + // Swap `a` and `b` to make `a` always bigger than `b` + if (a.cmp(b) < 0) { + var t = a; + a = b; + b = t; + } + a.isub(a.div(b).mul(b)); + } while (a.cmpn(0) !== 0 && b.cmpn(0) !== 0); + if (a.cmpn(0) === 0) + return b.ishln(shift); + else + return a.ishln(shift); +}; + // Invert number in the field F(num) BN.prototype.invm = function invm(num) { return this._egcd(new BN(1), num).mod(num); diff --git a/node_modules/mysql2/node_modules/bn.js/package.json b/node_modules/mysql2/node_modules/bn.js/package.json index 82514ee..fa3405f 100644 --- a/node_modules/mysql2/node_modules/bn.js/package.json +++ b/node_modules/mysql2/node_modules/bn.js/package.json @@ -1,6 +1,6 @@ { "name": "bn.js", - "version": "0.11.7", + "version": "0.16.0", "description": "Big number implementation in pure javascript", "main": "lib/bn.js", "scripts": { @@ -29,10 +29,12 @@ "devDependencies": { "mocha": "^1.18.2" }, - "_id": "bn.js@0.11.7", - "_shasum": "7c5be037ccd45afc3136c7af92466c93d4ce5a56", - "_from": "bn.js@0.11.7", - "_npmVersion": "1.4.9", + "gitHead": "c6e4bd0744d4cf913071ae3ece7942e253dabd56", + "_id": "bn.js@0.16.0", + "_shasum": "5b6f7ea86ec2f8e065dee2b4d5f1540314bf523e", + "_from": "bn.js@0.16.0", + "_npmVersion": "2.1.6", + "_nodeVersion": "0.10.33", "_npmUser": { "name": "indutny", "email": "fedor@indutny.com" @@ -44,9 +46,10 @@ } ], "dist": { - "shasum": "7c5be037ccd45afc3136c7af92466c93d4ce5a56", - "tarball": "http://registry.npmjs.org/bn.js/-/bn.js-0.11.7.tgz" + "shasum": "5b6f7ea86ec2f8e065dee2b4d5f1540314bf523e", + "tarball": "http://registry.npmjs.org/bn.js/-/bn.js-0.16.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/bn.js/-/bn.js-0.11.7.tgz" + "_resolved": "https://registry.npmjs.org/bn.js/-/bn.js-0.16.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/mysql2/node_modules/bn.js/test/bn-test.js b/node_modules/mysql2/node_modules/bn.js/test/bn-test.js index 9965f43..1823b5f 100644 --- a/node_modules/mysql2/node_modules/bn.js/test/bn-test.js +++ b/node_modules/mysql2/node_modules/bn.js/test/bn-test.js @@ -1,9 +1,11 @@ var assert = require('assert'); var BN = require('../').BN; +var fixtures = require('./fixtures'); describe('BN', function() { it('should work with Number input', function() { assert.equal(new BN(12345).toString(16), '3039'); + assert.equal(new BN(0x4123456).toString(16), '4123456'); }); it('should work with String input', function() { @@ -24,6 +26,10 @@ describe('BN', function() { assert.equal(new BN('10654321').toString(), '10654321'); assert.equal(new BN('10000000000000000').toString(10), '10000000000000000'); + var base2 = '11111111111111111111111111111111111111111111111111111'; + assert.equal(new BN(base2, 2).toString(2), base2); + var base36 = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'; + assert.equal(new BN(base36, 36).toString(36), base36); }); it('should import/export big endian', function() { @@ -36,6 +42,13 @@ describe('BN', function() { '1,2,3,4,5,6,7,8'); }); + it('should import little endian', function() { + assert.equal(new BN([1,2,3], 10, 'le').toString(16), '30201'); + assert.equal(new BN([1,2,3,4], 10, 'le').toString(16), '4030201'); + assert.equal(new BN([1,2,3,4,5], 10, 'le').toString(16), '504030201'); + assert.equal(new BN([1,2,3,4,5,6,7,8], 10, 'le').toString(16), '807060504030201'); + }); + it('should return proper bitLength', function() { assert.equal(new BN(0).bitLength(), 0); assert.equal(new BN(0x1).bitLength(), 1); @@ -65,6 +78,54 @@ describe('BN', function() { assert.equal(r.toString(16), 'ac79bd9b79be7a277bde'); }); + describe('hex padding', function(){ + it('should have length of 8 from leading 15', function(){ + var a = new BN('ffb9602', 16); + var b = new Buffer(a.toString('hex', 2), 'hex'); + assert.equal(a.toString('hex', 2).length, 8); + }); + + it('should have length of 8 from leading zero', function(){ + var a = new BN('fb9604', 16); + var b = new Buffer(a.toString('hex', 8), 'hex'); + assert.equal(a.toString('hex', 8).length, 8); + }); + + it('should have length of 8 from leading zeros', function(){ + var a = new BN(0); + var b = new Buffer(a.toString('hex', 8), 'hex'); + assert.equal(a.toString('hex', 8).length, 8); + }); + + it('should have length of 64 from leading 15', function(){ + var a = new BN( + 'ffb96ff654e61130ba8422f0debca77a0ea74ae5ea8bca9b54ab64aabf01003', + 16); + var b = new Buffer(a.toString('hex', 2), 'hex'); + assert.equal(a.toString('hex', 2).length, 64); + }); + + it('should have length of 64 from leading zero', function(){ + var a = new BN( + 'fb96ff654e61130ba8422f0debca77a0ea74ae5ea8bca9b54ab64aabf01003', + 16); + var b = new Buffer(a.toString('hex', 64), 'hex'); + assert.equal(a.toString('hex', 64).length, 64); + }); + }); + + describe('iaddn', function() { + it('should allow a sign change', function() { + var a = new BN(-100) + assert.equal(a.sign, true) + + a.iaddn(200) + + assert.equal(a.sign, false) + assert.equal(a.toString(), '100') + }) + }) + it('should subtract numbers', function() { assert.equal(new BN(14).sub(new BN(26)).toString(16), '-c'); assert.equal(new BN(26).sub(new BN(14)).toString(16), 'c'); @@ -105,6 +166,26 @@ describe('BN', function() { assert.equal(b.isub(a).toString(16), 'fffffffedcbb'); }); + describe('isubn', function() { + it('should work for positive numbers', function() { + var a = new BN(-100) + assert.equal(a.sign, true) + + a.isubn(200) + assert.equal(a.sign, true) + assert.equal(a.toString(), '-300') + }) + + it('should not allow a sign change', function() { + var a = new BN(-100) + assert.equal(a.sign, true) + + a.isubn(-200); + assert.equal(a.sign, false) + assert.equal(a.toString(), '100') + }) + }) + it('should mul numbers', function() { assert.equal(new BN(0x1001).mul(new BN(0x1234)).toString(16), '1235234'); @@ -139,6 +220,14 @@ describe('BN', function() { ); }); + it('should regress mul big numbers', function() { + var q = fixtures.dhGroups.p17.q; + var qs = fixtures.dhGroups.p17.qs; + + var q = new BN(q, 16); + assert.equal(q.sqr().toString(16), qs); + }); + it('should imul numbers', function() { var a = new BN('abcdef01234567890abcd', 16); var b = new BN('deadbeefa551edebabba8', 16); @@ -235,6 +324,12 @@ describe('BN', function() { '-8'); }); + it('should absolute numbers', function() { + assert.equal(new BN(0x1001).abs().toString(), '4097'); + assert.equal(new BN(-0x1001).abs().toString(), '4097'); + assert.equal(new BN('ffffffff', 16).abs().toString(), '4294967295'); + }) + it('should modn numbers', function() { assert.equal(new BN('10', 16).modn(256).toString(16), '10'); assert.equal(new BN('100', 16).modn(256).toString(16), '0'); @@ -287,6 +382,12 @@ describe('BN', function() { var a = new BN('deadbeef', 16); var b = a.invm(p192); assert.equal(a.mul(b).mod(p192).toString(16), '1'); + + // Even base + var phi = new BN('872d9b030ba368706b68932cf07a0e0c', 16); + var e = new BN(65537); + var d = e.invm(phi); + assert.equal(e.mul(d).mod(phi).toString(16), '1'); }); it('should support bincn', function() { @@ -304,4 +405,40 @@ describe('BN', function() { assert.equal(new BN('123456789', 16).imaskn(16).toString(16), '6789'); assert.equal(new BN('123456789', 16).imaskn(28).toString(16), '3456789'); }); + + it('should support testn', function() { + [ + 'ff', + 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' + ].forEach(function(hex) { + var bn = new BN(hex, 16) + var bl = bn.bitLength() + + for (var i = 0; i < bl; ++i) { + assert.equal(bn.testn(i), true); + } + + // test off the end + assert.equal(bn.testn(bl), false); + }) + + var xbits = [ + '01111001010111001001000100011101110100111011000110001110010111011001010', + '01110000000010110001111010101111100111110010001111000001001011010100111', + '01000101001100010001101001011110100001001111100110001110010111' + ].join('') + + var x = new BN( + '23478905234580795234378912401239784125643978256123048348957342' + ) + for (var i = 0; i < x.bitLength(); ++i) { + assert.equal(x.testn(i), (xbits.charAt(i) === '1'), 'Failed @ bit ' + i) + } + }); + + it('should support gcd', function() { + assert.equal(new BN(3).gcd(new BN(2)).toString(16), '1'); + assert.equal(new BN(18).gcd(new BN(12)).toString(16), '6'); + assert.equal(new BN(-18).gcd(new BN(12)).toString(16), '6'); + }); }); diff --git a/node_modules/mysql2/node_modules/bn.js/test/fixtures.js b/node_modules/mysql2/node_modules/bn.js/test/fixtures.js new file mode 100644 index 0000000..29442d9 --- /dev/null +++ b/node_modules/mysql2/node_modules/bn.js/test/fixtures.js @@ -0,0 +1,264 @@ +exports.dhGroups = { + p16: { + prime: 'ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd1' + + '29024e088a67cc74020bbea63b139b22514a08798e3404dd' + + 'ef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245' + + 'e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7ed' + + 'ee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3d' + + 'c2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f' + + '83655d23dca3ad961c62f356208552bb9ed529077096966d' + + '670c354e4abc9804f1746c08ca18217c32905e462e36ce3b' + + 'e39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9' + + 'de2bcbf6955817183995497cea956ae515d2261898fa0510' + + '15728e5a8aaac42dad33170d04507a33a85521abdf1cba64' + + 'ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7' + + 'abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6b' + + 'f12ffa06d98a0864d87602733ec86a64521f2b18177b200c' + + 'bbe117577a615d6c770988c0bad946e208e24fa074e5ab31' + + '43db5bfce0fd108e4b82d120a92108011a723c12a787e6d7' + + '88719a10bdba5b2699c327186af4e23c1a946834b6150bda' + + '2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6' + + '287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed' + + '1f612970cee2d7afb81bdd762170481cd0069127d5b05aa9' + + '93b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199' + + 'ffffffffffffffff', + priv: '6d5923e6449122cbbcc1b96093e0b7e4fd3e469f58daddae' + + '53b49b20664f4132675df9ce98ae0cfdcac0f4181ccb643b' + + '625f98104dcf6f7d8e81961e2cab4b5014895260cb977c7d' + + '2f981f8532fb5da60b3676dfe57f293f05d525866053ac7e' + + '65abfd19241146e92e64f309a97ef3b529af4d6189fa416c' + + '9e1a816c3bdf88e5edf48fbd8233ef9038bb46faa95122c0' + + '5a426be72039639cd2d53d37254b3d258960dcb33c255ede' + + '20e9d7b4b123c8b4f4b986f53cdd510d042166f7dd7dca98' + + '7c39ab36381ba30a5fdd027eb6128d2ef8e5802a2194d422' + + 'b05fe6e1cb4817789b923d8636c1ec4b7601c90da3ddc178' + + '52f59217ae070d87f2e75cbfb6ff92430ad26a71c8373452' + + 'ae1cc5c93350e2d7b87e0acfeba401aaf518580937bf0b6c' + + '341f8c49165a47e49ce50853989d07171c00f43dcddddf72' + + '94fb9c3f4e1124e98ef656b797ef48974ddcd43a21fa06d0' + + '565ae8ce494747ce9e0ea0166e76eb45279e5c6471db7df8' + + 'cc88764be29666de9c545e72da36da2f7a352fb17bdeb982' + + 'a6dc0193ec4bf00b2e533efd6cd4d46e6fb237b775615576' + + 'dd6c7c7bbc087a25e6909d1ebc6e5b38e5c8472c0fc429c6' + + 'f17da1838cbcd9bbef57c5b5522fd6053e62ba21fe97c826' + + 'd3889d0cc17e5fa00b54d8d9f0f46fb523698af965950f4b' + + '941369e180f0aece3870d9335f2301db251595d173902cad' + + '394eaa6ffef8be6c', + pub: 'd53703b7340bc89bfc47176d351e5cf86d5a18d9662eca3c' + + '9759c83b6ccda8859649a5866524d77f79e501db923416ca' + + '2636243836d3e6df752defc0fb19cc386e3ae48ad647753f' + + 'bf415e2612f8a9fd01efe7aca249589590c7e6a0332630bb' + + '29c5b3501265d720213790556f0f1d114a9e2071be3620bd' + + '4ee1e8bb96689ac9e226f0a4203025f0267adc273a43582b' + + '00b70b490343529eaec4dcff140773cd6654658517f51193' + + '13f21f0a8e04fe7d7b21ffeca85ff8f87c42bb8d9cb13a72' + + 'c00e9c6e9dfcedda0777af951cc8ccab90d35e915e707d8e' + + '4c2aca219547dd78e9a1a0730accdc9ad0b854e51edd1e91' + + '4756760bab156ca6e3cb9c625cf0870def34e9ac2e552800' + + 'd6ce506d43dbbc75acfa0c8d8fb12daa3c783fb726f187d5' + + '58131779239c912d389d0511e0f3a81969d12aeee670e48f' + + 'ba41f7ed9f10705543689c2506b976a8ffabed45e33795b0' + + '1df4f6b993a33d1deab1316a67419afa31fbb6fdd252ee8c' + + '7c7d1d016c44e3fcf6b41898d7f206aa33760b505e4eff2e' + + 'c624bc7fe636b1d59e45d6f904fc391419f13d1f0cdb5b6c' + + '2378b09434159917dde709f8a6b5dc30994d056e3f964371' + + '11587ac7af0a442b8367a7bd940f752ddabf31cf01171e24' + + 'd78df136e9681cd974ce4f858a5fb6efd3234a91857bb52d' + + '9e7b414a8bc66db4b5a73bbeccfb6eb764b4f0cbf0375136' + + 'b024b04e698d54a5' + }, + p17: { + prime: 'ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd1' + + '29024e088a67cc74020bbea63b139b22514a08798e3404dd' + + 'ef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245' + + 'e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7ed' + + 'ee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3d' + + 'c2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f' + + '83655d23dca3ad961c62f356208552bb9ed529077096966d' + + '670c354e4abc9804f1746c08ca18217c32905e462e36ce3b' + + 'e39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9' + + 'de2bcbf6955817183995497cea956ae515d2261898fa0510' + + '15728e5a8aaac42dad33170d04507a33a85521abdf1cba64' + + 'ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7' + + 'abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6b' + + 'f12ffa06d98a0864d87602733ec86a64521f2b18177b200c' + + 'bbe117577a615d6c770988c0bad946e208e24fa074e5ab31' + + '43db5bfce0fd108e4b82d120a92108011a723c12a787e6d7' + + '88719a10bdba5b2699c327186af4e23c1a946834b6150bda' + + '2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6' + + '287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed' + + '1f612970cee2d7afb81bdd762170481cd0069127d5b05aa9' + + '93b4ea988d8fddc186ffb7dc90a6c08f4df435c934028492' + + '36c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bd' + + 'f8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831' + + '179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1b' + + 'db7f1447e6cc254b332051512bd7af426fb8f401378cd2bf' + + '5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6' + + 'd55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f3' + + '23a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aa' + + 'cc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be328' + + '06a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55c' + + 'da56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee' + + '12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff', + priv: '6017f2bc23e1caff5b0a8b4e1fc72422b5204415787801dc' + + '025762b8dbb98ab57603aaaa27c4e6bdf742b4a1726b9375' + + 'a8ca3cf07771779589831d8bd18ddeb79c43e7e77d433950' + + 'e652e49df35b11fa09644874d71d62fdaffb580816c2c88c' + + '2c4a2eefd4a660360316741b05a15a2e37f236692ad3c463' + + 'fff559938fc6b77176e84e1bb47fb41af691c5eb7bb81bd8' + + 'c918f52625a1128f754b08f5a1403b84667231c4dfe07ed4' + + '326234c113931ce606037e960f35a2dfdec38a5f057884d3' + + '0af8fab3be39c1eeb390205fd65982191fc21d5aa30ddf51' + + 'a8e1c58c0c19fc4b4a7380ea9e836aaf671c90c29bc4bcc7' + + '813811aa436a7a9005de9b507957c56a9caa1351b6efc620' + + '7225a18f6e97f830fb6a8c4f03b82f4611e67ab9497b9271' + + 'd6ac252793cc3e5538990dbd894d2dbc2d152801937d9f74' + + 'da4b741b50b4d40e4c75e2ac163f7b397fd555648b249f97' + + 'ffe58ffb6d096aa84534c4c5729cff137759bd34e80db4ab' + + '47e2b9c52064e7f0bf677f72ac9e5d0c6606943683f9d12f' + + '180cf065a5cb8ec3179a874f358847a907f8471d15f1e728' + + '7023249d6d13c82da52628654438f47b8b5cdf4761fbf6ad' + + '9219eceac657dbd06cf2ab776ad4c968f81c3d039367f0a4' + + 'd77c7ec4435c27b6c147071665100063b5666e06eb2fb2cc' + + '3159ba34bc98ca346342195f6f1fb053ddc3bc1873564d40' + + '1c6738cdf764d6e1ff25ca5926f80102ea6593c17170966b' + + 'b5d7352dd7fb821230237ea3ebed1f920feaadbd21be295a' + + '69f2083deae9c5cdf5f4830eb04b7c1f80cc61c17232d79f' + + '7ecc2cc462a7965f804001c89982734e5abba2d31df1b012' + + '152c6b226dff34510b54be8c2cd68d795def66c57a3abfb6' + + '896f1d139e633417f8c694764974d268f46ece3a8d6616ea' + + 'a592144be48ee1e0a1595d3e5edfede5b27cec6c48ceb2ff' + + 'b42cb44275851b0ebf87dfc9aa2d0cb0805e9454b051dfe8' + + 'a29fadd82491a4b4c23f2d06ba45483ab59976da1433c9ce' + + '500164b957a04cf62dd67595319b512fc4b998424d1164dd' + + 'bbe5d1a0f7257cbb04ec9b5ed92079a1502d98725023ecb2', + pub: '3bf836229c7dd874fe37c1790d201e82ed8e192ed61571ca' + + '7285264974eb2a0171f3747b2fc23969a916cbd21e14f7e2' + + 'f0d72dcd2247affba926f9e7bb99944cb5609aed85e71b89' + + 'e89d2651550cb5bd8281bd3144066af78f194032aa777739' + + 'cccb7862a1af401f99f7e5c693f25ddce2dedd9686633820' + + 'd28d0f5ed0c6b5a094f5fe6170b8e2cbc9dff118398baee6' + + 'e895a6301cb6e881b3cae749a5bdf5c56fc897ff68bc73f2' + + '4811bb108b882872bade1f147d886a415cda2b93dd90190c' + + 'be5c2dd53fe78add5960e97f58ff2506afe437f4cf4c912a' + + '397c1a2139ac6207d3ab76e6b7ffd23bb6866dd7f87a9ae5' + + '578789084ff2d06ea0d30156d7a10496e8ebe094f5703539' + + '730f5fdbebc066de417be82c99c7da59953071f49da7878d' + + 'a588775ff2a7f0084de390f009f372af75cdeba292b08ea8' + + '4bd13a87e1ca678f9ad148145f7cef3620d69a891be46fbb' + + 'cad858e2401ec0fd72abdea2f643e6d0197b7646fbb83220' + + '0f4cf7a7f6a7559f9fb0d0f1680822af9dbd8dec4cd1b5e1' + + '7bc799e902d9fe746ddf41da3b7020350d3600347398999a' + + 'baf75d53e03ad2ee17de8a2032f1008c6c2e6618b62f225b' + + 'a2f350179445debe68500fcbb6cae970a9920e321b468b74' + + '5fb524fb88abbcacdca121d737c44d30724227a99745c209' + + 'b970d1ff93bbc9f28b01b4e714d6c9cbd9ea032d4e964d8e' + + '8fff01db095160c20b7646d9fcd314c4bc11bcc232aeccc0' + + 'fbedccbc786951025597522eef283e3f56b44561a0765783' + + '420128638c257e54b972a76e4261892d81222b3e2039c61a' + + 'ab8408fcaac3d634f848ab3ee65ea1bd13c6cd75d2e78060' + + 'e13cf67fbef8de66d2049e26c0541c679fff3e6afc290efe' + + '875c213df9678e4a7ec484bc87dae5f0a1c26d7583e38941' + + 'b7c68b004d4df8b004b666f9448aac1cc3ea21461f41ea5d' + + 'd0f7a9e6161cfe0f58bcfd304bdc11d78c2e9d542e86c0b5' + + '6985cc83f693f686eaac17411a8247bf62f5ccc7782349b5' + + 'cc1f20e312fa2acc0197154d1bfee507e8db77e8f2732f2d' + + '641440ccf248e8643b2bd1e1f9e8239356ab91098fcb431d', + q: 'a899c59999bf877d96442d284359783bdc64b5f878b688fe' + + '51407f0526e616553ad0aaaac4d5bed3046f10a1faaf42bb' + + '2342dc4b7908eea0c46e4c4576897675c2bfdc4467870d3d' + + 'cd90adaed4359237a4bc6924bfb99aa6bf5f5ede15b574ea' + + 'e977eac096f3c67d09bda574c6306c6123fa89d2f086b8dc' + + 'ff92bc570c18d83fe6c810ccfd22ce4c749ef5e6ead3fffe' + + 'c63d95e0e3fde1df9db6a35fa1d107058f37e41957769199' + + 'd945dd7a373622c65f0af3fd9eb1ddc5c764bbfaf7a3dc37' + + '2548e683b970dac4aa4b9869080d2376c9adecebb84e172c' + + '09aeeb25fb8df23e60033260c4f8aac6b8b98ab894b1fb84' + + 'ebb83c0fb2081c3f3eee07f44e24d8fabf76f19ed167b0d7' + + 'ff971565aa4efa3625fce5a43ceeaa3eebb3ce88a00f597f' + + '048c69292b38dba2103ecdd5ec4ccfe3b2d87fa6202f334b' + + 'c1cab83b608dfc875b650b69f2c7e23c0b2b4adf149a6100' + + 'db1b6dbad4679ecb1ea95eafaba3bd00db11c2134f5a8686' + + '358b8b2ab49a1b2e85e1e45caeac5cd4dc0b3b5fffba8871' + + '1c6baf399edd48dad5e5c313702737a6dbdcede80ca358e5' + + '1d1c4fe42e8948a084403f61baed38aa9a1a5ce2918e9f33' + + '100050a430b47bc592995606440272a4994677577a6aaa1b' + + 'a101045dbec5a4e9566dab5445d1af3ed19519f07ac4e2a8' + + 'bd0a84b01978f203a9125a0be020f71fab56c2c9e344d4f4' + + '12d53d3cd8eb74ca5122002e931e3cb0bd4b7492436be17a' + + 'd7ebe27148671f59432c36d8c56eb762655711cfc8471f70' + + '83a8b7283bcb3b1b1d47d37c23d030288cfcef05fbdb4e16' + + '652ee03ee7b77056a808cd700bc3d9ef826eca9a59be959c' + + '947c865d6b372a1ca2d503d7df6d7611b12111665438475a' + + '1c64145849b3da8c2d343410df892d958db232617f9896f1' + + 'de95b8b5a47132be80dd65298c7f2047858409bf762dbc05' + + 'a62ca392ac40cfb8201a0607a2cae07d99a307625f2b2d04' + + 'fe83fbd3ab53602263410f143b73d5b46fc761882e78c782' + + 'd2c36e716a770a7aefaf7f76cea872db7bffefdbc4c2f9e0' + + '39c19adac915e7a63dcb8c8c78c113f29a3e0bc10e100ce0', + qs: '6f0a2fb763eaeb8eb324d564f03d4a55fdcd709e5f1b65e9' + + '5702b0141182f9f945d71bc3e64a7dfdae7482a7dd5a4e58' + + 'bc38f78de2013f2c468a621f08536969d2c8d011bb3bc259' + + '2124692c91140a5472cad224acdacdeae5751dadfdf068b8' + + '77bfa7374694c6a7be159fc3d24ff9eeeecaf62580427ad8' + + '622d48c51a1c4b1701d768c79d8c819776e096d2694107a2' + + 'f3ec0c32224795b59d32894834039dacb369280afb221bc0' + + '90570a93cf409889b818bb30cccee98b2aa26dbba0f28499' + + '08e1a3cd43fa1f1fb71049e5c77c3724d74dc351d9989057' + + '37bbda3805bd6b1293da8774410fb66e3194e18cdb304dd9' + + 'a0b59b583dcbc9fc045ac9d56aea5cfc9f8a0b95da1e11b7' + + '574d1f976e45fe12294997fac66ca0b83fc056183549e850' + + 'a11413cc4abbe39a211e8c8cbf82f2a23266b3c10ab9e286' + + '07a1b6088909cddff856e1eb6b2cde8bdac53fa939827736' + + 'ca1b892f6c95899613442bd02dbdb747f02487718e2d3f22' + + 'f73734d29767ed8d0e346d0c4098b6fdcb4df7d0c4d29603' + + '5bffe80d6c65ae0a1b814150d349096baaf950f2caf298d2' + + 'b292a1d48cf82b10734fe8cedfa16914076dfe3e9b51337b' + + 'ed28ea1e6824bb717b641ca0e526e175d3e5ed7892aebab0' + + 'f207562cc938a821e2956107c09b6ce4049adddcd0b7505d' + + '49ae6c69a20122461102d465d93dc03db026be54c303613a' + + 'b8e5ce3fd4f65d0b6162ff740a0bf5469ffd442d8c509cd2' + + '3b40dab90f6776ca17fc0678774bd6eee1fa85ababa52ec1' + + 'a15031eb677c6c488661dddd8b83d6031fe294489ded5f08' + + '8ad1689a14baeae7e688afa3033899c81f58de39b392ca94' + + 'af6f15a46f19fa95c06f9493c8b96a9be25e78b9ea35013b' + + 'caa76de6303939299d07426a88a334278fc3d0d9fa71373e' + + 'be51d3c1076ab93a11d3d0d703366ff8cde4c11261d488e5' + + '60a2bdf3bfe2476032294800d6a4a39d306e65c6d7d8d66e' + + '5ec63eee94531e83a9bddc458a2b508285c0ee10b7bd94da' + + '2815a0c5bd5b2e15cbe66355e42f5af8955cdfc0b3a4996d' + + '288db1f4b32b15643b18193e378cb7491f3c3951cdd044b1' + + 'a519571bffac2da986f5f1d506c66530a55f70751e24fa8e' + + 'd83ac2347f4069fb561a5565e78c6f0207da24e889a93a96' + + '65f717d9fe8a2938a09ab5f81be7ccecf466c0397fc15a57' + + '469939793f302739765773c256a3ca55d0548afd117a7cae' + + '98ca7e0d749a130c7b743d376848e255f8fdbe4cb4480b63' + + 'cd2c015d1020cf095d175f3ca9dcdfbaf1b2a6e6468eee4c' + + 'c750f2132a77f376bd9782b9d0ff4da98621b898e251a263' + + '4301ba2214a8c430b2f7a79dbbfd6d7ff6e9b0c137b025ff' + + '587c0bf912f0b19d4fff96b1ecd2ca990c89b386055c60f2' + + '3b94214bd55096f17a7b2c0fa12b333235101cd6f28a128c' + + '782e8a72671adadebbd073ded30bd7f09fb693565dcf0bf3' + + '090c21d13e5b0989dd8956f18f17f4f69449a13549c9d80a' + + '77e5e61b5aeeee9528634100e7bc390672f0ded1ca53555b' + + 'abddbcf700b9da6192255bddf50a76b709fbed251dce4c7e' + + '1ca36b85d1e97c1bc9d38c887a5adf140f9eeef674c31422' + + 'e65f63cae719f8c1324e42fa5fd8500899ef5aa3f9856aa7' + + 'ce10c85600a040343204f36bfeab8cfa6e9deb8a2edd2a8e' + + '018d00c7c9fa3a251ad0f57183c37e6377797653f382ec7a' + + '2b0145e16d3c856bc3634b46d90d7198aff12aff88a30e34' + + 'e2bfaf62705f3382576a9d3eeb0829fca2387b5b654af46e' + + '5cf6316fb57d59e5ea6c369061ac64d99671b0e516529dd5' + + 'd9c48ea0503e55fee090d36c5ea8b5954f6fcc0060794e1c' + + 'b7bc24aa1e5c0142fd4ce6e8fd5aa92a7bf84317ea9e1642' + + 'b6995bac6705adf93cbce72433ed0871139970d640f67b78' + + 'e63a7a6d849db2567df69ac7d79f8c62664ac221df228289' + + 'd0a4f9ebd9acb4f87d49da64e51a619fd3f3baccbd9feb12' + + '5abe0cc2c8d17ed1d8546da2b6c641f4d3020a5f9b9f26ac' + + '16546c2d61385505612275ea344c2bbf1ce890023738f715' + + '5e9eba6a071678c8ebd009c328c3eb643679de86e69a9fa5' + + '67a9e146030ff03d546310a0a568c5ba0070e0da22f2cef8' + + '54714b04d399bbc8fd261f9e8efcd0e83bdbc3f5cfb2d024' + + '3e398478cc598e000124eb8858f9df8f52946c2a1ca5c400' + } +}; diff --git a/node_modules/mysql2/node_modules/bn.js/test/pummel/dh-group-test.js b/node_modules/mysql2/node_modules/bn.js/test/pummel/dh-group-test.js new file mode 100644 index 0000000..dd6481f --- /dev/null +++ b/node_modules/mysql2/node_modules/bn.js/test/pummel/dh-group-test.js @@ -0,0 +1,21 @@ +var assert = require('assert'); +var BN = require('../../').BN; +var fixtures = require('../fixtures'); + +describe('BN.js/Slow DH test', function() { + var groups = fixtures.dhGroups; + Object.keys(groups).forEach(function(name) { + it('should match public key for ' + name + ' group', function() { + var group = groups[name]; + + this.timeout(3600 * 1000); + + var base = new BN(2); + var mont = BN.red(new BN(group.prime, 16)); + var priv = new BN(group.priv, 16); + var multed = base.toRed(mont).redPow(priv).fromRed(); + var actual = new Buffer(multed.toArray()); + assert.equal(actual.toString('hex'), group.pub); + }); + }); +}); diff --git a/node_modules/mysql2/node_modules/bn.js/test/red-test.js b/node_modules/mysql2/node_modules/bn.js/test/red-test.js index d57ba7c..cb637e4 100644 --- a/node_modules/mysql2/node_modules/bn.js/test/red-test.js +++ b/node_modules/mysql2/node_modules/bn.js/test/red-test.js @@ -1,5 +1,6 @@ var assert = require('assert'); var BN = require('../').BN; +var fixtures = require('./fixtures'); describe('BN.js/Reduction context', function() { function testMethod(name, fn) { diff --git a/node_modules/mysql2/node_modules/cardinal/node_modules/ansicolors/package.json b/node_modules/mysql2/node_modules/cardinal/node_modules/ansicolors/package.json index 740025d..4188c40 100644 --- a/node_modules/mysql2/node_modules/cardinal/node_modules/ansicolors/package.json +++ b/node_modules/mysql2/node_modules/cardinal/node_modules/ansicolors/package.json @@ -30,5 +30,5 @@ }, "homepage": "https://github.com/thlorenz/ansicolors", "_id": "ansicolors@0.2.1", - "_from": "ansicolors@~0.2.1" + "_from": "ansicolors@>=0.2.1 <0.3.0" } diff --git a/node_modules/mysql2/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/package.json b/node_modules/mysql2/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/package.json index 98d0e76..dc5f573 100644 --- a/node_modules/mysql2/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/package.json +++ b/node_modules/mysql2/node_modules/cardinal/node_modules/redeyed/node_modules/esprima/package.json @@ -55,5 +55,5 @@ "url": "https://github.com/ariya/esprima/issues" }, "_id": "esprima@1.0.4", - "_from": "esprima@~1.0.4" + "_from": "esprima@>=1.0.4 <1.1.0" } diff --git a/node_modules/mysql2/node_modules/cardinal/node_modules/redeyed/package.json b/node_modules/mysql2/node_modules/cardinal/node_modules/redeyed/package.json index bb8c240..601b3ea 100644 --- a/node_modules/mysql2/node_modules/cardinal/node_modules/redeyed/package.json +++ b/node_modules/mysql2/node_modules/cardinal/node_modules/redeyed/package.json @@ -41,5 +41,5 @@ }, "homepage": "https://github.com/thlorenz/redeyed", "_id": "redeyed@0.4.4", - "_from": "redeyed@~0.4.0" + "_from": "redeyed@>=0.4.0 <0.5.0" } diff --git a/node_modules/mysql2/node_modules/cardinal/package.json b/node_modules/mysql2/node_modules/cardinal/package.json index d57245c..3e9c011 100644 --- a/node_modules/mysql2/node_modules/cardinal/package.json +++ b/node_modules/mysql2/node_modules/cardinal/package.json @@ -46,5 +46,23 @@ }, "homepage": "https://github.com/thlorenz/cardinal", "_id": "cardinal@0.4.4", - "_from": "cardinal@^0.4.4" + "dist": { + "shasum": "ca5bb68a5b511b90fe93b9acea49bdee5c32bfe2", + "tarball": "http://registry.npmjs.org/cardinal/-/cardinal-0.4.4.tgz" + }, + "_from": "cardinal@0.4.4", + "_npmVersion": "1.3.22", + "_npmUser": { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + }, + "maintainers": [ + { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + } + ], + "directories": {}, + "_shasum": "ca5bb68a5b511b90fe93b9acea49bdee5c32bfe2", + "_resolved": "https://registry.npmjs.org/cardinal/-/cardinal-0.4.4.tgz" } diff --git a/node_modules/mysql2/node_modules/double-ended-queue/.npmignore b/node_modules/mysql2/node_modules/double-ended-queue/.npmignore new file mode 100644 index 0000000..bd236a0 --- /dev/null +++ b/node_modules/mysql2/node_modules/double-ended-queue/.npmignore @@ -0,0 +1,31 @@ +node_modules/* +todo.txt +npm-debug.log +test/* +benchmark/* +browser/* +src/* +async +sync +mixed +bench.json +js/browser +js/browser/* +js/debug +js/debug/* +reader.js +read.txt +bench +.editorconfig +.jshintrc +ast_passes.js +mocharun.js +throwaway.js +throwaway.html +deque.sublime-workspace +deque.sublime-project +changelog.js +.travis.yml +sauce_connect.log +nodex64.exe +bump.js diff --git a/node_modules/mysql2/node_modules/double-ended-queue/Gruntfile.js b/node_modules/mysql2/node_modules/double-ended-queue/Gruntfile.js new file mode 100644 index 0000000..7aed70d --- /dev/null +++ b/node_modules/mysql2/node_modules/double-ended-queue/Gruntfile.js @@ -0,0 +1,188 @@ +"use strict"; +Error.stackTraceLimit = 100; +var astPasses = require("./ast_passes.js"); + +module.exports = function( grunt ) { + var isCI = !!grunt.option("ci"); + + var license; + function getLicense() { + if( !license ) { + var fs = require("fs"); + var text = fs.readFileSync("LICENSE", "utf8"); + text = text.split("\n").map(function(line, index){ + return " * " + line; + }).join("\n") + license = "/**\n" + text + "\n */\n"; + } + return license + } + + function writeFile( dest, content ) { + grunt.file.write( dest, content ); + grunt.log.writeln('File "' + dest + '" created.'); + } + + var gruntConfig = {}; + + var getGlobals = function() { + var fs = require("fs"); + var file = "./src/constants.js"; + var contents = fs.readFileSync(file, "utf8"); + var rconstantname = /CONSTANT\(\s*([^,]+)/g; + var m; + var globals = { + "console": false, + "require": false, + "module": false, + "define": false + }; + while( ( m = rconstantname.exec( contents ) ) ) { + globals[m[1]] = false; + } + return globals; + } + + gruntConfig.pkg = grunt.file.readJSON("package.json"); + + gruntConfig.jshint = { + all: { + options: { + globals: getGlobals(), + + "bitwise": false, + "camelcase": true, + "curly": true, + "eqeqeq": true, + "es3": true, + "forin": true, + "immed": true, + "latedef": false, + "newcap": true, + "noarg": true, + "noempty": true, + "nonew": true, + "plusplus": false, + "quotmark": "double", + "undef": true, + "unused": true, + "strict": false, + "trailing": true, + "maxparams": 7, + "maxlen": 80, + + "asi": false, + "boss": true, + "eqnull": true, + "evil": true, + "expr": false, + "funcscope": false, + "globalstrict": false, + "lastsemic": false, + "laxcomma": false, + "laxbreak": false, + "loopfunc": true, + "multistr": true, + "proto": false, + "scripturl": true, + "smarttabs": false, + "shadow": true, + "sub": true, + "supernew": false, + "validthis": true, + + "browser": true, + "jquery": true, + "devel": true, + + + '-W014': true, + '-W116': true, + '-W106': true, + '-W064': true, + '-W097': true + }, + + files: { + src: [ + "./src/deque.js" + ] + } + } + }; + + if( !isCI ) { + gruntConfig.jshint.all.options.reporter = require("jshint-stylish"); + } + + gruntConfig.bump = { + options: { + files: ['package.json'], + updateConfigs: [], + commit: true, + commitMessage: 'Release v%VERSION%', + commitFiles: ['-a'], + createTag: true, + tagName: 'v%VERSION%', + tagMessage: 'Version %VERSION%', + false: true, + pushTo: 'master', + gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe' + } + }; + + grunt.initConfig(gruntConfig); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-bump'); + + + grunt.registerTask( "build", function() { + var fs = require("fs"); + var CONSTANTS_FILE = "./src/constants.js"; + + astPasses.readConstants(fs.readFileSync(CONSTANTS_FILE, "utf8"), CONSTANTS_FILE); + var fileNames = ["deque.js"]; + fileNames.forEach(function(fileName){ + var src = fs.readFileSync("./src/" + fileName, "utf8"); + src = astPasses.removeComments(src, fileName); + src = astPasses.expandConstants(src, fileName); + src = getLicense() + src; + writeFile("./js/" + fileName, src); + }); + }); + + grunt.registerTask( "testrun", function() { + var fs = require("fs"); + var done = this.async(); + var Mocha = require("mocha"); + + var mochaOpts = { + reporter: "spec", + timeout: 500, + slow: Infinity + }; + + var mocha = new Mocha(mochaOpts); + + fs.readdirSync("./test").forEach(function(fileName) { + mocha.addFile("./test/" + fileName); + }); + + mocha.run(function(err){ + if( err ) { + process.stderr.write(test.title + "\n" + err.stack + "\n"); + done(err); + } + else { + done(); + } + }).on( "fail", function( test, err ) { + process.stderr.write(test.title + "\n" + err.stack + "\n"); + done(err); + }); + }); + + grunt.registerTask( "test", ["jshint", "build", "testrun"] ); + grunt.registerTask( "default", ["jshint", "build"] ); + +}; diff --git a/node_modules/jsdoc/node_modules/async/LICENSE b/node_modules/mysql2/node_modules/double-ended-queue/LICENSE similarity index 82% rename from node_modules/jsdoc/node_modules/async/LICENSE rename to node_modules/mysql2/node_modules/double-ended-queue/LICENSE index b7f9d50..abaadaa 100644 --- a/node_modules/jsdoc/node_modules/async/LICENSE +++ b/node_modules/mysql2/node_modules/double-ended-queue/LICENSE @@ -1,19 +1,19 @@ -Copyright (c) 2010 Caolan McMahon +Copyright (c) 2013 Petka Antonov 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: +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 +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. +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/mysql2/node_modules/double-ended-queue/README.md b/node_modules/mysql2/node_modules/double-ended-queue/README.md new file mode 100644 index 0000000..b1d115d --- /dev/null +++ b/node_modules/mysql2/node_modules/double-ended-queue/README.md @@ -0,0 +1,293 @@ +#Introduction + +Extremely fast [double-ended queue](http://en.wikipedia.org/wiki/Double-ended_queue) implementation. Double-ended queue can also be used as a: + +- [Stack](http://en.wikipedia.org/wiki/Stack_\(abstract_data_type\)) +- [Queue](http://en.wikipedia.org/wiki/Queue_\(data_structure\)) + +The implementation is GC and CPU cache friendly [circular buffer](http://en.wikipedia.org/wiki/Circular_buffer). [It will run circles around any "linked list" implementation](#performance). + +Every queue operation is done in constant `O(1)` - including random access from `.get()`. + +#Topics + +- [Quick start](#quick-start) +- [Why not use an Array?](#why-not-use-an-array) +- [Using double-ended queue as a normal queue](#using-double-ended-queue-as-a-normal-queue) +- [API reference and examples](#api) +- [Performance](#performance) + +#Quick start + + npm install double-ended-queue + +```js +var Deque = require("double-ended-queue"); + +var deque = new Deque([1,2,3,4]); +deque.shift(); //1 +deque.pop(); //4 +``` + +#Why not use an Array? + +Arrays take linear `O(N)` time to do `shift` and `unshift` operations. That means in theory that an array with 1000 items is 1000x slower to do those operations than a deque with 1000 items. 10000x slower with 10000 items and so on. + +V8 implements [a trick for small arrays](https://code.google.com/p/v8/issues/detail?id=3059) where these operations are done in constant time, however even with this trick deque is still 4x faster. + +But arrays use "native" methods, they must be faster! + +In V8, there is almost no advantage for a method to be a built-in. In fact many times built-ins are at a severe disadvantage of having to implement far more complex semantics than is actually needed in practice. For example, sparse array handling punishes almost every built-in array method even though nobody uses sparse arrays as is evidenced by the popularity of the underscore library which doesn't handle sparse arrays in the same way across different browsers. + +#Using double-ended queue as a normal queue + +Queue is a more commonly needed data structure however a separate implementation does not provide any advantage in terms of performance. Aliases are provided specifically for the queue use-case. You may use `.enqueue(items...)` to enqueue item(s) and `.dequeue()` to dequeue an item. + +#API + +- [`new Deque()`](#new-deque---deque) +- [`new Deque(Array items)`](#new-dequearray-items---deque) +- [`new Deque(int capacity)`](#new-dequeint-capacity---deque) +- [`push(dynamic items...)`](#pushdynamic-items---int) +- [`unshift(dynamic items...)`](#unshiftdynamic-items---int) +- [`pop()`](#pop---dynamic) +- [`shift()`](#shift---dynamic) +- [`toArray()`](#toarray---array) +- [`peekBack()`](#peekback---dynamic) +- [`peekFront()`](#peekfront---dynamic) +- [`get(int index)`](#getint-index---dynamic) +- [`isEmpty()`](#isempty---boolean) +- [`clear()`](#clear---void) + +#####`new Deque()` -> `Deque` + +Creates an empty double-ended queue with initial capacity of 16. If you know the optimal size before-hand, use [`new Deque(int capacity)`](#new-dequeint-capacity---deque). + +```js +var deque = new Deque(); +deque.push(1, 2, 3); +deque.shift(); //1 +deque.pop(); //3 +``` + +
        + +#####`new Deque(Array items)` -> `Deque` + +Creates a double-ended queue from `items`. + +```js +var deque = new Deque([1,2,3,4]); +deque.shift(); //1 +deque.pop(); //4 +``` + +
        + +#####`new Deque(int capacity)` -> `Deque` + +Creates an empty double-ended queue with the given `capacity`. `Capacity` should be the maximum amount of items the queue will hold at a given time. + +The reason to give an initial capacity is to avoid potentially expensive resizing operations at runtime. + +```js +var deque = new Deque(100); +deque.push(1, 2, 3); +deque.shift(); //1 +deque.pop(); //3 +``` + +
        + +#####`push(dynamic items...)` -> `int` + +Push items to the back of this queue. Returns the amount of items currently in the queue after the operation. + +```js +var deque = new Deque(); +deque.push(1); +deque.pop(); //1 +deque.push(1, 2, 3); +deque.shift(); //1 +deque.shift(); //2 +deque.shift(); //3 +``` + +**Aliases:** `enqueue`, `insertBack` + +
        + +#####`unshift(dynamic items...)` -> `int` + +Unshift items to the front of this queue. Returns the amount of items currently in the queue after the operation. + +```js +var deque = new Deque([2,3]); +deque.unshift(1); +deque.toString(); //"1,2,3" +deque.unshift(-2, -1, 0); +deque.toString(); //"-2,-1,0,1,2,3" +``` + +**Aliases:** `insertFront` + +
        + + +#####`pop()` -> `dynamic` + +Pop off the item at the back of this queue. + +Note: The item will be removed from the queue. If you simply want to see what's at the back of the queue use [`peekBack()`](#peekback---dynamic) or [`.get(-1)`](#getint-index---dynamic). + +If the queue is empty, `undefined` is returned. If you need to differentiate between `undefined` values in the queue and `pop()` return value - +check the queue `.length` before popping. + +```js +var deque = new Deque([1,2,3]); +deque.pop(); //3 +deque.pop(); //2 +deque.pop(); //1 +deque.pop(); //undefined +``` + +**Aliases:** `removeBack` + +
        + +#####`shift()` -> `dynamic` + +Shifts off the item at the front of this queue. + +Note: The item will be removed from the queue. If you simply want to see what's at the front of the queue use [`peekFront()`](#peekfront---dynamic) or [`.get(0)`](#getint-index---dynamic). + +If the queue is empty, `undefined` is returned. If you need to differentiate between `undefined` values in the queue and `shift()` return value - +check the queue `.length` before shifting. + +```js +var deque = new Deque([1,2,3]); +deque.shift(); //1 +deque.shift(); //2 +deque.shift(); //3 +deque.shift(); //undefined +``` + +**Aliases:** `removeFront`, `dequeue` + +
        + +#####`toArray()` -> `Array` + +Returns the items in the queue as an array. Starting from the item in the front of the queue and ending to the item at the back of the queue. + +```js +var deque = new Deque([1,2,3]); +deque.push(4); +deque.unshift(0); +deque.toArray(); //[0,1,2,3,4] +``` + +**Aliases:** `toJSON` + +
        + +#####`peekBack()` -> `dynamic` + +Returns the item that is at the back of this queue without removing it. + +If the queue is empty, `undefined` is returned. + +```js +var deque = new Deque([1,2,3]); +deque.push(4); +deque.peekBack(); //4 +``` + +
        + +#####`peekFront()` -> `dynamic` + +Returns the item that is at the front of this queue without removing it. + +If the queue is empty, `undefined` is returned. + +```js +var deque = new Deque([1,2,3]); +deque.push(4); +deque.peekFront(); //1 +``` + +
        + +#####`get(int index)` -> `dynamic` + +Returns the item that is at the given `index` of this queue without removing it. + +The index is zero-based, so `.get(0)` will return the item that is at the front, `.get(1)` will return +the item that comes after and so on. + +The index can be negative to read items at the back of the queue. `.get(-1)` returns the item that is at the back of the queue, +`.get(-2)` will return the item that comes before and so on. + +Returns `undefined` if `index` is not a valid index into the queue. + +```js +var deque = new Deque([1,2,3]); +deque.get(0); //1 +deque.get(1); //2 +deque.get(2); //3 + +deque.get(-1); //3 +deque.get(-2); //2 +deque.get(-3); //1 +``` + +**Note**: Even though indexed accessor (e.g. `queue[0]`) could *appear* to return a correct value *sometimes*, this is completely unreliable. The numeric slots +of the deque object are internally used as an optimization and have no meaningful order or meaning to outside. Always use `.get()`. + +**Note**: The implementation has O(1) random access using `.get()`. + +
        + +#####`isEmpty()` -> `boolean` + +Return `true` if this queue is empty, `false` otherwise. + +```js +var deque = new Deque(); +deque.isEmpty(); //true +deque.push(1); +deque.isEmpty(); //false +``` + +
        + +#####`clear()` -> `void` + +Remove all items from this queue. Does not change the queue's capacity. + +```js +var deque = new Deque([1,2,3]); +deque.toString(); //"1,2,3" +deque.clear(); +deque.toString(); //"" +``` +
        + +#Performance + +Clone the repo and `npm install`. Then run the `bench` script. + +##1000 items in the queue + + double-ended-queue x 15,532,714 ops/sec ±0.19% (96 runs sampled) + built-in array x 6,501,398 ops/sec ±0.87% (95 runs sampled) + node-deque x 2,938,068 ops/sec ±3.50% (68 runs sampled) + +##2 million items in the queue + + double-ended-queue x 14,425,547 ops/sec ±0.17% (94 runs sampled) + node-deque x 2,815,628 ops/sec ±10.56% (76 runs sampled) + built-in array x 19.23 ops/sec ±0.35% (51 runs sampled) + +Noteworthy is just how bad the degradation can be for built-in array when V8 cannot use the trick. diff --git a/node_modules/mysql2/node_modules/double-ended-queue/js/deque.js b/node_modules/mysql2/node_modules/double-ended-queue/js/deque.js new file mode 100644 index 0000000..90a3559 --- /dev/null +++ b/node_modules/mysql2/node_modules/double-ended-queue/js/deque.js @@ -0,0 +1,287 @@ +/** + * Copyright (c) 2013 Petka Antonov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions:

        + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +"use strict"; +function Deque(capacity) { + this._capacity = getCapacity(capacity); + this._length = 0; + this._front = 0; + this._makeCapacity(); + if (isArray(capacity)) { + var len = capacity.length; + for (var i = 0; i < len; ++i) { + this[i] = capacity[i]; + } + this._length = len; + } +} + +Deque.prototype.toArray = function Deque$toArray() { + var len = this._length; + var ret = new Array(len); + var front = this._front; + var capacity = this._capacity; + for (var j = 0; j < len; ++j) { + ret[j] = this[(front + j) & (capacity - 1)]; + } + return ret; +}; + +Deque.prototype.push = function Deque$push(item) { + var argsLength = arguments.length; + var length = this._length; + if (argsLength > 1) { + var capacity = this._capacity; + if (length + argsLength > capacity) { + for (var i = 0; i < argsLength; ++i) { + this._checkCapacity(length + 1); + var j = (this._front + length) & (this._capacity - 1); + this[j] = arguments[i]; + length++; + this._length = length; + } + return length; + } + else { + var j = this._front; + for (var i = 0; i < argsLength; ++i) { + this[(j + length) & (capacity - 1)] = arguments[i]; + j++; + } + this._length = length + argsLength; + return length + argsLength; + } + + } + + if (argsLength === 0) return length; + + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = item; + this._length = length + 1; + return length + 1; +}; + +Deque.prototype.pop = function Deque$pop() { + var length = this._length; + if (length === 0) { + return void 0; + } + var i = (this._front + length - 1) & (this._capacity - 1); + var ret = this[i]; + this[i] = void 0; + this._length = length - 1; + return ret; +}; + +Deque.prototype.shift = function Deque$shift() { + var length = this._length; + if (length === 0) { + return void 0; + } + var front = this._front; + var ret = this[front]; + this[front] = void 0; + this._front = (front + 1) & (this._capacity - 1); + this._length = length - 1; + return ret; +}; + +Deque.prototype.unshift = function Deque$unshift(item) { + var length = this._length; + var argsLength = arguments.length; + + + if (argsLength > 1) { + var capacity = this._capacity; + if (length + argsLength > capacity) { + for (var i = argsLength - 1; i >= 0; i--) { + this._checkCapacity(length + 1); + var capacity = this._capacity; + var j = (((( this._front - 1 ) & + ( capacity - 1) ) ^ capacity ) - capacity ); + this[j] = arguments[i]; + length++; + this._length = length; + this._front = j; + } + return length; + } + else { + var front = this._front; + for (var i = argsLength - 1; i >= 0; i--) { + var j = (((( front - 1 ) & + ( capacity - 1) ) ^ capacity ) - capacity ); + this[j] = arguments[i]; + front = j; + } + this._front = front; + this._length = length + argsLength; + return length + argsLength; + } + } + + if (argsLength === 0) return length; + + this._checkCapacity(length + 1); + var capacity = this._capacity; + var i = (((( this._front - 1 ) & + ( capacity - 1) ) ^ capacity ) - capacity ); + this[i] = item; + this._length = length + 1; + this._front = i; + return length + 1; +}; + +Deque.prototype.peekBack = function Deque$peekBack() { + var length = this._length; + if (length === 0) { + return void 0; + } + var index = (this._front + length - 1) & (this._capacity - 1); + return this[index]; +}; + +Deque.prototype.peekFront = function Deque$peekFront() { + if (this._length === 0) { + return void 0; + } + return this[this._front]; +}; + +Deque.prototype.get = function Deque$get(index) { + var i = index; + if ((i !== (i | 0))) { + return void 0; + } + var len = this._length; + if (i < 0) { + i = i + len; + } + if (i < 0 || i >= len) { + return void 0; + } + return this[(this._front + i) & (this._capacity - 1)]; +}; + +Deque.prototype.isEmpty = function Deque$isEmpty() { + return this._length === 0; +}; + +Deque.prototype.clear = function Deque$clear() { + this._length = 0; + this._front = 0; + this._makeCapacity(); +}; + +Deque.prototype.toString = function Deque$toString() { + return this.toArray().toString(); +}; + +Deque.prototype.valueOf = Deque.prototype.toString; +Deque.prototype.removeFront = Deque.prototype.shift; +Deque.prototype.removeBack = Deque.prototype.pop; +Deque.prototype.insertFront = Deque.prototype.unshift; +Deque.prototype.insertBack = Deque.prototype.push; +Deque.prototype.enqueue = Deque.prototype.push; +Deque.prototype.dequeue = Deque.prototype.shift; +Deque.prototype.toJSON = Deque.prototype.toArray; + +Object.defineProperty(Deque.prototype, "length", { + get: function() { + return this._length; + }, + set: function() { + throw new RangeError(""); + } +}); + +Deque.prototype._makeCapacity = function Deque$_makeCapacity() { + var len = this._capacity; + for (var i = 0; i < len; ++i) { + this[i] = void 0; + } +}; + +Deque.prototype._checkCapacity = function Deque$_checkCapacity(size) { + if (this._capacity < size) { + this._resizeTo(getCapacity(this._capacity * 1.5 + 16)); + } +}; + +Deque.prototype._resizeTo = function Deque$_resizeTo(capacity) { + var oldFront = this._front; + var oldCapacity = this._capacity; + var oldDeque = new Array(oldCapacity); + var length = this._length; + + arrayCopy(this, 0, oldDeque, 0, oldCapacity); + this._capacity = capacity; + this._makeCapacity(); + this._front = 0; + if (oldFront + length <= oldCapacity) { + arrayCopy(oldDeque, oldFront, this, 0, length); + } else { var lengthBeforeWrapping = + length - ((oldFront + length) & (oldCapacity - 1)); + + arrayCopy(oldDeque, oldFront, this, 0, lengthBeforeWrapping); + arrayCopy(oldDeque, 0, this, lengthBeforeWrapping, + length - lengthBeforeWrapping); + } +}; + + +var isArray = Array.isArray; + +function arrayCopy(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + } +} + +function pow2AtLeast(n) { + n = n >>> 0; + n = n - 1; + n = n | (n >> 1); + n = n | (n >> 2); + n = n | (n >> 4); + n = n | (n >> 8); + n = n | (n >> 16); + return n + 1; +} + +function getCapacity(capacity) { + if (typeof capacity !== "number") { + if (isArray(capacity)) { + capacity = capacity.length; + } + else { + return 16; + } + } + return pow2AtLeast( + Math.min( + Math.max(16, capacity), 1073741824) + ); +} + +module.exports = Deque; diff --git a/node_modules/mysql2/node_modules/double-ended-queue/package.json b/node_modules/mysql2/node_modules/double-ended-queue/package.json new file mode 100644 index 0000000..6e0bb32 --- /dev/null +++ b/node_modules/mysql2/node_modules/double-ended-queue/package.json @@ -0,0 +1,64 @@ +{ + "name": "double-ended-queue", + "description": "Extremely fast double-ended queue implementation", + "version": "2.0.0-0", + "keywords": [ + "data-structure", + "data-structures", + "queue", + "deque", + "double-ended-queue" + ], + "scripts": { + "test": "grunt test" + }, + "homepage": "https://github.com/petkaantonov/deque", + "repository": { + "type": "git", + "url": "git://github.com/petkaantonov/deque.git" + }, + "bugs": { + "url": "http://github.com/petkaantonov/deque/issues" + }, + "license": "MIT", + "author": { + "name": "Petka Antonov", + "email": "petka_antonov@hotmail.com", + "url": "http://github.com/petkaantonov/" + }, + "devDependencies": { + "grunt": "~0.4.1", + "grunt-contrib-jshint": "~0.6.4", + "jshint-stylish": "latest", + "acorn": "~0.3.1", + "mocha": "~1.12.1", + "grunt-cli": "~0.1.9", + "bluebird": "~0.11", + "benchmark": "~1.0.0", + "deque": "0.0.4", + "q": "~0.9.7", + "semver-utils": "~1.1.0" + }, + "main": "./js/deque.js", + "_id": "double-ended-queue@2.0.0-0", + "dist": { + "shasum": "7847fda1c00fb722245aff83643a4887670efd2c", + "tarball": "http://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.0.0-0.tgz" + }, + "_from": "double-ended-queue@2.0.0-0", + "_npmVersion": "1.3.14", + "_npmUser": { + "name": "esailija", + "email": "petka_antonov@hotmail.com" + }, + "maintainers": [ + { + "name": "esailija", + "email": "petka_antonov@hotmail.com" + } + ], + "directories": {}, + "_shasum": "7847fda1c00fb722245aff83643a4887670efd2c", + "_resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.0.0-0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/mysql2/node_modules/fastqueue/README.md b/node_modules/mysql2/node_modules/fastqueue/README.md deleted file mode 100644 index c3e8c69..0000000 --- a/node_modules/mysql2/node_modules/fastqueue/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Fast Queue - -While normal JavaScript arrays can be used as FIFO queues, the `.shift()` call is very slow if the queue gets large because it has to reindex all the remaining items on every shift. - -This library is a fast queue that only implements `.push(item)`, `.shift()`, `.unshift(item)` and `.length` from the Array interface. - -Internally it uses two arrays and cycles them and uses counters so that the `.shift()` calls are still fast. - -## Usage - -```js -var Queue = require('fastqueue'); - -var q = new Queue; -q.push(1); -q.push(2); -q.push(3); -var i = 4; -while (q.length > 0) { - console.log(q.length, q.shift()); - q.unshift(i++); - console.log(q.length, q.shift()); - q.push(i++); - console.log(q.length, q.shift()); -} -``` diff --git a/node_modules/mysql2/node_modules/fastqueue/package.json b/node_modules/mysql2/node_modules/fastqueue/package.json deleted file mode 100644 index 4f56d6d..0000000 --- a/node_modules/mysql2/node_modules/fastqueue/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "fastqueue", - "version": "0.1.0", - "description": "A fast push/shift sync queue", - "main": "queue.js", - "readme": "# Fast Queue\n\nWhile normal JavaScript arrays can be used as FIFO queues, the `.shift()` call is very slow if the queue gets large because it has to reindex all the remaining items on every shift.\n\nThis library is a fast queue that only implements `.push(item)`, `.shift()`, `.unshift(item)` and `.length` from the Array interface.\n\nInternally it uses two arrays and cycles them and uses counters so that the `.shift()` calls are still fast.\n\n## Usage\n\n```js\nvar Queue = require('fastqueue');\n\nvar q = new Queue;\nq.push(1);\nq.push(2);\nq.push(3);\nvar i = 4;\nwhile (q.length > 0) {\n console.log(q.length, q.shift());\n q.unshift(i++);\n console.log(q.length, q.shift());\n q.push(i++);\n console.log(q.length, q.shift());\n}\n```\n", - "readmeFilename": "README.md", - "_id": "fastqueue@0.1.0", - "dist": { - "shasum": "6c691016b3806186476eeb05a717babb8f633c19", - "tarball": "http://registry.npmjs.org/fastqueue/-/fastqueue-0.1.0.tgz" - }, - "_from": "fastqueue@~0.1.0", - "_npmVersion": "1.2.15", - "_npmUser": { - "name": "creationix", - "email": "tim@creationix.com" - }, - "maintainers": [ - { - "name": "creationix", - "email": "tim@creationix.com" - } - ], - "directories": {}, - "_shasum": "6c691016b3806186476eeb05a717babb8f633c19", - "_resolved": "https://registry.npmjs.org/fastqueue/-/fastqueue-0.1.0.tgz" -} diff --git a/node_modules/mysql2/node_modules/fastqueue/queue.js b/node_modules/mysql2/node_modules/fastqueue/queue.js deleted file mode 100644 index 5c4f9ab..0000000 --- a/node_modules/mysql2/node_modules/fastqueue/queue.js +++ /dev/null @@ -1,67 +0,0 @@ -module.exports = Queue; - -function Queue() { - this.head = []; - this.tail = []; - this.index = 0; - this.headLength = 0; - this.length = 0; -} - -// Get an item from the front of the queue. -Queue.prototype.shift = function () { - if (this.index >= this.headLength) { - // When the head is empty, swap it with the tail to get fresh items. - var t = this.head; - t.length = 0; - this.head = this.tail; - this.tail = t; - this.index = 0; - this.headLength = this.head.length; - if (!this.headLength) { - return; - } - } - - // There was an item in the head, let's pull it out. - var value = this.head[this.index]; - // And remove it from the head - if (this.index < 0) { - delete this.head[this.index++]; - } - else { - this.head[this.index++] = undefined; - } - this.length--; - return value; -}; - -// Insert a new item at the front of the queue. -Queue.prototype.unshift = function (item) { - this.head[--this.index] = item; - this.length++; - return this; -}; - -// Push a new item on the end of the queue. -Queue.prototype.push = function (item) { - // Pushes always go to the write-only tail - this.length++; - this.tail.push(item); - return this; -}; - -/* -var q = new Queue; -q.push(1); -q.push(2); -q.push(3); -var i = 4; -while (q.length > 0) { - console.log(q.length, q.shift()); - q.unshift(i++); - console.log(q.length, q.shift()); - q.push(i++); - console.log(q.length, q.shift()); -} -*/ diff --git a/node_modules/mysql2/node_modules/named-placeholders/.npmignore b/node_modules/mysql2/node_modules/named-placeholders/.npmignore new file mode 100644 index 0000000..59ee676 --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/.npmignore @@ -0,0 +1,17 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz +.DS_Store + +tmp +pids +logs + +node_modules +npm-debug.log + diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/.travis.yml b/node_modules/mysql2/node_modules/named-placeholders/.travis.yml similarity index 77% rename from node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/.travis.yml rename to node_modules/mysql2/node_modules/named-placeholders/.travis.yml index 6e5919d..05d299e 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/.travis.yml +++ b/node_modules/mysql2/node_modules/named-placeholders/.travis.yml @@ -1,3 +1,4 @@ language: node_js node_js: - "0.10" + - "0.11" diff --git a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/LICENSE b/node_modules/mysql2/node_modules/named-placeholders/LICENSE similarity index 86% rename from node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/LICENSE rename to node_modules/mysql2/node_modules/named-placeholders/LICENSE index 8f29698..bc0223f 100644 --- a/node_modules/grunt-istanbul/node_modules/istanbul/node_modules/async/LICENSE +++ b/node_modules/mysql2/node_modules/named-placeholders/LICENSE @@ -1,4 +1,6 @@ -Copyright (c) 2010-2014 Caolan McMahon +The MIT License (MIT) + +Copyright (c) 2014 Andrey Sidorov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -7,13 +9,13 @@ 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 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. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/mysql2/node_modules/named-placeholders/README.md b/node_modules/mysql2/node_modules/named-placeholders/README.md new file mode 100644 index 0000000..eb2e7a7 --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/README.md @@ -0,0 +1,29 @@ +[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=sidorares&url=https://github.com/sidorares/named-placeholders&title=named-placeholders&language=&tags=github&category=software) + +[![NPM](https://nodei.co/npm/named-placeholders.png?downloads=true&stars=true)](https://nodei.co/npm/named-placeholders/) + +[![Build Status](https://secure.travis-ci.org/sidorares/named-placeholders.png)](http://travis-ci.org/sidorares/named-placeholders) + +# named-placeholders + +compiles "select foo where foo.id = :bar and foo.baz < :baz" into "select foo where foo.id = ? and foo.baz < ?" + ["bar", "baz"] + +## usage + +```sh +npm install named-placeholders +``` + +see [this mysql2 discussion](https://github.com/sidorares/node-mysql2/issues/117) + +```js +var mysql = require('mysql'); +var toUnnamed = require('named-placeholders')(); + +var q = toUnnamed('select 1+:test', { test: 123}); +mysl.createConnection().query(q[0], q[1]); +``` + +## credits + +parser is based on @mscdex code of his excellent [node-mariasql](https://github.com/mscdex/node-mariasql) library diff --git a/node_modules/mysql2/node_modules/named-placeholders/index.js b/node_modules/mysql2/node_modules/named-placeholders/index.js new file mode 100644 index 0000000..912ed05 --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/index.js @@ -0,0 +1,110 @@ +// based on code from Brian White @mscdex mariasql library - https://github.com/mscdex/node-mariasql/blob/master/lib/Client.js#L272-L332 +// License: https://github.com/mscdex/node-mariasql/blob/master/LICENSE + +var RE_PARAM = /(?:\?)|(?::(\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g, + DQUOTE = 34, + SQUOTE = 39, + BSLASH = 92; + +var parse = function(query) { + var cqfn; + if (this._queryCache && (cqfn = this._queryCache.get(query))) + return cqfn; + + var ppos = RE_PARAM.exec(query), curpos = 0, start = 0, end, parts = [], + i, chr, inQuote = false, escape = false, qchr, tokens = [], qcnt = 0, fn; + + if (ppos) { + do { + for (i=curpos,end=ppos.index; i +Brian Cottingham +Carlos Brito Lage +Jesse Dailey +Kevin O'Hara +Marco Rogers +Mark Cavage +Marko Mikulicic +Nathan Rajlich +Satheesh Natesan +Trent Mick +ashleybrener +n4kz diff --git a/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/LICENSE b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/LICENSE new file mode 100644 index 0000000..05a4010 --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/LICENSE @@ -0,0 +1,23 @@ +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/mysql2/node_modules/named-placeholders/node_modules/lru-cache/README.md b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/README.md new file mode 100644 index 0000000..03ee0f9 --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/README.md @@ -0,0 +1,97 @@ +# lru cache + +A cache object that deletes the least-recently-used items. + +## Usage: + +```javascript +var LRU = require("lru-cache") + , options = { max: 500 + , length: function (n) { return n * 2 } + , dispose: function (key, n) { n.close() } + , maxAge: 1000 * 60 * 60 } + , cache = LRU(options) + , otherCache = LRU(50) // sets just the max size + +cache.set("key", "value") +cache.get("key") // "value" + +cache.reset() // empty the cache +``` + +If you put more stuff in it, then items will fall out. + +If you try to put an oversized thing in it, then it'll fall out right +away. + +## Options + +* `max` The maximum size of the cache, checked by applying the length + function to all values in the cache. Not setting this is kind of + silly, since that's the whole purpose of this lib, but it defaults + to `Infinity`. +* `maxAge` Maximum age in ms. Items are not pro-actively pruned out + as they age, but if you try to get an item that is too old, it'll + drop it and return undefined instead of giving it to you. +* `length` Function that is used to calculate the length of stored + items. If you're storing strings or buffers, then you probably want + to do something like `function(n){return n.length}`. The default is + `function(n){return 1}`, which is fine if you want to store `n` + like-sized things. +* `dispose` Function that is called on items when they are dropped + from the cache. This can be handy if you want to close file + descriptors or do other cleanup tasks when items are no longer + accessible. Called with `key, value`. It's called *before* + actually removing the item from the internal cache, so if you want + to immediately put it back in, you'll have to do that in a + `nextTick` or `setTimeout` callback or it won't do anything. +* `stale` By default, if you set a `maxAge`, it'll only actually pull + stale items out of the cache when you `get(key)`. (That is, it's + not pre-emptively doing a `setTimeout` or anything.) If you set + `stale:true`, it'll return the stale value before deleting it. If + you don't set this, then it'll return `undefined` when you try to + get a stale entry, as if it had already been deleted. + +## API + +* `set(key, value)` +* `get(key) => value` + + Both of these will update the "recently used"-ness of the key. + They do what you think. + +* `peek(key)` + + Returns the key value (or `undefined` if not found) without + updating the "recently used"-ness of the key. + + (If you find yourself using this a lot, you *might* be using the + wrong sort of data structure, but there are some use cases where + it's handy.) + +* `del(key)` + + Deletes a key out of the cache. + +* `reset()` + + Clear the cache entirely, throwing away all values. + +* `has(key)` + + Check if a key is in the cache, without updating the recent-ness + or deleting it for being stale. + +* `forEach(function(value,key,cache), [thisp])` + + Just like `Array.prototype.forEach`. Iterates over all the keys + in the cache, in order of recent-ness. (Ie, more recently used + items are iterated over first.) + +* `keys()` + + Return an array of the keys in the cache. + +* `values()` + + Return an array of the values in the cache. diff --git a/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/lib/lru-cache.js b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/lib/lru-cache.js new file mode 100644 index 0000000..d1d1381 --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/lib/lru-cache.js @@ -0,0 +1,252 @@ +;(function () { // closure for web browsers + +if (typeof module === 'object' && module.exports) { + module.exports = LRUCache +} else { + // just set the global for non-node platforms. + this.LRUCache = LRUCache +} + +function hOP (obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key) +} + +function naiveLength () { return 1 } + +function LRUCache (options) { + if (!(this instanceof LRUCache)) + return new LRUCache(options) + + if (typeof options === 'number') + options = { max: options } + + if (!options) + options = {} + + this._max = options.max + // Kind of weird to have a default max of Infinity, but oh well. + if (!this._max || !(typeof this._max === "number") || this._max <= 0 ) + this._max = Infinity + + this._lengthCalculator = options.length || naiveLength + if (typeof this._lengthCalculator !== "function") + this._lengthCalculator = naiveLength + + this._allowStale = options.stale || false + this._maxAge = options.maxAge || null + this._dispose = options.dispose + this.reset() +} + +// resize the cache when the max changes. +Object.defineProperty(LRUCache.prototype, "max", + { set : function (mL) { + if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity + this._max = mL + if (this._length > this._max) trim(this) + } + , get : function () { return this._max } + , enumerable : true + }) + +// resize the cache when the lengthCalculator changes. +Object.defineProperty(LRUCache.prototype, "lengthCalculator", + { set : function (lC) { + if (typeof lC !== "function") { + this._lengthCalculator = naiveLength + this._length = this._itemCount + for (var key in this._cache) { + this._cache[key].length = 1 + } + } else { + this._lengthCalculator = lC + this._length = 0 + for (var key in this._cache) { + this._cache[key].length = this._lengthCalculator(this._cache[key].value) + this._length += this._cache[key].length + } + } + + if (this._length > this._max) trim(this) + } + , get : function () { return this._lengthCalculator } + , enumerable : true + }) + +Object.defineProperty(LRUCache.prototype, "length", + { get : function () { return this._length } + , enumerable : true + }) + + +Object.defineProperty(LRUCache.prototype, "itemCount", + { get : function () { return this._itemCount } + , enumerable : true + }) + +LRUCache.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + var i = 0; + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + i++ + var hit = this._lruList[k] + if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { + del(this, hit) + if (!this._allowStale) hit = undefined + } + if (hit) { + fn.call(thisp, hit.value, hit.key, this) + } + } +} + +LRUCache.prototype.keys = function () { + var keys = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + keys[i++] = hit.key + } + return keys +} + +LRUCache.prototype.values = function () { + var values = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + values[i++] = hit.value + } + return values +} + +LRUCache.prototype.reset = function () { + if (this._dispose && this._cache) { + for (var k in this._cache) { + this._dispose(k, this._cache[k].value) + } + } + + this._cache = Object.create(null) // hash of items by key + this._lruList = Object.create(null) // list of items in order of use recency + this._mru = 0 // most recently used + this._lru = 0 // least recently used + this._length = 0 // number of items in the list + this._itemCount = 0 +} + +// Provided for debugging/dev purposes only. No promises whatsoever that +// this API stays stable. +LRUCache.prototype.dump = function () { + return this._cache +} + +LRUCache.prototype.dumpLru = function () { + return this._lruList +} + +LRUCache.prototype.set = function (key, value) { + if (hOP(this._cache, key)) { + // dispose of the old one before overwriting + if (this._dispose) this._dispose(key, this._cache[key].value) + if (this._maxAge) this._cache[key].now = Date.now() + this._cache[key].value = value + this.get(key) + return true + } + + var len = this._lengthCalculator(value) + var age = this._maxAge ? Date.now() : 0 + var hit = new Entry(key, value, this._mru++, len, age) + + // oversized objects fall out of cache automatically. + if (hit.length > this._max) { + if (this._dispose) this._dispose(key, value) + return false + } + + this._length += hit.length + this._lruList[hit.lu] = this._cache[key] = hit + this._itemCount ++ + + if (this._length > this._max) trim(this) + return true +} + +LRUCache.prototype.has = function (key) { + if (!hOP(this._cache, key)) return false + var hit = this._cache[key] + if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { + return false + } + return true +} + +LRUCache.prototype.get = function (key) { + return get(this, key, true) +} + +LRUCache.prototype.peek = function (key) { + return get(this, key, false) +} + +LRUCache.prototype.pop = function () { + var hit = this._lruList[this._lru] + del(this, hit) + return hit || null +} + +LRUCache.prototype.del = function (key) { + del(this, this._cache[key]) +} + +function get (self, key, doUse) { + var hit = self._cache[key] + if (hit) { + if (self._maxAge && (Date.now() - hit.now > self._maxAge)) { + del(self, hit) + if (!self._allowStale) hit = undefined + } else { + if (doUse) use(self, hit) + } + if (hit) hit = hit.value + } + return hit +} + +function use (self, hit) { + shiftLU(self, hit) + hit.lu = self._mru ++ + self._lruList[hit.lu] = hit +} + +function trim (self) { + while (self._lru < self._mru && self._length > self._max) + del(self, self._lruList[self._lru]) +} + +function shiftLU (self, hit) { + delete self._lruList[ hit.lu ] + while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ +} + +function del (self, hit) { + if (hit) { + if (self._dispose) self._dispose(hit.key, hit.value) + self._length -= hit.length + self._itemCount -- + delete self._cache[ hit.key ] + shiftLU(self, hit) + } +} + +// classy, since V8 prefers predictable objects. +function Entry (key, value, lu, length, now) { + this.key = key + this.value = value + this.lu = lu + this.length = length + this.now = now +} + +})() diff --git a/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/package.json b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/package.json new file mode 100644 index 0000000..9bd1c47 --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/package.json @@ -0,0 +1,33 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "2.5.0", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "scripts": { + "test": "tap test --gc" + }, + "main": "lib/lru-cache.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "tap": "", + "weak": "" + }, + "license": { + "type": "MIT", + "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" + }, + "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-lru-cache/issues" + }, + "homepage": "https://github.com/isaacs/node-lru-cache", + "_id": "lru-cache@2.5.0", + "_from": "lru-cache@2.5.0" +} diff --git a/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/test/basic.js b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/test/basic.js new file mode 100644 index 0000000..f72697c --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/test/basic.js @@ -0,0 +1,369 @@ +var test = require("tap").test + , LRU = require("../") + +test("basic", function (t) { + var cache = new LRU({max: 10}) + cache.set("key", "value") + t.equal(cache.get("key"), "value") + t.equal(cache.get("nada"), undefined) + t.equal(cache.length, 1) + t.equal(cache.max, 10) + t.end() +}) + +test("least recently set", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), "B") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("lru recently gotten", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + cache.get("a") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), undefined) + t.equal(cache.get("a"), "A") + t.end() +}) + +test("del", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.del("a") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("max", function (t) { + var cache = new LRU(3) + + // test changing the max, verify that the LRU items get dropped. + cache.max = 100 + for (var i = 0; i < 100; i ++) cache.set(i, i) + t.equal(cache.length, 100) + for (var i = 0; i < 100; i ++) { + t.equal(cache.get(i), i) + } + cache.max = 3 + t.equal(cache.length, 3) + for (var i = 0; i < 97; i ++) { + t.equal(cache.get(i), undefined) + } + for (var i = 98; i < 100; i ++) { + t.equal(cache.get(i), i) + } + + // now remove the max restriction, and try again. + cache.max = "hello" + for (var i = 0; i < 100; i ++) cache.set(i, i) + t.equal(cache.length, 100) + for (var i = 0; i < 100; i ++) { + t.equal(cache.get(i), i) + } + // should trigger an immediate resize + cache.max = 3 + t.equal(cache.length, 3) + for (var i = 0; i < 97; i ++) { + t.equal(cache.get(i), undefined) + } + for (var i = 98; i < 100; i ++) { + t.equal(cache.get(i), i) + } + t.end() +}) + +test("reset", function (t) { + var cache = new LRU(10) + cache.set("a", "A") + cache.set("b", "B") + cache.reset() + t.equal(cache.length, 0) + t.equal(cache.max, 10) + t.equal(cache.get("a"), undefined) + t.equal(cache.get("b"), undefined) + t.end() +}) + + +// Note: `.dump()` is a debugging tool only. No guarantees are made +// about the format/layout of the response. +test("dump", function (t) { + var cache = new LRU(10) + var d = cache.dump(); + t.equal(Object.keys(d).length, 0, "nothing in dump for empty cache") + cache.set("a", "A") + var d = cache.dump() // { a: { key: "a", value: "A", lu: 0 } } + t.ok(d.a) + t.equal(d.a.key, "a") + t.equal(d.a.value, "A") + t.equal(d.a.lu, 0) + + cache.set("b", "B") + cache.get("b") + d = cache.dump() + t.ok(d.b) + t.equal(d.b.key, "b") + t.equal(d.b.value, "B") + t.equal(d.b.lu, 2) + + t.end() +}) + + +test("basic with weighed length", function (t) { + var cache = new LRU({ + max: 100, + length: function (item) { return item.size } + }) + cache.set("key", {val: "value", size: 50}) + t.equal(cache.get("key").val, "value") + t.equal(cache.get("nada"), undefined) + t.equal(cache.lengthCalculator(cache.get("key")), 50) + t.equal(cache.length, 50) + t.equal(cache.max, 100) + t.end() +}) + + +test("weighed length item too large", function (t) { + var cache = new LRU({ + max: 10, + length: function (item) { return item.size } + }) + t.equal(cache.max, 10) + + // should fall out immediately + cache.set("key", {val: "value", size: 50}) + + t.equal(cache.length, 0) + t.equal(cache.get("key"), undefined) + t.end() +}) + +test("least recently set with weighed length", function (t) { + var cache = new LRU({ + max:8, + length: function (item) { return item.length } + }) + cache.set("a", "A") + cache.set("b", "BB") + cache.set("c", "CCC") + cache.set("d", "DDDD") + t.equal(cache.get("d"), "DDDD") + t.equal(cache.get("c"), "CCC") + t.equal(cache.get("b"), undefined) + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("lru recently gotten with weighed length", function (t) { + var cache = new LRU({ + max: 8, + length: function (item) { return item.length } + }) + cache.set("a", "A") + cache.set("b", "BB") + cache.set("c", "CCC") + cache.get("a") + cache.get("b") + cache.set("d", "DDDD") + t.equal(cache.get("c"), undefined) + t.equal(cache.get("d"), "DDDD") + t.equal(cache.get("b"), "BB") + t.equal(cache.get("a"), "A") + t.end() +}) + +test("set returns proper booleans", function(t) { + var cache = new LRU({ + max: 5, + length: function (item) { return item.length } + }) + + t.equal(cache.set("a", "A"), true) + + // should return false for max exceeded + t.equal(cache.set("b", "donuts"), false) + + t.equal(cache.set("b", "B"), true) + t.equal(cache.set("c", "CCCC"), true) + t.end() +}) + +test("drop the old items", function(t) { + var cache = new LRU({ + max: 5, + maxAge: 50 + }) + + cache.set("a", "A") + + setTimeout(function () { + cache.set("b", "b") + t.equal(cache.get("a"), "A") + }, 25) + + setTimeout(function () { + cache.set("c", "C") + // timed out + t.notOk(cache.get("a")) + }, 60) + + setTimeout(function () { + t.notOk(cache.get("b")) + t.equal(cache.get("c"), "C") + }, 90) + + setTimeout(function () { + t.notOk(cache.get("c")) + t.end() + }, 155) +}) + +test("disposal function", function(t) { + var disposed = false + var cache = new LRU({ + max: 1, + dispose: function (k, n) { + disposed = n + } + }) + + cache.set(1, 1) + cache.set(2, 2) + t.equal(disposed, 1) + cache.set(3, 3) + t.equal(disposed, 2) + cache.reset() + t.equal(disposed, 3) + t.end() +}) + +test("disposal function on too big of item", function(t) { + var disposed = false + var cache = new LRU({ + max: 1, + length: function (k) { + return k.length + }, + dispose: function (k, n) { + disposed = n + } + }) + var obj = [ 1, 2 ] + + t.equal(disposed, false) + cache.set("obj", obj) + t.equal(disposed, obj) + t.end() +}) + +test("has()", function(t) { + var cache = new LRU({ + max: 1, + maxAge: 10 + }) + + cache.set('foo', 'bar') + t.equal(cache.has('foo'), true) + cache.set('blu', 'baz') + t.equal(cache.has('foo'), false) + t.equal(cache.has('blu'), true) + setTimeout(function() { + t.equal(cache.has('blu'), false) + t.end() + }, 15) +}) + +test("stale", function(t) { + var cache = new LRU({ + maxAge: 10, + stale: true + }) + + cache.set('foo', 'bar') + t.equal(cache.get('foo'), 'bar') + t.equal(cache.has('foo'), true) + setTimeout(function() { + t.equal(cache.has('foo'), false) + t.equal(cache.get('foo'), 'bar') + t.equal(cache.get('foo'), undefined) + t.end() + }, 15) +}) + +test("lru update via set", function(t) { + var cache = LRU({ max: 2 }); + + cache.set('foo', 1); + cache.set('bar', 2); + cache.del('bar'); + cache.set('baz', 3); + cache.set('qux', 4); + + t.equal(cache.get('foo'), undefined) + t.equal(cache.get('bar'), undefined) + t.equal(cache.get('baz'), 3) + t.equal(cache.get('qux'), 4) + t.end() +}) + +test("least recently set w/ peek", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + t.equal(cache.peek("a"), "A") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), "B") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("pop the least used item", function (t) { + var cache = new LRU(3) + , last + + cache.set("a", "A") + cache.set("b", "B") + cache.set("c", "C") + + t.equal(cache.length, 3) + t.equal(cache.max, 3) + + // Ensure we pop a, c, b + cache.get("b", "B") + + last = cache.pop() + t.equal(last.key, "a") + t.equal(last.value, "A") + t.equal(cache.length, 2) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last.key, "c") + t.equal(last.value, "C") + t.equal(cache.length, 1) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last.key, "b") + t.equal(last.value, "B") + t.equal(cache.length, 0) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last, null) + t.equal(cache.length, 0) + t.equal(cache.max, 3) + + t.end() +}) diff --git a/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/test/foreach.js b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/test/foreach.js new file mode 100644 index 0000000..eefb80d --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/test/foreach.js @@ -0,0 +1,52 @@ +var test = require('tap').test +var LRU = require('../') + +test('forEach', function (t) { + var l = new LRU(5) + for (var i = 0; i < 10; i ++) { + l.set(i.toString(), i.toString(2)) + } + + var i = 9 + l.forEach(function (val, key, cache) { + t.equal(cache, l) + t.equal(key, i.toString()) + t.equal(val, i.toString(2)) + i -= 1 + }) + + // get in order of most recently used + l.get(6) + l.get(8) + + var order = [ 8, 6, 9, 7, 5 ] + var i = 0 + + l.forEach(function (val, key, cache) { + var j = order[i ++] + t.equal(cache, l) + t.equal(key, j.toString()) + t.equal(val, j.toString(2)) + }) + + t.end() +}) + +test('keys() and values()', function (t) { + var l = new LRU(5) + for (var i = 0; i < 10; i ++) { + l.set(i.toString(), i.toString(2)) + } + + t.similar(l.keys(), ['9', '8', '7', '6', '5']) + t.similar(l.values(), ['1001', '1000', '111', '110', '101']) + + // get in order of most recently used + l.get(6) + l.get(8) + + t.similar(l.keys(), ['8', '6', '9', '7', '5']) + t.similar(l.values(), ['1000', '110', '1001', '111', '101']) + + t.end() +}) diff --git a/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/test/memory-leak.js b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/test/memory-leak.js new file mode 100644 index 0000000..7af45b0 --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/node_modules/lru-cache/test/memory-leak.js @@ -0,0 +1,50 @@ +#!/usr/bin/env node --expose_gc + +var weak = require('weak'); +var test = require('tap').test +var LRU = require('../') +var l = new LRU({ max: 10 }) +var refs = 0 +function X() { + refs ++ + weak(this, deref) +} + +function deref() { + refs -- +} + +test('no leaks', function (t) { + // fill up the cache + for (var i = 0; i < 100; i++) { + l.set(i, new X); + // throw some gets in there, too. + if (i % 2 === 0) + l.get(i / 2) + } + + gc() + + var start = process.memoryUsage() + + // capture the memory + var startRefs = refs + + // do it again, but more + for (var i = 0; i < 10000; i++) { + l.set(i, new X); + // throw some gets in there, too. + if (i % 2 === 0) + l.get(i / 2) + } + + gc() + + var end = process.memoryUsage() + t.equal(refs, startRefs, 'no leaky refs') + + console.error('start: %j\n' + + 'end: %j', start, end); + t.pass(); + t.end(); +}) diff --git a/node_modules/mysql2/node_modules/named-placeholders/package.json b/node_modules/mysql2/node_modules/named-placeholders/package.json new file mode 100644 index 0000000..754539b --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/package.json @@ -0,0 +1,58 @@ +{ + "name": "named-placeholders", + "version": "0.1.3", + "description": "sql named placeholders to unnamed compiler", + "main": "index.js", + "scripts": { + "test": "mocha" + }, + "repository": { + "type": "git", + "url": "https://github.com/sidorares/named-placeholders" + }, + "keywords": [ + "sql", + "pdo", + "named", + "placeholders" + ], + "author": { + "name": "Andrey Sidorov", + "email": "sidorares@yandex.com" + }, + "license": "MIT", + "devDependencies": { + "mocha": "1.21.4", + "mocha.md": "0.1.0", + "should": "4.0.4" + }, + "dependencies": { + "lru-cache": "2.5.0" + }, + "gitHead": "78fb4ea2b3b5279e4778bd96c232a80fa18b0511", + "bugs": { + "url": "https://github.com/sidorares/named-placeholders/issues" + }, + "homepage": "https://github.com/sidorares/named-placeholders", + "_id": "named-placeholders@0.1.3", + "_shasum": "353776ee259ad105227e13852eef4215ac631e84", + "_from": "named-placeholders@0.1.3", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "sidorares", + "email": "sidorares@yandex.com" + }, + "maintainers": [ + { + "name": "sidorares", + "email": "sidorares@yandex.com" + } + ], + "dist": { + "shasum": "353776ee259ad105227e13852eef4215ac631e84", + "tarball": "http://registry.npmjs.org/named-placeholders/-/named-placeholders-0.1.3.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-0.1.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/mysql2/node_modules/named-placeholders/test/example.md b/node_modules/mysql2/node_modules/named-placeholders/test/example.md new file mode 100644 index 0000000..9272e33 --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/test/example.md @@ -0,0 +1,13 @@ +# given input query with named parameters + +it should build corresponding query with `?` placeholders and fill array of parameres from input object + +```js + var compile = require('..')(); + + var query = 'Select users.json,EXISTS(Select 1 from moderators where moderators.id = :id) as is_moderator from users where users.id = :id and users.status = :status and users.complete_status = :complete_status'; + + compile(query, {id: 123, status: 'Yes!', complete_status: 'No!'}) + .should.eql([ 'Select users.json,EXISTS(Select 1 from moderators where moderators.id = ?) as is_moderator from users where users.id = ? and users.status = ? and users.complete_status = ?', + [ 123, 123, 'Yes!', 'No!' ] ]); +``` diff --git a/node_modules/mysql2/node_modules/named-placeholders/test/mocha.opts b/node_modules/mysql2/node_modules/named-placeholders/test/mocha.opts new file mode 100644 index 0000000..d12be27 --- /dev/null +++ b/node_modules/mysql2/node_modules/named-placeholders/test/mocha.opts @@ -0,0 +1,2 @@ +--require should +--compilers md:mocha.md diff --git a/node_modules/mysql2/package.json b/node_modules/mysql2/package.json index a25f9e5..4bf64c2 100644 --- a/node_modules/mysql2/package.json +++ b/node_modules/mysql2/package.json @@ -1,13 +1,15 @@ { "name": "mysql2", - "version": "0.12.5", + "version": "0.15.0", "description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS", "main": "index.js", "directories": { "example": "examples" }, "scripts": { - "test": "./test/run.js" + "test": "./test/run.js", + "benchmark": "./benchmarks/run-unit.js", + "benchmarks": "./benchmarks/run-unit.js" }, "repository": { "type": "git", @@ -24,21 +26,26 @@ }, "license": "MIT", "dependencies": { - "bn.js": "0.11.7", - "cardinal": "^0.4.4", - "fastqueue": "~0.1.0" + "bn.js": "0.16.0", + "cardinal": "0.4.4", + "named-placeholders": "0.1.3", + "double-ended-queue": "2.0.0-0" }, "devDependencies": { - "urun": "0.0.6" + "progress": "1.1.8", + "readable-stream": "1.0.33", + "urun": "0.0.8", + "utest": "0.0.8" }, + "gitHead": "3b27a177f9c77935ad7d5170c65f745a56caf445", "bugs": { "url": "https://github.com/sidorares/node-mysql2/issues" }, "homepage": "https://github.com/sidorares/node-mysql2", - "_id": "mysql2@0.12.5", - "_shasum": "b2d527d276da40490d89d66ae2c0f44c1b9cdcaf", - "_from": "mysql2@0.12.5", - "_npmVersion": "1.4.9", + "_id": "mysql2@0.15.0", + "_shasum": "d203d60f8c680557edcb85d45839608c5daeb865", + "_from": "mysql2@>=0.15.0 <0.16.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "sidorares", "email": "sidorares@yandex.com" @@ -54,9 +61,9 @@ } ], "dist": { - "shasum": "b2d527d276da40490d89d66ae2c0f44c1b9cdcaf", - "tarball": "http://registry.npmjs.org/mysql2/-/mysql2-0.12.5.tgz" + "shasum": "d203d60f8c680557edcb85d45839608c5daeb865", + "tarball": "http://registry.npmjs.org/mysql2/-/mysql2-0.15.0.tgz" }, - "_resolved": "https://registry.npmjs.org/mysql2/-/mysql2-0.12.5.tgz", + "_resolved": "https://registry.npmjs.org/mysql2/-/mysql2-0.15.0.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/mysql2/select.js b/node_modules/mysql2/select.js new file mode 100644 index 0000000..d34a925 --- /dev/null +++ b/node_modules/mysql2/select.js @@ -0,0 +1,52 @@ +var pool = require('./index.js').createPool({ database: 'test', connectionLimit: 100}); +//var pool = require('mysql').createPool({ database: 'test', connectionLimit: 100}); +var count = 0; +var start = process.hrtime(); +var start1 = process.hrtime(); +var rowsInterval = 10000000; +//var q = 'select 1'; +var q = 'select id from insert_test limit ? '; +function bench() { + //conn.query(q, function(err, rows) { + //conn.query(q, [ Number(process.argv[3]) ], function(err, rows) { + pool.getConnection(function(err, conn) { + debugger; + //conn.changeUser({ user: 'benchmarkdbuser', password: 'benchmarkdbpass'}, function() { console.log('!!!'); + conn.changeUser({ user: 'root', password: ''}, function() { console.log('!!!'); + + conn.query('select USER()', console.log); + + }); + + return; + + conn.execute(q, [ Number(process.argv[3]) ]).on('result', function(row) { + count++; +/* + if (count % rowsInterval == 0) { + var end = process.hrtime(start); + var rps = count*1e9/(end[0]*1e9+end[1]); + var end = process.hrtime(start1); + var rpslocal = rowsInterval*1e9/(end[0]*1e9+end[1]); + console.log(count, rps, rpslocal); + start1 = process.hrtime(); + } +*/ + }).on('end', function() { + if (count > 10*rowsInterval) { + var end = process.hrtime(start1); + var rpslocal = rowsInterval*10*1e9/(end[0]*1e9+end[1]); + console.log(count, rpslocal); + return pool.end(); + } + conn.release(); + bench(); + }); + }); +} + +var n = parseInt(process.argv[2], 10); +for(; n > 0; --n) { + console.log('starting bench') + bench(); +} diff --git a/node_modules/mysql2/test/common.js b/node_modules/mysql2/test/common.js index 02c71a9..ebd2fec 100644 --- a/node_modules/mysql2/test/common.js +++ b/node_modules/mysql2/test/common.js @@ -6,6 +6,8 @@ var config = { port: process.env.MYSQL_PORT || 3306 } +module.exports.SqlString = require('../lib/sql_string.js'); + module.exports.createConnection = function(args, callback) { // hrtime polyfill for old node versions: if (!process.hrtime) @@ -51,11 +53,12 @@ module.exports.createConnection = function(args, callback) { return driver.createConnection({ host: config.host, - user: config.user, - password: config.password, - database: config.database, + user: (args && args.user) || config.user, + password: (args && args.password) || config.password, + database: (args && args.database) || config.database, multipleStatements: args ? args.multipleStatements : false, port: (args && args.port) || config.port, + debug: process.env.DEBUG, dateStrings: args && args.dateStrings }); }; @@ -103,7 +106,7 @@ module.exports.createServer = function(cb) { }); //conn.on('end', ); }); - server.listen(3307, undefined, undefined, cb); + server.listen(3307, cb); return server; } diff --git a/node_modules/mysql2/test/integration/connection/test-binary-charset-string.js b/node_modules/mysql2/test/integration/connection/test-binary-charset-string.js index 403011d..fe32707 100644 --- a/node_modules/mysql2/test/integration/connection/test-binary-charset-string.js +++ b/node_modules/mysql2/test/integration/connection/test-binary-charset-string.js @@ -54,12 +54,9 @@ connection.execute(query1, [], function(err, _rows, _fields) { if (err) throw err; rows3 = _rows; fields3 = _fields; + connection.end(); }); -connection.end(); - - -connection.end(); process.on('exit', function() { assert.deepEqual(rows, [{"x'010203'": Buffer([1, 2, 3])}]); diff --git a/node_modules/mysql2/test/integration/connection/test-buffer-params.js b/node_modules/mysql2/test/integration/connection/test-buffer-params.js index 59a0950..b62b8e1 100644 --- a/node_modules/mysql2/test/integration/connection/test-buffer-params.js +++ b/node_modules/mysql2/test/integration/connection/test-buffer-params.js @@ -18,9 +18,9 @@ connection.query('SELECT HEX(?) as buf', [buf], function(err, _rows, _fields) { if (err) throw err; rows1 = _rows; fields1 = _fields; + connection.end(); }); -connection.end(); process.on('exit', function() { assert.deepEqual(rows, [{buf: buf.toString('hex').toUpperCase()}]); diff --git a/node_modules/mysql2/test/integration/connection/test-change-user.js b/node_modules/mysql2/test/integration/connection/test-change-user.js new file mode 100644 index 0000000..f3715aa --- /dev/null +++ b/node_modules/mysql2/test/integration/connection/test-change-user.js @@ -0,0 +1,57 @@ +var assert = require('assert'); +var common = require('../../common'); +var connection = common.createConnection(); + +// create test user first +connection.query("GRANT ALL ON *.* TO 'changeuser1'@'localhost' IDENTIFIED BY 'changeuser1pass'"); +connection.query("GRANT ALL ON *.* TO 'changeuser2'@'localhost' IDENTIFIED BY 'changeuser2pass'"); +connection.query('FLUSH PRIVILEGES'); + +connection.changeUser({ + user: 'changeuser1', + password: 'changeuser1pass' +}); +connection.query('select user()', function(err, rows) { + if (err) throw err; + assert.deepEqual(rows, [ { 'user()': 'changeuser1@localhost' } ]); +}); + +connection.changeUser({ + user: 'changeuser2', + password: 'changeuser2pass' +}); + +connection.query('select user()', function(err, rows) { + if (err) throw err; + assert.deepEqual(rows, [ { 'user()': 'changeuser2@localhost' } ]); +}); + +connection.changeUser({ + user: 'changeuser1', + passwordSha1: new Buffer('f961d39c82138dcec42b8d0dcb3e40a14fb7e8cd', 'hex') // sha1(changeuser1pass) +}); +connection.query('select user()', function(err, rows) { + if (err) throw err; + assert.deepEqual(rows, [ { 'user()': 'changeuser1@localhost' } ]); +}); + +connection.end(); + +// from felixge/node-mysql/test/unit/connection/test-change-database-fatal-error.js: +// This test verifies that changeUser errors are treated as fatal errors. The +// rationale for that is that a failure to execute a changeUser sequence may +// cause unexpected behavior for queries that were enqueued under the +// assumption of changeUser to succeed. + +var beforeChange = 1; +connection.changeUser({database: 'does-not-exist'}, function (err) { + assert.ok(err, 'got error'); + assert.equal(err.code, 'ER_BAD_DB_ERROR'); + assert.equal(err.fatal, true); +}); + +connection.on('error', function(err) { + assert.ok(err, 'got disconnect'); + assert.equal(err.code, 'PROTOCOL_CONNECTION_LOST'); + assert.equal(beforeChange, 1); +}); diff --git a/node_modules/mysql2/test/integration/connection/test-connect-sha1.js b/node_modules/mysql2/test/integration/connection/test-connect-sha1.js new file mode 100644 index 0000000..bf7369b --- /dev/null +++ b/node_modules/mysql2/test/integration/connection/test-connect-sha1.js @@ -0,0 +1,68 @@ +var mysql = require('../../../index.js'); +var auth = require('../../../lib/auth_41.js'); +var assert = require('assert'); + +var server; + +function authenticate(params, cb) { + var doubleSha = auth.doubleSha1('testpassword'); + var isValid = auth.verifyToken(params.authPluginData1, params.authPluginData2, params.authToken, doubleSha); + assert(isValid); + cb(null); +} + +var queryCalls = 0; + +var server = mysql.createServer(); +server.listen(3307); +server.on('connection', function(conn) { + conn.serverHandshake({ + protocolVersion: 10, + serverVersion: 'node.js rocks', + connectionId: 1234, + statusFlags: 2, + characterSet: 8, + capabilityFlags: 0xffffff, + authCallback: authenticate + }); + conn.on('query', function(sql) { + assert.equal(sql, 'select 1+1'); + queryCalls++; + conn.close(); + }); +}); + +var connection = mysql.createConnection({ + port: 3307, + user: 'testuser', + database: 'testdatabase', + passwordSha1: Buffer('8bb6118f8fd6935ad0876a3be34a717d32708ffd', 'hex') +}); + +connection.on('error', function(err) { + assert.equal(err.code, 'PROTOCOL_CONNECTION_LOST'); +}); + +connection.query('select 1+1', function(err) { + assert.equal(err.code, 'PROTOCOL_CONNECTION_LOST'); + server._server.close(); +}); + +var _1_2 = false; +var _1_3 = false; + +connection.query('select 1+2', function(err) { + assert.equal(err.code, 'PROTOCOL_CONNECTION_LOST'); + _1_2 = true; +}); + +connection.query('select 1+3', function(err) { + assert.equal(err.code, 'PROTOCOL_CONNECTION_LOST'); + _1_3 = true; +}); + +process.on('exit', function() { + assert.equal(queryCalls, 1); + assert.equal(_1_2, true); + assert.equal(_1_3, true); +}); diff --git a/node_modules/mysql2/test/integration/connection/test-custom-date-parameter.js b/node_modules/mysql2/test/integration/connection/test-custom-date-parameter.js index dae6fa7..00f3cf8 100644 --- a/node_modules/mysql2/test/integration/connection/test-custom-date-parameter.js +++ b/node_modules/mysql2/test/integration/connection/test-custom-date-parameter.js @@ -16,9 +16,9 @@ connection.execute('SELECT UNIX_TIMESTAMP(?) t', [new Date('1990-08-08 UTC')], f if (err) throw err; rows = _rows; console.log(_rows, _fields); + connection.end(); }); -connection.end(); process.on('exit', function() { assert.deepEqual(rows, [{t: 650073600}]); diff --git a/node_modules/mysql2/test/integration/connection/test-date-parameter.js b/node_modules/mysql2/test/integration/connection/test-date-parameter.js index e2b1ddb..9d87209 100644 --- a/node_modules/mysql2/test/integration/connection/test-date-parameter.js +++ b/node_modules/mysql2/test/integration/connection/test-date-parameter.js @@ -8,9 +8,9 @@ connection.execute('SELECT UNIX_TIMESTAMP(?) t', [new Date('1990-01-01 UTC')], f if (err) throw err; rows = _rows; console.log(_rows, _fields); + connection.end(); }); -connection.end(); process.on('exit', function() { assert.deepEqual(rows, [{t: 631152000}]); diff --git a/node_modules/mysql2/test/integration/connection/test-datetime.js b/node_modules/mysql2/test/integration/connection/test-datetime.js index a608db6..1fff096 100644 --- a/node_modules/mysql2/test/integration/connection/test-datetime.js +++ b/node_modules/mysql2/test/integration/connection/test-datetime.js @@ -38,6 +38,7 @@ connection.query('select * from t', function(err, _rows, _fields) { connection.execute('select * from t', function(err, _rows, _fields) { if (err) throw err; rows3 = _rows; + connection.end(); }); connection1.query('select * from t', function(err, _rows, _fields) { @@ -50,11 +51,9 @@ connection1.execute('select * from t', function(err, _rows, _fields) { console.log(_rows); if (err) throw err; rows5 = _rows; + connection1.end(); }); -connection.end(); -connection1.end(); - process.on('exit', function() { assert.equal(rows[0].t.constructor, Date); assert.equal(rows[0].t.getDate(), date.getDate()); diff --git a/node_modules/mysql2/test/integration/connection/test-domains.js b/node_modules/mysql2/test/integration/connection/test-domains.js index f7ee8b4..e199a3f 100644 --- a/node_modules/mysql2/test/integration/connection/test-domains.js +++ b/node_modules/mysql2/test/integration/connection/test-domains.js @@ -10,7 +10,7 @@ d1.run(function() { var common = require('../../common'); var connection = common.createConnection(); var assert = require('assert'); - + d2.run(function() { connection.query('SELECT 1', function(err, _rows, _fields) { if (err) throw err; @@ -20,6 +20,7 @@ d1.run(function() { d3.run(function() { connection.execute('SELECT 1', function(err, _rows, _fields) { + connection.end(); if (err) throw err; throw new Error('inside domain 3'); }); @@ -31,7 +32,6 @@ d1.run(function() { }); }); - connection.end(); setTimeout(function() { throw new Error('inside domain 1'); }, 100); @@ -55,6 +55,6 @@ d1.on('error', function(err) { process.on('exit', function() { assert.equal(''+err1, 'Error: inside domain 1') assert.equal(''+err2, 'Error: inside domain 2') - assert.equal(''+err3, 'Error: inside domain 3') - assert.equal(''+err4, 'Error: inside domain 4') + assert.equal(''+err3, 'Error: inside domain 3') + assert.equal(''+err4, 'Error: inside domain 4') }); diff --git a/node_modules/mysql2/test/integration/connection/test-errors.js b/node_modules/mysql2/test/integration/connection/test-errors.js index 999f273..925ebaf 100644 --- a/node_modules/mysql2/test/integration/connection/test-errors.js +++ b/node_modules/mysql2/test/integration/connection/test-errors.js @@ -28,9 +28,9 @@ connection.execute('error in execute 1', []).on('error', function() { }); connection.query('error in query 1').on('error', function() { onQueryErrorEvent1 = true; + connection.end(); }); -connection.end(); process.on('exit', function() { assert.equal(onExecuteResultError, true); diff --git a/node_modules/mysql2/test/integration/connection/test-execute-1.js b/node_modules/mysql2/test/integration/connection/test-execute-1.js index 47c4255..3f8f0a5 100644 --- a/node_modules/mysql2/test/integration/connection/test-execute-1.js +++ b/node_modules/mysql2/test/integration/connection/test-execute-1.js @@ -43,9 +43,9 @@ connection.execute('SELECT * FROM announcements', function (err, rows) { assert.equal(rows[0].text, 'Расти борода, расти'); assert.equal(rows[1].title, 'Граждане Российской Федерации имеют право собираться мирно без оружия'); assert.equal(rows[1].text, 'проводить собрания, митинги и демонстрации, шествия и пикетирование'); + connection.end(); }); -connection.end(); process.on('exit', function() { assert.deepEqual(rows, [{'test': 124}]); diff --git a/node_modules/mysql2/test/integration/connection/test-execute-and-unprepare.js b/node_modules/mysql2/test/integration/connection/test-execute-and-unprepare.js new file mode 100644 index 0000000..c5c928c --- /dev/null +++ b/node_modules/mysql2/test/integration/connection/test-execute-and-unprepare.js @@ -0,0 +1,21 @@ +var common = require('../../common'); +var connection = common.createConnection(); +var assert = require('assert'); + +var max = 500; +var start = process.hrtime(); +function exec(i) { + var query = 'select 1+' + i; + connection.execute(query, function(err, rows, columns) { + connection.unprepare(query); + if (err) throw err; + if (i > max) + connection.end(); + else + exec(i+1); + }); +} +connection.query('SET GLOBAL max_prepared_stmt_count=10', function(err) { + if (err) throw err; + exec(1); +}); diff --git a/node_modules/mysql2/test/integration/connection/test-execute-cached.js b/node_modules/mysql2/test/integration/connection/test-execute-cached.js new file mode 100644 index 0000000..ee1b2c7 --- /dev/null +++ b/node_modules/mysql2/test/integration/connection/test-execute-cached.js @@ -0,0 +1,35 @@ +var common = require('../../common'); +var connection = common.createConnection(); +var assert = require('assert'); + +var rows = undefined; +var rows1 = undefined; +var rows3 = undefined; + +var q = 'select 1 + ? as test'; +var key = 'undefined/undefined/undefined' + q; + +connection.execute(q, [123], function(err, _rows, _fields) { + if (err) throw err; + rows = _rows; + connection.execute(q, [124], function(err, _rows, _fields) { + if (err) throw err; + rows1 = _rows; + connection.execute(q, [125], function(err, _rows, _fields) { + if (err) throw err; + rows2 = _rows; + assert(Object.keys(connection._statements).length == 1); + assert(connection._statements[key].query == q); + assert(connection._statements[key].parameters.length == 1); + connection.end(); + }); + }); +}); + + +process.on('exit', function() { + assert.deepEqual(rows, [{'test': 124}]); + assert.deepEqual(rows1, [{'test': 125}]); + assert.deepEqual(rows2, [{'test': 126}]); +}); + diff --git a/node_modules/mysql2/test/integration/connection/test-execute-newdecimal.js b/node_modules/mysql2/test/integration/connection/test-execute-newdecimal.js index 7b317b1..c0bebcb 100644 --- a/node_modules/mysql2/test/integration/connection/test-execute-newdecimal.js +++ b/node_modules/mysql2/test/integration/connection/test-execute-newdecimal.js @@ -10,8 +10,8 @@ connection.execute('SELECT f FROM t', function(err, _rows, _fields) { if (err) throw err; rows = _rows; fields = _fields; + connection.end(); }); -connection.end(); process.on('exit', function() { assert.deepEqual(rows, [{'f': '12345.6700'}]); diff --git a/node_modules/mysql2/test/integration/connection/test-execute-nocolumndef.js b/node_modules/mysql2/test/integration/connection/test-execute-nocolumndef.js new file mode 100644 index 0000000..7eb769c --- /dev/null +++ b/node_modules/mysql2/test/integration/connection/test-execute-nocolumndef.js @@ -0,0 +1,149 @@ +var common = require('../../common'); +var connection = common.createConnection(); +var assert = require('assert'); + +// https://github.com/sidorares/node-mysql2/issues/130 +// https://github.com/sidorares/node-mysql2/issues/37 +// binary protocol examples where `prepare` returns no column definitions but execute() does return fields/rows + +var rows; +var fields; + +connection.execute('explain SELECT 1', function(err, _rows, _fields) { + if (err) throw err; + + rows = _rows + fields = _fields; + connection.end(); +}); + +var expectedRows; +var expectedFields; + +process.on('exit', function() { + assert.deepEqual(rows, expectedRows); + var fi = fields.map(function(c) { return c.inspect() }); + assert.deepEqual(fi, expectedFields); +}); + +expectedFields = [{ catalog: 'def', + schema: '', + table: '', + orgTable: '', + name: 'id', + orgName: '', + characterSet: 63, + columnLength: 3, + columnType: 8, + flags: 161, + decimals: 0 }, + { catalog: 'def', + schema: '', + table: '', + orgTable: '', + name: 'select_type', + orgName: '', + characterSet: 33, + columnLength: 57, + columnType: 253, + flags: 1, + decimals: 31 }, + { catalog: 'def', + schema: '', + table: '', + orgTable: '', + name: 'table', + orgName: '', + characterSet: 33, + columnLength: 192, + columnType: 253, + flags: 0, + decimals: 31 }, + { catalog: 'def', + schema: '', + table: '', + orgTable: '', + name: 'type', + orgName: '', + characterSet: 33, + columnLength: 30, + columnType: 253, + flags: 0, + decimals: 31 }, + { catalog: 'def', + schema: '', + table: '', + orgTable: '', + name: 'possible_keys', + orgName: '', + characterSet: 33, + columnLength: 12288, + columnType: 253, + flags: 0, + decimals: 31 }, + { catalog: 'def', + schema: '', + table: '', + orgTable: '', + name: 'key', + orgName: '', + characterSet: 33, + columnLength: 192, + columnType: 253, + flags: 0, + decimals: 31 }, + { catalog: 'def', + schema: '', + table: '', + orgTable: '', + name: 'key_len', + orgName: '', + characterSet: 33, + columnLength: 12288, + columnType: 253, + flags: 0, + decimals: 31 }, + { catalog: 'def', + schema: '', + table: '', + orgTable: '', + name: 'ref', + orgName: '', + characterSet: 33, + columnLength: 3072, + columnType: 253, + flags: 0, + decimals: 31 }, + { catalog: 'def', + schema: '', + table: '', + orgTable: '', + name: 'rows', + orgName: '', + characterSet: 63, + columnLength: 10, + columnType: 8, + flags: 160, + decimals: 0 }, + { catalog: 'def', + schema: '', + table: '', + orgTable: '', + name: 'Extra', + orgName: '', + characterSet: 33, + columnLength: 765, + columnType: 253, + flags: 1, + decimals: 31 }]; + +expectedRows = [ {id: 1, + select_type: 'SIMPLE', + table: null, + type: null, + possible_keys: null, + key: null, + key_len: null, + ref: null, + rows: null, + Extra: 'No tables used' }]; diff --git a/node_modules/mysql2/test/integration/connection/test-execute-null-bitmap.js b/node_modules/mysql2/test/integration/connection/test-execute-null-bitmap.js index 4f03916..c6a5959 100644 --- a/node_modules/mysql2/test/integration/connection/test-execute-null-bitmap.js +++ b/node_modules/mysql2/test/integration/connection/test-execute-null-bitmap.js @@ -19,4 +19,4 @@ function dotest() { }); } -dotest(); +connection.query('SET GLOBAL max_prepared_stmt_count=300', dotest); diff --git a/node_modules/mysql2/test/integration/connection/test-execute-signed.js b/node_modules/mysql2/test/integration/connection/test-execute-signed.js index 1caef2a..f70d82b 100644 --- a/node_modules/mysql2/test/integration/connection/test-execute-signed.js +++ b/node_modules/mysql2/test/integration/connection/test-execute-signed.js @@ -22,9 +22,9 @@ connection.execute('SELECT * from test_table', [], function(err, _rows, _fields) if (err) throw err; rows = _rows; fields = _fields; + connection.end(); }); -connection.end(); process.on('exit', function() { assert.deepEqual(rows, [{"id":1,"num":1,"l": 3},{"id":2,"num":-2,"l":-10},{"id":3,"num":-1,"l":-4000000}]); diff --git a/node_modules/mysql2/test/integration/connection/test-execute-type-casting.js b/node_modules/mysql2/test/integration/connection/test-execute-type-casting.js index d0eb809..107c1dd 100644 --- a/node_modules/mysql2/test/integration/connection/test-execute-type-casting.js +++ b/node_modules/mysql2/test/integration/connection/test-execute-type-casting.js @@ -37,10 +37,9 @@ connection.execute('SELECT * FROM ' + table + ' WHERE id = ?;', [1], function(er if (err) throw err; row = rows[0]; + connection.end(); }); -connection.end(); - process.on('exit', function() { tests.forEach(function(test) { var expected = test.expect || test.insert; diff --git a/node_modules/mysql2/test/integration/connection/test-handshake-errors.js b/node_modules/mysql2/test/integration/connection/test-handshake-errors.js deleted file mode 100644 index 364d8ef..0000000 --- a/node_modules/mysql2/test/integration/connection/test-handshake-errors.js +++ /dev/null @@ -1,24 +0,0 @@ -var common = require('../../common'); -var assert = require('assert'); - -var conns = []; - -function spawn() { - var c = common.createConnection(); - c.ping(spawn); - conns.push(c); - - c.on('error', function(err) { - conns.forEach(function(c) { if (c) c.end(); }) - }); -} - -spawn(); - -process.on('uncaughtException', function(e) { - assert(false, 'should not have uncaught exceptions'); -}); - -process.on('exit', function() { - assert(conns.length > 0); -}); diff --git a/node_modules/mysql2/test/integration/connection/test-invalid-date-result.js b/node_modules/mysql2/test/integration/connection/test-invalid-date-result.js index 26d38a5..e22630a 100644 --- a/node_modules/mysql2/test/integration/connection/test-invalid-date-result.js +++ b/node_modules/mysql2/test/integration/connection/test-invalid-date-result.js @@ -7,10 +7,9 @@ var rows = undefined; connection.execute('SELECT TIMESTAMP(0000-00-00) t', [], function(err, _rows, _fields) { if (err) throw err; rows = _rows; + connection.end(); }); -connection.end(); - function isInvalidTime(t) { return isNaN(t.getTime()); } diff --git a/node_modules/mysql2/test/integration/connection/test-load-infile.js b/node_modules/mysql2/test/integration/connection/test-load-infile.js new file mode 100644 index 0000000..e33c04d --- /dev/null +++ b/node_modules/mysql2/test/integration/connection/test-load-infile.js @@ -0,0 +1,73 @@ +var common = require('../../common'); +var connection = common.createConnection(); +var assert = require('assert'); + +var table = 'load_data_test'; +connection.query([ + 'CREATE TEMPORARY TABLE `' + table + '` (', + '`id` int(11) unsigned NOT NULL AUTO_INCREMENT,', + '`title` varchar(255),', + 'PRIMARY KEY (`id`)', + ') ENGINE=InnoDB DEFAULT CHARSET=utf8' +].join('\n')); + +var path = './test/fixtures/data.csv'; +var sql = + 'LOAD DATA LOCAL INFILE ? INTO TABLE ' + table + ' ' + + 'FIELDS TERMINATED BY ? (id, title)'; + +var ok; +connection.query(sql, [path, ','], function(err, _ok) { + if (err) throw err; + ok = _ok; +}); + +var rows; +connection.query('SELECT * FROM ' + table, function(err, _rows) { + if (err) throw err; + rows = _rows; +}); + +// Try to load a file that does not exist to see if we handle this properly +var loadErr; +var loadResult; +var badPath = '/does_not_exist.csv'; + +connection.query(sql, [badPath, ','], function(err, result) { + loadErr = err; + loadResult = result; +}); + +// test path mapping +var Stream = require('readable-stream').PassThrough; +var myStream = new Stream(); + +var createMyStream = function(path) { return myStream; }; +var streamResult; +connection.query({ + sql: sql, + values: [badPath, ','], + infileStreamFactory: createMyStream + }, function(err, result) { + if (err) throw err; + streamResult = result; + } +); +myStream.write('11,Hello World\n'); +myStream.write('21,One '); +myStream.write('more row\n'); +myStream.end(); + +connection.end(); + +process.on('exit', function() { + assert.equal(ok.affectedRows, 4); + assert.equal(rows.length, 4); + assert.equal(rows[0].id, 1); + assert.equal(rows[0].title, 'Hello World'); + + assert.equal(loadErr.code, 'ENOENT'); + assert.equal(loadResult.affectedRows, 0); + + assert.equal(streamResult.affectedRows, 2); +}); diff --git a/node_modules/mysql2/test/integration/connection/test-multiple-results.js b/node_modules/mysql2/test/integration/connection/test-multiple-results.js index 5637acb..4d7c4b7 100644 --- a/node_modules/mysql2/test/integration/connection/test-multiple-results.js +++ b/node_modules/mysql2/test/integration/connection/test-multiple-results.js @@ -1,4 +1,4 @@ -var mysql = require('../../common').createConnection({multipleStatements: true}); +var mysql = require('../../common.js').createConnection({multipleStatements: true}); var assert = require('assert'); mysql.query('CREATE TEMPORARY TABLE no_rows (test int)'); mysql.query('CREATE TEMPORARY TABLE some_rows (test int)'); @@ -89,7 +89,7 @@ function do_test(testIndex) { else if (_rows.length > 0) { if (_rows.constructor.name == 'Array' && _rows[0].constructor.name == 'TextRow') _numResults = 1; - if (_rows.constructor.name == 'Array' && + if (_rows.constructor.name == 'Array' && (_rows[0].constructor.name == 'Array' || _rows[0].constructor.name =='ResultSetHeader')) _numResults = _rows.length } @@ -97,7 +97,16 @@ function do_test(testIndex) { console.log(err); process.exit(-1); } - assert.deepEqual(expectation, [_rows, _columns, _numResults]); + var arrOrColumn = function (c) { + if (Array.isArray(c)) + return c.map(arrOrColumn); + + if (typeof c == 'undefined') + return void(0); + + return c.inspect(); + }; + assert.deepEqual(expectation, [_rows, arrOrColumn(_columns), _numResults]); var q = mysql.query(sql); var resIndex = 0; var rowIndex = 0; @@ -123,10 +132,11 @@ function do_test(testIndex) { function checkFields(fields, index) { if (_numResults == 1) { assert.equal(index, 0); - assert.deepEqual(_columns, fields); + debugger + assert.deepEqual(arrOrColumn(_columns), arrOrColumn(fields)); } else - assert.deepEqual(_columns[index], fields); + assert.deepEqual(arrOrColumn(_columns[index]), arrOrColumn(fields)); } q.on('result', checkRow); q.on('fields', checkFields); diff --git a/node_modules/mysql2/test/integration/connection/test-named-paceholders.js b/node_modules/mysql2/test/integration/connection/test-named-paceholders.js new file mode 100644 index 0000000..8a2b1fc --- /dev/null +++ b/node_modules/mysql2/test/integration/connection/test-named-paceholders.js @@ -0,0 +1,41 @@ +var common = require('../../common'); +var connection = common.createConnection(); +var assert = require('assert'); + + +connection.query([ + 'CREATE TEMPORARY TABLE `test_table` (', + '`id` int(11) unsigned NOT NULL AUTO_INCREMENT,', + '`num1` int(15),', + '`num2` int(15),', + 'PRIMARY KEY (`id`)', + ') ENGINE=InnoDB DEFAULT CHARSET=utf8' +].join('\n')); + +connection.query('insert into test_table(num1,num2) values(?, 3)', [1]); +connection.query('insert into test_table(num1,num2) values(3-?, -10)', [5]); +connection.query('insert into test_table(num1,num2) values(4+?, 4000000-?)', [-5, 8000000]); +connection.query('insert into test_table(num1,num2) values(?, ?)', [-5, 8000000]); + +connection.config.namedPlaceholders = true; +var cmd = connection.execute('SELECT * from test_table where num1 < :numParam and num2 > :lParam', {lParam: 100, numParam: 2}, function(err, rows, fields) { + if (err) throw err; + assert.deepEqual(rows, [ { id: 4, num1: -5, num2: 8000000 } ]); +}); + +connection.execute('SELECT :a + :a as sum', {a: 2}, function(err, rows, fields) { + if (err) throw err; + assert.deepEqual(rows, [{"sum":4}]); +}); + +connection.query('SELECT * from test_table where num1 < :numParam and num2 > :lParam', {lParam: 100, numParam: 2}, function(err, rows, fields) { + if (err) throw err; + assert.deepEqual(rows, [ { id: 4, num1: -5, num2: 8000000 } ]); +}); + +connection.query('SELECT :a + :a as sum', {a: 2}, function(err, rows, fields) { + if (err) throw err; + assert.deepEqual(rows, [{"sum":4}]); +}); + +connection.end(); diff --git a/node_modules/mysql2/test/integration/connection/test-nested-tables-query.js b/node_modules/mysql2/test/integration/connection/test-nested-tables-query.js index c6315e9..b7e88f4 100644 --- a/node_modules/mysql2/test/integration/connection/test-nested-tables-query.js +++ b/node_modules/mysql2/test/integration/connection/test-nested-tables-query.js @@ -63,15 +63,13 @@ connection.execute(options3, function(err, _rows) { if (err) throw err; rows3e = _rows; + connection.end(); }); -connection.end(); - process.on('exit', function() { assert.equal(rows1.length, 1); assert.equal(rows1[0].nested_test.id, 1); assert.equal(rows1[0].nested_test.title, 'test'); - assert.equal(rows2.length, 1); assert.equal(rows2[0].nested_test_id, 1); assert.equal(rows2[0].nested_test_title, 'test'); diff --git a/node_modules/mysql2/test/integration/connection/test-null-double.js b/node_modules/mysql2/test/integration/connection/test-null-double.js index 3fa1eeb..c1df45f 100644 --- a/node_modules/mysql2/test/integration/connection/test-null-double.js +++ b/node_modules/mysql2/test/integration/connection/test-null-double.js @@ -11,9 +11,9 @@ connection.query('INSERT INTO t VALUES(123)'); connection.query('SELECT * from t', function(err, _rows, _fields) { if (err) throw err; rows = _rows; + connection.end(); }); -connection.end(); process.on('exit', function() { assert.deepEqual(rows[0], {i: null}); diff --git a/node_modules/mysql2/test/integration/connection/test-null-int.js b/node_modules/mysql2/test/integration/connection/test-null-int.js index 3fa1eeb..da6c2e6 100644 --- a/node_modules/mysql2/test/integration/connection/test-null-int.js +++ b/node_modules/mysql2/test/integration/connection/test-null-int.js @@ -11,10 +11,9 @@ connection.query('INSERT INTO t VALUES(123)'); connection.query('SELECT * from t', function(err, _rows, _fields) { if (err) throw err; rows = _rows; + connection.end(); }); -connection.end(); - process.on('exit', function() { assert.deepEqual(rows[0], {i: null}); assert.deepEqual(rows[1], {i: 123}); diff --git a/node_modules/mysql2/test/integration/connection/test-null.js b/node_modules/mysql2/test/integration/connection/test-null.js index 1ea2b9e..302a031 100644 --- a/node_modules/mysql2/test/integration/connection/test-null.js +++ b/node_modules/mysql2/test/integration/connection/test-null.js @@ -16,10 +16,9 @@ connection.query('SELECT * from t', function(err, _rows, _fields) { if (err) throw err; rows1 = _rows; fields1 = _fields; + connection.end(); }); -connection.end(); - process.on('exit', function() { assert.deepEqual(rows, [{'cast(NULL AS CHAR)': null}]); assert.equal(fields[0].columnType, 253); diff --git a/node_modules/mysql2/test/integration/connection/test-prepare-and-close.js b/node_modules/mysql2/test/integration/connection/test-prepare-and-close.js new file mode 100644 index 0000000..d1ded76 --- /dev/null +++ b/node_modules/mysql2/test/integration/connection/test-prepare-and-close.js @@ -0,0 +1,26 @@ +var common = require('../../common'); +var connection = common.createConnection(); +var assert = require('assert'); + +var max = 500; +var start = process.hrtime(); +function prepare(i) { + connection.prepare('select 1+' + i, function(err, stmt) { + stmt.close(); + if (!err) { + if (i > max) { + var end = process.hrtime(start); + var ns = end[0]*1e9+end[1]; + console.log(max*1e9/ns + ' prepares/sec'); + return connection.end(); + } + setTimeout(function() {prepare(i+1)}, 2); + return; + } + assert(0, 'Error in prepare!'); + }); +} +connection.query('SET GLOBAL max_prepared_stmt_count=10', function(err) { + if (err) throw err; + prepare(1); +}); diff --git a/node_modules/mysql2/test/integration/connection/test-prepare-simple.js b/node_modules/mysql2/test/integration/connection/test-prepare-simple.js new file mode 100644 index 0000000..c004a4a --- /dev/null +++ b/node_modules/mysql2/test/integration/connection/test-prepare-simple.js @@ -0,0 +1,29 @@ +var common = require('../../common'); +var connection = common.createConnection(); +var assert = require('assert'); + +var _stmt1, _stmt2, _stmt3; +var query1 = 'select 1 + ? + ? as test'; +var query2 = 'select 1 + 1'; // no parameters +var query3 = 'create temporary table aaa(i int);' // no parameters, no result columns + +connection.prepare(query1, function(err1, stmt1) { + _stmt1 = stmt1; + _stmt1.close(); + connection.prepare(query2, function(err2, stmt2) { + _stmt2 = stmt2; + connection.prepare(query3, function(err3, stmt3) { + _stmt3 = stmt3; + _stmt2.close(); + _stmt3.close() + connection.end(); + }); + }); +}); + +process.on('exit', function() { + assert.equal(_stmt1.query, query1); + assert(_stmt1.id >= 0); + assert.equal(_stmt1.columns.length, 1); + assert.equal(_stmt1.parameters.length, 2); +}); diff --git a/node_modules/mysql2/test/integration/connection/test-prepare-then-execute.js b/node_modules/mysql2/test/integration/connection/test-prepare-then-execute.js new file mode 100644 index 0000000..e6ed9b0 --- /dev/null +++ b/node_modules/mysql2/test/integration/connection/test-prepare-then-execute.js @@ -0,0 +1,26 @@ +var common = require('../../common'); +var connection = common.createConnection(); +var assert = require('assert'); + +var _stmt = null; +var _columns = null; +var _rows = null; + +connection.prepare('select 1 + ? + ? as test', function(err, stmt) { + if (err) throw err; + _stmt = stmt; + stmt.execute([111, 123], function(err, rows, columns) { + if (err) throw err; + _columns = columns; + _rows = rows; + connection.end(); + }); +}); + + +process.on('exit', function() { + assert.equal(_stmt.columns.length, 1); + assert.equal(_stmt.parameters.length, 2); + assert.deepEqual(_rows, [ { test: 235 } ]); + assert.equal(_columns[0].name, 'test'); +}); diff --git a/node_modules/mysql2/test/integration/connection/test-select-1.js b/node_modules/mysql2/test/integration/connection/test-select-1.js index cc59619..ab8c2c5 100644 --- a/node_modules/mysql2/test/integration/connection/test-select-1.js +++ b/node_modules/mysql2/test/integration/connection/test-select-1.js @@ -9,10 +9,9 @@ connection.query('SELECT 1', function(err, _rows, _fields) { rows = _rows; fields = _fields; + connection.end(); }); -connection.end(); - process.on('exit', function() { assert.deepEqual(rows, [{1: 1}]); assert.equal(fields[0].name, '1'); diff --git a/node_modules/mysql2/test/integration/connection/test-select-empty-string.js b/node_modules/mysql2/test/integration/connection/test-select-empty-string.js index 8e10ce7..b3be6a3 100644 --- a/node_modules/mysql2/test/integration/connection/test-select-empty-string.js +++ b/node_modules/mysql2/test/integration/connection/test-select-empty-string.js @@ -7,10 +7,9 @@ connection.query('SELECT ""', function(err, _rows) { if (err) throw err; rows = _rows; + connection.end(); }); -connection.end(); - process.on('exit', function() { assert.deepEqual(rows, [{'': ''}]); }); diff --git a/node_modules/mysql2/test/integration/connection/test-select-negative.js b/node_modules/mysql2/test/integration/connection/test-select-negative.js index 9442988..7b66aa8 100644 --- a/node_modules/mysql2/test/integration/connection/test-select-negative.js +++ b/node_modules/mysql2/test/integration/connection/test-select-negative.js @@ -17,10 +17,9 @@ connection.query('SELECT -1 v', function(err, _rows, _fields) { if (err) throw err; rows1 = _rows; fields1 = _fields; + connection.end(); }); -connection.end(); - process.on('exit', function() { assert.deepEqual(rows, [{v: -1}]); assert.deepEqual(rows1, [{v: -1}]); diff --git a/node_modules/mysql2/test/integration/connection/test-select-utf8.js b/node_modules/mysql2/test/integration/connection/test-select-utf8.js index 54b5fc7..c81cac6 100644 --- a/node_modules/mysql2/test/integration/connection/test-select-utf8.js +++ b/node_modules/mysql2/test/integration/connection/test-select-utf8.js @@ -9,9 +9,9 @@ connection.query("SELECT '" + multibyteText + "'", function(err, _rows, _fields) if (err) throw err; rows = _rows; fields = _fields; + connection.end(); }); -connection.end(); process.on('exit', function() { assert.equal(rows[0][multibyteText], multibyteText); diff --git a/node_modules/mysql2/test/integration/connection/test-select-utf8mb4.js b/node_modules/mysql2/test/integration/connection/test-select-utf8mb4.js index e26342d..0ad55d0 100644 --- a/node_modules/mysql2/test/integration/connection/test-select-utf8mb4.js +++ b/node_modules/mysql2/test/integration/connection/test-select-utf8mb4.js @@ -9,10 +9,9 @@ connection.query("SELECT '" + multibyteText + "'", function(err, _rows, _fields) if (err) throw err; rows = _rows; fields = _fields; + connection.end(); }); -connection.end(); - process.on('exit', function() { assert.equal(rows[0][multibyteText], multibyteText); assert.equal(fields[0].name, multibyteText); diff --git a/node_modules/mysql2/test/integration/connection/test-server-listen.js b/node_modules/mysql2/test/integration/connection/test-server-listen.js new file mode 100644 index 0000000..3dbe299 --- /dev/null +++ b/node_modules/mysql2/test/integration/connection/test-server-listen.js @@ -0,0 +1,35 @@ +var assert = require('assert'); +var mysql = require('../../../index.js') + +// Verifies that the Server.listen can be called with any combination of +// pararameters valid for net.Server.listen. + +var server = mysql.createServer(); +var serverListenCallbackFired = false; + +function testListen(argsDescription, listenCaller) { + var server = mysql.createServer(); + var listenCallbackFired = false; + + listenCaller(server, function() { + listenCallbackFired = true; + }); + setTimeout(function() { + assert.ok( + listenCallbackFired, + 'Callback for call with ' + argsDescription + ' did not fire'); + server._server.close(); + }, 100); +} + +testListen('port', function(server, callback) { + server.listen(0, callback); +}); + +testListen('port, host', function(server, callback) { + server.listen(0, '127.0.0.1', callback); +}); + +testListen('port, host, backlog', function(server, callback) { + server.listen(0, '127.0.0.1', 50, callback); +}); diff --git a/node_modules/mysql2/test/integration/connection/test-signed-tinyint.js b/node_modules/mysql2/test/integration/connection/test-signed-tinyint.js index 19fba63..e0d93ea 100644 --- a/node_modules/mysql2/test/integration/connection/test-signed-tinyint.js +++ b/node_modules/mysql2/test/integration/connection/test-signed-tinyint.js @@ -11,9 +11,9 @@ connection.query('INSERT INTO signed_ints values (3, -110, -500)'); connection.execute('SELECT * from signed_ints', [5], function(err, _rows, _fields) { if (err) throw err; rows = _rows; + connection.end(); }); -connection.end(); process.on('exit', function() { assert.deepEqual(rows, [{"b11":-3,"b12":-120,"b21":500},{"b11":3,"b12":-110,"b21":-500}]); diff --git a/node_modules/mysql2/test/integration/connection/test-timestamp.js b/node_modules/mysql2/test/integration/connection/test-timestamp.js index 1773ed9..3839ebc 100644 --- a/node_modules/mysql2/test/integration/connection/test-timestamp.js +++ b/node_modules/mysql2/test/integration/connection/test-timestamp.js @@ -17,8 +17,8 @@ connection.execute('SELECT f FROM t', function(err, _rows, _fields) { if (err) throw err; rows1 = _rows; fields1 = _fields; + connection.end(); }); -connection.end(); process.on('exit', function() { assert.deepEqual(rows[0].f.toString(), 'Invalid Date'); @@ -32,5 +32,5 @@ process.on('exit', function() { assert.equal(rows[1].f.getSeconds(), 3); assert.equal(fields[0].name, 'f'); assert.deepEqual(rows[1], rows1[1]); - assert.deepEqual(fields, fields1); + assert.deepEqual(fields[0].inspect(), fields1[0].inspect()); }); diff --git a/node_modules/mysql2/test/integration/connection/test-type-cast-null-fields.js b/node_modules/mysql2/test/integration/connection/test-type-cast-null-fields.js index f5718f4..f5aa32d 100644 --- a/node_modules/mysql2/test/integration/connection/test-type-cast-null-fields.js +++ b/node_modules/mysql2/test/integration/connection/test-type-cast-null-fields.js @@ -24,9 +24,9 @@ connection.query('SELECT * FROM ' + table, function(err, _results) { if (err) throw err; results = _results; + connection.end(); }); -connection.end(); process.on('exit', function() { assert.strictEqual(results[0].date, null); diff --git a/node_modules/mysql2/test/integration/connection/test-type-casting.js b/node_modules/mysql2/test/integration/connection/test-type-casting.js index 5ad7761..bd5c37e 100644 --- a/node_modules/mysql2/test/integration/connection/test-type-casting.js +++ b/node_modules/mysql2/test/integration/connection/test-type-casting.js @@ -37,9 +37,9 @@ connection.query('SELECT * FROM type_casting', function(err, rows) { if (err) throw err; row = rows[0]; + connection.end(); }); -connection.end(); process.on('exit', function() { tests.forEach(function(test) { diff --git a/node_modules/mysql2/test/unit/protocol/test-SqlString.js b/node_modules/mysql2/test/unit/protocol/test-SqlString.js new file mode 100644 index 0000000..dffede3 --- /dev/null +++ b/node_modules/mysql2/test/unit/protocol/test-SqlString.js @@ -0,0 +1,175 @@ +var common = require('../../common'); +var test = require('utest'); +var assert = require('assert'); +var SqlString = common.SqlString; + +test('SqlString.escapeId', { + 'value is quoted': function() { + assert.equal('`id`', SqlString.escapeId('id')); + }, + + 'value containing escapes is quoted': function() { + assert.equal('`i``d`', SqlString.escapeId('i`d')); + }, + + 'value containing separator is quoted': function() { + assert.equal('`id1`.`id2`', SqlString.escapeId('id1.id2')); + }, + 'value containing separator and escapes is quoted': function() { + assert.equal('`id``1`.`i``d2`', SqlString.escapeId('id`1.i`d2')); + }, + + 'arrays are turned into lists': function() { + assert.equal(SqlString.escapeId(['a', 'b', 't.c']), "`a`, `b`, `t`.`c`"); + }, + + 'nested arrays are flattened': function() { + assert.equal(SqlString.escapeId(['a', ['b', ['t.c']]]), "`a`, `b`, `t`.`c`"); + }, +}); + +test('SqlString.escape', { + 'undefined -> NULL': function() { + assert.equal(SqlString.escape(undefined), 'NULL'); + }, + + 'null -> NULL': function() { + assert.equal(SqlString.escape(null), 'NULL'); + }, + + 'booleans convert to strings': function() { + assert.equal(SqlString.escape(false), 'false'); + assert.equal(SqlString.escape(true), 'true'); + }, + + 'numbers convert to strings': function() { + assert.equal(SqlString.escape(5), '5'); + }, + + 'objects are turned into key value pairs': function() { + assert.equal(SqlString.escape({a: 'b', c: 'd'}), "`a` = 'b', `c` = 'd'"); + }, + + 'objects function properties are ignored': function() { + assert.equal(SqlString.escape({a: 'b', c: function() {}}), "`a` = 'b'"); + }, + + 'nested objects are cast to strings': function() { + assert.equal(SqlString.escape({a: {nested: true}}), "`a` = '[object Object]'"); + }, + + 'arrays are turned into lists': function() { + assert.equal(SqlString.escape([1, 2, 'c']), "1, 2, 'c'"); + }, + + 'nested arrays are turned into grouped lists': function() { + assert.equal(SqlString.escape([[1,2,3], [4,5,6], ['a', 'b', {nested: true}]]), "(1, 2, 3), (4, 5, 6), ('a', 'b', '[object Object]')"); + }, + + 'nested objects inside arrays are cast to strings': function() { + assert.equal(SqlString.escape([1, {nested: true}, 2]), "1, '[object Object]', 2"); + }, + + 'strings are quoted': function() { + assert.equal(SqlString.escape('Super'), "'Super'"); + }, + + '\0 gets escaped': function() { + assert.equal(SqlString.escape('Sup\0er'), "'Sup\\0er'"); + }, + + '\b gets escaped': function() { + assert.equal(SqlString.escape('Sup\ber'), "'Sup\\ber'"); + }, + + '\n gets escaped': function() { + assert.equal(SqlString.escape('Sup\ner'), "'Sup\\ner'"); + }, + + '\r gets escaped': function() { + assert.equal(SqlString.escape('Sup\rer'), "'Sup\\rer'"); + }, + + '\t gets escaped': function() { + assert.equal(SqlString.escape('Sup\ter'), "'Sup\\ter'"); + }, + + '\\ gets escaped': function() { + assert.equal(SqlString.escape('Sup\\er'), "'Sup\\\\er'"); + }, + + '\u001a (ascii 26) gets replaced with \\Z': function() { + assert.equal(SqlString.escape('Sup\u001aer'), "'Sup\\Zer'"); + }, + + 'single quotes get escaped': function() { + assert.equal(SqlString.escape('Sup\'er'), "'Sup\\'er'"); + }, + + 'double quotes get escaped': function() { + assert.equal(SqlString.escape('Sup"er'), "'Sup\\\"er'"); + }, + + 'dates are converted to YYYY-MM-DD HH:II:SS.sss': function() { + var expected = '2012-05-07 11:42:03.002'; + var date = new Date(2012, 4, 7, 11, 42, 3, 2); + var string = SqlString.escape(date); + + assert.strictEqual(string, "'" + expected + "'"); + }, + + 'buffers are converted to hex': function() { + var buffer = new Buffer([0, 1, 254, 255]); + var string = SqlString.escape(buffer); + + assert.strictEqual(string, "X'0001feff'"); + }, + + 'NaN -> NaN': function() { + assert.equal(SqlString.escape(NaN), 'NaN'); + }, + + 'Infinity -> Infinity': function() { + assert.equal(SqlString.escape(Infinity), 'Infinity'); + } +}); + +test('SqlString.format', { + 'question marks are replaced with escaped array values': function() { + var sql = SqlString.format('? and ?', ['a', 'b']); + assert.equal(sql, "'a' and 'b'"); + }, + + 'extra question marks are left untouched': function() { + var sql = SqlString.format('? and ?', ['a']); + assert.equal(sql, "'a' and ?"); + }, + + 'extra arguments are not used': function() { + var sql = SqlString.format('? and ?', ['a', 'b', 'c']); + assert.equal(sql, "'a' and 'b'"); + }, + + 'question marks within values do not cause issues': function() { + var sql = SqlString.format('? and ?', ['hello?', 'b']); + assert.equal(sql, "'hello?' and 'b'"); + }, + + 'undefined is ignored': function () { + var sql = SqlString.format('?', undefined, false) + assert.equal(sql, '?') + }, + + 'objects is converted to values': function () { + var sql = SqlString.format('?', { 'hello': 'world' }, false) + assert.equal(sql, "`hello` = 'world'") + }, + + 'objects is not converted to values': function () { + var sql = SqlString.format('?', { 'hello': 'world' }, true) + assert.equal(sql, "'[object Object]'") + + var sql = SqlString.format('?', { toString: function () { return 'hello' } }, true) + assert.equal(sql, "'hello'") + } +}); diff --git a/node_modules/mysql2/test/unit/test-packet-parser.js b/node_modules/mysql2/test/unit/test-packet-parser.js new file mode 100644 index 0000000..fd51616 --- /dev/null +++ b/node_modules/mysql2/test/unit/test-packet-parser.js @@ -0,0 +1,80 @@ +var PacketParser = require('../../lib/packet_parser.js'); +var assert = require('assert'); + +var pp; +var packets = []; +function reset() { + pp = new PacketParser(handler); + packets = []; +} +var handler = function(p) { + p.dump(); + packets.push(p); +} + +function execute(str, verify) { + reset(); + var buffers = str.split('|').map(function(sb) { return sb.split(',').map(Number) }); + console.log(str); + for(var i=0; i < buffers.length; ++i) + pp.execute(new Buffer(buffers[i])); + verify(); +} + +function p123() { + assert(packets.length === 1); + assert(packets[0].length() === 10); + assert(packets[0].sequenceId === 123); +} + +function p120_121() { + packets.forEach(function(p) { p.dump }); + assert(packets.length === 2); + assert(packets[0].length() === 0); + assert(packets[0].sequenceId === 120); + assert(packets[1].length() === 0); + assert(packets[1].sequenceId === 121); +} + +execute("10,0,0,123,1,2,3,4,5,6,7,8,9,0", p123); +execute("10,0,0,123|1,2,3,4,5,6,7,8,9,0", p123); +execute("10,0,0|123,1,2,3,4,5,6,7,8,9,0", p123); +execute("10|0,0|123,1,2,3,4,5,6,7,8,9,0", p123); +execute("10,0,0,123,1|2,3,4,5,6|7,8,9,0", p123); +execute("10,0,0,123,1,2|,3,4,5,6|7,8,9,0", p123); + +function p42() { + assert(packets.length === 1); + assert(packets[0].length() === 0); + assert(packets[0].sequenceId === 42); +} + +execute("0,0,0,42", p42); +execute("0|0,0,42", p42); +execute("0,0|0,42", p42); +execute("0,0|0|42", p42); +execute("0,0,0|42", p42); +execute("0|0|0|42", p42); +execute("0|0,0|42", p42); + +// two zero length packets +execute("0,0,0,120,0,0,0,121", p120_121); +execute("0,0,0|120|0|0|0|121", p120_121); + +var p122_123 = function() { + assert(packets.length === 2); + assert(packets[0].length() === 5); + assert(packets[0].sequenceId === 122); + assert(packets[1].length() === 6); + assert(packets[1].sequenceId === 123); +} +// two non-zero length packets +execute("5,0,0,122,1,2,3,4,5,6,0,0,123,1,2,3,4,5,6", p122_123); +execute("5,0,0,122,1,2,3,4,5|6,0,0,123,1,2,3,4,5,6", p122_123); +execute("5,0,0,122,1,2,3,4|5|6|0,0,123,1,2,3,4,5,6", p122_123); +execute("5,0,0,122,1,2,3,4,5,6|0,0,123,1,2,3,4,5,6", p122_123); +execute("5,0,0,122,1,2,3,4,5,6,0|0,123,1,2,3,4,5,6", p122_123); +execute("5,0,0,122,1,2,3,4,5,6,0,0|123,1,2,3,4,5,6", p122_123); +execute("5,0,0,122,1,2,3,4,5,6,0,0,123|1,2,3,4,5,6", p122_123); +execute("5,0,0,122,1,2,3,4,5,6,0,0,123,1|2,3,4,5,6", p122_123); +execute("5,0,0,122,1,2,3,4,5,6,0,0,123,1|2,3|4,5,6", p122_123); diff --git a/node_modules/mysql2/ttt.js b/node_modules/mysql2/ttt.js deleted file mode 100644 index fc1b3e2..0000000 --- a/node_modules/mysql2/ttt.js +++ /dev/null @@ -1,17 +0,0 @@ -var fs = require('fs'); -var mysql = require('./index.js'); -var conn = mysql.createConnection({ - user: 'root', - password: '', - database: 'test', - host: '127.0.0.1', - port: '3307', - debug: true, - compress: 1, - }); - -setTimeout(function() { -conn.query('select * from mil limit 1000', function(err, res) { - console.log(res); -}); -}, 10); diff --git a/node_modules/node-firebird/.npmignore b/node_modules/node-firebird/.npmignore index 47443cf..b59f7e3 100644 --- a/node_modules/node-firebird/.npmignore +++ b/node_modules/node-firebird/.npmignore @@ -1,2 +1 @@ - -*.fdb +test/ \ No newline at end of file diff --git a/node_modules/node-firebird/README.md b/node_modules/node-firebird/README.md index 74a0059..289b776 100644 --- a/node_modules/node-firebird/README.md +++ b/node_modules/node-firebird/README.md @@ -47,7 +47,7 @@ var Firebird = require('node-firebird'); - `Firebird.attach(options, function(err, db))` attach a database - `Firebird.create(options, function(err, db))` create a database - `Firebird.attachOrCreate(options, function(err, db))` attach or create database -- `Firebird.pool(maxSockets, options, function(err, db)) -> return {Object}` create a connection pooling +- `Firebird.pool(max, options, function(err, db)) -> return {Object}` create a connection pooling ## Connection types @@ -99,9 +99,6 @@ pool.get(function(err, db) { }); }); -// close all opened connections -pool.detach(); - // Destroy pool pool.destroy(); ``` @@ -349,6 +346,14 @@ Node is unicode, no matter if your database is using another charset to store st This is why you should use **Firebird 2.5** server at least. +### Firebird 3.0 Support + +Firebird new wire protocol is not supported yet so +for Firebird 3.0 you need to add the following in firebird.conf +``` +AuthServer = Legacy_Auth +WireCrypt = Disabled +``` ## Contributors - Henri Gourvest, diff --git a/node_modules/node-firebird/lib/index.js b/node_modules/node-firebird/lib/index.js index 00bed5f..7a0ca0f 100644 --- a/node_modules/node-firebird/lib/index.js +++ b/node_modules/node-firebird/lib/index.js @@ -7,7 +7,7 @@ var BlrReader = serialize.BlrReader, XdrWriter = serialize.XdrWriter, BlrWriter = serialize.BlrWriter, - messages = require('./messages.js'); + messages = require('./messages.js') if (typeof(setImmediate) === 'undefined') { global.setImmediate = function(cb) { @@ -590,16 +590,9 @@ const function SQLVarText() {} SQLVarText.prototype.decode = function(data) { - var ret; - if (this.subType > 1) { - ret = data.readText(this.length, DEFAULT_ENCODING); - } else { - ret = data.readBuffer(this.length); - } - - if (!data.readInt()) { + var ret = data.readString(DEFAULT_ENCODING); + if (!data.readInt()) return ret; - } return null; }; @@ -619,15 +612,9 @@ SQLVarNull.prototype.constructor = SQLVarNull; function SQLVarString() {} SQLVarString.prototype.decode = function(data) { - var ret; - if (this.subType > 1) { - ret = data.readString(DEFAULT_ENCODING) - } else { - ret = data.readBuffer() - } - if (!data.readInt()) { + var ret = data.readString(DEFAULT_ENCODING); + if (!data.readInt()) return ret; - } return null; }; @@ -815,7 +802,6 @@ SQLVarTimeStamp.prototype.calcBlr = function(blr) { //------------------------------------------------------ -// todo: test it function SQLVarBoolean() {} SQLVarBoolean.prototype.decode = function(data) { @@ -1000,6 +986,11 @@ function doCallback(obj, callback) { if (!callback) return; + if (obj instanceof Error) { + callback(obj); + return; + } + if (isError(obj)) { callback(new Error(obj.message)); return; @@ -1084,7 +1075,6 @@ Transaction.prototype.execute = function(query, params, callback, custom) { } var self = this; - this.newStatement(query, function(err, statement) { if (err) { @@ -1193,7 +1183,12 @@ function Database(connection) { connection.db = this; } -Database.prototype.__proto__ = new Events.EventEmitter(); +Database.prototype.__proto__ = Object.create(Events.EventEmitter.prototype, { + constructor: { + value: Database, + enumberable: false + } +}); Database.prototype.escape = function(value) { return exports.escape(value); @@ -1274,6 +1269,12 @@ Database.prototype.execute = function(query, params, callback, custom) { transaction.execute(query, params, function(err, result, meta, isSelect) { + if (isSelect) { + if (callback) + callback(err, result, meta, isSelect); + return; + } + if (err) { transaction.rollback(function() { doError(err, callback); @@ -1399,75 +1400,26 @@ exports.attachOrCreate = function(options, callback) { // Pooling exports.pool = function(max, options, callback) { - - var pool = new Pool(); - + var pool = new Pool(max, options); options.isPool = true; - - function create(max) { - exports.attach(options, function(err, db) { - - if (err) - throw err; - - max--; - - pool.db.push(db); - poolEvents(db, pool); - - if (max <= 0) { - pool.isReady = true; - pool.check(); - if (callback) - callback(null, pool); - return; - } - - create(max); - }); - }; - - create(max); - return pool; }; -function poolEvents(db, pool) { - db.removeAllListeners('detach'); - db.on('detach', function(is) { - - if (!is) - return; - - db.connection._queue = []; - db.connection._pending = []; - db.connection._isUsed = false; - - setImmediate(function() { - pool.check(); - }); - }); -} - /*************************************** * * Simple Pooling * ***************************************/ -function Pool() { - this.db = []; +function Pool(max, options) { + this.db = 0; + this.max = max || 4; this.pending = []; - this.isReady = false; - this.isDestroy = false; + this.options = options; } Pool.prototype.get = function(callback) { - var self = this; - if (self.isDestroy) - return self; - self.pending.push(callback); self.check(); return self; @@ -1476,53 +1428,30 @@ Pool.prototype.get = function(callback) { Pool.prototype.check = function() { var self = this; - - for (var i = 0, length = self.db.length; i < length; i++) { - - var db = self.db[i]; - if (db.connection._isUsed) - continue; - - db.removeAllListeners('detach'); - poolEvents(db, self); - - var cb = self.pending.shift(); - if (cb) { - db.connection._isUsed = true; - cb(null, db); - } - + if (self.db >= self.max) return self; - } + + var cb = self.pending.shift(); + if (!cb) + return self; + + self.db++; + exports.attach(self.options, function(err, db) { + if (!err) { + db.on('detach', function() { self.db--; self.check(); }); + } else + self.db--; + cb(err, db); + }); + + setImmediate(function() { + self.check(); + }); return self; }; -Pool.prototype.detach = function() { - - var self = this; - var count = self.db.length; - - var fn = function() { - count--; - if (count > 0 || !self.isDestroy) - return; - self.db = null; - self.pending = null; - }; - - for (var i = 0; i < self.db.length; i++) - self.db[i].detach(fn, true); - - return self; -}; - -Pool.prototype.destroy = function() { - var self = this; - self.detach(); - self.isDestroy = true; - return self; -}; +Pool.prototype.destroy = function() {}; /*************************************** * @@ -1633,7 +1562,6 @@ exports.Connection.prototype._bind_events = function(host, port, callback) { xdr.buffer = buf; } - while (xdr.pos < xdr.buffer.length) { pos = xdr.pos; @@ -1687,6 +1615,7 @@ function decodeResponse(data, callback, db){ } while (r === op_dummy); var item, op; + switch (r) { case op_response: @@ -1779,9 +1708,6 @@ function decodeResponse(data, callback, db){ item = output[i]; var value = item.decode(data); - if (item.type === 580 && value !== null) - value = typeof(value) === 'object' ? value.low_ : value; - if (custom.asObject) { if (item.type === SQL_BLOB) value = fetch_blob_async(statement, value, cols[i]); @@ -1917,21 +1843,13 @@ Connection.prototype.attach = function (options, callback, db) { this._queueEvent(cb); }; -Connection.prototype.detach = function (callback, force) { +Connection.prototype.detach = function (callback) { var self = this; if (self._isClosed) return; - if (self.options.isPool && !force) { - self._isUsed = false; - // self._queue = []; - // self._pending = []; - self.db.emit('detach', true); - return; - } - self._isUsed = false; self._isDetach = true; @@ -2470,7 +2388,9 @@ Connection.prototype.executeStatement = function(transaction, statement, params, ret[i] = new SQLParamBool(value); break; default: - throw new Error('Unexpected parametter'); + //throw new Error('Unexpected parametter: ' + JSON.stringify(params) + ' - ' + JSON.stringify(input)); + ret[i] = value === null || value === undefined ? new SQLVarNull() : new SQLParamString(value.toString()); + break; } done(); } @@ -2489,8 +2409,11 @@ Connection.prototype.executeStatement = function(transaction, statement, params, params = []; } - if (params === undefined || params.length !== input.length) - throw new Error('Expected parameters: ' + input.length); + if (params === undefined || params.length !== input.length) { + self._pending.pop(); + callback(new Error('Expected parameters: (params=' + params.length + ' vs. expected=' + input.length + ') - ' + statement.query)); + return; + } PrepareParams(params, input, function(prms) { diff --git a/node_modules/node-firebird/lib/serialize.js b/node_modules/node-firebird/lib/serialize.js index f4013fe..02f65b7 100644 --- a/node_modules/node-firebird/lib/serialize.js +++ b/node_modules/node-firebird/lib/serialize.js @@ -208,7 +208,7 @@ XdrWriter.prototype.addInt = function (value) { XdrWriter.prototype.addInt64 = function (value) { this.ensure(8); - var l = new Long(value); + var l = Long.fromNumber(value); this.buffer.writeInt32BE(l.high_, this.pos); this.pos += 4; this.buffer.writeInt32BE(l.low_, this.pos); @@ -295,7 +295,7 @@ XdrReader.prototype.readInt64 = function () { this.pos += 4; var low = this.buffer.readInt32BE(this.pos); this.pos += 4; - return new Long(low, high); + return new Long(low, high).toNumber(); }; XdrReader.prototype.readShort = function () { diff --git a/node_modules/node-firebird/package.json b/node_modules/node-firebird/package.json index cc51ab5..9668750 100644 --- a/node_modules/node-firebird/package.json +++ b/node_modules/node-firebird/package.json @@ -1,6 +1,6 @@ { "name": "node-firebird", - "version": "0.2.5", + "version": "0.3.0", "description": "Pure JavaScript and Asynchronous Firebird client for Node.js.", "keywords": [ "firebird", @@ -34,14 +34,14 @@ "url": "https://raw.githubusercontent.com/hgourvest/node-firebird/master/LICENSE" } ], - "gitHead": "2e5a6ab893765fd53585c2dc88321d6e0677afc4", + "gitHead": "1b536743a315af250065f0e138df01fa8091296a", "bugs": { "url": "https://github.com/hgourvest/node-firebird/issues" }, - "_id": "node-firebird@0.2.5", + "_id": "node-firebird@0.3.0", "scripts": {}, - "_shasum": "5d8dedf25853195fe95a1d2eea3931231b24aff3", - "_from": "node-firebird@0.2.5", + "_shasum": "50f6fd6f79bf3399c8f4e337266cfa0dc66326bc", + "_from": "node-firebird@0.3.0", "_npmVersion": "1.4.28", "_npmUser": { "name": "mariuz", @@ -62,9 +62,10 @@ } ], "dist": { - "shasum": "5d8dedf25853195fe95a1d2eea3931231b24aff3", - "tarball": "http://registry.npmjs.org/node-firebird/-/node-firebird-0.2.5.tgz" + "shasum": "50f6fd6f79bf3399c8f4e337266cfa0dc66326bc", + "tarball": "http://registry.npmjs.org/node-firebird/-/node-firebird-0.3.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/node-firebird/-/node-firebird-0.2.5.tgz" + "_resolved": "https://registry.npmjs.org/node-firebird/-/node-firebird-0.3.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/node-firebird/test/image.png b/node_modules/node-firebird/test/image.png deleted file mode 100644 index 1f6799ade830e49d23db26f67ac0b471b910df98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5472 zcmV-m6`$&fP)(ypmv;Iuxl}C**=`q+VQ{KODq< zeC$?C{QBPf`N!&{DDA^FYO7S8WsEHkoNBC z{OqKlheWlE9EorY{P?QW($mDky!z_HEG8uNwjk8Sl;^EK>f5R2y+n(7CFbPe?9WzM zR#bX(N))Vfr> zw1hkw1pK}{lx{4fkYLBEbjX}o{NAL>i67XuIHzh9iDwZsA_UBS1l-ZA$BsZeE(BCU z1jM2wypDkM#fkaXl&5Vkd|nWdf<$amB-yuw*~6)XO&8RpShsHs=g6qsjw*>)A*fyq z`OcKrn>?t9V9A9)yn7$$q(uDW-TT$Bw6e4Ix>~ILSK|Nx5+O-MK~#8N?3o3R>o^!i z{lhhp*s7EmF%~}}G*9+Y4M((Zln2X{8?Of+2x3TAobZr2g#Q+CdZI9@3aRL#Hixrt>mX+y@HG&c!E3={C5G4&eMu-rq#4RJ{ zBu*NM8Agbr1!9B*S~mW&MPx;FRhF|pKsLaEtSrB5f@4OabYRjwBjzMdcZ5J*^a925 zi7SlE5FxV9=4KrGjKLs`rQs1Q3!(x>2% zk)lp%xM{>XiSr#Pl1vLND-&7+H>D=$&I$|<{CKG-u zBk(LFigOs*2k@LIh)wLxTK}yh$e%}6MxNeHinYu85dY5c@%qjT3_Puh)RIE_^$l-j zx4n+^R9G3wgj7L&en|-2+f1wJlg|F@VCrfo;1dNw41z5q<^I|0@`9SkyJmzYDbpkl z7%7`NGQbEdse)iJXTe=n=%T99>i4rhf7x62%_W98@)qefjAGAc=2lg)GQBvWXRwWct)J*2%Its^H;x+8?&EC z(+s2W3a=3j3g3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^+{6D+vV993Cxy%f6RR~NNCzTur?5n@oIk{83gBQ zQxRdqp15Ki5nEW{m||GN-6E0PWK7frp-d^IX=BNh6{JY0Bd*$ox5G3@VGE+DZxeNI zGEFQhQ?@XNL|oYr$!fxp1{E5qFrtJ30#uk&q|nvnZ?j0@;hU>`yqCn<#Ip-ILQ!4vIKORYOXrZCgx<*62ZW!!YIATkiC#w zi8zO68$_JeF5SH<8v|V`Qk(z@y}h1Iyv+Z4{rz%2NiyzK(nA?9-(n6qFh&v)&_a1> zh@|GmnPGE1=1!y9yH;WlEjNi|)H%e7w;j64P#CFtH^X5bDSI(e69^cPVY_QxX6MMj>15d>B16AuWyJ=O zGGv%!lKP@^EwKsCkO+0=v&>G3MxA0+Mso7r|m!eIza;iOJuU_5z(5W^R&03M#n)C5sO)Y^(HHA#zcXS zu~p5BkReC~99WyRYNEr_FK?cHIh2I;VgyR*&1rTDSZ$pis@AM-w;cRM4dqz(XvN`ITBwMyj9T*lCBj*Io+Gg ziu5-M8jT995fs%D!TVNvL&U2p?(cUo!YMY{>@-5@&BJsu{rdjyk129!z5k?mb|0@+ zN1L1Tr(Pr@aK>e?BhW}x#tMa@CF99jezvC~fo)F4S-Xkuikko1KK-jU3uIX6C?-p3p{)YBkNjuU@Z|?T z7BBcS+;;B94Q1`F)Yrm58tWmQu!`Ts<9nFa* 0, name + ': pool pending'); - }); - - query.push(function(next) { - setTimeout(function() { - pool.destroy(); - console.timeEnd(name); - }, 500); - next(); - }); - - setTimeout(function() { - query.async(next); - }, 1000); -} diff --git a/node_modules/pg/.npmignore b/node_modules/pg/.npmignore index 2bd9cb3..4460241 100644 --- a/node_modules/pg/.npmignore +++ b/node_modules/pg/.npmignore @@ -1,2 +1,6 @@ +node_modules/ +*.swp +*.log .lock-wscript build/ +*~ diff --git a/node_modules/pg/.travis.yml b/node_modules/pg/.travis.yml index 6b32c30..2a588ba 100644 --- a/node_modules/pg/.travis.yml +++ b/node_modules/pg/.travis.yml @@ -1,6 +1,7 @@ language: node_js node_js: - "0.10" + - "0.11" before_script: - node script/create-test-tables.js pg://postgres@127.0.0.1:5432/postgres env: diff --git a/node_modules/pg/Makefile b/node_modules/pg/Makefile index ee973b6..d9d4bb1 100644 --- a/node_modules/pg/Makefile +++ b/node_modules/pg/Makefile @@ -7,35 +7,26 @@ params := $(connectionString) node-command := xargs -n 1 -I file node file $(params) .PHONY : test test-connection test-integration bench test-native \ - build/default/binding.node jshint upgrade-pg publish + jshint publish test-missing-native update-npm all: npm install -build: - node-gyp rebuild - help: @echo "make prepare-test-db [connectionString=postgres://]" @echo "make test-all [connectionString=postgres://]" test: test-unit -test-all: jshint test-unit test-integration test-native test-binary +test-all: jshint test-missing-native test-unit test-integration test-native test-binary -test-travis: test-all upgrade-pg - #@make test-all connectionString=postgres://postgres@localhost:5433/postgres -upgrade-pg: - #@chmod 755 script/travis-pg-9.2-install.sh - #@./script/travis-pg-9.2-install.sh +udpate-npm: + @npm i npm --global bench: @find benchmark -name "*-bench.js" | $(node-command) -build/default/binding.node: - @node-gyp rebuild - test-unit: @find test/unit -name "*-tests.js" | $(node-command) @@ -47,12 +38,23 @@ test-connection-binary: @echo "***Testing binary connection***" @node script/test-connection.js $(params) binary -test-native: build/default/binding.node +test-missing-native: + @echo "***Testing optional native install***" + @rm -rf node_modules/pg-native + @node test/native/missing-native.js + @npm install pg-native@1.4.0 + @node test/native/missing-native.js + @rm -rf node_modules/pg-native + +node_modules/pg-native/index.js: + @npm i pg-native + +test-native: node_modules/pg-native/index.js @echo "***Testing native bindings***" @find test/native -name "*-tests.js" | $(node-command) @find test/integration -name "*-tests.js" | $(node-command) native -test-integration: test-connection build/default/binding.node +test-integration: test-connection @echo "***Testing Pure Javascript***" @find test/integration -name "*-tests.js" | $(node-command) @@ -67,7 +69,3 @@ prepare-test-db: jshint: @echo "***Starting jshint***" @./node_modules/.bin/jshint lib - -publish: - @rm -r build || (exit 0) - @npm publish diff --git a/node_modules/pg/NEWS.md b/node_modules/pg/NEWS.md index 99885ab..2bd6df9 100644 --- a/node_modules/pg/NEWS.md +++ b/node_modules/pg/NEWS.md @@ -4,6 +4,17 @@ For richer information consult the commit log on github with referenced pull req We do not include break-fix version release in this file. +### v4.2.0 +- Support for additional error fields in postgres >= 9.3 if available. + +### v4.1.0 +- Allow type parser overrides on a [per-client basis](https://github.com/brianc/node-postgres/pull/679) + +### v4.0.0 +- Make [native bindings](https://github.com/brianc/node-pg-native.git) an optional install with `npm install pg-native` +- No longer surround query result callback with `try/catch` block. +- Remove built in COPY IN / COPY OUT support - better implementations provided by [pg-copy-streams](https://github.com/brianc/node-pg-copy-streams.git) and [pg-native](https://github.com/brianc/node-pg-native.git) + ### v3.6.0 - Include support for (parsing JSONB)[https://github.com/brianc/node-pg-types/pull/13] (supported in postgres 9.4) diff --git a/node_modules/pg/README.md b/node_modules/pg/README.md index 1c82ed5..85a50bc 100644 --- a/node_modules/pg/README.md +++ b/node_modules/pg/README.md @@ -1,12 +1,14 @@ #node-postgres -[![Build Status](https://secure.travis-ci.org/brianc/node-postgres.png?branch=master)](http://travis-ci.org/brianc/node-postgres) +[![Build Status](https://secure.travis-ci.org/brianc/node-postgres.svg?branch=master)](http://travis-ci.org/brianc/node-postgres) -PostgreSQL client for node.js. Pure JavaScript and native libpq bindings. +PostgreSQL client for node.js. Pure JavaScript and optional native libpq bindings. -## Installation +## Install - npm install pg +```sh +$ npm install pg +``` ## Examples @@ -34,19 +36,16 @@ pg.connect(conString, function(err, client, done) { //output: 1 }); }); - ``` [Check this out for the get up and running quickly example](https://github.com/brianc/node-postgres/wiki/Example) -### Simple +### Client instance -Sometimes you may not want to use a pool of connections. You can easily connect a single client to a postgres instance, run a query, and disconnect. +Sometimes you may not want to use a pool of connections. You can easily connect a single client to a postgres instance, run some queries, and disconnect. ```javascript -var pg = require('pg'); -//or native libpq bindings -//var pg = require('pg').native +var pg = require('pg'); var conString = "postgres://username:password@localhost/database"; @@ -67,15 +66,22 @@ client.connect(function(err) { ``` -## [Documentation](https://github.com/brianc/node-postgres/wiki) +## [More Documentation](https://github.com/brianc/node-postgres/wiki) ## Native Bindings -node-postgres contains a pure JavaScript driver and also exposes JavaScript bindings via libpq. You can use either interface. I personally use the JavaScript bindings as they are quite fast, and I like having everything implemented in JavaScript. +To install the [native bindings](https://github.com/brianc/node-pg-native.git): -To use native libpq bindings replace `require('pg')` with `require('pg').native`. If you __do not__ need or want the native bindings at all, consider using [node-postgres-pure](https://github.com/brianc/node-postgres-pure) instead which does not include them. +```sh +$ npm install pg pg-native +``` -The two share the same interface so __no other code changes should be required__. If you find yourself having to change code other than the require statement when switching from `pg` to `pg.native` or `pg.js`, please report an issue. + +node-postgres contains a pure JavaScript protocol implementation which is quite fast, but you can optionally use native bindings for a 20-30% increase in parsing speed. Both versions are adequate for production workloads. + +To use the native bindings, first install [pg-native](https://github.com/brianc/node-pg-native.git). Once pg-native is installed, simply replace `require('pg')` with `require('pg').native`. + +node-postgres abstracts over the pg-native module to provide exactly the same interface as the pure JavaScript version. __No other code changes are required__. If you find yourself having to change code other than the require statement when switching from `require('pg')` to `require('pg').native` please report an issue. ## Features @@ -90,19 +96,18 @@ The two share the same interface so __no other code changes should be required__ ## Contributing -__I love contributions.__ +__We love contributions!__ -You are welcome contribute via pull requests. If you need help getting the tests running locally feel free to email me or gchat me. +If you need help getting the tests running locally or have any questions about the code when working on a patch please feel free to email me or gchat me. I will __happily__ accept your pull request if it: - __has tests__ - looks reasonable - does not break backwards compatibility -- satisfies jshint Information about the testing processes is in the [wiki](https://github.com/brianc/node-postgres/wiki/Testing). -If you need help or have questions about constructing a pull request I'll be glad to help out as well. +Open source belongs to all of us, and we're all invited to participate! ## Support @@ -113,16 +118,15 @@ If at all possible when you open an issue please provide Usually I'll pop the code into the repo as a test. Hopefully the test fails. Then I make the test pass. Then everyone's happy! - If you need help or run into _any_ issues getting node-postgres to work on your system please report a bug or contact me directly. I am usually available via google-talk at my github account public email address. -I usually tweet about any important status updates or changes to node-postgres. +I usually tweet about any important status updates or changes to node-postgres on twitter. Follow me [@briancarlson](https://twitter.com/briancarlson) to keep up to date. ## Extras -node-postgres is by design _low level_ with the bare minimum of abstraction. These might help out: +node-postgres is by design pretty light on abstractions. These are some handy modules we've been using over the years to complete the picture: - [brianc/node-pg-native](https://github.com/brianc/node-pg-native) - Simple interface abstraction on top of [libpq](https://github.com/brianc/node-libpq) - [brianc/node-pg-query-stream](https://github.com/brianc/node-pg-query-stream) - Query results from node-postgres as a readable (object) stream @@ -133,18 +137,11 @@ node-postgres is by design _low level_ with the bare minimum of abstraction. Th - [Suor/pg-bricks](https://github.com/Suor/pg-bricks) - A higher level wrapper around node-postgres to handle connection settings, sql generation, transactions and ease data access. - [grncdr/node-any-db](https://github.com/grncdr/node-any-db) - Thin and less-opinionated database abstraction layer for node. - [brianc/node-sql](https://github.com/brianc/node-sql) - SQL generation for node.js -- [hiddentao/suqel](https://hiddentao.github.io/squel/) - SQL query string builder for Javascript +- [hiddentao/squel](https://hiddentao.github.io/squel/) - SQL query string builder for Javascript - [CSNW/sql-bricks](https://github.com/CSNW/sql-bricks) - Transparent, Schemaless SQL Generation - [datalanche/node-pg-format](https://github.com/datalanche/node-pg-format) - Safely and easily create dynamic SQL queries with this Node implementation of [PostgreSQL format()](http://www.postgresql.org/docs/9.3/static/functions-string.html#FUNCTIONS-STRING-FORMAT). - - -### Windows - - 1. Install Visual Studio C++ (successfully built with Express 2010). Express is free. - 2. Add your Postgre Installation's `bin` folder to the system path (i.e. `C:\Program Files\PostgreSQL\9.3\bin`). - 3. Make sure that both `libpq.dll` and `pg_config.exe` are in that folder. - 4. `npm install pg` - +- [iceddev/pg-transact](https://github.com/iceddev/pg-transact) - A nicer API on node-postgres transactions +- [sehrope/node-pg-db](https://github.com/sehrope/node-pg-db) - Simpler interface, named parameter support, transaction management and event hooks. ## License diff --git a/node_modules/pg/benchmark/4e822a1.txt b/node_modules/pg/benchmark/4e822a1.txt deleted file mode 100644 index ce94b25..0000000 --- a/node_modules/pg/benchmark/4e822a1.txt +++ /dev/null @@ -1,17 +0,0 @@ -benchmark -starting simple-query-parsing -4166 ops/sec - (100/0.024) -8333 ops/sec - (1000/0.12) -10405 ops/sec - (10000/0.961) -10515 ops/sec - (10000/0.951) -10638 ops/sec - (10000/0.94) -10460 ops/sec - (10000/0.956) -starting prepared-statement-parsing -4166 ops/sec - (100/0.024) -8264 ops/sec - (1000/0.121) -7530 ops/sec - (10000/1.328) -8250 ops/sec - (10000/1.212) -8156 ops/sec - (10000/1.226) -8110 ops/sec - (10000/1.233) -done - diff --git a/node_modules/pg/benchmark/835f71a76f.txt b/node_modules/pg/benchmark/835f71a76f.txt deleted file mode 100644 index 8d35cd4..0000000 --- a/node_modules/pg/benchmark/835f71a76f.txt +++ /dev/null @@ -1,17 +0,0 @@ -benchmark -starting simple-query-parsing -3703 ops/sec - (100/0.027) -7299 ops/sec - (1000/0.137) -8888 ops/sec - (10000/1.125) -8733 ops/sec - (10000/1.145) -8810 ops/sec - (10000/1.135) -8771 ops/sec - (10000/1.14) -starting prepared-statement-parsing -3846 ops/sec - (100/0.026) -7299 ops/sec - (1000/0.137) -7225 ops/sec - (10000/1.384) -7288 ops/sec - (10000/1.372) -7225 ops/sec - (10000/1.384) -7457 ops/sec - (10000/1.341) -done - diff --git a/node_modules/pg/benchmark/df766c913.txt b/node_modules/pg/benchmark/df766c913.txt deleted file mode 100644 index 80f2674..0000000 --- a/node_modules/pg/benchmark/df766c913.txt +++ /dev/null @@ -1,17 +0,0 @@ -benchmark -starting simple-query-parsing -3571 ops/sec - (100/0.028) -7299 ops/sec - (1000/0.137) -8873 ops/sec - (10000/1.127) -8536 ops/sec - (40000/4.686) -8494 ops/sec - (40000/4.709) -7695 ops/sec - (40000/5.198) -starting prepared-statement-parsing -4000 ops/sec - (100/0.025) -6944 ops/sec - (1000/0.144) -7153 ops/sec - (10000/1.398) -7127 ops/sec - (40000/5.612) -7208 ops/sec - (40000/5.549) -6460 ops/sec - (40000/6.191) -done - diff --git a/node_modules/pg/benchmark/index.js b/node_modules/pg/benchmark/index.js deleted file mode 100644 index a07fe45..0000000 --- a/node_modules/pg/benchmark/index.js +++ /dev/null @@ -1,42 +0,0 @@ -var async = require('async'); -var max = 10000; -var maxTimes = 3; -var doLoops = function(bench, loops, times, cb) { - var start = new Date(); - var count = 0; - - var done = function() { - var duration = (new Date() - start) - var seconds = (duration / 1000); - console.log("%d ops/sec - (%d/%d)", ~~(loops/seconds), loops, seconds); - var next = loops * 10; - if(next > max) { - if(times > maxTimes) return cb(); - times++; - next = max; - } - setTimeout(function() { - doLoops(bench, next, times, cb); - }, 100); - } - - var run = function() { - if(count++ >= loops){ - return done(); - } - bench(function() { - setImmediate(run); - }); - } - run(); -} -var bench = require(__dirname + '/simple-query-parsing'); -console.log(); -var benches = ['simple-query-parsing', 'prepared-statement-parsing']; -async.forEachSeries(benches, function(name, cb) { - var bench = require(__dirname + '/' + name)(); - console.log('starting ', name); - doLoops(bench, 100, 1, cb); -}, function(err, res) { - console.log('done') -}) diff --git a/node_modules/pg/benchmark/prepare-values.js b/node_modules/pg/benchmark/prepare-values.js deleted file mode 100644 index 49e973e..0000000 --- a/node_modules/pg/benchmark/prepare-values.js +++ /dev/null @@ -1,46 +0,0 @@ -var utils = require("../lib/utils"); - -var numArr = []; -for (var i = 0; i < 1000; i++) numArr[i] = i; -console.time("prepare-number-array"); -for (var i = 0; i < 100; i++) { - utils.prepareValue(numArr); -} -console.timeEnd("prepare-number-array"); - - -var strArr = new Array(10000); -console.time("prepare-string-array"); -for (var i = 0; i < 100; i++) { - utils.prepareValue(strArr); -} -console.timeEnd("prepare-string-array"); - - -var objArr = []; -for (var i = 0; i < 1000; i++) objArr[i] = { x: { y: 42 }}; -console.time("prepare-object-array"); -for (var i = 0; i < 100; i++) { - utils.prepareValue(objArr); -} -console.timeEnd("prepare-object-array"); - - -var obj = { x: { y: 42 }}; -console.time("prepare-object"); -for (var i = 0; i < 100000; i++) { - utils.prepareValue(obj); -} -console.timeEnd("prepare-object"); - - -var customType = { - toPostgres: function () { - return { toPostgres: function () { return new Date(); } }; - } -}; -console.time("prepare-custom-type"); -for (var i = 0; i < 100000; i++) { - utils.prepareValue(customType); -} -console.timeEnd("prepare-custom-type"); diff --git a/node_modules/pg/benchmark/prepared-statement-parsing.js b/node_modules/pg/benchmark/prepared-statement-parsing.js deleted file mode 100644 index d869d5c..0000000 --- a/node_modules/pg/benchmark/prepared-statement-parsing.js +++ /dev/null @@ -1,73 +0,0 @@ -var Client = require(__dirname + '/../lib/client'); -var buffers = require(__dirname + '/../test/test-buffers'); -require(__dirname + '/../test/unit/test-helper'); - -var stream = new MemoryStream(); -stream.readyState = 'open'; -var client = new Client({ - stream: stream -}); - -var rowDescription = new buffers.rowDescription([{ - name: 'id', - tableID: 1, - attributeNumber: 1, - dataTypeID: 23, //int4 - typeModifer: 0, - formatCode: 0 -},{ - name: 'name', - tableID: 1, - attributeNumber: 2, - dataTypeID: 25, //text - typeModifer: 0, - formatCode: 0 //text format -}, { - name: 'comment', - tableID: 1, - attributeNumber: 3, - dataTypeID: 25, //text - typeModifer: 0, - formatCode: 0 //text format -}]); -var row1 = buffers.dataRow(['1', 'Brian', 'Something groovy']); -var row2 = buffers.dataRow(['2', 'Bob', 'Testint test']); -var row3 = buffers.dataRow(['3', 'The amazing power of the everlasting gobstopper', 'okay now']); -var parseCompleteBuffer = buffers.parseComplete(); -var bindCompleteBuffer = buffers.bindComplete(); -var portalSuspendedBuffer = buffers.portalSuspended(); -var complete = buffers.commandComplete('SELECT 3'); -var ready = buffers.readyForQuery(); -var buffer = Buffer.concat([parseCompleteBuffer, - bindCompleteBuffer, - rowDescription, - row1, - row2, - row3, - portalSuspendedBuffer, - row1, - row2, - row3, - portalSuspendedBuffer, - row1, - row2, - row3, - portalSuspendedBuffer, - complete, ready]); - -var bufferSlice = require('buffer-slice'); -var buffers = bufferSlice(10, buffer); - -client.connect(assert.calls(function() { - client.connection.emit('readyForQuery'); - module.exports = function() { - return function(done) { - client.query('SELECT * FROM whatever WHERE this = "doesnt even matter"', ['whatever'], function(err, res) { - assert.equal(res.rows.length, 9); - done(); - }); - buffers.forEach(stream.emit.bind(stream, 'data')); - }; - }; -})); -client.connection.emit('readyForQuery'); diff --git a/node_modules/pg/benchmark/simple-query-parsing.js b/node_modules/pg/benchmark/simple-query-parsing.js deleted file mode 100644 index fb4895d..0000000 --- a/node_modules/pg/benchmark/simple-query-parsing.js +++ /dev/null @@ -1,59 +0,0 @@ -var Client = require(__dirname + '/../lib/client'); -var buffers = require(__dirname + '/../test/test-buffers'); -require(__dirname + '/../test/unit/test-helper'); - -var stream = new MemoryStream(); -stream.readyState = 'open'; -var client = new Client({ - stream: stream -}); - -var rowDescription = new buffers.rowDescription([{ - name: 'id', - tableID: 1, - attributeNumber: 1, - dataTypeID: 23, //int4 - typeModifer: 0, - formatCode: 0 -},{ - name: 'name', - tableID: 1, - attributeNumber: 2, - dataTypeID: 25, //text - typeModifer: 0, - formatCode: 0 //text format -}, { - name: 'comment', - tableID: 1, - attributeNumber: 3, - dataTypeID: 25, //text - typeModifer: 0, - formatCode: 0 //text format -}]); -var row1 = buffers.dataRow(['1', 'Brian', 'Something groovy']); -var row2 = buffers.dataRow(['2', 'Bob', 'Testint test']); -var row3 = buffers.dataRow(['3', 'The amazing power of the everlasting gobstopper', 'okay now']); -var complete = buffers.commandComplete('SELECT 3'); -var ready = buffers.readyForQuery(); -var buffer = Buffer.concat([ - rowDescription, - row1, row2, row3, - row1, row2, row3, - row1, row2, row3, - complete, ready]); -var bufferSlice = require('buffer-slice'); -buffers = bufferSlice(10, buffer); - -client.connect(assert.calls(function() { - client.connection.emit('readyForQuery'); - module.exports = function() { - return function(done) { - client.query('SELECT * FROM whatever WHERE this = "doesnt even matter"', function(err, res) { - assert.equal(res.rows.length, 9); - done(); - }); - buffers.forEach(stream.emit.bind(stream, 'data')); - }; - }; -})); -client.connection.emit('readyForQuery'); diff --git a/node_modules/pg/binding.gyp b/node_modules/pg/binding.gyp deleted file mode 100644 index bdc9dfd..0000000 --- a/node_modules/pg/binding.gyp +++ /dev/null @@ -1,38 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'binding', - 'sources': ['src/binding.cc'], - 'include_dirs': [ - '= ' + pkg.minNativeVersion + ' of pg-native required.'; +assert(semver.gte(Native.version, pkg.minNativeVersion), msg); -var Connection = binding.Connection; -var NativeQuery = require(__dirname + '/query'); +var NativeQuery = require('./query'); -for(var k in EventEmitter.prototype) { - Connection.prototype[k] = EventEmitter.prototype[k]; -} +var Client = module.exports = function(config) { + EventEmitter.call(this); + config = config || {}; -var nativeConnect = Connection.prototype.connect; + this._types = new TypeOverrides(config.types); -Connection.prototype.connect = function(cb) { + this.native = new Native({ + types: this._types + }); + + this._queryQueue = []; + this._connected = false; + + //keep these on the object for legacy reasons + //for the time being. TODO: deprecate all this jazz + var cp = this.connectionParameters = new ConnectionParameters(config); + this.user = cp.user; + this.password = cp.password; + this.database = cp.database; + this.host = cp.host; + this.port = cp.port; + + //a hash to hold named queries + this.namedQueries = {}; +}; + +util.inherits(Client, EventEmitter); + +//connect to the backend +//pass an optional callback to be called once connected +//or with an error if there was a connection error +//if no callback is passed and there is a connection error +//the client will emit an error event. +Client.prototype.connect = function(cb) { var self = this; + + var onError = function(err) { + if(cb) return cb(err); + return self.emit('error', err); + }; + this.connectionParameters.getLibpqConnectionString(function(err, conString) { - if(err) { - return cb ? cb(err) : self.emit('error', err); - } - if(cb) { - var errCallback; - var connectCallback = function() { - //remove single-fire connection error callback - self.removeListener('error', errCallback); - cb(null); - }; - errCallback = function(err) { - //remove singel-fire connection success callback - self.removeListener('connect', connectCallback); - cb(err); - }; - self.once('connect', connectCallback); - self.once('error', errCallback); - } - nativeConnect.call(self, conString); + if(err) return onError(err); + self.native.connect(conString, function(err) { + if(err) return onError(err); + + //set internal states to connected + self._connected = true; + + //handle connection errors from the native layer + self.native.on('error', function(err) { + //error will be handled by active query + if(self._activeQuery && self._activeQuery.state != 'end') { + return; + } + self.emit('error', err); + }); + + self.native.on('notification', function(msg) { + self.emit('notification', { + channel: msg.relname, + payload: msg.extra + }); + }); + + //signal we are connected now + self.emit('connect'); + self._pulseQueryQueue(true); + + //possibly call the optional callback + if(cb) cb(); + }); }); }; -Connection.prototype._copy = function (text, stream) { - var q = new NativeQuery(text, function (error) { - if (error) { - q.stream.error(error); - } else { - q.stream.close(); - } - }); - q.stream = stream; - this._queryQueue.push(q); - this._pulseQueryQueue(); - return q.stream; -}; +//send a query to the server +//this method is highly overloaded to take +//1) string query, optional array of parameters, optional function callback +//2) object query with { +// string query +// optional array values, +// optional function callback instead of as a separate parameter +// optional string name to name & cache the query plan +// optional string rowMode = 'array' for an array of results +// } +Client.prototype.query = function(config, values, callback) { + var query = new NativeQuery(this.native); -Connection.prototype.copyFrom = function (text) { - return this._copy(text, new CopyFromStream()); -}; + //support query('text', ...) style calls + if(typeof config == 'string') { + query.text = config; + } -Connection.prototype.copyTo = function (text) { - return this._copy(text, new CopyToStream()); -}; + //support passing everything in via a config object + if(typeof config == 'object') { + query.text = config.text; + query.values = config.values; + query.name = config.name; + query.callback = config.callback; + query._arrayMode = config.rowMode == 'array'; + } -Connection.prototype.sendCopyFromChunk = function (chunk) { - this._sendCopyFromChunk(chunk); -}; + //support query({...}, function() {}) style calls + //& support query(..., ['values'], ...) style calls + if(typeof values == 'function') { + query.callback = values; + } + else if(util.isArray(values)) { + query.values = values; + } + if(typeof callback == 'function') { + query.callback = callback; + } -Connection.prototype.endCopyFrom = function (msg) { - this._endCopyFrom(msg); -}; - -// use JS version if native version undefined -// happens when PG version < 9.0.0 -if (!Connection.prototype.escapeIdentifier) { - Connection.prototype.escapeIdentifier = JsClient.prototype.escapeIdentifier; -} -if (!Connection.prototype.escapeLiteral) { - Connection.prototype.escapeLiteral = JsClient.prototype.escapeLiteral; -} - -Connection.prototype.query = function(config, values, callback) { - var query = (config instanceof NativeQuery) ? config : - new NativeQuery(config, values, callback); this._queryQueue.push(query); this._pulseQueryQueue(); return query; }; -var nativeCancel = Connection.prototype.cancel; - -Connection.prototype.cancel = function(client, query) { - if (client._activeQuery == query) { - this.connect(nativeCancel.bind(client)); - } else if (client._queryQueue.indexOf(query) != -1) { - client._queryQueue.splice(client._queryQueue.indexOf(query), 1); +//disconnect from the backend server +Client.prototype.end = function(cb) { + var self = this; + if(!this._connected) { + this.once('connect', this.end.bind(this, cb)); } + this.native.end(function() { + //send an error to the active query + if(self._hasActiveQuery()) { + var msg = 'Connection terminated'; + self._queryQueue.length = 0; + self._activeQuery.handleError(new Error(msg)); + } + self.emit('end'); + if(cb) cb(); + }); }; -Connection.prototype._pulseQueryQueue = function(initialConnection) { +Client.prototype._hasActiveQuery = function() { + return this._activeQuery && this._activeQuery.state != 'error' && this._activeQuery.state != 'end'; +}; + +Client.prototype._pulseQueryQueue = function(initialConnection) { if(!this._connected) { return; } - if(this._activeQuery) { + if(this._hasActiveQuery()) { return; } var query = this._queryQueue.shift(); @@ -114,127 +168,26 @@ Connection.prototype._pulseQueryQueue = function(initialConnection) { return; } this._activeQuery = query; - if(query.name) { - if(this._namedQueries[query.name]) { - this._sendQueryPrepared(query.name, query.values||[], query.singleRowMode); - } else { - this._namedQuery = true; - this._sendPrepare(query.name, query.text, (query.values||[]).length, query.singleRowMode); - } - } else if(query.values) { - //call native function - this._sendQueryWithParams(query.text, query.values, query.singleRowMode); - } else { - //call native function - this._sendQuery(query.text, query.singleRowMode); + query.submit(this); + var self = this; + query.once('_done', function() { + self._pulseQueryQueue(); + }); +}; + +//attempt to cancel an in-progress query +Client.prototype.cancel = function(query) { + if(this._activeQuery == query) { + this.native.cancel(function() {}); + } else if (this._queryQueue.indexOf(query) != -1) { + this._queryQueue.splice(this._queryQueue.indexOf(query), 1); } }; -Connection.prototype.sendCopyFail = function(msg) { - this.endCopyFrom(msg); +Client.prototype.setTypeParser = function(oid, format, parseFn) { + return this._types.setTypeParser(oid, format, parseFn); }; -var clientBuilder = function(config) { - config = config || {}; - var connection = new Connection(); - EventEmitter.call(connection); - connection._queryQueue = []; - connection._namedQueries = {}; - connection._activeQuery = null; - connection.connectionParameters = new ConnectionParameters(config); - //attach properties to normalize interface with pure js client - connection.user = connection.connectionParameters.user; - connection.password = connection.connectionParameters.password; - connection.database = connection.connectionParameters.database; - connection.host = connection.connectionParameters.host; - connection.port = connection.connectionParameters.port; - connection.on('connect', function() { - connection._connected = true; - connection._pulseQueryQueue(true); - }); - - connection.on('_rowDescription', function(rowDescription) { - connection._activeQuery.handleRowDescription(rowDescription); - }); - - //proxy some events to active query - connection.on('_row', function(row) { - connection._activeQuery.handleRow(row); - }); - - connection.on('_cmdStatus', function(status) { - //set this here so we can pass it to the query - //when the query completes - connection._lastMeta = status; - }); - - //TODO: emit more native error properties (make it match js error) - connection.on('_error', function(err) { - //create Error object from object literal - var error = new Error(err.message || "Unknown native driver error"); - for(var key in err) { - error[key] = err[key]; - } - - //give up on trying to wait for named query prepare - this._namedQuery = false; - if(connection._activeQuery) { - connection._activeQuery.handleError(error); - } else { - connection.emit('error', error); - } - }); - - connection.on('_end', function() { - process.nextTick(function() { - if(connection._activeQuery) { - connection._activeQuery.handleError(new Error("Connection was ended during query")); - } - connection.emit('end'); - }); - }); - - connection.on('_readyForQuery', function() { - var error; - var q = this._activeQuery; - //a named query finished being prepared - if(this._namedQuery) { - this._namedQueries[q.name] = true; - this._namedQuery = false; - this._sendQueryPrepared(q.name, q.values||[]); - } else { - //try/catch/rethrow to ensure exceptions don't prevent the queryQueue from - //being processed - try{ - connection._activeQuery.handleReadyForQuery(connection._lastMeta); - } catch(e) { - error = e; - } - connection._activeQuery = null; - connection._pulseQueryQueue(); - if(error) throw error; - } - }); - connection.on('copyInResponse', function () { - //connection is ready to accept chunks - //start to send data from stream - connection._activeQuery.streamData(connection); - }); - connection.on('copyOutResponse', function(msg) { - if (connection._activeQuery.stream === undefined) { - connection._activeQuery._canceledDueToError = new Error('No destination stream defined'); - (new clientBuilder({port: connection.port, host: connection.host})).cancel(connection, connection._activeQuery); - } - }); - connection.on('copyData', function (chunk) { - //recieve chunk from connection - //move it to stream - connection._activeQuery.handleCopyFromChunk(chunk); - }); - return connection; +Client.prototype.getTypeParser = function(oid, format) { + return this._types.getTypeParser(oid, format); }; - -// expose a Query constructor -clientBuilder.Query = NativeQuery; - -module.exports = clientBuilder; diff --git a/node_modules/pg/lib/native/query.js b/node_modules/pg/lib/native/query.js index 55b3262..29b77ba 100644 --- a/node_modules/pg/lib/native/query.js +++ b/node_modules/pg/lib/native/query.js @@ -1,105 +1,108 @@ var EventEmitter = require('events').EventEmitter; var util = require('util'); +var utils = require('../utils'); +var NativeResult = require('./result'); -var utils = require(__dirname + '/../utils'); -var Result = require(__dirname + '/../result'); - -//event emitter proxy -var NativeQuery = function(config, values, callback) { - // use of "new" optional - if (!(this instanceof NativeQuery)) { - return new NativeQuery(config, values, callback); - } - +var NativeQuery = module.exports = function(native) { EventEmitter.call(this); + this.native = native; + this.text = null; + this.values = null; + this.name = null; + this.callback = null; + this.state = 'new'; + this._arrayMode = false; - var c = utils.normalizeQueryConfig(config, values, callback); - - this.name = c.name; - this.text = c.text; - this.values = c.values; - this.callback = c.callback; - if(process.domain && c.callback) { - this.callback = process.domain.bind(c.callback); - } - this.singleRowMode = false; - - if(!this.callback) { - this.singleRowMode = true; - } - - this._result = new Result(config.rowMode); - this._addedFields = false; - this._hadError = false; - //normalize values - if(this.values) { - for(var i = 0, len = this.values.length; i < len; i++) { - this.values[i] = utils.prepareValue(this.values[i]); - } - } - this._canceledDueToError = false; + //if the 'row' event is listened for + //then emit them as they come in + //without setting singleRowMode to true + //this has almost no meaning because libpq + //reads all rows into memory befor returning any + this._emitRowEvents = false; + this.on('newListener', function(event) { + if(event === 'row') this._emitRowEvents = true; + }.bind(this)); }; util.inherits(NativeQuery, EventEmitter); -NativeQuery.prototype.handleRowDescription = function(rowDescription) { - this._result.addFields(rowDescription); -}; - -NativeQuery.prototype.handleRow = function(rowData) { - var row = this._result.parseRow(rowData); - if(this.callback) { - this._result.addRow(row); +NativeQuery.prototype.handleError = function(err) { + var self = this; + //copy pq error fields into the error object + var fields = self.native.pq.resultErrorFields(); + if(fields) { + for(var key in fields) { + err[key] = fields[key]; + } } - this.emit('row', row, this._result); -}; - -NativeQuery.prototype.handleError = function(error) { - if (this._canceledDueToError) { - error = this._canceledDueToError; - this._canceledDueToError = false; - } - this._hadError = true; - if(this.callback) { - var cb = this.callback; - //remove callback to prevent double call on readyForQuery - this.callback = null; - cb(error); + if(self.callback) { + self.callback(err); } else { - this.emit('error', error); + self.emit('error', err); } + self.state = 'error'; }; -NativeQuery.prototype.handleReadyForQuery = function(meta) { - if(this._hadError) return; - if (this._canceledDueToError) { - return this.handleError(this._canceledDueToError); - } - if(meta) { - this._result.addCommandComplete(meta); - } - if(this.callback) { - this.callback(null, this._result); - } - this.emit('end', this._result); -}; +NativeQuery.prototype.submit = function(client) { + this.state = 'running'; + var self = this; + client.native.arrayMode = this._arrayMode; -NativeQuery.prototype.streamData = function (connection) { - if(this.stream) { - this.stream.startStreamingToConnection(connection); + var after = function(err, rows) { + client.native.arrayMode = false; + setImmediate(function() { + self.emit('_done'); + }); + + //handle possible query error + if(err) { + return self.handleError(err); + } + + var result = new NativeResult(); + result.addCommandComplete(self.native.pq); + result.rows = rows; + + //emit row events for each row in the result + if(self._emitRowEvents) { + rows.forEach(function(row) { + self.emit('row', row, result); + }); + } + + + //handle successful result + self.state = 'end'; + self.emit('end', result); + if(self.callback) { + self.callback(null, result); + } + }; + + if(process.domain) { + after = process.domain.bind(after); } - else { - connection.sendCopyFail('No source stream defined'); + + //named query + if(this.name) { + var values = (this.values||[]).map(utils.prepareValue); + + //check if the client has already executed this named query + //if so...just execute it again - skip the planning phase + if(client.namedQueries[this.name]) { + return this.native.execute(this.name, values, after); + } + //plan the named query the first time, then execute it + return this.native.prepare(this.name, this.text, values.length, function(err) { + if(err) return after(err); + client.namedQueries[self.name] = true; + return self.native.execute(self.name, values, after); + }); + } + else if(this.values) { + var vals = this.values.map(utils.prepareValue); + this.native.query(this.text, vals, after); + } else { + this.native.query(this.text, after); } }; - -NativeQuery.prototype.handleCopyFromChunk = function (chunk) { - if(this.stream) { - this.stream.handleChunk(chunk); - } - //if there are no stream (for example when copy to query was sent by - //query method instead of copyTo) error will be handled - //on copyOutResponse event, so silently ignore this error here -}; - -module.exports = NativeQuery; diff --git a/node_modules/pg/lib/native/result.js b/node_modules/pg/lib/native/result.js new file mode 100644 index 0000000..5e202f1 --- /dev/null +++ b/node_modules/pg/lib/native/result.js @@ -0,0 +1,22 @@ +var NativeResult = module.exports = function(pq) { + this.command = null; + this.rowCount = 0; + this.rows = null; + this.fields = null; +}; + +NativeResult.prototype.addCommandComplete = function(pq) { + this.command = pq.cmdStatus().split(' ')[0]; + this.rowCount = pq.cmdTuples(); + var nfields = pq.nfields(); + if(nfields < 1) return; + + this.fields = []; + for(var i = 0; i < nfields; i++) { + this.fields.push({ + name: pq.fname(i), + dataTypeID: pq.ftype(i) + }); + } +}; + diff --git a/node_modules/pg/lib/query.js b/node_modules/pg/lib/query.js index 1eb47b4..69be6e4 100644 --- a/node_modules/pg/lib/query.js +++ b/node_modules/pg/lib/query.js @@ -23,9 +23,7 @@ var Query = function(config, values, callback) { if(process.domain && config.callback) { this.callback = process.domain.bind(config.callback); } - this._fieldNames = []; - this._fieldConverters = []; - this._result = new Result(config.rowMode); + this._result = new Result(config.rowMode, config.types); this.isPreparedStatement = false; this._canceledDueToError = false; EventEmitter.call(this); diff --git a/node_modules/pg/lib/result.js b/node_modules/pg/lib/result.js index ae99255..bf05381 100644 --- a/node_modules/pg/lib/result.js +++ b/node_modules/pg/lib/result.js @@ -88,7 +88,7 @@ Result.prototype.addFields = function(fieldDescriptions) { for(var i = 0; i < fieldDescriptions.length; i++) { var desc = fieldDescriptions[i]; this.fields.push(desc); - var parser = types.getTypeParser(desc.dataTypeID, desc.format || 'text'); + var parser = this._getTypeParser(desc.dataTypeID, desc.format || 'text'); this._parsers.push(parser); //this is some craziness to compile the row result parsing //results in ~60% speedup on large query result sets @@ -99,4 +99,6 @@ Result.prototype.addFields = function(fieldDescriptions) { } }; +Result.prototype._getTypeParser = types.getTypeParser; + module.exports = Result; diff --git a/node_modules/pg/lib/type-overrides.js b/node_modules/pg/lib/type-overrides.js new file mode 100644 index 0000000..f6ebdb9 --- /dev/null +++ b/node_modules/pg/lib/type-overrides.js @@ -0,0 +1,30 @@ +var types = require('pg-types'); + +function TypeOverrides(userTypes) { + this._types = userTypes || types; + this.text = {}; + this.binary = {}; +} + +TypeOverrides.prototype.getOverrides = function(format) { + switch(format) { + case 'text': return this.text; + case 'binary': return this.binary; + default: return {}; + } +}; + +TypeOverrides.prototype.setTypeParser = function(oid, format, parseFn) { + if(typeof format == 'function') { + parseFn = format; + format = 'text'; + } + this.getOverrides(format)[oid] = parseFn; +}; + +TypeOverrides.prototype.getTypeParser = function(oid, format) { + format = format || 'text'; + return this.getOverrides(format)[oid] || this._types.getTypeParser(oid, format); +}; + +module.exports = TypeOverrides; diff --git a/node_modules/pg/node_modules/.bin/semver b/node_modules/pg/node_modules/.bin/semver new file mode 120000 index 0000000..317eb29 --- /dev/null +++ b/node_modules/pg/node_modules/.bin/semver @@ -0,0 +1 @@ +../semver/bin/semver \ No newline at end of file diff --git a/node_modules/pg/node_modules/bindings/README.md b/node_modules/pg/node_modules/bindings/README.md deleted file mode 100644 index 585cf51..0000000 --- a/node_modules/pg/node_modules/bindings/README.md +++ /dev/null @@ -1,97 +0,0 @@ -node-bindings -============= -### Helper module for loading your native module's .node file - -This is a helper module for authors of Node.js native addon modules. -It is basically the "swiss army knife" of `require()`ing your native module's -`.node` file. - -Throughout the course of Node's native addon history, addons have ended up being -compiled in a variety of different places, depending on which build tool and which -version of node was used. To make matters worse, now the _gyp_ build tool can -produce either a _Release_ or _Debug_ build, each being built into different -locations. - -This module checks _all_ the possible locations that a native addon would be built -at, and returns the first one that loads successfully. - - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install bindings -``` - -Or add it to the `"dependencies"` section of your _package.json_ file. - - -Example -------- - -`require()`ing the proper bindings file for the current node version, platform -and architecture is as simple as: - -``` js -var bindings = require('bindings')('binding.node') - -// Use your bindings defined in your C files -bindings.your_c_function() -``` - - -Nice Error Output ------------------ - -When the `.node` file could not be loaded, `node-bindings` throws an Error with -a nice error message telling you exactly what was tried. You can also check the -`err.tries` Array property. - -``` -Error: Could not load the bindings file. Tried: - → /Users/nrajlich/ref/build/binding.node - → /Users/nrajlich/ref/build/Debug/binding.node - → /Users/nrajlich/ref/build/Release/binding.node - → /Users/nrajlich/ref/out/Debug/binding.node - → /Users/nrajlich/ref/Debug/binding.node - → /Users/nrajlich/ref/out/Release/binding.node - → /Users/nrajlich/ref/Release/binding.node - → /Users/nrajlich/ref/build/default/binding.node - → /Users/nrajlich/ref/compiled/0.8.2/darwin/x64/binding.node - at bindings (/Users/nrajlich/ref/node_modules/bindings/bindings.js:84:13) - at Object. (/Users/nrajlich/ref/lib/ref.js:5:47) - at Module._compile (module.js:449:26) - at Object.Module._extensions..js (module.js:467:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - ... -``` - - -License -------- - -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.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/pg/node_modules/bindings/bindings.js b/node_modules/pg/node_modules/bindings/bindings.js deleted file mode 100644 index 93dcf85..0000000 --- a/node_modules/pg/node_modules/bindings/bindings.js +++ /dev/null @@ -1,166 +0,0 @@ - -/** - * Module dependencies. - */ - -var fs = require('fs') - , path = require('path') - , join = path.join - , dirname = path.dirname - , exists = fs.existsSync || path.existsSync - , defaults = { - arrow: process.env.NODE_BINDINGS_ARROW || ' → ' - , compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled' - , platform: process.platform - , arch: process.arch - , version: process.versions.node - , bindings: 'bindings.node' - , try: [ - // node-gyp's linked version in the "build" dir - [ 'module_root', 'build', 'bindings' ] - // node-waf and gyp_addon (a.k.a node-gyp) - , [ 'module_root', 'build', 'Debug', 'bindings' ] - , [ 'module_root', 'build', 'Release', 'bindings' ] - // Debug files, for development (legacy behavior, remove for node v0.9) - , [ 'module_root', 'out', 'Debug', 'bindings' ] - , [ 'module_root', 'Debug', 'bindings' ] - // Release files, but manually compiled (legacy behavior, remove for node v0.9) - , [ 'module_root', 'out', 'Release', 'bindings' ] - , [ 'module_root', 'Release', 'bindings' ] - // Legacy from node-waf, node <= 0.4.x - , [ 'module_root', 'build', 'default', 'bindings' ] - // Production "Release" buildtype binary (meh...) - , [ 'module_root', 'compiled', 'version', 'platform', 'arch', 'bindings' ] - ] - } - -/** - * The main `bindings()` function loads the compiled bindings for a given module. - * It uses V8's Error API to determine the parent filename that this function is - * being invoked from, which is then used to find the root directory. - */ - -function bindings (opts) { - - // Argument surgery - if (typeof opts == 'string') { - opts = { bindings: opts } - } else if (!opts) { - opts = {} - } - opts.__proto__ = defaults - - // Get the module root - if (!opts.module_root) { - opts.module_root = exports.getRoot(exports.getFileName()) - } - - // Ensure the given bindings name ends with .node - if (path.extname(opts.bindings) != '.node') { - opts.bindings += '.node' - } - - var tries = [] - , i = 0 - , l = opts.try.length - , n - , b - , err - - for (; i(std::string) - - Added NanNew(std::string&) - - Added NanAsciiString helper class - - Added NanUtf8String helper class - - Added NanUcs2String helper class - - Deprecated NanRawString() - - Deprecated NanCString() - - Added NanGetIsolateData(v8::Isolate *isolate) - - Added NanMakeCallback(v8::Handle target, v8::Handle func, int argc, v8::Handle* argv) - - Added NanMakeCallback(v8::Handle target, v8::Handle symbol, int argc, v8::Handle* argv) - - Added NanMakeCallback(v8::Handle target, const char* method, int argc, v8::Handle* argv) - - Added NanSetTemplate(v8::Handle templ, v8::Handle name , v8::Handle value, v8::PropertyAttribute attributes) - - Added NanSetPrototypeTemplate(v8::Local templ, v8::Handle name, v8::Handle value, v8::PropertyAttribute attributes) - - Added NanSetInstanceTemplate(v8::Local templ, const char *name, v8::Handle value) - - Added NanSetInstanceTemplate(v8::Local templ, v8::Handle name, v8::Handle value, v8::PropertyAttribute attributes) - -**1.2.0 Jun 5 2014** - - - Add NanSetPrototypeTemplate - - Changed NAN_WEAK_CALLBACK internals, switched _NanWeakCallbackData to class, - introduced _NanWeakCallbackDispatcher - - Removed -Wno-unused-local-typedefs from test builds - - Made test builds Windows compatible ('Sleep()') - -**1.1.2 May 28 2014** - - - Release to fix more stuff-ups in 1.1.1 - -**1.1.1 May 28 2014** - - - Release to fix version mismatch in nan.h and lack of changelog entry for 1.1.0 - -**1.1.0 May 25 2014** - - - Remove nan_isolate, use v8::Isolate::GetCurrent() internally instead - - Additional explicit overloads for NanNew(): (char*,int), (uint8_t*[,int]), - (uint16_t*[,int), double, int, unsigned int, bool, v8::String::ExternalStringResource*, - v8::String::ExternalAsciiStringResource* - - Deprecate NanSymbol() - - Added SetErrorMessage() and ErrorMessage() to NanAsyncWorker - -**1.0.0 May 4 2014** - - - Heavy API changes for V8 3.25 / Node 0.11.13 - - Use cpplint.py - - Removed NanInitPersistent - - Removed NanPersistentToLocal - - Removed NanFromV8String - - Removed NanMakeWeak - - Removed NanNewLocal - - Removed NAN_WEAK_CALLBACK_OBJECT - - Removed NAN_WEAK_CALLBACK_DATA - - Introduce NanNew, replaces NanNewLocal, NanPersistentToLocal, adds many overloaded typed versions - - Introduce NanUndefined, NanNull, NanTrue and NanFalse - - Introduce NanEscapableScope and NanEscapeScope - - Introduce NanMakeWeakPersistent (requires a special callback to work on both old and new node) - - Introduce NanMakeCallback for node::MakeCallback - - Introduce NanSetTemplate - - Introduce NanGetCurrentContext - - Introduce NanCompileScript and NanRunScript - - Introduce NanAdjustExternalMemory - - Introduce NanAddGCEpilogueCallback, NanAddGCPrologueCallback, NanRemoveGCEpilogueCallback, NanRemoveGCPrologueCallback - - Introduce NanGetHeapStatistics - - Rename NanAsyncWorker#SavePersistent() to SaveToPersistent() - -**0.8.0 Jan 9 2014** - - - NanDispose -> NanDisposePersistent, deprecate NanDispose - - Extract _NAN_*_RETURN_TYPE, pull up NAN_*() - -**0.7.1 Jan 9 2014** - - - Fixes to work against debug builds of Node - - Safer NanPersistentToLocal (avoid reinterpret_cast) - - Speed up common NanRawString case by only extracting flattened string when necessary - -**0.7.0 Dec 17 2013** - - - New no-arg form of NanCallback() constructor. - - NanCallback#Call takes Handle rather than Local - - Removed deprecated NanCallback#Run method, use NanCallback#Call instead - - Split off _NAN_*_ARGS_TYPE from _NAN_*_ARGS - - Restore (unofficial) Node 0.6 compatibility at NanCallback#Call() - - Introduce NanRawString() for char* (or appropriate void*) from v8::String - (replacement for NanFromV8String) - - Introduce NanCString() for null-terminated char* from v8::String - -**0.6.0 Nov 21 2013** - - - Introduce NanNewLocal(v8::Handle value) for use in place of - v8::Local::New(...) since v8 started requiring isolate in Node 0.11.9 - -**0.5.2 Nov 16 2013** - - - Convert SavePersistent and GetFromPersistent in NanAsyncWorker from protected and public - -**0.5.1 Nov 12 2013** - - - Use node::MakeCallback() instead of direct v8::Function::Call() - -**0.5.0 Nov 11 2013** - - - Added @TooTallNate as collaborator - - New, much simpler, "include_dirs" for binding.gyp - - Added full range of NAN_INDEX_* macros to match NAN_PROPERTY_* macros - -**0.4.4 Nov 2 2013** - - - Isolate argument from v8::Persistent::MakeWeak removed for 0.11.8+ - -**0.4.3 Nov 2 2013** - - - Include node_object_wrap.h, removed from node.h for Node 0.11.8. - -**0.4.2 Nov 2 2013** - - - Handle deprecation of v8::Persistent::Dispose(v8::Isolate* isolate)) for - Node 0.11.8 release. - -**0.4.1 Sep 16 2013** - - - Added explicit `#include ` as it was removed from node.h for v0.11.8 - -**0.4.0 Sep 2 2013** - - - Added NAN_INLINE and NAN_DEPRECATED and made use of them - - Added NanError, NanTypeError and NanRangeError - - Cleaned up code - -**0.3.2 Aug 30 2013** - - - Fix missing scope declaration in GetFromPersistent() and SaveToPersistent - in NanAsyncWorker - -**0.3.1 Aug 20 2013** - - - fix "not all control paths return a value" compile warning on some platforms - -**0.3.0 Aug 19 2013** - - - Made NAN work with NPM - - Lots of fixes to NanFromV8String, pulling in features from new Node core - - Changed node::encoding to Nan::Encoding in NanFromV8String to unify the API - - Added optional error number argument for NanThrowError() - - Added NanInitPersistent() - - Added NanReturnNull() and NanReturnEmptyString() - - Added NanLocker and NanUnlocker - - Added missing scopes - - Made sure to clear disposed Persistent handles - - Changed NanAsyncWorker to allocate error messages on the heap - - Changed NanThrowError(Local) to NanThrowError(Handle) - - Fixed leak in NanAsyncWorker when errmsg is used - -**0.2.2 Aug 5 2013** - - - Fixed usage of undefined variable with node::BASE64 in NanFromV8String() - -**0.2.1 Aug 5 2013** - - - Fixed 0.8 breakage, node::BUFFER encoding type not available in 0.8 for - NanFromV8String() - -**0.2.0 Aug 5 2013** - - - Added NAN_PROPERTY_GETTER, NAN_PROPERTY_SETTER, NAN_PROPERTY_ENUMERATOR, - NAN_PROPERTY_DELETER, NAN_PROPERTY_QUERY - - Extracted _NAN_METHOD_ARGS, _NAN_GETTER_ARGS, _NAN_SETTER_ARGS, - _NAN_PROPERTY_GETTER_ARGS, _NAN_PROPERTY_SETTER_ARGS, - _NAN_PROPERTY_ENUMERATOR_ARGS, _NAN_PROPERTY_DELETER_ARGS, - _NAN_PROPERTY_QUERY_ARGS - - Added NanGetInternalFieldPointer, NanSetInternalFieldPointer - - Added NAN_WEAK_CALLBACK, NAN_WEAK_CALLBACK_OBJECT, - NAN_WEAK_CALLBACK_DATA, NanMakeWeak - - Renamed THROW_ERROR to _NAN_THROW_ERROR - - Added NanNewBufferHandle(char*, size_t, node::smalloc::FreeCallback, void*) - - Added NanBufferUse(char*, uint32_t) - - Added NanNewContextHandle(v8::ExtensionConfiguration*, - v8::Handle, v8::Handle) - - Fixed broken NanCallback#GetFunction() - - Added optional encoding and size arguments to NanFromV8String() - - Added NanGetPointerSafe() and NanSetPointerSafe() - - Added initial test suite (to be expanded) - - Allow NanUInt32OptionValue to convert any Number object - -**0.1.0 Jul 21 2013** - - - Added `NAN_GETTER`, `NAN_SETTER` - - Added `NanThrowError` with single Local argument - - Added `NanNewBufferHandle` with single uint32_t argument - - Added `NanHasInstance(Persistent&, Handle)` - - Added `Local NanCallback#GetFunction()` - - Added `NanCallback#Call(int, Local[])` - - Deprecated `NanCallback#Run(int, Local[])` in favour of Call diff --git a/node_modules/pg/node_modules/nan/LICENSE b/node_modules/pg/node_modules/nan/LICENSE deleted file mode 100644 index d502e18..0000000 --- a/node_modules/pg/node_modules/nan/LICENSE +++ /dev/null @@ -1,46 +0,0 @@ -Copyright 2013, NAN contributors: - - Rod Vagg - - Benjamin Byholm - - Trevor Norris - - Nathan Rajlich - - Brett Lawson - - Ben Noordhuis -(the "Original Author") -All rights reserved. - -MIT +no-false-attribs 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. - -Distributions of all or part of the Software intended to be used -by the recipients as they would use the unmodified Software, -containing modifications that substantially alter, remove, or -disable functionality of the Software, outside of the documented -configuration mechanisms provided by the Software, shall be -modified such that the Original Author's bug reporting email -addresses and urls are either replaced with the contact information -of the parties responsible for the changes, or removed entirely. - -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. - - -Except where noted, this license applies to any and all software -programs and associated documentation files created by the -Original Author, when distributed with the Software. diff --git a/node_modules/pg/node_modules/nan/README.md b/node_modules/pg/node_modules/nan/README.md deleted file mode 100644 index 2904a38..0000000 --- a/node_modules/pg/node_modules/nan/README.md +++ /dev/null @@ -1,1054 +0,0 @@ -Native Abstractions for Node.js -=============================== - -**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10 and 0.11, and eventually 0.12.** - -***Current version: 1.3.0*** - -*(See [nan.h](https://github.com/rvagg/nan/blob/master/CHANGELOG.md) for complete ChangeLog)* - -[![NPM](https://nodei.co/npm/nan.png?downloads=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6)](https://nodei.co/npm/nan/) - -[![Build Status](https://secure.travis-ci.org/rvagg/nan.png)](http://travis-ci.org/rvagg/nan) -[![Build status](https://ci.appveyor.com/api/projects/status/kh73pbm9dsju7fgh)](https://ci.appveyor.com/project/RodVagg/nan) - -Thanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.11/0.12, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle. - -This project also contains some helper utilities that make addon development a bit more pleasant. - - * **[News & Updates](#news)** - * **[Usage](#usage)** - * **[Example](#example)** - * **[API](#api)** - - -## News & Updates - -### Aug-2014: 1.3.0 release - -* `NanCString()` and `NanRawString()` have been deprecated in favour of new NanAsciiString, NanUtf8String and NanUcs2String. These classes manage the underlying memory for you in a safer way than just handing off an allocated array. You should now `*NanAsciiString(handle)` to access the raw `char` data, you can also allocate on the heap if you need to keep a reference. -* Two more NanMakeCallback overloads have been added to for parity with Node core. -* You can now `NanNew(std::string)` (use `NanNew(std::string&)` to pass by reference) -* NanSetTemplate, NanSetPrototypeTemplate and NanSetInstanceTemplate have been added. - -### May-2014: 1.1.0 release - -* We've deprecated `NanSymbol()`, you should just use `NanNew()` now. -* `NanNull()`, `NanUndefined()`, `NanTrue()`, `NanFalse()` all return `Local`s now. -* `nan_isolate` is gone, it was intended to be internal-only but if you were using it then you should switch to `v8::Isolate::GetCurrent()`. -* `NanNew()` has received some additional overload-love so you should be able to give it many kinds of values without specifying the ``. -* Lots of small fixes and additions to expand the V8 API coverage, *use the source, Luke*. - - -### May-2014: Major changes for V8 3.25 / Node 0.11.13 - -Node 0.11.11 and 0.11.12 were both broken releases for native add-ons, you simply can't properly compile against either of them for different reasons. But we now have a 0.11.13 release that jumps a couple of versions of V8 ahead and includes some more, major (traumatic) API changes. - -Because we are now nearing Node 0.12 and estimate that the version of V8 we are using in Node 0.11.13 will be close to the API we get for 0.12, we have taken the opportunity to not only *fix* NAN for 0.11.13 but make some major changes to improve the NAN API. - -We have **removed support for Node 0.11 versions prior to 0.11.13**. As usual, our tests are run against (and pass) the last 5 versions of Node 0.8 and Node 0.10. We also include Node 0.11.13 obviously. - -The major change is something that [Benjamin Byholm](kkoopa) has put many hours in to. We now have a fantastic new `NanNew(args)` interface for creating new `Local`s, this replaces `NanNewLocal()` and much more. If you look in [./nan.h](nan.h) you'll see a large number of overloaded versions of this method. In general you should be able to `NanNew(arguments)` for any type you want to make a `Local` from. This includes `Persistent` types, so we now have a `Local NanNew(const Persistent arg)` to replace `NanPersistentToLocal()`. - -We also now have `NanUndefined()`, `NanNull()`, `NanTrue()` and `NanFalse()`. Mainly because of the new requirement for an `Isolate` argument for each of the native V8 versions of this. - -V8 has now introduced an `EscapableHandleScope` from which you `scope.Escape(Local value)` to *return* a value from a one scope to another. This replaces the standard `HandleScope` and `scope.Close(Local value)`, although `HandleScope` still exists for when you don't need to return a handle to the caller. For NAN we are exposing it as `NanEscapableScope()` and `NanEscapeScope()`, while `NanScope()` is still how you create a new scope that doesn't need to return handles. For older versions of Node/V8, it'll still map to the older `HandleScope` functionality. - -`NanFromV8String()` was deprecated and has now been removed. You should use `NanCString()` or `NanRawString()` instead. - -Because `node::MakeCallback()` now takes an `Isolate`, and because it doesn't exist in older versions of Node, we've introduced `NanMakeCallback()`. You should *always* use this when calling a JavaScript function from C++. - -There's lots more, check out the Changelog in nan.h or look through [#86](https://github.com/rvagg/nan/pull/86) for all the gory details. - -### Dec-2013: NanCString and NanRawString - -Two new functions have been introduced to replace the functionality that's been provided by `NanFromV8String` until now. NanCString has sensible defaults so it's super easy to fetch a null-terminated c-style string out of a `v8::String`. `NanFromV8String` is still around and has defaults that allow you to pass a single handle to fetch a `char*` while `NanRawString` requires a little more attention to arguments. - -### Nov-2013: Node 0.11.9+ breaking V8 change - -The version of V8 that's shipping with Node 0.11.9+ has changed the signature for new `Local`s to: `v8::Local::New(isolate, value)`, i.e. introducing the `isolate` argument and therefore breaking all new `Local` declarations for previous versions. NAN 0.6+ now includes a `NanNewLocal(value)` that can be used in place to work around this incompatibility and maintain compatibility with 0.8->0.11.9+ (minus a few early 0.11 releases). - -For example, if you wanted to return a `null` on a callback you will have to change the argument from `v8::Local::New(v8::Null())` to `NanNewLocal(v8::Null())`. - -### Nov-2013: Change to binding.gyp `"include_dirs"` for NAN - -Inclusion of NAN in a project's binding.gyp is now greatly simplified. You can now just use `" -## Usage - -Simply add **NAN** as a dependency in the *package.json* of your Node addon: - -``` bash -$ npm install --save nan -``` - -Pull in the path to **NAN** in your *binding.gyp* so that you can use `#include ` in your *.cpp* files: - -``` python -"include_dirs" : [ - "` when compiling your addon. - - -## Example - -See **[LevelDOWN](https://github.com/rvagg/node-leveldown/pull/48)** for a full example of **NAN** in use. - -For a simpler example, see the **[async pi estimation example](https://github.com/rvagg/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**. - -Compare to the current 0.10 version of this example, found in the [node-addon-examples](https://github.com/rvagg/node-addon-examples/tree/master/9_async_work) repository and also a 0.11 version of the same found [here](https://github.com/kkoopa/node-addon-examples/tree/5c01f58fc993377a567812597e54a83af69686d7/9_async_work). - -Note that there is no embedded version sniffing going on here and also the async work is made much simpler, see below for details on the `NanAsyncWorker` class. - -```c++ -// addon.cc -#include -#include -// ... - -using v8::FunctionTemplate; -using v8::Handle; -using v8::Object; -using v8::String; - -void InitAll(Handle exports) { - exports->Set(NanNew("calculateSync"), - NanNew(CalculateSync)->GetFunction()); - - exports->Set(NanNew("calculateAsync"), - NanNew(CalculateAsync)->GetFunction()); -} - -NODE_MODULE(addon, InitAll) -``` - -```c++ -// sync.h -#include -#include - -NAN_METHOD(CalculateSync); -``` - -```c++ -// sync.cc -#include -#include -#include "./sync.h" -// ... - -using v8::Number; - -// Simple synchronous access to the `Estimate()` function -NAN_METHOD(CalculateSync) { - NanScope(); - - // expect a number as the first argument - int points = args[0]->Uint32Value(); - double est = Estimate(points); - - NanReturnValue(NanNew(est)); -} -``` - -```c++ -// async.h -#include -#include - -NAN_METHOD(CalculateAsync); -``` - -```c++ -// async.cc -#include -#include -#include "./async.h" - -// ... - -using v8::Function; -using v8::Local; -using v8::Null; -using v8::Number; -using v8::Value; - -class PiWorker : public NanAsyncWorker { - public: - PiWorker(NanCallback *callback, int points) - : NanAsyncWorker(callback), points(points) {} - ~PiWorker() {} - - // Executed inside the worker-thread. - // It is not safe to access V8, or V8 data structures - // here, so everything we need for input and output - // should go on `this`. - void Execute () { - estimate = Estimate(points); - } - - // Executed when the async work is complete - // this function will be run inside the main event loop - // so it is safe to use V8 again - void HandleOKCallback () { - NanScope(); - - Local argv[] = { - NanNull() - , NanNew(estimate) - }; - - callback->Call(2, argv); - }; - - private: - int points; - double estimate; -}; - -// Asynchronous access to the `Estimate()` function -NAN_METHOD(CalculateAsync) { - NanScope(); - - int points = args[0]->Uint32Value(); - NanCallback *callback = new NanCallback(args[1].As()); - - NanAsyncQueueWorker(new PiWorker(callback, points)); - NanReturnUndefined(); -} -``` - - -## API - - * NAN_METHOD - * NAN_GETTER - * NAN_SETTER - * NAN_PROPERTY_GETTER - * NAN_PROPERTY_SETTER - * NAN_PROPERTY_ENUMERATOR - * NAN_PROPERTY_DELETER - * NAN_PROPERTY_QUERY - * NAN_INDEX_GETTER - * NAN_INDEX_SETTER - * NAN_INDEX_ENUMERATOR - * NAN_INDEX_DELETER - * NAN_INDEX_QUERY - * NAN_WEAK_CALLBACK - * NAN_DEPRECATED - * NAN_INLINE - * NanNew - * NanUndefined - * NanNull - * NanTrue - * NanFalse - * NanReturnValue - * NanReturnUndefined - * NanReturnNull - * NanReturnEmptyString - * NanScope - * NanEscapableScope - * NanEscapeScope - * NanLocker - * NanUnlocker - * NanGetInternalFieldPointer - * NanSetInternalFieldPointer - * NanObjectWrapHandle - * NanSymbol - * NanGetPointerSafe - * NanSetPointerSafe - * NanRawString - * NanCString - * NanAsciiString - * NanUtf8String - * NanUcs2String - * NanBooleanOptionValue - * NanUInt32OptionValue - * NanError, NanTypeError, NanRangeError - * NanThrowError, NanThrowTypeError, NanThrowRangeError, NanThrowError(Handle), NanThrowError(Handle, int) - * NanNewBufferHandle(char *, size_t, FreeCallback, void *), NanNewBufferHandle(char *, uint32_t), NanNewBufferHandle(uint32_t) - * NanBufferUse(char *, uint32_t) - * NanNewContextHandle - * NanGetCurrentContext - * NanHasInstance - * NanDisposePersistent - * NanAssignPersistent - * NanMakeWeakPersistent - * NanSetTemplate - * NanSetPrototypeTemplate - * NanSetInstanceTemplate - * NanMakeCallback - * NanCompileScript - * NanRunScript - * NanAdjustExternalMemory - * NanAddGCEpilogueCallback - * NanAddGCPrologueCallback - * NanRemoveGCEpilogueCallback - * NanRemoveGCPrologueCallback - * NanGetHeapStatistics - * NanCallback - * NanAsyncWorker - * NanAsyncQueueWorker - - -### NAN_METHOD(methodname) - -Use `NAN_METHOD` to define your V8 accessible methods: - -```c++ -// .h: -class Foo : public node::ObjectWrap { - ... - - static NAN_METHOD(Bar); - static NAN_METHOD(Baz); -} - - -// .cc: -NAN_METHOD(Foo::Bar) { - ... -} - -NAN_METHOD(Foo::Baz) { - ... -} -``` - -The reason for this macro is because of the method signature change in 0.11: - -```c++ -// 0.10 and below: -Handle name(const Arguments& args) - -// 0.11 and above -void name(const FunctionCallbackInfo& args) -``` - -The introduction of `FunctionCallbackInfo` brings additional complications: - - -### NAN_GETTER(methodname) - -Use `NAN_GETTER` to declare your V8 accessible getters. You get a `Local` `property` and an appropriately typed `args` object that can act like the `args` argument to a `NAN_METHOD` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_GETTER`. - - -### NAN_SETTER(methodname) - -Use `NAN_SETTER` to declare your V8 accessible setters. Same as `NAN_GETTER` but you also get a `Local` `value` object to work with. - - -### NAN_PROPERTY_GETTER(cbname) -Use `NAN_PROPERTY_GETTER` to declare your V8 accessible property getters. You get a `Local` `property` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_GETTER`. - - -### NAN_PROPERTY_SETTER(cbname) -Use `NAN_PROPERTY_SETTER` to declare your V8 accessible property setters. Same as `NAN_PROPERTY_GETTER` but you also get a `Local` `value` object to work with. - - -### NAN_PROPERTY_ENUMERATOR(cbname) -Use `NAN_PROPERTY_ENUMERATOR` to declare your V8 accessible property enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_PROPERTY_GETTER` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_ENUMERATOR`. - - -### NAN_PROPERTY_DELETER(cbname) -Use `NAN_PROPERTY_DELETER` to declare your V8 accessible property deleters. Same as `NAN_PROPERTY_GETTER`. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_DELETER`. - - -### NAN_PROPERTY_QUERY(cbname) -Use `NAN_PROPERTY_QUERY` to declare your V8 accessible property queries. Same as `NAN_PROPERTY_GETTER`. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_QUERY`. - - -### NAN_INDEX_GETTER(cbname) -Use `NAN_INDEX_GETTER` to declare your V8 accessible index getters. You get a `uint32_t` `index` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_GETTER`. - - -### NAN_INDEX_SETTER(cbname) -Use `NAN_INDEX_SETTER` to declare your V8 accessible index setters. Same as `NAN_INDEX_GETTER` but you also get a `Local` `value` object to work with. - - -### NAN_INDEX_ENUMERATOR(cbname) -Use `NAN_INDEX_ENUMERATOR` to declare your V8 accessible index enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_INDEX_GETTER` call. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_ENUMERATOR`. - - -### NAN_INDEX_DELETER(cbname) -Use `NAN_INDEX_DELETER` to declare your V8 accessible index deleters. Same as `NAN_INDEX_GETTER`. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_DELETER`. - - -### NAN_INDEX_QUERY(cbname) -Use `NAN_INDEX_QUERY` to declare your V8 accessible index queries. Same as `NAN_INDEX_GETTER`. - -You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_QUERY`. - - -### NAN_WEAK_CALLBACK(cbname) - -Use `NAN_WEAK_CALLBACK` to define your V8 WeakReference callbacks. There is an argument object `const _NanWeakCallbackData &data` allowing access to the weak object and the supplied parameter through its `GetValue` and `GetParameter` methods. You can even access the weak callback info object through the `GetCallbackInfo()`method, but you probably should not. `Revive()` keeps the weak object alive until the next GC round. - -```c++ -NAN_WEAK_CALLBACK(weakCallback) { - int *parameter = data.GetParameter(); - NanMakeCallback(NanGetCurrentContext()->Global(), data.GetValue(), 0, NULL); - if ((*parameter)++ == 0) { - data.Revive(); - } else { - delete parameter; - } -} -``` - - -### NAN_DEPRECATED -Declares a function as deprecated. - -```c++ -static NAN_DEPRECATED NAN_METHOD(foo) { - ... -} -``` - - -### NAN_INLINE -Inlines a function. - -```c++ -NAN_INLINE int foo(int bar) { - ... -} -``` - - -### Local<T> NanNew<T>( ... ) - -Use `NanNew` to construct almost all v8 objects and make new local handles. - -Note: Using NanNew with an std::string is possible, however, you should ensure -to use the overload version (`NanNew(stdString)`) rather than the template -version (`NanNew(stdString)`) as there is an unnecessary -performance penalty to using the template version because of the inability for -compilers to appropriately deduce to reference types on template specialization. - -```c++ -Local s = NanNew("value"); - -... - -Persistent o; - -... - -Local lo = NanNew(o); - -``` - - -### Local<Primitive> NanUndefined() - -Use instead of `Undefined()` - - -### Local<Primitive> NanNull() - -Use instead of `Null()` - - -### Local<Boolean> NanTrue() - -Use instead of `True()` - - -### Local<Boolean> NanFalse() - -Use instead of `False()` - - -### NanReturnValue(Handle<Value>) - -Use `NanReturnValue` when you want to return a value from your V8 accessible method: - -```c++ -NAN_METHOD(Foo::Bar) { - ... - - NanReturnValue(NanNew("FooBar!")); -} -``` - -No `return` statement required. - - -### NanReturnUndefined() - -Use `NanReturnUndefined` when you don't want to return anything from your V8 accessible method: - -```c++ -NAN_METHOD(Foo::Baz) { - ... - - NanReturnUndefined(); -} -``` - - -### NanReturnNull() - -Use `NanReturnNull` when you want to return `Null` from your V8 accessible method: - -```c++ -NAN_METHOD(Foo::Baz) { - ... - - NanReturnNull(); -} -``` - - -### NanReturnEmptyString() - -Use `NanReturnEmptyString` when you want to return an empty `String` from your V8 accessible method: - -```c++ -NAN_METHOD(Foo::Baz) { - ... - - NanReturnEmptyString(); -} -``` - - -### NanScope() - -The introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanScope()` necessary, use it in place of `HandleScope scope` when you do not wish to return handles (`Handle` or `Local`) to the surrounding scope (or in functions directly exposed to V8, as they do not return values in the normal sense): - -```c++ -NAN_METHOD(Foo::Bar) { - NanScope(); - - NanReturnValue(NanNew("FooBar!")); -} -``` - -This method is not directly exposed to V8, nor does it return a handle, so it uses an unescapable scope: - -```c++ -bool Foo::Bar() { - NanScope(); - - Local val = NanFalse(); - ... - return val->Value(); -} -``` - - -### NanEscapableScope() - -The separation of handle scopes into escapable and inescapable scopes makes `NanEscapableScope()` necessary, use it in place of `HandleScope scope` when you later wish to return a handle (`Handle` or `Local`) from the scope, this is for internal functions not directly exposed to V8: - -```c++ -Handle Foo::Bar() { - NanEscapableScope(); - - return NanEscapeScope(NanNew("FooBar!")); -} -``` - - -### Local<T> NanEscapeScope(Handle<T> value); -Use together with `NanEscapableScope` to escape the scope. Corresponds to `HandleScope::Close` or `EscapableHandleScope::Escape`. - - -### NanLocker() - -The introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanLocker()` necessary, use it in place of `Locker locker`: - -```c++ -NAN_METHOD(Foo::Bar) { - NanLocker(); - ... - NanUnlocker(); -} -``` - - -### NanUnlocker() - -The introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanUnlocker()` necessary, use it in place of `Unlocker unlocker`: - -```c++ -NAN_METHOD(Foo::Bar) { - NanLocker(); - ... - NanUnlocker(); -} -``` - - -### void * NanGetInternalFieldPointer(Handle<Object>, int) - -Gets a pointer to the internal field with at `index` from a V8 `Object` handle. - -```c++ -Local obj; -... -NanGetInternalFieldPointer(obj, 0); -``` - -### void NanSetInternalFieldPointer(Handle<Object>, int, void *) - -Sets the value of the internal field at `index` on a V8 `Object` handle. - -```c++ -static Persistent dataWrapperCtor; -... -Local wrapper = NanNew(dataWrapperCtor)->NewInstance(); -NanSetInternalFieldPointer(wrapper, 0, this); -``` - - -### Local<Object> NanObjectWrapHandle(Object) - -When you want to fetch the V8 object handle from a native object you've wrapped with Node's `ObjectWrap`, you should use `NanObjectWrapHandle`: - -```c++ -NanObjectWrapHandle(iterator)->Get(NanNew("end")) -``` - - -### Local<String> NanSymbol(const char *) - -Deprecated. Use `NanNew` instead. -Use to create string symbol objects (i.e. `v8::String::NewSymbol(x)`), for getting and setting object properties, or names of objects. - -```c++ -bool foo = false; -if (obj->Has(NanNew("foo"))) - foo = optionsObj->Get(NanNew("foo"))->BooleanValue() -``` - - -### Type NanGetPointerSafe(Type *[, Type]) - -A helper for getting values from optional pointers. If the pointer is `NULL`, the function returns the optional default value, which defaults to `0`. Otherwise, the function returns the value the pointer points to. - -```c++ -char *plugh(uint32_t *optional) { - char res[] = "xyzzy"; - uint32_t param = NanGetPointerSafe(optional, 0x1337); - switch (param) { - ... - } - NanSetPointerSafe(optional, 0xDEADBEEF); -} -``` - - -### bool NanSetPointerSafe(Type *, Type) - -A helper for setting optional argument pointers. If the pointer is `NULL`, the function simply returns `false`. Otherwise, the value is assigned to the variable the pointer points to. - -```c++ -const char *plugh(size_t *outputsize) { - char res[] = "xyzzy"; - if !(NanSetPointerSafe(outputsize, strlen(res) + 1)) { - ... - } - - ... -} -``` - - -### void* NanRawString(Handle<Value>, enum Nan::Encoding, size_t *, void *, size_t, int) - -Deprecated. Use something else. - -When you want to convert a V8 `String` to a `char*` buffer, use `NanRawString`. You have to supply an encoding as well as a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows setting `String::WriteOptions`. -Just remember that you'll end up with an object that you'll need to `delete[]` at some point unless you supply your own buffer: - -```c++ -size_t count; -void* decoded = NanRawString(args[1], Nan::BASE64, &count, NULL, 0, String::HINT_MANY_WRITES_EXPECTED); -... -delete[] reinterpret_cast(decoded); -``` - - -### char* NanCString(Handle<Value>, size_t *[, char *, size_t, int]) - -Deprecated. Use `NanUtf8String` instead. - -When you want to convert a V8 `String` to a null-terminated C `char*` use `NanCString`. The resulting `char*` will be UTF-8-encoded, and you need to supply a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows optionally setting `String::WriteOptions`, which default to `v8::String::NO_OPTIONS`. -Just remember that you'll end up with an object that you'll need to `delete[]` at some point unless you supply your own buffer: - -```c++ -size_t count; -char* name = NanCString(args[0], &count); -... -delete[] name; -``` - - -### NanAsciiString - -Convert a `String` to zero-terminated, Ascii-encoded `char *`. - -```c++ -NAN_METHOD(foo) { - NanScope(); - NanReturnValue(NanNew(*NanAsciiString(arg[0]))); -} -``` - - -### NanUtf8String - -Convert a `String` to zero-terminated, Utf8-encoded `char *`. - -```c++ -NAN_METHOD(foo) { - NanScope(); - NanReturnValue(NanNew(*NanUtf8String(arg[0]))); -} -``` - - -### NanUcs2String - -Convert a `String` to zero-terminated, Ucs2-encoded `uint16_t *`. - -```c++ -NAN_METHOD(foo) { - NanScope(); - NanReturnValue(NanNew(*NanUcs2String(arg[0]))); -} -``` - - -### bool NanBooleanOptionValue(Handle<Value>, Handle<String>[, bool]) - -When you have an "options" object that you need to fetch properties from, boolean options can be fetched with this pair. They check first if the object exists (`IsEmpty`), then if the object has the given property (`Has`) then they get and convert/coerce the property to a `bool`. - -The optional last parameter is the *default* value, which is `false` if left off: - -```c++ -// `foo` is false unless the user supplies a truthy value for it -bool foo = NanBooleanOptionValue(optionsObj, NanNew("foo")); -// `bar` is true unless the user supplies a falsy value for it -bool bar = NanBooleanOptionValueDefTrue(optionsObj, NanNew("bar"), true); -``` - - -### uint32_t NanUInt32OptionValue(Handle<Value>, Handle<String>, uint32_t) - -Similar to `NanBooleanOptionValue`, use `NanUInt32OptionValue` to fetch an integer option from your options object. Can be any kind of JavaScript `Number` and it will be coerced to an unsigned 32-bit integer. - -Requires all 3 arguments as a default is not optional: - -```c++ -uint32_t count = NanUInt32OptionValue(optionsObj, NanNew("count"), 1024); -``` - - -### NanError(message), NanTypeError(message), NanRangeError(message) - -For making `Error`, `TypeError` and `RangeError` objects. - -```c++ -Local res = NanError("you must supply a callback argument"); -``` - - -### NanThrowError(message), NanThrowTypeError(message), NanThrowRangeError(message), NanThrowError(Local<Value>), NanThrowError(Local<Value>, int) - -For throwing `Error`, `TypeError` and `RangeError` objects. - -```c++ -NanThrowError("you must supply a callback argument"); -``` - -Can also handle any custom object you may want to throw. If used with the error code argument, it will add the supplied error code to the error object as a property called `code`. - - -### Local<Object> NanNewBufferHandle(char *, uint32_t), Local<Object> NanNewBufferHandle(uint32_t) - -The `Buffer` API has changed a little in Node 0.11, this helper provides consistent access to `Buffer` creation: - -```c++ -NanNewBufferHandle((char*)value.data(), value.size()); -``` - -Can also be used to initialize a `Buffer` with just a `size` argument. - -Can also be supplied with a `NanFreeCallback` and a hint for the garbage collector. - - -### Local<Object> NanBufferUse(char*, uint32_t) - -`Buffer::New(char*, uint32_t)` prior to 0.11 would make a copy of the data. -While it was possible to get around this, it required a shim by passing a -callback. So the new API `Buffer::Use(char*, uint32_t)` was introduced to remove -needing to use this shim. - -`NanBufferUse` uses the `char*` passed as the backing data, and will free the -memory automatically when the weak callback is called. Keep this in mind, as -careless use can lead to "double free or corruption" and other cryptic failures. - - -### bool NanHasInstance(Persistent<FunctionTemplate>&, Handle<Value>) - -Can be used to check the type of an object to determine it is of a particular class you have already defined and have a `Persistent` handle for. - - -### Local<Context> NanNewContextHandle([ExtensionConfiguration*, Handle<ObjectTemplate>, Handle<Value>]) -Creates a new `Local` handle. - -```c++ -Local ftmpl = NanNew(); -Local otmpl = ftmpl->InstanceTemplate(); -Local ctx = NanNewContextHandle(NULL, otmpl); -``` - - -### Local<Context> NanGetCurrentContext() - -Gets the current context. - -```c++ -Local ctx = NanGetCurrentContext(); -``` - - -### void NanDisposePersistent(Persistent<T> &) - -Use `NanDisposePersistent` to dispose a `Persistent` handle. - -```c++ -NanDisposePersistent(persistentHandle); -``` - - -### NanAssignPersistent(handle, object) - -Use `NanAssignPersistent` to assign a non-`Persistent` handle to a `Persistent` one. You can no longer just declare a `Persistent` handle and assign directly to it later, you have to `Reset` it in Node 0.11, so this makes it easier. - -In general it is now better to place anything you want to protect from V8's garbage collector as properties of a generic `Object` and then assign that to a `Persistent`. This works in older versions of Node also if you use `NanAssignPersistent`: - -```c++ -Persistent persistentHandle; - -... - -Local obj = NanNew(); -obj->Set(NanNew("key"), keyHandle); // where keyHandle might be a Local -NanAssignPersistent(persistentHandle, obj) -``` - - -### _NanWeakCallbackInfo<T, P>* NanMakeWeakPersistent(Handle<T>, P*, _NanWeakCallbackInfo<T, P>::Callback) - -Creates a weak persistent handle with the supplied parameter and `NAN_WEAK_CALLBACK`. - -```c++ -NAN_WEAK_CALLBACK(weakCallback) { - -... - -} - -Local func; - -... - -int *parameter = new int(0); -NanMakeWeakPersistent(func, parameter, &weakCallback); -``` - - -### NanSetTemplate(templ, name, value [, attributes]) - -Use to add properties on object and function templates. - - -### NanSetPrototypeTemplate(templ, name, value [, attributes]) - -Use to add prototype properties on function templates. - - -### NanSetInstanceTemplate(templ, name, value [, attributes]) - -Use to add instance properties on function templates. - - -### NanMakeCallback(target, func, argc, argv) - -Use instead of `node::MakeCallback` to call javascript functions. This is the only proper way of calling functions. - - -### NanCompileScript(Handle s [, const ScriptOrigin& origin]) - -Use to create new scripts bound to the current context. - - -### NanRunScript(script) - -Use to run both bound and unbound scripts. - - -### NanAdjustExternalMemory(int change_in_bytes) - -Simply does `AdjustAmountOfExternalAllocatedMemory`, note that the argument and returned value have type `int`. - - -### NanAddGCEpilogueCallback(GCEpilogueCallback callback, GCType gc_type_filter=kGCTypeAll) - -Simply does `AddGCEpilogueCallback` - - -### NanAddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type_filter=kGCTypeAll) - -Simply does `AddGCPrologueCallback` - - -### NanRemoveGCEpilogueCallback(GCEpilogueCallback callback) - -Simply does `RemoveGCEpilogueCallback` - - -### NanRemoveGCPrologueCallback(GCPrologueCallback callback) - -Simply does `RemoveGCPrologueCallback` - - -### NanGetHeapStatistics(HeapStatistics *heap_statistics) - -Simply does `GetHeapStatistics` - - -### NanCallback - -Because of the difficulties imposed by the changes to `Persistent` handles in V8 in Node 0.11, creating `Persistent` versions of your `Handle` is annoyingly tricky. `NanCallback` makes it easier by taking your handle, making it persistent until the `NanCallback` is deleted and even providing a handy `Call()` method to fetch and execute the callback `Function`. - -```c++ -Local callbackHandle = args[0].As(); -NanCallback *callback = new NanCallback(callbackHandle); -// pass `callback` around and it's safe from GC until you: -delete callback; -``` - -You can execute the callback like so: - -```c++ -// no arguments: -callback->Call(0, NULL); - -// an error argument: -Handle argv[] = { - NanError(NanNew("fail!")) -}; -callback->Call(1, argv); - -// a success argument: -Handle argv[] = { - NanNull(), - NanNew("w00t!") -}; -callback->Call(2, argv); -``` - -`NanCallback` also has a `Local GetCallback()` method that you can use -to fetch a local handle to the underlying callback function, as well as a -`void SetFunction(Handle)` for setting the callback on the -`NanCallback`. You can check if a `NanCallback` is empty with the `bool IsEmpty()` method. Additionally a generic constructor is available for using -`NanCallback` without performing heap allocations. - - -### NanAsyncWorker - -`NanAsyncWorker` is an abstract class that you can subclass to have much of the annoying async queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the async work is in progress. - -See a rough outline of the implementation: - -```c++ -class NanAsyncWorker { -public: - NanAsyncWorker (NanCallback *callback); - - // Clean up persistent handles and delete the *callback - virtual ~NanAsyncWorker (); - - // Check the `ErrorMessage()` and call HandleOKCallback() - // or HandleErrorCallback depending on whether it has been set or not - virtual void WorkComplete (); - - // You must implement this to do some async work. If there is an - // error then use `SetErrorMessage()` to set an error message and the callback will - // be passed that string in an Error object - virtual void Execute (); - - // Save a V8 object in a Persistent handle to protect it from GC - void SaveToPersistent(const char *key, Local &obj); - - // Fetch a stored V8 object (don't call from within `Execute()`) - Local GetFromPersistent(const char *key); - - // Get the error message (or NULL) - const char *ErrorMessage(); - - // Set an error message - void SetErrorMessage(const char *msg); - -protected: - // Default implementation calls the callback function with no arguments. - // Override this to return meaningful data - virtual void HandleOKCallback (); - - // Default implementation calls the callback function with an Error object - // wrapping the `errmsg` string - virtual void HandleErrorCallback (); -}; -``` - - -### NanAsyncQueueWorker(NanAsyncWorker *) - -`NanAsyncQueueWorker` will run a `NanAsyncWorker` asynchronously via libuv. Both the *execute* and *after_work* steps are taken care of for you—most of the logic for this is embedded in `NanAsyncWorker`. - -### Contributors - -NAN is only possible due to the excellent work of the following contributors: - - - - - - - - -
        Rod VaggGitHub/rvaggTwitter/@rvagg
        Benjamin ByholmGitHub/kkoopa-
        Trevor NorrisGitHub/trevnorrisTwitter/@trevnorris
        Nathan RajlichGitHub/TooTallNateTwitter/@TooTallNate
        Brett LawsonGitHub/brett19Twitter/@brett19x
        Ben NoordhuisGitHub/bnoordhuisTwitter/@bnoordhuis
        - -Licence & copyright ------------------------ - -Copyright (c) 2014 NAN contributors (listed above). - -Native Abstractions for Node.js is licensed under an MIT +no-false-attribs license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/node_modules/pg/node_modules/nan/appveyor.yml b/node_modules/pg/node_modules/nan/appveyor.yml deleted file mode 100644 index 657eed6..0000000 --- a/node_modules/pg/node_modules/nan/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -# http://www.appveyor.com/docs/appveyor-yml - -# Test against these versions of Node.js. -environment: - matrix: - - nodejs_version: "0.8" - - nodejs_version: "0.10" - - nodejs_version: "0.11" - -# Install scripts. (runs after repo cloning) -install: - # Get the latest stable version of Node 0.STABLE.latest - - npm install npm - - move node_modules npm - - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) - # Typical npm stuff. - - npm/.bin/npm install - - npm/.bin/npm run rebuild-tests - -# Post-install test scripts. -test_script: - # Output useful info for debugging. - - node --version - - npm --version - - cmd: npm test - -# Don't actually build. -build: off - -# Set build version format here instead of in the admin panel. -version: "{build}" - diff --git a/node_modules/pg/node_modules/nan/include_dirs.js b/node_modules/pg/node_modules/nan/include_dirs.js deleted file mode 100644 index 4f1dfb4..0000000 --- a/node_modules/pg/node_modules/nan/include_dirs.js +++ /dev/null @@ -1 +0,0 @@ -console.log(require('path').relative('.', __dirname)); diff --git a/node_modules/pg/node_modules/nan/nan.h b/node_modules/pg/node_modules/nan/nan.h deleted file mode 100644 index 063de4e..0000000 --- a/node_modules/pg/node_modules/nan/nan.h +++ /dev/null @@ -1,2331 +0,0 @@ -/********************************************************************************** - * NAN - Native Abstractions for Node.js - * - * Copyright (c) 2014 NAN contributors: - * - Rod Vagg - * - Benjamin Byholm - * - Trevor Norris - * - Nathan Rajlich - * - Brett Lawson - * - Ben Noordhuis - * - * MIT +no-false-attribs License - * - * Version 1.3.0: current Node unstable: 0.11.13, Node stable: 0.10.30 - * - * See https://github.com/rvagg/nan for the latest update to this file - **********************************************************************************/ - -#ifndef NAN_H_ -#define NAN_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(__GNUC__) && !defined(DEBUG) -# define NAN_INLINE inline __attribute__((always_inline)) -#elif defined(_MSC_VER) && !defined(DEBUG) -# define NAN_INLINE __forceinline -#else -# define NAN_INLINE inline -#endif - -#if defined(__GNUC__) && !V8_DISABLE_DEPRECATIONS -# define NAN_DEPRECATED __attribute__((deprecated)) -#elif defined(_MSC_VER) && !V8_DISABLE_DEPRECATIONS -# define NAN_DEPRECATED __declspec(deprecated) -#else -# define NAN_DEPRECATED -#endif - -// some generic helpers - -template NAN_INLINE bool NanSetPointerSafe( - T *var - , T val -) { - if (var) { - *var = val; - return true; - } else { - return false; - } -} - -template NAN_INLINE T NanGetPointerSafe( - T *var - , T fallback = reinterpret_cast(0) -) { - if (var) { - return *var; - } else { - return fallback; - } -} - -NAN_INLINE bool NanBooleanOptionValue( - v8::Local optionsObj - , v8::Handle opt, bool def -) { - if (def) { - return optionsObj.IsEmpty() - || !optionsObj->Has(opt) - || optionsObj->Get(opt)->BooleanValue(); - } else { - return !optionsObj.IsEmpty() - && optionsObj->Has(opt) - && optionsObj->Get(opt)->BooleanValue(); - } -} - -NAN_INLINE bool NanBooleanOptionValue( - v8::Local optionsObj - , v8::Handle opt -) { - return NanBooleanOptionValue(optionsObj, opt, false); -} - -NAN_INLINE uint32_t NanUInt32OptionValue( - v8::Local optionsObj - , v8::Handle opt - , uint32_t def -) { - return !optionsObj.IsEmpty() - && optionsObj->Has(opt) - && optionsObj->Get(opt)->IsNumber() - ? optionsObj->Get(opt)->Uint32Value() - : def; -} - -#if (NODE_MODULE_VERSION > 0x000B) -// Node 0.11+ (0.11.3 and below won't compile with these) - -# define _NAN_METHOD_ARGS_TYPE const v8::FunctionCallbackInfo& -# define _NAN_METHOD_ARGS _NAN_METHOD_ARGS_TYPE args -# define _NAN_METHOD_RETURN_TYPE void - -# define _NAN_GETTER_ARGS_TYPE const v8::PropertyCallbackInfo& -# define _NAN_GETTER_ARGS _NAN_GETTER_ARGS_TYPE args -# define _NAN_GETTER_RETURN_TYPE void - -# define _NAN_SETTER_ARGS_TYPE const v8::PropertyCallbackInfo& -# define _NAN_SETTER_ARGS _NAN_SETTER_ARGS_TYPE args -# define _NAN_SETTER_RETURN_TYPE void - -# define _NAN_PROPERTY_GETTER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_GETTER_ARGS _NAN_PROPERTY_GETTER_ARGS_TYPE args -# define _NAN_PROPERTY_GETTER_RETURN_TYPE void - -# define _NAN_PROPERTY_SETTER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_SETTER_ARGS _NAN_PROPERTY_SETTER_ARGS_TYPE args -# define _NAN_PROPERTY_SETTER_RETURN_TYPE void - -# define _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_ENUMERATOR_ARGS _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE args -# define _NAN_PROPERTY_ENUMERATOR_RETURN_TYPE void - -# define _NAN_PROPERTY_DELETER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_DELETER_ARGS \ - _NAN_PROPERTY_DELETER_ARGS_TYPE args -# define _NAN_PROPERTY_DELETER_RETURN_TYPE void - -# define _NAN_PROPERTY_QUERY_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_PROPERTY_QUERY_ARGS _NAN_PROPERTY_QUERY_ARGS_TYPE args -# define _NAN_PROPERTY_QUERY_RETURN_TYPE void - -# define _NAN_INDEX_GETTER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_GETTER_ARGS _NAN_INDEX_GETTER_ARGS_TYPE args -# define _NAN_INDEX_GETTER_RETURN_TYPE void - -# define _NAN_INDEX_SETTER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_SETTER_ARGS _NAN_INDEX_SETTER_ARGS_TYPE args -# define _NAN_INDEX_SETTER_RETURN_TYPE void - -# define _NAN_INDEX_ENUMERATOR_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_ENUMERATOR_ARGS _NAN_INDEX_ENUMERATOR_ARGS_TYPE args -# define _NAN_INDEX_ENUMERATOR_RETURN_TYPE void - -# define _NAN_INDEX_DELETER_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_DELETER_ARGS _NAN_INDEX_DELETER_ARGS_TYPE args -# define _NAN_INDEX_DELETER_RETURN_TYPE void - -# define _NAN_INDEX_QUERY_ARGS_TYPE \ - const v8::PropertyCallbackInfo& -# define _NAN_INDEX_QUERY_ARGS _NAN_INDEX_QUERY_ARGS_TYPE args -# define _NAN_INDEX_QUERY_RETURN_TYPE void - - typedef v8::FunctionCallback NanFunctionCallback; - - template - NAN_INLINE v8::Local NanNew() { - return T::New(v8::Isolate::GetCurrent()); - } - - template - NAN_INLINE v8::Local NanNew(P arg1) { - return T::New(v8::Isolate::GetCurrent(), arg1); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle receiver - , int argc - , v8::Handle argv[] = 0) { - return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv); - } - - template - NAN_INLINE v8::Local NanNew( - NanFunctionCallback callback - , v8::Handle data = v8::Handle() - , v8::Handle signature = v8::Handle()) { - return T::New(v8::Isolate::GetCurrent(), callback, data, signature); - } - - template - NAN_INLINE v8::Local NanNew(v8::Handle arg1) { - return v8::Local::New(v8::Isolate::GetCurrent(), arg1); - } - - template - NAN_INLINE v8::Local NanNew(const v8::Persistent &arg1) { - return v8::Local::New(v8::Isolate::GetCurrent(), arg1); - } - - template - NAN_INLINE v8::Local NanNew(P arg1, int arg2) { - return T::New(v8::Isolate::GetCurrent(), arg1, arg2); - } - - template<> - NAN_INLINE v8::Local NanNew() { - return v8::Array::New(v8::Isolate::GetCurrent()); - } - - template<> - NAN_INLINE v8::Local NanNew(int length) { - return v8::Array::New(v8::Isolate::GetCurrent(), length); - } - - template<> - NAN_INLINE v8::Local NanNew(double time) { - return v8::Date::New(v8::Isolate::GetCurrent(), time).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(int time) { - return v8::Date::New(v8::Isolate::GetCurrent(), time).As(); - } - - typedef v8::UnboundScript NanUnboundScript; - typedef v8::Script NanBoundScript; - - template - NAN_INLINE v8::Local NanNew( - P s - , const v8::ScriptOrigin& origin - ) { - v8::ScriptCompiler::Source source(s, origin); - return v8::ScriptCompiler::CompileUnbound( - v8::Isolate::GetCurrent(), &source); - } - - template<> - NAN_INLINE v8::Local NanNew( - v8::Local s - ) { - v8::ScriptCompiler::Source source(s); - return v8::ScriptCompiler::CompileUnbound( - v8::Isolate::GetCurrent(), &source); - } - - template<> - NAN_INLINE v8::Local NanNew(bool value) { - return v8::BooleanObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local - NanNew >( - v8::Local value) { - return v8::StringObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local - NanNew >( - v8::Handle value) { - return v8::StringObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(double val) { - return v8::NumberObject::New( - v8::Isolate::GetCurrent(), val).As(); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Local pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Local pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template<> - NAN_INLINE v8::Local NanNew(int32_t val) { - return v8::Uint32::NewFromUnsigned( - v8::Isolate::GetCurrent(), val)->ToUint32(); - } - - template<> - NAN_INLINE v8::Local NanNew(uint32_t val) { - return v8::Uint32::NewFromUnsigned( - v8::Isolate::GetCurrent(), val)->ToUint32(); - } - - template<> - NAN_INLINE v8::Local NanNew(int32_t val) { - return v8::Int32::New(v8::Isolate::GetCurrent(), val)->ToInt32(); - } - - template<> - NAN_INLINE v8::Local NanNew(uint32_t val) { - return v8::Int32::New(v8::Isolate::GetCurrent(), val)->ToInt32(); - } - - template<> - NAN_INLINE v8::Local NanNew( - char *arg - , int length) { - return v8::String::NewFromUtf8( - v8::Isolate::GetCurrent() - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew( - const char *arg - , int length) { - return v8::String::NewFromUtf8( - v8::Isolate::GetCurrent() - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew(char *arg) { - return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - const char *arg) { - return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - uint8_t *arg - , int length) { - return v8::String::NewFromOneByte( - v8::Isolate::GetCurrent() - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint8_t *arg - , int length) { - return v8::String::NewFromOneByte( - v8::Isolate::GetCurrent() - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew(uint8_t *arg) { - return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint8_t *arg) { - return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - uint16_t *arg - , int length) { - return v8::String::NewFromTwoByte( - v8::Isolate::GetCurrent() - , arg - , v8::String::kNormalString - , length); - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint16_t *arg - , int length) { - return v8::String::NewFromTwoByte( - v8::Isolate::GetCurrent() - , arg - , v8::String::kNormalString - , length); - } - template<> - NAN_INLINE v8::Local NanNew( - uint16_t *arg) { - return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint16_t *arg) { - return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), arg); - } - - template<> - NAN_INLINE v8::Local NanNew( - std::string arg) { - return NanNew(arg.c_str(), arg.size()); - } - - template<> - NAN_INLINE v8::Local NanNew() { - return v8::String::Empty(v8::Isolate::GetCurrent()); - } - - NAN_INLINE v8::Local NanNew(const char* arg, int length = -1) { - return NanNew(arg, length); - } - - NAN_INLINE v8::Local NanNew( - const uint8_t* arg - , int length = -1) { - return NanNew(arg, length); - } - - NAN_INLINE v8::Local NanNew( - const uint16_t* arg - , int length = -1) { - return NanNew(arg, length); - } - - NAN_INLINE v8::Local NanNew( - const std::string& arg) { - return NanNew(arg.c_str(), arg.size()); - } - - NAN_INLINE v8::Local NanNew(double val) { - return NanNew(val); - } - - NAN_INLINE v8::Local NanNew(int val) { - return NanNew(val); - } - - NAN_INLINE v8::Local NanNew(unsigned int val) { - return NanNew(val); - } - - NAN_INLINE v8::Local NanNew(bool val) { - return NanNew(val); - } - - NAN_INLINE v8::Local NanNew( - v8::String::ExternalStringResource *resource) { - return v8::String::NewExternal(v8::Isolate::GetCurrent(), resource); - } - - NAN_INLINE v8::Local NanNew( - v8::String::ExternalAsciiStringResource *resource) { - return v8::String::NewExternal(v8::Isolate::GetCurrent(), resource); - } - -# define NanScope() v8::HandleScope scope(v8::Isolate::GetCurrent()) -# define NanEscapableScope() \ - v8::EscapableHandleScope scope(v8::Isolate::GetCurrent()) - - template - NAN_INLINE v8::Local _NanEscapeScopeHelper(v8::Handle val) { - return NanNew(val); - } - - template - NAN_INLINE v8::Local _NanEscapeScopeHelper(v8::Local val) { - return val; - } - -# define NanEscapeScope(val) scope.Escape(_NanEscapeScopeHelper(val)) -# define NanLocker() v8::Locker locker(v8::Isolate::GetCurrent()) -# define NanUnlocker() v8::Unlocker unlocker(v8::Isolate::GetCurrent()) -# define NanReturnValue(value) return args.GetReturnValue().Set(value) -# define NanReturnUndefined() return -# define NanReturnNull() return args.GetReturnValue().SetNull() -# define NanReturnEmptyString() return args.GetReturnValue().SetEmptyString() - -# define NanObjectWrapHandle(obj) obj->handle() - - NAN_INLINE v8::Local NanUndefined() { - NanEscapableScope(); - return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent()))); - } - - NAN_INLINE v8::Local NanNull() { - NanEscapableScope(); - return NanEscapeScope(NanNew(v8::Null(v8::Isolate::GetCurrent()))); - } - - NAN_INLINE v8::Local NanTrue() { - NanEscapableScope(); - return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent()))); - } - - NAN_INLINE v8::Local NanFalse() { - NanEscapableScope(); - return NanEscapeScope(NanNew(v8::False(v8::Isolate::GetCurrent()))); - } - - NAN_INLINE int NanAdjustExternalMemory(int bc) { - return static_cast( - v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(bc)); - } - - NAN_INLINE void NanSetTemplate( - v8::Handle templ - , const char *name - , v8::Handle value) { - templ->Set(v8::Isolate::GetCurrent(), name, value); - } - - NAN_INLINE void NanSetTemplate( - v8::Handle templ - , v8::Handle name - , v8::Handle value - , v8::PropertyAttribute attributes) { - templ->Set(name, value, attributes); - } - - NAN_INLINE v8::Local NanGetCurrentContext() { - return v8::Isolate::GetCurrent()->GetCurrentContext(); - } - - NAN_INLINE void* NanGetInternalFieldPointer( - v8::Handle object - , int index) { - return object->GetAlignedPointerFromInternalField(index); - } - - NAN_INLINE void NanSetInternalFieldPointer( - v8::Handle object - , int index - , void* value) { - object->SetAlignedPointerInInternalField(index, value); - } - - NAN_INLINE void NanAddGCEpilogueCallback( - v8::Isolate::GCEpilogueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - v8::Isolate::GetCurrent()->AddGCEpilogueCallback(callback, gc_type_filter); - } - - NAN_INLINE void NanRemoveGCEpilogueCallback( - v8::Isolate::GCEpilogueCallback callback) { - v8::Isolate::GetCurrent()->RemoveGCEpilogueCallback(callback); - } - - NAN_INLINE void NanAddGCPrologueCallback( - v8::Isolate::GCPrologueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - v8::Isolate::GetCurrent()->AddGCPrologueCallback(callback, gc_type_filter); - } - - NAN_INLINE void NanRemoveGCPrologueCallback( - v8::Isolate::GCPrologueCallback callback) { - v8::Isolate::GetCurrent()->RemoveGCPrologueCallback(callback); - } - - NAN_INLINE void NanGetHeapStatistics( - v8::HeapStatistics *heap_statistics) { - v8::Isolate::GetCurrent()->GetHeapStatistics(heap_statistics); - } - - NAN_DEPRECATED NAN_INLINE v8::Local NanSymbol( - const char* data, int length = -1) { - return NanNew(data, length); - } - - template - NAN_INLINE void NanAssignPersistent( - v8::Persistent& handle - , v8::Handle obj) { - handle.Reset(v8::Isolate::GetCurrent(), obj); - } - - template - NAN_INLINE void NanAssignPersistent( - v8::Persistent& handle - , const v8::Persistent& obj) { - handle.Reset(v8::Isolate::GetCurrent(), obj); - } - - template - class _NanWeakCallbackData; - - template - struct _NanWeakCallbackInfo { - typedef void (*Callback)(const _NanWeakCallbackData& data); - NAN_INLINE _NanWeakCallbackInfo(v8::Handle handle, P* param, Callback cb) - : parameter(param), callback(cb) { - NanAssignPersistent(persistent, handle); - } - - NAN_INLINE ~_NanWeakCallbackInfo() { - persistent.Reset(); - } - - P* const parameter; - Callback const callback; - v8::Persistent persistent; - }; - - template - class _NanWeakCallbackData { - public: - NAN_INLINE _NanWeakCallbackData(_NanWeakCallbackInfo *info) - : info_(info) { } - - NAN_INLINE v8::Local GetValue() const { - return NanNew(info_->persistent); - } - - NAN_INLINE P* GetParameter() const { return info_->parameter; } - - NAN_INLINE bool IsNearDeath() const { - return info_->persistent.IsNearDeath(); - } - - NAN_INLINE void Revive() const; - - NAN_INLINE _NanWeakCallbackInfo* GetCallbackInfo() const { - return info_; - } - - NAN_DEPRECATED NAN_INLINE void Dispose() const { - } - - private: - _NanWeakCallbackInfo* info_; - }; - - template - static void _NanWeakCallbackDispatcher( - const v8::WeakCallbackData > &data) { - _NanWeakCallbackInfo *info = data.GetParameter(); - _NanWeakCallbackData wcbd(info); - info->callback(wcbd); - if (wcbd.IsNearDeath()) { - delete wcbd.GetCallbackInfo(); - } - } - - template - NAN_INLINE void _NanWeakCallbackData::Revive() const { - info_->persistent.SetWeak(info_, &_NanWeakCallbackDispatcher); - } - -template -NAN_INLINE _NanWeakCallbackInfo* NanMakeWeakPersistent( - v8::Handle handle - , P* parameter - , typename _NanWeakCallbackInfo::Callback callback) { - _NanWeakCallbackInfo *cbinfo = - new _NanWeakCallbackInfo(handle, parameter, callback); - cbinfo->persistent.SetWeak(cbinfo, &_NanWeakCallbackDispatcher); - return cbinfo; -} - -# define NAN_WEAK_CALLBACK(name) \ - template \ - static void name(const _NanWeakCallbackData &data) - -# define _NAN_ERROR(fun, errmsg) fun(NanNew(errmsg)) - -# define _NAN_THROW_ERROR(fun, errmsg) \ - do { \ - NanScope(); \ - v8::Isolate::GetCurrent()->ThrowException(_NAN_ERROR(fun, errmsg)); \ - } while (0); - - NAN_INLINE v8::Local NanError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::Error, errmsg); - } - - NAN_INLINE void NanThrowError(const char* errmsg) { - _NAN_THROW_ERROR(v8::Exception::Error, errmsg); - } - - NAN_INLINE void NanThrowError(v8::Handle error) { - NanScope(); - v8::Isolate::GetCurrent()->ThrowException(error); - } - - NAN_INLINE v8::Local NanError( - const char *msg - , const int errorNumber - ) { - v8::Local err = v8::Exception::Error(NanNew(msg)); - v8::Local obj = err.As(); - obj->Set(NanNew("code"), NanNew(errorNumber)); - return err; - } - - NAN_INLINE void NanThrowError( - const char *msg - , const int errorNumber - ) { - NanThrowError(NanError(msg, errorNumber)); - } - - NAN_INLINE v8::Local NanTypeError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::TypeError, errmsg); - } - - NAN_INLINE void NanThrowTypeError(const char* errmsg) { - _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg); - } - - NAN_INLINE v8::Local NanRangeError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::RangeError, errmsg); - } - - NAN_INLINE void NanThrowRangeError(const char* errmsg) { - _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg); - } - - template NAN_INLINE void NanDisposePersistent( - v8::Persistent &handle - ) { - handle.Reset(); - } - - NAN_INLINE v8::Local NanNewBufferHandle ( - char *data - , size_t length - , node::smalloc::FreeCallback callback - , void *hint - ) { - return node::Buffer::New( - v8::Isolate::GetCurrent(), data, length, callback, hint); - } - - NAN_INLINE v8::Local NanNewBufferHandle ( - const char *data - , uint32_t size - ) { - return node::Buffer::New(v8::Isolate::GetCurrent(), data, size); - } - - NAN_INLINE v8::Local NanNewBufferHandle (uint32_t size) { - return node::Buffer::New(v8::Isolate::GetCurrent(), size); - } - - NAN_INLINE v8::Local NanBufferUse( - char* data - , uint32_t size - ) { - return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size); - } - - NAN_INLINE bool NanHasInstance( - v8::Persistent& function_template - , v8::Handle value - ) { - return NanNew(function_template)->HasInstance(value); - } - - NAN_INLINE v8::Local NanNewContextHandle( - v8::ExtensionConfiguration* extensions = NULL - , v8::Handle tmpl = v8::Handle() - , v8::Handle obj = v8::Handle() - ) { - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - return v8::Local::New( - isolate - , v8::Context::New(isolate, extensions, tmpl, obj) - ); - } - - NAN_INLINE v8::Local NanCompileScript( - v8::Local s - , const v8::ScriptOrigin& origin - ) { - v8::ScriptCompiler::Source source(s, origin); - return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source); - } - - NAN_INLINE v8::Local NanCompileScript( - v8::Local s - ) { - v8::ScriptCompiler::Source source(s); - return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source); - } - - NAN_INLINE v8::Local NanRunScript( - v8::Handle script - ) { - return script->BindToCurrentContext()->Run(); - } - - NAN_INLINE v8::Local NanRunScript( - v8::Handle script - ) { - return script->Run(); - } - - NAN_INLINE v8::Local NanMakeCallback( - v8::Handle target - , v8::Handle func - , int argc - , v8::Handle* argv) { - return NanNew(node::MakeCallback( - v8::Isolate::GetCurrent(), target, func, argc, argv)); - } - - NAN_INLINE v8::Local NanMakeCallback( - v8::Handle target - , v8::Handle symbol - , int argc - , v8::Handle* argv) { - return NanNew(node::MakeCallback( - v8::Isolate::GetCurrent(), target, symbol, argc, argv)); - } - - NAN_INLINE v8::Local NanMakeCallback( - v8::Handle target - , const char* method - , int argc - , v8::Handle* argv) { - return NanNew(node::MakeCallback( - v8::Isolate::GetCurrent(), target, method, argc, argv)); - } - - template - NAN_INLINE void NanSetIsolateData( - v8::Isolate *isolate - , T *data - ) { - isolate->SetData(0, data); - } - - template - NAN_INLINE T *NanGetIsolateData( - v8::Isolate *isolate - ) { - return static_cast(isolate->GetData(0)); - } - - class NanAsciiString { - public: - NAN_INLINE explicit NanAsciiString(v8::Handle from) { - v8::Local toStr = from->ToString(); - int buf_size = toStr->Length() + 1; - buf = new char[buf_size]; - size = toStr->WriteOneByte( - reinterpret_cast(buf), 0, buf_size); - } - - NAN_INLINE int Size() const { - return size; - } - - NAN_INLINE char* operator*() { return buf; } - - NAN_INLINE ~NanAsciiString() { - delete[] buf; - } - - private: - char *buf; - int size; - }; - - class NanUtf8String { - public: - NAN_INLINE explicit NanUtf8String(v8::Handle from) { - v8::Local toStr = from->ToString(); - int buf_size = toStr->Utf8Length() + 1; - buf = new char[buf_size]; - size = toStr->WriteUtf8(buf, buf_size); - } - - NAN_INLINE int Size() const { - return size; - } - - NAN_INLINE char* operator*() { return buf; } - - NAN_INLINE ~NanUtf8String() { - delete[] buf; - } - - private: - char *buf; - int size; - }; - - class NanUcs2String { - public: - NAN_INLINE explicit NanUcs2String(v8::Handle from) { - v8::Local toStr = from->ToString(); - int buf_size = toStr->Length() + 1; - buf = new uint16_t[buf_size]; - size = toStr->Write(buf, 0, buf_size); - } - - NAN_INLINE int Size() const { - return size; - } - - NAN_INLINE uint16_t* operator*() { return buf; } - - NAN_INLINE ~NanUcs2String() { - delete[] buf; - } - - private: - uint16_t *buf; - int size; - }; - -#else -// Node 0.8 and 0.10 - -# define _NAN_METHOD_ARGS_TYPE const v8::Arguments& -# define _NAN_METHOD_ARGS _NAN_METHOD_ARGS_TYPE args -# define _NAN_METHOD_RETURN_TYPE v8::Handle - -# define _NAN_GETTER_ARGS_TYPE const v8::AccessorInfo & -# define _NAN_GETTER_ARGS _NAN_GETTER_ARGS_TYPE args -# define _NAN_GETTER_RETURN_TYPE v8::Handle - -# define _NAN_SETTER_ARGS_TYPE const v8::AccessorInfo & -# define _NAN_SETTER_ARGS _NAN_SETTER_ARGS_TYPE args -# define _NAN_SETTER_RETURN_TYPE void - -# define _NAN_PROPERTY_GETTER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_GETTER_ARGS _NAN_PROPERTY_GETTER_ARGS_TYPE args -# define _NAN_PROPERTY_GETTER_RETURN_TYPE v8::Handle - -# define _NAN_PROPERTY_SETTER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_SETTER_ARGS _NAN_PROPERTY_SETTER_ARGS_TYPE args -# define _NAN_PROPERTY_SETTER_RETURN_TYPE v8::Handle - -# define _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_ENUMERATOR_ARGS _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE args -# define _NAN_PROPERTY_ENUMERATOR_RETURN_TYPE v8::Handle - -# define _NAN_PROPERTY_DELETER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_DELETER_ARGS _NAN_PROPERTY_DELETER_ARGS_TYPE args -# define _NAN_PROPERTY_DELETER_RETURN_TYPE v8::Handle - -# define _NAN_PROPERTY_QUERY_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_PROPERTY_QUERY_ARGS _NAN_PROPERTY_QUERY_ARGS_TYPE args -# define _NAN_PROPERTY_QUERY_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_GETTER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_GETTER_ARGS _NAN_INDEX_GETTER_ARGS_TYPE args -# define _NAN_INDEX_GETTER_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_SETTER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_SETTER_ARGS _NAN_INDEX_SETTER_ARGS_TYPE args -# define _NAN_INDEX_SETTER_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_ENUMERATOR_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_ENUMERATOR_ARGS _NAN_INDEX_ENUMERATOR_ARGS_TYPE args -# define _NAN_INDEX_ENUMERATOR_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_DELETER_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_DELETER_ARGS _NAN_INDEX_DELETER_ARGS_TYPE args -# define _NAN_INDEX_DELETER_RETURN_TYPE v8::Handle - -# define _NAN_INDEX_QUERY_ARGS_TYPE const v8::AccessorInfo& -# define _NAN_INDEX_QUERY_ARGS _NAN_INDEX_QUERY_ARGS_TYPE args -# define _NAN_INDEX_QUERY_RETURN_TYPE v8::Handle - - typedef v8::InvocationCallback NanFunctionCallback; - - NAN_DEPRECATED NAN_INLINE v8::Local NanSymbol( - const char* data, int length = -1) { - return v8::String::NewSymbol(data, length); - } - - template - NAN_INLINE v8::Local NanNew() { - return v8::Local::New(T::New()); - } - - template - NAN_INLINE v8::Local NanNew(v8::Handle arg) { - return v8::Local::New(arg); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle receiver - , int argc - , v8::Handle argv[] = 0) { - return v8::Signature::New(receiver, argc, argv); - } - - template - NAN_INLINE v8::Local NanNew( - NanFunctionCallback callback - , v8::Handle data = v8::Handle() - , v8::Handle signature = v8::Handle()) { - return T::New(callback, data, signature); - } - - template - NAN_INLINE v8::Local NanNew(const v8::Persistent &arg) { - return v8::Local::New(arg); - } - - template - NAN_INLINE v8::Local NanNew(P arg) { - return v8::Local::New(T::New(arg)); - } - - template - NAN_INLINE v8::Local NanNew(P arg, int length) { - return v8::Local::New(T::New(arg, length)); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Local pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Handle pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template - NAN_INLINE v8::Local NanNew( - v8::Local pattern, v8::RegExp::Flags flags) { - return v8::RegExp::New(pattern, flags); - } - - template<> - NAN_INLINE v8::Local NanNew() { - return v8::Array::New(); - } - - template<> - NAN_INLINE v8::Local NanNew(int length) { - return v8::Array::New(length); - } - - template<> - NAN_INLINE v8::Local NanNew(double time) { - return v8::Date::New(time).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(int time) { - return v8::Date::New(time).As(); - } - - typedef v8::Script NanUnboundScript; - typedef v8::Script NanBoundScript; - - template - NAN_INLINE v8::Local NanNew( - P s - , const v8::ScriptOrigin& origin - ) { - return v8::Script::New(s, const_cast(&origin)); - } - - template<> - NAN_INLINE v8::Local NanNew( - v8::Local s - ) { - return v8::Script::New(s); - } - - template<> - NAN_INLINE v8::Local NanNew(bool value) { - return v8::BooleanObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local - NanNew >( - v8::Local value) { - return v8::StringObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local - NanNew >( - v8::Handle value) { - return v8::StringObject::New(value).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(double val) { - return v8::NumberObject::New(val).As(); - } - - template<> - NAN_INLINE v8::Local NanNew(int32_t val) { - return v8::Uint32::NewFromUnsigned(val)->ToUint32(); - } - - template<> - NAN_INLINE v8::Local NanNew(uint32_t val) { - return v8::Uint32::NewFromUnsigned(val)->ToUint32(); - } - - template<> - NAN_INLINE v8::Local NanNew(int32_t val) { - return v8::Int32::New(val)->ToInt32(); - } - - template<> - NAN_INLINE v8::Local NanNew(uint32_t val) { - return v8::Int32::New(val)->ToInt32(); - } - - template<> - NAN_INLINE v8::Local NanNew( - uint8_t *arg - , int length) { - int len = length; - if (len < 0) { - size_t temp = strlen(reinterpret_cast(arg)); - assert(temp <= INT_MAX && "too long string"); - len = static_cast(temp); - } - uint16_t *warg = new uint16_t[len]; - for (int i = 0; i < len; i++) { - warg[i] = arg[i]; - } - v8::Local retval = v8::String::New(warg, len); - delete[] warg; - return retval; - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint8_t *arg - , int length) { - int len = length; - if (len < 0) { - size_t temp = strlen(reinterpret_cast(arg)); - assert(temp <= INT_MAX && "too long string"); - len = static_cast(temp); - } - uint16_t *warg = new uint16_t[len]; - for (int i = 0; i < len; i++) { - warg[i] = arg[i]; - } - v8::Local retval = v8::String::New(warg, len); - delete[] warg; - return retval; - } - - template<> - NAN_INLINE v8::Local NanNew(uint8_t *arg) { - size_t temp = strlen(reinterpret_cast(arg)); - assert(temp <= INT_MAX && "too long string"); - int length = static_cast(temp); - uint16_t *warg = new uint16_t[length]; - for (int i = 0; i < length; i++) { - warg[i] = arg[i]; - } - - v8::Local retval = v8::String::New(warg, length); - delete[] warg; - return retval; - } - - template<> - NAN_INLINE v8::Local NanNew( - const uint8_t *arg) { - size_t temp = strlen(reinterpret_cast(arg)); - assert(temp <= INT_MAX && "too long string"); - int length = static_cast(temp); - uint16_t *warg = new uint16_t[length]; - for (int i = 0; i < length; i++) { - warg[i] = arg[i]; - } - v8::Local retval = v8::String::New(warg, length); - delete[] warg; - return retval; - } - - template<> - NAN_INLINE v8::Local NanNew( - std::string arg) { - return NanNew(arg.c_str(), arg.size()); - } - - template<> - NAN_INLINE v8::Local NanNew() { - return v8::String::Empty(); - } - - NAN_INLINE v8::Local NanNew(const char* arg, int length = -1) { - return NanNew(arg, length); - } - - NAN_INLINE v8::Local NanNew( - const uint8_t* arg - , int length = -1) { - return NanNew(arg, length); - } - - NAN_INLINE v8::Local NanNew( - const uint16_t* arg - , int length = -1) { - return NanNew(arg, length); - } - - NAN_INLINE v8::Local NanNew( - std::string& arg) { - return NanNew(arg.c_str(), arg.size()); - } - - NAN_INLINE v8::Local NanNew(double val) { - return NanNew(val); - } - - NAN_INLINE v8::Local NanNew(int val) { - return NanNew(val); - } - - NAN_INLINE v8::Local NanNew(unsigned int val) { - return NanNew(val); - } - - NAN_INLINE v8::Local NanNew(bool val) { - return NanNew(val); - } - - NAN_INLINE v8::Local NanNew( - v8::String::ExternalStringResource *resource) { - return v8::String::NewExternal(resource); - } - - NAN_INLINE v8::Local NanNew( - v8::String::ExternalAsciiStringResource *resource) { - return v8::String::NewExternal(resource); - } - -# define NanScope() v8::HandleScope scope -# define NanEscapableScope() v8::HandleScope scope -# define NanEscapeScope(val) scope.Close(val) -# define NanLocker() v8::Locker locker -# define NanUnlocker() v8::Unlocker unlocker -# define NanReturnValue(value) return scope.Close(value) -# define NanReturnUndefined() return v8::Undefined() -# define NanReturnNull() return v8::Null() -# define NanReturnEmptyString() return v8::String::Empty() -# define NanObjectWrapHandle(obj) v8::Local::New(obj->handle_) - - NAN_INLINE v8::Local NanUndefined() { - NanEscapableScope(); - return NanEscapeScope(NanNew(v8::Undefined())); - } - - NAN_INLINE v8::Local NanNull() { - NanEscapableScope(); - return NanEscapeScope(NanNew(v8::Null())); - } - - NAN_INLINE v8::Local NanTrue() { - NanEscapableScope(); - return NanEscapeScope(NanNew(v8::True())); - } - - NAN_INLINE v8::Local NanFalse() { - NanEscapableScope(); - return NanEscapeScope(NanNew(v8::False())); - } - - NAN_INLINE int NanAdjustExternalMemory(int bc) { - return static_cast(v8::V8::AdjustAmountOfExternalAllocatedMemory(bc)); - } - - NAN_INLINE void NanSetTemplate( - v8::Handle templ - , const char *name - , v8::Handle value) { - templ->Set(name, value); - } - - NAN_INLINE void NanSetTemplate( - v8::Handle templ - , v8::Handle name - , v8::Handle value - , v8::PropertyAttribute attributes) { - templ->Set(name, value, attributes); - } - - NAN_INLINE v8::Local NanGetCurrentContext() { - return v8::Context::GetCurrent(); - } - - NAN_INLINE void* NanGetInternalFieldPointer( - v8::Handle object - , int index) { - return object->GetPointerFromInternalField(index); - } - - NAN_INLINE void NanSetInternalFieldPointer( - v8::Handle object - , int index - , void* value) { - object->SetPointerInInternalField(index, value); - } - - NAN_INLINE void NanAddGCEpilogueCallback( - v8::GCEpilogueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - v8::V8::AddGCEpilogueCallback(callback, gc_type_filter); - } - NAN_INLINE void NanRemoveGCEpilogueCallback( - v8::GCEpilogueCallback callback) { - v8::V8::RemoveGCEpilogueCallback(callback); - } - NAN_INLINE void NanAddGCPrologueCallback( - v8::GCPrologueCallback callback - , v8::GCType gc_type_filter = v8::kGCTypeAll) { - v8::V8::AddGCPrologueCallback(callback, gc_type_filter); - } - NAN_INLINE void NanRemoveGCPrologueCallback( - v8::GCPrologueCallback callback) { - v8::V8::RemoveGCPrologueCallback(callback); - } - NAN_INLINE void NanGetHeapStatistics( - v8::HeapStatistics *heap_statistics) { - v8::V8::GetHeapStatistics(heap_statistics); - } - - template - NAN_INLINE void NanAssignPersistent( - v8::Persistent& handle - , v8::Handle obj) { - handle.Dispose(); - handle = v8::Persistent::New(obj); - } - - template - class _NanWeakCallbackData; - - template - struct _NanWeakCallbackInfo { - typedef void (*Callback)(const _NanWeakCallbackData &data); - NAN_INLINE _NanWeakCallbackInfo(v8::Handle handle, P* param, Callback cb) - : parameter(param) - , callback(cb) - , persistent(v8::Persistent::New(handle)) { } - - NAN_INLINE ~_NanWeakCallbackInfo() { - persistent.Dispose(); - persistent.Clear(); - } - - P* const parameter; - Callback const callback; - v8::Persistent persistent; - }; - - template - class _NanWeakCallbackData { - public: - NAN_INLINE _NanWeakCallbackData(_NanWeakCallbackInfo *info) - : info_(info) { } - - NAN_INLINE v8::Local GetValue() const { - return NanNew(info_->persistent); - } - - NAN_INLINE P* GetParameter() const { return info_->parameter; } - - NAN_INLINE bool IsNearDeath() const { - return info_->persistent.IsNearDeath(); - } - - NAN_INLINE void Revive() const; - - NAN_INLINE _NanWeakCallbackInfo* GetCallbackInfo() const { - return info_; - } - - NAN_DEPRECATED NAN_INLINE void Dispose() const { - } - - private: - _NanWeakCallbackInfo* info_; - }; - - template - static void _NanWeakPersistentDispatcher( - v8::Persistent object, void *data) { - _NanWeakCallbackInfo* info = - static_cast<_NanWeakCallbackInfo*>(data); - _NanWeakCallbackData wcbd(info); - info->callback(wcbd); - if (wcbd.IsNearDeath()) { - delete wcbd.GetCallbackInfo(); - } - } - - template - NAN_INLINE void _NanWeakCallbackData::Revive() const { - info_->persistent.MakeWeak( - info_ - , &_NanWeakPersistentDispatcher); - } - - template - NAN_INLINE _NanWeakCallbackInfo* NanMakeWeakPersistent( - v8::Handle handle - , P* parameter - , typename _NanWeakCallbackInfo::Callback callback) { - _NanWeakCallbackInfo *cbinfo = - new _NanWeakCallbackInfo(handle, parameter, callback); - cbinfo->persistent.MakeWeak( - cbinfo - , &_NanWeakPersistentDispatcher); - return cbinfo; - } - -# define NAN_WEAK_CALLBACK(name) \ - template \ - static void name(const _NanWeakCallbackData &data) - -# define _NAN_ERROR(fun, errmsg) \ - fun(v8::String::New(errmsg)) - -# define _NAN_THROW_ERROR(fun, errmsg) \ - do { \ - NanScope(); \ - return v8::Local::New( \ - v8::ThrowException(_NAN_ERROR(fun, errmsg))); \ - } while (0); - - NAN_INLINE v8::Local NanError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::Error, errmsg); - } - - NAN_INLINE v8::Local NanThrowError(const char* errmsg) { - _NAN_THROW_ERROR(v8::Exception::Error, errmsg); - } - - NAN_INLINE v8::Local NanThrowError( - v8::Handle error - ) { - NanScope(); - return v8::Local::New(v8::ThrowException(error)); - } - - NAN_INLINE v8::Local NanError( - const char *msg - , const int errorNumber - ) { - v8::Local err = v8::Exception::Error(v8::String::New(msg)); - v8::Local obj = err.As(); - obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber)); - return err; - } - - NAN_INLINE v8::Local NanThrowError( - const char *msg - , const int errorNumber - ) { - return NanThrowError(NanError(msg, errorNumber)); - } - - NAN_INLINE v8::Local NanTypeError(const char* errmsg) { - return _NAN_ERROR(v8::Exception::TypeError, errmsg); - } - - NAN_INLINE v8::Local NanThrowTypeError( - const char* errmsg - ) { - _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg); - } - - NAN_INLINE v8::Local NanRangeError( - const char* errmsg - ) { - return _NAN_ERROR(v8::Exception::RangeError, errmsg); - } - - NAN_INLINE v8::Local NanThrowRangeError( - const char* errmsg - ) { - _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg); - } - - template - NAN_INLINE void NanDisposePersistent( - v8::Persistent &handle) { // NOLINT(runtime/references) - handle.Dispose(); - handle.Clear(); - } - - NAN_INLINE v8::Local NanNewBufferHandle ( - char *data - , size_t length - , node::Buffer::free_callback callback - , void *hint - ) { - return NanNew( - node::Buffer::New(data, length, callback, hint)->handle_); - } - - NAN_INLINE v8::Local NanNewBufferHandle ( - const char *data - , uint32_t size - ) { -#if NODE_MODULE_VERSION >= 0x000B - return NanNew(node::Buffer::New(data, size)->handle_); -#else - return NanNew( - node::Buffer::New(const_cast(data), size)->handle_); -#endif - } - - NAN_INLINE v8::Local NanNewBufferHandle (uint32_t size) { - return NanNew(node::Buffer::New(size)->handle_); - } - - NAN_INLINE void FreeData(char *data, void *hint) { - delete[] data; - } - - NAN_INLINE v8::Local NanBufferUse( - char* data - , uint32_t size - ) { - return NanNew( - node::Buffer::New(data, size, FreeData, NULL)->handle_); - } - - NAN_INLINE bool NanHasInstance( - v8::Persistent& function_template - , v8::Handle value - ) { - return function_template->HasInstance(value); - } - - NAN_INLINE v8::Local NanNewContextHandle( - v8::ExtensionConfiguration* extensions = NULL - , v8::Handle tmpl = v8::Handle() - , v8::Handle obj = v8::Handle() - ) { - v8::Persistent ctx = v8::Context::New(extensions, tmpl, obj); - v8::Local lctx = NanNew(ctx); - ctx.Dispose(); - return lctx; - } - - NAN_INLINE v8::Local NanCompileScript( - v8::Local s - , const v8::ScriptOrigin& origin - ) { - return v8::Script::Compile(s, const_cast(&origin)); - } - - NAN_INLINE v8::Local NanCompileScript( - v8::Local s - ) { - return v8::Script::Compile(s); - } - - NAN_INLINE v8::Local NanRunScript(v8::Handle script) { - return script->Run(); - } - - NAN_INLINE v8::Local NanMakeCallback( - v8::Handle target - , v8::Handle func - , int argc - , v8::Handle* argv) { -# if NODE_VERSION_AT_LEAST(0, 8, 0) - return NanNew(node::MakeCallback(target, func, argc, argv)); -# else - v8::TryCatch try_catch; - v8::Local result = NanNew(func->Call(target, argc, argv)); - if (try_catch.HasCaught()) { - node::FatalException(try_catch); - } - return result; -# endif - } - - NAN_INLINE v8::Local NanMakeCallback( - v8::Handle target - , v8::Handle symbol - , int argc - , v8::Handle* argv) { -# if NODE_VERSION_AT_LEAST(0, 8, 0) - return NanNew(node::MakeCallback(target, symbol, argc, argv)); -# else - v8::Local callback = target->Get(symbol).As(); - return NanMakeCallback(target, callback, argc, argv); -# endif - } - - NAN_INLINE v8::Local NanMakeCallback( - v8::Handle target - , const char* method - , int argc - , v8::Handle* argv) { -# if NODE_VERSION_AT_LEAST(0, 8, 0) - return NanNew(node::MakeCallback(target, method, argc, argv)); -# else - return NanMakeCallback(target, NanNew(method), argc, argv); -# endif - } - - template - NAN_INLINE void NanSetIsolateData( - v8::Isolate *isolate - , T *data - ) { - isolate->SetData(data); - } - - template - NAN_INLINE T *NanGetIsolateData( - v8::Isolate *isolate - ) { - return static_cast(isolate->GetData()); - } - - class NanAsciiString { - public: - NAN_INLINE explicit NanAsciiString(v8::Handle from) { - v8::Local toStr = from->ToString(); - int buf_size = toStr->Length() + 1; - buf = new char[buf_size]; - size = toStr->WriteAscii(buf, 0, buf_size); - } - - NAN_INLINE int Size() const { - return size; - } - - NAN_INLINE char* operator*() { return buf; } - - NAN_INLINE ~NanAsciiString() { - delete[] buf; - } - - private: - char *buf; - int size; - }; - - class NanUtf8String { - public: - NAN_INLINE explicit NanUtf8String(v8::Handle from) { - v8::Local toStr = from->ToString(); - int buf_size = toStr->Utf8Length() + 1; - buf = new char[buf_size]; - size = toStr->WriteUtf8(buf, buf_size); - } - - NAN_INLINE int Size() const { - return size; - } - - NAN_INLINE char* operator*() { return buf; } - - NAN_INLINE ~NanUtf8String() { - delete[] buf; - } - - private: - char *buf; - int size; - }; - - class NanUcs2String { - public: - NAN_INLINE explicit NanUcs2String(v8::Handle from) { - v8::Local toStr = from->ToString(); - int buf_size = toStr->Length() + 1; - buf = new uint16_t[buf_size]; - size = toStr->Write(buf, 0, buf_size); - } - - NAN_INLINE int Size() const { - return size; - } - - NAN_INLINE uint16_t* operator*() { return buf; } - - NAN_INLINE ~NanUcs2String() { - delete[] buf; - } - - private: - uint16_t *buf; - int size; - }; - -#endif // NODE_MODULE_VERSION - -typedef void (*NanFreeCallback)(char *data, void *hint); - -#define NAN_METHOD(name) _NAN_METHOD_RETURN_TYPE name(_NAN_METHOD_ARGS) -#define NAN_GETTER(name) \ - _NAN_GETTER_RETURN_TYPE name( \ - v8::Local property \ - , _NAN_GETTER_ARGS) -#define NAN_SETTER(name) \ - _NAN_SETTER_RETURN_TYPE name( \ - v8::Local property \ - , v8::Local value \ - , _NAN_SETTER_ARGS) -#define NAN_PROPERTY_GETTER(name) \ - _NAN_PROPERTY_GETTER_RETURN_TYPE name( \ - v8::Local property \ - , _NAN_PROPERTY_GETTER_ARGS) -#define NAN_PROPERTY_SETTER(name) \ - _NAN_PROPERTY_SETTER_RETURN_TYPE name( \ - v8::Local property \ - , v8::Local value \ - , _NAN_PROPERTY_SETTER_ARGS) -#define NAN_PROPERTY_ENUMERATOR(name) \ - _NAN_PROPERTY_ENUMERATOR_RETURN_TYPE name(_NAN_PROPERTY_ENUMERATOR_ARGS) -#define NAN_PROPERTY_DELETER(name) \ - _NAN_PROPERTY_DELETER_RETURN_TYPE name( \ - v8::Local property \ - , _NAN_PROPERTY_DELETER_ARGS) -#define NAN_PROPERTY_QUERY(name) \ - _NAN_PROPERTY_QUERY_RETURN_TYPE name( \ - v8::Local property \ - , _NAN_PROPERTY_QUERY_ARGS) -# define NAN_INDEX_GETTER(name) \ - _NAN_INDEX_GETTER_RETURN_TYPE name(uint32_t index, _NAN_INDEX_GETTER_ARGS) -#define NAN_INDEX_SETTER(name) \ - _NAN_INDEX_SETTER_RETURN_TYPE name( \ - uint32_t index \ - , v8::Local value \ - , _NAN_INDEX_SETTER_ARGS) -#define NAN_INDEX_ENUMERATOR(name) \ - _NAN_INDEX_ENUMERATOR_RETURN_TYPE name(_NAN_INDEX_ENUMERATOR_ARGS) -#define NAN_INDEX_DELETER(name) \ - _NAN_INDEX_DELETER_RETURN_TYPE name( \ - uint32_t index \ - , _NAN_INDEX_DELETER_ARGS) -#define NAN_INDEX_QUERY(name) \ - _NAN_INDEX_QUERY_RETURN_TYPE name(uint32_t index, _NAN_INDEX_QUERY_ARGS) - -class NanCallback { - public: - NanCallback() { - NanScope(); - v8::Local obj = NanNew(); - NanAssignPersistent(handle, obj); - } - - explicit NanCallback(const v8::Handle &fn) { - NanScope(); - v8::Local obj = NanNew(); - NanAssignPersistent(handle, obj); - SetFunction(fn); - } - - ~NanCallback() { - if (handle.IsEmpty()) return; - NanDisposePersistent(handle); - } - - NAN_INLINE void SetFunction(const v8::Handle &fn) { - NanScope(); - NanNew(handle)->Set(kCallbackIndex, fn); - } - - NAN_INLINE v8::Local GetFunction() const { - NanEscapableScope(); - return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex) - .As()); - } - - NAN_INLINE bool IsEmpty() const { - NanScope(); - return NanNew(handle)->Get(kCallbackIndex)->IsUndefined(); - } - - v8::Handle Call(int argc, v8::Handle argv[]) const { - NanEscapableScope(); -#if (NODE_MODULE_VERSION > 0x000B) // 0.11.12+ - v8::Isolate* isolate = v8::Isolate::GetCurrent(); - v8::Local callback = NanNew(handle)-> - Get(kCallbackIndex).As(); - return NanEscapeScope(node::MakeCallback( - isolate - , isolate->GetCurrentContext()->Global() - , callback - , argc - , argv - )); -#else -#if NODE_VERSION_AT_LEAST(0, 8, 0) - v8::Local callback = handle-> - Get(kCallbackIndex).As(); - return NanEscapeScope(node::MakeCallback( - v8::Context::GetCurrent()->Global() - , callback - , argc - , argv - )); -#else - v8::Local callback = handle-> - Get(kCallbackIndex).As(); - return NanEscapeScope(NanMakeCallback( - v8::Context::GetCurrent()->Global(), callback, argc, argv)); -#endif -#endif - } - - private: - v8::Persistent handle; - static const uint32_t kCallbackIndex = 0; -}; - -/* abstract */ class NanAsyncWorker { - public: - explicit NanAsyncWorker(NanCallback *callback) - : callback(callback), errmsg_(NULL) { - request.data = this; - - NanScope(); - v8::Local obj = NanNew(); - NanAssignPersistent(persistentHandle, obj); - } - - virtual ~NanAsyncWorker() { - NanScope(); - - if (!persistentHandle.IsEmpty()) - NanDisposePersistent(persistentHandle); - if (callback) - delete callback; - if (errmsg_) - delete[] errmsg_; - } - - virtual void WorkComplete() { - NanScope(); - - if (errmsg_ == NULL) - HandleOKCallback(); - else - HandleErrorCallback(); - delete callback; - callback = NULL; - } - - NAN_INLINE void SaveToPersistent( - const char *key, const v8::Local &obj) { - v8::Local handle = NanNew(persistentHandle); - handle->Set(NanNew(key), obj); - } - - v8::Local GetFromPersistent(const char *key) const { - NanEscapableScope(); - v8::Local handle = NanNew(persistentHandle); - return NanEscapeScope(handle->Get(NanNew(key)).As()); - } - - virtual void Execute() = 0; - - uv_work_t request; - - protected: - v8::Persistent persistentHandle; - NanCallback *callback; - - virtual void HandleOKCallback() { - NanScope(); - - callback->Call(0, NULL); - } - - virtual void HandleErrorCallback() { - NanScope(); - - v8::Local argv[] = { - v8::Exception::Error(NanNew(ErrorMessage())) - }; - callback->Call(1, argv); - } - - void SetErrorMessage(const char *msg) { - if (errmsg_) { - delete[] errmsg_; - } - - size_t size = strlen(msg) + 1; - errmsg_ = new char[size]; - memcpy(errmsg_, msg, size); - } - - const char* ErrorMessage() const { - return errmsg_; - } - - private: - char *errmsg_; -}; - -NAN_INLINE void NanAsyncExecute (uv_work_t* req) { - NanAsyncWorker *worker = static_cast(req->data); - worker->Execute(); -} - -NAN_INLINE void NanAsyncExecuteComplete (uv_work_t* req) { - NanAsyncWorker* worker = static_cast(req->data); - worker->WorkComplete(); - delete worker; -} - -NAN_INLINE void NanAsyncQueueWorker (NanAsyncWorker* worker) { - uv_queue_work( - uv_default_loop() - , &worker->request - , NanAsyncExecute - , (uv_after_work_cb)NanAsyncExecuteComplete - ); -} - -//// Base 64 //// - -#define _nan_base64_encoded_size(size) ((size + 2 - ((size + 2) % 3)) / 3 * 4) - -// Doesn't check for padding at the end. Can be 1-2 bytes over. -NAN_INLINE size_t _nan_base64_decoded_size_fast(size_t size) { - size_t remainder = size % 4; - - size = (size / 4) * 3; - if (remainder) { - if (size == 0 && remainder == 1) { - // special case: 1-byte input cannot be decoded - size = 0; - } else { - // non-padded input, add 1 or 2 extra bytes - size += 1 + (remainder == 3); - } - } - - return size; -} - -template -NAN_INLINE size_t _nan_base64_decoded_size( - const T* src - , size_t size -) { - if (size == 0) - return 0; - - if (src[size - 1] == '=') - size--; - if (size > 0 && src[size - 1] == '=') - size--; - - return _nan_base64_decoded_size_fast(size); -} - -// supports regular and URL-safe base64 -static const int _nan_unbase64_table[] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -2, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 62, -1, 63 - , 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1 - , -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 - , 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63 - , -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 - , 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 -}; - -#define _nan_unbase64(x) _nan_unbase64_table[(uint8_t)(x)] - -template static size_t _nan_base64_decode( - char* buf - , size_t len - , const T* src - , const size_t srcLen -) { - char* dst = buf; - char* dstEnd = buf + len; - const T* srcEnd = src + srcLen; - - while (src < srcEnd && dst < dstEnd) { - ptrdiff_t remaining = srcEnd - src; - char a, b, c, d; - - while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; - if (remaining == 0 || *src == '=') break; - a = _nan_unbase64(*src++); - - while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; - if (remaining <= 1 || *src == '=') break; - b = _nan_unbase64(*src++); - - *dst++ = (a << 2) | ((b & 0x30) >> 4); - if (dst == dstEnd) break; - - while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; - if (remaining <= 2 || *src == '=') break; - c = _nan_unbase64(*src++); - - *dst++ = ((b & 0x0F) << 4) | ((c & 0x3C) >> 2); - if (dst == dstEnd) break; - - while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; - if (remaining <= 3 || *src == '=') break; - d = _nan_unbase64(*src++); - - *dst++ = ((c & 0x03) << 6) | (d & 0x3F); - } - - return dst - buf; -} - -//// HEX //// - -template unsigned _nan_hex2bin(T c) { - if (c >= '0' && c <= '9') return c - '0'; - if (c >= 'A' && c <= 'F') return 10 + (c - 'A'); - if (c >= 'a' && c <= 'f') return 10 + (c - 'a'); - return static_cast(-1); -} - -template static size_t _nan_hex_decode( - char* buf - , size_t len - , const T* src - , const size_t srcLen -) { - size_t i; - for (i = 0; i < len && i * 2 + 1 < srcLen; ++i) { - unsigned a = _nan_hex2bin(src[i * 2 + 0]); - unsigned b = _nan_hex2bin(src[i * 2 + 1]); - if (!~a || !~b) return i; - buf[i] = a * 16 + b; - } - - return i; -} - -static bool _NanGetExternalParts( - v8::Handle val - , const char** data - , size_t* len -) { - if (node::Buffer::HasInstance(val)) { - *data = node::Buffer::Data(val.As()); - *len = node::Buffer::Length(val.As()); - return true; - } - - assert(val->IsString()); - v8::Local str = NanNew(val.As()); - - if (str->IsExternalAscii()) { - const v8::String::ExternalAsciiStringResource* ext; - ext = str->GetExternalAsciiStringResource(); - *data = ext->data(); - *len = ext->length(); - return true; - - } else if (str->IsExternal()) { - const v8::String::ExternalStringResource* ext; - ext = str->GetExternalStringResource(); - *data = reinterpret_cast(ext->data()); - *len = ext->length(); - return true; - } - - return false; -} - -namespace Nan { - enum Encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER}; -} - -/* NAN_DEPRECATED */ NAN_INLINE void* _NanRawString( - v8::Handle from - , enum Nan::Encoding encoding - , size_t *datalen - , void *buf - , size_t buflen - , int flags -) { - NanScope(); - - size_t sz_; - size_t term_len = !(flags & v8::String::NO_NULL_TERMINATION); - char *data = NULL; - size_t len; - bool is_extern = _NanGetExternalParts( - from - , const_cast(&data) - , &len); - - if (is_extern && !term_len) { - NanSetPointerSafe(datalen, len); - return data; - } - - v8::Local toStr = from->ToString(); - - char *to = static_cast(buf); - - switch (encoding) { - case Nan::ASCII: -#if NODE_MODULE_VERSION < 0x000C - sz_ = toStr->Length(); - if (to == NULL) { - to = new char[sz_ + term_len]; - } else { - assert(buflen >= sz_ + term_len && "too small buffer"); - } - NanSetPointerSafe( - datalen - , toStr->WriteAscii(to, 0, static_cast(sz_ + term_len), flags)); - return to; -#endif - case Nan::BINARY: - case Nan::BUFFER: - sz_ = toStr->Length(); - if (to == NULL) { - to = new char[sz_ + term_len]; - } else { - assert(buflen >= sz_ + term_len && "too small buffer"); - } -#if NODE_MODULE_VERSION < 0x000C - { - uint16_t* twobytebuf = new uint16_t[sz_ + term_len]; - - size_t len = toStr->Write(twobytebuf, 0, - static_cast(sz_ + term_len), flags); - - for (size_t i = 0; i < sz_ + term_len && i < len + term_len; i++) { - unsigned char *b = reinterpret_cast(&twobytebuf[i]); - to[i] = *b; - } - - NanSetPointerSafe(datalen, len); - - delete[] twobytebuf; - return to; - } -#else - NanSetPointerSafe( - datalen, - toStr->WriteOneByte( - reinterpret_cast(to) - , 0 - , static_cast(sz_ + term_len) - , flags)); - return to; -#endif - case Nan::UTF8: - sz_ = toStr->Utf8Length(); - if (to == NULL) { - to = new char[sz_ + term_len]; - } else { - assert(buflen >= sz_ + term_len && "too small buffer"); - } - NanSetPointerSafe( - datalen - , toStr->WriteUtf8(to, static_cast(sz_ + term_len) - , NULL, flags) - - term_len); - return to; - case Nan::BASE64: - { - v8::String::Value value(toStr); - sz_ = _nan_base64_decoded_size(*value, value.length()); - if (to == NULL) { - to = new char[sz_ + term_len]; - } else { - assert(buflen >= sz_ + term_len); - } - NanSetPointerSafe( - datalen - , _nan_base64_decode(to, sz_, *value, value.length())); - if (term_len) { - to[sz_] = '\0'; - } - return to; - } - case Nan::UCS2: - { - sz_ = toStr->Length(); - if (to == NULL) { - to = new char[(sz_ + term_len) * 2]; - } else { - assert(buflen >= (sz_ + term_len) * 2 && "too small buffer"); - } - - int bc = 2 * toStr->Write( - reinterpret_cast(to) - , 0 - , static_cast(sz_ + term_len) - , flags); - NanSetPointerSafe(datalen, bc); - return to; - } - case Nan::HEX: - { - v8::String::Value value(toStr); - sz_ = value.length(); - assert(!(sz_ & 1) && "bad hex data"); - if (to == NULL) { - to = new char[sz_ / 2 + term_len]; - } else { - assert(buflen >= sz_ / 2 + term_len && "too small buffer"); - } - NanSetPointerSafe( - datalen - , _nan_hex_decode(to, sz_ / 2, *value, value.length())); - } - if (term_len) { - to[sz_ / 2] = '\0'; - } - return to; - default: - assert(0 && "unknown encoding"); - } - return to; -} - -NAN_DEPRECATED NAN_INLINE void* NanRawString( - v8::Handle from - , enum Nan::Encoding encoding - , size_t *datalen - , void *buf - , size_t buflen - , int flags -) { - return _NanRawString(from, encoding, datalen, buf, buflen, flags); -} - - -NAN_DEPRECATED NAN_INLINE char* NanCString( - v8::Handle from - , size_t *datalen - , char *buf = NULL - , size_t buflen = 0 - , int flags = v8::String::NO_OPTIONS -) { - return static_cast( - _NanRawString(from, Nan::UTF8, datalen, buf, buflen, flags) - ); -} - -NAN_INLINE void NanSetPrototypeTemplate( - v8::Local templ - , const char *name - , v8::Handle value -) { - NanSetTemplate(templ->PrototypeTemplate(), name, value); -} - -NAN_INLINE void NanSetPrototypeTemplate( - v8::Local templ - , v8::Handle name - , v8::Handle value - , v8::PropertyAttribute attributes -) { - NanSetTemplate(templ->PrototypeTemplate(), name, value, attributes); -} - -NAN_INLINE void NanSetInstanceTemplate( - v8::Local templ - , const char *name - , v8::Handle value -) { - NanSetTemplate(templ->InstanceTemplate(), name, value); -} - -NAN_INLINE void NanSetInstanceTemplate( - v8::Local templ - , v8::Handle name - , v8::Handle value - , v8::PropertyAttribute attributes -) { - NanSetTemplate(templ->InstanceTemplate(), name, value, attributes); -} - -#endif // NAN_H_ diff --git a/node_modules/pg/node_modules/nan/package.json b/node_modules/pg/node_modules/nan/package.json deleted file mode 100644 index af046a9..0000000 --- a/node_modules/pg/node_modules/nan/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "nan", - "version": "1.3.0", - "description": "Native Abstractions for Node.js: C++ header for Node 0.8->0.12 compatibility", - "main": "include_dirs.js", - "repository": { - "type": "git", - "url": "git://github.com/rvagg/nan.git" - }, - "scripts": { - "test": "tap --gc test/js/*-test.js", - "rebuild-tests": "node-gyp rebuild --directory test" - }, - "contributors": [ - { - "name": "Rod Vagg", - "email": "r@va.gg", - "url": "https://github.com/rvagg" - }, - { - "name": "Benjamin Byholm", - "email": "bbyholm@abo.fi", - "url": "https://github.com/kkoopa/" - }, - { - "name": "Trevor Norris", - "email": "trev.norris@gmail.com", - "url": "https://github.com/trevnorris" - }, - { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "https://github.com/TooTallNate" - }, - { - "name": "Brett Lawson", - "email": "brett19@gmail.com", - "url": "https://github.com/brett19" - }, - { - "name": "Ben Noordhuis", - "email": "info@bnoordhuis.nl", - "url": "https://github.com/bnoordhuis" - } - ], - "devDependencies": { - "bindings": "~1.2.1", - "node-gyp": "~1.0.1", - "tap": "~0.4.12", - "xtend": "~4.0.0" - }, - "license": "MIT", - "gitHead": "e482fbe142e58373d5a24f4e5a60c61e22a13f83", - "bugs": { - "url": "https://github.com/rvagg/nan/issues" - }, - "homepage": "https://github.com/rvagg/nan", - "_id": "nan@1.3.0", - "_shasum": "9a5b8d5ef97a10df3050e59b2c362d3baf779742", - "_from": "nan@1.3.0", - "_npmVersion": "1.4.21", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "dist": { - "shasum": "9a5b8d5ef97a10df3050e59b2c362d3baf779742", - "tarball": "http://registry.npmjs.org/nan/-/nan-1.3.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/nan/-/nan-1.3.0.tgz" -} diff --git a/node_modules/pg/node_modules/pgpass/node_modules/split/node_modules/through/package.json b/node_modules/pg/node_modules/pgpass/node_modules/split/node_modules/through/package.json index fe9fbdb..7ae09d0 100644 --- a/node_modules/pg/node_modules/pgpass/node_modules/split/node_modules/through/package.json +++ b/node_modules/pg/node_modules/pgpass/node_modules/split/node_modules/through/package.json @@ -43,7 +43,7 @@ }, "_id": "through@2.3.6", "_shasum": "26681c0f524671021d4e29df7c36bce2d0ecf2e8", - "_from": "through@2", + "_from": "through@>=2.0.0 <3.0.0", "_npmVersion": "1.4.26", "_npmUser": { "name": "dominictarr", diff --git a/node_modules/pg/node_modules/pgpass/node_modules/split/package.json b/node_modules/pg/node_modules/pgpass/node_modules/split/package.json index 970f7d7..46fc823 100644 --- a/node_modules/pg/node_modules/pgpass/node_modules/split/package.json +++ b/node_modules/pg/node_modules/pgpass/node_modules/split/package.json @@ -1,6 +1,6 @@ { "name": "split", - "version": "0.3.1", + "version": "0.3.2", "license": "MIT", "description": "split a Text Stream into a Line Stream", "homepage": "http://github.com/dominictarr/split", @@ -30,13 +30,13 @@ "engines": { "node": "*" }, - "gitHead": "93d5c8a04da1ca4acf040c1f08dc5f4316e09711", + "gitHead": "d2ae5e25453c89181c7e53527f08eef416c5fdba", "bugs": { "url": "https://github.com/dominictarr/split/issues" }, - "_id": "split@0.3.1", - "_shasum": "cebcf142bf61bbb64b141628e6db482a2914654c", - "_from": "split@~0.3", + "_id": "split@0.3.2", + "_shasum": "4b812a275f842c1d340c12761e40df7b802bca17", + "_from": "split@>=0.3.0 <0.4.0", "_npmVersion": "1.4.26", "_npmUser": { "name": "dominictarr", @@ -49,10 +49,10 @@ } ], "dist": { - "shasum": "cebcf142bf61bbb64b141628e6db482a2914654c", - "tarball": "http://registry.npmjs.org/split/-/split-0.3.1.tgz" + "shasum": "4b812a275f842c1d340c12761e40df7b802bca17", + "tarball": "http://registry.npmjs.org/split/-/split-0.3.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/split/-/split-0.3.1.tgz", + "_resolved": "https://registry.npmjs.org/split/-/split-0.3.2.tgz", "readme": "ERROR: No README data found!" } diff --git a/node_modules/pg/node_modules/pgpass/node_modules/split/readme.markdown b/node_modules/pg/node_modules/pgpass/node_modules/split/readme.markdown index 7a77c17..13854ae 100644 --- a/node_modules/pg/node_modules/pgpass/node_modules/split/readme.markdown +++ b/node_modules/pg/node_modules/pgpass/node_modules/split/readme.markdown @@ -33,6 +33,18 @@ Valid options: split(JSON.parse, null, { maxLength: 2}) ``` +## keep matched splitter + +As with `Array#split`, if you split by a regular expression with a matching group, +the matches will be retained in the collection. + +``` +stdin +.pipe(split(/(\r?\n)/)) +... //lines + separators. +``` + + # NDJ - Newline Delimited Json `split` accepts a function which transforms each line. diff --git a/node_modules/pg/node_modules/semver/.npmignore b/node_modules/pg/node_modules/semver/.npmignore new file mode 100644 index 0000000..7300fbc --- /dev/null +++ b/node_modules/pg/node_modules/semver/.npmignore @@ -0,0 +1 @@ +# nada diff --git a/node_modules/pg/node_modules/semver/LICENSE b/node_modules/pg/node_modules/semver/LICENSE new file mode 100644 index 0000000..0c44ae7 --- /dev/null +++ b/node_modules/pg/node_modules/semver/LICENSE @@ -0,0 +1,27 @@ +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/pg/node_modules/semver/Makefile b/node_modules/pg/node_modules/semver/Makefile new file mode 100644 index 0000000..71af0e9 --- /dev/null +++ b/node_modules/pg/node_modules/semver/Makefile @@ -0,0 +1,24 @@ +files = semver.browser.js \ + semver.min.js \ + semver.browser.js.gz \ + semver.min.js.gz + +all: $(files) + +clean: + rm -f $(files) + +semver.browser.js: head.js.txt semver.js foot.js.txt + ( cat head.js.txt; \ + cat semver.js | \ + egrep -v '^ *\/\* nomin \*\/' | \ + perl -pi -e 's/debug\([^\)]+\)//g'; \ + cat foot.js.txt ) > semver.browser.js + +semver.min.js: semver.browser.js + uglifyjs -m semver.min.js + +%.gz: % + gzip --stdout -9 <$< >$@ + +.PHONY: all clean diff --git a/node_modules/pg/node_modules/semver/README.md b/node_modules/pg/node_modules/semver/README.md new file mode 100644 index 0000000..1ec8089 --- /dev/null +++ b/node_modules/pg/node_modules/semver/README.md @@ -0,0 +1,300 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Usage + + $ npm install semver + + semver.valid('1.2.3') // '1.2.3' + semver.valid('a.b.c') // null + semver.clean(' =v1.2.3 ') // '1.2.3' + semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true + semver.gt('1.2.3', '9.8.7') // false + semver.lt('1.2.3', '9.8.7') // true + +As a command-line utility: + + $ semver -h + + Usage: semver [ [...]] [-r | -i | --preid | -l | -rv] + Test if version(s) satisfy the supplied range(s), and sort them. + + Multiple versions or ranges may be supplied, unless increment + option is specified. In that case, only a single version may + be used, and it is incremented by the specified level + + Program exits successfully if any valid version satisfies + all supplied ranges, and prints all satisfying versions. + + If no versions are valid, or ranges are not satisfied, + then exits failure. + + Versions are printed in ascending order, so supplying + multiple versions to the utility will just sort them. + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +````javascript +> semver.inc('1.2.3', 'pre', 'beta') +'1.2.4-beta.0' +``` + +command-line example: + +```shell +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```shell +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero digit in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +## Functions + +All methods and classes take a final `loose` boolean argument that, if +true, will be more forgiving about not-quite-valid semver strings. +The resulting output will always be 100% strict, of course. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. diff --git a/node_modules/pg/node_modules/semver/bin/semver b/node_modules/pg/node_modules/semver/bin/semver new file mode 100755 index 0000000..c5f2e85 --- /dev/null +++ b/node_modules/pg/node_modules/semver/bin/semver @@ -0,0 +1,133 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + , versions = [] + , range = [] + , gt = [] + , lt = [] + , eq = [] + , inc = null + , version = require("../package.json").version + , loose = false + , identifier = undefined + , semver = require("../semver") + , reverse = false + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var i = a.indexOf('=') + if (i !== -1) { + a = a.slice(0, i) + argv.unshift(a.slice(i + 1)) + } + switch (a) { + case "-rv": case "-rev": case "--rev": case "--reverse": + reverse = true + break + case "-l": case "--loose": + loose = true + break + case "-v": case "--version": + versions.push(argv.shift()) + break + case "-i": case "--inc": case "--increment": + switch (argv[0]) { + case "major": case "minor": case "patch": case "prerelease": + case "premajor": case "preminor": case "prepatch": + inc = argv.shift() + break + default: + inc = "patch" + break + } + break + case "--preid": + identifier = argv.shift() + break + case "-r": case "--range": + range.push(argv.shift()) + break + case "-h": case "--help": case "-?": + return help() + default: + versions.push(a) + break + } + } + + versions = versions.filter(function (v) { + return semver.valid(v, loose) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) + return failInc() + + for (var i = 0, l = range.length; i < l ; i ++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], loose) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error("--inc can only be used on a single version with no range") + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? "rcompare" : "compare" + versions.sort(function (a, b) { + return semver[compare](a, b, loose) + }).map(function (v) { + return semver.clean(v, loose) + }).map(function (v) { + return inc ? semver.inc(v, inc, loose, identifier) : v + }).forEach(function (v,i,_) { console.log(v) }) +} + +function help () { + console.log(["SemVer " + version + ,"" + ,"A JavaScript implementation of the http://semver.org/ specification" + ,"Copyright Isaac Z. Schlueter" + ,"" + ,"Usage: semver [options] [ [...]]" + ,"Prints valid versions sorted by SemVer precedence" + ,"" + ,"Options:" + ,"-r --range " + ," Print versions that match the specified range." + ,"" + ,"-i --increment []" + ," Increment a version by the specified level. Level can" + ," be one of: major, minor, patch, premajor, preminor," + ," prepatch, or prerelease. Default level is 'patch'." + ," Only one version may be specified." + ,"" + ,"--preid " + ," Identifier to be used to prefix premajor, preminor," + ," prepatch or prerelease version increments." + ,"" + ,"-l --loose" + ," Interpret versions and ranges loosely" + ,"" + ,"Program exits successfully if any valid version satisfies" + ,"all supplied ranges, and prints all satisfying versions." + ,"" + ,"If no satisfying versions are found, then exits failure." + ,"" + ,"Versions are printed in ascending order, so supplying" + ,"multiple versions to the utility will just sort them." + ].join("\n")) +} diff --git a/node_modules/pg/node_modules/semver/foot.js.txt b/node_modules/pg/node_modules/semver/foot.js.txt new file mode 100644 index 0000000..8f83c20 --- /dev/null +++ b/node_modules/pg/node_modules/semver/foot.js.txt @@ -0,0 +1,6 @@ + +})( + typeof exports === 'object' ? exports : + typeof define === 'function' && define.amd ? {} : + semver = {} +); diff --git a/node_modules/pg/node_modules/semver/head.js.txt b/node_modules/pg/node_modules/semver/head.js.txt new file mode 100644 index 0000000..6536865 --- /dev/null +++ b/node_modules/pg/node_modules/semver/head.js.txt @@ -0,0 +1,2 @@ +;(function(exports) { + diff --git a/node_modules/pg/node_modules/semver/package.json b/node_modules/pg/node_modules/semver/package.json new file mode 100644 index 0000000..dc242ca --- /dev/null +++ b/node_modules/pg/node_modules/semver/package.json @@ -0,0 +1,55 @@ +{ + "name": "semver", + "version": "4.2.0", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "browser": "semver.browser.js", + "min": "semver.min.js", + "scripts": { + "test": "tap test/*.js", + "prepublish": "make" + }, + "devDependencies": { + "tap": "0.x >=0.0.4", + "uglify-js": "~2.3.6" + }, + "license": "BSD", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-semver.git" + }, + "bin": { + "semver": "./bin/semver" + }, + "gitHead": "f353d3337dd9bef990b6873e281342260b4e63ae", + "bugs": { + "url": "https://github.com/isaacs/node-semver/issues" + }, + "homepage": "https://github.com/isaacs/node-semver", + "_id": "semver@4.2.0", + "_shasum": "a571fd4adbe974fe32bd9cb4c5e249606f498423", + "_from": "semver@>=4.1.0 <5.0.0", + "_npmVersion": "2.1.14", + "_nodeVersion": "0.10.33", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "dist": { + "shasum": "a571fd4adbe974fe32bd9cb4c5e249606f498423", + "tarball": "http://registry.npmjs.org/semver/-/semver-4.2.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/semver/-/semver-4.2.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/node_modules/pg/node_modules/semver/semver.browser.js b/node_modules/pg/node_modules/semver/semver.browser.js new file mode 100644 index 0000000..49d7856 --- /dev/null +++ b/node_modules/pg/node_modules/semver/semver.browser.js @@ -0,0 +1,1147 @@ +;(function(exports) { + +// export the class if we are in a Node-like system. +if (typeof module === 'object' && module.exports === exports) + exports = module.exports = SemVer; + +// The debug function is excluded entirely from the minified version. + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; + +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; + + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; + +src[FULL] = '^' + FULLPLAIN + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; + +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; + +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; + +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?'; + +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?'; + +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; + +var TILDETRIM = R++; +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); +var tildeTrimReplace = '$1~'; + +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++; +src[LONECARET] = '(?:\\^)'; + +var CARETTRIM = R++; +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); +var caretTrimReplace = '$1^'; + +var CARET = R++; +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; +var CARETLOOSE = R++; +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; + + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); +var comparatorTrimReplace = '$1$2$3'; + + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; + +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + ; + if (!re[i]) + re[i] = new RegExp(src[i]); +} + +exports.parse = parse; +function parse(version, loose) { + var r = loose ? re[LOOSE] : re[FULL]; + return (r.test(version)) ? new SemVer(version, loose) : null; +} + +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; +} + + +exports.clean = clean; +function clean(version, loose) { + var s = parse(version.trim().replace(/^[=v]+/, ''), loose); + return s ? s.version : null; +} + +exports.SemVer = SemVer; + +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version); + } + + if (!(this instanceof SemVer)) + return new SemVer(version, loose); + + ; + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); + + if (!m) + throw new TypeError('Invalid Version: ' + version); + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + return (/^[0-9]+$/.test(id)) ? +id : id; + }); + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; + +SemVer.prototype.inspect = function() { + return ''; +}; + +SemVer.prototype.toString = function() { + return this.version; +}; + +SemVer.prototype.compare = function(other) { + ; + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return this.compareMain(other) || this.comparePre(other); +}; + +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); +}; + +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.length && !other.prerelease.length) + return 0; + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + ; + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function(release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc('pre', identifier); + break; + case 'preminor': + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc('pre', identifier); + break; + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) + this.major++; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) + this.minor++; + this.patch = 0; + this.prerelease = []; + break; + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) + this.patch++; + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) + this.prerelease = [identifier, 0]; + } else + this.prerelease = [identifier, 0]; + } + break; + + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + return this; +}; + +exports.inc = inc; +function inc(version, release, loose, identifier) { + if (typeof(loose) === 'string') { + identifier = loose; + loose = undefined; + } + + try { + return new SemVer(version, loose).inc(release, identifier).version; + } catch (er) { + return null; + } +} + +exports.diff = diff; +function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(version2); + if (v1.prerelease.length || v2.prerelease.length) { + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return 'pre'+key; + } + } + } + return 'prerelease'; + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return key; + } + } + } + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} + +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(b); +} + +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} + +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} + +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} + +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} + +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} + +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} + +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} + +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} + +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} + +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} + +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a === b; + break; + case '!==': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a !== b; + break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} + +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } + + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); + + ; + this.loose = loose; + this.parse(comp); + + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; + + ; +} + +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); + + if (!m) + throw new TypeError('Invalid comparator: ' + comp); + + this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else + this.semver = new SemVer(m[2], this.loose); +}; + +Comparator.prototype.inspect = function() { + return ''; +}; + +Comparator.prototype.toString = function() { + return this.value; +}; + +Comparator.prototype.test = function(version) { + ; + + if (this.semver === ANY) + return true; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + return cmp(version, this.operator, this.semver, this.loose); +}; + + +exports.Range = Range; +function Range(range, loose) { + if ((range instanceof Range) && range.loose === loose) + return range; + + if (!(this instanceof Range)) + return new Range(range, loose); + + this.loose = loose; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } + + this.format(); +} + +Range.prototype.inspect = function() { + return ''; +}; + +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; + +Range.prototype.toString = function() { + return this.range; +}; + +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + ; + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + ; + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + ; + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); + + return set; +}; + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + ; + comp = replaceCarets(comp, loose); + ; + comp = replaceTildes(comp, loose); + ; + comp = replaceXRanges(comp, loose); + ; + comp = replaceStars(comp, loose); + ; + return comp; +} + +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} + +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + ; + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) + // ~1.2 == >=1.2.0- <1.3.0- + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else if (pr) { + ; + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + + ; + return ret; + }); +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceCaret(comp, loose); + }).join(' '); +} + +function replaceCaret(comp, loose) { + ; + var r = loose ? re[CARETLOOSE] : re[CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + ; + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) { + if (M === '0') + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; + } else if (pr) { + ; + if (pr.charAt(0) !== '-') + pr = '-' + pr; + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + (+M + 1) + '.0.0'; + } else { + ; + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0'; + } + + ; + return ret; + }); +} + +function replaceXRanges(comp, loose) { + ; + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} + +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + ; + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) + gtlt = ''; + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0'; + } else { + // nothing is forbidden + ret = '*'; + } + } else if (gtlt && anyX) { + // replace X with 0 + if (xm) + m = 0; + if (xp) + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>='; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) + M = +M + 1 + else + m = +m + 1 + } + + ret = gtlt + M + '.' + m + '.' + p; + } else if (xm) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + } + + ; + + return ret; + }); +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + ; + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0'; + else + from = '>=' + from; + + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; + + return (from + ' ' + to).trim(); +} + + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; +}; + +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; + } + + if (version.prerelease.length) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (var i = 0; i < set.length; i++) { + ; + if (set[i].semver === ANY) + return true; + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver; + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) + return true; + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false; + } + + return true; +} + +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; + } + return range.test(version); +} + +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return rcompare(a, b, loose); + })[0] || null; +} + +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr; +function ltr(version, range, loose) { + return outside(version, range, '<', loose); +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr; +function gtr(version, range, loose) { + return outside(version, range, '>', loose); +} + +exports.outside = outside; +function outside(version, range, hilo, loose) { + version = new SemVer(version, loose); + range = new Range(range, loose); + + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case '>': + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = '>'; + ecomp = '>='; + break; + case '<': + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = '<'; + ecomp = '<='; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, loose)) { + return false; + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i]; + + var high = null; + var low = null; + + comparators.forEach(function(comparator) { + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, loose)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, loose)) { + low = comparator; + } + }); + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false; + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; + } + } + return true; +} + +// Use the define() function if we're in AMD land +if (typeof define === 'function' && define.amd) + define(exports); + +})( + typeof exports === 'object' ? exports : + typeof define === 'function' && define.amd ? {} : + semver = {} +); diff --git a/node_modules/pg/node_modules/semver/semver.browser.js.gz b/node_modules/pg/node_modules/semver/semver.browser.js.gz new file mode 100644 index 0000000000000000000000000000000000000000..c6b27c9ad311eba6e0be891e8c4decf10a8f4fb7 GIT binary patch literal 7739 zcmV-B9>n1viwFR$IGI!e1KmAqa~n63-}x(Gtt%uYlBVROZch@W(k9BrSC;IOlr8Vt z(t1b^sfp*o%nbENB>(p72cGjH%|MfKSh4+i%IBZnFwa$))!vtiy#)BI8CO0KMX$kBD>FWKN_?Epp)M({A4Dg zWV#G}F&d3TI~o7tPx7|-<{Mc&kUdeg>a`_=E-t}|b3girpY9Q17eLX}A1~)ZkuHJ^ z8c)LI)Sn7J&V$qs@5L-lA|gKu;$Rj))s3HK06rizr%CSbLOryF{~=uFM*uNM(z${Z zFchj;_!Icz5a=oP^i-sF=v_gyT|$plz7Xvt9x&W}(2 zaeVgg^S8&}{~NxXzj|{DBW>>thJ#_-4Aq)t$ljq3LLrgkf?U#B*`x&zB(p9N#Tc7#IuzX!l|<_Qf&-KF*R< zKF%nwzaj_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E2Ohpqj#nEKgr4yyt-mZ2%G*f%~IS!z$e zc+TlgA2saGM|yey{S5{F6VOBXF$DE(pPv36fZIxEF&`Bse05{2>F=r5&=l9fWI4Zv zS>DcQt&~e6pPwQt#`lG_Qg;6Y!MVF-DZ#4DqpIwq%4QW;c@EqwhqMQg0;97<)7bS{ zC6IcyX=I+A;*xK^aaITo&bORxa4M+*m$!8-aDJJkdcMH5c$neEYp0bbl0Dm)F~|7@;AexcyGFL0%zuKB%1!s0Hx_}0AAFD$=qI@x z`lUW_uKB4*k8(@xr(y79JIm+|W!oTH7Z@l!lc&xFhO|i+Bx%Vq&w{C6f&{P0x#QD7 zwf#2tnuHIm3mqx#3RCAo#~-5npj~-8Ny6hpMf}a`u@2XD5GL+0Pyk!cQBRn`UPiIZ)l z!Rci$4RjsMuj#fa8#$FLd8^A>=6N`F*npN}Z*uJhxZNusLZPJ(FtQWtYKfd%)CK-q zSQ3`8N13e9xndS<__EVMidq)1$`iq*@E7k0B>FW!$ z2~3u$^Y9byCNq3fLYclG*Bck&fO9c|)DSpXuJJ1~>GTA*Jwiz}I+w;F5L_KnGO*@j#RvD-LqYdRFWV6*nk zH)H~zj@k7twL1)~`B}by&JQqjx>h93G9O1LKZp=BORY^jx8OazYD5PgTruz>dLmCE zR)3-vrsQL{gAN#DvHy&%{wueKx_H+>uF)Sf{QZ&I=$kOVKenLH{{;wu6p5mD008!4 B_{jhO literal 0 HcmV?d00001 diff --git a/node_modules/pg/node_modules/semver/semver.js b/node_modules/pg/node_modules/semver/semver.js new file mode 100644 index 0000000..026173e --- /dev/null +++ b/node_modules/pg/node_modules/semver/semver.js @@ -0,0 +1,1151 @@ +// export the class if we are in a Node-like system. +if (typeof module === 'object' && module.exports === exports) + exports = module.exports = SemVer; + +// The debug function is excluded entirely from the minified version. +/* nomin */ var debug; +/* nomin */ if (typeof process === 'object' && + /* nomin */ process.env && + /* nomin */ process.env.NODE_DEBUG && + /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) + /* nomin */ debug = function() { + /* nomin */ var args = Array.prototype.slice.call(arguments, 0); + /* nomin */ args.unshift('SEMVER'); + /* nomin */ console.log.apply(console, args); + /* nomin */ }; +/* nomin */ else + /* nomin */ debug = function() {}; + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; + +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; + + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; + +src[FULL] = '^' + FULLPLAIN + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; + +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; + +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; + +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?'; + +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?'; + +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; + +var TILDETRIM = R++; +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); +var tildeTrimReplace = '$1~'; + +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++; +src[LONECARET] = '(?:\\^)'; + +var CARETTRIM = R++; +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); +var caretTrimReplace = '$1^'; + +var CARET = R++; +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; +var CARETLOOSE = R++; +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; + + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); +var comparatorTrimReplace = '$1$2$3'; + + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; + +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]); + if (!re[i]) + re[i] = new RegExp(src[i]); +} + +exports.parse = parse; +function parse(version, loose) { + var r = loose ? re[LOOSE] : re[FULL]; + return (r.test(version)) ? new SemVer(version, loose) : null; +} + +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; +} + + +exports.clean = clean; +function clean(version, loose) { + var s = parse(version.trim().replace(/^[=v]+/, ''), loose); + return s ? s.version : null; +} + +exports.SemVer = SemVer; + +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version); + } + + if (!(this instanceof SemVer)) + return new SemVer(version, loose); + + debug('SemVer', version, loose); + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); + + if (!m) + throw new TypeError('Invalid Version: ' + version); + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + return (/^[0-9]+$/.test(id)) ? +id : id; + }); + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; + +SemVer.prototype.inspect = function() { + return ''; +}; + +SemVer.prototype.toString = function() { + return this.version; +}; + +SemVer.prototype.compare = function(other) { + debug('SemVer.compare', this.version, this.loose, other); + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return this.compareMain(other) || this.comparePre(other); +}; + +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); +}; + +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.length && !other.prerelease.length) + return 0; + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function(release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc('pre', identifier); + break; + case 'preminor': + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc('pre', identifier); + break; + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) + this.major++; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) + this.minor++; + this.patch = 0; + this.prerelease = []; + break; + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) + this.patch++; + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) + this.prerelease = [identifier, 0]; + } else + this.prerelease = [identifier, 0]; + } + break; + + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + return this; +}; + +exports.inc = inc; +function inc(version, release, loose, identifier) { + if (typeof(loose) === 'string') { + identifier = loose; + loose = undefined; + } + + try { + return new SemVer(version, loose).inc(release, identifier).version; + } catch (er) { + return null; + } +} + +exports.diff = diff; +function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(version2); + if (v1.prerelease.length || v2.prerelease.length) { + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return 'pre'+key; + } + } + } + return 'prerelease'; + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return key; + } + } + } + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} + +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(b); +} + +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} + +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} + +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} + +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} + +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} + +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} + +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} + +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} + +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} + +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} + +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a === b; + break; + case '!==': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a !== b; + break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} + +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } + + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); + + debug('comparator', comp, loose); + this.loose = loose; + this.parse(comp); + + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; + + debug('comp', this); +} + +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); + + if (!m) + throw new TypeError('Invalid comparator: ' + comp); + + this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else + this.semver = new SemVer(m[2], this.loose); +}; + +Comparator.prototype.inspect = function() { + return ''; +}; + +Comparator.prototype.toString = function() { + return this.value; +}; + +Comparator.prototype.test = function(version) { + debug('Comparator.test', version, this.loose); + + if (this.semver === ANY) + return true; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + return cmp(version, this.operator, this.semver, this.loose); +}; + + +exports.Range = Range; +function Range(range, loose) { + if ((range instanceof Range) && range.loose === loose) + return range; + + if (!(this instanceof Range)) + return new Range(range, loose); + + this.loose = loose; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } + + this.format(); +} + +Range.prototype.inspect = function() { + return ''; +}; + +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; + +Range.prototype.toString = function() { + return this.range; +}; + +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + debug('range', range, loose); + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug('hyphen replace', range); + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + debug('comparator trim', range, re[COMPARATORTRIM]); + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); + + return set; +}; + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + debug('comp', comp); + comp = replaceCarets(comp, loose); + debug('caret', comp); + comp = replaceTildes(comp, loose); + debug('tildes', comp); + comp = replaceXRanges(comp, loose); + debug('xrange', comp); + comp = replaceStars(comp, loose); + debug('stars', comp); + return comp; +} + +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} + +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) + // ~1.2 == >=1.2.0- <1.3.0- + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else if (pr) { + debug('replaceTilde pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + + debug('tilde return', ret); + return ret; + }); +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceCaret(comp, loose); + }).join(' '); +} + +function replaceCaret(comp, loose) { + debug('caret', comp, loose); + var r = loose ? re[CARETLOOSE] : re[CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) { + if (M === '0') + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; + } else if (pr) { + debug('replaceCaret pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + (+M + 1) + '.0.0'; + } else { + debug('no pr'); + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0'; + } + + debug('caret return', ret); + return ret; + }); +} + +function replaceXRanges(comp, loose) { + debug('replaceXRanges', comp, loose); + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} + +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr); + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) + gtlt = ''; + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0'; + } else { + // nothing is forbidden + ret = '*'; + } + } else if (gtlt && anyX) { + // replace X with 0 + if (xm) + m = 0; + if (xp) + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>='; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) + M = +M + 1 + else + m = +m + 1 + } + + ret = gtlt + M + '.' + m + '.' + p; + } else if (xm) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + } + + debug('xRange return', ret); + + return ret; + }); +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + debug('replaceStars', comp, loose); + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0'; + else + from = '>=' + from; + + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; + + return (from + ' ' + to).trim(); +} + + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; +}; + +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; + } + + if (version.prerelease.length) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (var i = 0; i < set.length; i++) { + debug(set[i].semver); + if (set[i].semver === ANY) + return true; + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver; + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) + return true; + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false; + } + + return true; +} + +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; + } + return range.test(version); +} + +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return rcompare(a, b, loose); + })[0] || null; +} + +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr; +function ltr(version, range, loose) { + return outside(version, range, '<', loose); +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr; +function gtr(version, range, loose) { + return outside(version, range, '>', loose); +} + +exports.outside = outside; +function outside(version, range, hilo, loose) { + version = new SemVer(version, loose); + range = new Range(range, loose); + + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case '>': + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = '>'; + ecomp = '>='; + break; + case '<': + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = '<'; + ecomp = '<='; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, loose)) { + return false; + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i]; + + var high = null; + var low = null; + + comparators.forEach(function(comparator) { + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, loose)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, loose)) { + low = comparator; + } + }); + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false; + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; + } + } + return true; +} + +// Use the define() function if we're in AMD land +if (typeof define === 'function' && define.amd) + define(exports); diff --git a/node_modules/pg/node_modules/semver/semver.min.js b/node_modules/pg/node_modules/semver/semver.min.js new file mode 100644 index 0000000..2f07e16 --- /dev/null +++ b/node_modules/pg/node_modules/semver/semver.min.js @@ -0,0 +1 @@ +(function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=H;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var a=n++;t[a]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var o=n++;t[o]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var f=n++;t[f]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var u=n++;t[u]="(?:"+t[i]+"|"+t[a]+")";var l=n++;t[l]="(?:"+t[s]+"|"+t[a]+")";var p=n++;t[p]="(?:-("+t[u]+"(?:\\."+t[u]+")*))";var c=n++;t[c]="(?:-?("+t[l]+"(?:\\."+t[l]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[o]+t[p]+"?"+t[v]+"?";t[m]="^"+g+"$";var w="[v=\\s]*"+t[f]+t[c]+"?"+t[v]+"?";var d=n++;t[d]="^"+w+"$";var y=n++;t[y]="((?:<|>)?=?)";var j=n++;t[j]=t[s]+"|x|X|\\*";var b=n++;t[b]=t[i]+"|x|X|\\*";var $=n++;t[$]="[v=\\s]*("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:"+t[p]+")?"+t[v]+"?"+")?)?";var k=n++;t[k]="[v=\\s]*("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:"+t[c]+")?"+t[v]+"?"+")?)?";var E=n++;t[E]="^"+t[y]+"\\s*"+t[$]+"$";var x=n++;t[x]="^"+t[y]+"\\s*"+t[k]+"$";var R=n++;t[R]="(?:~>?)";var S=n++;t[S]="(\\s*)"+t[R]+"\\s+";r[S]=new RegExp(t[S],"g");var V="$1~";var I=n++;t[I]="^"+t[R]+t[$]+"$";var T=n++;t[T]="^"+t[R]+t[k]+"$";var A=n++;t[A]="(?:\\^)";var C=n++;t[C]="(\\s*)"+t[A]+"\\s+";r[C]=new RegExp(t[C],"g");var M="$1^";var z=n++;t[z]="^"+t[A]+t[$]+"$";var N=n++;t[N]="^"+t[A]+t[k]+"$";var P=n++;t[P]="^"+t[y]+"\\s*("+w+")$|^$";var Z=n++;t[Z]="^"+t[y]+"\\s*("+g+")$|^$";var q=n++;t[q]="(\\s*)"+t[y]+"\\s*("+w+"|"+t[$]+")";r[q]=new RegExp(t[q],"g");var L="$1$2$3";var X=n++;t[X]="^\\s*("+t[$]+")"+"\\s+-\\s+"+"("+t[$]+")"+"\\s*$";var _=n++;t[_]="^\\s*("+t[k]+")"+"\\s+-\\s+"+"("+t[k]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return U(this.major,e.major)||U(this.minor,e.minor)||U(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return U(t,n)}while(++r)};H.prototype.inc=function(e,r){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",r);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",r);break;case"prepatch":this.prerelease.length=0;this.inc("patch",r);this.inc("pre",r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",r);this.inc("pre",r);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var t=this.prerelease.length;while(--t>=0){if(typeof this.prerelease[t]==="number"){this.prerelease[t]++;t=-2}}if(t===-1)this.prerelease.push(0)}if(r){if(this.prerelease[0]===r){if(isNaN(this.prerelease[1]))this.prerelease=[r,0]}else this.prerelease=[r,0]}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t,n){if(typeof t==="string"){n=t;t=undefined}try{return new H(e,t).inc(r,n).version}catch(i){return null}}e.diff=K;function K(e,r){if(ar(e,r)){return null}else{var t=D(e);var n=D(r);if(t.prerelease.length||n.prerelease.length){for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return"pre"+i}}}return"prerelease"}for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return i}}}}}e.compareIdentifiers=U;var Q=/^[0-9]+$/;function U(e,r){var t=Q.test(e);var n=Q.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=W;function W(e,r){return U(r,e)}e.compare=Y;function Y(e,r,t){return new H(e,t).compare(r)}e.compareLoose=er;function er(e,r){return Y(e,r,true)}e.rcompare=rr;function rr(e,r,t){return Y(r,e,t)}e.sort=tr;function tr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=nr;function nr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=ir;function ir(e,r,t){return Y(e,r,t)>0}e.lt=sr;function sr(e,r,t){return Y(e,r,t)<0}e.eq=ar;function ar(e,r,t){return Y(e,r,t)===0}e.neq=or;function or(e,r,t){return Y(e,r,t)!==0}e.gte=fr;function fr(e,r,t){return Y(e,r,t)>=0}e.lte=ur;function ur(e,r,t){return Y(e,r,t)<=0}e.cmp=lr;function lr(e,r,t,n){var i;switch(r){case"===":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e===t;break;case"!==":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e!==t;break;case"":case"=":case"==":i=ar(e,t,n);break;case"!=":i=or(e,t,n);break;case">":i=ir(e,t,n);break;case">=":i=fr(e,t,n);break;case"<":i=sr(e,t,n);break;case"<=":i=ur(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=pr;function pr(e,r){if(e instanceof pr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof pr))return new pr(e,r);this.loose=r;this.parse(e);if(this.semver===cr)this.value="";else this.value=this.operator+this.semver.version}var cr={};pr.prototype.parse=function(e){var t=this.loose?r[P]:r[Z];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(this.operator==="=")this.operator="";if(!n[2])this.semver=cr;else this.semver=new H(n[2],this.loose)};pr.prototype.inspect=function(){return''};pr.prototype.toString=function(){return this.value};pr.prototype.test=function(e){if(this.semver===cr)return true;if(typeof e==="string")e=new H(e,this.loose);return lr(e,this.operator,this.semver,this.loose)};e.Range=hr;function hr(e,r){if(e instanceof hr&&e.loose===r)return e;if(!(this instanceof hr))return new hr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}hr.prototype.inspect=function(){return''};hr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};hr.prototype.toString=function(){return this.range};hr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[_]:r[X];e=e.replace(n,Er);e=e.replace(r[q],L);e=e.replace(r[S],V);e=e.replace(r[C],M);e=e.split(/\s+/).join(" ");var i=t?r[P]:r[Z];var s=e.split(" ").map(function(e){return mr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new pr(e,t)});return s};e.toComparators=vr;function vr(e,r){return new hr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function mr(e,r){e=yr(e,r);e=wr(e,r);e=br(e,r);e=kr(e,r);return e}function gr(e){return!e||e.toLowerCase()==="x"||e==="*"}function wr(e,r){return e.trim().split(/\s+/).map(function(e){return dr(e,r)}).join(" ")}function dr(e,t){var n=t?r[T]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(gr(r))s="";else if(gr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(gr(n))s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0";return s})}function yr(e,r){return e.trim().split(/\s+/).map(function(e){return jr(e,r)}).join(" ")}function jr(e,t){var n=t?r[N]:r[z];return e.replace(n,function(e,r,t,n,i){var s;if(gr(r))s="";else if(gr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(gr(n)){if(r==="0")s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else s=">="+r+"."+t+".0 <"+(+r+1)+".0.0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+i+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0"}else{if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+(+r+1)+".0.0"}return s})}function br(e,r){return e.split(/\s+/).map(function(e){return $r(e,r)}).join(" ")}function $r(e,t){e=e.trim();var n=t?r[x]:r[E];return e.replace(n,function(e,r,t,n,i,s){var a=gr(t);var o=a||gr(n);var f=o||gr(i);var u=f;if(r==="="&&u)r="";if(a){if(r===">"||r==="<"){e="<0.0.0"}else{e="*"}}else if(r&&u){if(o)n=0;if(f)i=0;if(r===">"){r=">=";if(o){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}else if(r==="<="){r="<";if(o)t=+t+1;else n=+n+1}e=r+t+"."+n+"."+i}else if(o){e=">="+t+".0.0 <"+(+t+1)+".0.0"}else if(f){e=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"}return e})}function kr(e,t){return e.trim().replace(r[O],"")}function Er(e,r,t,n,i,s,a,o,f,u,l,p,c){if(gr(t))r="";else if(gr(n))r=">="+t+".0.0";else if(gr(i))r=">="+t+"."+n+".0";else r=">="+r;if(gr(f))o="";else if(gr(u))o="<"+(+f+1)+".0.0";else if(gr(l))o="<"+f+"."+(+u+1)+".0";else if(p)o="<="+f+"."+u+"."+l+"-"+p;else o="<="+o;return(r+" "+o).trim()}hr.prototype.test=function(e){if(!e)return false;if(typeof e==="string")e=new H(e,this.loose);for(var r=0;r0){var n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return true}}return false}return true}e.satisfies=Rr;function Rr(e,r,t){try{r=new hr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Sr;function Sr(e,r,t){return e.filter(function(e){return Rr(e,r,t)}).sort(function(e,r){return rr(e,r,t)})[0]||null}e.validRange=Vr;function Vr(e,r){try{return new hr(e,r).range||"*"}catch(t){return null}}e.ltr=Ir;function Ir(e,r,t){return Ar(e,r,"<",t)}e.gtr=Tr;function Tr(e,r,t){return Ar(e,r,">",t)}e.outside=Ar;function Ar(e,r,t,n){e=new H(e,n);r=new hr(r,n);var i,s,a,o,f;switch(t){case">":i=ir;s=ur;a=sr;o=">";f=">=";break;case"<":i=sr;s=fr;a=ir;o="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Rr(e,r,n)){return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IxfgZvriXTF+BR1G`*~Wde-9{R}Wlbl|9tMh79-A*Q%9g#qkNr z76Mauz32Z%un@|sKKG9i_VJ?ry{ImWSr^e~)rfvbC~t2HndAwRO$z6%oA)X;?lCER@n3^b9X@nVs_p z6-WayBO5AI z1sY;XR!LV5riFxH8YGqf0|#@~LIKfwL~-7NtqFyBl-Ihm@7=?;xW2DUJs|kFtC#NA z;u{(UOUT)Z$$AT!JM!oTJX@0Dvu2Lt404EeAl~*gepqH02xaC2folp~}`c@@K z1Uob+9#&P_QxmXHRe$>e5Iz_PAJ!r45<-+Fv476lo`JMybXJR<1t*Q+B06{Se5RYP z2{m7-_Xx#lDqIhH)DfN%?o=HTs|`nhoFb$zAqNt2kV9_jGCp~e#tGcCqH9p3;WcJ{ z5H-Lh4agEesDT}$UF(T_;YV%`?Mh(jU6;bHO9#Tt6ONOrT@x@lKT5~?i(~MT{+1XY z1MCGHcwhxHz!q!)*By7lCisJOUW@Ct&q6<-Knuq6Gs-JqCML`TU{rHtVRq=?@Gp(0 z74-nVwKd5hmdi;A+io^vu#4tYHI5dlgfwk7y$v{}1W;sc^|ldHw>A+}Cu*|m&ChN1 mh&$WP6Mg=fy>6ZlX{!G)qQm>FPZ{$bZ1+DfhiyLSF8}~o4dA~3 literal 0 HcmV?d00001 diff --git a/node_modules/pg/node_modules/semver/test/amd.js b/node_modules/pg/node_modules/semver/test/amd.js new file mode 100644 index 0000000..a604134 --- /dev/null +++ b/node_modules/pg/node_modules/semver/test/amd.js @@ -0,0 +1,15 @@ +var tap = require('tap'); +var test = tap.test; + +test('amd', function(t) { + global.define = define; + define.amd = true; + var defined = null; + function define(stuff) { + defined = stuff; + } + var fromRequire = require('../'); + t.ok(defined, 'amd function called'); + t.equal(fromRequire, defined, 'amd stuff same as require stuff'); + t.end(); +}); diff --git a/node_modules/pg/node_modules/semver/test/clean.js b/node_modules/pg/node_modules/semver/test/clean.js new file mode 100644 index 0000000..9e268de --- /dev/null +++ b/node_modules/pg/node_modules/semver/test/clean.js @@ -0,0 +1,29 @@ +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var clean = semver.clean; + +test('\nclean tests', function(t) { + // [range, version] + // Version should be detectable despite extra characters + [ + ['1.2.3', '1.2.3'], + [' 1.2.3 ', '1.2.3'], + [' 1.2.3-4 ', '1.2.3-4'], + [' 1.2.3-pre ', '1.2.3-pre'], + [' =v1.2.3 ', '1.2.3'], + ['v1.2.3', '1.2.3'], + [' v1.2.3 ', '1.2.3'], + ['\t1.2.3', '1.2.3'], + ['>1.2.3', null], + ['~1.2.3', null], + ['<=1.2.3', null], + ['1.2.x', null] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var msg = 'clean(' + range + ') = ' + version; + t.equal(clean(range), version, msg); + }); + t.end(); +}); diff --git a/node_modules/pg/node_modules/semver/test/gtr.js b/node_modules/pg/node_modules/semver/test/gtr.js new file mode 100644 index 0000000..bbb8789 --- /dev/null +++ b/node_modules/pg/node_modules/semver/test/gtr.js @@ -0,0 +1,173 @@ +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var gtr = semver.gtr; + +test('\ngtr tests', function(t) { + // [range, version, loose] + // Version should be greater than range + [ + ['~1.2.2', '1.3.0'], + ['~0.6.1-1', '0.7.1-1'], + ['1.0.0 - 2.0.0', '2.0.1'], + ['1.0.0', '1.0.1-beta1'], + ['1.0.0', '2.0.0'], + ['<=2.0.0', '2.1.1'], + ['<=2.0.0', '3.2.9'], + ['<2.0.0', '2.0.0'], + ['0.1.20 || 1.2.4', '1.2.5'], + ['2.x.x', '3.0.0'], + ['1.2.x', '1.3.0'], + ['1.2.x || 2.x', '3.0.0'], + ['2.*.*', '5.0.1'], + ['1.2.*', '1.3.3'], + ['1.2.* || 2.*', '4.0.0'], + ['2', '3.0.0'], + ['2.3', '2.4.2'], + ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.5.5'], + ['~>3.2.1', '3.3.0'], // >=3.2.1 <3.3.0 + ['~1', '2.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '2.2.4'], + ['~> 1', '3.2.3'], + ['~1.0', '1.1.2'], // >=1.0.0 <1.1.0 + ['~ 1.0', '1.1.0'], + ['<1.2', '1.2.0'], + ['< 1.2', '1.2.1'], + ['1', '2.0.0beta', true], + ['~v0.5.4-pre', '0.6.0'], + ['~v0.5.4-pre', '0.6.1-pre'], + ['=0.7.x', '0.8.0'], + ['=0.7.x', '0.8.0-asdf'], + ['<0.7.x', '0.7.0'], + ['~1.2.2', '1.3.0'], + ['1.0.0 - 2.0.0', '2.2.3'], + ['1.0.0', '1.0.1'], + ['<=2.0.0', '3.0.0'], + ['<=2.0.0', '2.9999.9999'], + ['<=2.0.0', '2.2.9'], + ['<2.0.0', '2.9999.9999'], + ['<2.0.0', '2.2.9'], + ['2.x.x', '3.1.3'], + ['1.2.x', '1.3.3'], + ['1.2.x || 2.x', '3.1.3'], + ['2.*.*', '3.1.3'], + ['1.2.*', '1.3.3'], + ['1.2.* || 2.*', '3.1.3'], + ['2', '3.1.2'], + ['2.3', '2.4.1'], + ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 + ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 + ['~1', '2.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '2.2.3'], + ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 + ['<1', '1.0.0'], + ['1', '2.0.0beta', true], + ['<1', '1.0.0beta', true], + ['< 1', '1.0.0beta', true], + ['=0.7.x', '0.8.2'], + ['<0.7.x', '0.7.2'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = 'gtr(' + version + ', ' + range + ', ' + loose + ')'; + t.ok(gtr(version, range, loose), msg); + }); + t.end(); +}); + +test('\nnegative gtr tests', function(t) { + // [range, version, loose] + // Version should NOT be greater than range + [ + ['~0.6.1-1', '0.6.1-1'], + ['1.0.0 - 2.0.0', '1.2.3'], + ['1.0.0 - 2.0.0', '0.9.9'], + ['1.0.0', '1.0.0'], + ['>=*', '0.2.4'], + ['', '1.0.0', true], + ['*', '1.2.3'], + ['*', 'v1.2.3-foo'], + ['>=1.0.0', '1.0.0'], + ['>=1.0.0', '1.0.1'], + ['>=1.0.0', '1.1.0'], + ['>1.0.0', '1.0.1'], + ['>1.0.0', '1.1.0'], + ['<=2.0.0', '2.0.0'], + ['<=2.0.0', '1.9999.9999'], + ['<=2.0.0', '0.2.9'], + ['<2.0.0', '1.9999.9999'], + ['<2.0.0', '0.2.9'], + ['>= 1.0.0', '1.0.0'], + ['>= 1.0.0', '1.0.1'], + ['>= 1.0.0', '1.1.0'], + ['> 1.0.0', '1.0.1'], + ['> 1.0.0', '1.1.0'], + ['<= 2.0.0', '2.0.0'], + ['<= 2.0.0', '1.9999.9999'], + ['<= 2.0.0', '0.2.9'], + ['< 2.0.0', '1.9999.9999'], + ['<\t2.0.0', '0.2.9'], + ['>=0.1.97', 'v0.1.97'], + ['>=0.1.97', '0.1.97'], + ['0.1.20 || 1.2.4', '1.2.4'], + ['0.1.20 || >1.2.4', '1.2.4'], + ['0.1.20 || 1.2.4', '1.2.3'], + ['0.1.20 || 1.2.4', '0.1.20'], + ['>=0.2.3 || <0.0.1', '0.0.0'], + ['>=0.2.3 || <0.0.1', '0.2.3'], + ['>=0.2.3 || <0.0.1', '0.2.4'], + ['||', '1.3.4'], + ['2.x.x', '2.1.3'], + ['1.2.x', '1.2.3'], + ['1.2.x || 2.x', '2.1.3'], + ['1.2.x || 2.x', '1.2.3'], + ['x', '1.2.3'], + ['2.*.*', '2.1.3'], + ['1.2.*', '1.2.3'], + ['1.2.* || 2.*', '2.1.3'], + ['1.2.* || 2.*', '1.2.3'], + ['1.2.* || 2.*', '1.2.3'], + ['*', '1.2.3'], + ['2', '2.1.2'], + ['2.3', '2.3.1'], + ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.4.5'], + ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 + ['~1', '1.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '1.2.3'], + ['~> 1', '1.2.3'], + ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 + ['~ 1.0', '1.0.2'], + ['>=1', '1.0.0'], + ['>= 1', '1.0.0'], + ['<1.2', '1.1.1'], + ['< 1.2', '1.1.1'], + ['1', '1.0.0beta', true], + ['~v0.5.4-pre', '0.5.5'], + ['~v0.5.4-pre', '0.5.4'], + ['=0.7.x', '0.7.2'], + ['>=0.7.x', '0.7.2'], + ['=0.7.x', '0.7.0-asdf'], + ['>=0.7.x', '0.7.0-asdf'], + ['<=0.7.x', '0.6.2'], + ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], + ['>=0.2.3 <=0.2.4', '0.2.4'], + ['1.0.0 - 2.0.0', '2.0.0'], + ['^1', '0.0.0-0'], + ['^3.0.0', '2.0.0'], + ['^1.0.0 || ~2.0.1', '2.0.0'], + ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], + ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], + ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], + ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = '!gtr(' + version + ', ' + range + ', ' + loose + ')'; + t.notOk(gtr(version, range, loose), msg); + }); + t.end(); +}); diff --git a/node_modules/pg/node_modules/semver/test/index.js b/node_modules/pg/node_modules/semver/test/index.js new file mode 100644 index 0000000..1528bb7 --- /dev/null +++ b/node_modules/pg/node_modules/semver/test/index.js @@ -0,0 +1,682 @@ +'use strict'; + +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var eq = semver.eq; +var gt = semver.gt; +var lt = semver.lt; +var neq = semver.neq; +var cmp = semver.cmp; +var gte = semver.gte; +var lte = semver.lte; +var satisfies = semver.satisfies; +var validRange = semver.validRange; +var inc = semver.inc; +var diff = semver.diff; +var replaceStars = semver.replaceStars; +var toComparators = semver.toComparators; +var SemVer = semver.SemVer; +var Range = semver.Range; + +test('\ncomparison tests', function(t) { + // [version1, version2] + // version1 should be greater than version2 + [['0.0.0', '0.0.0-foo'], + ['0.0.1', '0.0.0'], + ['1.0.0', '0.9.9'], + ['0.10.0', '0.9.0'], + ['0.99.0', '0.10.0'], + ['2.0.0', '1.2.3'], + ['v0.0.0', '0.0.0-foo', true], + ['v0.0.1', '0.0.0', true], + ['v1.0.0', '0.9.9', true], + ['v0.10.0', '0.9.0', true], + ['v0.99.0', '0.10.0', true], + ['v2.0.0', '1.2.3', true], + ['0.0.0', 'v0.0.0-foo', true], + ['0.0.1', 'v0.0.0', true], + ['1.0.0', 'v0.9.9', true], + ['0.10.0', 'v0.9.0', true], + ['0.99.0', 'v0.10.0', true], + ['2.0.0', 'v1.2.3', true], + ['1.2.3', '1.2.3-asdf'], + ['1.2.3', '1.2.3-4'], + ['1.2.3', '1.2.3-4-foo'], + ['1.2.3-5-foo', '1.2.3-5'], + ['1.2.3-5', '1.2.3-4'], + ['1.2.3-5-foo', '1.2.3-5-Foo'], + ['3.0.0', '2.7.2+asdf'], + ['1.2.3-a.10', '1.2.3-a.5'], + ['1.2.3-a.b', '1.2.3-a.5'], + ['1.2.3-a.b', '1.2.3-a'], + ['1.2.3-a.b.c.10.d.5', '1.2.3-a.b.c.5.d.100'] + ].forEach(function(v) { + var v0 = v[0]; + var v1 = v[1]; + var loose = v[2]; + t.ok(gt(v0, v1, loose), "gt('" + v0 + "', '" + v1 + "')"); + t.ok(lt(v1, v0, loose), "lt('" + v1 + "', '" + v0 + "')"); + t.ok(!gt(v1, v0, loose), "!gt('" + v1 + "', '" + v0 + "')"); + t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); + t.ok(eq(v0, v0, loose), "eq('" + v0 + "', '" + v0 + "')"); + t.ok(eq(v1, v1, loose), "eq('" + v1 + "', '" + v1 + "')"); + t.ok(neq(v0, v1, loose), "neq('" + v0 + "', '" + v1 + "')"); + t.ok(cmp(v1, '==', v1, loose), "cmp('" + v1 + "' == '" + v1 + "')"); + t.ok(cmp(v0, '>=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')"); + t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')"); + t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')"); + }); + t.end(); +}); + +test('\nequality tests', function(t) { + // [version1, version2] + // version1 should be equivalent to version2 + [['1.2.3', 'v1.2.3', true], + ['1.2.3', '=1.2.3', true], + ['1.2.3', 'v 1.2.3', true], + ['1.2.3', '= 1.2.3', true], + ['1.2.3', ' v1.2.3', true], + ['1.2.3', ' =1.2.3', true], + ['1.2.3', ' v 1.2.3', true], + ['1.2.3', ' = 1.2.3', true], + ['1.2.3-0', 'v1.2.3-0', true], + ['1.2.3-0', '=1.2.3-0', true], + ['1.2.3-0', 'v 1.2.3-0', true], + ['1.2.3-0', '= 1.2.3-0', true], + ['1.2.3-0', ' v1.2.3-0', true], + ['1.2.3-0', ' =1.2.3-0', true], + ['1.2.3-0', ' v 1.2.3-0', true], + ['1.2.3-0', ' = 1.2.3-0', true], + ['1.2.3-1', 'v1.2.3-1', true], + ['1.2.3-1', '=1.2.3-1', true], + ['1.2.3-1', 'v 1.2.3-1', true], + ['1.2.3-1', '= 1.2.3-1', true], + ['1.2.3-1', ' v1.2.3-1', true], + ['1.2.3-1', ' =1.2.3-1', true], + ['1.2.3-1', ' v 1.2.3-1', true], + ['1.2.3-1', ' = 1.2.3-1', true], + ['1.2.3-beta', 'v1.2.3-beta', true], + ['1.2.3-beta', '=1.2.3-beta', true], + ['1.2.3-beta', 'v 1.2.3-beta', true], + ['1.2.3-beta', '= 1.2.3-beta', true], + ['1.2.3-beta', ' v1.2.3-beta', true], + ['1.2.3-beta', ' =1.2.3-beta', true], + ['1.2.3-beta', ' v 1.2.3-beta', true], + ['1.2.3-beta', ' = 1.2.3-beta', true], + ['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true], + ['1.2.3+build', ' = 1.2.3+otherbuild', true], + ['1.2.3-beta+build', '1.2.3-beta+otherbuild'], + ['1.2.3+build', '1.2.3+otherbuild'], + [' v1.2.3+build', '1.2.3+otherbuild'] + ].forEach(function(v) { + var v0 = v[0]; + var v1 = v[1]; + var loose = v[2]; + t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')"); + t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')"); + t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')'); + t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')'); + t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')'); + t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')'); + t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')"); + t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')"); + t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); + t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')"); + }); + t.end(); +}); + + +test('\nrange tests', function(t) { + // [range, version] + // version should be included by range + [['1.0.0 - 2.0.0', '1.2.3'], + ['^1.2.3+build', '1.2.3'], + ['^1.2.3+build', '1.3.0'], + ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3'], + ['1.2.3pre+asdf - 2.4.3-pre+asdf', '1.2.3', true], + ['1.2.3-pre+asdf - 2.4.3pre+asdf', '1.2.3', true], + ['1.2.3pre+asdf - 2.4.3pre+asdf', '1.2.3', true], + ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3-pre.2'], + ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '2.4.3-alpha'], + ['1.2.3+asdf - 2.4.3+asdf', '1.2.3'], + ['1.0.0', '1.0.0'], + ['>=*', '0.2.4'], + ['', '1.0.0'], + ['*', '1.2.3'], + ['*', 'v1.2.3-foo', true], + ['>=1.0.0', '1.0.0'], + ['>=1.0.0', '1.0.1'], + ['>=1.0.0', '1.1.0'], + ['>1.0.0', '1.0.1'], + ['>1.0.0', '1.1.0'], + ['<=2.0.0', '2.0.0'], + ['<=2.0.0', '1.9999.9999'], + ['<=2.0.0', '0.2.9'], + ['<2.0.0', '1.9999.9999'], + ['<2.0.0', '0.2.9'], + ['>= 1.0.0', '1.0.0'], + ['>= 1.0.0', '1.0.1'], + ['>= 1.0.0', '1.1.0'], + ['> 1.0.0', '1.0.1'], + ['> 1.0.0', '1.1.0'], + ['<= 2.0.0', '2.0.0'], + ['<= 2.0.0', '1.9999.9999'], + ['<= 2.0.0', '0.2.9'], + ['< 2.0.0', '1.9999.9999'], + ['<\t2.0.0', '0.2.9'], + ['>=0.1.97', 'v0.1.97', true], + ['>=0.1.97', '0.1.97'], + ['0.1.20 || 1.2.4', '1.2.4'], + ['>=0.2.3 || <0.0.1', '0.0.0'], + ['>=0.2.3 || <0.0.1', '0.2.3'], + ['>=0.2.3 || <0.0.1', '0.2.4'], + ['||', '1.3.4'], + ['2.x.x', '2.1.3'], + ['1.2.x', '1.2.3'], + ['1.2.x || 2.x', '2.1.3'], + ['1.2.x || 2.x', '1.2.3'], + ['x', '1.2.3'], + ['2.*.*', '2.1.3'], + ['1.2.*', '1.2.3'], + ['1.2.* || 2.*', '2.1.3'], + ['1.2.* || 2.*', '1.2.3'], + ['*', '1.2.3'], + ['2', '2.1.2'], + ['2.3', '2.3.1'], + ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.4.5'], + ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0, + ['~1', '1.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '1.2.3'], + ['~> 1', '1.2.3'], + ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0, + ['~ 1.0', '1.0.2'], + ['~ 1.0.3', '1.0.12'], + ['>=1', '1.0.0'], + ['>= 1', '1.0.0'], + ['<1.2', '1.1.1'], + ['< 1.2', '1.1.1'], + ['~v0.5.4-pre', '0.5.5'], + ['~v0.5.4-pre', '0.5.4'], + ['=0.7.x', '0.7.2'], + ['<=0.7.x', '0.7.2'], + ['>=0.7.x', '0.7.2'], + ['<=0.7.x', '0.6.2'], + ['~1.2.1 >=1.2.3', '1.2.3'], + ['~1.2.1 =1.2.3', '1.2.3'], + ['~1.2.1 1.2.3', '1.2.3'], + ['~1.2.1 >=1.2.3 1.2.3', '1.2.3'], + ['~1.2.1 1.2.3 >=1.2.3', '1.2.3'], + ['~1.2.1 1.2.3', '1.2.3'], + ['>=1.2.1 1.2.3', '1.2.3'], + ['1.2.3 >=1.2.1', '1.2.3'], + ['>=1.2.3 >=1.2.1', '1.2.3'], + ['>=1.2.1 >=1.2.3', '1.2.3'], + ['>=1.2', '1.2.8'], + ['^1.2.3', '1.8.1'], + ['^0.1.2', '0.1.2'], + ['^0.1', '0.1.2'], + ['^1.2', '1.4.2'], + ['^1.2 ^1', '1.4.2'], + ['^1.2.3-alpha', '1.2.3-pre'], + ['^1.2.0-alpha', '1.2.0-pre'], + ['^0.0.1-alpha', '0.0.1-beta'] + ].forEach(function(v) { + var range = v[0]; + var ver = v[1]; + var loose = v[2]; + t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver); + }); + t.end(); +}); + +test('\nnegative range tests', function(t) { + // [range, version] + // version should not be included by range + [['1.0.0 - 2.0.0', '2.2.3'], + ['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'], + ['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'], + ['^1.2.3+build', '2.0.0'], + ['^1.2.3+build', '1.2.0'], + ['^1.2.3', '1.2.3-pre'], + ['^1.2', '1.2.0-pre'], + ['>1.2', '1.3.0-beta'], + ['<=1.2.3', '1.2.3-beta'], + ['^1.2.3', '1.2.3-beta'], + ['=0.7.x', '0.7.0-asdf'], + ['>=0.7.x', '0.7.0-asdf'], + ['1', '1.0.0beta', true], + ['<1', '1.0.0beta', true], + ['< 1', '1.0.0beta', true], + ['1.0.0', '1.0.1'], + ['>=1.0.0', '0.0.0'], + ['>=1.0.0', '0.0.1'], + ['>=1.0.0', '0.1.0'], + ['>1.0.0', '0.0.1'], + ['>1.0.0', '0.1.0'], + ['<=2.0.0', '3.0.0'], + ['<=2.0.0', '2.9999.9999'], + ['<=2.0.0', '2.2.9'], + ['<2.0.0', '2.9999.9999'], + ['<2.0.0', '2.2.9'], + ['>=0.1.97', 'v0.1.93', true], + ['>=0.1.97', '0.1.93'], + ['0.1.20 || 1.2.4', '1.2.3'], + ['>=0.2.3 || <0.0.1', '0.0.3'], + ['>=0.2.3 || <0.0.1', '0.2.2'], + ['2.x.x', '1.1.3'], + ['2.x.x', '3.1.3'], + ['1.2.x', '1.3.3'], + ['1.2.x || 2.x', '3.1.3'], + ['1.2.x || 2.x', '1.1.3'], + ['2.*.*', '1.1.3'], + ['2.*.*', '3.1.3'], + ['1.2.*', '1.3.3'], + ['1.2.* || 2.*', '3.1.3'], + ['1.2.* || 2.*', '1.1.3'], + ['2', '1.1.2'], + ['2.3', '2.4.1'], + ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.3.9'], + ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 + ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 + ['~1', '0.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '2.2.3'], + ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 + ['<1', '1.0.0'], + ['>=1.2', '1.1.1'], + ['1', '2.0.0beta', true], + ['~v0.5.4-beta', '0.5.4-alpha'], + ['=0.7.x', '0.8.2'], + ['>=0.7.x', '0.6.2'], + ['<0.7.x', '0.7.2'], + ['<1.2.3', '1.2.3-beta'], + ['=1.2.3', '1.2.3-beta'], + ['>1.2', '1.2.8'], + ['^1.2.3', '2.0.0-alpha'], + ['^1.2.3', '1.2.2'], + ['^1.2', '1.1.9'], + // invalid ranges never satisfied! + ['blerg', '1.2.3'], + ['git+https://user:password0123@github.com/foo', '123.0.0', true], + ['^1.2.3', '2.0.0-pre'] + ].forEach(function(v) { + var range = v[0]; + var ver = v[1]; + var loose = v[2]; + var found = satisfies(ver, range, loose); + t.ok(!found, ver + ' not satisfied by ' + range); + }); + t.end(); +}); + +test('\nincrement versions test', function(t) { +// [version, inc, result, identifier] +// inc(version, inc) -> result + [['1.2.3', 'major', '2.0.0'], + ['1.2.3', 'minor', '1.3.0'], + ['1.2.3', 'patch', '1.2.4'], + ['1.2.3tag', 'major', '2.0.0', true], + ['1.2.3-tag', 'major', '2.0.0'], + ['1.2.3', 'fake', null], + ['1.2.0-0', 'patch', '1.2.0'], + ['fake', 'major', null], + ['1.2.3-4', 'major', '2.0.0'], + ['1.2.3-4', 'minor', '1.3.0'], + ['1.2.3-4', 'patch', '1.2.3'], + ['1.2.3-alpha.0.beta', 'major', '2.0.0'], + ['1.2.3-alpha.0.beta', 'minor', '1.3.0'], + ['1.2.3-alpha.0.beta', 'patch', '1.2.3'], + ['1.2.4', 'prerelease', '1.2.5-0'], + ['1.2.3-0', 'prerelease', '1.2.3-1'], + ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'], + ['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'], + ['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'], + ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'], + ['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'], + ['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'], + ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'], + ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'], + ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'], + ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'], + ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'], + ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'], + ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'], + ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'], + ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'], + ['1.2.0', 'prepatch', '1.2.1-0'], + ['1.2.0-1', 'prepatch', '1.2.1-0'], + ['1.2.0', 'preminor', '1.3.0-0'], + ['1.2.3-1', 'preminor', '1.3.0-0'], + ['1.2.0', 'premajor', '2.0.0-0'], + ['1.2.3-1', 'premajor', '2.0.0-0'], + ['1.2.0-1', 'minor', '1.2.0'], + ['1.0.0-1', 'major', '1.0.0'], + + ['1.2.3', 'major', '2.0.0', false, 'dev'], + ['1.2.3', 'minor', '1.3.0', false, 'dev'], + ['1.2.3', 'patch', '1.2.4', false, 'dev'], + ['1.2.3tag', 'major', '2.0.0', true, 'dev'], + ['1.2.3-tag', 'major', '2.0.0', false, 'dev'], + ['1.2.3', 'fake', null, false, 'dev'], + ['1.2.0-0', 'patch', '1.2.0', false, 'dev'], + ['fake', 'major', null, false, 'dev'], + ['1.2.3-4', 'major', '2.0.0', false, 'dev'], + ['1.2.3-4', 'minor', '1.3.0', false, 'dev'], + ['1.2.3-4', 'patch', '1.2.3', false, 'dev'], + ['1.2.3-alpha.0.beta', 'major', '2.0.0', false, 'dev'], + ['1.2.3-alpha.0.beta', 'minor', '1.3.0', false, 'dev'], + ['1.2.3-alpha.0.beta', 'patch', '1.2.3', false, 'dev'], + ['1.2.4', 'prerelease', '1.2.5-dev.0', false, 'dev'], + ['1.2.3-0', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1', false, 'alpha'], + ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta', false, 'alpha'], + ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta', false, 'alpha'], + ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta', false, 'alpha'], + ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta', false, 'alpha'], + ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1', false, 'alpha'], + ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2', false, 'alpha'], + ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3', false, 'alpha'], + ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'], + ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'], + ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'], + ['1.2.0', 'prepatch', '1.2.1-dev.0', 'dev'], + ['1.2.0-1', 'prepatch', '1.2.1-dev.0', 'dev'], + ['1.2.0', 'preminor', '1.3.0-dev.0', 'dev'], + ['1.2.3-1', 'preminor', '1.3.0-dev.0', 'dev'], + ['1.2.0', 'premajor', '2.0.0-dev.0', 'dev'], + ['1.2.3-1', 'premajor', '2.0.0-dev.0', 'dev'], + ['1.2.0-1', 'minor', '1.2.0', 'dev'], + ['1.0.0-1', 'major', '1.0.0', 'dev'], + ['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev'] + + ].forEach(function(v) { + var pre = v[0]; + var what = v[1]; + var wanted = v[2]; + var loose = v[3]; + var id = v[4]; + var found = inc(pre, what, loose, id); + var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')'; + t.equal(found, wanted, cmd + ' === ' + wanted); + }); + + t.end(); +}); + +test('\ndiff versions test', function(t) { +// [version1, version2, result] +// diff(version1, version2) -> result + [['1.2.3', '0.2.3', 'major'], + ['1.4.5', '0.2.3', 'major'], + ['1.2.3', '2.0.0-pre', 'premajor'], + ['1.2.3', '1.3.3', 'minor'], + ['1.0.1', '1.1.0-pre', 'preminor'], + ['1.2.3', '1.2.4', 'patch'], + ['1.2.3', '1.2.4-pre', 'prepatch'], + ['0.0.1', '0.0.1-pre', 'prerelease'], + ['0.0.1', '0.0.1-pre-2', 'prerelease'], + ['1.1.0', '1.1.0-pre', 'prerelease'], + ['1.1.0-pre-1', '1.1.0-pre-2', 'prerelease'], + ['1.0.0', '1.0.0', null] + + ].forEach(function(v) { + var version1 = v[0]; + var version2 = v[1]; + var wanted = v[2]; + var found = diff(version1, version2); + var cmd = 'diff(' + version1 + ', ' + version2 + ')'; + t.equal(found, wanted, cmd + ' === ' + wanted); + }); + + t.end(); +}); + +test('\nvalid range test', function(t) { + // [range, result] + // validRange(range) -> result + // translate ranges into their canonical form + [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'], + ['1.0.0', '1.0.0'], + ['>=*', '*'], + ['', '*'], + ['*', '*'], + ['*', '*'], + ['>=1.0.0', '>=1.0.0'], + ['>1.0.0', '>1.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['1', '>=1.0.0 <2.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['<2.0.0', '<2.0.0'], + ['<2.0.0', '<2.0.0'], + ['>= 1.0.0', '>=1.0.0'], + ['>= 1.0.0', '>=1.0.0'], + ['>= 1.0.0', '>=1.0.0'], + ['> 1.0.0', '>1.0.0'], + ['> 1.0.0', '>1.0.0'], + ['<= 2.0.0', '<=2.0.0'], + ['<= 2.0.0', '<=2.0.0'], + ['<= 2.0.0', '<=2.0.0'], + ['< 2.0.0', '<2.0.0'], + ['< 2.0.0', '<2.0.0'], + ['>=0.1.97', '>=0.1.97'], + ['>=0.1.97', '>=0.1.97'], + ['0.1.20 || 1.2.4', '0.1.20||1.2.4'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['||', '||'], + ['2.x.x', '>=2.0.0 <3.0.0'], + ['1.2.x', '>=1.2.0 <1.3.0'], + ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], + ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], + ['x', '*'], + ['2.*.*', '>=2.0.0 <3.0.0'], + ['1.2.*', '>=1.2.0 <1.3.0'], + ['1.2.* || 2.*', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], + ['*', '*'], + ['2', '>=2.0.0 <3.0.0'], + ['2.3', '>=2.3.0 <2.4.0'], + ['~2.4', '>=2.4.0 <2.5.0'], + ['~2.4', '>=2.4.0 <2.5.0'], + ['~>3.2.1', '>=3.2.1 <3.3.0'], + ['~1', '>=1.0.0 <2.0.0'], + ['~>1', '>=1.0.0 <2.0.0'], + ['~> 1', '>=1.0.0 <2.0.0'], + ['~1.0', '>=1.0.0 <1.1.0'], + ['~ 1.0', '>=1.0.0 <1.1.0'], + ['^0', '>=0.0.0 <1.0.0'], + ['^ 1', '>=1.0.0 <2.0.0'], + ['^0.1', '>=0.1.0 <0.2.0'], + ['^1.0', '>=1.0.0 <2.0.0'], + ['^1.2', '>=1.2.0 <2.0.0'], + ['^0.0.1', '>=0.0.1 <0.0.2'], + ['^0.0.1-beta', '>=0.0.1-beta <0.0.2'], + ['^0.1.2', '>=0.1.2 <0.2.0'], + ['^1.2.3', '>=1.2.3 <2.0.0'], + ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0'], + ['<1', '<1.0.0'], + ['< 1', '<1.0.0'], + ['>=1', '>=1.0.0'], + ['>= 1', '>=1.0.0'], + ['<1.2', '<1.2.0'], + ['< 1.2', '<1.2.0'], + ['1', '>=1.0.0 <2.0.0'], + ['>01.02.03', '>1.2.3', true], + ['>01.02.03', null], + ['~1.2.3beta', '>=1.2.3-beta <1.3.0', true], + ['~1.2.3beta', null], + ['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0'] + ].forEach(function(v) { + var pre = v[0]; + var wanted = v[1]; + var loose = v[2]; + var found = validRange(pre, loose); + + t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted); + }); + + t.end(); +}); + +test('\ncomparators test', function(t) { + // [range, comparators] + // turn range into a set of individual comparators + [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]], + ['1.0.0', [['1.0.0']]], + ['>=*', [['']]], + ['', [['']]], + ['*', [['']]], + ['*', [['']]], + ['>=1.0.0', [['>=1.0.0']]], + ['>=1.0.0', [['>=1.0.0']]], + ['>=1.0.0', [['>=1.0.0']]], + ['>1.0.0', [['>1.0.0']]], + ['>1.0.0', [['>1.0.0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['1', [['>=1.0.0', '<2.0.0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['<2.0.0', [['<2.0.0']]], + ['<2.0.0', [['<2.0.0']]], + ['>= 1.0.0', [['>=1.0.0']]], + ['>= 1.0.0', [['>=1.0.0']]], + ['>= 1.0.0', [['>=1.0.0']]], + ['> 1.0.0', [['>1.0.0']]], + ['> 1.0.0', [['>1.0.0']]], + ['<= 2.0.0', [['<=2.0.0']]], + ['<= 2.0.0', [['<=2.0.0']]], + ['<= 2.0.0', [['<=2.0.0']]], + ['< 2.0.0', [['<2.0.0']]], + ['<\t2.0.0', [['<2.0.0']]], + ['>=0.1.97', [['>=0.1.97']]], + ['>=0.1.97', [['>=0.1.97']]], + ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['||', [[''], ['']]], + ['2.x.x', [['>=2.0.0', '<3.0.0']]], + ['1.2.x', [['>=1.2.0', '<1.3.0']]], + ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['x', [['']]], + ['2.*.*', [['>=2.0.0', '<3.0.0']]], + ['1.2.*', [['>=1.2.0', '<1.3.0']]], + ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['*', [['']]], + ['2', [['>=2.0.0', '<3.0.0']]], + ['2.3', [['>=2.3.0', '<2.4.0']]], + ['~2.4', [['>=2.4.0', '<2.5.0']]], + ['~2.4', [['>=2.4.0', '<2.5.0']]], + ['~>3.2.1', [['>=3.2.1', '<3.3.0']]], + ['~1', [['>=1.0.0', '<2.0.0']]], + ['~>1', [['>=1.0.0', '<2.0.0']]], + ['~> 1', [['>=1.0.0', '<2.0.0']]], + ['~1.0', [['>=1.0.0', '<1.1.0']]], + ['~ 1.0', [['>=1.0.0', '<1.1.0']]], + ['~ 1.0.3', [['>=1.0.3', '<1.1.0']]], + ['~> 1.0.3', [['>=1.0.3', '<1.1.0']]], + ['<1', [['<1.0.0']]], + ['< 1', [['<1.0.0']]], + ['>=1', [['>=1.0.0']]], + ['>= 1', [['>=1.0.0']]], + ['<1.2', [['<1.2.0']]], + ['< 1.2', [['<1.2.0']]], + ['1', [['>=1.0.0', '<2.0.0']]], + ['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]], + ['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]], + ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]], + ['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]], + ['>*', [['<0.0.0']]], + ['<*', [['<0.0.0']]] + ].forEach(function(v) { + var pre = v[0]; + var wanted = v[1]; + var found = toComparators(v[0]); + var jw = JSON.stringify(wanted); + t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw); + }); + + t.end(); +}); + +test('\ninvalid version numbers', function(t) { + ['1.2.3.4', + 'NOT VALID', + 1.2, + null, + 'Infinity.NaN.Infinity' + ].forEach(function(v) { + t.throws(function() { + new SemVer(v); + }, {name:'TypeError', message:'Invalid Version: ' + v}); + }); + + t.end(); +}); + +test('\nstrict vs loose version numbers', function(t) { + [['=1.2.3', '1.2.3'], + ['01.02.03', '1.2.3'], + ['1.2.3-beta.01', '1.2.3-beta.1'], + [' =1.2.3', '1.2.3'], + ['1.2.3foo', '1.2.3-foo'] + ].forEach(function(v) { + var loose = v[0]; + var strict = v[1]; + t.throws(function() { + new SemVer(loose); + }); + var lv = new SemVer(loose, true); + t.equal(lv.version, strict); + t.ok(eq(loose, strict, true)); + t.throws(function() { + eq(loose, strict); + }); + t.throws(function() { + new SemVer(strict).compare(loose); + }); + }); + t.end(); +}); + +test('\nstrict vs loose ranges', function(t) { + [['>=01.02.03', '>=1.2.3'], + ['~1.02.03beta', '>=1.2.3-beta <1.3.0'] + ].forEach(function(v) { + var loose = v[0]; + var comps = v[1]; + t.throws(function() { + new Range(loose); + }); + t.equal(new Range(loose, true).range, comps); + }); + t.end(); +}); + +test('\nmax satisfying', function(t) { + [[['1.2.3', '1.2.4'], '1.2', '1.2.4'], + [['1.2.4', '1.2.3'], '1.2', '1.2.4'], + [['1.2.3', '1.2.4', '1.2.5', '1.2.6'], '~1.2.3', '1.2.6'], + [['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true] + ].forEach(function(v) { + var versions = v[0]; + var range = v[1]; + var expect = v[2]; + var loose = v[3]; + var actual = semver.maxSatisfying(versions, range, loose); + t.equal(actual, expect); + }); + t.end(); +}); diff --git a/node_modules/pg/node_modules/semver/test/ltr.js b/node_modules/pg/node_modules/semver/test/ltr.js new file mode 100644 index 0000000..ecd1387 --- /dev/null +++ b/node_modules/pg/node_modules/semver/test/ltr.js @@ -0,0 +1,181 @@ +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var ltr = semver.ltr; + +test('\nltr tests', function(t) { + // [range, version, loose] + // Version should be less than range + [ + ['~1.2.2', '1.2.1'], + ['~0.6.1-1', '0.6.1-0'], + ['1.0.0 - 2.0.0', '0.0.1'], + ['1.0.0-beta.2', '1.0.0-beta.1'], + ['1.0.0', '0.0.0'], + ['>=2.0.0', '1.1.1'], + ['>=2.0.0', '1.2.9'], + ['>2.0.0', '2.0.0'], + ['0.1.20 || 1.2.4', '0.1.5'], + ['2.x.x', '1.0.0'], + ['1.2.x', '1.1.0'], + ['1.2.x || 2.x', '1.0.0'], + ['2.*.*', '1.0.1'], + ['1.2.*', '1.1.3'], + ['1.2.* || 2.*', '1.1.9999'], + ['2', '1.0.0'], + ['2.3', '2.2.2'], + ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.3.5'], + ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 + ['~1', '0.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '0.2.4'], + ['~> 1', '0.2.3'], + ['~1.0', '0.1.2'], // >=1.0.0 <1.1.0 + ['~ 1.0', '0.1.0'], + ['>1.2', '1.2.0'], + ['> 1.2', '1.2.1'], + ['1', '0.0.0beta', true], + ['~v0.5.4-pre', '0.5.4-alpha'], + ['~v0.5.4-pre', '0.5.4-alpha'], + ['=0.7.x', '0.6.0'], + ['=0.7.x', '0.6.0-asdf'], + ['>=0.7.x', '0.6.0'], + ['~1.2.2', '1.2.1'], + ['1.0.0 - 2.0.0', '0.2.3'], + ['1.0.0', '0.0.1'], + ['>=2.0.0', '1.0.0'], + ['>=2.0.0', '1.9999.9999'], + ['>=2.0.0', '1.2.9'], + ['>2.0.0', '2.0.0'], + ['>2.0.0', '1.2.9'], + ['2.x.x', '1.1.3'], + ['1.2.x', '1.1.3'], + ['1.2.x || 2.x', '1.1.3'], + ['2.*.*', '1.1.3'], + ['1.2.*', '1.1.3'], + ['1.2.* || 2.*', '1.1.3'], + ['2', '1.9999.9999'], + ['2.3', '2.2.1'], + ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 + ['~>3.2.1', '2.3.2'], // >=3.2.1 <3.3.0 + ['~1', '0.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '0.2.3'], + ['~1.0', '0.0.0'], // >=1.0.0 <1.1.0 + ['>1', '1.0.0'], + ['2', '1.0.0beta', true], + ['>1', '1.0.0beta', true], + ['> 1', '1.0.0beta', true], + ['=0.7.x', '0.6.2'], + ['=0.7.x', '0.7.0-asdf'], + ['^1', '1.0.0-0'], + ['>=0.7.x', '0.7.0-asdf'], + ['1', '1.0.0beta', true], + ['>=0.7.x', '0.6.2'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = 'ltr(' + version + ', ' + range + ', ' + loose + ')'; + t.ok(ltr(version, range, loose), msg); + }); + t.end(); +}); + +test('\nnegative ltr tests', function(t) { + // [range, version, loose] + // Version should NOT be greater than range + [ + ['~ 1.0', '1.1.0'], + ['~0.6.1-1', '0.6.1-1'], + ['1.0.0 - 2.0.0', '1.2.3'], + ['1.0.0 - 2.0.0', '2.9.9'], + ['1.0.0', '1.0.0'], + ['>=*', '0.2.4'], + ['', '1.0.0', true], + ['*', '1.2.3'], + ['*', 'v1.2.3-foo'], + ['>=1.0.0', '1.0.0'], + ['>=1.0.0', '1.0.1'], + ['>=1.0.0', '1.1.0'], + ['>1.0.0', '1.0.1'], + ['>1.0.0', '1.1.0'], + ['<=2.0.0', '2.0.0'], + ['<=2.0.0', '1.9999.9999'], + ['<=2.0.0', '0.2.9'], + ['<2.0.0', '1.9999.9999'], + ['<2.0.0', '0.2.9'], + ['>= 1.0.0', '1.0.0'], + ['>= 1.0.0', '1.0.1'], + ['>= 1.0.0', '1.1.0'], + ['> 1.0.0', '1.0.1'], + ['> 1.0.0', '1.1.0'], + ['<= 2.0.0', '2.0.0'], + ['<= 2.0.0', '1.9999.9999'], + ['<= 2.0.0', '0.2.9'], + ['< 2.0.0', '1.9999.9999'], + ['<\t2.0.0', '0.2.9'], + ['>=0.1.97', 'v0.1.97'], + ['>=0.1.97', '0.1.97'], + ['0.1.20 || 1.2.4', '1.2.4'], + ['0.1.20 || >1.2.4', '1.2.4'], + ['0.1.20 || 1.2.4', '1.2.3'], + ['0.1.20 || 1.2.4', '0.1.20'], + ['>=0.2.3 || <0.0.1', '0.0.0'], + ['>=0.2.3 || <0.0.1', '0.2.3'], + ['>=0.2.3 || <0.0.1', '0.2.4'], + ['||', '1.3.4'], + ['2.x.x', '2.1.3'], + ['1.2.x', '1.2.3'], + ['1.2.x || 2.x', '2.1.3'], + ['1.2.x || 2.x', '1.2.3'], + ['x', '1.2.3'], + ['2.*.*', '2.1.3'], + ['1.2.*', '1.2.3'], + ['1.2.* || 2.*', '2.1.3'], + ['1.2.* || 2.*', '1.2.3'], + ['1.2.* || 2.*', '1.2.3'], + ['*', '1.2.3'], + ['2', '2.1.2'], + ['2.3', '2.3.1'], + ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.4.5'], + ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 + ['~1', '1.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '1.2.3'], + ['~> 1', '1.2.3'], + ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 + ['~ 1.0', '1.0.2'], + ['>=1', '1.0.0'], + ['>= 1', '1.0.0'], + ['<1.2', '1.1.1'], + ['< 1.2', '1.1.1'], + ['~v0.5.4-pre', '0.5.5'], + ['~v0.5.4-pre', '0.5.4'], + ['=0.7.x', '0.7.2'], + ['>=0.7.x', '0.7.2'], + ['<=0.7.x', '0.6.2'], + ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], + ['>=0.2.3 <=0.2.4', '0.2.4'], + ['1.0.0 - 2.0.0', '2.0.0'], + ['^3.0.0', '4.0.0'], + ['^1.0.0 || ~2.0.1', '2.0.0'], + ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], + ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], + ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], + ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'], + ['^1.0.0alpha', '1.0.0beta', true], + ['~1.0.0alpha', '1.0.0beta', true], + ['^1.0.0-alpha', '1.0.0beta', true], + ['~1.0.0-alpha', '1.0.0beta', true], + ['^1.0.0-alpha', '1.0.0-beta'], + ['~1.0.0-alpha', '1.0.0-beta'], + ['=0.1.0', '1.0.0'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = '!ltr(' + version + ', ' + range + ', ' + loose + ')'; + t.notOk(ltr(version, range, loose), msg); + }); + t.end(); +}); diff --git a/node_modules/pg/node_modules/semver/test/no-module.js b/node_modules/pg/node_modules/semver/test/no-module.js new file mode 100644 index 0000000..8b50873 --- /dev/null +++ b/node_modules/pg/node_modules/semver/test/no-module.js @@ -0,0 +1,19 @@ +var tap = require('tap'); +var test = tap.test; + +test('no module system', function(t) { + var fs = require('fs'); + var vm = require('vm'); + var head = fs.readFileSync(require.resolve('../head.js.txt'), 'utf8'); + var src = fs.readFileSync(require.resolve('../'), 'utf8'); + var foot = fs.readFileSync(require.resolve('../foot.js.txt'), 'utf8'); + vm.runInThisContext(head + src + foot, 'semver.js'); + + // just some basic poking to see if it did some stuff + t.type(global.semver, 'object'); + t.type(global.semver.SemVer, 'function'); + t.type(global.semver.Range, 'function'); + t.ok(global.semver.satisfies('1.2.3', '1.2')); + t.end(); +}); + diff --git a/node_modules/pg/package.json b/node_modules/pg/package.json index 564942c..20d1e75 100644 --- a/node_modules/pg/package.json +++ b/node_modules/pg/package.json @@ -1,6 +1,6 @@ { "name": "pg", - "version": "3.6.3", + "version": "4.2.0", "description": "PostgreSQL client - pure javascript & libpq with the same API", "keywords": [ "postgres", @@ -21,35 +21,35 @@ }, "main": "./lib", "dependencies": { - "bindings": "1.2.1", "buffer-writer": "1.0.0", "generic-pool": "2.1.1", - "nan": "1.3.0", "packet-reader": "0.2.0", "pg-connection-string": "0.1.3", "pg-types": "1.6.0", - "pgpass": "0.0.3" + "pgpass": "0.0.3", + "semver": "^4.1.0" }, "devDependencies": { + "async": "0.9.0", "jshint": "2.5.2", - "semver": "~3.0.1", - "async": "0.9.0" + "pg-copy-streams": "0.3.0" }, + "minNativeVersion": "1.7.0", "scripts": { "changelog": "npm i github-changes && ./node_modules/.bin/github-changes -o brianc -r node-postgres -d pulls -a -v", - "test": "make test-travis connectionString=postgres://postgres@localhost:5432/postgres", - "install": "node-gyp rebuild || (exit 0)" + "test": "make test-all connectionString=postgres://postgres@localhost:5432/postgres" }, "engines": { "node": ">= 0.8.0" }, + "gitHead": "44eaaf68a49b457cd7d7d6acad5ee741db2589ad", "bugs": { "url": "https://github.com/brianc/node-postgres/issues" }, - "_id": "pg@3.6.3", - "_shasum": "8a079c8647953738eb8e48c0366142051563ef4a", - "_from": "pg@3.6.3", - "_npmVersion": "1.4.9", + "_id": "pg@4.2.0", + "_shasum": "c225862d0aad4f4710f62e64882409a717a5dc62", + "_from": "pg@4.2.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "brianc", "email": "brian.m.carlson@gmail.com" @@ -61,9 +61,10 @@ } ], "dist": { - "shasum": "8a079c8647953738eb8e48c0366142051563ef4a", - "tarball": "http://registry.npmjs.org/pg/-/pg-3.6.3.tgz" + "shasum": "c225862d0aad4f4710f62e64882409a717a5dc62", + "tarball": "http://registry.npmjs.org/pg/-/pg-4.2.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/pg/-/pg-3.6.3.tgz" + "_resolved": "https://registry.npmjs.org/pg/-/pg-4.2.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/node_modules/pg/src/binding.cc b/node_modules/pg/src/binding.cc deleted file mode 100644 index c2757c6..0000000 --- a/node_modules/pg/src/binding.cc +++ /dev/null @@ -1,957 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define LOG(msg) printf("%s\n",msg); -#define TRACE(msg) //printf("%s\n", msg); - -#if PG_VERSION_NUM >= 90000 -#define ESCAPE_SUPPORTED -#endif - -#if PG_VERSION_NUM >= 90200 -#define SINGLE_ROW_SUPPORTED -#endif - -#define THROW(msg) NanThrowError(msg); NanReturnUndefined(); - -using namespace v8; -using namespace node; - -class Connection : public ObjectWrap { - -public: - - //creates the V8 objects & attaches them to the module (target) - static void - Init (Handle target) - { - NanScope(); - Local t = NanNew(New); - - t->InstanceTemplate()->SetInternalFieldCount(1); - t->SetClassName(NanNew("Connection")); - - NanSetPrototypeTemplate(t, "connect", NanNew(Connect)); -#ifdef ESCAPE_SUPPORTED - NanSetPrototypeTemplate(t, "escapeIdentifier", NanNew(EscapeIdentifier)); - NanSetPrototypeTemplate(t, "escapeLiteral", NanNew(EscapeLiteral)); -#endif - NanSetPrototypeTemplate(t, "_sendQuery", NanNew(SendQuery)); - NanSetPrototypeTemplate(t, "_sendQueryWithParams", NanNew(SendQueryWithParams)); - NanSetPrototypeTemplate(t, "_sendPrepare", NanNew(SendPrepare)); - NanSetPrototypeTemplate(t, "_sendQueryPrepared", NanNew(SendQueryPrepared)); - NanSetPrototypeTemplate(t, "cancel", NanNew(Cancel)); - NanSetPrototypeTemplate(t, "end", NanNew(End)); - NanSetPrototypeTemplate(t, "_sendCopyFromChunk", NanNew(SendCopyFromChunk)); - NanSetPrototypeTemplate(t, "_endCopyFrom", NanNew(EndCopyFrom)); - target->Set(NanNew("Connection"), t->GetFunction()); - TRACE("created class"); - } - - //static function called by libuv as callback entrypoint - static void - io_event(uv_poll_t* w, int status, int revents) - { - - TRACE("Received IO event"); - - if(status == -1) { - TRACE("Connection error. -1 status from lib_uv_poll"); - } - - Connection *connection = static_cast(w->data); - connection->HandleIOEvent(revents); - } - - //v8 entry point into Connection#connect - static NAN_METHOD(Connect) - { - NanScope(); - Connection *self = ObjectWrap::Unwrap(args.This()); - if(args.Length() == 0 || !args[0]->IsString()) { - THROW("Must include connection string as only argument to connect"); - } - - String::Utf8Value conninfo(args[0]->ToString()); - bool success = self->Connect(*conninfo); - if(!success) { - self -> EmitLastError(); - self -> DestroyConnection(); - } - - NanReturnUndefined(); - } - - //v8 entry point into Connection#cancel - static NAN_METHOD(Cancel) - { - NanScope(); - Connection *self = ObjectWrap::Unwrap(args.This()); - - bool success = self->Cancel(); - if(!success) { - self -> EmitLastError(); - self -> DestroyConnection(); - } - - NanReturnUndefined(); - } - -#ifdef ESCAPE_SUPPORTED - //v8 entry point into Connection#escapeIdentifier - static NAN_METHOD(EscapeIdentifier) - { - NanScope(); - Connection *self = ObjectWrap::Unwrap(args.This()); - - char* inputStr = MallocCString(args[0]); - - if(!inputStr) { - THROW("Unable to allocate memory for a string in EscapeIdentifier.") - } - - char* escapedStr = self->EscapeIdentifier(inputStr); - free(inputStr); - - if(escapedStr == NULL) { - THROW(self->GetLastError()); - } - - Local jsStr = NanNew(escapedStr, strlen(escapedStr)); - PQfreemem(escapedStr); - - NanReturnValue(jsStr); - } - - //v8 entry point into Connection#escapeLiteral - static NAN_METHOD(EscapeLiteral) - { - NanScope(); - Connection *self = ObjectWrap::Unwrap(args.This()); - - char* inputStr = MallocCString(args[0]); - - if(!inputStr) { - THROW("Unable to allocate memory for a string in EscapeIdentifier.") - } - - char* escapedStr = self->EscapeLiteral(inputStr); - free(inputStr); - - if(escapedStr == NULL) { - THROW(self->GetLastError()); - } - - Local jsStr = NanNew(escapedStr, strlen(escapedStr)); - PQfreemem(escapedStr); - - NanReturnValue(jsStr); - } -#endif - - //v8 entry point into Connection#_sendQuery - static NAN_METHOD(SendQuery) - { - NanScope(); - Connection *self = ObjectWrap::Unwrap(args.This()); - const char *lastErrorMessage; - if(!args[0]->IsString()) { - THROW("First parameter must be a string query"); - } - - char* queryText = MallocCString(args[0]); - bool singleRowMode = (bool)args[1]->Int32Value(); - - int result = self->Send(queryText, singleRowMode); - free(queryText); - if(result == 0) { - lastErrorMessage = self->GetLastError(); - THROW(lastErrorMessage); - } - //TODO should we flush before throw? - self->Flush(); - NanReturnUndefined(); - } - - //v8 entry point into Connection#_sendQueryWithParams - static NAN_METHOD(SendQueryWithParams) - { - NanScope(); - //dispatch non-prepared parameterized query - DispatchParameterizedQuery(args, false); - NanReturnUndefined(); - } - - //v8 entry point into Connection#_sendPrepare(string queryName, string queryText, int nParams) - static NAN_METHOD(SendPrepare) - { - NanScope(); - - Connection *self = ObjectWrap::Unwrap(args.This()); - String::Utf8Value queryName(args[0]); - String::Utf8Value queryText(args[1]); - int length = args[2]->Int32Value(); - bool singleRowMode = (bool)args[3]->Int32Value(); - self->SendPrepare(*queryName, *queryText, length, singleRowMode); - - NanReturnUndefined(); - } - - //v8 entry point into Connection#_sendQueryPrepared(string queryName, string[] paramValues) - static NAN_METHOD(SendQueryPrepared) - { - NanScope(); - //dispatch prepared parameterized query - DispatchParameterizedQuery(args, true); - NanReturnUndefined(); - } - - static void DispatchParameterizedQuery(_NAN_METHOD_ARGS, bool isPrepared) - { - NanScope(); - Connection *self = ObjectWrap::Unwrap(args.This()); - - String::Utf8Value queryName(args[0]); - //TODO this is much copy/pasta code - if(!args[0]->IsString()) { - NanThrowError("First parameter must be a string"); - return; - } - - if(!args[1]->IsArray()) { - NanThrowError("Values must be an array"); - return; - } - - Local jsParams = Local::Cast(args[1]); - int len = jsParams->Length(); - - - char** paramValues = ArgToCStringArray(jsParams); - if(!paramValues) { - NanThrowError("Unable to allocate char **paramValues from Local of v8 params"); - return; - } - - char* queryText = MallocCString(args[0]); - bool singleRowMode = (bool)args[2]->Int32Value(); - - int result = 0; - if(isPrepared) { - result = self->SendPreparedQuery(queryText, len, paramValues, singleRowMode); - } else { - result = self->SendQueryParams(queryText, len, paramValues, singleRowMode); - } - - free(queryText); - ReleaseCStringArray(paramValues, len); - if(result == 1) { - return; - } - self->EmitLastError(); - NanThrowError("Postgres returned non-1 result from query dispatch."); - } - - //v8 entry point into Connection#end - static NAN_METHOD(End) - { - NanScope(); - - Connection *self = ObjectWrap::Unwrap(args.This()); - - self->End(); - NanReturnUndefined(); - } - - uv_poll_t read_watcher_; - uv_poll_t write_watcher_; - PGconn *connection_; - bool connecting_; - bool ioInitialized_; - bool copyOutMode_; - bool copyInMode_; - bool reading_; - bool writing_; - bool ended_; - Connection () : ObjectWrap () - { - connection_ = NULL; - connecting_ = false; - ioInitialized_ = false; - copyOutMode_ = false; - copyInMode_ = false; - reading_ = false; - writing_ = false; - ended_ = false; - TRACE("Initializing ev watchers"); - read_watcher_.data = this; - write_watcher_.data = this; - } - - ~Connection () - { - } - - static NAN_METHOD(SendCopyFromChunk) { - NanScope(); - Connection *self = ObjectWrap::Unwrap(args.This()); - //TODO handle errors in some way - if (args.Length() < 1 && !Buffer::HasInstance(args[0])) { - THROW("SendCopyFromChunk requires 1 Buffer argument"); - } - self->SendCopyFromChunk(args[0]->ToObject()); - NanReturnUndefined(); - } - static NAN_METHOD(EndCopyFrom) { - NanScope(); - Connection *self = ObjectWrap::Unwrap(args.This()); - char * error_msg = NULL; - if (args[0]->IsString()) { - error_msg = MallocCString(args[0]); - } - //TODO handle errors in some way - self->EndCopyFrom(error_msg); - free(error_msg); - NanReturnUndefined(); - } - -protected: - //v8 entry point to constructor - static NAN_METHOD(New) - { - NanScope(); - Connection *connection = new Connection(); - connection->Wrap(args.This()); - - NanReturnValue(args.This()); - } - -#ifdef ESCAPE_SUPPORTED - char * EscapeIdentifier(const char *str) - { - TRACE("js::EscapeIdentifier") - return PQescapeIdentifier(connection_, str, strlen(str)); - } - - char * EscapeLiteral(const char *str) - { - TRACE("js::EscapeLiteral") - return PQescapeLiteral(connection_, str, strlen(str)); - } -#endif - - void enableSingleRowMode(bool enable) - { -#ifdef SINGLE_ROW_SUPPORTED - if(enable == true) { - int mode = PQsetSingleRowMode(connection_); - if(mode == 1) { - TRACE("PQsetSingleRowMode enabled") - } else { - TRACE("PQsetSingleRowMode disabled") - } - } else { - TRACE("PQsetSingleRowMode disabled") - } -#endif - } - - int Send(const char *queryText, bool singleRowMode) - { - TRACE("js::Send") - int rv = PQsendQuery(connection_, queryText); - enableSingleRowMode(singleRowMode); - StartWrite(); - return rv; - } - - int SendQueryParams(const char *command, const int nParams, const char * const *paramValues, bool singleRowMode) - { - TRACE("js::SendQueryParams") - int rv = PQsendQueryParams(connection_, command, nParams, NULL, paramValues, NULL, NULL, 0); - enableSingleRowMode(singleRowMode); - StartWrite(); - return rv; - } - - int SendPrepare(const char *name, const char *command, const int nParams, bool singleRowMode) - { - TRACE("js::SendPrepare") - int rv = PQsendPrepare(connection_, name, command, nParams, NULL); - enableSingleRowMode(singleRowMode); - StartWrite(); - return rv; - } - - int SendPreparedQuery(const char *name, int nParams, const char * const *paramValues, bool singleRowMode) - { - int rv = PQsendQueryPrepared(connection_, name, nParams, paramValues, NULL, NULL, 0); - enableSingleRowMode(singleRowMode); - StartWrite(); - return rv; - } - - bool Cancel() - { - PGcancel* pgCancel = PQgetCancel(connection_); - char errbuf[256]; - int result = PQcancel(pgCancel, errbuf, 256); - StartWrite(); - PQfreeCancel(pgCancel); - return result; - } - - //flushes socket - void Flush() - { - if(PQflush(connection_) == 1) { - TRACE("Flushing"); - uv_poll_start(&write_watcher_, UV_WRITABLE, io_event); - } - } - - //safely destroys the connection at most 1 time - void DestroyConnection() - { - if(connection_ != NULL) { - PQfinish(connection_); - connection_ = NULL; - } - } - - //initializes initial async connection to postgres via libpq - //and hands off control to libev - bool Connect(const char* conninfo) - { - if(ended_) return true; - connection_ = PQconnectStart(conninfo); - - if (!connection_) { - LOG("Connection couldn't be created"); - } - - ConnStatusType status = PQstatus(connection_); - - if(CONNECTION_BAD == status) { - return false; - } - - if (PQsetnonblocking(connection_, 1) == -1) { - LOG("Unable to set connection to non-blocking"); - return false; - } - - int fd = PQsocket(connection_); - if(fd < 0) { - LOG("socket fd was negative. error"); - return false; - } - - assert(PQisnonblocking(connection_)); - - PQsetNoticeProcessor(connection_, NoticeReceiver, this); - - TRACE("Setting watchers to socket"); - uv_poll_init(uv_default_loop(), &read_watcher_, fd); - uv_poll_init(uv_default_loop(), &write_watcher_, fd); - - ioInitialized_ = true; - - connecting_ = true; - StartWrite(); - - Ref(); - return true; - } - - static void NoticeReceiver(void *arg, const char *message) - { - Connection *self = (Connection*)arg; - self->HandleNotice(message); - } - - void HandleNotice(const char *message) - { - NanScope(); - Handle notice = NanNew(message); - Emit("notice", ¬ice); - } - - //called to process io_events from libuv - void HandleIOEvent(int revents) - { - - if(connecting_) { - TRACE("Processing connecting_ io"); - HandleConnectionIO(); - return; - } - - if(revents & UV_READABLE) { - TRACE("revents & UV_READABLE"); - TRACE("about to consume input"); - if(PQconsumeInput(connection_) == 0) { - TRACE("could not read, terminating"); - End(); - EmitLastError(); - //LOG("Something happened, consume input is 0"); - return; - } - TRACE("Consumed"); - - //declare handlescope as this method is entered via a libuv callback - //and not part of the public v8 interface - NanScope(); - if (this->copyOutMode_) { - this->HandleCopyOut(); - } - if (!this->copyInMode_ && !this->copyOutMode_ && PQisBusy(connection_) == 0) { - PGresult *result; - bool didHandleResult = false; - TRACE("PQgetResult"); - while ((result = PQgetResult(connection_))) { - TRACE("HandleResult"); - didHandleResult = HandleResult(result); - TRACE("PQClear"); - PQclear(result); - if(!didHandleResult) { - //this means that we are in copy in or copy out mode - //in this situation PQgetResult will return same - //result untill all data will be read (copy out) or - //until data end notification (copy in) - //and because of this, we need to break cycle - break; - } - } - //might have fired from notification - if(didHandleResult) { - Emit("_readyForQuery"); - } - } - - PGnotify *notify; - TRACE("PQnotifies"); - while ((notify = PQnotifies(connection_))) { - Local result = NanNew(); - result->Set(NanNew("channel"), NanNew(notify->relname)); - result->Set(NanNew("payload"), NanNew(notify->extra)); - Handle res = (Handle)result; - Emit("notification", &res); - PQfreemem(notify); - } - - } - - if(revents & UV_WRITABLE) { - TRACE("revents & UV_WRITABLE"); - if (PQflush(connection_) == 0) { - //nothing left to write, poll the socket for more to read - StartRead(); - } - } - } - bool HandleCopyOut () { - char * buffer = NULL; - int copied; - copied = PQgetCopyData(connection_, &buffer, 1); - while (copied > 0) { - Local node_chunk = NanNewBufferHandle(buffer, copied); - Emit("copyData", &node_chunk); - PQfreemem(buffer); - copied = PQgetCopyData(connection_, &buffer, 1); - } - if (copied == 0) { - //wait for next read ready - //result was not handled completely - return false; - } else if (copied == -1) { - this->copyOutMode_ = false; - return true; - } else if (copied == -2) { - this->copyOutMode_ = false; - return true; - } - return false; - } - - //maps the postgres tuple results to v8 objects - //and emits row events - //TODO look at emitting fewer events because the back & forth between - //javascript & c++ might introduce overhead (requires benchmarking) - void EmitRowDescription(const PGresult* result) - { - NanScope(); - Local row = NanNew(); - int fieldCount = PQnfields(result); - for(int fieldNumber = 0; fieldNumber < fieldCount; fieldNumber++) { - Local field = NanNew(); - //name of field - char* fieldName = PQfname(result, fieldNumber); - field->Set(NanNew("name"), NanNew(fieldName)); - - //oid of type of field - int fieldType = PQftype(result, fieldNumber); - field->Set(NanNew("dataTypeID"), NanNew(fieldType)); - - row->Set(NanNew(fieldNumber), field); - } - - Handle e = (Handle)row; - Emit("_rowDescription", &e); - } - - bool HandleResult(PGresult* result) - { - TRACE("PQresultStatus"); - ExecStatusType status = PQresultStatus(result); - switch(status) { - case PGRES_TUPLES_OK: -#ifdef SINGLE_ROW_SUPPORTED - case PGRES_SINGLE_TUPLE: -#endif - { - EmitRowDescription(result); - HandleTuplesResult(result); - EmitCommandMetaData(result); - return true; - } - break; - case PGRES_FATAL_ERROR: - { - TRACE("HandleErrorResult"); - HandleErrorResult(result); - return true; - } - break; - case PGRES_COMMAND_OK: - case PGRES_EMPTY_QUERY: - { - EmitCommandMetaData(result); - return true; - } - break; - case PGRES_COPY_IN: - { - this->copyInMode_ = true; - Emit("copyInResponse"); - return false; - } - break; - case PGRES_COPY_OUT: - { - this->copyOutMode_ = true; - Emit("copyOutResponse"); - return this->HandleCopyOut(); - } - break; - default: - printf("YOU SHOULD NEVER SEE THIS! PLEASE OPEN AN ISSUE ON GITHUB! Unrecogized query status: %s\n", PQresStatus(status)); - break; - } - return true; - } - - void EmitCommandMetaData(PGresult* result) - { - NanScope(); - Local info = NanNew(); - info->Set(NanNew("command"), NanNew(PQcmdStatus(result))); - info->Set(NanNew("value"), NanNew(PQcmdTuples(result))); - Handle e = (Handle)info; - Emit("_cmdStatus", &e); - } - - //maps the postgres tuple results to v8 objects - //and emits row events - //TODO look at emitting fewer events because the back & forth between - //javascript & c++ might introduce overhead (requires benchmarking) - void HandleTuplesResult(const PGresult* result) - { - NanScope(); - int rowCount = PQntuples(result); - for(int rowNumber = 0; rowNumber < rowCount; rowNumber++) { - //create result object for this row - Local row = NanNew(); - int fieldCount = PQnfields(result); - for(int fieldNumber = 0; fieldNumber < fieldCount; fieldNumber++) { - - //value of field - if(PQgetisnull(result, rowNumber, fieldNumber)) { - row->Set(NanNew(fieldNumber), NanNull()); - } else { - char* fieldValue = PQgetvalue(result, rowNumber, fieldNumber); - row->Set(NanNew(fieldNumber), NanNew(fieldValue)); - } - } - - Handle e = (Handle)row; - Emit("_row", &e); - } - } - - void HandleErrorResult(const PGresult* result) - { - NanScope(); - //instantiate the return object as an Error with the summary Postgres message - TRACE("ReadResultField"); - const char* errorMessage = PQresultErrorField(result, PG_DIAG_MESSAGE_PRIMARY); - if(!errorMessage) { - //there is no error, it has already been consumed in the last - //read-loop callback - return; - } - Local msg = Local::Cast(NanError(errorMessage)); - TRACE("AttachErrorFields"); - //add the other information returned by Postgres to the error object - AttachErrorField(result, msg, NanNew("severity"), PG_DIAG_SEVERITY); - AttachErrorField(result, msg, NanNew("code"), PG_DIAG_SQLSTATE); - AttachErrorField(result, msg, NanNew("detail"), PG_DIAG_MESSAGE_DETAIL); - AttachErrorField(result, msg, NanNew("hint"), PG_DIAG_MESSAGE_HINT); - AttachErrorField(result, msg, NanNew("position"), PG_DIAG_STATEMENT_POSITION); - AttachErrorField(result, msg, NanNew("internalPosition"), PG_DIAG_INTERNAL_POSITION); - AttachErrorField(result, msg, NanNew("internalQuery"), PG_DIAG_INTERNAL_QUERY); - AttachErrorField(result, msg, NanNew("where"), PG_DIAG_CONTEXT); - AttachErrorField(result, msg, NanNew("file"), PG_DIAG_SOURCE_FILE); - AttachErrorField(result, msg, NanNew("line"), PG_DIAG_SOURCE_LINE); - AttachErrorField(result, msg, NanNew("routine"), PG_DIAG_SOURCE_FUNCTION); - Handle m = msg; - TRACE("EmitError"); - Emit("_error", &m); - } - - void AttachErrorField(const PGresult *result, const Local msg, const Local symbol, int fieldcode) - { - NanScope(); - char *val = PQresultErrorField(result, fieldcode); - if(val) { - msg->Set(symbol, NanNew(val)); - } - } - - void End() - { - TRACE("stopping read & write"); - StopRead(); - StopWrite(); - DestroyConnection(); - Emit("_end"); - ended_ = true; - } - -private: - //EventEmitter was removed from c++ in node v0.5.x - void Emit(const char* message) { - NanScope(); - Handle args[1] = { NanNew(message) }; - Emit(1, args); - } - - void Emit(const char* message, Handle* arg) { - NanScope(); - Handle args[2] = { NanNew(message), *arg }; - Emit(2, args); - } - - void Emit(int length, Handle *args) { - NanScope(); - - Local emit_v = NanObjectWrapHandle(this)->Get(NanNew("emit")); - assert(emit_v->IsFunction()); - Local emit_f = emit_v.As(); - - TryCatch tc; - emit_f->Call(NanObjectWrapHandle(this), length, args); - if(tc.HasCaught()) { - FatalException(tc); - } - } - - void HandleConnectionIO() - { - PostgresPollingStatusType status = PQconnectPoll(connection_); - switch(status) { - case PGRES_POLLING_READING: - TRACE("Polled: PGRES_POLLING_READING"); - StartRead(); - break; - case PGRES_POLLING_WRITING: - TRACE("Polled: PGRES_POLLING_WRITING"); - StartWrite(); - break; - case PGRES_POLLING_FAILED: - StopRead(); - StopWrite(); - TRACE("Polled: PGRES_POLLING_FAILED"); - EmitLastError(); - break; - case PGRES_POLLING_OK: - TRACE("Polled: PGRES_POLLING_OK"); - connecting_ = false; - StartRead(); - Emit("connect"); - default: - //printf("Unknown polling status: %d\n", status); - break; - } - } - - void EmitError(const char *message) - { - NanScope(); - Local exception = NanError(message); - Emit("_error", &exception); - } - - void EmitLastError() - { - EmitError(PQerrorMessage(connection_)); - } - - const char *GetLastError() - { - return PQerrorMessage(connection_); - } - - void StopWrite() - { - TRACE("write STOP"); - if(ioInitialized_ && writing_) { - uv_poll_stop(&write_watcher_); - writing_ = false; - } - } - - void StartWrite() - { - TRACE("write START"); - if(reading_) { - TRACE("stop READ to start WRITE"); - StopRead(); - } - uv_poll_start(&write_watcher_, UV_WRITABLE, io_event); - writing_ = true; - } - - void StopRead() - { - TRACE("read STOP"); - if(ioInitialized_ && reading_) { - uv_poll_stop(&read_watcher_); - reading_ = false; - } - } - - void StartRead() - { - TRACE("read START"); - if(writing_) { - TRACE("stop WRITE to start READ"); - StopWrite(); - } - uv_poll_start(&read_watcher_, UV_READABLE, io_event); - reading_ = true; - } - //Converts a v8 array to an array of cstrings - //the result char** array must be free() when it is no longer needed - //if for any reason the array cannot be created, returns 0 - static char** ArgToCStringArray(Local params) - { - int len = params->Length(); - char** paramValues = new char*[len]; - for(int i = 0; i < len; i++) { - Handle val = params->Get(i); - if(val->IsString()) { - char* cString = MallocCString(val); - //will be 0 if could not malloc - if(!cString) { - LOG("ArgToCStringArray: OUT OF MEMORY OR SOMETHING BAD!"); - ReleaseCStringArray(paramValues, i-1); - return 0; - } - paramValues[i] = cString; - } else if(val->IsNull()) { - paramValues[i] = NULL; - } else if(val->IsObject() && Buffer::HasInstance(val)) { - if(Buffer::Length(val) > 0) { - char *cHexString = MallocCHexString(val->ToObject()); - if(!cHexString) { - LOG("ArgToCStringArray: OUT OF MEMORY OR SOMETHING BAD!"); - ReleaseCStringArray(paramValues, i-1); - return 0; - } - paramValues[i] = cHexString; - } else { - paramValues[i] = MallocCString(NanNew("")); - } - } else { - //a paramter was not a string - LOG("Parameter not a string or buffer"); - ReleaseCStringArray(paramValues, i-1); - return 0; - } - } - return paramValues; - } - - //helper function to release cString arrays - static void ReleaseCStringArray(char **strArray, int len) - { - for(int i = 0; i < len; i++) { - free(strArray[i]); - } - delete [] strArray; - } - - //helper function to malloc new string from v8string - static char* MallocCString(v8::Handle v8String) - { - String::Utf8Value utf8String(v8String->ToString()); - char *cString = (char *) malloc(strlen(*utf8String) + 1); - if(!cString) { - return cString; - } - strcpy(cString, *utf8String); - return cString; - } - - //helper function to Malloc a Bytea encoded Hex string from a buffer - static char* MallocCHexString(v8::Handle buf) - { - char* bufferData = Buffer::Data(buf); - size_t hexStringLen = Buffer::Length(buf)*2 + 3; - char *cHexString = (char *) malloc(hexStringLen); - if(!cHexString) { - return cHexString; - } - strcpy(cHexString, "\\x"); - for (uint32_t i = 0, k = 2; k < hexStringLen; i += 1, k += 2) { - static const char hex[] = "0123456789abcdef"; - uint8_t val = static_cast(bufferData[i]); - cHexString[k + 0] = hex[val >> 4]; - cHexString[k + 1] = hex[val & 15]; - } - cHexString[hexStringLen-1] = 0; - return cHexString; - } - - void SendCopyFromChunk(Handle chunk) { - PQputCopyData(connection_, Buffer::Data(chunk), Buffer::Length(chunk)); - } - void EndCopyFrom(char * error_msg) { - PQputCopyEnd(connection_, error_msg); - this->copyInMode_ = false; - } - -}; - - -extern "C" void init (Handle target) -{ - NanScope(); - Connection::Init(target); -} -NODE_MODULE(binding, init) diff --git a/node_modules/pg/test/cli.js b/node_modules/pg/test/cli.js index 93482c9..bec0f3f 100644 --- a/node_modules/pg/test/cli.js +++ b/node_modules/pg/test/cli.js @@ -17,4 +17,8 @@ for(var i = 0; i < process.argv.length; i++) { } } +if(process.env['PG_TEST_NATIVE']) { + config.native = true; +} + module.exports = config; diff --git a/node_modules/pg/test/integration/client/appname-tests.js b/node_modules/pg/test/integration/client/appname-tests.js index 2735368..ca074ec 100644 --- a/node_modules/pg/test/integration/client/appname-tests.js +++ b/node_modules/pg/test/integration/client/appname-tests.js @@ -1,3 +1,4 @@ +return; var helper = require('./test-helper'); var Client = helper.Client; @@ -92,4 +93,4 @@ if (!helper.args.native) { assert.strictEqual(res, appName); }); }); -} \ No newline at end of file +} diff --git a/node_modules/pg/test/integration/client/cancel-query-tests.js b/node_modules/pg/test/integration/client/cancel-query-tests.js index 80b05b2..b6c0c7f 100644 --- a/node_modules/pg/test/integration/client/cancel-query-tests.js +++ b/node_modules/pg/test/integration/client/cancel-query-tests.js @@ -9,15 +9,15 @@ test("cancellation of a query", function() { client.on('drain', client.end.bind(client)); - var rows1 = 0, rows2 = 0, rows3 = 0, rows4 = 0; + var rows3 = 0; var query1 = client.query(qry); query1.on('row', function(row) { - rows1++; + throw new Error('Should not emit a row') }); var query2 = client.query(qry); query2.on('row', function(row) { - rows2++; + throw new Error('Should not emit a row') }); var query3 = client.query(qry); query3.on('row', function(row) { @@ -25,19 +25,13 @@ test("cancellation of a query", function() { }); var query4 = client.query(qry); query4.on('row', function(row) { - rows4++; + throw new Error('Should not emit a row') }); helper.pg.cancel(helper.config, client, query1); helper.pg.cancel(helper.config, client, query2); helper.pg.cancel(helper.config, client, query4); - setTimeout(function() { - assert.equal(rows1, 0); - assert.equal(rows2, 0); - assert.equal(rows4, 0); - }, 2000); - assert.emits(query3, 'end', function() { test("returned right number of rows", function() { assert.equal(rows3, 26); diff --git a/node_modules/pg/test/integration/client/copy-tests.js b/node_modules/pg/test/integration/client/copy-tests.js deleted file mode 100644 index de06b0d..0000000 --- a/node_modules/pg/test/integration/client/copy-tests.js +++ /dev/null @@ -1,168 +0,0 @@ -var helper = require(__dirname + '/../test-helper'); -var pg = require(__dirname + '/../../../lib'); -if(helper.args.native) { - pg = require(__dirname + '/../../../lib').native; -} -var ROWS_TO_INSERT = 1000; -var prepareTable = function (client, callback) { - client.query( - 'CREATE TEMP TABLE copy_test (id SERIAL, name CHARACTER VARYING(10), age INT)', - assert.calls(function (err, result) { - assert.equal(err, null, - err && err.message ? "create table query should not fail: " + err.message : null); - callback(); - }) - ); -}; -test('COPY FROM', function () { - pg.connect(helper.config, function (error, client, done) { - assert.equal(error, null, "Failed to connect: " + helper.sys.inspect(error)); - prepareTable(client, function () { - var stream = client.copyFrom("COPY copy_test (name, age) FROM stdin WITH CSV"); - stream.on('error', function (error) { - assert.ok(false, "COPY FROM stream should not emit errors" + helper.sys.inspect(error)); - }); - for (var i = 0; i < ROWS_TO_INSERT; i++) { - stream.write( String(Date.now() + Math.random()).slice(0,10) + ',' + i + '\n'); - } - assert.emits(stream, 'close', function () { - client.query("SELECT count(*), sum(age) from copy_test", function (err, result) { - assert.equal(err, null, "Query should not fail"); - assert.lengthIs(result.rows, 1) - assert.equal(result.rows[0].sum, ROWS_TO_INSERT * (0 + ROWS_TO_INSERT -1)/2); - assert.equal(result.rows[0].count, ROWS_TO_INSERT); - done(); - }); - }, "COPY FROM stream should emit close after query end"); - stream.end(); - }); - }); -}); -test('COPY TO', function () { - pg.connect(helper.config, function (error, client, done) { - assert.equal(error, null, "Failed to connect: " + helper.sys.inspect(error)); - prepareTable(client, function () { - var stream = client.copyTo("COPY person (id, name, age) TO stdin WITH CSV"); - var buf = new Buffer(0); - stream.on('error', function (error) { - assert.ok(false, "COPY TO stream should not emit errors" + helper.sys.inspect(error)); - }); - assert.emits(stream, 'data', function (chunk) { - buf = Buffer.concat([buf, chunk]); - }, "COPY IN stream should emit data event for each row"); - assert.emits(stream, 'end', function () { - var lines = buf.toString().split('\n'); - assert.equal(lines.length >= 0, true, "copy in should return rows saved by copy from"); - assert.equal(lines[0].split(',').length, 3, "each line should consists of 3 fields"); - done(); - }, "COPY IN stream should emit end event after all rows"); - }); - }); -}); - -test('COPY TO, queue queries', function () { - if(helper.config.native) return false; - pg.connect(helper.config, assert.calls(function (error, client, done) { - assert.equal(error, null, "Failed to connect: " + helper.sys.inspect(error)); - prepareTable(client, function () { - var query1Done = false, - copyQueryDone = false, - query2Done = false; - client.query("SELECT count(*) from person", function () { - query1Done = true; - assert.ok(!copyQueryDone && ! query2Done, "first query has to be executed before others"); - }); - var stream = client.copyTo("COPY person (id, name, age) TO stdin WITH CSV"); - //imitate long query, to make impossible, - //that copy query end callback runs after - //second query callback - client.query("SELECT pg_sleep(1)", function () { - query2Done = true; - assert.ok(copyQueryDone && query2Done, "second query has to be executed after others"); - }); - var buf = new Buffer(0); - stream.on('error', function (error) { - assert.ok(false, "COPY TO stream should not emit errors" + helper.sys.inspect(error)); - }); - assert.emits(stream, 'data', function (chunk) { - buf = Buffer.concat([buf, chunk]); - }, "COPY IN stream should emit data event for each row"); - assert.emits(stream, 'end', function () { - copyQueryDone = true; - assert.ok(query1Done && ! query2Done, "copy query has to be executed before second query and after first"); - var lines = buf.toString().split('\n'); - assert.equal(lines.length >= 0, true, "copy in should return rows saved by copy from"); - assert.equal(lines[0].split(',').length, 3, "each line should consists of 3 fields"); - done(); - }, "COPY IN stream should emit end event after all rows"); - }); - })); -}); - -test("COPY TO incorrect usage with large data", function () { - if(helper.config.native) return false; - //when many data is loaded from database (and it takes a lot of time) - //there are chance, that query will be canceled before it ends - //but if there are not so much data, cancel message may be - //send after copy query ends - //so we need to test both situations - pg.connect(helper.config, assert.calls(function (error, client, done) { - assert.equal(error, null, "Failed to connect: " + helper.sys.inspect(error)); - //intentionally incorrect usage of copy. - //this has to report error in standart way, instead of just throwing exception - client.query( - "COPY (SELECT GENERATE_SERIES(1, 10000000)) TO STDOUT WITH CSV", - assert.calls(function (error) { - assert.ok(error, "error should be reported when sending copy to query with query method"); - client.query("SELECT 1", assert.calls(function (error, result) { - assert.isNull(error, "incorrect copy usage should not break connection"); - assert.ok(result, "incorrect copy usage should not break connection"); - done(); - })); - }) - ); - })); -}); - -test("COPY TO incorrect usage with small data", function () { - if(helper.config.native) return false; - pg.connect(helper.config, assert.calls(function (error, client, done) { - assert.equal(error, null, "Failed to connect: " + helper.sys.inspect(error)); - //intentionally incorrect usage of copy. - //this has to report error in standart way, instead of just throwing exception - client.query( - "COPY (SELECT GENERATE_SERIES(1, 1)) TO STDOUT WITH CSV", - assert.calls(function (error) { - assert.ok(error, "error should be reported when sending copy to query with query method"); - client.query("SELECT 1", assert.calls(function (error, result) { - assert.isNull(error, "incorrect copy usage should not break connection: " + error); - assert.ok(result, "incorrect copy usage should not break connection"); - done(); - })); - }) - ); - })); -}); - -test("COPY FROM incorrect usage", function () { - pg.connect(helper.config, function (error, client, done) { - assert.equal(error, null, "Failed to connect: " + helper.sys.inspect(error)); - prepareTable(client, function () { - //intentionally incorrect usage of copy. - //this has to report error in standart way, instead of just throwing exception - client.query( - "COPY copy_test from STDIN WITH CSV", - assert.calls(function (error) { - assert.ok(error, "error should be reported when sending copy to query with query method"); - client.query("SELECT 1", assert.calls(function (error, result) { - assert.isNull(error, "incorrect copy usage should not break connection: " + error); - assert.ok(result, "incorrect copy usage should not break connection"); - done(); - pg.end(helper.config); - })); - }) - ); - }); - }); -}); - diff --git a/node_modules/pg/test/integration/client/custom-types-tests.js b/node_modules/pg/test/integration/client/custom-types-tests.js new file mode 100644 index 0000000..3847922 --- /dev/null +++ b/node_modules/pg/test/integration/client/custom-types-tests.js @@ -0,0 +1,18 @@ +var helper = require(__dirname + '/test-helper'); +return console.log('TODO: get this working for non-native client'); + +helper.config.types = { + getTypeParser: function() { + return function() { + return 'okay!' + } + } +}; + +helper.pg.connect(helper.config, assert.success(function(client, done) { + client.query('SELECT NOW() as val', assert.success(function(res) { + assert.equal(res.rows[0].val, 'okay!'); + done(); + helper.pg.end(); + })); +})); diff --git a/node_modules/pg/test/integration/client/error-handling-tests.js b/node_modules/pg/test/integration/client/error-handling-tests.js index 616493b..d3bf36c 100644 --- a/node_modules/pg/test/integration/client/error-handling-tests.js +++ b/node_modules/pg/test/integration/client/error-handling-tests.js @@ -3,8 +3,9 @@ var util = require('util'); var createErorrClient = function() { var client = helper.client(); - client.on('error', function(err) { - assert.ok(false, "client should not throw query error: " + util.inspect(err)); + client.once('error', function(err) { + //console.log('error', util.inspect(err)); + assert.fail('Client shoud not throw error during query execution'); }); client.on('drain', client.end.bind(client)); return client; @@ -18,11 +19,8 @@ test('error handling', function(){ var query = client.query("select omfg from yodas_dsflsd where pixistix = 'zoiks!!!'"); assert.emits(query, 'error', function(error) { - test('error is a psql error', function() { - assert.equal(error.severity, "ERROR"); - }); + assert.equal(error.severity, "ERROR"); }); - }); test('within a prepared statement', function() { @@ -108,7 +106,7 @@ test('non-error calls supplied callback', function() { }); client.connect(assert.calls(function(err) { - assert.isNull(err); + assert.ifError(err); client.end(); })) }); @@ -123,9 +121,11 @@ test('when connecting to invalid host', function() { password: '1234', host: 'asldkfjasdf!!#1308140.com' }); + var delay = 5000; var tid = setTimeout(function() { - assert(false, "When connecting to an invalid host the error event should be emitted but it has been " + delay + " and still no error event."); + var msg = "When connecting to an invalid host the error event should be emitted but it has been " + delay + " and still no error event." + assert(false, msg); }, delay); client.on('error', function() { clearTimeout(tid); @@ -140,7 +140,7 @@ test('when connecting to invalid host with callback', function() { host: 'asldkfjasdf!!#1308140.com' }); client.connect(function(error, client) { - assert.ok(error); + assert(error); }); }); diff --git a/node_modules/pg/test/integration/client/force-native-with-envvar-tests.js b/node_modules/pg/test/integration/client/force-native-with-envvar-tests.js index e41587d..0ac3098 100644 --- a/node_modules/pg/test/integration/client/force-native-with-envvar-tests.js +++ b/node_modules/pg/test/integration/client/force-native-with-envvar-tests.js @@ -1,3 +1,4 @@ +return; /** * helper needs to be loaded for the asserts but it alos proloads * client which we don't want here diff --git a/node_modules/pg/test/integration/client/notice-tests.js b/node_modules/pg/test/integration/client/notice-tests.js index 4c6920a..764b45c 100644 --- a/node_modules/pg/test/integration/client/notice-tests.js +++ b/node_modules/pg/test/integration/client/notice-tests.js @@ -1,4 +1,5 @@ var helper = require(__dirname + '/test-helper'); + test('emits notice message', function() { //TODO this doesn't work on all versions of postgres return false; diff --git a/node_modules/pg/test/integration/client/query-callback-error-tests.js b/node_modules/pg/test/integration/client/query-callback-error-tests.js index bd80153..4f95e28 100644 --- a/node_modules/pg/test/integration/client/query-callback-error-tests.js +++ b/node_modules/pg/test/integration/client/query-callback-error-tests.js @@ -1,3 +1,4 @@ +return console.log('query-callback-error-tests: DEPRECATED - if you want saftey in your callback, you can try/catch your own functions'); var helper = require(__dirname + '/test-helper'); var util = require('util'); diff --git a/node_modules/pg/test/integration/client/query-error-handling-prepared-statement-tests.js b/node_modules/pg/test/integration/client/query-error-handling-prepared-statement-tests.js index 7d25a7d..1516465 100644 --- a/node_modules/pg/test/integration/client/query-error-handling-prepared-statement-tests.js +++ b/node_modules/pg/test/integration/client/query-error-handling-prepared-statement-tests.js @@ -63,7 +63,7 @@ test('client end during query execution of prepared statement', function() { text: sleepQuery, values: [5] }, assert.calls(function(err, result) { - assert.equal(err.message, 'Connection was ended during query'); + assert.equal(err.message, 'Connection terminated'); })); query1.on('error', function(err) { diff --git a/node_modules/pg/test/integration/client/query-error-handling-tests.js b/node_modules/pg/test/integration/client/query-error-handling-tests.js index 2b708b8..36bade7 100644 --- a/node_modules/pg/test/integration/client/query-error-handling-tests.js +++ b/node_modules/pg/test/integration/client/query-error-handling-tests.js @@ -35,3 +35,51 @@ test('error during query execution', function() { })); })); }); + +if(helper.config.native) return; + +test('9.3 column error fields', function() { + var client = new Client(helper.args); + client.connect(assert.success(function() { + helper.versionGTE(client, '9.3.0', assert.success(function(isGreater) { + if(!isGreater) { + return client.end(); + } + + client.query('DROP TABLE IF EXISTS column_err_test'); + client.query('CREATE TABLE column_err_test(a int NOT NULL)'); + client.query('INSERT INTO column_err_test(a) VALUES (NULL)', function (err) { + assert.equal(err.severity, 'ERROR'); + assert.equal(err.code, '23502'); + assert.equal(err.schema, 'public'); + assert.equal(err.table, 'column_err_test'); + assert.equal(err.column, 'a'); + return client.end(); + }); + })); + })); +}); + +test('9.3 constraint error fields', function() { + var client = new Client(helper.args); + client.connect(assert.success(function() { + helper.versionGTE(client, '9.3.0', assert.success(function(isGreater) { + if(!isGreater) { + console.log('skip 9.3 error field on older versions of postgres'); + return client.end(); + } + + client.query('DROP TABLE IF EXISTS constraint_err_test'); + client.query('CREATE TABLE constraint_err_test(a int PRIMARY KEY)'); + client.query('INSERT INTO constraint_err_test(a) VALUES (1)'); + client.query('INSERT INTO constraint_err_test(a) VALUES (1)', function (err) { + assert.equal(err.severity, 'ERROR'); + assert.equal(err.code, '23505'); + assert.equal(err.schema, 'public'); + assert.equal(err.table, 'constraint_err_test'); + assert.equal(err.constraint, 'constraint_err_test_pkey'); + return client.end(); + }); + })); + })); +}); diff --git a/node_modules/pg/test/integration/client/result-metadata-tests.js b/node_modules/pg/test/integration/client/result-metadata-tests.js index 8f66fe1..0136300 100644 --- a/node_modules/pg/test/integration/client/result-metadata-tests.js +++ b/node_modules/pg/test/integration/client/result-metadata-tests.js @@ -12,6 +12,7 @@ test('should return insert metadata', function() { assert.equal(result.command, 'CREATE'); var q = client.query("INSERT INTO zugzug(name) VALUES('more work?')", assert.calls(function(err, result) { + assert.isNull(err); assert.equal(result.command, "INSERT"); assert.equal(result.rowCount, 1); diff --git a/node_modules/pg/test/integration/client/type-coercion-tests.js b/node_modules/pg/test/integration/client/type-coercion-tests.js index 05dda98..efc3a86 100644 --- a/node_modules/pg/test/integration/client/type-coercion-tests.js +++ b/node_modules/pg/test/integration/client/type-coercion-tests.js @@ -158,11 +158,11 @@ if(!helper.config.binary) { client.end(); }); - // Set teh server timeszone to the same as used for the test, + // Set the server timeszone to the same as used for the test, // otherwise (if server's timezone is ahead of GMT) in // textParsers.js::parseDate() the timezone offest is added to the date; // in the case of "275760-09-13 00:00:00 GMT" the timevalue overflows. - client.query('SET TIMEZONE TO GMT', [], assert.success(function(res){ + client.query('SET TIMEZONE TO GMT', assert.success(function(res){ // PostgreSQL supports date range of 4713 BCE to 294276 CE // http://www.postgresql.org/docs/9.2/static/datatype-datetime.html @@ -186,7 +186,7 @@ if(!helper.config.binary) { } helper.pg.connect(helper.config, assert.calls(function(err, client, done) { - assert.isNull(err); + assert.ifError(err); client.query('select null as res;', assert.calls(function(err, res) { assert.isNull(err); assert.strictEqual(res.rows[0].res, null) diff --git a/node_modules/pg/test/integration/client/type-parser-override-tests.js b/node_modules/pg/test/integration/client/type-parser-override-tests.js new file mode 100644 index 0000000..68a5de7 --- /dev/null +++ b/node_modules/pg/test/integration/client/type-parser-override-tests.js @@ -0,0 +1,34 @@ +var helper = require(__dirname + '/test-helper'); + +function testTypeParser(client, expectedResult, done) { + var boolValue = true; + client.query('CREATE TEMP TABLE parserOverrideTest(id bool)'); + client.query('INSERT INTO parserOverrideTest(id) VALUES ($1)', [boolValue]); + client.query('SELECT * FROM parserOverrideTest', assert.success(function(result) { + assert.equal(result.rows[0].id, expectedResult); + helper.pg.end(); + done(); + })); +} + +helper.pg.connect(helper.config, assert.success(function(client1, done1) { + helper.pg.connect(helper.config, assert.success(function(client2, done2) { + var boolTypeOID = 16; + client1.setTypeParser(boolTypeOID, function(){ + return 'first client'; + }); + client2.setTypeParser(boolTypeOID, function(){ + return 'second client'; + }); + + client1.setTypeParser(boolTypeOID, 'binary', function(){ + return 'first client binary'; + }); + client2.setTypeParser(boolTypeOID, 'binary', function(){ + return 'second client binary'; + }); + + testTypeParser(client1, 'first client', done1); + testTypeParser(client2, 'second client', done2); + })); +})); diff --git a/node_modules/pg/test/integration/connection-pool/error-tests.js b/node_modules/pg/test/integration/connection-pool/error-tests.js index c286d56..4159d82 100644 --- a/node_modules/pg/test/integration/connection-pool/error-tests.js +++ b/node_modules/pg/test/integration/connection-pool/error-tests.js @@ -5,15 +5,14 @@ pg = pg; //first make pool hold 2 clients pg.defaults.poolSize = 2; - //get first client pg.connect(helper.config, assert.success(function(client, done) { client.id = 1; + client.query('SELECT NOW()', function() { pg.connect(helper.config, assert.success(function(client2, done2) { client2.id = 2; - var pidColName = 'procpid' + var pidColName = 'procpid'; helper.versionGTE(client2, '9.2.0', assert.success(function(isGreater) { - console.log(isGreater) var killIdleQuery = 'SELECT pid, (SELECT pg_terminate_backend(pid)) AS killed FROM pg_stat_activity WHERE state = $1'; var params = ['idle']; if(!isGreater) { @@ -37,4 +36,6 @@ pg.connect(helper.config, assert.success(function(client, done) { })); })); })); + + }) })); diff --git a/node_modules/pg/test/integration/connection-pool/max-connection-tests.js b/node_modules/pg/test/integration/connection-pool/max-connection-tests.js index 61755a0..68c0773 100644 --- a/node_modules/pg/test/integration/connection-pool/max-connection-tests.js +++ b/node_modules/pg/test/integration/connection-pool/max-connection-tests.js @@ -1,3 +1,2 @@ var helper = require(__dirname + "/test-helper") -helper.testPoolSize(10); -helper.testPoolSize(11); +helper.testPoolSize(40); diff --git a/node_modules/pg/test/integration/gh-issues/699-tests.js b/node_modules/pg/test/integration/gh-issues/699-tests.js new file mode 100644 index 0000000..f3716bb --- /dev/null +++ b/node_modules/pg/test/integration/gh-issues/699-tests.js @@ -0,0 +1,27 @@ +var helper = require('../test-helper'); +var assert = require('assert'); +var copyFrom = require('pg-copy-streams').from; + +if(helper.args.native) return; + +helper.pg.connect(function (err, client, done) { + if (err) throw err; + + var c = 'CREATE TEMP TABLE employee (id integer, fname varchar(400), lname varchar(400))'; + + client.query(c, function (err) { + if (err) throw err; + + var stream = client.query(copyFrom("COPY employee FROM STDIN")); + stream.on('end', function () { + done(); + helper.pg.end(); + }); + + for (var i = 1; i <= 5; i++) { + var line = ['1\ttest', i, '\tuser', i, '\n']; + stream.write(line.join('')); + } + stream.end(); + }); +}); diff --git a/node_modules/pg/test/native/copy-events-tests.js b/node_modules/pg/test/native/copy-events-tests.js deleted file mode 100644 index 76f7e29..0000000 --- a/node_modules/pg/test/native/copy-events-tests.js +++ /dev/null @@ -1,40 +0,0 @@ -var helper = require(__dirname+"/../test-helper"); -var Client = require(__dirname + "/../../lib/native"); -test('COPY FROM events check', function () { - var con = new Client(helper.config), - stdinStream = con.copyFrom('COPY person FROM STDIN'); - assert.emits(con, 'copyInResponse', - function () { - stdinStream.end(); - }, - "backend should emit copyInResponse after COPY FROM query" - ); - assert.emits(con, '_readyForQuery', - function () { - con.end(); - }, - "backend should emit _readyForQuery after data will be coped to stdin stream" - ); - con.connect(); -}); -test('COPY TO events check', function () { - var con = new Client(helper.config), - stdoutStream = con.copyTo('COPY person TO STDOUT'); - assert.emits(con, 'copyOutResponse', - function () {}, - "backend should emit copyOutResponse on copyOutResponse message from server" - ); - assert.emits(con, 'copyData', - function () { - }, - "backend should emit copyData on every data row" - ); - assert.emits(con, '_readyForQuery', - function () { - con.end(); - }, - "backend should emit _readyForQuery after data will be coped to stdout stream" - ); - con.connect(); -}); - diff --git a/node_modules/pg/test/native/copyto-largedata-tests.js b/node_modules/pg/test/native/copyto-largedata-tests.js deleted file mode 100644 index 8c87948..0000000 --- a/node_modules/pg/test/native/copyto-largedata-tests.js +++ /dev/null @@ -1,23 +0,0 @@ -var helper = require(__dirname+"/../test-helper"); -var Client = require(__dirname + "/../../lib/native"); -test("COPY TO large amount of data from postgres", function () { - //there were a bug in native implementation of COPY TO: - //if there were too much data (if we face situation - //when data is not ready while calling PQgetCopyData); - //while loop in Connection::HandleIOEvent becomes infinite - //in such way hanging node, consumes 100% cpu, and making connection unusable - var con = new Client(helper.config), - rowCount = 100000, - stdoutStream = con.copyTo('COPY (select generate_series(1, ' + rowCount + ')) TO STDOUT'); - stdoutStream.on('data', function () { - rowCount--; - }); - stdoutStream.on('end', function () { - assert.equal(rowCount, 0, "copy to should load exactly requested number of rows"); - con.query("SELECT 1", assert.calls(function (error, result) { - assert.ok(!error && result, "loading large amount of data by copy to should not break connection"); - con.end(); - })); - }); - con.connect(); -}); diff --git a/node_modules/pg/test/native/evented-api-tests.js b/node_modules/pg/test/native/evented-api-tests.js index db93f5b..9bff341 100644 --- a/node_modules/pg/test/native/evented-api-tests.js +++ b/node_modules/pg/test/native/evented-api-tests.js @@ -10,31 +10,32 @@ var setupClient = function() { return client; } -test('connects', function() { - var client = new Client(helper.config); - client.connect(); - test('good query', function() { - var query = client.query("SELECT 1 as num, 'HELLO' as str"); - assert.emits(query, 'row', function(row) { - test('has integer data type', function() { - assert.strictEqual(row.num, 1); - }) - test('has string data type', function() { - assert.strictEqual(row.str, "HELLO") - }) - test('emits end AFTER row event', function() { - assert.emits(query, 'end'); - test('error query', function() { - var query = client.query("LSKDJF"); - assert.emits(query, 'error', function(err) { - assert.ok(err != null, "Should not have emitted null error"); - client.end(); - }) - }) - }) - }) - }) -}) +//test('connects', function() { + //var client = new Client(helper.config); + //client.connect(); + //test('good query', function() { + //var query = client.query("SELECT 1 as num, 'HELLO' as str"); + //assert.emits(query, 'row', function(row) { + //test('has integer data type', function() { + //assert.strictEqual(row.num, 1); + //}) + //test('has string data type', function() { + //assert.strictEqual(row.str, "HELLO") + //}) + //test('emits end AFTER row event', function() { + //assert.emits(query, 'end'); + //test('error query', function() { + //var query = client.query("LSKDJF"); + //assert.emits(query, 'error', function(err) { + //assert.ok(err != null, "Should not have emitted null error"); + //client.end(); + //}) + //}) + //}) + //}) + //}) +//}) + test('multiple results', function() { test('queued queries', function() { @@ -48,10 +49,10 @@ test('multiple results', function() { }) assert.emits(q, 'end', function() { test('query with config', function() { - var q = client.query({text:'SELECT 1 as num'}); - assert.emits(q, 'row', function(row) { + var q2 = client.query({text:'SELECT 1 as num'}); + assert.emits(q2, 'row', function(row) { assert.strictEqual(row.num, 1); - assert.emits(q, 'end', function() { + assert.emits(q2, 'end', function() { client.end(); }) }) diff --git a/node_modules/pg/test/native/missing-native.js b/node_modules/pg/test/native/missing-native.js new file mode 100644 index 0000000..b13a631 --- /dev/null +++ b/node_modules/pg/test/native/missing-native.js @@ -0,0 +1,8 @@ +//this test assumes it has been run from the Makefile +//and that node_modules/pg-native has been deleted + +var assert = require('assert'); + +assert.throws(function() { + require('../../lib').native; +}); diff --git a/node_modules/pg/test/native/stress-tests.js b/node_modules/pg/test/native/stress-tests.js index cac03d0..bd2bca5 100644 --- a/node_modules/pg/test/native/stress-tests.js +++ b/node_modules/pg/test/native/stress-tests.js @@ -24,13 +24,13 @@ test('many queries', function() { var q = client.query("SELECT * FROM person"); assert.emits(q, 'end', function() { count++; - }) + }); } assert.emits(client, 'drain', function() { client.end(); assert.equal(count, expected); - }) -}) + }); +}); test('many clients', function() { var clients = []; diff --git a/node_modules/pg/test/test-helper.js b/node_modules/pg/test/test-helper.js index cb7e606..175cbbb 100644 --- a/node_modules/pg/test/test-helper.js +++ b/node_modules/pg/test/test-helper.js @@ -139,7 +139,8 @@ var expect = function(callback, timeout) { "Expected execution of function to be fired within " + timeout + " milliseconds " + + " (hint: export TEST_TIMEOUT=" - + " to change timeout globally)"); + + " to change timeout globally)" + + callback.toString()); }, timeout) if(callback.length < 3) { diff --git a/node_modules/pg/test/unit/copystream/copyfrom-tests.js b/node_modules/pg/test/unit/copystream/copyfrom-tests.js deleted file mode 100644 index 7b96049..0000000 --- a/node_modules/pg/test/unit/copystream/copyfrom-tests.js +++ /dev/null @@ -1,99 +0,0 @@ -var helper = require(__dirname + '/../test-helper'); -var CopyFromStream = require(__dirname + '/../../../lib/copystream').CopyFromStream; -var ConnectionImitation = function () { - this.send = 0; - this.hasToBeSend = 0; - this.finished = 0; -}; -ConnectionImitation.prototype = { - endCopyFrom: function () { - assert.ok(this.finished++ === 0, "end shoud be called only once"); - assert.equal(this.send, this.hasToBeSend, "at the moment of the end all data has to be sent"); - }, - sendCopyFromChunk: function (chunk) { - this.send += chunk.length; - return true; - }, - updateHasToBeSend: function (chunk) { - this.hasToBeSend += chunk.length; - return chunk; - } -}; -var buf1 = new Buffer("asdfasd"), - buf2 = new Buffer("q03r90arf0aospd;"), - buf3 = new Buffer(542), - buf4 = new Buffer("93jfemialfjkasjlfas"); - -test('CopyFromStream, start streaming before data, end after data. no drain event', function () { - var stream = new CopyFromStream(); - var conn = new ConnectionImitation(); - stream.on('drain', function () { - assert.ok(false, "there has not be drain event"); - }); - stream.startStreamingToConnection(conn); - assert.ok(stream.write(conn.updateHasToBeSend(buf1))); - assert.ok(stream.write(conn.updateHasToBeSend(buf2))); - assert.ok(stream.write(conn.updateHasToBeSend(buf3))); - assert.ok(stream.writable, "stream has to be writable"); - stream.end(conn.updateHasToBeSend(buf4)); - assert.ok(!stream.writable, "stream has not to be writable"); - stream.end(); - assert.equal(conn.hasToBeSend, conn.send); -}); -test('CopyFromStream, start streaming after end, end after data. drain event', function () { - var stream = new CopyFromStream(); - assert.emits(stream, 'drain', function() {}, 'drain have to be emitted'); - var conn = new ConnectionImitation() - assert.ok(!stream.write(conn.updateHasToBeSend(buf1))); - assert.ok(!stream.write(conn.updateHasToBeSend(buf2))); - assert.ok(!stream.write(conn.updateHasToBeSend(buf3))); - assert.ok(stream.writable, "stream has to be writable"); - stream.end(conn.updateHasToBeSend(buf4)); - assert.ok(!stream.writable, "stream has not to be writable"); - stream.end(); - stream.startStreamingToConnection(conn); - assert.equal(conn.hasToBeSend, conn.send); -}); -test('CopyFromStream, start streaming between data chunks. end after data. drain event', function () { - var stream = new CopyFromStream(); - var conn = new ConnectionImitation() - assert.emits(stream, 'drain', function() {}, 'drain have to be emitted'); - stream.write(conn.updateHasToBeSend(buf1)); - stream.write(conn.updateHasToBeSend(buf2)); - stream.startStreamingToConnection(conn); - stream.write(conn.updateHasToBeSend(buf3)); - assert.ok(stream.writable, "stream has to be writable"); - stream.end(conn.updateHasToBeSend(buf4)); - assert.equal(conn.hasToBeSend, conn.send); - assert.ok(!stream.writable, "stream has not to be writable"); - stream.end(); -}); -test('CopyFromStream, start sreaming before end. end stream with data. drain event', function () { - var stream = new CopyFromStream(); - var conn = new ConnectionImitation() - assert.emits(stream, 'drain', function() {}, 'drain have to be emitted'); - stream.write(conn.updateHasToBeSend(buf1)); - stream.write(conn.updateHasToBeSend(buf2)); - stream.write(conn.updateHasToBeSend(buf3)); - stream.startStreamingToConnection(conn); - assert.ok(stream.writable, "stream has to be writable"); - stream.end(conn.updateHasToBeSend(buf4)); - assert.equal(conn.hasToBeSend, conn.send); - assert.ok(!stream.writable, "stream has not to be writable"); - stream.end(); -}); -test('CopyFromStream, start streaming after end. end with data. drain event', function(){ - var stream = new CopyFromStream(); - var conn = new ConnectionImitation() - assert.emits(stream, 'drain', function() {}, 'drain have to be emitted'); - stream.write(conn.updateHasToBeSend(buf1)); - stream.write(conn.updateHasToBeSend(buf2)); - stream.write(conn.updateHasToBeSend(buf3)); - stream.startStreamingToConnection(conn); - assert.ok(stream.writable, "stream has to be writable"); - stream.end(conn.updateHasToBeSend(buf4)); - stream.startStreamingToConnection(conn); - assert.equal(conn.hasToBeSend, conn.send); - assert.ok(!stream.writable, "stream has not to be writable"); - stream.end(); -}); diff --git a/node_modules/pg/test/unit/copystream/copyto-tests.js b/node_modules/pg/test/unit/copystream/copyto-tests.js deleted file mode 100644 index 7a6255b..0000000 --- a/node_modules/pg/test/unit/copystream/copyto-tests.js +++ /dev/null @@ -1,122 +0,0 @@ -var helper = require(__dirname + '/../test-helper'); -var CopyToStream = require(__dirname + '/../../../lib/copystream').CopyToStream; -var DataCounter = function () { - this.sendBytes = 0; - this.recievedBytes = 0; -}; -DataCounter.prototype = { - send: function (buf) { - this.sendBytes += buf.length; - return buf; - }, - recieve: function (chunk) { - this.recievedBytes += chunk.length; - }, - assert: function () { - assert.equal(this.sendBytes, this.recievedBytes, "data bytes send and recieved has to match"); - } -}; -var buf1 = new Buffer("asdfasd"), - buf2 = new Buffer("q03r90arf0aospd;"), - buf3 = new Buffer(542), - buf4 = new Buffer("93jfemialfjkasjlfas"); -test('CopyToStream simple', function () { - var stream = new CopyToStream(), - dc = new DataCounter(); - assert.emits(stream, 'end', function () {}, ''); - stream.on('data', dc.recieve.bind(dc)); - stream.handleChunk(dc.send(buf1)); - stream.handleChunk(dc.send(buf2)); - stream.handleChunk(dc.send(buf3)); - stream.handleChunk(dc.send(buf4)); - dc.assert(); - stream.close(); -}); -test('CopyToStream pause/resume/close', function () { - var stream = new CopyToStream(), - dc = new DataCounter(); - stream.on('data', dc.recieve.bind(dc)); - assert.emits(stream, 'end', function () {}, 'stream has to emit end after closing'); - stream.pause(); - stream.handleChunk(dc.send(buf1)); - stream.handleChunk(dc.send(buf2)); - stream.handleChunk(dc.send(buf3)); - assert.equal(dc.recievedBytes, 0); - stream.resume(); - dc.assert(); - stream.handleChunk(dc.send(buf2)); - dc.assert(); - stream.handleChunk(dc.send(buf3)); - dc.assert(); - stream.pause(); - stream.handleChunk(dc.send(buf4)); - assert(dc.sendBytes - dc.recievedBytes, buf4.length, "stream has not emit, data while it is in paused state"); - stream.resume(); - dc.assert(); - stream.close(); -}); -test('CopyToStream error', function () { - var stream = new CopyToStream(), - dc = new DataCounter(); - stream.on('data', dc.recieve.bind(dc)); - assert.emits(stream, 'error', function () {}, 'stream has to emit error event, when error method called'); - stream.handleChunk(dc.send(buf1)); - stream.handleChunk(dc.send(buf2)); - stream.error(new Error('test error')); -}); -test('CopyToStream do not emit anything while paused', function () { - var stream = new CopyToStream(); - stream.on('data', function () { - assert.ok(false, "stream has not emit data when paused"); - }); - stream.on('end', function () { - assert.ok(false, "stream has not emit end when paused"); - }); - stream.on('error', function () { - assert.ok(false, "stream has not emit end when paused"); - }); - stream.pause(); - stream.handleChunk(buf2); - stream.close(); - stream.error(); -}); -test('CopyToStream emit data and error after resume', function () { - var stream = new CopyToStream(), - paused; - stream.on('data', function () { - assert.ok(!paused, "stream has not emit data when paused"); - }); - stream.on('end', function () { - assert.ok(!paused, "stream has not emit end when paused"); - }); - stream.on('error', function () { - assert.ok(!paused, "stream has not emit end when paused"); - }); - paused = true; - stream.pause(); - stream.handleChunk(buf2); - stream.error(); - paused = false; - stream.resume(); -}); -test('CopyToStream emit data and end after resume', function () { - var stream = new CopyToStream(), - paused; - stream.on('data', function () { - assert.ok(!paused, "stream has not emit data when paused"); - }); - stream.on('end', function () { - assert.ok(!paused, "stream has not emit end when paused"); - }); - stream.on('error', function () { - assert.ok(!paused, "stream has not emit end when paused"); - }); - paused = true; - stream.pause(); - stream.handleChunk(buf2); - stream.close(); - paused = false; - stream.resume(); -}); - - diff --git a/node_modules/pg/wscript b/node_modules/pg/wscript deleted file mode 100644 index 2a340d5..0000000 --- a/node_modules/pg/wscript +++ /dev/null @@ -1,32 +0,0 @@ -import Options, Utils -from os import unlink, symlink, popen -from os.path import exists - -srcdir = '.' -blddir = 'build' -VERSION = '0.0.1' - -def set_options(opt): - opt.tool_options('compiler_cxx') - -def configure(conf): - conf.check_tool('compiler_cxx') - conf.check_tool('node_addon') - - pg_config = conf.find_program('pg_config', var='PG_CONFIG', mandatory=True) - pg_libdir = popen("%s --libdir" % pg_config).readline().strip() - conf.env.append_value("LIBPATH_PG", pg_libdir) - conf.env.append_value("LIB_PG", "pq") - pg_includedir = popen("%s --includedir" % pg_config).readline().strip() - conf.env.append_value("CPPPATH_PG", pg_includedir) - -def build(bld): - obj = bld.new_task_gen('cxx', 'shlib', 'node_addon') - obj.cxxflags = ["-g", "-D_LARGEFILE_SOURCE", "-Wall"] - obj.target = 'binding' - obj.source = "./src/binding.cc" - obj.uselib = "PG" - -def test(test): - Utils.exec_command("node test/native/connection-tests.js") - Utils.exec_command("node test/native/evented-api-tests.js")

        )CdQ3F!eKyF|9D2V!F-rhUpJ8J+l7g0OBBVM#THTI&O8)>EGR%u6Gd9D9pm5!S}%&6DxW}^f|7=Y zPoO3(pTZY#?(7(|!5}5Nn!D%DotZmlW)?smSMcEE<^aT$6gw#LlwubPI9BYTffL0! zyu-EPCnz{Y#ZR&1d{F!hr_NW!&#~mXis$jseXDo@U)-kR7sMBeUt-T&RQw9By@BF9 z3f?cpmw4m-R{RHncaC**(V--ipJ<~6LkW2fi6RVfh%vcYt9@z>&M0LBSf-Q|Et8wU zCt43_*JB)mHR71wb`K@~5Cizwp{`A2uuJ^_Bcl3k{7ree$8&@l?;^2nagS+NqCDBfkB?pJws=PbK~+A7|2 z{gCDJKI-i%m4LD$n{WIwWR|c+NRy`C1#)1sSBI7FiH6z-QkhY&Q_|%I3exQ zQ`X1M?cZH4^M&BSyr;2z$+^SZUMA*0001Z+HKHROw(}?!13=vX`$@Br+fGR zZ%e`5O6%Txi$Yrz0gF{}p>fY>OnlS0Uevf}oDXW;D{d2gcE<2)oFcV80@g$H)63L{HN*d{8kVzKVW(;E)$9N_%kx5Ku3R9WJbY?JW^G#k0Wdx>E$NBBVtKRLiL?sA*s%w`TdsNz1=+~FRNdB8&+@iBD0 zXFTC4C-8-Cwv(4U=LLQ~^Oa4^rG|OTr5?ItoaPMYxxh`%a*kVU z;HYGAjq6;IY{`*awo0DlOMw(hkrYdb(O28l;MYvSx*ChcQW4f^QL5UdE3HbqvbxB$pfSg`>Cj#;?~00;nMAg}==M6d%RaIhCe zARtS)01i=0um)3FSgr#ump{<1pq_<0a34Kp8x=7I1^|9 literal 0 HcmV?d00001 diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.eot b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.eot new file mode 100644 index 0000000000000000000000000000000000000000..6bbc3cf58cb011a6b4bf3cb1612ce212608f7274 GIT binary patch literal 19836 zcmZsgRZtvUw51zpym5DThsL#WcXxNU5Zv8egL^}8cXxMp4*>!Rfh5d-=k3gW1;PMQVF3RzW%ci{fFmPHfCS@z{{K`l z41n@~^u3v|;D7Xg7dAi*;0~|>xc(Q?0$BW~UjGHq0h<3YJAeWd?h+ZWM9EYu5@Hs0EOnnkAtTzP9coXJALmS|h&nzJd% z7?C@cPUEGrLHk-#NysfAePe#dP9_6D5VGbo4fVVs0)83}G7LoWV`e*{V_8RPK>Iqw z*X0)8;uQ6FzC+dip(fgJU!9*!>pW6;pdJ$jHReX|0V)o@BosG=sN|PYN^-JAOY{e4 z&QjmR91WNK#}_%Ei?QhW{ab*7Eg=}E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IDo^P&Sg+U zP})x7RcPA<(y(?M)(wM7$61TK8pLHLaFcoFLG9`+s~KhSvofMWBYj^Pyg__~Gz^ zVrbS#zm;grG_HblLAo8oP9-#NZWhufM^z{3$3WUXaXp!-{3nNL4!8}cV&;ca=%d3VU1nt3Zibk$*NxWDo#&_+*|0lf5wV?=jBDrG`mXh=@QcmV1oxO$u)7p->W4y2zy>e5D@(8NHwYQnOtxt2>|}8N^y*? zLAVaH#{wjP5`|*22MN^&kfV^vT3GoBfg)2d0D~#z%a$(LVn&qQ_*P!*r8zUCG6=Xh z2)Hc<Dp_VfW;%qc9N}3_UXK>S6uMG{LPNv$U0AX?USRQuh@!*>kjltVfT(mB(+Zwq zg5odCBCXx1G$Wy-UE5Uv#?9=l*mm8)yx2Nk-|I@sJRLm%^SpL|459|Q&g?!}8M|UQ zJv+MwV>MeE*c@%Y;7T?k z97s`Mem7DIS@~7AlTK4UNweiV>x~Sb{@XV(9;ls!iLN^^iEjxhs!PZ&-&GZW195r+ zndNf~o5y&{3~)cb5$&+}@B{56aFCAkWD348T0K@~OkjRv+rdrAe<)I%BI2)PbzK|s z@lCV-d|y$1{46^TE;86z<-=ScRwp{iz6%o(UH|^74(U`A^(JYLS^Px7UNYX#$!tEE z8eLVw#5=>3-R9@LVgOe(L?0SjGzC!3xZ+r{(+i8_xgl9G<)?l|Op~UxGr}(IbPX0a z1bc~Q-CsQ$w%6=9msPWkij)lLN`s%BjKG*x$&BJ8m-_)4ksZrbC#k7mq + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.woff b/node_modules/jsdoc/templates/default/static/fonts/OpenSans-Regular-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..e231183dce4c7b452afc9e7799586fd285e146f4 GIT binary patch literal 22660 zcmZsBb8u!&^yZs4wmESowrx9^*tTukn%K5&Yhv4(*qAukeD&L{+O67q>#5V{x##IV z{l`6h>vp@zi-`e10Npn{(tTN_YxCRmIVMn%D!3L|6nA35hpGpD)!9{ zef#*|AOyh!fQc)}D}8f^003Aa005ms>xd~NuB0La06>I)#{_(%EYB!BUtWox2>^hE z`}Xz!L*CzXKO-9h`)|(rTVDVG0AWyXSQL$1oe97DLHdqi_y!N<2n4sOy_wB7C-6PS z>$gpag7p+MGjRIWBJh02K>cqZnOS?7esdxKfFK_LU}yi!vWwQ-#K0H;kPrTjVg3di z2-xpH^KbH-Yy0*IzV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G=D_YZrwzQ)? z9q33WI@5)&bfY^KG<2-kuv3PEaw_OSPkPatKJ=v@PF(b-5;qsKztm7)X`M`R%vxPkz=8(j&nYXNAml(yw zHZil28@!iT_Hu+@{Ny(WIL2LWbDUYsW(U>Wr-nP+<1r6-$Rj?6zxRwMJmmzw@XvPg zlIOg@&u6}}i8%zA%RFkSV;}X*r-2}igjm2r7V(M2ETM^|EN2-P+0RN=u!_}u;TxBD z#Ys+anb*AIjl@a3BuJtpNwTC!s-#J}WJsoDNj9fB!+9=nle3)T78^J!Ib7p9S0q>R zB%iH(mjWr2A}N*qGq^*+`sT!~_VKtP`-Ih%R;A6{ za<;Bp{{lIAr&0g_086+4$WmCb0RfI#xd;FV0AnDq0V71P10!&-7eyc-OSk|IQA@A} zQ(9QCG#jueSzu-$id9&!0wrOv0YzgYVz2@uM6wG31}d@)1_mm!6b1$=S+WEu2}M#w zvJ40ZDzOFuM6o0Rh*4OuK!{ke1_MN~CIN_1ShxfLh*+@(0Yq6@Sy{LN|Anvwjj;s) ML;wL%uV=LY00kR;TmS$7 literal 0 HcmV?d00001 diff --git a/node_modules/jsdoc/templates/default/static/styles/jsdoc-default.css b/node_modules/jsdoc/templates/default/static/styles/jsdoc-default.css index 124ef6c..0067cb1 100644 --- a/node_modules/jsdoc/templates/default/static/styles/jsdoc-default.css +++ b/node_modules/jsdoc/templates/default/static/styles/jsdoc-default.css @@ -1,57 +1,90 @@ +@font-face { + font-family: 'Open Sans'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Regular-webfont.eot'); + src: + local('Open Sans'), + local('OpenSans'), + url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Regular-webfont.woff') format('woff'), + url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg'); +} + +@font-face { + font-family: 'Open Sans Light'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Light-webfont.eot'); + src: + local('Open Sans Light'), + local('OpenSans Light'), + url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Light-webfont.woff') format('woff'), + url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg'); +} + html { overflow: auto; background-color: #fff; + font-size: 14px; } body { - font: 14px "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif; - line-height: 130%; - color: #000; - background-color: #fff; + font-family: 'Open Sans', sans-serif; + line-height: 1.5; + color: #4d4e53; + background-color: white; } -a { - color: #444; +a, a:visited, a:active { + color: #0095dd; + text-decoration: none; } -a:visited { - color: #444; -} - -a:active { - color: #444; +a:hover { + text-decoration: underline; } header { display: block; - padding: 6px 4px; + padding: 0px 4px; +} + +tt, code, kbd, samp { + font-family: Consolas, Monaco, 'Andale Mono', monospace; } .class-description { - font-style: italic; - font-family: Palatino, 'Palatino Linotype', serif; font-size: 130%; line-height: 140%; margin-bottom: 1em; margin-top: 1em; } +.class-description:empty { + margin: 0; +} + #main { float: left; - width: 100%; + width: 70%; +} + +article dl { + margin-bottom: 40px; } section { display: block; - background-color: #fff; padding: 12px 24px; border-bottom: 1px solid #ccc; - margin-right: 240px; + margin-right: 30px; } .variation { @@ -68,26 +101,27 @@ section nav { display: block; - float: left; - margin-left: -230px; + float: right; margin-top: 28px; - width: 220px; + width: 30%; + box-sizing: border-box; border-left: 1px solid #ccc; - padding-left: 9px; + padding-left: 16px; } nav ul { font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif; font-size: 100%; line-height: 17px; - padding:0; - margin:0; - list-style-type:none; + padding: 0; + margin: 0; + list-style-type: none; } -nav h2 a, nav h2 a:visited { - color: #A35A00; - text-decoration: none; +nav ul a, nav ul a:visited, nav ul a:active { + font-family: Consolas, Monaco, 'Andale Mono', monospace; + line-height: 18px; + color: #4D4E53; } nav h3 { @@ -98,18 +132,6 @@ nav li { margin-top: 6px; } -nav a { - color: #5C5954; -} - -nav a:visited { - color: #5C5954; -} - -nav a:active { - color: #5C5954; -} - footer { display: block; padding: 6px; @@ -118,39 +140,33 @@ footer { font-size: 90%; } +h1, h2, h3, h4 { + font-weight: 200; + margin: 0; +} + h1 { - font-size: 200%; - font-weight: bold; - letter-spacing: -0.01em; - margin: 6px 0 9px 0; + font-family: 'Open Sans Light', sans-serif; + font-size: 48px; + letter-spacing: -2px; + margin: 12px 24px 20px; } -h2 +h2, h3 { - font-size: 170%; - font-weight: bold; - letter-spacing: -0.01em; - margin: 6px 0 3px 0; -} - -h3 -{ - font-size: 150%; - font-weight: bold; - letter-spacing: -0.01em; - margin-top: 16px; - margin: 6px 0 3px 0; + font-size: 30px; + font-weight: 700; + letter-spacing: -1px; + margin-bottom: 12px; } h4 { - font-size: 130%; - font-weight: bold; - letter-spacing: -0.01em; - margin-top: 16px; - margin: 18px 0 3px 0; - color: #A35A00; + font-size: 18px; + letter-spacing: -0.33px; + margin-bottom: 12px; + color: #4d4e53; } h5, .container-overview .subsection-title @@ -158,7 +174,7 @@ h5, .container-overview .subsection-title font-size: 120%; font-weight: bold; letter-spacing: -0.01em; - margin: 8px 0 3px -16px; + margin: 8px 0 3px 0; } h6 @@ -176,6 +192,11 @@ h6 text-decoration: none; } +.clear +{ + clear: both; +} + .important { font-weight: bold; @@ -191,12 +212,12 @@ h6 } .name, .signature { - font-family: Consolas, "Lucida Console", Monaco, monospace; + font-family: Consolas, Monaco, 'Andale Mono', monospace; } .details { margin-top: 14px; border-left: 2px solid #DDD; } -.details dt { width:100px; float:left; padding-left: 10px; padding-top: 6px; } -.details dd { margin-left: 50px; } +.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } +.details dd { margin-left: 70px; } .details ul { margin: 0; } .details ul { list-style-type: none; } .details li { margin-left: 30px; padding-top: 6px; } @@ -205,14 +226,12 @@ h6 .description { margin-bottom: 1em; - margin-left: -16px; margin-top: 1em; } .code-caption { font-style: italic; - font-family: Palatino, 'Palatino Linotype', serif; font-size: 107%; margin: 0; } @@ -230,14 +249,13 @@ h6 .prettyprint code { - font-family: Consolas, 'Lucida Console', Monaco, monospace; font-size: 100%; line-height: 18px; display: block; padding: 4px 12px; margin: 0; background-color: #fff; - color: #000; + color: #4D4E53; } .prettyprint code span.line @@ -286,8 +304,8 @@ h6 } .params .name, .props .name, .name code { - color: #A35A00; - font-family: Consolas, 'Lucida Console', Monaco, monospace; + color: #4D4E53; + font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 100%; } diff --git a/node_modules/jsdoc/templates/default/static/styles/prettify-tomorrow.css b/node_modules/jsdoc/templates/default/static/styles/prettify-tomorrow.css index aa2908c..b6f92a7 100644 --- a/node_modules/jsdoc/templates/default/static/styles/prettify-tomorrow.css +++ b/node_modules/jsdoc/templates/default/static/styles/prettify-tomorrow.css @@ -98,7 +98,7 @@ /* pre.prettyprint { background: white; - font-family: Menlo, Monaco, Consolas, monospace; + font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 12px; line-height: 1.5; border: 1px solid #ccc; diff --git a/node_modules/jsdoc/templates/default/tmpl/augments.tmpl b/node_modules/jsdoc/templates/default/tmpl/augments.tmpl new file mode 100644 index 0000000..446d28a --- /dev/null +++ b/node_modules/jsdoc/templates/default/tmpl/augments.tmpl @@ -0,0 +1,10 @@ + + + +