From 8cfbdeb567a9f02531eb64311eb081ddb55ca6f4 Mon Sep 17 00:00:00 2001 From: Jonathan Lipps Date: Mon, 24 Sep 2012 11:37:12 -0700 Subject: [PATCH] bringing in lots of work from before --- .gitignore | 2 + models/post.js | 14 +- node_modules/.bin/express | 1 - node_modules/.bin/jade | 1 - node_modules/.bin/nopt | 1 - node_modules/.bin/vows | 1 - node_modules/.bin/wd | 1 - node_modules/argparser/ArgParser.js | 286 -- node_modules/argparser/LICENCE | 22 - node_modules/argparser/README.md | 380 -- node_modules/argparser/package.json | 45 - node_modules/argparser/test/shinout.test.js | 40 - node_modules/argparser/test/test.js | 125 - node_modules/assert/assert.js | 307 -- .../util/node_modules/events.node/events.js | 209 -- .../node_modules/events.node/package.json | 39 - .../assert/node_modules/util/package.json | 40 - node_modules/assert/node_modules/util/util.js | 439 --- node_modules/assert/package.json | 40 - node_modules/express/.npmignore | 8 - node_modules/express/.travis.yml | 3 - node_modules/express/History.md | 866 ----- node_modules/express/LICENSE | 22 - node_modules/express/Makefile | 28 - node_modules/express/Readme.md | 179 - node_modules/express/bin/express | 380 -- node_modules/express/client.js | 25 - node_modules/express/index.js | 4 - node_modules/express/lib-cov/application.js | 510 --- node_modules/express/lib-cov/express.js | 65 - node_modules/express/lib-cov/middleware.js | 54 - node_modules/express/lib-cov/request.js | 225 -- node_modules/express/lib-cov/response.js | 611 ---- .../express/lib-cov/router/collection.js | 40 - node_modules/express/lib-cov/router/index.js | 515 --- .../express/lib-cov/router/methods.js | 9 - node_modules/express/lib-cov/router/route.js | 68 - node_modules/express/lib-cov/utils.js | 151 - node_modules/express/lib-cov/view.js | 81 - node_modules/express/lib/application.js | 534 --- node_modules/express/lib/express.js | 91 - node_modules/express/lib/middleware.js | 37 - node_modules/express/lib/request.js | 415 --- node_modules/express/lib/response.js | 640 ---- node_modules/express/lib/router/index.js | 295 -- node_modules/express/lib/router/methods.js | 36 - node_modules/express/lib/router/route.js | 78 - node_modules/express/lib/utils.js | 254 -- node_modules/express/lib/view.js | 81 - .../express/node_modules/commander/.npmignore | 4 - .../node_modules/commander/.travis.yml | 4 - .../express/node_modules/commander/History.md | 99 - .../express/node_modules/commander/Makefile | 7 - .../express/node_modules/commander/Readme.md | 263 -- .../express/node_modules/commander/index.js | 2 - .../node_modules/commander/lib/commander.js | 992 ----- .../node_modules/commander/package.json | 38 - .../express/node_modules/connect/.npmignore | 12 - .../express/node_modules/connect/LICENSE | 24 - .../express/node_modules/connect/index.js | 4 - .../express/node_modules/connect/lib/cache.js | 81 - .../node_modules/connect/lib/connect.js | 84 - .../express/node_modules/connect/lib/index.js | 55 - .../connect/lib/middleware/basicAuth.js | 98 - .../connect/lib/middleware/bodyParser.js | 61 - .../connect/lib/middleware/compress.js | 142 - .../connect/lib/middleware/cookieParser.js | 62 - .../connect/lib/middleware/cookieSession.js | 96 - .../connect/lib/middleware/csrf.js | 75 - .../connect/lib/middleware/directory.js | 227 -- .../connect/lib/middleware/errorHandler.js | 87 - .../connect/lib/middleware/favicon.js | 86 - .../connect/lib/middleware/json.js | 61 - .../connect/lib/middleware/limit.js | 77 - .../connect/lib/middleware/logger.js | 331 -- .../connect/lib/middleware/methodOverride.js | 40 - .../connect/lib/middleware/multipart.js | 99 - .../connect/lib/middleware/query.js | 46 - .../connect/lib/middleware/responseTime.js | 32 - .../connect/lib/middleware/session.js | 325 -- .../connect/lib/middleware/session/cookie.js | 129 - .../connect/lib/middleware/session/memory.js | 131 - .../connect/lib/middleware/session/session.js | 117 - .../connect/lib/middleware/session/store.js | 86 - .../connect/lib/middleware/static.js | 246 -- .../connect/lib/middleware/staticCache.js | 188 - .../connect/lib/middleware/urlencoded.js | 54 - .../connect/lib/middleware/vhost.js | 40 - .../express/node_modules/connect/lib/patch.js | 79 - .../express/node_modules/connect/lib/proto.js | 231 -- .../connect/lib/public/directory.html | 75 - .../connect/lib/public/error.html | 13 - .../connect/lib/public/favicon.ico | Bin 1406 -> 0 bytes .../connect/lib/public/icons/page.png | Bin 635 -> 0 bytes .../connect/lib/public/icons/page_add.png | Bin 739 -> 0 bytes .../connect/lib/public/icons/page_attach.png | Bin 794 -> 0 bytes .../connect/lib/public/icons/page_code.png | Bin 818 -> 0 bytes .../connect/lib/public/icons/page_copy.png | Bin 663 -> 0 bytes .../connect/lib/public/icons/page_delete.png | Bin 740 -> 0 bytes .../connect/lib/public/icons/page_edit.png | Bin 807 -> 0 bytes .../connect/lib/public/icons/page_error.png | Bin 793 -> 0 bytes .../connect/lib/public/icons/page_excel.png | Bin 817 -> 0 bytes .../connect/lib/public/icons/page_find.png | Bin 879 -> 0 bytes .../connect/lib/public/icons/page_gear.png | Bin 833 -> 0 bytes .../connect/lib/public/icons/page_go.png | Bin 779 -> 0 bytes .../connect/lib/public/icons/page_green.png | Bin 621 -> 0 bytes .../connect/lib/public/icons/page_key.png | Bin 801 -> 0 bytes .../lib/public/icons/page_lightning.png | Bin 839 -> 0 bytes .../connect/lib/public/icons/page_link.png | Bin 830 -> 0 bytes .../lib/public/icons/page_paintbrush.png | Bin 813 -> 0 bytes .../connect/lib/public/icons/page_paste.png | Bin 703 -> 0 bytes .../connect/lib/public/icons/page_red.png | Bin 641 -> 0 bytes .../connect/lib/public/icons/page_refresh.png | Bin 858 -> 0 bytes .../connect/lib/public/icons/page_save.png | Bin 774 -> 0 bytes .../connect/lib/public/icons/page_white.png | Bin 294 -> 0 bytes .../lib/public/icons/page_white_acrobat.png | Bin 591 -> 0 bytes .../public/icons/page_white_actionscript.png | Bin 664 -> 0 bytes .../lib/public/icons/page_white_add.png | Bin 512 -> 0 bytes .../connect/lib/public/icons/page_white_c.png | Bin 587 -> 0 bytes .../lib/public/icons/page_white_camera.png | Bin 656 -> 0 bytes .../lib/public/icons/page_white_cd.png | Bin 666 -> 0 bytes .../lib/public/icons/page_white_code.png | Bin 603 -> 0 bytes .../lib/public/icons/page_white_code_red.png | Bin 587 -> 0 bytes .../public/icons/page_white_coldfusion.png | Bin 592 -> 0 bytes .../public/icons/page_white_compressed.png | Bin 724 -> 0 bytes .../lib/public/icons/page_white_copy.png | Bin 309 -> 0 bytes .../lib/public/icons/page_white_cplusplus.png | Bin 621 -> 0 bytes .../lib/public/icons/page_white_csharp.png | Bin 700 -> 0 bytes .../lib/public/icons/page_white_cup.png | Bin 639 -> 0 bytes .../lib/public/icons/page_white_database.png | Bin 579 -> 0 bytes .../lib/public/icons/page_white_delete.png | Bin 536 -> 0 bytes .../lib/public/icons/page_white_dvd.png | Bin 638 -> 0 bytes .../lib/public/icons/page_white_edit.png | Bin 618 -> 0 bytes .../lib/public/icons/page_white_error.png | Bin 623 -> 0 bytes .../lib/public/icons/page_white_excel.png | Bin 663 -> 0 bytes .../lib/public/icons/page_white_find.png | Bin 676 -> 0 bytes .../lib/public/icons/page_white_flash.png | Bin 582 -> 0 bytes .../lib/public/icons/page_white_freehand.png | Bin 639 -> 0 bytes .../lib/public/icons/page_white_gear.png | Bin 402 -> 0 bytes .../lib/public/icons/page_white_get.png | Bin 516 -> 0 bytes .../lib/public/icons/page_white_go.png | Bin 612 -> 0 bytes .../connect/lib/public/icons/page_white_h.png | Bin 603 -> 0 bytes .../public/icons/page_white_horizontal.png | Bin 296 -> 0 bytes .../lib/public/icons/page_white_key.png | Bin 616 -> 0 bytes .../lib/public/icons/page_white_lightning.png | Bin 669 -> 0 bytes .../lib/public/icons/page_white_link.png | Bin 614 -> 0 bytes .../lib/public/icons/page_white_magnify.png | Bin 554 -> 0 bytes .../lib/public/icons/page_white_medal.png | Bin 706 -> 0 bytes .../lib/public/icons/page_white_office.png | Bin 779 -> 0 bytes .../lib/public/icons/page_white_paint.png | Bin 688 -> 0 bytes .../public/icons/page_white_paintbrush.png | Bin 618 -> 0 bytes .../lib/public/icons/page_white_paste.png | Bin 620 -> 0 bytes .../lib/public/icons/page_white_php.png | Bin 538 -> 0 bytes .../lib/public/icons/page_white_picture.png | Bin 650 -> 0 bytes .../public/icons/page_white_powerpoint.png | Bin 588 -> 0 bytes .../lib/public/icons/page_white_put.png | Bin 523 -> 0 bytes .../lib/public/icons/page_white_ruby.png | Bin 626 -> 0 bytes .../lib/public/icons/page_white_stack.png | Bin 317 -> 0 bytes .../lib/public/icons/page_white_star.png | Bin 565 -> 0 bytes .../lib/public/icons/page_white_swoosh.png | Bin 634 -> 0 bytes .../lib/public/icons/page_white_text.png | Bin 342 -> 0 bytes .../public/icons/page_white_text_width.png | Bin 315 -> 0 bytes .../lib/public/icons/page_white_tux.png | Bin 668 -> 0 bytes .../lib/public/icons/page_white_vector.png | Bin 644 -> 0 bytes .../public/icons/page_white_visualstudio.png | Bin 702 -> 0 bytes .../lib/public/icons/page_white_width.png | Bin 309 -> 0 bytes .../lib/public/icons/page_white_word.png | Bin 651 -> 0 bytes .../lib/public/icons/page_white_world.png | Bin 734 -> 0 bytes .../lib/public/icons/page_white_wrench.png | Bin 613 -> 0 bytes .../lib/public/icons/page_white_zip.png | Bin 386 -> 0 bytes .../connect/lib/public/icons/page_word.png | Bin 777 -> 0 bytes .../connect/lib/public/icons/page_world.png | Bin 903 -> 0 bytes .../node_modules/connect/lib/public/style.css | 141 - .../express/node_modules/connect/lib/utils.js | 490 --- .../connect/node_modules/crc/.gitmodules | 3 - .../connect/node_modules/crc/README.md | 27 - .../connect/node_modules/crc/lib/crc.js | 362 -- .../connect/node_modules/crc/package.json | 29 - .../node_modules/crc/tests/crc_tests.js | 64 - .../crc/tests/nodeunit/.npmignore | 3 - .../crc/tests/nodeunit/CONTRIBUTORS.md | 56 - .../node_modules/crc/tests/nodeunit/LICENSE | 19 - .../node_modules/crc/tests/nodeunit/Makefile | 126 - .../node_modules/crc/tests/nodeunit/README.md | 430 --- .../crc/tests/nodeunit/bin/nodeunit | 108 - .../crc/tests/nodeunit/bin/nodeunit.json | 10 - .../crc/tests/nodeunit/deps/async.js | 602 ---- .../crc/tests/nodeunit/deps/ejs.js | 125 - .../crc/tests/nodeunit/deps/json2.js | 483 --- .../crc/tests/nodeunit/doc/nodeunit.md | 60 - .../nodeunit/examples/browser/nodeunit.js | 1757 --------- .../tests/nodeunit/examples/browser/suite1.js | 12 - .../tests/nodeunit/examples/browser/suite2.js | 13 - .../tests/nodeunit/examples/browser/test.html | 16 - .../crc/tests/nodeunit/img/example_fail.png | Bin 38642 -> 0 bytes .../crc/tests/nodeunit/img/example_pass.png | Bin 14133 -> 0 bytes .../node_modules/crc/tests/nodeunit/index.js | 3 - .../crc/tests/nodeunit/lib/assert.js | 316 -- .../crc/tests/nodeunit/lib/core.js | 236 -- .../crc/tests/nodeunit/lib/nodeunit.js | 80 - .../tests/nodeunit/lib/reporters/browser.js | 119 - .../tests/nodeunit/lib/reporters/default.js | 110 - .../crc/tests/nodeunit/lib/reporters/html.js | 112 - .../crc/tests/nodeunit/lib/reporters/index.js | 9 - .../crc/tests/nodeunit/lib/reporters/junit.js | 183 - .../tests/nodeunit/lib/reporters/minimal.js | 117 - .../nodeunit/lib/reporters/skip_passed.js | 110 - .../crc/tests/nodeunit/lib/types.js | 187 - .../crc/tests/nodeunit/lib/utils.js | 209 -- .../crc/tests/nodeunit/man1/nodeunit.1 | 95 - .../crc/tests/nodeunit/nodelint.cfg | 4 - .../crc/tests/nodeunit/package.json | 53 - .../crc/tests/nodeunit/share/junit.xml.ejs | 19 - .../crc/tests/nodeunit/share/license.js | 11 - .../crc/tests/nodeunit/share/nodeunit.css | 70 - .../fixtures/coffee/mock_coffee_module.coffee | 4 - .../test/fixtures/dir/mock_module3.js | 1 - .../test/fixtures/dir/mock_module4.js | 1 - .../nodeunit/test/fixtures/mock_module1.js | 1 - .../nodeunit/test/fixtures/mock_module2.js | 1 - .../nodeunit/test/fixtures/raw_jscode1.js | 3 - .../nodeunit/test/fixtures/raw_jscode2.js | 3 - .../nodeunit/test/fixtures/raw_jscode3.js | 1 - .../crc/tests/nodeunit/test/test-base.js | 219 -- .../nodeunit/test/test-failing-callbacks.js | 114 - .../crc/tests/nodeunit/test/test-httputil.js | 55 - .../crc/tests/nodeunit/test/test-runfiles.js | 214 -- .../crc/tests/nodeunit/test/test-runmodule.js | 125 - .../crc/tests/nodeunit/test/test-runtest.js | 46 - .../crc/tests/nodeunit/test/test-sandbox.js | 31 - .../crc/tests/nodeunit/test/test-testcase.js | 234 -- .../crc/tests/nodeunit/test/test.html | 26 - .../node_modules/formidable/.npmignore | 4 - .../node_modules/formidable/.travis.yml | 4 - .../connect/node_modules/formidable/Makefile | 14 - .../connect/node_modules/formidable/Readme.md | 303 -- .../connect/node_modules/formidable/TODO | 3 - .../benchmark/bench-multipart-parser.js | 70 - .../node_modules/formidable/example/post.js | 43 - .../node_modules/formidable/example/upload.js | 48 - .../connect/node_modules/formidable/index.js | 1 - .../node_modules/formidable/lib/file.js | 61 - .../formidable/lib/incoming_form.js | 378 -- .../node_modules/formidable/lib/index.js | 3 - .../formidable/lib/multipart_parser.js | 312 -- .../formidable/lib/querystring_parser.js | 25 - .../node_modules/formidable/lib/util.js | 6 - .../node_modules/formidable/package.json | 29 - .../node_modules/formidable/test/common.js | 19 - .../test/fixture/file/funkyfilename.txt | 1 - .../formidable/test/fixture/file/plain.txt | 1 - .../http/special-chars-in-filename/info.md | 3 - .../formidable/test/fixture/js/no-filename.js | 3 - .../fixture/js/special-chars-in-filename.js | 21 - .../formidable/test/fixture/multipart.js | 72 - .../test/integration/test-fixtures.js | 89 - .../formidable/test/legacy/common.js | 24 - .../integration/test-multipart-parser.js | 80 - .../test/legacy/simple/test-file.js | 104 - .../test/legacy/simple/test-incoming-form.js | 726 ---- .../legacy/simple/test-multipart-parser.js | 50 - .../legacy/simple/test-querystring-parser.js | 45 - .../legacy/system/test-multi-video-upload.js | 72 - .../node_modules/formidable/test/run.js | 2 - .../test/unit/test-incoming-form.js | 63 - .../node_modules/formidable/tool/record.js | 47 - .../connect/node_modules/mime/LICENSE | 19 - .../connect/node_modules/mime/README.md | 50 - .../connect/node_modules/mime/mime.js | 92 - .../connect/node_modules/mime/package.json | 40 - .../connect/node_modules/mime/test.js | 79 - .../node_modules/mime/types/mime.types | 1479 -------- .../node_modules/mime/types/node.types | 43 - .../connect/node_modules/qs/.gitmodules | 6 - .../connect/node_modules/qs/.npmignore | 1 - .../connect/node_modules/qs/.travis.yml | 4 - .../connect/node_modules/qs/History.md | 73 - .../connect/node_modules/qs/Makefile | 5 - .../connect/node_modules/qs/Readme.md | 54 - .../connect/node_modules/qs/benchmark.js | 17 - .../connect/node_modules/qs/examples.js | 51 - .../connect/node_modules/qs/index.js | 2 - .../node_modules/qs/lib/querystring.js | 264 -- .../connect/node_modules/qs/package.json | 30 - .../connect/node_modules/qs/test/mocha.opts | 2 - .../connect/node_modules/qs/test/parse.js | 167 - .../connect/node_modules/qs/test/stringify.js | 103 - .../express/node_modules/connect/package.json | 45 - .../express/node_modules/debug/.npmignore | 4 - .../express/node_modules/debug/History.md | 41 - .../express/node_modules/debug/Makefile | 5 - .../express/node_modules/debug/Readme.md | 130 - .../express/node_modules/debug/debug.js | 122 - .../express/node_modules/debug/example/app.js | 19 - .../node_modules/debug/example/browser.html | 24 - .../node_modules/debug/example/wildcards.js | 10 - .../node_modules/debug/example/worker.js | 22 - .../express/node_modules/debug/index.js | 2 - .../express/node_modules/debug/lib/debug.js | 147 - .../express/node_modules/debug/package.json | 29 - .../express/node_modules/mime/LICENSE | 19 - .../express/node_modules/mime/README.md | 63 - .../express/node_modules/mime/mime.js | 93 - .../express/node_modules/mime/package.json | 38 - .../express/node_modules/mime/test.js | 53 - .../node_modules/mime/types/mime.types | 1510 -------- .../node_modules/mime/types/node.types | 48 - .../node_modules/mkdirp/.gitignore.orig | 2 - .../node_modules/mkdirp/.gitignore.rej | 5 - .../express/node_modules/mkdirp/.npmignore | 2 - .../express/node_modules/mkdirp/.travis.yml | 4 - .../express/node_modules/mkdirp/LICENSE | 21 - .../node_modules/mkdirp/README.markdown | 61 - .../node_modules/mkdirp/examples/pow.js | 6 - .../node_modules/mkdirp/examples/pow.js.orig | 6 - .../node_modules/mkdirp/examples/pow.js.rej | 19 - .../express/node_modules/mkdirp/index.js | 83 - .../express/node_modules/mkdirp/package.json | 37 - .../express/node_modules/mkdirp/test/chmod.js | 38 - .../node_modules/mkdirp/test/clobber.js | 37 - .../node_modules/mkdirp/test/mkdirp.js | 28 - .../express/node_modules/mkdirp/test/perm.js | 32 - .../node_modules/mkdirp/test/perm_sync.js | 39 - .../express/node_modules/mkdirp/test/race.js | 41 - .../express/node_modules/mkdirp/test/rel.js | 32 - .../node_modules/mkdirp/test/return.js | 25 - .../node_modules/mkdirp/test/return_sync.js | 24 - .../express/node_modules/mkdirp/test/sync.js | 32 - .../express/node_modules/mkdirp/test/umask.js | 28 - .../node_modules/mkdirp/test/umask_sync.js | 32 - node_modules/express/package.json | 74 - node_modules/express/test.js | 16 - node_modules/jade/.npmignore | 15 - node_modules/jade/LICENSE | 22 - node_modules/jade/bin/jade | 147 - node_modules/jade/index.js | 4 - node_modules/jade/jade.1 | 16 - node_modules/jade/jade.js | 3179 ----------------- node_modules/jade/jade.md | 368 -- node_modules/jade/jade.min.js | 2 - node_modules/jade/lib/compiler.js | 504 --- node_modules/jade/lib/doctypes.js | 18 - node_modules/jade/lib/filters.js | 97 - node_modules/jade/lib/inline-tags.js | 28 - node_modules/jade/lib/jade.js | 237 -- node_modules/jade/lib/lexer.js | 728 ---- node_modules/jade/lib/nodes/block-comment.js | 33 - node_modules/jade/lib/nodes/block.js | 100 - node_modules/jade/lib/nodes/case.js | 43 - node_modules/jade/lib/nodes/code.js | 35 - node_modules/jade/lib/nodes/comment.js | 32 - node_modules/jade/lib/nodes/doctype.js | 29 - node_modules/jade/lib/nodes/each.js | 35 - node_modules/jade/lib/nodes/filter.js | 35 - node_modules/jade/lib/nodes/index.js | 20 - node_modules/jade/lib/nodes/literal.js | 32 - node_modules/jade/lib/nodes/mixin.js | 34 - node_modules/jade/lib/nodes/node.js | 14 - node_modules/jade/lib/nodes/tag.js | 92 - node_modules/jade/lib/nodes/text.js | 42 - node_modules/jade/lib/parser.js | 654 ---- node_modules/jade/lib/runtime.js | 127 - node_modules/jade/lib/self-closing.js | 19 - node_modules/jade/lib/utils.js | 49 - .../jade/node_modules/commander/.npmignore | 4 - .../jade/node_modules/commander/.travis.yml | 4 - .../jade/node_modules/commander/History.md | 99 - .../jade/node_modules/commander/Makefile | 7 - .../jade/node_modules/commander/Readme.md | 263 -- .../jade/node_modules/commander/index.js | 2 - .../node_modules/commander/lib/commander.js | 992 ----- .../jade/node_modules/commander/package.json | 38 - .../jade/node_modules/mkdirp/.gitignore.orig | 2 - .../jade/node_modules/mkdirp/.gitignore.rej | 5 - .../jade/node_modules/mkdirp/.npmignore | 2 - node_modules/jade/node_modules/mkdirp/LICENSE | 21 - .../jade/node_modules/mkdirp/README.markdown | 54 - .../jade/node_modules/mkdirp/examples/pow.js | 6 - .../node_modules/mkdirp/examples/pow.js.orig | 6 - .../node_modules/mkdirp/examples/pow.js.rej | 19 - .../jade/node_modules/mkdirp/index.js | 79 - .../jade/node_modules/mkdirp/package.json | 40 - .../jade/node_modules/mkdirp/test/chmod.js | 38 - .../jade/node_modules/mkdirp/test/clobber.js | 37 - .../jade/node_modules/mkdirp/test/mkdirp.js | 28 - .../jade/node_modules/mkdirp/test/perm.js | 32 - .../node_modules/mkdirp/test/perm_sync.js | 39 - .../jade/node_modules/mkdirp/test/race.js | 41 - .../jade/node_modules/mkdirp/test/rel.js | 32 - .../jade/node_modules/mkdirp/test/sync.js | 27 - .../jade/node_modules/mkdirp/test/umask.js | 28 - .../node_modules/mkdirp/test/umask_sync.js | 27 - node_modules/jade/package.json | 50 - node_modules/jade/runtime.js | 132 - node_modules/jade/runtime.min.js | 1 - node_modules/jade/test.jade | 7 - node_modules/jade/testing/head.jade | 5 - node_modules/jade/testing/index.jade | 10 - node_modules/jade/testing/index.js | 11 - node_modules/jade/testing/layout.jade | 6 - node_modules/jade/testing/user.jade | 7 - node_modules/jade/testing/user.js | 27 - node_modules/nopt/.npmignore | 0 node_modules/nopt/LICENSE | 23 - node_modules/nopt/README.md | 208 -- node_modules/nopt/bin/nopt.js | 44 - node_modules/nopt/examples/my-program.js | 30 - node_modules/nopt/lib/nopt.js | 552 --- .../nopt/node_modules/abbrev/README.md | 23 - .../nopt/node_modules/abbrev/lib/abbrev.js | 106 - .../nopt/node_modules/abbrev/package.json | 32 - node_modules/nopt/package.json | 42 - node_modules/should/.gitmodules | 3 - node_modules/should/.npmignore | 1 - node_modules/should/History.md | 106 - node_modules/should/Makefile | 6 - node_modules/should/Readme.md | 367 -- node_modules/should/examples/runner.js | 53 - node_modules/should/index.js | 2 - node_modules/should/lib/eql.js | 91 - node_modules/should/lib/should.js | 701 ---- node_modules/should/package.json | 42 - node_modules/should/test/exist.test.js | 96 - node_modules/should/test/should.test.js | 557 --- node_modules/underscore.string/.travis.yml | 8 - node_modules/underscore.string/Gemfile | 5 - node_modules/underscore.string/Gemfile.lock | 34 - .../underscore.string/README.markdown | 668 ---- node_modules/underscore.string/Rakefile | 28 - .../dist/underscore.string.min.js | 1 - .../lib/underscore.string.js | 525 --- node_modules/underscore.string/package.json | 80 - .../underscore.string/test/run-qunit.js | 44 - node_modules/underscore.string/test/speed.js | 138 - .../underscore.string/test/strings.js | 438 --- .../test/strings_standalone.js | 12 - node_modules/underscore.string/test/test.html | 31 - .../test/test_standalone.html | 18 - .../test/test_underscore/arrays.js | 166 - .../test/test_underscore/chaining.js | 59 - .../test/test_underscore/collections.js | 270 -- .../test/test_underscore/functions.js | 198 - .../test/test_underscore/objects.js | 535 --- .../test/test_underscore/speed.js | 70 - .../test/test_underscore/temp.js | 27 - .../test/test_underscore/temp_tests.html | 19 - .../test/test_underscore/test.html | 43 - .../test/test_underscore/utility.js | 155 - .../test/test_underscore/vendor/jquery.js | 19 - .../test/test_underscore/vendor/jslitmus.js | 670 ---- .../test/test_underscore/vendor/qunit.css | 196 - .../test/test_underscore/vendor/qunit.js | 2360 ------------ .../underscore.string/test/underscore.js | 999 ------ node_modules/underscore/.npmignore | 3 - node_modules/underscore/CNAME | 1 - node_modules/underscore/LICENSE | 22 - node_modules/underscore/README.md | 19 - node_modules/underscore/favicon.ico | Bin 1406 -> 0 bytes node_modules/underscore/index.html | 2109 ----------- node_modules/underscore/index.js | 1 - node_modules/underscore/package.json | 37 - node_modules/underscore/raw/underscore.psd | Bin 215540 -> 0 bytes node_modules/underscore/underscore-min.js | 32 - node_modules/underscore/underscore.js | 1059 ------ node_modules/vows/.npmignore | 1 - node_modules/vows/.travis.yml | 6 - node_modules/vows/LICENSE | 20 - node_modules/vows/Makefile | 7 - node_modules/vows/README.md | 65 - node_modules/vows/bin/vows | 560 --- node_modules/vows/lib/assert/error.js | 42 - node_modules/vows/lib/assert/macros.js | 215 -- node_modules/vows/lib/assert/utils.js | 77 - node_modules/vows/lib/vows.js | 255 -- node_modules/vows/lib/vows/console.js | 140 - node_modules/vows/lib/vows/context.js | 76 - node_modules/vows/lib/vows/coverage/file.js | 29 - .../coverage/fragments/coverage-foot.html | 2 - .../coverage/fragments/coverage-head.html | 61 - .../vows/lib/vows/coverage/report-html.js | 54 - .../vows/lib/vows/coverage/report-json.js | 54 - .../vows/lib/vows/coverage/report-plain.js | 38 - .../vows/lib/vows/coverage/report-xml.js | 81 - node_modules/vows/lib/vows/extras.js | 28 - .../vows/lib/vows/reporters/dot-matrix.js | 67 - node_modules/vows/lib/vows/reporters/json.js | 33 - .../vows/lib/vows/reporters/silent.js | 8 - node_modules/vows/lib/vows/reporters/spec.js | 42 - node_modules/vows/lib/vows/reporters/watch.js | 37 - node_modules/vows/lib/vows/reporters/xunit.js | 90 - node_modules/vows/lib/vows/suite.js | 380 -- node_modules/vows/node_modules/eyes/LICENSE | 20 - node_modules/vows/node_modules/eyes/Makefile | 4 - node_modules/vows/node_modules/eyes/README.md | 72 - .../vows/node_modules/eyes/lib/eyes.js | 236 -- .../vows/node_modules/eyes/package.json | 48 - .../vows/node_modules/eyes/test/eyes-test.js | 56 - node_modules/vows/package.json | 50 - node_modules/vows/test/assert-test.js | 133 - .../vows/test/fixtures/isolate/failing.js | 18 - .../vows/test/fixtures/isolate/log.js | 18 - .../vows/test/fixtures/isolate/passing.js | 17 - .../vows/test/fixtures/isolate/stderr.js | 18 - .../test/fixtures/supress-stdout/output.js | 16 - node_modules/vows/test/isolate-test.js | 140 - node_modules/vows/test/supress-stdout-test.js | 43 - node_modules/vows/test/vows-error-test.js | 51 - node_modules/vows/test/vows-test.js | 522 --- .../vows/test/vows_underscore_test.js | 14 - node_modules/wd/.npmignore | 2 - node_modules/wd/LICENSE.APACHE2 | 15 - node_modules/wd/Makefile | 33 - node_modules/wd/README.md | 613 ---- node_modules/wd/doc/jsonwiremap-all.md | 1049 ------ node_modules/wd/doc/jsonwiremap-supported.md | 543 --- node_modules/wd/doc/supported-methods-old.md | 24 - node_modules/wd/examples/example.chrome.js | 37 - node_modules/wd/examples/example.firefox.js | 46 - .../wd/examples/example.ondemand.ie.js | 44 - node_modules/wd/examples/example.ondemand.js | 42 - node_modules/wd/lib/bin.js | 26 - .../lib/browser-scripts/safe-execute-async.js | 7 - .../wd/lib/browser-scripts/safe-execute.js | 7 - .../wait-for-cond-in-browser.js | 32 - node_modules/wd/lib/builder.js | 341 -- node_modules/wd/lib/element.js | 52 - node_modules/wd/lib/jsonwire-errors.js | 92 - node_modules/wd/lib/main.js | 87 - node_modules/wd/lib/protocol.js | 701 ---- node_modules/wd/lib/special-keys.js | 61 - .../wd/node_modules/async/.gitmodules | 9 - node_modules/wd/node_modules/async/.npmignore | 4 - node_modules/wd/node_modules/async/LICENSE | 19 - node_modules/wd/node_modules/async/Makefile | 25 - node_modules/wd/node_modules/async/README.md | 1021 ------ node_modules/wd/node_modules/async/index.js | 3 - .../wd/node_modules/async/lib/async.js | 692 ---- .../wd/node_modules/async/package.json | 38 - node_modules/wd/package.json | 49 - .../wd/test/common/basic-test-base.coffee | 48 - .../wd/test/common/basic-test-base.js | 64 - .../wd/test/common/leak-detector.coffee | 13 - node_modules/wd/test/common/leak-detector.js | 23 - node_modules/wd/test/saucelabs/.npmignore | 3 - node_modules/wd/test/saucelabs/README | 5 - .../wd/test/saucelabs/basic-test.coffee | 31 - node_modules/wd/test/saucelabs/basic-test.js | 36 - .../test/saucelabs/browser-init-test.coffee | 99 - .../wd/test/saucelabs/browser-init-test.js | 124 - .../wd/test/saucelabs/config-helper.coffee | 17 - .../wd/test/saucelabs/config-helper.js | 24 - .../wd/test/saucelabs/config.sample.coffee | 5 - .../wd/test/saucelabs/config.sample.js | 11 - .../test/unit/assets/element-test-page.html | 15 - .../wd/test/unit/assets/test-page.html | 96 - node_modules/wd/test/unit/basic-test.coffee | 13 - node_modules/wd/test/unit/basic-test.js | 21 - .../wd/test/unit/browser-init-test.coffee | 83 - .../wd/test/unit/browser-init-test.js | 108 - node_modules/wd/test/unit/element-test.coffee | 113 - node_modules/wd/test/unit/element-test.js | 148 - .../wd/test/unit/per-method-test.coffee | 1184 ------ node_modules/wd/test/unit/per-method-test.js | 1374 ------- .../wd/test/unit/wd-remote-init-test.coffee | 115 - .../wd/test/unit/wd-remote-init-test.js | 140 - public/app.js | 20 + public/style.css | 47 +- raw_tests.js | 50 +- tests.js | 4 +- views/layout.jade | 5 +- views/post/index.jade | 20 +- 571 files changed, 144 insertions(+), 66589 deletions(-) delete mode 120000 node_modules/.bin/express delete mode 120000 node_modules/.bin/jade delete mode 120000 node_modules/.bin/nopt delete mode 120000 node_modules/.bin/vows delete mode 120000 node_modules/.bin/wd delete mode 100644 node_modules/argparser/ArgParser.js delete mode 100644 node_modules/argparser/LICENCE delete mode 100644 node_modules/argparser/README.md delete mode 100644 node_modules/argparser/package.json delete mode 100644 node_modules/argparser/test/shinout.test.js delete mode 100644 node_modules/argparser/test/test.js delete mode 100644 node_modules/assert/assert.js delete mode 100644 node_modules/assert/node_modules/util/node_modules/events.node/events.js delete mode 100644 node_modules/assert/node_modules/util/node_modules/events.node/package.json delete mode 100644 node_modules/assert/node_modules/util/package.json delete mode 100644 node_modules/assert/node_modules/util/util.js delete mode 100644 node_modules/assert/package.json delete mode 100644 node_modules/express/.npmignore delete mode 100644 node_modules/express/.travis.yml delete mode 100644 node_modules/express/History.md delete mode 100644 node_modules/express/LICENSE delete mode 100644 node_modules/express/Makefile delete mode 100644 node_modules/express/Readme.md delete mode 100755 node_modules/express/bin/express delete mode 100644 node_modules/express/client.js delete mode 100644 node_modules/express/index.js delete mode 100644 node_modules/express/lib-cov/application.js delete mode 100644 node_modules/express/lib-cov/express.js delete mode 100644 node_modules/express/lib-cov/middleware.js delete mode 100644 node_modules/express/lib-cov/request.js delete mode 100644 node_modules/express/lib-cov/response.js delete mode 100644 node_modules/express/lib-cov/router/collection.js delete mode 100644 node_modules/express/lib-cov/router/index.js delete mode 100644 node_modules/express/lib-cov/router/methods.js delete mode 100644 node_modules/express/lib-cov/router/route.js delete mode 100644 node_modules/express/lib-cov/utils.js delete mode 100644 node_modules/express/lib-cov/view.js delete mode 100644 node_modules/express/lib/application.js delete mode 100644 node_modules/express/lib/express.js delete mode 100644 node_modules/express/lib/middleware.js delete mode 100644 node_modules/express/lib/request.js delete mode 100644 node_modules/express/lib/response.js delete mode 100644 node_modules/express/lib/router/index.js delete mode 100644 node_modules/express/lib/router/methods.js delete mode 100644 node_modules/express/lib/router/route.js delete mode 100644 node_modules/express/lib/utils.js delete mode 100644 node_modules/express/lib/view.js delete mode 100644 node_modules/express/node_modules/commander/.npmignore delete mode 100644 node_modules/express/node_modules/commander/.travis.yml delete mode 100644 node_modules/express/node_modules/commander/History.md delete mode 100644 node_modules/express/node_modules/commander/Makefile delete mode 100644 node_modules/express/node_modules/commander/Readme.md delete mode 100644 node_modules/express/node_modules/commander/index.js delete mode 100644 node_modules/express/node_modules/commander/lib/commander.js delete mode 100644 node_modules/express/node_modules/commander/package.json delete mode 100644 node_modules/express/node_modules/connect/.npmignore delete mode 100644 node_modules/express/node_modules/connect/LICENSE delete mode 100644 node_modules/express/node_modules/connect/index.js delete mode 100644 node_modules/express/node_modules/connect/lib/cache.js delete mode 100644 node_modules/express/node_modules/connect/lib/connect.js delete mode 100644 node_modules/express/node_modules/connect/lib/index.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/basicAuth.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/bodyParser.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/compress.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/cookieParser.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/cookieSession.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/csrf.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/directory.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/errorHandler.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/favicon.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/json.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/limit.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/logger.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/methodOverride.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/multipart.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/query.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/responseTime.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/session.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/session/cookie.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/session/memory.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/session/session.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/session/store.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/static.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/staticCache.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/urlencoded.js delete mode 100644 node_modules/express/node_modules/connect/lib/middleware/vhost.js delete mode 100644 node_modules/express/node_modules/connect/lib/patch.js delete mode 100644 node_modules/express/node_modules/connect/lib/proto.js delete mode 100644 node_modules/express/node_modules/connect/lib/public/directory.html delete mode 100644 node_modules/express/node_modules/connect/lib/public/error.html delete mode 100644 node_modules/express/node_modules/connect/lib/public/favicon.ico delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_add.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_attach.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_code.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_copy.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_delete.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_edit.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_error.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_excel.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_find.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_gear.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_go.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_green.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_key.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_link.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_paste.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_red.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_save.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_add.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_c.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_camera.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_cd.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_compressed.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_cplusplus.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_csharp.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_cup.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_database.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_delete.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_dvd.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_error.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_flash.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_go.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_h.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_horizontal.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_lightning.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_medal.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_paintbrush.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_paste.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_php.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_put.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_text.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_text_width.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_tux.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_vector.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_visualstudio.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_word.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/icons/page_world.png delete mode 100644 node_modules/express/node_modules/connect/lib/public/style.css delete mode 100644 node_modules/express/node_modules/connect/lib/utils.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/.gitmodules delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/README.md delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/lib/crc.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/package.json delete mode 100755 node_modules/express/node_modules/connect/node_modules/crc/tests/crc_tests.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/.npmignore delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/CONTRIBUTORS.md delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/LICENSE delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/Makefile delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/README.md delete mode 100755 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/bin/nodeunit delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/bin/nodeunit.json delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/deps/async.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/deps/ejs.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/deps/json2.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/doc/nodeunit.md delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/nodeunit.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/suite1.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/suite2.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/test.html delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/img/example_fail.png delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/img/example_pass.png delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/index.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/assert.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/core.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/nodeunit.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/browser.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/default.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/html.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/index.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/junit.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/minimal.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/skip_passed.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/types.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/utils.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/man1/nodeunit.1 delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/nodelint.cfg delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/package.json delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/share/junit.xml.ejs delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/share/license.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/share/nodeunit.css delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/coffee/mock_coffee_module.coffee delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/dir/mock_module3.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/dir/mock_module4.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/mock_module1.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/mock_module2.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/raw_jscode1.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/raw_jscode2.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/raw_jscode3.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-base.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-failing-callbacks.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-httputil.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-runfiles.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-runmodule.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-runtest.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-sandbox.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-testcase.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test.html delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/.npmignore delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/Makefile delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/Readme.md delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/TODO delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/example/post.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/index.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/package.json delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/common.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js delete mode 100755 node_modules/express/node_modules/connect/node_modules/formidable/test/run.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/mime/LICENSE delete mode 100644 node_modules/express/node_modules/connect/node_modules/mime/README.md delete mode 100644 node_modules/express/node_modules/connect/node_modules/mime/mime.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/mime/package.json delete mode 100644 node_modules/express/node_modules/connect/node_modules/mime/test.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/mime/types/mime.types delete mode 100644 node_modules/express/node_modules/connect/node_modules/mime/types/node.types delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/.gitmodules delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/.npmignore delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/.travis.yml delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/History.md delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/Makefile delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/Readme.md delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/benchmark.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/examples.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/index.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/lib/querystring.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/package.json delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/test/mocha.opts delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/test/parse.js delete mode 100644 node_modules/express/node_modules/connect/node_modules/qs/test/stringify.js delete mode 100644 node_modules/express/node_modules/connect/package.json delete mode 100644 node_modules/express/node_modules/debug/.npmignore delete mode 100644 node_modules/express/node_modules/debug/History.md delete mode 100644 node_modules/express/node_modules/debug/Makefile delete mode 100644 node_modules/express/node_modules/debug/Readme.md delete mode 100644 node_modules/express/node_modules/debug/debug.js delete mode 100644 node_modules/express/node_modules/debug/example/app.js delete mode 100644 node_modules/express/node_modules/debug/example/browser.html delete mode 100644 node_modules/express/node_modules/debug/example/wildcards.js delete mode 100644 node_modules/express/node_modules/debug/example/worker.js delete mode 100644 node_modules/express/node_modules/debug/index.js delete mode 100644 node_modules/express/node_modules/debug/lib/debug.js delete mode 100644 node_modules/express/node_modules/debug/package.json delete mode 100644 node_modules/express/node_modules/mime/LICENSE delete mode 100644 node_modules/express/node_modules/mime/README.md delete mode 100644 node_modules/express/node_modules/mime/mime.js delete mode 100644 node_modules/express/node_modules/mime/package.json delete mode 100644 node_modules/express/node_modules/mime/test.js delete mode 100644 node_modules/express/node_modules/mime/types/mime.types delete mode 100644 node_modules/express/node_modules/mime/types/node.types delete mode 100644 node_modules/express/node_modules/mkdirp/.gitignore.orig delete mode 100644 node_modules/express/node_modules/mkdirp/.gitignore.rej delete mode 100644 node_modules/express/node_modules/mkdirp/.npmignore delete mode 100644 node_modules/express/node_modules/mkdirp/.travis.yml delete mode 100644 node_modules/express/node_modules/mkdirp/LICENSE delete mode 100644 node_modules/express/node_modules/mkdirp/README.markdown delete mode 100644 node_modules/express/node_modules/mkdirp/examples/pow.js delete mode 100644 node_modules/express/node_modules/mkdirp/examples/pow.js.orig delete mode 100644 node_modules/express/node_modules/mkdirp/examples/pow.js.rej delete mode 100644 node_modules/express/node_modules/mkdirp/index.js delete mode 100644 node_modules/express/node_modules/mkdirp/package.json delete mode 100644 node_modules/express/node_modules/mkdirp/test/chmod.js delete mode 100644 node_modules/express/node_modules/mkdirp/test/clobber.js delete mode 100644 node_modules/express/node_modules/mkdirp/test/mkdirp.js delete mode 100644 node_modules/express/node_modules/mkdirp/test/perm.js delete mode 100644 node_modules/express/node_modules/mkdirp/test/perm_sync.js delete mode 100644 node_modules/express/node_modules/mkdirp/test/race.js delete mode 100644 node_modules/express/node_modules/mkdirp/test/rel.js delete mode 100644 node_modules/express/node_modules/mkdirp/test/return.js delete mode 100644 node_modules/express/node_modules/mkdirp/test/return_sync.js delete mode 100644 node_modules/express/node_modules/mkdirp/test/sync.js delete mode 100644 node_modules/express/node_modules/mkdirp/test/umask.js delete mode 100644 node_modules/express/node_modules/mkdirp/test/umask_sync.js delete mode 100644 node_modules/express/package.json delete mode 100644 node_modules/express/test.js delete mode 100644 node_modules/jade/.npmignore delete mode 100644 node_modules/jade/LICENSE delete mode 100755 node_modules/jade/bin/jade delete mode 100644 node_modules/jade/index.js delete mode 100644 node_modules/jade/jade.1 delete mode 100644 node_modules/jade/jade.js delete mode 100644 node_modules/jade/jade.md delete mode 100644 node_modules/jade/jade.min.js delete mode 100644 node_modules/jade/lib/compiler.js delete mode 100644 node_modules/jade/lib/doctypes.js delete mode 100644 node_modules/jade/lib/filters.js delete mode 100644 node_modules/jade/lib/inline-tags.js delete mode 100644 node_modules/jade/lib/jade.js delete mode 100644 node_modules/jade/lib/lexer.js delete mode 100644 node_modules/jade/lib/nodes/block-comment.js delete mode 100644 node_modules/jade/lib/nodes/block.js delete mode 100644 node_modules/jade/lib/nodes/case.js delete mode 100644 node_modules/jade/lib/nodes/code.js delete mode 100644 node_modules/jade/lib/nodes/comment.js delete mode 100644 node_modules/jade/lib/nodes/doctype.js delete mode 100644 node_modules/jade/lib/nodes/each.js delete mode 100644 node_modules/jade/lib/nodes/filter.js delete mode 100644 node_modules/jade/lib/nodes/index.js delete mode 100644 node_modules/jade/lib/nodes/literal.js delete mode 100644 node_modules/jade/lib/nodes/mixin.js delete mode 100644 node_modules/jade/lib/nodes/node.js delete mode 100644 node_modules/jade/lib/nodes/tag.js delete mode 100644 node_modules/jade/lib/nodes/text.js delete mode 100644 node_modules/jade/lib/parser.js delete mode 100644 node_modules/jade/lib/runtime.js delete mode 100644 node_modules/jade/lib/self-closing.js delete mode 100644 node_modules/jade/lib/utils.js delete mode 100644 node_modules/jade/node_modules/commander/.npmignore delete mode 100644 node_modules/jade/node_modules/commander/.travis.yml delete mode 100644 node_modules/jade/node_modules/commander/History.md delete mode 100644 node_modules/jade/node_modules/commander/Makefile delete mode 100644 node_modules/jade/node_modules/commander/Readme.md delete mode 100644 node_modules/jade/node_modules/commander/index.js delete mode 100644 node_modules/jade/node_modules/commander/lib/commander.js delete mode 100644 node_modules/jade/node_modules/commander/package.json delete mode 100644 node_modules/jade/node_modules/mkdirp/.gitignore.orig delete mode 100644 node_modules/jade/node_modules/mkdirp/.gitignore.rej delete mode 100644 node_modules/jade/node_modules/mkdirp/.npmignore delete mode 100644 node_modules/jade/node_modules/mkdirp/LICENSE delete mode 100644 node_modules/jade/node_modules/mkdirp/README.markdown delete mode 100644 node_modules/jade/node_modules/mkdirp/examples/pow.js delete mode 100644 node_modules/jade/node_modules/mkdirp/examples/pow.js.orig delete mode 100644 node_modules/jade/node_modules/mkdirp/examples/pow.js.rej delete mode 100644 node_modules/jade/node_modules/mkdirp/index.js delete mode 100644 node_modules/jade/node_modules/mkdirp/package.json delete mode 100644 node_modules/jade/node_modules/mkdirp/test/chmod.js delete mode 100644 node_modules/jade/node_modules/mkdirp/test/clobber.js delete mode 100644 node_modules/jade/node_modules/mkdirp/test/mkdirp.js delete mode 100644 node_modules/jade/node_modules/mkdirp/test/perm.js delete mode 100644 node_modules/jade/node_modules/mkdirp/test/perm_sync.js delete mode 100644 node_modules/jade/node_modules/mkdirp/test/race.js delete mode 100644 node_modules/jade/node_modules/mkdirp/test/rel.js delete mode 100644 node_modules/jade/node_modules/mkdirp/test/sync.js delete mode 100644 node_modules/jade/node_modules/mkdirp/test/umask.js delete mode 100644 node_modules/jade/node_modules/mkdirp/test/umask_sync.js delete mode 100644 node_modules/jade/package.json delete mode 100644 node_modules/jade/runtime.js delete mode 100644 node_modules/jade/runtime.min.js delete mode 100644 node_modules/jade/test.jade delete mode 100644 node_modules/jade/testing/head.jade delete mode 100644 node_modules/jade/testing/index.jade delete mode 100644 node_modules/jade/testing/index.js delete mode 100644 node_modules/jade/testing/layout.jade delete mode 100644 node_modules/jade/testing/user.jade delete mode 100644 node_modules/jade/testing/user.js delete mode 100644 node_modules/nopt/.npmignore delete mode 100644 node_modules/nopt/LICENSE delete mode 100644 node_modules/nopt/README.md delete mode 100755 node_modules/nopt/bin/nopt.js delete mode 100755 node_modules/nopt/examples/my-program.js delete mode 100644 node_modules/nopt/lib/nopt.js delete mode 100644 node_modules/nopt/node_modules/abbrev/README.md delete mode 100644 node_modules/nopt/node_modules/abbrev/lib/abbrev.js delete mode 100644 node_modules/nopt/node_modules/abbrev/package.json delete mode 100644 node_modules/nopt/package.json delete mode 100644 node_modules/should/.gitmodules delete mode 100644 node_modules/should/.npmignore delete mode 100644 node_modules/should/History.md delete mode 100644 node_modules/should/Makefile delete mode 100644 node_modules/should/Readme.md delete mode 100644 node_modules/should/examples/runner.js delete mode 100644 node_modules/should/index.js delete mode 100644 node_modules/should/lib/eql.js delete mode 100644 node_modules/should/lib/should.js delete mode 100644 node_modules/should/package.json delete mode 100644 node_modules/should/test/exist.test.js delete mode 100644 node_modules/should/test/should.test.js delete mode 100644 node_modules/underscore.string/.travis.yml delete mode 100644 node_modules/underscore.string/Gemfile delete mode 100644 node_modules/underscore.string/Gemfile.lock delete mode 100644 node_modules/underscore.string/README.markdown delete mode 100644 node_modules/underscore.string/Rakefile delete mode 100644 node_modules/underscore.string/dist/underscore.string.min.js delete mode 100644 node_modules/underscore.string/lib/underscore.string.js delete mode 100644 node_modules/underscore.string/package.json delete mode 100644 node_modules/underscore.string/test/run-qunit.js delete mode 100644 node_modules/underscore.string/test/speed.js delete mode 100644 node_modules/underscore.string/test/strings.js delete mode 100644 node_modules/underscore.string/test/strings_standalone.js delete mode 100644 node_modules/underscore.string/test/test.html delete mode 100644 node_modules/underscore.string/test/test_standalone.html delete mode 100644 node_modules/underscore.string/test/test_underscore/arrays.js delete mode 100644 node_modules/underscore.string/test/test_underscore/chaining.js delete mode 100644 node_modules/underscore.string/test/test_underscore/collections.js delete mode 100644 node_modules/underscore.string/test/test_underscore/functions.js delete mode 100644 node_modules/underscore.string/test/test_underscore/objects.js delete mode 100644 node_modules/underscore.string/test/test_underscore/speed.js delete mode 100644 node_modules/underscore.string/test/test_underscore/temp.js delete mode 100644 node_modules/underscore.string/test/test_underscore/temp_tests.html delete mode 100644 node_modules/underscore.string/test/test_underscore/test.html delete mode 100644 node_modules/underscore.string/test/test_underscore/utility.js delete mode 100644 node_modules/underscore.string/test/test_underscore/vendor/jquery.js delete mode 100644 node_modules/underscore.string/test/test_underscore/vendor/jslitmus.js delete mode 100644 node_modules/underscore.string/test/test_underscore/vendor/qunit.css delete mode 100644 node_modules/underscore.string/test/test_underscore/vendor/qunit.js delete mode 100644 node_modules/underscore.string/test/underscore.js delete mode 100644 node_modules/underscore/.npmignore delete mode 100644 node_modules/underscore/CNAME delete mode 100644 node_modules/underscore/LICENSE delete mode 100644 node_modules/underscore/README.md delete mode 100755 node_modules/underscore/favicon.ico delete mode 100644 node_modules/underscore/index.html delete mode 100644 node_modules/underscore/index.js delete mode 100644 node_modules/underscore/package.json delete mode 100644 node_modules/underscore/raw/underscore.psd delete mode 100644 node_modules/underscore/underscore-min.js delete mode 100644 node_modules/underscore/underscore.js delete mode 100644 node_modules/vows/.npmignore delete mode 100644 node_modules/vows/.travis.yml delete mode 100644 node_modules/vows/LICENSE delete mode 100644 node_modules/vows/Makefile delete mode 100644 node_modules/vows/README.md delete mode 100755 node_modules/vows/bin/vows delete mode 100644 node_modules/vows/lib/assert/error.js delete mode 100644 node_modules/vows/lib/assert/macros.js delete mode 100644 node_modules/vows/lib/assert/utils.js delete mode 100644 node_modules/vows/lib/vows.js delete mode 100644 node_modules/vows/lib/vows/console.js delete mode 100644 node_modules/vows/lib/vows/context.js delete mode 100644 node_modules/vows/lib/vows/coverage/file.js delete mode 100644 node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html delete mode 100644 node_modules/vows/lib/vows/coverage/fragments/coverage-head.html delete mode 100644 node_modules/vows/lib/vows/coverage/report-html.js delete mode 100644 node_modules/vows/lib/vows/coverage/report-json.js delete mode 100644 node_modules/vows/lib/vows/coverage/report-plain.js delete mode 100644 node_modules/vows/lib/vows/coverage/report-xml.js delete mode 100644 node_modules/vows/lib/vows/extras.js delete mode 100644 node_modules/vows/lib/vows/reporters/dot-matrix.js delete mode 100644 node_modules/vows/lib/vows/reporters/json.js delete mode 100644 node_modules/vows/lib/vows/reporters/silent.js delete mode 100644 node_modules/vows/lib/vows/reporters/spec.js delete mode 100644 node_modules/vows/lib/vows/reporters/watch.js delete mode 100644 node_modules/vows/lib/vows/reporters/xunit.js delete mode 100644 node_modules/vows/lib/vows/suite.js delete mode 100644 node_modules/vows/node_modules/eyes/LICENSE delete mode 100644 node_modules/vows/node_modules/eyes/Makefile delete mode 100644 node_modules/vows/node_modules/eyes/README.md delete mode 100644 node_modules/vows/node_modules/eyes/lib/eyes.js delete mode 100644 node_modules/vows/node_modules/eyes/package.json delete mode 100644 node_modules/vows/node_modules/eyes/test/eyes-test.js delete mode 100644 node_modules/vows/package.json delete mode 100644 node_modules/vows/test/assert-test.js delete mode 100644 node_modules/vows/test/fixtures/isolate/failing.js delete mode 100644 node_modules/vows/test/fixtures/isolate/log.js delete mode 100644 node_modules/vows/test/fixtures/isolate/passing.js delete mode 100644 node_modules/vows/test/fixtures/isolate/stderr.js delete mode 100644 node_modules/vows/test/fixtures/supress-stdout/output.js delete mode 100644 node_modules/vows/test/isolate-test.js delete mode 100644 node_modules/vows/test/supress-stdout-test.js delete mode 100644 node_modules/vows/test/vows-error-test.js delete mode 100644 node_modules/vows/test/vows-test.js delete mode 100644 node_modules/vows/test/vows_underscore_test.js delete mode 100644 node_modules/wd/.npmignore delete mode 100644 node_modules/wd/LICENSE.APACHE2 delete mode 100644 node_modules/wd/Makefile delete mode 100644 node_modules/wd/README.md delete mode 100644 node_modules/wd/doc/jsonwiremap-all.md delete mode 100644 node_modules/wd/doc/jsonwiremap-supported.md delete mode 100644 node_modules/wd/doc/supported-methods-old.md delete mode 100644 node_modules/wd/examples/example.chrome.js delete mode 100644 node_modules/wd/examples/example.firefox.js delete mode 100644 node_modules/wd/examples/example.ondemand.ie.js delete mode 100644 node_modules/wd/examples/example.ondemand.js delete mode 100755 node_modules/wd/lib/bin.js delete mode 100644 node_modules/wd/lib/browser-scripts/safe-execute-async.js delete mode 100644 node_modules/wd/lib/browser-scripts/safe-execute.js delete mode 100644 node_modules/wd/lib/browser-scripts/wait-for-cond-in-browser.js delete mode 100644 node_modules/wd/lib/builder.js delete mode 100644 node_modules/wd/lib/element.js delete mode 100644 node_modules/wd/lib/jsonwire-errors.js delete mode 100644 node_modules/wd/lib/main.js delete mode 100644 node_modules/wd/lib/protocol.js delete mode 100644 node_modules/wd/lib/special-keys.js delete mode 100644 node_modules/wd/node_modules/async/.gitmodules delete mode 100644 node_modules/wd/node_modules/async/.npmignore delete mode 100644 node_modules/wd/node_modules/async/LICENSE delete mode 100644 node_modules/wd/node_modules/async/Makefile delete mode 100644 node_modules/wd/node_modules/async/README.md delete mode 100644 node_modules/wd/node_modules/async/index.js delete mode 100644 node_modules/wd/node_modules/async/lib/async.js delete mode 100644 node_modules/wd/node_modules/async/package.json delete mode 100644 node_modules/wd/package.json delete mode 100644 node_modules/wd/test/common/basic-test-base.coffee delete mode 100644 node_modules/wd/test/common/basic-test-base.js delete mode 100644 node_modules/wd/test/common/leak-detector.coffee delete mode 100644 node_modules/wd/test/common/leak-detector.js delete mode 100644 node_modules/wd/test/saucelabs/.npmignore delete mode 100644 node_modules/wd/test/saucelabs/README delete mode 100644 node_modules/wd/test/saucelabs/basic-test.coffee delete mode 100644 node_modules/wd/test/saucelabs/basic-test.js delete mode 100644 node_modules/wd/test/saucelabs/browser-init-test.coffee delete mode 100644 node_modules/wd/test/saucelabs/browser-init-test.js delete mode 100644 node_modules/wd/test/saucelabs/config-helper.coffee delete mode 100644 node_modules/wd/test/saucelabs/config-helper.js delete mode 100644 node_modules/wd/test/saucelabs/config.sample.coffee delete mode 100644 node_modules/wd/test/saucelabs/config.sample.js delete mode 100644 node_modules/wd/test/unit/assets/element-test-page.html delete mode 100644 node_modules/wd/test/unit/assets/test-page.html delete mode 100644 node_modules/wd/test/unit/basic-test.coffee delete mode 100644 node_modules/wd/test/unit/basic-test.js delete mode 100644 node_modules/wd/test/unit/browser-init-test.coffee delete mode 100644 node_modules/wd/test/unit/browser-init-test.js delete mode 100644 node_modules/wd/test/unit/element-test.coffee delete mode 100644 node_modules/wd/test/unit/element-test.js delete mode 100644 node_modules/wd/test/unit/per-method-test.coffee delete mode 100644 node_modules/wd/test/unit/per-method-test.js delete mode 100644 node_modules/wd/test/unit/wd-remote-init-test.coffee delete mode 100644 node_modules/wd/test/unit/wd-remote-init-test.js create mode 100644 public/app.js diff --git a/.gitignore b/.gitignore index c07bf0b..ad118df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ test_confs.js *.sublime* +node_modules/ +sauce_connect.log diff --git a/models/post.js b/models/post.js index f2b514c..37bb59d 100644 --- a/models/post.js +++ b/models/post.js @@ -28,9 +28,9 @@ Post.prototype.validate = function(fn){ Post.prototype.update = function(data, fn){ - this.updatedAt = new Date; + this.updatedAt = new Date(); for (var key in data) { - if (undefined != data[key]) { + if (undefined !== data[key]) { this[key] = data[key]; } } @@ -41,6 +41,16 @@ Post.prototype.destroy = function(fn){ exports.destroy(this.id, fn); }; +Post.prototype.excerpt = function() { + return this.body.substr(0, 100) + '...'; +}; + +Post.prototype.body_nl2br = function() { + var str = this.body.replace(/\n/, '

', 'm'); + //return str.replace(/\n/, '
', 'm'); + return str; +}; + exports.count = function(fn){ fn(null, Object.keys(db).length); }; diff --git a/node_modules/.bin/express b/node_modules/.bin/express deleted file mode 120000 index b741d99..0000000 --- a/node_modules/.bin/express +++ /dev/null @@ -1 +0,0 @@ -../express/bin/express \ No newline at end of file diff --git a/node_modules/.bin/jade b/node_modules/.bin/jade deleted file mode 120000 index 571fae7..0000000 --- a/node_modules/.bin/jade +++ /dev/null @@ -1 +0,0 @@ -../jade/bin/jade \ No newline at end of file diff --git a/node_modules/.bin/nopt b/node_modules/.bin/nopt deleted file mode 120000 index 6b6566e..0000000 --- a/node_modules/.bin/nopt +++ /dev/null @@ -1 +0,0 @@ -../nopt/bin/nopt.js \ No newline at end of file diff --git a/node_modules/.bin/vows b/node_modules/.bin/vows deleted file mode 120000 index 0386e59..0000000 --- a/node_modules/.bin/vows +++ /dev/null @@ -1 +0,0 @@ -../vows/bin/vows \ No newline at end of file diff --git a/node_modules/.bin/wd b/node_modules/.bin/wd deleted file mode 120000 index 9b606df..0000000 --- a/node_modules/.bin/wd +++ /dev/null @@ -1 +0,0 @@ -../wd/lib/bin.js \ No newline at end of file diff --git a/node_modules/argparser/ArgParser.js b/node_modules/argparser/ArgParser.js deleted file mode 100644 index 23369ea..0000000 --- a/node_modules/argparser/ArgParser.js +++ /dev/null @@ -1,286 +0,0 @@ -function ArgParser() { - this._valopts = {s: [], l: []}; - this._opts = {s: [], l: []}; - this._options = {}; - this._args = []; - this._invalids = []; - this._defaults = {}; - - this.emptyValue = false; - this._files = []; - this._dirs = []; - this._nums = []; - this._err = null; - this._min = null; - this._max = null; -} - -ArgParser.create = function() { - return new ArgParser().addValueOptions(Array.prototype.slice.call(arguments)); -}; - -// get options ( getOptions("s") ... -ArgParser.prototype.getOptions = function() { - if (arguments.length == 0) { - return this._options; - } - var ret = null; - const that = this; - Array.prototype.forEach.call(arguments, function(arg) { - ret = ret || that._options[arg]; - }); - return ret; -}; -// syntax sugar -ArgParser.prototype.opt = ArgParser.prototype.getOptions; - - -// get arguments getArgs(0), getArgs(1) ... -ArgParser.prototype.getArgs = function(n) { - return (n == null) ? this._args: this._args[n]; -}; -// syntax sugar -ArgParser.prototype.arg = ArgParser.prototype.getArgs; - -// stringify current options -ArgParser.prototype.stringifyOptions = function() { - var that = this; - return ['_opts', '_valopts'].map(function(opts) { - return Object.keys(that[opts]).map(function(sl) { - return that[opts][sl] - .filter(function(k) { - return (that._options[k] !== false); - }) - .map(function(k) { - return (( (sl == 's') ? '-'+k : '--'+k ) + ( (opts == '_opts') ? '' : (' ' + that._options[k]))).replace(/ +$/, ''); - }).join(' '); - }).join(' ').replace(/ +$/, ''); - }).join(' ').replace(/ +$/, ''); -}; - -// stringify current options and args -ArgParser.prototype.stringify = function() { - return this.stringifyOptions() + ' ' + this._args.join(' '); -}; - -// get invalid options given -ArgParser.prototype.getInvalids = function(n) { - return (n == null) ? this._invalids : this._invalids[n]; -}; - -ArgParser.prototype.invalids = function() { return this._invalids }; - - -// set options which requires a value -ArgParser.prototype.addValueOptions = function() { - var arr = (Array.isArray(arguments[0])) ? arguments[0] : Array.prototype.slice.call(arguments); - arr.forEach(function(opt) { - this._valopts[(opt.length == 1) ? 's' : 'l'].push(opt); - }, this); - return this; -}; -// syntax sugar -ArgParser.prototype.vals = ArgParser.prototype.addValueOptions; - - -// set args | options which requires (a file | a directory | a number) -['files', 'dirs', 'nums'].forEach(function(name) { - var _name = "_" + name; - // register required file nums - ArgParser.prototype[name] = function() { - var valueOptions = []; - var arr = (Array.isArray(arguments[0])) ? arguments[0] : Array.prototype.slice.call(arguments); - arr.forEach(function(v) { - this[_name].push(v); - if (typeof v == "string") valueOptions.push(v); - }, this); - return valueOptions.length ? this.addValueOptions(valueOptions) : this; - }; -}); - - -// set defaults -ArgParser.prototype.defaults = function(obj, noSetNums) { - var keys = Object.keys(obj); - var nums = []; - keys.forEach(function(k) { - var val = obj[k]; - if (typeof val == "number") nums.push(k); - this._defaults[k] = val; - }, this); - if (!noSetNums && nums.length) { - this.nums(nums); - } - return this.addValueOptions(keys); -}; - - -// set options which requires no values -ArgParser.prototype.addOptions = function() { - var arr = (Array.isArray(arguments[0])) ? arguments[0] : Array.prototype.slice.call(arguments); - arr.forEach(function(opt) { - this._opts[(opt.length == 1) ? 's' : 'l'].push(opt); - }, this); - return this; -}; - -// syntax sugar -ArgParser.prototype.nonvals = ArgParser.prototype.addOptions; - -// register function called after error (in parsing) -ArgParser.prototype.err = function(err) { - if (typeof err == "function") this._err = err; - return this; -}; - - -// register argument nums -ArgParser.prototype.arglen = function(min, max) { - if (typeof min == "number") this._min = min; - if (typeof max == "number") this._max = max; - return this; -}; - - -// parse argv -ArgParser.prototype.parse = function(arr) { - /* clear past data */ - this._options = {}; - this._args = []; - this._invalids = []; - - /* check arguments */ - if (! (arr instanceof Array)) { - arr = []; - process.argv.forEach(function(v, k) { - if (k >= 2) arr.push(v); - }); - } - - /* set default values */ - var that = this; // for shortcut access to this - ['_opts', '_valopts'].forEach(function(opts) { - ['s', 'l'].forEach(function(sl) { - that[opts][sl].forEach(function(opt) { - that._options[opt] = (that._defaults[opt] != undefined) ? that._defaults[opt] : that.emptyValue; - }); - }); - }); - - - /* parse arguments */ - var vopt; - arr.forEach(function(val) { - /* if option with value is set */ - if (vopt) { - that._options[vopt] = val; - vopt = null; - return; - } - - /* short option parsing */ - if (val.match(/^-[a-zA-Z0-9_]$/)) { - var optname = val.charAt(1); - if (that._valopts.s.indexOf(optname) >= 0) { - vopt = optname; - return; - } - else if (that._opts.s.indexOf(optname) >= 0) { - that._options[optname] = true; - return; - } - else { // invalid option - that._options[optname] = true; - that._invalids.push(optname); - return; - } - } - - /* long option parsing */ - if (val.match(/^--[a-zA-Z0-9_-]+$/)) { - var optname = val.slice(2); - if (that._valopts.l.indexOf(optname) >= 0) { - vopt = optname; - return; - } - else if (that._opts.l.indexOf(optname) >= 0) { - that._options[optname] = true; - return; - } - else { - that._options[optname] = true; - that._invalids.push(optname); - return; - } - } - - /* arguments */ - that._args.push(val); - }); - - var path = require('path'), fs = require('fs'); - - try { - - // check file existence - this._files.forEach(function(v) { - if (typeof v == "string" && this.getOptions(v) === this.emptyValue) return; - var f = (typeof v == "number") ? this.getArgs(v) : this.getOptions(v); - if (f == '-') return; - try{if(!fs.statSync(f).isFile()){throw 1}}catch(e){throw new Error(f + ": no such file or directory (in args " + v + ')');} - }, this); - - // check dir existence - this._dirs.forEach(function(v) { - if (typeof v == "string" && this.getOptions(v) === this.emptyValue) return; - var d = (typeof v == "number") ? this.getArgs(v) : this.getOptions(v); - try{if(!fs.statSync(d).isDirectory()){throw 1}}catch(e){throw new Error(d + ": no such file or directory (in args " + v + ')');} - }, this); - - // Numberize - this._nums.forEach(function(v) { - if (typeof v == "string" && this.getOptions(v) === this.emptyValue) return; - var num = Number( (typeof v == "number") ? this.getArgs(v) : this.getOptions(v) ); - if (isNaN(num)) throw new Error('the arg ' + v +' must be a number.'); - if (typeof v == "number") this._args[v] = num; - else this._options[v] = num; - }, this); - - // check argument length - if (this._min != null && this._min > this._args.length) - throw new Error('required at least ' + this._min + ' argument(s)'); - - if (this._max != null && this._max < this._args.length) - throw new Error('required at most ' + this._max + ' argument(s)'); - } - catch (e) { - if (!this._err) throw e; - var ret = this._err(e); - return (ret == undefined) ? false : ret; - } - - return this; -}; - -ArgParser.getOptionString = function(obj) { - var ret = []; - Object.keys(obj).forEach(function(opt) { - if (obj[opt] === null || obj[opt] === false) return; - ret.push( ((opt.length == 1) ? '-' : '--') + opt + ' ' + obj[opt]); - }); - return ret.join(' '); -}; - -/** - * register shortcut - **/ -Object.keys(ArgParser.prototype).forEach(function(methodName) { - if (ArgParser[methodName]) return; - ArgParser[methodName] = function() { - var ap = new ArgParser(); - ap[methodName].apply(ap, arguments); - return ap; - }; -}); - -module.exports = ArgParser; diff --git a/node_modules/argparser/LICENCE b/node_modules/argparser/LICENCE deleted file mode 100644 index 64ba039..0000000 --- a/node_modules/argparser/LICENCE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2011 SHIN Suzuki - -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/argparser/README.md b/node_modules/argparser/README.md deleted file mode 100644 index 3893d9e..0000000 --- a/node_modules/argparser/README.md +++ /dev/null @@ -1,380 +0,0 @@ -argparser -================== -[Node.js] Parses command line args and options. - -## Installation ## - git clone git://github.com/shinout/argparser.git - - OR - - npm install argparser - -## Usage ## - -a command - - node script.js -r --num 100 file1.txt 11 - -in script.js - - var ap = require('argparser') - .files(0) - .nums(1, "num") - .nonvals('r') - .parse(); - - var file = ap.arg(0) // "file1.txt" - var n = ap.arg(1) // 11 - var num = ap.opt("num") // 100 - var r = ap.opt("r") // true - -## API Documentation ## -- ArgParser.create() -- ap.vals() -- ap.nonvals() -- ap.files() -- ap.dirs() -- ap.nums() -- ap.defaults() -- ap.err() -- ap.arglen() -- ap.parse(arr) -- ap.opt(op1, op2, ...) -- ap.arg() -- ap.stringify() -- ap.invalids() -- ap.emptyValue - -### ArgParser.create() ### -Creates an instance of ArgParser. - - var ap = ArgParser.create().parse(); - -This can be omitted using **shortcut methods**. - -Returns an instance of ArgParser. - -### ap.vals() ### -Adds options with value. - -a command - - node script.js --seq ACTG -n 1 - -in script.js - - var ap = require('argparser') - .vals("n", "seq") - .parse(); - - var n = ap.opt("n") // "1" - var seq = ap.opt("seq") // "ACTG" - -"--" is used for long option name (more than one characters). - -"-" is used for short option name (just one character). - - node script.js --long long -s short - -Returns this. - -### ap.nonvals() ### -Adds options without values. - -a command - - node script.js -t --no-save - -in script.js - - var ap = require('argparser') - .nonvals("t", "no-save") - .parse(); - - var t = ap.opt("t") // true - var nosave = ap.opt("no-save") // true - -"--" is used for long option name (more than one characters). - -"-" is used for short option name (just one character). - - node script.js --long -s - -Returns this. - -### ap.files() ### -Specifies an argument or an option is a file. - -These values are checked in **ap.parse()**. - -If there is an invalid filename, an exception is thrown. - -a command - - node script.js --txt foo.txt bar.txt - -in script.js - - var ap = require('argparser') - .files("txt", 0) - .parse(); - - var txt = ap.opt("txt") // "foo.txt" - var nosave = ap.arg(0) // "bar.txt" - -"0" in the example means the first argument. - -"1" will be the second, and so on. - -We don't need to call **ap.vals()** to the option name used in **ap.files()**. - -Returns this. - - -### ap.dirs() ### -Specifies an argument or an option is a directory. - -The same specs as **ap.files()**. - -Returns this. - -### ap.nums() ### -Specifies an argument or an option is a number. - -If isNaN, an exception is thrown. - -a command - - node script.js -n 11 bar.txt 300 - -in script.js - - var ap = require('argparser') - .files(0) - .nums("n", 1) - .parse(); - - var file = ap.arg(0) // "bar.txt" - var n = ap.opt("n") // 11 - console.log(typeof n) // "number" - var num = ap.arg(1) // 300 - console.log(typeof num) // "number" - -The same specs as **ap.files()**. - -Returns this. - - -### ap.defaults(obj, noSetNums) ### -set default values to options with a value. - -a command - - node script.js - -in script.js - - var ap = require('argparser') - .defaults({ - n : 3, - file : "file1.txt" - }) - .files("file") - .parse(); - - var n = ap.opt("n") // 3 - var file = ap.opt("file") // "file1.txt" - -If **noSetNums** is true, **ap.nums()** is not called to options -whose default value is number. -By default, **ap.nums()** are called to these options automatically. - - -### ap.err(fn) ### -Registers a function called when an error is thrown in parsing. - -The argument passed to **fn** is the thrown error. - -Return value of the function is the return value of **ap.parse()**. - -By default, it returns **false**. - - var ap = require('argparser') - .files(0) - .err(function(e) { - console.error(e.message) - console.error("[usage]\n\tnode", __filename, "") - }) - .parse(); - - if (!ap) process.exit(); - - -### ap.arglen(min, max) ### -Registers a limit of argument length. - -ArgParser throws an error if **min** is larger than arguments.length. - -ArgParser throws an error if **max** is smaller than arguments.length. - -We can set just **min** like the following sample. - - var ap = require('argparser') - .arglen(3) // three arguments are required - .parse(); - - - -### ap.parse(arr) ### -Parses arguments. - -**arr** is optional. - -If **arr** is not set, parses **process.argv** (without process.argv[0] and process.argv[1]). - - var ap = require('argparser').files(0, "f").parse(["-f", "file1.txt", "file2.txt"]); - var f = ap.opt("f"); // "file1.txt" - var f2 = ap.arg(0); // "file2.txt" - - -### ap.arg() ### -Get arguments. - -a command - - node script.js arg1 arg2 --opt arg3 --valopt optval - -in script.js - - var ap = require('argparser') - .vals("valopt") - .nonvals("opt") - .parse(); - - var a1 = ap.arg(0); // arg1 - var a2 = ap.arg(1); // arg2 - var a3 = ap.arg(2); // arg3 - var a4 = ap.arg(3); // undefined - - -### ap.opt(op1, op2, ...) ### -Get options value. - -a command - - node script.js -o --valopt optval arg1 --aaa - -in script.js - - var ap = require('argparser') - .vals("valopt", "v2") - .nonvals("o", "opt") - .parse(); - -When registered vals options are passed, returns the value. - - var o1 = ap.opt("valopt"); // "optval" - -When registered nonvals options are passed, returns true. - - var o2 = ap.opt("o"); // true - - -When registered options are not passed, returns **ap.emptyValue**. - - console.log(ap.emptyValue) // false - var o3 = ap.opt("opt"); // false - var o4 = ap.opt("v2"); // false - -**ap.emptyValue** is writable. - - -If multiple arguments are passed, the first matched value is returned. - - var o3 = ap.opt("opt", "o"); // true - var o4 = ap.opt("valopt", "v2); // "optval" - - -When not a registered option is passed, it is parsed as an invalid nonval option. - - var o5 = ap.opt("aaa"); // true - var o6 = ap.invalids(); // ["aaa"] - var o7 = ap.opt("eee"); // undefined - - -### ap.emptyValue ### -When a registered options is not set, this value is returned in **ap.opt()**. - - ap.emptyValue = null - - -### ap.invalids() ### -Gets a list of invalid options. - -a command - - node script.js -a --bcd - -in script.js - - var ap = require('argparser').parse(); - var list = ap.invalid(); - console.log(list); // "a", "bcd" - - -### ap.stringify() ### -Gets canonical format. - -a command - - node script.js -a 1 arg1 -t --invalid_opt --bcd file.txt arg2 arg3 - -in script.js - - var ap = require('argparser') - .vals("a", "bcd") - .nonvals("t") - .parse(); - console.log(ap.stringify()); // -t -a 1 --bcd file.txt arg1 arg2 arg3 - -**Note that invalid options are removed.** - -## shortcut methods ## - -- ArgParser.vals() -- ArgParser.nonvals() -- ArgParser.files() -- ArgParser.dirs() -- ArgParser.nums() -- ArgParser.defaults() -- ArgParser.parse() - - ArgParser.vals("a") - -is completely equivalent to - - ArgParser.create().vals("a") - -## licence ## -(The MIT License) - -Copyright (c) 2011-2012 SHIN Suzuki - -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/argparser/package.json b/node_modules/argparser/package.json deleted file mode 100644 index 82f79b1..0000000 --- a/node_modules/argparser/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "argparser", - "version": "0.2.1", - "description": "object to parse commandline-args and options.", - "keywords": [ - "getopt", - "arguments", - "option", - "getopts", - "command" - ], - "author": { - "name": "SHIN Suzuki", - "email": "shinout310@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/shinout/argparser.git" - }, - "bugs": { - "url": "https://github.com/shinout/argparser/issues" - }, - "licences": [ - { - "type": "MIT", - "url": "https://github.com/shinout/argparser/raw/master/LICENCE" - } - ], - "main": "./ArgParser.js", - "_id": "argparser@0.2.1", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "4739dfa3c2befccf1d3e44742816ced5cbfa3fa8" - }, - "_from": "argparser" -} diff --git a/node_modules/argparser/test/shinout.test.js b/node_modules/argparser/test/shinout.test.js deleted file mode 100644 index dc96a46..0000000 --- a/node_modules/argparser/test/shinout.test.js +++ /dev/null @@ -1,40 +0,0 @@ -module.exports = (function() { - var l = console.log; - var assert = require("assert"); - var c = 0; - var t = 0; - function result(name, reset) { - l("\n/*-----------------------"); - l(" * test: [ "+ name + " ]"); - l(" * result: "+ c + "/" + t + " ->" + parseInt(100*c/t) +'%' ); - if ( c > 0 && c == t) { - l(" * perfect! "); - } else { - l(" * "+(t-c)+" test(s) FAILED."); - } - l(" *-----------------------*/\n"); - if (reset) { - c = 0, t = 0; - } - } - var ret = function() { - var type = Array.prototype.shift.call(arguments); - if (type == "result") { - return result(arguments[0] || 'test', arguments[1] || false); - } - try { - if (typeof assert[type] != "function") { - throw new Error("[assert." + type + "] is not a function"); - } - assert[type].apply(t, arguments); - c++; - } catch (e) { - l(e.stack); - } - t++; - } - ret.exe = function(fn) { - setTimeout(fn, 0); - } - return ret; -})(); diff --git a/node_modules/argparser/test/test.js b/node_modules/argparser/test/test.js deleted file mode 100644 index 5a103c4..0000000 --- a/node_modules/argparser/test/test.js +++ /dev/null @@ -1,125 +0,0 @@ -const ArgParser= require('../ArgParser'); -const test = require('./shinout.test'); - -var parser = ArgParser.create(); -parser.vals(['m', 'mmm', 'set-hoge']); -parser.nonvals(['h', 'hhh', 'non-val']); -parser.parse(['-h', 'aa', 'hoge', 'fuga', '--mmm', 'piyo']); -var options = parser.opt(); -var args = parser.arg(); - -test('equal', options.h, true, 'invalid : options.h'); -test('deepEqual', options['non-val'], false, 'invalid : options[non-val]'); -test('deepEqual', options['non-option'], undefined, 'invalid : options[non-option]'); -test('equal', args[0], 'aa', 'invalid : args[0]'); -test('equal', args[1], 'hoge', 'invalid : args[1]'); -test('equal', args[2], 'fuga', 'invalid : args[2]'); - -test('equal', parser.opt('hhh'), false, 'invalid : opt(hhh)'); -test('equal', parser.opt('h'), true, 'invalid : opt(h)'); -test('equal', parser.opt('h', 'hhh'), true, 'invalid : opt(h, hhh)'); -test('equal', parser.opt('hhh', 'h'), true, 'invalid : opt(hhh, h)'); -test('deepEqual', parser.opt('non-val'), false, 'invalid : opt(non-val)'); -test('deepEqual', parser.opt('non-option'), undefined, 'invalid : opt(non-option)'); -test('deepEqual', parser.opt('mmm'), 'piyo', 'invalid : opt(mmm)'); -test('deepEqual', parser.opt('m'), false, 'invalid : opt(m)'); -test('deepEqual', parser.opt('m', 'mmm'), 'piyo', 'invalid : opt(m, mmm)'); -test('deepEqual', parser.opt('mmm', 'm'), 'piyo', 'invalid : opt(mmm, m)'); - -test('equal', parser.arg(0), 'aa', 'invalid : arg(0)'); -test('equal', parser.arg(1), 'hoge', 'invalid : arg(1)'); -test('equal', parser.arg(2), 'fuga', 'invalid : arg(2)'); -test('result', 'simple option test'); - - -parser.parse(['--set-hoge', 'foo', 'bar', '-m', '23', '-h']); -var options = parser.opt(); -var args = parser.arg(); -test('equal', options.h, true, 'invalid : options.h'); -test('equal', options.m, '23', 'invalid : options.m'); -test('equal', options['set-hoge'], 'foo', 'invalid : options[set-hoge]'); -test('equal', args[0], 'bar', 'invalid : args[0]'); -test('result', 'option with val test'); - - -parser.parse(['--not-option', 'foo', 'bar', '-h']); -var options = parser.opt(); -var args = parser.arg(); -test('equal', options.h, true, 'invalid : options.h'); -test('equal', options['not-option'], true, 'invalid : options[not-option]'); -test('equal', args[0], 'foo', 'invalid : args[0]'); -test('equal', args[1], 'bar', 'invalid : args[1]'); -test('equal', parser.getInvalids()[0], 'not-option'); - -test('equal', parser.getInvalids(0), 'not-option', 'invalid : getInvalids(0)'); -test('result', 'invalid option test'); - - - -parser.parse(['-this-is-not-option', 'foo', 'bar', '-h']); -var options = parser.opt(); -var args = parser.arg(); -test('equal', options.h, true, 'invalid : options.h'); -test('equal', options['this-is-not-option'], null, 'invalid : options[this-is-not-option]'); -test('equal', args[0], '-this-is-not-option', 'invalid : args[0]'); -test('equal', args[1], 'foo', 'invalid : args[1]'); -test('equal', args[2], 'bar', 'invalid : args[2]'); -test('result', '-long-name test'); - - -parser.parse(); -test('ok', process.argv[0], 'process.argv[0] is deleted'); -test('ok', process.argv[1], 'process.argv[1] is deleted'); -test('result', 'argv test'); - -// getOptionString -var opts = {s: "shortval", looong: "longval", innt: 1, nullval: null, floaat: 0.222, falseval: false}; -test('equal', ArgParser.getOptionString(opts), '-s shortval --looong longval --innt 1 --floaat 0.222'); -test('result', 'getOptionString test'); - - - -// file -parser = ArgParser.create().files(0, "hoge", "f"); -try { - parser.parse([__filename, '-f', __filename, "--hoge", "notexistfile"]); -} -catch (e) { - test('ok', e.message.match("notexistfile")); -} - -test('result', 'file test'); - - -// dir -parser = ArgParser.dirs(0, "hoge", "f"); -try { - parser.parse([__dirname, '-f', __dirname, "--hoge", __filename]); -} -catch (e) { - test('ok', e.message.match(__filename)); -} - -// num -parser = ArgParser.nums(0, "hoge", "f"); -parser.parse(["3", '-f', "43.3", "--hoge", "-22.2"]); -test("strictEqual", parser.arg(0), 3); -test("strictEqual", parser.opt("f"), 43.3); -test("strictEqual", parser.opt("hoge"), -22.2); - -test('result', 'num test'); - - -//default -parser = ArgParser.defaults({ "hoge" : 14 }); -parser.parse(["eeeee"]); -test("strictEqual", parser.opt("hoge"), 14); -parser.parse(["--hoge", "13"]); -test("strictEqual", parser.opt("hoge"), 13); -test('result', 'default test'); - - -// ap shortcut creating -var parsed = ArgParser.parse(['ageage']); -test("strictEqual", parsed.arg(0), "ageage"); -test('result', 'shortcut test'); diff --git a/node_modules/assert/assert.js b/node_modules/assert/assert.js deleted file mode 100644 index d275994..0000000 --- a/node_modules/assert/assert.js +++ /dev/null @@ -1,307 +0,0 @@ -(function () { - "use strict" - -// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 -// -// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! -// -// Originally from narwhal.js (http://narwhaljs.org) -// Copyright (c) 2009 Thomas Robinson <280north.com> -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the 'Software'), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS 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. - -// UTILITY -var util = require('util'); -var pSlice = Array.prototype.slice; - -// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. - -var assert = exports; - -// 2. The AssertionError is defined in assert. -// new assert.AssertionError({ message: message, -// actual: actual, -// expected: expected }) - -assert.AssertionError = function AssertionError(options) { - this.name = 'AssertionError'; - this.message = options.message; - this.actual = options.actual; - this.expected = options.expected; - this.operator = options.operator; - var stackStartFunction = options.stackStartFunction || fail; - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, stackStartFunction); - } -}; -util.inherits(assert.AssertionError, Error); - -assert.AssertionError.prototype.toString = function() { - if (this.message) { - return [this.name + ':', this.message].join(' '); - } else { - return [this.name + ':', - JSON.stringify(this.expected), - this.operator, - JSON.stringify(this.actual)].join(' '); - } -}; - -// assert.AssertionError instanceof Error - -assert.AssertionError.__proto__ = Error.prototype; - -// At present only the three keys mentioned above are used and -// understood by the spec. Implementations or sub modules can pass -// other keys to the AssertionError's constructor - they will be -// ignored. - -// 3. All of the following functions must throw an AssertionError -// when a corresponding condition is not met, with a message that -// may be undefined if not provided. All assertion methods provide -// both the actual and expected values to the assertion error for -// display purposes. - -function fail(actual, expected, message, operator, stackStartFunction) { - throw new assert.AssertionError({ - message: message, - actual: actual, - expected: expected, - operator: operator, - stackStartFunction: stackStartFunction - }); -} - -// EXTENSION! allows for well behaved errors defined elsewhere. -assert.fail = fail; - -// 4. Pure assertion tests whether a value is truthy, as determined -// by !!guard. -// assert.ok(guard, message_opt); -// This statement is equivalent to assert.equal(true, guard, -// message_opt);. To test strictly for the value true, use -// assert.strictEqual(true, guard, message_opt);. - -assert.ok = function ok(value, message) { - if (!!!value) fail(value, true, message, '==', assert.ok); -}; - -// 5. The equality assertion tests shallow, coercive equality with -// ==. -// assert.equal(actual, expected, message_opt); - -assert.equal = function equal(actual, expected, message) { - if (actual != expected) fail(actual, expected, message, '==', assert.equal); -}; - -// 6. The non-equality assertion tests for whether two objects are not equal -// with != assert.notEqual(actual, expected, message_opt); - -assert.notEqual = function notEqual(actual, expected, message) { - if (actual == expected) { - fail(actual, expected, message, '!=', assert.notEqual); - } -}; - -// 7. The equivalence assertion tests a deep equality relation. -// assert.deepEqual(actual, expected, message_opt); - -assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected)) { - fail(actual, expected, message, 'deepEqual', assert.deepEqual); - } -}; - -function _deepEqual(actual, expected) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { - if (actual.length != expected.length) return false; - - for (var i = 0; i < actual.length; i++) { - if (actual[i] !== expected[i]) return false; - } - - return true; - - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } -} - -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function objEquiv(a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b); - } - try { - var ka = Object.keys(a), - kb = Object.keys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key])) return false; - } - return true; -} - -// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); - -assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected)) { - fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); - } -}; - -// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); - -assert.strictEqual = function strictEqual(actual, expected, message) { - if (actual !== expected) { - fail(actual, expected, message, '===', assert.strictEqual); - } -}; - -// 10. The strict non-equality assertion tests for strict inequality, as -// determined by !==. assert.notStrictEqual(actual, expected, message_opt); - -assert.notStrictEqual = function notStrictEqual(actual, expected, message) { - if (actual === expected) { - fail(actual, expected, message, '!==', assert.notStrictEqual); - } -}; - -function expectedException(actual, expected) { - if (!actual || !expected) { - return false; - } - - if (expected instanceof RegExp) { - return expected.test(actual); - } else if (actual instanceof expected) { - return true; - } else if (expected.call({}, actual) === true) { - return true; - } - - return false; -} - -function _throws(shouldThrow, block, expected, message) { - var actual; - - if (typeof expected === 'string') { - message = expected; - expected = null; - } - - try { - block(); - } catch (e) { - actual = e; - } - - message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + - (message ? ' ' + message : '.'); - - if (shouldThrow && !actual) { - fail('Missing expected exception' + message); - } - - if (!shouldThrow && expectedException(actual, expected)) { - fail('Got unwanted exception' + message); - } - - if ((shouldThrow && actual && expected && - !expectedException(actual, expected)) || (!shouldThrow && actual)) { - throw actual; - } -} - -// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); - -assert.throws = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [true].concat(pSlice.call(arguments))); -}; - -// EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [false].concat(pSlice.call(arguments))); -}; - -assert.ifError = function(err) { if (err) {throw err;}}; - -}()); diff --git a/node_modules/assert/node_modules/util/node_modules/events.node/events.js b/node_modules/assert/node_modules/util/node_modules/events.node/events.js deleted file mode 100644 index 6b73619..0000000 --- a/node_modules/assert/node_modules/util/node_modules/events.node/events.js +++ /dev/null @@ -1,209 +0,0 @@ -if ('undefined' === typeof process) { - process = {}; -} -(function () { - "use strict"; - - process.EventEmitter = process.EventEmitter || function () {}; - -// Copyright Joyent, Inc. and other Node 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. - -var EventEmitter = exports.EventEmitter = process.EventEmitter; -var isArray = Array.isArray; - -// By default EventEmitters will print a warning if more than -// 10 listeners are added to it. This is a useful default which -// helps finding memory leaks. -// -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -var defaultMaxListeners = 10; -EventEmitter.prototype.setMaxListeners = function(n) { - if (!this._events) this._events = {}; - this._events.maxListeners = n; -}; - - -EventEmitter.prototype.emit = function(type) { - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events || !this._events.error || - (isArray(this._events.error) && !this._events.error.length)) - { - if (arguments[1] instanceof Error) { - throw arguments[1]; // Unhandled 'error' event - } else { - throw new Error("Uncaught, unspecified 'error' event."); - } - return false; - } - } - - if (!this._events) return false; - var handler = this._events[type]; - if (!handler) return false; - - if (typeof handler == 'function') { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - var args = Array.prototype.slice.call(arguments, 1); - handler.apply(this, args); - } - return true; - - } else if (isArray(handler)) { - var args = Array.prototype.slice.call(arguments, 1); - - var listeners = handler.slice(); - for (var i = 0, l = listeners.length; i < l; i++) { - listeners[i].apply(this, args); - } - return true; - - } else { - return false; - } -}; - -// EventEmitter is defined in src/node_events.cc -// EventEmitter.prototype.emit() is also defined there. -EventEmitter.prototype.addListener = function(type, listener) { - if ('function' !== typeof listener) { - throw new Error('addListener only takes instances of Function'); - } - - if (!this._events) this._events = {}; - - // To avoid recursion in the case that type == "newListeners"! Before - // adding it to the listeners, first emit "newListeners". - this.emit('newListener', type, listener); - - if (!this._events[type]) { - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - } else if (isArray(this._events[type])) { - - // If we've already got an array, just append. - this._events[type].push(listener); - - // Check for listener leak - if (!this._events[type].warned) { - var m; - if (this._events.maxListeners !== undefined) { - m = this._events.maxListeners; - } else { - m = defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - console.trace(); - } - } - } else { - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - var self = this; - function g() { - self.removeListener(type, g); - listener.apply(this, arguments); - }; - - g.listener = listener; - self.on(type, g); - - return this; -}; - -EventEmitter.prototype.removeListener = function(type, listener) { - if ('function' !== typeof listener) { - throw new Error('removeListener only takes instances of Function'); - } - - // does not use listeners(), so no side effect of creating _events[type] - if (!this._events || !this._events[type]) return this; - - var list = this._events[type]; - - if (isArray(list)) { - var position = -1; - for (var i = 0, length = list.length; i < length; i++) { - if (list[i] === listener || - (list[i].listener && list[i].listener === listener)) - { - position = i; - break; - } - } - - if (position < 0) return this; - list.splice(position, 1); - if (list.length == 0) - delete this._events[type]; - } else if (list === listener || - (list.listener && list.listener === listener)) - { - delete this._events[type]; - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - // does not use listeners(), so no side effect of creating _events[type] - if (type && this._events && this._events[type]) this._events[type] = null; - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - if (!this._events) this._events = {}; - if (!this._events[type]) this._events[type] = []; - if (!isArray(this._events[type])) { - this._events[type] = [this._events[type]]; - } - return this._events[type]; -}; - -}()); diff --git a/node_modules/assert/node_modules/util/node_modules/events.node/package.json b/node_modules/assert/node_modules/util/node_modules/events.node/package.json deleted file mode 100644 index eb15bbd..0000000 --- a/node_modules/assert/node_modules/util/node_modules/events.node/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "author": { - "name": "Joyent", - "url": "http://www.joyent.com" - }, - "name": "events.node", - "description": "Node.JS events module (packaged for Node.JS and Ender.JS)", - "keywords": [ - "ender", - "events" - ], - "version": "0.4.9", - "homepage": "http://nodejs.org/docs/v0.4.9/api/events.html", - "repository": { - "type": "git", - "url": "git://github.com/coolaj86/nodejs-libs-4-browser.git" - }, - "provides": "events", - "main": "./events.js", - "directories": { - "lib": "." - }, - "engines": { - "node": ">= 0.2.0", - "ender": ">= 0.5.0" - }, - "dependencies": {}, - "devDependencies": {}, - "_id": "events.node@0.4.9", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "8dec2e535c6e2dc00b5fea64e8556563aaec647c" - }, - "_from": "events.node@>= 0.4.0" -} diff --git a/node_modules/assert/node_modules/util/package.json b/node_modules/assert/node_modules/util/package.json deleted file mode 100644 index 66a63a0..0000000 --- a/node_modules/assert/node_modules/util/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "author": { - "name": "Joyent", - "url": "http://www.joyent.com" - }, - "name": "util", - "description": "Node.JS util module", - "keywords": [ - "ender", - "util" - ], - "version": "0.4.9", - "homepage": "http://nodejs.org/docs/v0.4.9/api/util.html", - "repository": { - "type": "git", - "url": "git://github.com/coolaj86/nodejs-libs-4-browser.git" - }, - "main": "./util.js", - "directories": { - "lib": "." - }, - "engines": { - "node": ">= 0.2.0", - "ender": ">= 0.5.0" - }, - "dependencies": { - "events.node": ">= 0.4.0" - }, - "devDependencies": {}, - "_id": "util@0.4.9", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "44d4347ea67bd374afec15133075d7b35fa94ddf" - }, - "_from": "util@>= 0.4.9" -} diff --git a/node_modules/assert/node_modules/util/util.js b/node_modules/assert/node_modules/util/util.js deleted file mode 100644 index c821f39..0000000 --- a/node_modules/assert/node_modules/util/util.js +++ /dev/null @@ -1,439 +0,0 @@ -var process = process; -(function () { - "use strict"; - -// Copyright Joyent, Inc. and other Node 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. - -var events = require('events.node'); - - -exports.print = function() { - for (var i = 0, len = arguments.length; i < len; ++i) { - process.stdout.write(String(arguments[i])); - } -}; - - -exports.puts = function() { - for (var i = 0, len = arguments.length; i < len; ++i) { - process.stdout.write(arguments[i] + '\n'); - } -}; - - -exports.debug = function(x) { - process.binding('stdio').writeError('DEBUG: ' + x + '\n'); -}; - - -var error = exports.error = function(x) { - for (var i = 0, len = arguments.length; i < len; ++i) { - process.binding('stdio').writeError(arguments[i] + '\n'); - } -}; - - -/** - * Echos the value of a value. Trys to print the value out - * in the best way possible given the different types. - * - * @param {Object} obj The object to print out. - * @param {Boolean} showHidden Flag that shows hidden (not enumerable) - * properties of objects. - * @param {Number} depth Depth in which to descend in object. Default is 2. - * @param {Boolean} colors Flag to turn on ANSI escape codes to color the - * output. Default is false (no coloring). - */ -exports.inspect = function(obj, showHidden, depth, colors) { - var seen = []; - - var stylize = function(str, styleType) { - // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics - var styles = - { 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] }; - - var style = - { 'special': 'cyan', - 'number': 'blue', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' }[styleType]; - - if (style) { - return '\x1B[' + styles[style][0] + 'm' + str + - '\x1B[' + styles[style][1] + 'm'; - } else { - return str; - } - }; - if (! colors) { - stylize = function(str, styleType) { return str; }; - } - - function format(value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (value && typeof value.inspect === 'function' && - // Filter out the util module, it's inspect function is special - value !== exports && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - return value.inspect(recurseTimes); - } - - // Primitive types cannot have properties - switch (typeof value) { - case 'undefined': - return stylize('undefined', 'undefined'); - - case 'string': - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return stylize(simple, 'string'); - - case 'number': - return stylize('' + value, 'number'); - - case 'boolean': - return stylize('' + value, 'boolean'); - } - // For some reason typeof null is "object", so special case here. - if (value === null) { - return stylize('null', 'null'); - } - - // Look up the keys of the object. - var visible_keys = Object.keys(value); - var keys = showHidden ? Object.getOwnPropertyNames(value) : visible_keys; - - // Functions without properties can be shortcutted. - if (typeof value === 'function' && keys.length === 0) { - if (isRegExp(value)) { - return stylize('' + value, 'regexp'); - } else { - var name = value.name ? ': ' + value.name : ''; - return stylize('[Function' + name + ']', 'special'); - } - } - - // Dates without properties can be shortcutted - if (isDate(value) && keys.length === 0) { - return stylize(value.toUTCString(), 'date'); - } - - var base, type, braces; - // Determine the object type - if (isArray(value)) { - type = 'Array'; - braces = ['[', ']']; - } else { - type = 'Object'; - braces = ['{', '}']; - } - - // Make functions say that they are functions - if (typeof value === 'function') { - var n = value.name ? ': ' + value.name : ''; - base = (isRegExp(value)) ? ' ' + value : ' [Function' + n + ']'; - } else { - base = ''; - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + value.toUTCString(); - } - - if (keys.length === 0) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return stylize('' + value, 'regexp'); - } else { - return stylize('[Object]', 'special'); - } - } - - seen.push(value); - - var output = keys.map(function(key) { - var name, str; - if (value.__lookupGetter__) { - if (value.__lookupGetter__(key)) { - if (value.__lookupSetter__(key)) { - str = stylize('[Getter/Setter]', 'special'); - } else { - str = stylize('[Getter]', 'special'); - } - } else { - if (value.__lookupSetter__(key)) { - str = stylize('[Setter]', 'special'); - } - } - } - if (visible_keys.indexOf(key) < 0) { - name = '[' + key + ']'; - } - if (!str) { - if (seen.indexOf(value[key]) < 0) { - if (recurseTimes === null) { - str = format(value[key]); - } else { - str = format(value[key], recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (isArray(value)) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = stylize('[Circular]', 'special'); - } - } - if (typeof name === 'undefined') { - if (type === 'Array' && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = stylize(name, 'string'); - } - } - - return name + ': ' + str; - }); - - seen.pop(); - - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.length + 1; - }, 0); - - if (length > (require('readline').columns || 50)) { - output = braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - - } else { - output = braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; - } - - return output; - } - return format(obj, (typeof depth === 'undefined' ? 2 : depth)); -}; - - -function isArray(ar) { - return ar instanceof Array || - Array.isArray(ar) || - (ar && ar !== Object.prototype && isArray(ar.__proto__)); -} - - -function isRegExp(re) { - var s = '' + re; - return re instanceof RegExp || // easy case - // duck-type for context-switching evalcx case - typeof(re) === 'function' && - re.constructor.name === 'RegExp' && - re.compile && - re.test && - re.exec && - s.match(/^\/.*\/[gim]{0,3}$/); -} - - -function isDate(d) { - if (d instanceof Date) return true; - if (typeof d !== 'object') return false; - var properties = Date.prototype && Object.getOwnPropertyNames(Date.prototype); - var proto = d.__proto__ && Object.getOwnPropertyNames(d.__proto__); - return JSON.stringify(proto) === JSON.stringify(properties); -} - - -var pWarning; - -exports.p = function() { - if (!pWarning) { - pWarning = 'util.p will be removed in future versions of Node. ' + - 'Use util.puts(util.inspect()) instead.\n'; - exports.error(pWarning); - } - for (var i = 0, len = arguments.length; i < len; ++i) { - error(exports.inspect(arguments[i])); - } -}; - - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - - -exports.log = function(msg) { - exports.puts(timestamp() + ' - ' + msg.toString()); -}; - - -var execWarning; -exports.exec = function() { - if (!execWarning) { - execWarning = 'util.exec has moved to the "child_process" module.' + - ' Please update your source code.'; - error(execWarning); - } - return require('child_process').exec.apply(this, arguments); -}; - - -exports.pump = function(readStream, writeStream, callback) { - var callbackCalled = false; - - function call(a, b, c) { - if (callback && !callbackCalled) { - callback(a, b, c); - callbackCalled = true; - } - } - - if (!readStream.pause) { - readStream.pause = function() {readStream.emit('pause');}; - } - - if (!readStream.resume) { - readStream.resume = function() {readStream.emit('resume');}; - } - - readStream.addListener('data', function(chunk) { - if (writeStream.write(chunk) === false) readStream.pause(); - }); - - writeStream.addListener('pause', function() { - readStream.pause(); - }); - - writeStream.addListener('drain', function() { - readStream.resume(); - }); - - writeStream.addListener('resume', function() { - readStream.resume(); - }); - - readStream.addListener('end', function() { - writeStream.end(); - }); - - readStream.addListener('close', function() { - call(); - }); - - readStream.addListener('error', function(err) { - writeStream.end(); - call(err); - }); - - writeStream.addListener('error', function(err) { - readStream.destroy(); - call(err); - }); -}; - - -/** - * Inherit the prototype methods from one constructor into another. - * - * The Function.prototype.inherits from lang.js rewritten as a standalone - * function (not on Function.prototype). NOTE: If this file is to be loaded - * during bootstrapping this function needs to be revritten using some native - * functions as prototype setup using normal JavaScript does not work as - * expected during bootstrapping (see mirror.js in r114903). - * - * @param {function} ctor Constructor function which needs to inherit the - * prototype. - * @param {function} superCtor Constructor function to inherit prototype from. - */ -exports.inherits = function(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -}; - -}()); diff --git a/node_modules/assert/package.json b/node_modules/assert/package.json deleted file mode 100644 index bd3f61d..0000000 --- a/node_modules/assert/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "author": { - "name": "narwhal.js", - "url": "http://narwhaljs.org" - }, - "name": "assert", - "description": "Node.JS assert module", - "keywords": [ - "ender", - "assert" - ], - "version": "0.4.9", - "homepage": "http://nodejs.org/docs/v0.4.9/api/assert.html", - "repository": { - "type": "git", - "url": "git://github.com/coolaj86/nodejs-libs-4-browser.git" - }, - "main": "./assert.js", - "directories": { - "lib": "." - }, - "engines": { - "node": ">= 0.2.0", - "ender": ">= 0.5.0" - }, - "dependencies": { - "util": ">= 0.4.9" - }, - "devDependencies": {}, - "_id": "assert@0.4.9", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "1fe439ff515f5a96c7ebe37c07154e1d2ae91528" - }, - "_from": "assert" -} diff --git a/node_modules/express/.npmignore b/node_modules/express/.npmignore deleted file mode 100644 index 98d8e48..0000000 --- a/node_modules/express/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -.git* -docs/ -examples/ -support/ -test/ -testing.js -.DS_Store -coverage.html diff --git a/node_modules/express/.travis.yml b/node_modules/express/.travis.yml deleted file mode 100644 index b8e1f17..0000000 --- a/node_modules/express/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.6 \ No newline at end of file diff --git a/node_modules/express/History.md b/node_modules/express/History.md deleted file mode 100644 index 040b6e4..0000000 --- a/node_modules/express/History.md +++ /dev/null @@ -1,866 +0,0 @@ - -3.0.0alpha1 / 2012-04-15 -================== - - * Added `app.locals.use(callback)` - * Added `app.locals` object - * Added `app.locals(obj)` - * Added `res.locals` object - * Added `res.locals(obj)` - * Added `res.format()` for content-negotiation - * Added `app.engine()` - * Added `res.cookie()` JSON cookie support - * Added "trust proxy" setting - * Added `req.subdomains` - * Added `req.protocol` - * Added `req.secure` - * Added `req.path` - * Added `req.ips` - * Added `req.fresh` - * Added `req.stale` - * Added comma-delmited / array support for `req.accepts()` - * Added debug instrumentation - * Added `res.set(obj)` - * Added `res.set(field, value)` - * Added `res.get(field)` - * Added `app.get(setting)`. Closes #842 - * Added `req.acceptsLanguage()` - * Added `req.acceptsCharset()` - * Added `req.accepted` - * Added `req.acceptedLanguages` - * Added `req.acceptedCharsets` - * Added "json replacer" setting - * Added "json spaces" setting - * Added X-Forwarded-Proto support to `res.redirect()`. Closes #92 - * Added `--less` support to express(1) - * Added `express.response` prototype - * Added `express.request` prototype - * Added `express.application` prototype - * Added `app.path()` - * Added `app.render()` - * Added `res.type()` to replace `res.contentType()` - * Changed: `res.redirect()` to add relative support - * Changed: enable "jsonp callback" by default - * Changed: renamed "case sensitive routes" to "case sensitive routing" - * Rewrite of all tests with mocha - * Removed "root" setting - * Removed `res.redirect('home')` support - * Removed `req.notify()` - * Removed `app.register()` - * Removed `app.redirect()` - * Removed `app.is()` - * Removed `app.helpers()` - * Removed `app.dynamicHelpers()` - * Fixed `res.sendfile()` with non-GET. Closes #723 - * Fixed express(1) public dir for windows. Closes #866 - -2.5.9/ 2012-04-02 -================== - - * Added support for PURGE request method [pbuyle] - * Fixed `express(1)` generated app `app.address()` before `listening` [mmalecki] - -2.5.8 / 2012-02-08 -================== - - * Update mkdirp dep. Closes #991 - -2.5.7 / 2012-02-06 -================== - - * Fixed `app.all` duplicate DELETE requests [mscdex] - -2.5.6 / 2012-01-13 -================== - - * Updated hamljs dev dep. Closes #953 - -2.5.5 / 2012-01-08 -================== - - * Fixed: set `filename` on cached templates [matthewleon] - -2.5.4 / 2012-01-02 -================== - - * Fixed `express(1)` eol on 0.4.x. Closes #947 - -2.5.3 / 2011-12-30 -================== - - * Fixed `req.is()` when a charset is present - -2.5.2 / 2011-12-10 -================== - - * Fixed: express(1) LF -> CRLF for windows - -2.5.1 / 2011-11-17 -================== - - * Changed: updated connect to 1.8.x - * Removed sass.js support from express(1) - -2.5.0 / 2011-10-24 -================== - - * Added ./routes dir for generated app by default - * Added npm install reminder to express(1) app gen - * Added 0.5.x support - * Removed `make test-cov` since it wont work with node 0.5.x - * Fixed express(1) public dir for windows. Closes #866 - -2.4.7 / 2011-10-05 -================== - - * Added mkdirp to express(1). Closes #795 - * Added simple _json-config_ example - * Added shorthand for the parsed request's pathname via `req.path` - * Changed connect dep to 1.7.x to fix npm issue... - * Fixed `res.redirect()` __HEAD__ support. [reported by xerox] - * Fixed `req.flash()`, only escape args - * Fixed absolute path checking on windows. Closes #829 [reported by andrewpmckenzie] - -2.4.6 / 2011-08-22 -================== - - * Fixed multiple param callback regression. Closes #824 [reported by TroyGoode] - -2.4.5 / 2011-08-19 -================== - - * Added support for routes to handle errors. Closes #809 - * Added `app.routes.all()`. Closes #803 - * Added "basepath" setting to work in conjunction with reverse proxies etc. - * Refactored `Route` to use a single array of callbacks - * Added support for multiple callbacks for `app.param()`. Closes #801 -Closes #805 - * Changed: removed .call(self) for route callbacks - * Dependency: `qs >= 0.3.1` - * Fixed `res.redirect()` on windows due to `join()` usage. Closes #808 - -2.4.4 / 2011-08-05 -================== - - * Fixed `res.header()` intention of a set, even when `undefined` - * Fixed `*`, value no longer required - * Fixed `res.send(204)` support. Closes #771 - -2.4.3 / 2011-07-14 -================== - - * Added docs for `status` option special-case. Closes #739 - * Fixed `options.filename`, exposing the view path to template engines - -2.4.2. / 2011-07-06 -================== - - * Revert "removed jsonp stripping" for XSS - -2.4.1 / 2011-07-06 -================== - - * Added `res.json()` JSONP support. Closes #737 - * Added _extending-templates_ example. Closes #730 - * Added "strict routing" setting for trailing slashes - * Added support for multiple envs in `app.configure()` calls. Closes #735 - * Changed: `res.send()` using `res.json()` - * Changed: when cookie `path === null` don't default it - * Changed; default cookie path to "home" setting. Closes #731 - * Removed _pids/logs_ creation from express(1) - -2.4.0 / 2011-06-28 -================== - - * Added chainable `res.status(code)` - * Added `res.json()`, an explicit version of `res.send(obj)` - * Added simple web-service example - -2.3.12 / 2011-06-22 -================== - - * \#express is now on freenode! come join! - * Added `req.get(field, param)` - * Added links to Japanese documentation, thanks @hideyukisaito! - * Added; the `express(1)` generated app outputs the env - * Added `content-negotiation` example - * Dependency: connect >= 1.5.1 < 2.0.0 - * Fixed view layout bug. Closes #720 - * Fixed; ignore body on 304. Closes #701 - -2.3.11 / 2011-06-04 -================== - - * Added `npm test` - * Removed generation of dummy test file from `express(1)` - * Fixed; `express(1)` adds express as a dep - * Fixed; prune on `prepublish` - -2.3.10 / 2011-05-27 -================== - - * Added `req.route`, exposing the current route - * Added _package.json_ generation support to `express(1)` - * Fixed call to `app.param()` function for optional params. Closes #682 - -2.3.9 / 2011-05-25 -================== - - * Fixed bug-ish with `../' in `res.partial()` calls - -2.3.8 / 2011-05-24 -================== - - * Fixed `app.options()` - -2.3.7 / 2011-05-23 -================== - - * Added route `Collection`, ex: `app.get('/user/:id').remove();` - * Added support for `app.param(fn)` to define param logic - * Removed `app.param()` support for callback with return value - * Removed module.parent check from express(1) generated app. Closes #670 - * Refactored router. Closes #639 - -2.3.6 / 2011-05-20 -================== - - * Changed; using devDependencies instead of git submodules - * Fixed redis session example - * Fixed markdown example - * Fixed view caching, should not be enabled in development - -2.3.5 / 2011-05-20 -================== - - * Added export `.view` as alias for `.View` - -2.3.4 / 2011-05-08 -================== - - * Added `./examples/say` - * Fixed `res.sendfile()` bug preventing the transfer of files with spaces - -2.3.3 / 2011-05-03 -================== - - * Added "case sensitive routes" option. - * Changed; split methods supported per rfc [slaskis] - * Fixed route-specific middleware when using the same callback function several times - -2.3.2 / 2011-04-27 -================== - - * Fixed view hints - -2.3.1 / 2011-04-26 -================== - - * Added `app.match()` as `app.match.all()` - * Added `app.lookup()` as `app.lookup.all()` - * Added `app.remove()` for `app.remove.all()` - * Added `app.remove.VERB()` - * Fixed template caching collision issue. Closes #644 - * Moved router over from connect and started refactor - -2.3.0 / 2011-04-25 -================== - - * Added options support to `res.clearCookie()` - * Added `res.helpers()` as alias of `res.locals()` - * Added; json defaults to UTF-8 with `res.send()`. Closes #632. [Daniel * Dependency `connect >= 1.4.0` - * Changed; auto set Content-Type in res.attachement [Aaron Heckmann] - * Renamed "cache views" to "view cache". Closes #628 - * Fixed caching of views when using several apps. Closes #637 - * Fixed gotcha invoking `app.param()` callbacks once per route middleware. -Closes #638 - * Fixed partial lookup precedence. Closes #631 -Shaw] - -2.2.2 / 2011-04-12 -================== - - * Added second callback support for `res.download()` connection errors - * Fixed `filename` option passing to template engine - -2.2.1 / 2011-04-04 -================== - - * Added `layout(path)` helper to change the layout within a view. Closes #610 - * Fixed `partial()` collection object support. - Previously only anything with `.length` would work. - When `.length` is present one must still be aware of holes, - however now `{ collection: {foo: 'bar'}}` is valid, exposes - `keyInCollection` and `keysInCollection`. - - * Performance improved with better view caching - * Removed `request` and `response` locals - * Changed; errorHandler page title is now `Express` instead of `Connect` - -2.2.0 / 2011-03-30 -================== - - * Added `app.lookup.VERB()`, ex `app.lookup.put('/user/:id')`. Closes #606 - * Added `app.match.VERB()`, ex `app.match.put('/user/12')`. Closes #606 - * Added `app.VERB(path)` as alias of `app.lookup.VERB()`. - * Dependency `connect >= 1.2.0` - -2.1.1 / 2011-03-29 -================== - - * Added; expose `err.view` object when failing to locate a view - * Fixed `res.partial()` call `next(err)` when no callback is given [reported by aheckmann] - * Fixed; `res.send(undefined)` responds with 204 [aheckmann] - -2.1.0 / 2011-03-24 -================== - - * Added `/_?` partial lookup support. Closes #447 - * Added `request`, `response`, and `app` local variables - * Added `settings` local variable, containing the app's settings - * Added `req.flash()` exception if `req.session` is not available - * Added `res.send(bool)` support (json response) - * Fixed stylus example for latest version - * Fixed; wrap try/catch around `res.render()` - -2.0.0 / 2011-03-17 -================== - - * Fixed up index view path alternative. - * Changed; `res.locals()` without object returns the locals - -2.0.0rc3 / 2011-03-17 -================== - - * Added `res.locals(obj)` to compliment `res.local(key, val)` - * Added `res.partial()` callback support - * Fixed recursive error reporting issue in `res.render()` - -2.0.0rc2 / 2011-03-17 -================== - - * Changed; `partial()` "locals" are now optional - * Fixed `SlowBuffer` support. Closes #584 [reported by tyrda01] - * Fixed .filename view engine option [reported by drudge] - * Fixed blog example - * Fixed `{req,res}.app` reference when mounting [Ben Weaver] - -2.0.0rc / 2011-03-14 -================== - - * Fixed; expose `HTTPSServer` constructor - * Fixed express(1) default test charset. Closes #579 [reported by secoif] - * Fixed; default charset to utf-8 instead of utf8 for lame IE [reported by NickP] - -2.0.0beta3 / 2011-03-09 -================== - - * Added support for `res.contentType()` literal - The original `res.contentType('.json')`, - `res.contentType('application/json')`, and `res.contentType('json')` - will work now. - * Added `res.render()` status option support back - * Added charset option for `res.render()` - * Added `.charset` support (via connect 1.0.4) - * Added view resolution hints when in development and a lookup fails - * Added layout lookup support relative to the page view. - For example while rendering `./views/user/index.jade` if you create - `./views/user/layout.jade` it will be used in favour of the root layout. - * Fixed `res.redirect()`. RFC states absolute url [reported by unlink] - * Fixed; default `res.send()` string charset to utf8 - * Removed `Partial` constructor (not currently used) - -2.0.0beta2 / 2011-03-07 -================== - - * Added res.render() `.locals` support back to aid in migration process - * Fixed flash example - -2.0.0beta / 2011-03-03 -================== - - * Added HTTPS support - * Added `res.cookie()` maxAge support - * Added `req.header()` _Referrer_ / _Referer_ special-case, either works - * Added mount support for `res.redirect()`, now respects the mount-point - * Added `union()` util, taking place of `merge(clone())` combo - * Added stylus support to express(1) generated app - * Added secret to session middleware used in examples and generated app - * Added `res.local(name, val)` for progressive view locals - * Added default param support to `req.param(name, default)` - * Added `app.disabled()` and `app.enabled()` - * Added `app.register()` support for omitting leading ".", either works - * Added `res.partial()`, using the same interface as `partial()` within a view. Closes #539 - * Added `app.param()` to map route params to async/sync logic - * Added; aliased `app.helpers()` as `app.locals()`. Closes #481 - * Added extname with no leading "." support to `res.contentType()` - * Added `cache views` setting, defaulting to enabled in "production" env - * Added index file partial resolution, eg: partial('user') may try _views/user/index.jade_. - * Added `req.accepts()` support for extensions - * Changed; `res.download()` and `res.sendfile()` now utilize Connect's - static file server `connect.static.send()`. - * Changed; replaced `connect.utils.mime()` with npm _mime_ module - * Changed; allow `req.query` to be pre-defined (via middleware or other parent - * Changed view partial resolution, now relative to parent view - * Changed view engine signature. no longer `engine.render(str, options, callback)`, now `engine.compile(str, options) -> Function`, the returned function accepts `fn(locals)`. - * Fixed `req.param()` bug returning Array.prototype methods. Closes #552 - * Fixed; using `Stream#pipe()` instead of `sys.pump()` in `res.sendfile()` - * Fixed; using _qs_ module instead of _querystring_ - * Fixed; strip unsafe chars from jsonp callbacks - * Removed "stream threshold" setting - -1.0.8 / 2011-03-01 -================== - - * Allow `req.query` to be pre-defined (via middleware or other parent app) - * "connect": ">= 0.5.0 < 1.0.0". Closes #547 - * Removed the long deprecated __EXPRESS_ENV__ support - -1.0.7 / 2011-02-07 -================== - - * Fixed `render()` setting inheritance. - Mounted apps would not inherit "view engine" - -1.0.6 / 2011-02-07 -================== - - * Fixed `view engine` setting bug when period is in dirname - -1.0.5 / 2011-02-05 -================== - - * Added secret to generated app `session()` call - -1.0.4 / 2011-02-05 -================== - - * Added `qs` dependency to _package.json_ - * Fixed namespaced `require()`s for latest connect support - -1.0.3 / 2011-01-13 -================== - - * Remove unsafe characters from JSONP callback names [Ryan Grove] - -1.0.2 / 2011-01-10 -================== - - * Removed nested require, using `connect.router` - -1.0.1 / 2010-12-29 -================== - - * Fixed for middleware stacked via `createServer()` - previously the `foo` middleware passed to `createServer(foo)` - would not have access to Express methods such as `res.send()` - or props like `req.query` etc. - -1.0.0 / 2010-11-16 -================== - - * Added; deduce partial object names from the last segment. - For example by default `partial('forum/post', postObject)` will - give you the _post_ object, providing a meaningful default. - * Added http status code string representation to `res.redirect()` body - * Added; `res.redirect()` supporting _text/plain_ and _text/html_ via __Accept__. - * Added `req.is()` to aid in content negotiation - * Added partial local inheritance [suggested by masylum]. Closes #102 - providing access to parent template locals. - * Added _-s, --session[s]_ flag to express(1) to add session related middleware - * Added _--template_ flag to express(1) to specify the - template engine to use. - * Added _--css_ flag to express(1) to specify the - stylesheet engine to use (or just plain css by default). - * Added `app.all()` support [thanks aheckmann] - * Added partial direct object support. - You may now `partial('user', user)` providing the "user" local, - vs previously `partial('user', { object: user })`. - * Added _route-separation_ example since many people question ways - to do this with CommonJS modules. Also view the _blog_ example for - an alternative. - * Performance; caching view path derived partial object names - * Fixed partial local inheritance precedence. [reported by Nick Poulden] Closes #454 - * Fixed jsonp support; _text/javascript_ as per mailinglist discussion - -1.0.0rc4 / 2010-10-14 -================== - - * Added _NODE_ENV_ support, _EXPRESS_ENV_ is deprecated and will be removed in 1.0.0 - * Added route-middleware support (very helpful, see the [docs](http://expressjs.com/guide.html#Route-Middleware)) - * Added _jsonp callback_ setting to enable/disable jsonp autowrapping [Dav Glass] - * Added callback query check on response.send to autowrap JSON objects for simple webservice implementations [Dav Glass] - * Added `partial()` support for array-like collections. Closes #434 - * Added support for swappable querystring parsers - * Added session usage docs. Closes #443 - * Added dynamic helper caching. Closes #439 [suggested by maritz] - * Added authentication example - * Added basic Range support to `res.sendfile()` (and `res.download()` etc) - * Changed; `express(1)` generated app using 2 spaces instead of 4 - * Default env to "development" again [aheckmann] - * Removed _context_ option is no more, use "scope" - * Fixed; exposing _./support_ libs to examples so they can run without installs - * Fixed mvc example - -1.0.0rc3 / 2010-09-20 -================== - - * Added confirmation for `express(1)` app generation. Closes #391 - * Added extending of flash formatters via `app.flashFormatters` - * Added flash formatter support. Closes #411 - * Added streaming support to `res.sendfile()` using `sys.pump()` when >= "stream threshold" - * Added _stream threshold_ setting for `res.sendfile()` - * Added `res.send()` __HEAD__ support - * Added `res.clearCookie()` - * Added `res.cookie()` - * Added `res.render()` headers option - * Added `res.redirect()` response bodies - * Added `res.render()` status option support. Closes #425 [thanks aheckmann] - * Fixed `res.sendfile()` responding with 403 on malicious path - * Fixed `res.download()` bug; when an error occurs remove _Content-Disposition_ - * Fixed; mounted apps settings now inherit from parent app [aheckmann] - * Fixed; stripping Content-Length / Content-Type when 204 - * Fixed `res.send()` 204. Closes #419 - * Fixed multiple _Set-Cookie_ headers via `res.header()`. Closes #402 - * Fixed bug messing with error handlers when `listenFD()` is called instead of `listen()`. [thanks guillermo] - - -1.0.0rc2 / 2010-08-17 -================== - - * Added `app.register()` for template engine mapping. Closes #390 - * Added `res.render()` callback support as second argument (no options) - * Added callback support to `res.download()` - * Added callback support for `res.sendfile()` - * Added support for middleware access via `express.middlewareName()` vs `connect.middlewareName()` - * Added "partials" setting to docs - * Added default expresso tests to `express(1)` generated app. Closes #384 - * Fixed `res.sendfile()` error handling, defer via `next()` - * Fixed `res.render()` callback when a layout is used [thanks guillermo] - * Fixed; `make install` creating ~/.node_libraries when not present - * Fixed issue preventing error handlers from being defined anywhere. Closes #387 - -1.0.0rc / 2010-07-28 -================== - - * Added mounted hook. Closes #369 - * Added connect dependency to _package.json_ - - * Removed "reload views" setting and support code - development env never caches, production always caches. - - * Removed _param_ in route callbacks, signature is now - simply (req, res, next), previously (req, res, params, next). - Use _req.params_ for path captures, _req.query_ for GET params. - - * Fixed "home" setting - * Fixed middleware/router precedence issue. Closes #366 - * Fixed; _configure()_ callbacks called immediately. Closes #368 - -1.0.0beta2 / 2010-07-23 -================== - - * Added more examples - * Added; exporting `Server` constructor - * Added `Server#helpers()` for view locals - * Added `Server#dynamicHelpers()` for dynamic view locals. Closes #349 - * Added support for absolute view paths - * Added; _home_ setting defaults to `Server#route` for mounted apps. Closes #363 - * Added Guillermo Rauch to the contributor list - * Added support for "as" for non-collection partials. Closes #341 - * Fixed _install.sh_, ensuring _~/.node_libraries_ exists. Closes #362 [thanks jf] - * Fixed `res.render()` exceptions, now passed to `next()` when no callback is given [thanks guillermo] - * Fixed instanceof `Array` checks, now `Array.isArray()` - * Fixed express(1) expansion of public dirs. Closes #348 - * Fixed middleware precedence. Closes #345 - * Fixed view watcher, now async [thanks aheckmann] - -1.0.0beta / 2010-07-15 -================== - - * Re-write - - much faster - - much lighter - - Check [ExpressJS.com](http://expressjs.com) for migration guide and updated docs - -0.14.0 / 2010-06-15 -================== - - * Utilize relative requires - * Added Static bufferSize option [aheckmann] - * Fixed caching of view and partial subdirectories [aheckmann] - * Fixed mime.type() comments now that ".ext" is not supported - * Updated haml submodule - * Updated class submodule - * Removed bin/express - -0.13.0 / 2010-06-01 -================== - - * Added node v0.1.97 compatibility - * Added support for deleting cookies via Request#cookie('key', null) - * Updated haml submodule - * Fixed not-found page, now using using charset utf-8 - * Fixed show-exceptions page, now using using charset utf-8 - * Fixed view support due to fs.readFile Buffers - * Changed; mime.type() no longer accepts ".type" due to node extname() changes - -0.12.0 / 2010-05-22 -================== - - * Added node v0.1.96 compatibility - * Added view `helpers` export which act as additional local variables - * Updated haml submodule - * Changed ETag; removed inode, modified time only - * Fixed LF to CRLF for setting multiple cookies - * Fixed cookie complation; values are now urlencoded - * Fixed cookies parsing; accepts quoted values and url escaped cookies - -0.11.0 / 2010-05-06 -================== - - * Added support for layouts using different engines - - this.render('page.html.haml', { layout: 'super-cool-layout.html.ejs' }) - - this.render('page.html.haml', { layout: 'foo' }) // assumes 'foo.html.haml' - - this.render('page.html.haml', { layout: false }) // no layout - * Updated ext submodule - * Updated haml submodule - * Fixed EJS partial support by passing along the context. Issue #307 - -0.10.1 / 2010-05-03 -================== - - * Fixed binary uploads. - -0.10.0 / 2010-04-30 -================== - - * Added charset support via Request#charset (automatically assigned to 'UTF-8' when respond()'s - encoding is set to 'utf8' or 'utf-8'. - * Added "encoding" option to Request#render(). Closes #299 - * Added "dump exceptions" setting, which is enabled by default. - * Added simple ejs template engine support - * Added error reponse support for text/plain, application/json. Closes #297 - * Added callback function param to Request#error() - * Added Request#sendHead() - * Added Request#stream() - * Added support for Request#respond(304, null) for empty response bodies - * Added ETag support to Request#sendfile() - * Added options to Request#sendfile(), passed to fs.createReadStream() - * Added filename arg to Request#download() - * Performance enhanced due to pre-reversing plugins so that plugins.reverse() is not called on each request - * Performance enhanced by preventing several calls to toLowerCase() in Router#match() - * Changed; Request#sendfile() now streams - * Changed; Renamed Request#halt() to Request#respond(). Closes #289 - * Changed; Using sys.inspect() instead of JSON.encode() for error output - * Changed; run() returns the http.Server instance. Closes #298 - * Changed; Defaulting Server#host to null (INADDR_ANY) - * Changed; Logger "common" format scale of 0.4f - * Removed Logger "request" format - * Fixed; Catching ENOENT in view caching, preventing error when "views/partials" is not found - * Fixed several issues with http client - * Fixed Logger Content-Length output - * Fixed bug preventing Opera from retaining the generated session id. Closes #292 - -0.9.0 / 2010-04-14 -================== - - * Added DSL level error() route support - * Added DSL level notFound() route support - * Added Request#error() - * Added Request#notFound() - * Added Request#render() callback function. Closes #258 - * Added "max upload size" setting - * Added "magic" variables to collection partials (\_\_index\_\_, \_\_length\_\_, \_\_isFirst\_\_, \_\_isLast\_\_). Closes #254 - * Added [haml.js](http://github.com/visionmedia/haml.js) submodule; removed haml-js - * Added callback function support to Request#halt() as 3rd/4th arg - * Added preprocessing of route param wildcards using param(). Closes #251 - * Added view partial support (with collections etc) - * Fixed bug preventing falsey params (such as ?page=0). Closes #286 - * Fixed setting of multiple cookies. Closes #199 - * Changed; view naming convention is now NAME.TYPE.ENGINE (for example page.html.haml) - * Changed; session cookie is now httpOnly - * Changed; Request is no longer global - * Changed; Event is no longer global - * Changed; "sys" module is no longer global - * Changed; moved Request#download to Static plugin where it belongs - * Changed; Request instance created before body parsing. Closes #262 - * Changed; Pre-caching views in memory when "cache view contents" is enabled. Closes #253 - * Changed; Pre-caching view partials in memory when "cache view partials" is enabled - * Updated support to node --version 0.1.90 - * Updated dependencies - * Removed set("session cookie") in favour of use(Session, { cookie: { ... }}) - * Removed utils.mixin(); use Object#mergeDeep() - -0.8.0 / 2010-03-19 -================== - - * Added coffeescript example app. Closes #242 - * Changed; cache api now async friendly. Closes #240 - * Removed deprecated 'express/static' support. Use 'express/plugins/static' - -0.7.6 / 2010-03-19 -================== - - * Added Request#isXHR. Closes #229 - * Added `make install` (for the executable) - * Added `express` executable for setting up simple app templates - * Added "GET /public/*" to Static plugin, defaulting to /public - * Added Static plugin - * Fixed; Request#render() only calls cache.get() once - * Fixed; Namespacing View caches with "view:" - * Fixed; Namespacing Static caches with "static:" - * Fixed; Both example apps now use the Static plugin - * Fixed set("views"). Closes #239 - * Fixed missing space for combined log format - * Deprecated Request#sendfile() and 'express/static' - * Removed Server#running - -0.7.5 / 2010-03-16 -================== - - * Added Request#flash() support without args, now returns all flashes - * Updated ext submodule - -0.7.4 / 2010-03-16 -================== - - * Fixed session reaper - * Changed; class.js replacing js-oo Class implementation (quite a bit faster, no browser cruft) - -0.7.3 / 2010-03-16 -================== - - * Added package.json - * Fixed requiring of haml / sass due to kiwi removal - -0.7.2 / 2010-03-16 -================== - - * Fixed GIT submodules (HAH!) - -0.7.1 / 2010-03-16 -================== - - * Changed; Express now using submodules again until a PM is adopted - * Changed; chat example using millisecond conversions from ext - -0.7.0 / 2010-03-15 -================== - - * Added Request#pass() support (finds the next matching route, or the given path) - * Added Logger plugin (default "common" format replaces CommonLogger) - * Removed Profiler plugin - * Removed CommonLogger plugin - -0.6.0 / 2010-03-11 -================== - - * Added seed.yml for kiwi package management support - * Added HTTP client query string support when method is GET. Closes #205 - - * Added support for arbitrary view engines. - For example "foo.engine.html" will now require('engine'), - the exports from this module are cached after the first require(). - - * Added async plugin support - - * Removed usage of RESTful route funcs as http client - get() etc, use http.get() and friends - - * Removed custom exceptions - -0.5.0 / 2010-03-10 -================== - - * Added ext dependency (library of js extensions) - * Removed extname() / basename() utils. Use path module - * Removed toArray() util. Use arguments.values - * Removed escapeRegexp() util. Use RegExp.escape() - * Removed process.mixin() dependency. Use utils.mixin() - * Removed Collection - * Removed ElementCollection - * Shameless self promotion of ebook "Advanced JavaScript" (http://dev-mag.com) ;) - -0.4.0 / 2010-02-11 -================== - - * Added flash() example to sample upload app - * Added high level restful http client module (express/http) - * Changed; RESTful route functions double as HTTP clients. Closes #69 - * Changed; throwing error when routes are added at runtime - * Changed; defaulting render() context to the current Request. Closes #197 - * Updated haml submodule - -0.3.0 / 2010-02-11 -================== - - * Updated haml / sass submodules. Closes #200 - * Added flash message support. Closes #64 - * Added accepts() now allows multiple args. fixes #117 - * Added support for plugins to halt. Closes #189 - * Added alternate layout support. Closes #119 - * Removed Route#run(). Closes #188 - * Fixed broken specs due to use(Cookie) missing - -0.2.1 / 2010-02-05 -================== - - * Added "plot" format option for Profiler (for gnuplot processing) - * Added request number to Profiler plugin - * Fixed binary encoding for multi-part file uploads, was previously defaulting to UTF8 - * Fixed issue with routes not firing when not files are present. Closes #184 - * Fixed process.Promise -> events.Promise - -0.2.0 / 2010-02-03 -================== - - * Added parseParam() support for name[] etc. (allows for file inputs with "multiple" attr) Closes #180 - * Added Both Cache and Session option "reapInterval" may be "reapEvery". Closes #174 - * Added expiration support to cache api with reaper. Closes #133 - * Added cache Store.Memory#reap() - * Added Cache; cache api now uses first class Cache instances - * Added abstract session Store. Closes #172 - * Changed; cache Memory.Store#get() utilizing Collection - * Renamed MemoryStore -> Store.Memory - * Fixed use() of the same plugin several time will always use latest options. Closes #176 - -0.1.0 / 2010-02-03 -================== - - * Changed; Hooks (before / after) pass request as arg as well as evaluated in their context - * Updated node support to 0.1.27 Closes #169 - * Updated dirname(__filename) -> __dirname - * Updated libxmljs support to v0.2.0 - * Added session support with memory store / reaping - * Added quick uid() helper - * Added multi-part upload support - * Added Sass.js support / submodule - * Added production env caching view contents and static files - * Added static file caching. Closes #136 - * Added cache plugin with memory stores - * Added support to StaticFile so that it works with non-textual files. - * Removed dirname() helper - * Removed several globals (now their modules must be required) - -0.0.2 / 2010-01-10 -================== - - * Added view benchmarks; currently haml vs ejs - * Added Request#attachment() specs. Closes #116 - * Added use of node's parseQuery() util. Closes #123 - * Added `make init` for submodules - * Updated Haml - * Updated sample chat app to show messages on load - * Updated libxmljs parseString -> parseHtmlString - * Fixed `make init` to work with older versions of git - * Fixed specs can now run independant specs for those who cant build deps. Closes #127 - * Fixed issues introduced by the node url module changes. Closes 126. - * Fixed two assertions failing due to Collection#keys() returning strings - * Fixed faulty Collection#toArray() spec due to keys() returning strings - * Fixed `make test` now builds libxmljs.node before testing - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/express/LICENSE b/node_modules/express/LICENSE deleted file mode 100644 index 36075a3..0000000 --- a/node_modules/express/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2009-2011 TJ Holowaychuk - -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/express/Makefile b/node_modules/express/Makefile deleted file mode 100644 index 647e40a..0000000 --- a/node_modules/express/Makefile +++ /dev/null @@ -1,28 +0,0 @@ - -REPORTER = dot - -docs: docs/application.md docs/request.md docs/response.md - -docs/%.md: lib/%.js - @mkdir -p docs - dox --raw < $< | ./support/docs > $@ - -test: - @NODE_ENV=test ./node_modules/.bin/mocha \ - --reporter $(REPORTER) - -test-acceptance: - @NODE_ENV=test ./node_modules/.bin/mocha \ - --reporter spec \ - test/acceptance/*.js - -test-cov: lib-cov - @EXPRESS_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html - -lib-cov: - @jscoverage lib lib-cov - -docclean: - rm -fr docs - -.PHONY: docs docclean site test test-acceptance diff --git a/node_modules/express/Readme.md b/node_modules/express/Readme.md deleted file mode 100644 index c14ac36..0000000 --- a/node_modules/express/Readme.md +++ /dev/null @@ -1,179 +0,0 @@ - -![express logo](http://f.cl.ly/items/0V2S1n0K1i3y1c122g04/Screen%20Shot%202012-04-11%20at%209.59.42%20AM.png) - - Fast, unopinionated, minimalist web framework for [node](http://nodejs.org). - -```js -var express = require('express'); -var app = express(); - -app.get('/', function(req, res){ - res.send('Hello World'); -}); - -app.listen(3000); -``` - -## Installation - - $ npm install -g express - -## Quick Start - - The quickest way to get started with express is to utilize the executable `express(1)` to generate an application as shown below: - - Create the app: - - $ npm install -g express - $ express /tmp/foo && cd /tmp/foo - - Install dependencies: - - $ npm install - - Start the server: - - $ node app - -## Features - - * Built on [Connect](http://github.com/senchalabs/connect) - * Robust routing - * HTTP helpers (redirection, caching, etc) - * View system supporting 14+ template engines - * Content negotiation - * Focus on high performance - * Environment based configuration - * Executable for generating applications quickly - * High test coverage - -## Philosophy - - The Express philosophy is to provide small, robust tooling for HTTP servers. Making - it a great solution for single page applications, web sites, hybrids, or public - HTTP APIs. - - Built on Connect you can use _only_ what you need, and nothing more, applications - can be as big or as small as you like, even a single file. Express does - not force you to use any specific ORM or template engine. With support for over - 14 template engines via [Consolidate.js](github.com/visionmedia/consolidate.js) you - can quickly craft your perfect framework. - -## More Information - - * Join #express on freenode - * [Google Group](http://groups.google.com/group/express-js) for discussion - * Follow [tjholowaychuk](http://twitter.com/tjholowaychuk) on twitter for updates - * Visit the [Wiki](http://github.com/visionmedia/express/wiki) - * [日本語ドキュメンテーション](http://hideyukisaito.com/doc/expressjs/) by [hideyukisaito](https://github.com/hideyukisaito) - * [Русскоязычная документация](http://express-js.ru/) - -## Viewing Examples - -First install the dev dependencies to install all the example / test suite deps: - - $ cd express - $ npm install -d - -then run whichever tests you want: - - $ node examples/content-negotiation - -## Running Tests - -To run the test suite first invoke the following command within the repo, installing the development dependencies: - - $ npm install - -then run the tests: - - $ make test - -## Contributors - -``` -project: express -commits: 3559 -active : 468 days -files : 237 -authors: - 1891 Tj Holowaychuk 53.1% - 1285 visionmedia 36.1% - 182 TJ Holowaychuk 5.1% - 54 Aaron Heckmann 1.5% - 34 csausdev 1.0% - 26 ciaranj 0.7% - 21 Robert Sköld 0.6% - 6 Guillermo Rauch 0.2% - 3 Dav Glass 0.1% - 3 Nick Poulden 0.1% - 2 Randy Merrill 0.1% - 2 Benny Wong 0.1% - 2 Hunter Loftis 0.1% - 2 Jake Gordon 0.1% - 2 Brian McKinney 0.1% - 2 Roman Shtylman 0.1% - 2 Ben Weaver 0.1% - 2 Dave Hoover 0.1% - 2 Eivind Fjeldstad 0.1% - 2 Daniel Shaw 0.1% - 1 Matt Colyer 0.0% - 1 Pau Ramon 0.0% - 1 Pero Pejovic 0.0% - 1 Peter Rekdal Sunde 0.0% - 1 Raynos 0.0% - 1 Teng Siong Ong 0.0% - 1 Viktor Kelemen 0.0% - 1 ctide 0.0% - 1 8bitDesigner 0.0% - 1 isaacs 0.0% - 1 mgutz 0.0% - 1 pikeas 0.0% - 1 shuwatto 0.0% - 1 tstrimple 0.0% - 1 ewoudj 0.0% - 1 Adam Sanderson 0.0% - 1 Andrii Kostenko 0.0% - 1 Andy Hiew 0.0% - 1 Arpad Borsos 0.0% - 1 Ashwin Purohit 0.0% - 1 Benjen 0.0% - 1 Darren Torpey 0.0% - 1 Greg Ritter 0.0% - 1 Gregory Ritter 0.0% - 1 James Herdman 0.0% - 1 Jim Snodgrass 0.0% - 1 Joe McCann 0.0% - 1 Jonathan Dumaine 0.0% - 1 Jonathan Palardy 0.0% - 1 Jonathan Zacsh 0.0% - 1 Justin Lilly 0.0% - 1 Ken Sato 0.0% - 1 Maciej Małecki 0.0% - 1 Masahiro Hayashi 0.0% -``` - -## License - -(The MIT License) - -Copyright (c) 2009-2012 TJ Holowaychuk <tj@vision-media.ca> - -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/express/bin/express b/node_modules/express/bin/express deleted file mode 100755 index 22805f6..0000000 --- a/node_modules/express/bin/express +++ /dev/null @@ -1,380 +0,0 @@ -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var exec = require('child_process').exec - , program = require('commander') - , mkdirp = require('mkdirp') - , pkg = require('../package.json') - , version = pkg.version - , os = require('os') - , fs = require('fs'); - -// CLI - -program - .version(version) - .option('-s, --sessions', 'add session support') - .option('-e, --ejs', 'add ejs engine support (defaults to jade)') - .option('-J, --jshtml', 'add jshtml engine support (defaults to jade)') - .option('-c, --css ', 'add stylesheet support (less|stylus) (defaults to plain css)') - .option('-f, --force', 'force on non-empty directory') - .parse(process.argv); - -// Path - -var path = program.args.shift() || '.'; - -// end-of-line code - -var eol = 'win32' == os.platform() ? '\r\n' : '\n' - -// Template engine - -program.template = 'jade'; -if (program.ejs) program.template = 'ejs'; -if (program.jshtml) program.template = 'jshtml'; - -/** - * Routes index template. - */ - -var index = [ - '' - , '/*' - , ' * GET home page.' - , ' */' - , '' - , 'exports.index = function(req, res){' - , ' res.render(\'index\', { title: \'Express\' });' - , '};' -].join(eol); - -/** - * Jade layout template. - */ - -var jadeLayout = [ - '!!!' - , 'html' - , ' head' - , ' title= title' - , ' link(rel=\'stylesheet\', href=\'/stylesheets/style.css\')' - , ' body' - , ' block content' -].join(eol); - -/** - * Jade index template. - */ - -var jadeIndex = [ - 'extends layout' - , '' - , 'block content' - , ' h1= title' - , ' p Welcome to #{title}' -].join(eol); - -/** - * EJS index template. - */ - -var ejsIndex = [ - '' - , '' - , ' ' - , ' <%= title %>' - , ' ' - , ' ' - , ' ' - , '

<%= title %>

' - , '

Welcome to <%= title %>

' - , ' ' - , '' -].join(eol); - -/** - * JSHTML layout template. - */ - -var jshtmlLayout = [ - '' - , '' - , ' ' - , ' @write(title) ' - , ' ' - , ' ' - , ' ' - , ' @write(body)' - , ' ' - , '' -].join(eol); - -/** - * JSHTML index template. - */ - -var jshtmlIndex = [ - '

@write(title)

' - , '

Welcome to @write(title)

' -].join(eol); - -/** - * Default css template. - */ - -var css = [ - 'body {' - , ' padding: 50px;' - , ' font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;' - , '}' - , '' - , 'a {' - , ' color: #00B7FF;' - , '}' -].join(eol); - -/** - * Default less template. - */ - -var less = [ - 'body {' - , ' padding: 50px;' - , ' font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;' - , '}' - , '' - , 'a {' - , ' color: #00B7FF;' - , '}' -].join(eol); - -/** - * Default stylus template. - */ - -var stylus = [ - 'body' - , ' padding: 50px' - , ' font: 14px "Lucida Grande", Helvetica, Arial, sans-serif' - , 'a' - , ' color: #00B7FF' -].join(eol); - -/** - * App template. - */ - -var app = [ - '' - , '/**' - , ' * Module dependencies.' - , ' */' - , '' - , 'var express = require(\'express\')' - , ' , routes = require(\'./routes\')' - , ' , http = require(\'http\');' - , '' - , 'var app = express();' - , '' - , 'app.configure(function(){' - , ' app.set(\'views\', __dirname + \'/views\');' - , ' app.set(\'view engine\', \':TEMPLATE\');' - , ' app.use(express.favicon());' - , ' app.use(express.logger(\'dev\'));{css}' - , ' app.use(express.static(__dirname + \'/public\'));' - , ' app.use(express.bodyParser());' - , ' app.use(express.methodOverride());{sess}' - , ' app.use(app.router);' - , '});' - , '' - , 'app.configure(\'development\', function(){' - , ' app.use(express.errorHandler());' - , '});' - , '' - , 'app.get(\'/\', routes.index);' - , '' - , 'http.createServer(app).listen(3000);' - , '' - , 'console.log("Express server listening on port 3000");' - , '' -].join(eol); - -// Generate application - -(function createApplication(path) { - emptyDirectory(path, function(empty){ - if (empty || program.force) { - createApplicationAt(path); - } else { - program.confirm('destination is not empty, continue? ', function(ok){ - if (ok) { - process.stdin.destroy(); - createApplicationAt(path); - } else { - abort('aborting'); - } - }); - } - }); -})(path); - -/** - * Create application at the given directory `path`. - * - * @param {String} path - */ - -function createApplicationAt(path) { - console.log(); - process.on('exit', function(){ - console.log(); - console.log(' install dependencies:'); - console.log(' $ cd %s && npm install', path); - console.log(); - console.log(' run the app:'); - console.log(' $ node app'); - console.log(); - }); - - mkdir(path, function(){ - mkdir(path + '/public'); - mkdir(path + '/public/javascripts'); - mkdir(path + '/public/images'); - mkdir(path + '/public/stylesheets', function(){ - switch (program.css) { - case 'less': - write(path + '/public/stylesheets/style.less', less); - break; - case 'stylus': - write(path + '/public/stylesheets/style.styl', stylus); - break; - default: - write(path + '/public/stylesheets/style.css', css); - } - }); - - mkdir(path + '/routes', function(){ - write(path + '/routes/index.js', index); - }); - - mkdir(path + '/views', function(){ - switch (program.template) { - case 'ejs': - write(path + '/views/index.ejs', ejsIndex); - break; - case 'jade': - write(path + '/views/layout.jade', jadeLayout); - write(path + '/views/index.jade', jadeIndex); - break; - case 'jshtml': - write(path + '/views/layout.jshtml', jshtmlLayout); - write(path + '/views/index.jshtml', jshtmlIndex); - break; - - } - }); - - // CSS Engine support - switch (program.css) { - case 'less': - app = app.replace('{css}', eol + ' app.use(require(\'less-middleware\')({ src: __dirname + \'/public\' }));'); - break; - case 'stylus': - app = app.replace('{css}', eol + ' app.use(require(\'stylus\').middleware({ src: __dirname + \'/public\' }));'); - break; - default: - app = app.replace('{css}', ''); - } - - // Session support - app = app.replace('{sess}', program.sessions - ? eol + ' app.use(express.cookieParser(\'your secret here\'));' + eol + ' app.use(express.session());' - : ''); - - // Template support - app = app.replace(':TEMPLATE', program.template); - - // package.json - var pkg = { - name: 'application-name' - , version: '0.0.1' - , private: true - , scripts: { start: 'node app' } - , dependencies: { - express: version - } - } - - if (program.template) pkg.dependencies[program.template] = '*'; - - // CSS Engine support - switch (program.css) { - case 'less': - pkg.dependencies['less-middleware'] = '*'; - break; - default: - if (program.css) { - pkg.dependencies[program.css] = '*'; - } - } - - write(path + '/package.json', JSON.stringify(pkg, null, 2)); - write(path + '/app.js', app); - }); -} - -/** - * Check if the given directory `path` is empty. - * - * @param {String} path - * @param {Function} fn - */ - -function emptyDirectory(path, fn) { - fs.readdir(path, function(err, files){ - if (err && 'ENOENT' != err.code) throw err; - fn(!files || !files.length); - }); -} - -/** - * echo str > path. - * - * @param {String} path - * @param {String} str - */ - -function write(path, str) { - fs.writeFile(path, str); - console.log(' \x1b[36mcreate\x1b[0m : ' + path); -} - -/** - * Mkdir -p. - * - * @param {String} path - * @param {Function} fn - */ - -function mkdir(path, fn) { - mkdirp(path, 0755, function(err){ - if (err) throw err; - console.log(' \033[36mcreate\033[0m : ' + path); - fn && fn(); - }); -} - -/** - * Exit with the given `str`. - * - * @param {String} str - */ - -function abort(str) { - console.error(str); - process.exit(1); -} diff --git a/node_modules/express/client.js b/node_modules/express/client.js deleted file mode 100644 index 8984c44..0000000 --- a/node_modules/express/client.js +++ /dev/null @@ -1,25 +0,0 @@ - -var http = require('http'); - -var times = 50; - -while (times--) { - var req = http.request({ - port: 3000 - , method: 'POST' - , headers: { 'Content-Type': 'application/x-www-form-urlencoded' } - }); - - req.on('response', function(res){ - console.log(res.statusCode); - }); - - var n = 500000; - while (n--) { - req.write('foo=bar&bar=baz&'); - } - - req.write('foo=bar&bar=baz'); - - req.end(); -} \ No newline at end of file diff --git a/node_modules/express/index.js b/node_modules/express/index.js deleted file mode 100644 index bfe9934..0000000 --- a/node_modules/express/index.js +++ /dev/null @@ -1,4 +0,0 @@ - -module.exports = process.env.EXPRESS_COV - ? require('./lib-cov/express') - : require('./lib/express'); \ No newline at end of file diff --git a/node_modules/express/lib-cov/application.js b/node_modules/express/lib-cov/application.js deleted file mode 100644 index 86c80b4..0000000 --- a/node_modules/express/lib-cov/application.js +++ /dev/null @@ -1,510 +0,0 @@ -/* automatically generated by JSCoverage - do not edit */ -if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; -if (! _$jscoverage['application.js']) { - _$jscoverage['application.js'] = []; - _$jscoverage['application.js'][12] = 0; - _$jscoverage['application.js'][29] = 0; - _$jscoverage['application.js'][41] = 0; - _$jscoverage['application.js'][42] = 0; - _$jscoverage['application.js'][43] = 0; - _$jscoverage['application.js'][44] = 0; - _$jscoverage['application.js'][45] = 0; - _$jscoverage['application.js'][46] = 0; - _$jscoverage['application.js'][47] = 0; - _$jscoverage['application.js'][50] = 0; - _$jscoverage['application.js'][51] = 0; - _$jscoverage['application.js'][52] = 0; - _$jscoverage['application.js'][55] = 0; - _$jscoverage['application.js'][56] = 0; - _$jscoverage['application.js'][61] = 0; - _$jscoverage['application.js'][62] = 0; - _$jscoverage['application.js'][71] = 0; - _$jscoverage['application.js'][72] = 0; - _$jscoverage['application.js'][75] = 0; - _$jscoverage['application.js'][76] = 0; - _$jscoverage['application.js'][79] = 0; - _$jscoverage['application.js'][80] = 0; - _$jscoverage['application.js'][83] = 0; - _$jscoverage['application.js'][84] = 0; - _$jscoverage['application.js'][85] = 0; - _$jscoverage['application.js'][89] = 0; - _$jscoverage['application.js'][90] = 0; - _$jscoverage['application.js'][91] = 0; - _$jscoverage['application.js'][93] = 0; - _$jscoverage['application.js'][94] = 0; - _$jscoverage['application.js'][95] = 0; - _$jscoverage['application.js'][98] = 0; - _$jscoverage['application.js'][102] = 0; - _$jscoverage['application.js'][103] = 0; - _$jscoverage['application.js'][104] = 0; - _$jscoverage['application.js'][105] = 0; - _$jscoverage['application.js'][106] = 0; - _$jscoverage['application.js'][107] = 0; - _$jscoverage['application.js'][108] = 0; - _$jscoverage['application.js'][112] = 0; - _$jscoverage['application.js'][115] = 0; - _$jscoverage['application.js'][116] = 0; - _$jscoverage['application.js'][119] = 0; - _$jscoverage['application.js'][120] = 0; - _$jscoverage['application.js'][132] = 0; - _$jscoverage['application.js'][133] = 0; - _$jscoverage['application.js'][145] = 0; - _$jscoverage['application.js'][146] = 0; - _$jscoverage['application.js'][159] = 0; - _$jscoverage['application.js'][160] = 0; - _$jscoverage['application.js'][163] = 0; - _$jscoverage['application.js'][166] = 0; - _$jscoverage['application.js'][169] = 0; - _$jscoverage['application.js'][170] = 0; - _$jscoverage['application.js'][171] = 0; - _$jscoverage['application.js'][172] = 0; - _$jscoverage['application.js'][173] = 0; - _$jscoverage['application.js'][174] = 0; - _$jscoverage['application.js'][175] = 0; - _$jscoverage['application.js'][180] = 0; - _$jscoverage['application.js'][181] = 0; - _$jscoverage['application.js'][184] = 0; - _$jscoverage['application.js'][185] = 0; - _$jscoverage['application.js'][186] = 0; - _$jscoverage['application.js'][189] = 0; - _$jscoverage['application.js'][209] = 0; - _$jscoverage['application.js'][210] = 0; - _$jscoverage['application.js'][211] = 0; - _$jscoverage['application.js'][212] = 0; - _$jscoverage['application.js'][274] = 0; - _$jscoverage['application.js'][275] = 0; - _$jscoverage['application.js'][279] = 0; - _$jscoverage['application.js'][280] = 0; - _$jscoverage['application.js'][281] = 0; - _$jscoverage['application.js'][282] = 0; - _$jscoverage['application.js'][286] = 0; - _$jscoverage['application.js'][287] = 0; - _$jscoverage['application.js'][290] = 0; - _$jscoverage['application.js'][291] = 0; - _$jscoverage['application.js'][292] = 0; - _$jscoverage['application.js'][296] = 0; - _$jscoverage['application.js'][309] = 0; - _$jscoverage['application.js'][310] = 0; - _$jscoverage['application.js'][311] = 0; - _$jscoverage['application.js'][312] = 0; - _$jscoverage['application.js'][313] = 0; - _$jscoverage['application.js'][314] = 0; - _$jscoverage['application.js'][317] = 0; - _$jscoverage['application.js'][318] = 0; - _$jscoverage['application.js'][331] = 0; - _$jscoverage['application.js'][332] = 0; - _$jscoverage['application.js'][345] = 0; - _$jscoverage['application.js'][346] = 0; - _$jscoverage['application.js'][357] = 0; - _$jscoverage['application.js'][358] = 0; - _$jscoverage['application.js'][369] = 0; - _$jscoverage['application.js'][370] = 0; - _$jscoverage['application.js'][381] = 0; - _$jscoverage['application.js'][382] = 0; - _$jscoverage['application.js'][411] = 0; - _$jscoverage['application.js'][412] = 0; - _$jscoverage['application.js'][414] = 0; - _$jscoverage['application.js'][415] = 0; - _$jscoverage['application.js'][416] = 0; - _$jscoverage['application.js'][417] = 0; - _$jscoverage['application.js'][430] = 0; - _$jscoverage['application.js'][431] = 0; - _$jscoverage['application.js'][432] = 0; - _$jscoverage['application.js'][439] = 0; - _$jscoverage['application.js'][440] = 0; - _$jscoverage['application.js'][441] = 0; - _$jscoverage['application.js'][442] = 0; - _$jscoverage['application.js'][443] = 0; - _$jscoverage['application.js'][444] = 0; - _$jscoverage['application.js'][458] = 0; - _$jscoverage['application.js'][459] = 0; - _$jscoverage['application.js'][460] = 0; - _$jscoverage['application.js'][461] = 0; - _$jscoverage['application.js'][462] = 0; - _$jscoverage['application.js'][464] = 0; - _$jscoverage['application.js'][469] = 0; - _$jscoverage['application.js'][482] = 0; - _$jscoverage['application.js'][483] = 0; - _$jscoverage['application.js'][490] = 0; - _$jscoverage['application.js'][491] = 0; - _$jscoverage['application.js'][495] = 0; - _$jscoverage['application.js'][498] = 0; - _$jscoverage['application.js'][501] = 0; - _$jscoverage['application.js'][504] = 0; - _$jscoverage['application.js'][509] = 0; - _$jscoverage['application.js'][512] = 0; - _$jscoverage['application.js'][513] = 0; - _$jscoverage['application.js'][520] = 0; - _$jscoverage['application.js'][524] = 0; - _$jscoverage['application.js'][525] = 0; - _$jscoverage['application.js'][527] = 0; -} -_$jscoverage['application.js'][12]++; -var connect = require("connect"), Router = require("./router"), methods = Router.methods.concat("del", "all"), middleware = require("./middleware"), debug = require("debug")("express:application"), View = require("./view"), url = require("url"), utils = connect.utils, path = require("path"), http = require("http"), join = path.join, fs = require("fs"); -_$jscoverage['application.js'][29]++; -var app = exports = module.exports = {}; -_$jscoverage['application.js'][41]++; -app.init = (function () { - _$jscoverage['application.js'][42]++; - var self = this; - _$jscoverage['application.js'][43]++; - this.cache = {}; - _$jscoverage['application.js'][44]++; - this.settings = {}; - _$jscoverage['application.js'][45]++; - this.engines = {}; - _$jscoverage['application.js'][46]++; - this.viewCallbacks = []; - _$jscoverage['application.js'][47]++; - this.defaultConfiguration(); - _$jscoverage['application.js'][50]++; - methods.forEach((function (method) { - _$jscoverage['application.js'][51]++; - self.lookup[method] = (function (path) { - _$jscoverage['application.js'][52]++; - return self._router.lookup(method, path); -}); - _$jscoverage['application.js'][55]++; - self.remove[method] = (function (path) { - _$jscoverage['application.js'][56]++; - return self._router.lookup(method, path).remove(); -}); -})); - _$jscoverage['application.js'][61]++; - self.lookup.del = self.lookup["delete"]; - _$jscoverage['application.js'][62]++; - self.remove.del = self.remove["delete"]; -}); -_$jscoverage['application.js'][71]++; -app.defaultConfiguration = (function () { - _$jscoverage['application.js'][72]++; - var self = this; - _$jscoverage['application.js'][75]++; - this.set("env", process.env.NODE_ENV || "development"); - _$jscoverage['application.js'][76]++; - debug("booting in %s mode", this.get("env")); - _$jscoverage['application.js'][79]++; - this.use(connect.query()); - _$jscoverage['application.js'][80]++; - this.use(middleware.init(this)); - _$jscoverage['application.js'][83]++; - this.locals = (function (obj) { - _$jscoverage['application.js'][84]++; - for (var key in obj) { - _$jscoverage['application.js'][84]++; - self.locals[key] = obj[key]; -} - _$jscoverage['application.js'][85]++; - return self; -}); - _$jscoverage['application.js'][89]++; - this.locals.use = (function (fn) { - _$jscoverage['application.js'][90]++; - if (3 == fn.length) { - _$jscoverage['application.js'][91]++; - self.viewCallbacks.push(fn); - } - else { - _$jscoverage['application.js'][93]++; - self.viewCallbacks.push((function (req, res, done) { - _$jscoverage['application.js'][94]++; - fn(req, res); - _$jscoverage['application.js'][95]++; - done(); -})); - } - _$jscoverage['application.js'][98]++; - return this; -}); - _$jscoverage['application.js'][102]++; - this._router = new Router(this); - _$jscoverage['application.js'][103]++; - this.routes = this._router.routes; - _$jscoverage['application.js'][104]++; - this.__defineGetter__("router", (function () { - _$jscoverage['application.js'][105]++; - this._usedRouter = true; - _$jscoverage['application.js'][106]++; - this._router.caseSensitive = this.enabled("case sensitive routing"); - _$jscoverage['application.js'][107]++; - this._router.strict = this.enabled("strict routing"); - _$jscoverage['application.js'][108]++; - return this._router.middleware; -})); - _$jscoverage['application.js'][112]++; - this.locals.settings = this.settings; - _$jscoverage['application.js'][115]++; - this.configure("development", (function () { - _$jscoverage['application.js'][116]++; - this.set("json spaces", 2); -})); - _$jscoverage['application.js'][119]++; - this.configure("production", (function () { - _$jscoverage['application.js'][120]++; - this.enable("view cache"); -})); -}); -_$jscoverage['application.js'][132]++; -app.remove = (function (path) { - _$jscoverage['application.js'][133]++; - return this._router.lookup("all", path).remove(); -}); -_$jscoverage['application.js'][145]++; -app.lookup = (function (path) { - _$jscoverage['application.js'][146]++; - return this._router.lookup("all", path); -}); -_$jscoverage['application.js'][159]++; -app.use = (function (route, fn) { - _$jscoverage['application.js'][160]++; - var app, home, handle; - _$jscoverage['application.js'][163]++; - if ("string" != typeof route) { - _$jscoverage['application.js'][163]++; - fn = route, route = "/"; - } - _$jscoverage['application.js'][166]++; - if (fn.handle && fn.set) { - _$jscoverage['application.js'][166]++; - app = fn; - } - _$jscoverage['application.js'][169]++; - if (app) { - _$jscoverage['application.js'][170]++; - app.route = route; - _$jscoverage['application.js'][171]++; - fn = (function (req, res, next) { - _$jscoverage['application.js'][172]++; - var orig = req.app; - _$jscoverage['application.js'][173]++; - app.handle(req, res, (function (err) { - _$jscoverage['application.js'][174]++; - req.app = res.app = orig; - _$jscoverage['application.js'][175]++; - next(err); -})); -}); - } - _$jscoverage['application.js'][180]++; - debug("use %s %s", route, fn.name || "unnamed"); - _$jscoverage['application.js'][181]++; - connect.proto.use.call(this, route, fn); - _$jscoverage['application.js'][184]++; - if (app) { - _$jscoverage['application.js'][185]++; - app.parent = this; - _$jscoverage['application.js'][186]++; - app.emit("mount", this); - } - _$jscoverage['application.js'][189]++; - return this; -}); -_$jscoverage['application.js'][209]++; -app.engine = (function (ext, fn) { - _$jscoverage['application.js'][210]++; - if ("." != ext[0]) { - _$jscoverage['application.js'][210]++; - ext = "." + ext; - } - _$jscoverage['application.js'][211]++; - this.engines[ext] = fn; - _$jscoverage['application.js'][212]++; - return this; -}); -_$jscoverage['application.js'][274]++; -app.param = (function (name, fn) { - _$jscoverage['application.js'][275]++; - var self = this, fns = [].slice.call(arguments, 1); - _$jscoverage['application.js'][279]++; - if (Array.isArray(name)) { - _$jscoverage['application.js'][280]++; - name.forEach((function (name) { - _$jscoverage['application.js'][281]++; - fns.forEach((function (fn) { - _$jscoverage['application.js'][282]++; - self.param(name, fn); -})); -})); - } - else { - _$jscoverage['application.js'][286]++; - if ("function" == typeof name) { - _$jscoverage['application.js'][287]++; - this._router.param(name); - } - else { - _$jscoverage['application.js'][290]++; - if (":" == name[0]) { - _$jscoverage['application.js'][290]++; - name = name.substr(1); - } - _$jscoverage['application.js'][291]++; - fns.forEach((function (fn) { - _$jscoverage['application.js'][292]++; - self._router.param(name, fn); -})); - } - } - _$jscoverage['application.js'][296]++; - return this; -}); -_$jscoverage['application.js'][309]++; -app.set = (function (setting, val) { - _$jscoverage['application.js'][310]++; - if (1 == arguments.length) { - _$jscoverage['application.js'][311]++; - if (this.settings.hasOwnProperty(setting)) { - _$jscoverage['application.js'][312]++; - return this.settings[setting]; - } - else { - _$jscoverage['application.js'][313]++; - if (this.parent) { - _$jscoverage['application.js'][314]++; - return this.parent.set(setting); - } - } - } - else { - _$jscoverage['application.js'][317]++; - this.settings[setting] = val; - _$jscoverage['application.js'][318]++; - return this; - } -}); -_$jscoverage['application.js'][331]++; -app.path = (function () { - _$jscoverage['application.js'][332]++; - return this.parent? this.parent.path() + this.route: ""; -}); -_$jscoverage['application.js'][345]++; -app.enabled = (function (setting) { - _$jscoverage['application.js'][346]++; - return ! ! this.set(setting); -}); -_$jscoverage['application.js'][357]++; -app.disabled = (function (setting) { - _$jscoverage['application.js'][358]++; - return ! this.set(setting); -}); -_$jscoverage['application.js'][369]++; -app.enable = (function (setting) { - _$jscoverage['application.js'][370]++; - return this.set(setting, true); -}); -_$jscoverage['application.js'][381]++; -app.disable = (function (setting) { - _$jscoverage['application.js'][382]++; - return this.set(setting, false); -}); -_$jscoverage['application.js'][411]++; -app.configure = (function (env, fn) { - _$jscoverage['application.js'][412]++; - var envs = "all", args = [].slice.call(arguments); - _$jscoverage['application.js'][414]++; - fn = args.pop(); - _$jscoverage['application.js'][415]++; - if (args.length) { - _$jscoverage['application.js'][415]++; - envs = args; - } - _$jscoverage['application.js'][416]++; - if ("all" == envs || ~ envs.indexOf(this.settings.env)) { - _$jscoverage['application.js'][416]++; - fn.call(this); - } - _$jscoverage['application.js'][417]++; - return this; -}); -_$jscoverage['application.js'][430]++; -app.listen = (function () { - _$jscoverage['application.js'][431]++; - var server = http.createServer(this); - _$jscoverage['application.js'][432]++; - return server.listen.apply(server, arguments); -}); -_$jscoverage['application.js'][439]++; -methods.forEach((function (method) { - _$jscoverage['application.js'][440]++; - app[method] = (function (path) { - _$jscoverage['application.js'][441]++; - if ("get" == method && 1 == arguments.length) { - _$jscoverage['application.js'][441]++; - return this.set(path); - } - _$jscoverage['application.js'][442]++; - var args = [method].concat([].slice.call(arguments)); - _$jscoverage['application.js'][443]++; - if (! this._usedRouter) { - _$jscoverage['application.js'][443]++; - this.use(this.router); - } - _$jscoverage['application.js'][444]++; - return this._router.route.apply(this._router, args); -}); -})); -_$jscoverage['application.js'][458]++; -app.all = (function (path) { - _$jscoverage['application.js'][459]++; - var args = arguments; - _$jscoverage['application.js'][460]++; - methods.forEach((function (method) { - _$jscoverage['application.js'][461]++; - if ("all" == method || "del" == method) { - _$jscoverage['application.js'][461]++; - return; - } - _$jscoverage['application.js'][462]++; - app[method].apply(this, args); -}), this); - _$jscoverage['application.js'][464]++; - return this; -}); -_$jscoverage['application.js'][469]++; -app.del = app["delete"]; -_$jscoverage['application.js'][482]++; -app.render = (function (name, options, fn) { - _$jscoverage['application.js'][483]++; - var self = this, opts = {}, cache = this.cache, engines = this.engines, view; - _$jscoverage['application.js'][490]++; - if ("function" == typeof options) { - _$jscoverage['application.js'][491]++; - fn = options, options = {}; - } - _$jscoverage['application.js'][495]++; - utils.merge(opts, this.locals); - _$jscoverage['application.js'][498]++; - if (options.locals) { - _$jscoverage['application.js'][498]++; - utils.merge(opts, options.locals); - } - _$jscoverage['application.js'][501]++; - utils.merge(opts, options); - _$jscoverage['application.js'][504]++; - opts.cache = null == opts.cache? this.enabled("view cache"): opts.cache; - _$jscoverage['application.js'][509]++; - if (opts.cache) { - _$jscoverage['application.js'][509]++; - view = cache[name]; - } - _$jscoverage['application.js'][512]++; - if (! view) { - _$jscoverage['application.js'][513]++; - view = new View(name, {defaultEngine: this.get("view engine"), root: this.get("views") || process.cwd() + "/views", engines: engines}); - _$jscoverage['application.js'][520]++; - if (opts.cache) { - _$jscoverage['application.js'][520]++; - cache[name] = view; - } - } - _$jscoverage['application.js'][524]++; - try { - _$jscoverage['application.js'][525]++; - view.render(opts, fn); - } - catch (err) { - _$jscoverage['application.js'][527]++; - fn(err); - } -}); -_$jscoverage['application.js'].source = ["","/*!"," * Express - proto"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var connect = require('connect')"," , Router = require('./router')"," , methods = Router.methods.concat('del', 'all')"," , middleware = require('./middleware')"," , debug = require('debug')('express:application')"," , View = require('./view')"," , url = require('url')"," , utils = connect.utils"," , path = require('path')"," , http = require('http')"," , join = path.join"," , fs = require('fs');","","/**"," * Application prototype."," */","","var app = exports = module.exports = {};","","/**"," * Initialize the server."," *"," * - setup default configuration"," * - setup default middleware"," * - setup route reflection methods"," *"," * @api private"," */","","app.init = function(){"," var self = this;"," this.cache = {};"," this.settings = {};"," this.engines = {};"," this.viewCallbacks = [];"," this.defaultConfiguration();",""," // route reflection methods"," methods.forEach(function(method){"," self.lookup[method] = function(path){"," return self._router.lookup(method, path);"," };",""," self.remove[method] = function(path){"," return self._router.lookup(method, path).remove();"," };"," });",""," // del -> delete"," self.lookup.del = self.lookup.delete;"," self.remove.del = self.remove.delete;","};","","/**"," * Initialize application configuration."," *"," * @api private"," */","","app.defaultConfiguration = function(){"," var self = this;",""," // default settings"," this.set('env', process.env.NODE_ENV || 'development');"," debug('booting in %s mode', this.get('env'));",""," // implicit middleware"," this.use(connect.query());"," this.use(middleware.init(this));",""," // app locals"," this.locals = function(obj){"," for (var key in obj) self.locals[key] = obj[key];"," return self;"," };",""," // response locals"," this.locals.use = function(fn){"," if (3 == fn.length) {"," self.viewCallbacks.push(fn);"," } else {"," self.viewCallbacks.push(function(req, res, done){"," fn(req, res);"," done();"," });"," }"," return this;"," };",""," // router"," this._router = new Router(this);"," this.routes = this._router.routes;"," this.__defineGetter__('router', function(){"," this._usedRouter = true;"," this._router.caseSensitive = this.enabled('case sensitive routing');"," this._router.strict = this.enabled('strict routing');"," return this._router.middleware;"," });",""," // default locals"," this.locals.settings = this.settings;",""," // default configuration"," this.configure('development', function(){"," this.set('json spaces', 2);"," });",""," this.configure('production', function(){"," this.enable('view cache');"," });","};","","/**"," * Remove routes matching the given `path`."," *"," * @param {Route} path"," * @return {Boolean}"," * @api public"," */","","app.remove = function(path){"," return this._router.lookup('all', path).remove();","};","","/**"," * Lookup routes defined with a path"," * equivalent to `path`."," *"," * @param {String} path"," * @return {Array}"," * @api public"," */","","app.lookup = function(path){"," return this._router.lookup('all', path);","};","","/**"," * Proxy `connect#use()` to apply settings to"," * mounted applications."," *"," * @param {String|Function|Server} route"," * @param {Function|Server} fn"," * @return {app} for chaining"," * @api public"," */","","app.use = function(route, fn){"," var app, home, handle;",""," // default route to '/'"," if ('string' != typeof route) fn = route, route = '/';",""," // express app"," if (fn.handle && fn.set) app = fn;",""," // restore .app property on req and res"," if (app) {"," app.route = route;"," fn = function(req, res, next) {"," var orig = req.app;"," app.handle(req, res, function(err){"," req.app = res.app = orig;"," next(err);"," });"," };"," }",""," debug('use %s %s', route, fn.name || 'unnamed');"," connect.proto.use.call(this, route, fn);",""," // mounted an app"," if (app) {"," app.parent = this;"," app.emit('mount', this);"," }",""," return this;","};","","/**"," * Register the given template engine callback `fn`"," * as `ext`. For example we may wish to map \".html\""," * files to ejs rather than using the \".ejs\" extension."," *"," * app.engine('.html', require('ejs').render);"," *"," * or"," *"," * app.engine('html', require('ejs').render);"," *"," * @param {String} ext"," * @param {Function} fn"," * @return {app} for chaining"," * @api public"," */","","app.engine = function(ext, fn){"," if ('.' != ext[0]) ext = '.' + ext;"," this.engines[ext] = fn;"," return this;","};","","/**"," * Map the given param placeholder `name`(s) to the given callback(s)."," *"," * Param mapping is used to provide pre-conditions to routes"," * which us normalized placeholders. This callback has the same"," * signature as regular middleware, for example below when \":userId\""," * is used this function will be invoked in an attempt to load the user."," *"," * app.param('userId', function(req, res, next, id){"," * User.find(id, function(err, user){"," * if (err) {"," * next(err);"," * } else if (user) {"," * req.user = user;"," * next();"," * } else {"," * next(new Error('failed to load user'));"," * }"," * });"," * });"," *"," * Passing a single function allows you to map logic"," * to the values passed to `app.param()`, for example"," * this is useful to provide coercion support in a concise manner."," *"," * The following example maps regular expressions to param values"," * ensuring that they match, otherwise passing control to the next"," * route:"," *"," * app.param(function(name, regexp){"," * if (regexp instanceof RegExp) {"," * return function(req, res, next, val){"," * var captures;"," * if (captures = regexp.exec(String(val))) {"," * req.params[name] = captures;"," * next();"," * } else {"," * next('route');"," * }"," * }"," * }"," * });"," *"," * We can now use it as shown below, where \"/commit/:commit\" expects"," * that the value for \":commit\" is at 5 or more digits. The capture"," * groups are then available as `req.params.commit` as we defined"," * in the function above."," *"," * app.param('commit', /^\\d{5,}$/);"," *"," * For more of this useful functionality take a look"," * at [express-params](http://github.com/visionmedia/express-params)."," *"," * @param {String|Array|Function} name"," * @param {Function} fn"," * @return {app} for chaining"," * @api public"," */","","app.param = function(name, fn){"," var self = this"," , fns = [].slice.call(arguments, 1);",""," // array"," if (Array.isArray(name)) {"," name.forEach(function(name){"," fns.forEach(function(fn){"," self.param(name, fn);"," });"," });"," // param logic"," } else if ('function' == typeof name) {"," this._router.param(name);"," // single"," } else {"," if (':' == name[0]) name = name.substr(1);"," fns.forEach(function(fn){"," self._router.param(name, fn);"," });"," }",""," return this;","};","","/**"," * Assign `setting` to `val`, or return `setting`'s value."," * Mounted servers inherit their parent server's settings."," *"," * @param {String} setting"," * @param {String} val"," * @return {Server|Mixed} for chaining, or the setting value"," * @api public"," */","","app.set = function(setting, val){"," if (1 == arguments.length) {"," if (this.settings.hasOwnProperty(setting)) {"," return this.settings[setting];"," } else if (this.parent) {"," return this.parent.set(setting);"," }"," } else {"," this.settings[setting] = val;"," return this;"," }","};","","/**"," * Return the app's absolute pathname"," * based on the parent(s) that have"," * mounted it."," *"," * @return {String}"," * @api private"," */","","app.path = function(){"," return this.parent"," ? this.parent.path() + this.route"," : '';","};","","/**"," * Check if `setting` is enabled."," *"," * @param {String} setting"," * @return {Boolean}"," * @api public"," */","","app.enabled = function(setting){"," return !!this.set(setting);","};","","/**"," * Check if `setting` is disabled."," *"," * @param {String} setting"," * @return {Boolean}"," * @api public"," */","","app.disabled = function(setting){"," return !this.set(setting);","};","","/**"," * Enable `setting`."," *"," * @param {String} setting"," * @return {app} for chaining"," * @api public"," */","","app.enable = function(setting){"," return this.set(setting, true);","};","","/**"," * Disable `setting`."," *"," * @param {String} setting"," * @return {app} for chaining"," * @api public"," */","","app.disable = function(setting){"," return this.set(setting, false);","};","","/**"," * Configure callback for zero or more envs,"," * when no env is specified that callback will"," * be invoked for all environments. Any combination"," * can be used multiple times, in any order desired."," *"," * Examples:"," *"," * app.configure(function(){"," * // executed for all envs"," * });"," *"," * app.configure('stage', function(){"," * // executed staging env"," * });"," *"," * app.configure('stage', 'production', function(){"," * // executed for stage and production"," * });"," *"," * @param {String} env..."," * @param {Function} fn"," * @return {app} for chaining"," * @api public"," */","","app.configure = function(env, fn){"," var envs = 'all'"," , args = [].slice.call(arguments);"," fn = args.pop();"," if (args.length) envs = args;"," if ('all' == envs || ~envs.indexOf(this.settings.env)) fn.call(this);"," return this;","};","","/**"," * Listen for connections."," *"," * This method takes the same arguments"," * as node's `http.Server#listen()`. "," *"," * @return {http.Server}"," * @api public"," */","","app.listen = function(){"," var server = http.createServer(this);"," return server.listen.apply(server, arguments);","};","","/**"," * Delegate `.VERB(...)` calls to `.route(VERB, ...)`."," */","","methods.forEach(function(method){"," app[method] = function(path){"," if ('get' == method && 1 == arguments.length) return this.set(path); "," var args = [method].concat([].slice.call(arguments));"," if (!this._usedRouter) this.use(this.router);"," return this._router.route.apply(this._router, args);"," }","});","","/**"," * Special-cased \"all\" method, applying the given route `path`,"," * middleware, and callback to _every_ HTTP method."," *"," * @param {String} path"," * @param {Function} ..."," * @return {app} for chaining"," * @api public"," */","","app.all = function(path){"," var args = arguments;"," methods.forEach(function(method){"," if ('all' == method || 'del' == method) return;"," app[method].apply(this, args);"," }, this);"," return this;","};","","// del -> delete alias","","app.del = app.delete;","","/**"," * Render the given view `name` name with `options`"," * and a callback accepting an error and the"," * rendered template string."," *"," * @param {String} name"," * @param {String|Function} options or fn"," * @param {Function} fn"," * @api public"," */","","app.render = function(name, options, fn){"," var self = this"," , opts = {}"," , cache = this.cache"," , engines = this.engines"," , view;",""," // support callback function as second arg"," if ('function' == typeof options) {"," fn = options, options = {};"," }",""," // merge app.locals"," utils.merge(opts, this.locals);",""," // merge options.locals"," if (options.locals) utils.merge(opts, options.locals);",""," // merge options"," utils.merge(opts, options);",""," // set .cache unless explicitly provided"," opts.cache = null == opts.cache"," ? this.enabled('view cache')"," : opts.cache;",""," // primed cache"," if (opts.cache) view = cache[name];",""," // view"," if (!view) {"," view = new View(name, {"," defaultEngine: this.get('view engine')"," , root: this.get('views') || process.cwd() + '/views'"," , engines: engines"," });",""," // prime the cache"," if (opts.cache) cache[name] = view;"," }",""," // render"," try {"," view.render(opts, fn);"," } catch (err) {"," fn(err);"," }","};"]; diff --git a/node_modules/express/lib-cov/express.js b/node_modules/express/lib-cov/express.js deleted file mode 100644 index 8e191ab..0000000 --- a/node_modules/express/lib-cov/express.js +++ /dev/null @@ -1,65 +0,0 @@ -/* automatically generated by JSCoverage - do not edit */ -if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; -if (! _$jscoverage['express.js']) { - _$jscoverage['express.js'] = []; - _$jscoverage['express.js'][12] = 0; - _$jscoverage['express.js'][25] = 0; - _$jscoverage['express.js'][31] = 0; - _$jscoverage['express.js'][40] = 0; - _$jscoverage['express.js'][41] = 0; - _$jscoverage['express.js'][42] = 0; - _$jscoverage['express.js'][43] = 0; - _$jscoverage['express.js'][44] = 0; - _$jscoverage['express.js'][45] = 0; - _$jscoverage['express.js'][46] = 0; - _$jscoverage['express.js'][54] = 0; - _$jscoverage['express.js'][55] = 0; - _$jscoverage['express.js'][65] = 0; - _$jscoverage['express.js'][66] = 0; - _$jscoverage['express.js'][67] = 0; - _$jscoverage['express.js'][73] = 0; - _$jscoverage['express.js'][74] = 0; - _$jscoverage['express.js'][80] = 0; - _$jscoverage['express.js'][84] = 0; -} -_$jscoverage['express.js'][12]++; -var http = require("http"), connect = require("connect"), proto = require("./application"), Route = require("./router/route"), Router = require("./router"), req = require("./request"), res = require("./response"), utils = connect.utils; -_$jscoverage['express.js'][25]++; -exports = module.exports = createApplication; -_$jscoverage['express.js'][31]++; -exports.version = "3.0.0alpha1-pre"; -_$jscoverage['express.js'][40]++; -function createApplication() { - _$jscoverage['express.js'][41]++; - var app = connect(); - _$jscoverage['express.js'][42]++; - utils.merge(app, proto); - _$jscoverage['express.js'][43]++; - app.request = {__proto__: req}; - _$jscoverage['express.js'][44]++; - app.response = {__proto__: res}; - _$jscoverage['express.js'][45]++; - app.init(); - _$jscoverage['express.js'][46]++; - return app; -} -_$jscoverage['express.js'][54]++; -for (var key in connect.middleware) { - _$jscoverage['express.js'][55]++; - Object.defineProperty(exports, key, Object.getOwnPropertyDescriptor(connect.middleware, key)); -} -_$jscoverage['express.js'][65]++; -exports.application = proto; -_$jscoverage['express.js'][66]++; -exports.request = req; -_$jscoverage['express.js'][67]++; -exports.response = res; -_$jscoverage['express.js'][73]++; -exports.Route = Route; -_$jscoverage['express.js'][74]++; -exports.Router = Router; -_$jscoverage['express.js'][80]++; -exports.methods = require("./router/methods"); -_$jscoverage['express.js'][84]++; -exports.errorHandler.title = "Express"; -_$jscoverage['express.js'].source = ["","/*!"," * Express"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var http = require('http')"," , connect = require('connect')"," , proto = require('./application')"," , Route = require('./router/route')"," , Router = require('./router')"," , req = require('./request')"," , res = require('./response')"," , utils = connect.utils;","","/**"," * Expose `createApplication()`."," */","","exports = module.exports = createApplication;","","/**"," * Framework version."," */","","exports.version = '3.0.0alpha1-pre';","","/**"," * Create an express application."," *"," * @return {Function}"," * @api public"," */","","function createApplication() {"," var app = connect();"," utils.merge(app, proto);"," app.request = { __proto__: req };"," app.response = { __proto__: res };"," app.init();"," return app;","}","","/**"," * Expose connect.middleware as express.*"," * for example `express.logger` etc. "," */","","for (var key in connect.middleware) {"," Object.defineProperty("," exports"," , key"," , Object.getOwnPropertyDescriptor(connect.middleware, key));","}","","/**"," * Expose the prototypes."," */","","exports.application = proto;","exports.request = req;","exports.response = res;","","/**"," * Expose constructors."," */","","exports.Route = Route;","exports.Router = Router;","","/**"," * Expose HTTP methods."," */","","exports.methods = require('./router/methods');","","// Error handler title","","exports.errorHandler.title = 'Express';",""]; diff --git a/node_modules/express/lib-cov/middleware.js b/node_modules/express/lib-cov/middleware.js deleted file mode 100644 index f1a3e6d..0000000 --- a/node_modules/express/lib-cov/middleware.js +++ /dev/null @@ -1,54 +0,0 @@ -/* automatically generated by JSCoverage - do not edit */ -if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; -if (! _$jscoverage['middleware.js']) { - _$jscoverage['middleware.js'] = []; - _$jscoverage['middleware.js'][18] = 0; - _$jscoverage['middleware.js'][19] = 0; - _$jscoverage['middleware.js'][20] = 0; - _$jscoverage['middleware.js'][21] = 0; - _$jscoverage['middleware.js'][22] = 0; - _$jscoverage['middleware.js'][23] = 0; - _$jscoverage['middleware.js'][24] = 0; - _$jscoverage['middleware.js'][25] = 0; - _$jscoverage['middleware.js'][27] = 0; - _$jscoverage['middleware.js'][28] = 0; - _$jscoverage['middleware.js'][30] = 0; - _$jscoverage['middleware.js'][31] = 0; - _$jscoverage['middleware.js'][32] = 0; - _$jscoverage['middleware.js'][35] = 0; -} -_$jscoverage['middleware.js'][18]++; -exports.init = (function (app) { - _$jscoverage['middleware.js'][19]++; - return (function (req, res, next) { - _$jscoverage['middleware.js'][20]++; - var charset; - _$jscoverage['middleware.js'][21]++; - res.setHeader("X-Powered-By", "Express"); - _$jscoverage['middleware.js'][22]++; - req.app = res.app = app; - _$jscoverage['middleware.js'][23]++; - req.res = res; - _$jscoverage['middleware.js'][24]++; - res.req = req; - _$jscoverage['middleware.js'][25]++; - req.next = next; - _$jscoverage['middleware.js'][27]++; - req.__proto__ = app.request; - _$jscoverage['middleware.js'][28]++; - res.__proto__ = app.response; - _$jscoverage['middleware.js'][30]++; - res.locals = (function (obj) { - _$jscoverage['middleware.js'][31]++; - for (var key in obj) { - _$jscoverage['middleware.js'][31]++; - res.locals[key] = obj[key]; -} - _$jscoverage['middleware.js'][32]++; - return res; -}); - _$jscoverage['middleware.js'][35]++; - next(); -}); -}); -_$jscoverage['middleware.js'].source = ["","/*!"," * Express - middleware - init"," * Copyright(c) 2010-2011 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Initialization middleware, exposing the"," * request and response to eachother, as well"," * as defaulting the X-Powered-By header field."," *"," * @param {Function} app"," * @return {Function}"," * @api private"," */","","exports.init = function(app){"," return function(req, res, next){"," var charset;"," res.setHeader('X-Powered-By', 'Express');"," req.app = res.app = app;"," req.res = res;"," res.req = req;"," req.next = next;",""," req.__proto__ = app.request;"," res.__proto__ = app.response;",""," res.locals = function(obj){"," for (var key in obj) res.locals[key] = obj[key];"," return res;"," };",""," next();"," }","};"]; diff --git a/node_modules/express/lib-cov/request.js b/node_modules/express/lib-cov/request.js deleted file mode 100644 index 2fdf100..0000000 --- a/node_modules/express/lib-cov/request.js +++ /dev/null @@ -1,225 +0,0 @@ -/* automatically generated by JSCoverage - do not edit */ -if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; -if (! _$jscoverage['request.js']) { - _$jscoverage['request.js'] = []; - _$jscoverage['request.js'][12] = 0; - _$jscoverage['request.js'][22] = 0; - _$jscoverage['request.js'][49] = 0; - _$jscoverage['request.js'][50] = 0; - _$jscoverage['request.js'][53] = 0; - _$jscoverage['request.js'][56] = 0; - _$jscoverage['request.js'][86] = 0; - _$jscoverage['request.js'][87] = 0; - _$jscoverage['request.js'][99] = 0; - _$jscoverage['request.js'][100] = 0; - _$jscoverage['request.js'][101] = 0; - _$jscoverage['request.js'][115] = 0; - _$jscoverage['request.js'][116] = 0; - _$jscoverage['request.js'][117] = 0; - _$jscoverage['request.js'][141] = 0; - _$jscoverage['request.js'][142] = 0; - _$jscoverage['request.js'][143] = 0; - _$jscoverage['request.js'][161] = 0; - _$jscoverage['request.js'][162] = 0; - _$jscoverage['request.js'][163] = 0; - _$jscoverage['request.js'][167] = 0; - _$jscoverage['request.js'][185] = 0; - _$jscoverage['request.js'][186] = 0; - _$jscoverage['request.js'][187] = 0; - _$jscoverage['request.js'][191] = 0; - _$jscoverage['request.js'][213] = 0; - _$jscoverage['request.js'][215] = 0; - _$jscoverage['request.js'][218] = 0; - _$jscoverage['request.js'][221] = 0; - _$jscoverage['request.js'][225] = 0; - _$jscoverage['request.js'][227] = 0; - _$jscoverage['request.js'][267] = 0; - _$jscoverage['request.js'][268] = 0; - _$jscoverage['request.js'][269] = 0; - _$jscoverage['request.js'][270] = 0; - _$jscoverage['request.js'][271] = 0; - _$jscoverage['request.js'][272] = 0; - _$jscoverage['request.js'][273] = 0; - _$jscoverage['request.js'][274] = 0; - _$jscoverage['request.js'][275] = 0; - _$jscoverage['request.js'][276] = 0; - _$jscoverage['request.js'][277] = 0; - _$jscoverage['request.js'][279] = 0; - _$jscoverage['request.js'][294] = 0; - _$jscoverage['request.js'][295] = 0; - _$jscoverage['request.js'][296] = 0; - _$jscoverage['request.js'][310] = 0; - _$jscoverage['request.js'][311] = 0; - _$jscoverage['request.js'][324] = 0; - _$jscoverage['request.js'][325] = 0; - _$jscoverage['request.js'][338] = 0; - _$jscoverage['request.js'][339] = 0; - _$jscoverage['request.js'][351] = 0; - _$jscoverage['request.js'][352] = 0; - _$jscoverage['request.js'][364] = 0; - _$jscoverage['request.js'][365] = 0; - _$jscoverage['request.js'][375] = 0; - _$jscoverage['request.js'][376] = 0; - _$jscoverage['request.js'][377] = 0; -} -_$jscoverage['request.js'][12]++; -var http = require("http"), utils = require("./utils"), connect = require("connect"), parse = require("url").parse, mime = require("mime"); -_$jscoverage['request.js'][22]++; -var req = exports = module.exports = {__proto__: http.IncomingMessage.prototype}; -_$jscoverage['request.js'][49]++; -req.get = (function (name) { - _$jscoverage['request.js'][50]++; - switch (name = name.toLowerCase()) { - case "referer": - case "referrer": - _$jscoverage['request.js'][53]++; - return this.headers.referrer || this.headers.referer; - default: - _$jscoverage['request.js'][56]++; - return this.headers[name]; - } -}); -_$jscoverage['request.js'][86]++; -req.accepts = (function (type) { - _$jscoverage['request.js'][87]++; - return utils.accepts(type, this.get("Accept")); -}); -_$jscoverage['request.js'][99]++; -req.acceptsCharset = (function (charset) { - _$jscoverage['request.js'][100]++; - var accepted = this.acceptedCharsets; - _$jscoverage['request.js'][101]++; - return accepted.length? ~ accepted.indexOf(charset): true; -}); -_$jscoverage['request.js'][115]++; -req.acceptsLanguage = (function (lang) { - _$jscoverage['request.js'][116]++; - var accepted = this.acceptedLanguages; - _$jscoverage['request.js'][117]++; - return accepted.length? ~ accepted.indexOf(lang): true; -}); -_$jscoverage['request.js'][141]++; -req.__defineGetter__("accepted", (function () { - _$jscoverage['request.js'][142]++; - var accept = this.get("Accept"); - _$jscoverage['request.js'][143]++; - return accept? utils.parseAccept(accept): []; -})); -_$jscoverage['request.js'][161]++; -req.__defineGetter__("acceptedLanguages", (function () { - _$jscoverage['request.js'][162]++; - var accept = this.get("Accept-Language"); - _$jscoverage['request.js'][163]++; - return accept? utils.parseQuality(accept).map((function (obj) { - _$jscoverage['request.js'][167]++; - return obj.value; -})): []; -})); -_$jscoverage['request.js'][185]++; -req.__defineGetter__("acceptedCharsets", (function () { - _$jscoverage['request.js'][186]++; - var accept = this.get("Accept-Charset"); - _$jscoverage['request.js'][187]++; - return accept? utils.parseQuality(accept).map((function (obj) { - _$jscoverage['request.js'][191]++; - return obj.value; -})): []; -})); -_$jscoverage['request.js'][213]++; -req.param = (function (name, defaultValue) { - _$jscoverage['request.js'][215]++; - if (this.body && undefined !== this.body[name]) { - _$jscoverage['request.js'][215]++; - return this.body[name]; - } - _$jscoverage['request.js'][218]++; - if (this.params && this.params.hasOwnProperty(name) && undefined !== this.params[name]) { - _$jscoverage['request.js'][221]++; - return this.params[name]; - } - _$jscoverage['request.js'][225]++; - if (undefined !== this.query[name]) { - _$jscoverage['request.js'][225]++; - return this.query[name]; - } - _$jscoverage['request.js'][227]++; - return defaultValue; -}); -_$jscoverage['request.js'][267]++; -req.is = (function (type) { - _$jscoverage['request.js'][268]++; - var ct = this.get("Content-Type"); - _$jscoverage['request.js'][269]++; - if (! ct) { - _$jscoverage['request.js'][269]++; - return false; - } - _$jscoverage['request.js'][270]++; - ct = ct.split(";")[0]; - _$jscoverage['request.js'][271]++; - if (! ~ type.indexOf("/")) { - _$jscoverage['request.js'][271]++; - type = mime.lookup(type); - } - _$jscoverage['request.js'][272]++; - if (~ type.indexOf("*")) { - _$jscoverage['request.js'][273]++; - type = type.split("/"); - _$jscoverage['request.js'][274]++; - ct = ct.split("/"); - _$jscoverage['request.js'][275]++; - if ("*" == type[0] && type[1] == ct[1]) { - _$jscoverage['request.js'][275]++; - return true; - } - _$jscoverage['request.js'][276]++; - if ("*" == type[1] && type[0] == ct[0]) { - _$jscoverage['request.js'][276]++; - return true; - } - _$jscoverage['request.js'][277]++; - return false; - } - _$jscoverage['request.js'][279]++; - return ! ! ~ ct.indexOf(type); -}); -_$jscoverage['request.js'][294]++; -req.__defineGetter__("protocol", (function (trustProxy) { - _$jscoverage['request.js'][295]++; - var trustProxy = this.app.settings["trust proxy"]; - _$jscoverage['request.js'][296]++; - return this.secure? "https": trustProxy? (this.get("X-Forwarded-Proto") || "http"): "http"; -})); -_$jscoverage['request.js'][310]++; -req.__defineGetter__("secure", (function () { - _$jscoverage['request.js'][311]++; - return this.connection.encrypted; -})); -_$jscoverage['request.js'][324]++; -req.__defineGetter__("subdomains", (function () { - _$jscoverage['request.js'][325]++; - return this.get("Host").split(".").slice(0, -2).reverse(); -})); -_$jscoverage['request.js'][338]++; -req.__defineGetter__("path", (function () { - _$jscoverage['request.js'][339]++; - return parse(this.url).pathname; -})); -_$jscoverage['request.js'][351]++; -req.__defineGetter__("fresh", (function () { - _$jscoverage['request.js'][352]++; - return ! this.stale; -})); -_$jscoverage['request.js'][364]++; -req.__defineGetter__("stale", (function () { - _$jscoverage['request.js'][365]++; - return connect.utils.modified(this, this.res); -})); -_$jscoverage['request.js'][375]++; -req.__defineGetter__("xhr", (function () { - _$jscoverage['request.js'][376]++; - var val = this.get("X-Requested-With") || ""; - _$jscoverage['request.js'][377]++; - return "xmlhttprequest" == val.toLowerCase(); -})); -_$jscoverage['request.js'].source = ["","/*!"," * Express - request"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var http = require('http')"," , utils = require('./utils')"," , connect = require('connect')"," , parse = require('url').parse"," , mime = require('mime');","","/**"," * Request prototype."," */","","var req = exports = module.exports = {"," __proto__: http.IncomingMessage.prototype","};","","/**"," * Return request header."," *"," * The `Referrer` header field is special-cased,"," * both `Referrer` and `Referer` will yield are"," * interchangeable."," *"," * Examples:"," *"," * req.get('Content-Type');"," * // => \"text/plain\""," * "," * req.get('content-type');"," * // => \"text/plain\""," * "," * req.get('Something');"," * // => undefined"," * "," * @param {String} name"," * @return {String} "," * @api public"," */","","req.get = function(name){"," switch (name = name.toLowerCase()) {"," case 'referer':"," case 'referrer':"," return this.headers.referrer"," || this.headers.referer;"," default:"," return this.headers[name];"," }","};","","/**"," * Check if the given `type` is acceptable,"," * otherwise you should respond with 406 \"Not Acceptable\"."," *"," * Examples:"," * "," * // Accept: text/html"," * req.accepts('html');"," * // => true"," *"," * // Accept: text/*; application/json"," * req.accepts('html');"," * req.accepts('text/html');"," * req.accepts('text/plain');"," * req.accepts('application/json');"," * // => true"," *"," * req.accepts('image/png');"," * req.accepts('png');"," * // => false"," *"," * @param {String} type"," * @return {Boolean}"," * @api public"," */","","req.accepts = function(type){"," return utils.accepts(type, this.get('Accept'));","};","","/**"," * Check if the given `charset` is acceptable,"," * otherwise you should respond with 406 \"Not Acceptable\"."," *"," * @param {String} charset"," * @return {Boolean}"," * @api public"," */","","req.acceptsCharset = function(charset){"," var accepted = this.acceptedCharsets;"," return accepted.length"," ? ~accepted.indexOf(charset)"," : true;","};","","/**"," * Check if the given `lang` is acceptable,"," * otherwise you should respond with 406 \"Not Acceptable\"."," *"," * @param {String} lang"," * @return {Boolean}"," * @api public"," */","","req.acceptsLanguage = function(lang){"," var accepted = this.acceptedLanguages;"," return accepted.length"," ? ~accepted.indexOf(lang)"," : true;","};","","/**"," * Return an array of Accepted media types"," * ordered from highest quality to lowest."," *"," * Examples:"," *"," * [ { value: 'application/json',"," * quality: 1,"," * type: 'application',"," * subtype: 'json' },"," * { value: 'text/html',"," * quality: 0.5,"," * type: 'text',"," * subtype: 'html' } ]"," *"," * @return {Array}"," * @api public"," */","","req.__defineGetter__('accepted', function(){"," var accept = this.get('Accept');"," return accept"," ? utils.parseAccept(accept)"," : [];","});","","/**"," * Return an array of Accepted languages"," * ordered from highest quality to lowest."," *"," * Examples:"," *"," * Accept-Language: en;q=.5, en-us"," * ['en-us', 'en']"," *"," * @return {Array}"," * @api public"," */","","req.__defineGetter__('acceptedLanguages', function(){"," var accept = this.get('Accept-Language');"," return accept"," ? utils"," .parseQuality(accept)"," .map(function(obj){"," return obj.value;"," })"," : [];","});","","/**"," * Return an array of Accepted charsets"," * ordered from highest quality to lowest."," *"," * Examples:"," *"," * Accept-Charset: iso-8859-5;q=.2, unicode-1-1;q=0.8"," * ['unicode-1-1', 'iso-8859-5']"," *"," * @return {Array}"," * @api public"," */","","req.__defineGetter__('acceptedCharsets', function(){"," var accept = this.get('Accept-Charset');"," return accept"," ? utils"," .parseQuality(accept)"," .map(function(obj){"," return obj.value;"," })"," : [];","});","","/**"," * Return the value of param `name` when present or `defaultValue`."," *"," * - Checks body params, ex: id=12, {\"id\":12}"," * - Checks route placeholders, ex: _/user/:id_"," * - Checks query string params, ex: ?id=12"," *"," * To utilize request bodies, `req.body`"," * should be an object. This can be done by using"," * the `connect.bodyParser()` middleware."," *"," * @param {String} name"," * @param {Mixed} defaultValue"," * @return {String}"," * @api public"," */","","req.param = function(name, defaultValue){"," // req.body"," if (this.body && undefined !== this.body[name]) return this.body[name];",""," // route params"," if (this.params"," && this.params.hasOwnProperty(name)"," && undefined !== this.params[name]) {"," return this.params[name]; "," }",""," // query-string"," if (undefined !== this.query[name]) return this.query[name]; ",""," return defaultValue;","};","","/**"," * Check if the incoming request contains the \"Content-Type\" "," * header field, and it contains the give mime `type`."," *"," * Examples:"," *"," * // With Content-Type: text/html; charset=utf-8"," * req.is('html');"," * req.is('text/html');"," * req.is('text/*');"," * // => true"," * "," * // When Content-Type is application/json"," * req.is('json');"," * req.is('application/json');"," * req.is('application/*');"," * // => true"," * "," * req.is('html');"," * // => false"," * "," * Now within our route callbacks, we can use to to assert content types"," * such as \"image/jpeg\", \"image/png\", etc."," * "," * app.post('/image/upload', function(req, res, next){"," * if (req.is('image/*')) {"," * // do something"," * } else {"," * next();"," * }"," * });"," * "," * @param {String} type"," * @return {Boolean}"," * @api public"," */","","req.is = function(type){"," var ct = this.get('Content-Type');"," if (!ct) return false;"," ct = ct.split(';')[0];"," if (!~type.indexOf('/')) type = mime.lookup(type);"," if (~type.indexOf('*')) {"," type = type.split('/');"," ct = ct.split('/');"," if ('*' == type[0] && type[1] == ct[1]) return true;"," if ('*' == type[1] && type[0] == ct[0]) return true;"," return false;"," }"," return !! ~ct.indexOf(type);","};","","/**"," * Return the protocol string \"http\" or \"https\""," * when requested with TLS. When the \"trust proxy\" "," * setting is enabled the \"X-Forwarded-Proto\" header"," * field will be trusted. If you're running behind"," * a reverse proxy that supplies https for you this"," * may be enabled."," *"," * @return {String}"," * @api public"," */","","req.__defineGetter__('protocol', function(trustProxy){"," var trustProxy = this.app.settings['trust proxy'];"," return this.secure"," ? 'https'"," : trustProxy"," ? (this.get('X-Forwarded-Proto') || 'http')"," : 'http';","});","","/**"," * Short-hand for `req.connection.encrypted`."," *"," * @return {Boolean}"," * @api public"," */","","req.__defineGetter__('secure', function(){"," return this.connection.encrypted;","});","","/**"," * Return subdomains as an array."," *"," * For example \"tobi.ferrets.example.com\""," * would provide `[\"ferrets\", \"tobi\"]`."," *"," * @return {Array}"," * @api public"," */","","req.__defineGetter__('subdomains', function(){"," return this.get('Host')"," .split('.')"," .slice(0, -2)"," .reverse();","});","","/**"," * Short-hand for `require('url').parse(req.url).pathname`."," *"," * @return {String}"," * @api public"," */","","req.__defineGetter__('path', function(){"," return parse(this.url).pathname;","});","","/**"," * Check if the request is fresh, aka"," * Last-Modified and/or the ETag"," * still match."," *"," * @return {Boolean}"," * @api public"," */","","req.__defineGetter__('fresh', function(){"," return ! this.stale;","});","","/**"," * Check if the request is stale, aka"," * \"Last-Modified\" and / or the \"ETag\" for the"," * resource has changed."," *"," * @return {Boolean}"," * @api public"," */","","req.__defineGetter__('stale', function(){"," return connect.utils.modified(this, this.res);","});","","/**"," * Check if the request was an _XMLHttpRequest_."," *"," * @return {Boolean}"," * @api public"," */","","req.__defineGetter__('xhr', function(){"," var val = this.get('X-Requested-With') || '';"," return 'xmlhttprequest' == val.toLowerCase();","});"]; diff --git a/node_modules/express/lib-cov/response.js b/node_modules/express/lib-cov/response.js deleted file mode 100644 index a33f97e..0000000 --- a/node_modules/express/lib-cov/response.js +++ /dev/null @@ -1,611 +0,0 @@ -/* automatically generated by JSCoverage - do not edit */ -if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; -if (! _$jscoverage['response.js']) { - _$jscoverage['response.js'] = []; - _$jscoverage['response.js'][12] = 0; - _$jscoverage['response.js'][28] = 0; - _$jscoverage['response.js'][40] = 0; - _$jscoverage['response.js'][41] = 0; - _$jscoverage['response.js'][42] = 0; - _$jscoverage['response.js'][58] = 0; - _$jscoverage['response.js'][59] = 0; - _$jscoverage['response.js'][60] = 0; - _$jscoverage['response.js'][61] = 0; - _$jscoverage['response.js'][62] = 0; - _$jscoverage['response.js'][82] = 0; - _$jscoverage['response.js'][83] = 0; - _$jscoverage['response.js'][87] = 0; - _$jscoverage['response.js'][88] = 0; - _$jscoverage['response.js'][89] = 0; - _$jscoverage['response.js'][92] = 0; - _$jscoverage['response.js'][95] = 0; - _$jscoverage['response.js'][96] = 0; - _$jscoverage['response.js'][97] = 0; - _$jscoverage['response.js'][98] = 0; - _$jscoverage['response.js'][101] = 0; - _$jscoverage['response.js'][102] = 0; - _$jscoverage['response.js'][103] = 0; - _$jscoverage['response.js'][105] = 0; - _$jscoverage['response.js'][108] = 0; - _$jscoverage['response.js'][109] = 0; - _$jscoverage['response.js'][110] = 0; - _$jscoverage['response.js'][111] = 0; - _$jscoverage['response.js'][113] = 0; - _$jscoverage['response.js'][115] = 0; - _$jscoverage['response.js'][119] = 0; - _$jscoverage['response.js'][120] = 0; - _$jscoverage['response.js'][126] = 0; - _$jscoverage['response.js'][127] = 0; - _$jscoverage['response.js'][128] = 0; - _$jscoverage['response.js'][129] = 0; - _$jscoverage['response.js'][133] = 0; - _$jscoverage['response.js'][134] = 0; - _$jscoverage['response.js'][153] = 0; - _$jscoverage['response.js'][155] = 0; - _$jscoverage['response.js'][156] = 0; - _$jscoverage['response.js'][157] = 0; - _$jscoverage['response.js'][160] = 0; - _$jscoverage['response.js'][167] = 0; - _$jscoverage['response.js'][168] = 0; - _$jscoverage['response.js'][170] = 0; - _$jscoverage['response.js'][171] = 0; - _$jscoverage['response.js'][172] = 0; - _$jscoverage['response.js'][175] = 0; - _$jscoverage['response.js'][198] = 0; - _$jscoverage['response.js'][199] = 0; - _$jscoverage['response.js'][205] = 0; - _$jscoverage['response.js'][206] = 0; - _$jscoverage['response.js'][207] = 0; - _$jscoverage['response.js'][211] = 0; - _$jscoverage['response.js'][212] = 0; - _$jscoverage['response.js'][214] = 0; - _$jscoverage['response.js'][219] = 0; - _$jscoverage['response.js'][222] = 0; - _$jscoverage['response.js'][225] = 0; - _$jscoverage['response.js'][228] = 0; - _$jscoverage['response.js'][230] = 0; - _$jscoverage['response.js'][233] = 0; - _$jscoverage['response.js'][237] = 0; - _$jscoverage['response.js'][238] = 0; - _$jscoverage['response.js'][255] = 0; - _$jscoverage['response.js'][257] = 0; - _$jscoverage['response.js'][258] = 0; - _$jscoverage['response.js'][259] = 0; - _$jscoverage['response.js'][262] = 0; - _$jscoverage['response.js'][285] = 0; - _$jscoverage['response.js'][287] = 0; - _$jscoverage['response.js'][341] = 0; - _$jscoverage['response.js'][342] = 0; - _$jscoverage['response.js'][352] = 0; - _$jscoverage['response.js'][353] = 0; - _$jscoverage['response.js'][354] = 0; - _$jscoverage['response.js'][361] = 0; - _$jscoverage['response.js'][363] = 0; - _$jscoverage['response.js'][364] = 0; - _$jscoverage['response.js'][365] = 0; - _$jscoverage['response.js'][366] = 0; - _$jscoverage['response.js'][367] = 0; - _$jscoverage['response.js'][373] = 0; - _$jscoverage['response.js'][374] = 0; - _$jscoverage['response.js'][375] = 0; - _$jscoverage['response.js'][378] = 0; - _$jscoverage['response.js'][379] = 0; - _$jscoverage['response.js'][380] = 0; - _$jscoverage['response.js'][382] = 0; - _$jscoverage['response.js'][383] = 0; - _$jscoverage['response.js'][384] = 0; - _$jscoverage['response.js'][385] = 0; - _$jscoverage['response.js'][388] = 0; - _$jscoverage['response.js'][399] = 0; - _$jscoverage['response.js'][400] = 0; - _$jscoverage['response.js'][401] = 0; - _$jscoverage['response.js'][404] = 0; - _$jscoverage['response.js'][422] = 0; - _$jscoverage['response.js'][423] = 0; - _$jscoverage['response.js'][424] = 0; - _$jscoverage['response.js'][426] = 0; - _$jscoverage['response.js'][427] = 0; - _$jscoverage['response.js'][430] = 0; - _$jscoverage['response.js'][441] = 0; - _$jscoverage['response.js'][442] = 0; - _$jscoverage['response.js'][454] = 0; - _$jscoverage['response.js'][455] = 0; - _$jscoverage['response.js'][456] = 0; - _$jscoverage['response.js'][471] = 0; - _$jscoverage['response.js'][472] = 0; - _$jscoverage['response.js'][473] = 0; - _$jscoverage['response.js'][474] = 0; - _$jscoverage['response.js'][475] = 0; - _$jscoverage['response.js'][476] = 0; - _$jscoverage['response.js'][501] = 0; - _$jscoverage['response.js'][502] = 0; - _$jscoverage['response.js'][503] = 0; - _$jscoverage['response.js'][504] = 0; - _$jscoverage['response.js'][505] = 0; - _$jscoverage['response.js'][506] = 0; - _$jscoverage['response.js'][507] = 0; - _$jscoverage['response.js'][508] = 0; - _$jscoverage['response.js'][543] = 0; - _$jscoverage['response.js'][544] = 0; - _$jscoverage['response.js'][551] = 0; - _$jscoverage['response.js'][552] = 0; - _$jscoverage['response.js'][553] = 0; - _$jscoverage['response.js'][557] = 0; - _$jscoverage['response.js'][560] = 0; - _$jscoverage['response.js'][563] = 0; - _$jscoverage['response.js'][564] = 0; - _$jscoverage['response.js'][567] = 0; - _$jscoverage['response.js'][568] = 0; - _$jscoverage['response.js'][570] = 0; - _$jscoverage['response.js'][571] = 0; - _$jscoverage['response.js'][575] = 0; - _$jscoverage['response.js'][576] = 0; - _$jscoverage['response.js'][580] = 0; - _$jscoverage['response.js'][582] = 0; - _$jscoverage['response.js'][586] = 0; - _$jscoverage['response.js'][591] = 0; - _$jscoverage['response.js'][592] = 0; - _$jscoverage['response.js'][593] = 0; - _$jscoverage['response.js'][617] = 0; - _$jscoverage['response.js'][618] = 0; - _$jscoverage['response.js'][624] = 0; - _$jscoverage['response.js'][625] = 0; - _$jscoverage['response.js'][628] = 0; - _$jscoverage['response.js'][630] = 0; - _$jscoverage['response.js'][633] = 0; - _$jscoverage['response.js'][634] = 0; - _$jscoverage['response.js'][635] = 0; - _$jscoverage['response.js'][639] = 0; - _$jscoverage['response.js'][643] = 0; - _$jscoverage['response.js'][648] = 0; - _$jscoverage['response.js'][649] = 0; - _$jscoverage['response.js'][650] = 0; - _$jscoverage['response.js'][651] = 0; - _$jscoverage['response.js'][653] = 0; - _$jscoverage['response.js'][654] = 0; - _$jscoverage['response.js'][655] = 0; - _$jscoverage['response.js'][656] = 0; - _$jscoverage['response.js'][659] = 0; - _$jscoverage['response.js'][663] = 0; -} -_$jscoverage['response.js'][12]++; -var fs = require("fs"), http = require("http"), path = require("path"), connect = require("connect"), utils = connect.utils, accept = require("./utils").accept, statusCodes = http.STATUS_CODES, send = connect["static"].send, mime = require("mime"), basename = path.basename, join = path.join; -_$jscoverage['response.js'][28]++; -var res = module.exports = {__proto__: http.ServerResponse.prototype}; -_$jscoverage['response.js'][40]++; -res.status = (function (code) { - _$jscoverage['response.js'][41]++; - this.statusCode = code; - _$jscoverage['response.js'][42]++; - return this; -}); -_$jscoverage['response.js'][58]++; -res.cache = (function (type, options) { - _$jscoverage['response.js'][59]++; - var val = type; - _$jscoverage['response.js'][60]++; - options = options || {}; - _$jscoverage['response.js'][61]++; - if (options.maxAge) { - _$jscoverage['response.js'][61]++; - val += ", max-age=" + (options.maxAge / 1000); - } - _$jscoverage['response.js'][62]++; - return this.set("Cache-Control", val); -}); -_$jscoverage['response.js'][82]++; -res.send = (function (body) { - _$jscoverage['response.js'][83]++; - var req = this.req, head = "HEAD" == req.method; - _$jscoverage['response.js'][87]++; - if (2 == arguments.length) { - _$jscoverage['response.js'][88]++; - this.statusCode = body; - _$jscoverage['response.js'][89]++; - body = arguments[1]; - } - _$jscoverage['response.js'][92]++; - switch (typeof body) { - case "number": - _$jscoverage['response.js'][95]++; - this.get("Content-Type") || this.contentType(".txt"); - _$jscoverage['response.js'][96]++; - this.statusCode = body; - _$jscoverage['response.js'][97]++; - body = http.STATUS_CODES[body]; - _$jscoverage['response.js'][98]++; - break; - case "string": - _$jscoverage['response.js'][101]++; - if (! this.get("Content-Type")) { - _$jscoverage['response.js'][102]++; - this.charset = this.charset || "utf-8"; - _$jscoverage['response.js'][103]++; - this.contentType(".html"); - } - _$jscoverage['response.js'][105]++; - break; - case "boolean": - case "object": - _$jscoverage['response.js'][108]++; - if (null == body) { - _$jscoverage['response.js'][109]++; - body = ""; - } - else { - _$jscoverage['response.js'][110]++; - if (Buffer.isBuffer(body)) { - _$jscoverage['response.js'][111]++; - this.get("Content-Type") || this.contentType(".bin"); - } - else { - _$jscoverage['response.js'][113]++; - return this.json(body); - } - } - _$jscoverage['response.js'][115]++; - break; - } - _$jscoverage['response.js'][119]++; - if (undefined !== body && ! this.get("Content-Length")) { - _$jscoverage['response.js'][120]++; - this.set("Content-Length", Buffer.isBuffer(body)? body.length: Buffer.byteLength(body)); - } - _$jscoverage['response.js'][126]++; - if (204 == this.statusCode || 304 == this.statusCode) { - _$jscoverage['response.js'][127]++; - this.removeHeader("Content-Type"); - _$jscoverage['response.js'][128]++; - this.removeHeader("Content-Length"); - _$jscoverage['response.js'][129]++; - body = ""; - } - _$jscoverage['response.js'][133]++; - this.end(head? null: body); - _$jscoverage['response.js'][134]++; - return this; -}); -_$jscoverage['response.js'][153]++; -res.json = (function (obj) { - _$jscoverage['response.js'][155]++; - if (2 == arguments.length) { - _$jscoverage['response.js'][156]++; - this.statusCode = obj; - _$jscoverage['response.js'][157]++; - obj = arguments[1]; - } - _$jscoverage['response.js'][160]++; - var settings = this.app.settings, jsonp = settings["jsonp callback"], replacer = settings["json replacer"], spaces = settings["json spaces"], body = JSON.stringify(obj, replacer, spaces), callback = this.req.query.callback; - _$jscoverage['response.js'][167]++; - this.charset = this.charset || "utf-8"; - _$jscoverage['response.js'][168]++; - this.set("Content-Type", "application/json"); - _$jscoverage['response.js'][170]++; - if (callback && jsonp) { - _$jscoverage['response.js'][171]++; - this.set("Content-Type", "text/javascript"); - _$jscoverage['response.js'][172]++; - body = callback.replace(/[^\w$.]/g, "") + "(" + body + ");"; - } - _$jscoverage['response.js'][175]++; - return this.send(body); -}); -_$jscoverage['response.js'][198]++; -res.sendfile = (function (path, options, fn) { - _$jscoverage['response.js'][199]++; - var self = this, req = self.req, next = this.req.next, options = options || {}; - _$jscoverage['response.js'][205]++; - if ("function" == typeof options) { - _$jscoverage['response.js'][206]++; - fn = options; - _$jscoverage['response.js'][207]++; - options = {}; - } - _$jscoverage['response.js'][211]++; - options.callback = (function (err) { - _$jscoverage['response.js'][212]++; - if (err) { - _$jscoverage['response.js'][214]++; - if ("ENOENT" == err.code) { - _$jscoverage['response.js'][214]++; - err = 404; - } - _$jscoverage['response.js'][219]++; - if ("number" == typeof err) { - _$jscoverage['response.js'][219]++; - err = utils.error(err); - } - _$jscoverage['response.js'][222]++; - if (! self.headerSent) { - _$jscoverage['response.js'][222]++; - self.removeHeader("Content-Disposition"); - } - _$jscoverage['response.js'][225]++; - if (fn) { - _$jscoverage['response.js'][225]++; - return fn(err); - } - _$jscoverage['response.js'][228]++; - if (self.headerSent) { - _$jscoverage['response.js'][228]++; - return; - } - _$jscoverage['response.js'][230]++; - return req.next(err); - } - _$jscoverage['response.js'][233]++; - fn && fn(); -}); - _$jscoverage['response.js'][237]++; - options.path = encodeURIComponent(path); - _$jscoverage['response.js'][238]++; - send(this.req, this, next, options); -}); -_$jscoverage['response.js'][255]++; -res.download = (function (path, filename, fn) { - _$jscoverage['response.js'][257]++; - if ("function" == typeof filename) { - _$jscoverage['response.js'][258]++; - fn = filename; - _$jscoverage['response.js'][259]++; - filename = null; - } - _$jscoverage['response.js'][262]++; - return this.attachment(filename || path).sendfile(path, fn); -}); -_$jscoverage['response.js'][285]++; -res.contentType = res.type = (function (type) { - _$jscoverage['response.js'][287]++; - return this.set("Content-Type", mime.lookup(type)); -}); -_$jscoverage['response.js'][341]++; -res.format = (function (obj) { - _$jscoverage['response.js'][342]++; - var keys = Object.keys(obj), types = [], req = this.req, next = req.next, accepted = req.accepted, acceptedlen = accepted.length, type, key; - _$jscoverage['response.js'][352]++; - if (acceptedlen) { - _$jscoverage['response.js'][353]++; - for (var i = 0; i < keys.length; ++i) { - _$jscoverage['response.js'][354]++; - types.push(~ keys[i].indexOf("/")? keys[i]: mime.lookup(keys[i])); -} - } - _$jscoverage['response.js'][361]++; -out: - for (var i = 0; i < acceptedlen; ++i) { - _$jscoverage['response.js'][363]++; - for (var j = 0, jlen = types.length; j < jlen; ++j) { - _$jscoverage['response.js'][364]++; - if (accept(types[j].split("/"), accepted[i])) { - _$jscoverage['response.js'][365]++; - key = keys[j]; - _$jscoverage['response.js'][366]++; - type = types[j]; - _$jscoverage['response.js'][367]++; - break out; - } -} -} - _$jscoverage['response.js'][373]++; - if (! acceptedlen) { - _$jscoverage['response.js'][374]++; - key = keys[0]; - _$jscoverage['response.js'][375]++; - type = types[0]; - } - _$jscoverage['response.js'][378]++; - if (key) { - _$jscoverage['response.js'][379]++; - this.set("Content-Type", type); - _$jscoverage['response.js'][380]++; - obj[key](req, this, next); - } - else { - _$jscoverage['response.js'][382]++; - var err = new Error("Not Acceptable"); - _$jscoverage['response.js'][383]++; - err.status = 406; - _$jscoverage['response.js'][384]++; - err.types = types; - _$jscoverage['response.js'][385]++; - next(err); - } - _$jscoverage['response.js'][388]++; - return this; -}); -_$jscoverage['response.js'][399]++; -res.attachment = (function (filename) { - _$jscoverage['response.js'][400]++; - if (filename) { - _$jscoverage['response.js'][400]++; - this.type(filename); - } - _$jscoverage['response.js'][401]++; - this.set("Content-Disposition", filename? "attachment; filename=\"" + basename(filename) + "\"": "attachment"); - _$jscoverage['response.js'][404]++; - return this; -}); -_$jscoverage['response.js'][422]++; -res.set = (function (field, val) { - _$jscoverage['response.js'][423]++; - if (2 == arguments.length) { - _$jscoverage['response.js'][424]++; - this.setHeader(field, val); - } - else { - _$jscoverage['response.js'][426]++; - for (var key in field) { - _$jscoverage['response.js'][427]++; - this.setHeader(key, field[key]); -} - } - _$jscoverage['response.js'][430]++; - return this; -}); -_$jscoverage['response.js'][441]++; -res.get = (function (field) { - _$jscoverage['response.js'][442]++; - return this.getHeader(field); -}); -_$jscoverage['response.js'][454]++; -res.clearCookie = (function (name, options) { - _$jscoverage['response.js'][455]++; - var opts = {expires: new Date(1), path: "/"}; - _$jscoverage['response.js'][456]++; - return this.cookie(name, "", options? utils.merge(opts, options): opts); -}); -_$jscoverage['response.js'][471]++; -res.signedCookie = (function (name, val, options) { - _$jscoverage['response.js'][472]++; - var secret = this.req.secret; - _$jscoverage['response.js'][473]++; - if (! secret) { - _$jscoverage['response.js'][473]++; - throw new Error("connect.cookieParser(\"secret\") required for signed cookies"); - } - _$jscoverage['response.js'][474]++; - if ("object" == typeof val) { - _$jscoverage['response.js'][474]++; - val = "j:" + JSON.stringify(val); - } - _$jscoverage['response.js'][475]++; - val = utils.sign(val, secret); - _$jscoverage['response.js'][476]++; - return this.cookie(name, val, options); -}); -_$jscoverage['response.js'][501]++; -res.cookie = (function (name, val, options) { - _$jscoverage['response.js'][502]++; - options = options || {}; - _$jscoverage['response.js'][503]++; - if ("object" == typeof val) { - _$jscoverage['response.js'][503]++; - val = "j:" + JSON.stringify(val); - } - _$jscoverage['response.js'][504]++; - if ("maxAge" in options) { - _$jscoverage['response.js'][504]++; - options.expires = new Date(Date.now() + options.maxAge); - } - _$jscoverage['response.js'][505]++; - if (null == options.path) { - _$jscoverage['response.js'][505]++; - options.path = "/"; - } - _$jscoverage['response.js'][506]++; - var cookie = utils.serializeCookie(name, val, options); - _$jscoverage['response.js'][507]++; - this.set("Set-Cookie", cookie); - _$jscoverage['response.js'][508]++; - return this; -}); -_$jscoverage['response.js'][543]++; -res.redirect = (function (url) { - _$jscoverage['response.js'][544]++; - var app = this.app, req = this.req, head = "HEAD" == req.method, status = 302, body; - _$jscoverage['response.js'][551]++; - if (2 == arguments.length) { - _$jscoverage['response.js'][552]++; - status = url; - _$jscoverage['response.js'][553]++; - url = arguments[1]; - } - _$jscoverage['response.js'][557]++; - var map = {back: req.get("Referrer") || "/"}; - _$jscoverage['response.js'][560]++; - url = map[url] || url; - _$jscoverage['response.js'][563]++; - if (! ~ url.indexOf("://")) { - _$jscoverage['response.js'][564]++; - var path = app.path(); - _$jscoverage['response.js'][567]++; - if (0 == url.indexOf("./") || 0 == url.indexOf("..")) { - _$jscoverage['response.js'][568]++; - url = req.path + "/" + url; - } - else { - _$jscoverage['response.js'][570]++; - if ("/" != url[0]) { - _$jscoverage['response.js'][571]++; - url = path + "/" + url; - } - } - _$jscoverage['response.js'][575]++; - var host = req.get("Host"); - _$jscoverage['response.js'][576]++; - url = req.protocol + "://" + host + url; - } - _$jscoverage['response.js'][580]++; - this.format({"text/plain": (function () { - _$jscoverage['response.js'][582]++; - body = statusCodes[status] + ". Redirecting to " + url; -}), "text/html": (function () { - _$jscoverage['response.js'][586]++; - body = "

" + statusCodes[status] + ". Redirecting to " + url + "

"; -})}); - _$jscoverage['response.js'][591]++; - this.statusCode = status; - _$jscoverage['response.js'][592]++; - this.set("Location", url); - _$jscoverage['response.js'][593]++; - this.end(head? null: body); -}); -_$jscoverage['response.js'][617]++; -res.render = (function (view, options, fn) { - _$jscoverage['response.js'][618]++; - var self = this, options = options || {}, req = this.req, app = req.app; - _$jscoverage['response.js'][624]++; - if ("function" == typeof options) { - _$jscoverage['response.js'][625]++; - fn = options, options = {}; - } - _$jscoverage['response.js'][628]++; - function render() { - _$jscoverage['response.js'][630]++; - options.locals = self.locals; - _$jscoverage['response.js'][633]++; - fn = fn || (function (err, str) { - _$jscoverage['response.js'][634]++; - if (err) { - _$jscoverage['response.js'][634]++; - return req.next(err); - } - _$jscoverage['response.js'][635]++; - self.send(str); -}); - _$jscoverage['response.js'][639]++; - app.render(view, options, fn); -} - _$jscoverage['response.js'][643]++; - var callbacks = app.viewCallbacks, pending = callbacks.length, len = pending, done; - _$jscoverage['response.js'][648]++; - if (len) { - _$jscoverage['response.js'][649]++; - for (var i = 0; i < len; ++i) { - _$jscoverage['response.js'][650]++; - callbacks[i](req, self, (function (err) { - _$jscoverage['response.js'][651]++; - if (done) { - _$jscoverage['response.js'][651]++; - return; - } - _$jscoverage['response.js'][653]++; - if (err) { - _$jscoverage['response.js'][654]++; - req.next(err); - _$jscoverage['response.js'][655]++; - done = true; - _$jscoverage['response.js'][656]++; - return; - } - _$jscoverage['response.js'][659]++; - --pending || render(); -})); -} - } - else { - _$jscoverage['response.js'][663]++; - render(); - } -}); -_$jscoverage['response.js'].source = ["","/*!"," * Express - response"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var fs = require('fs')"," , http = require('http')"," , path = require('path')"," , connect = require('connect')"," , utils = connect.utils"," , accept = require('./utils').accept"," , statusCodes = http.STATUS_CODES"," , send = connect.static.send"," , mime = require('mime')"," , basename = path.basename"," , join = path.join;","","/**"," * Response prototype."," */","","var res = module.exports = {"," __proto__: http.ServerResponse.prototype","};","","/**"," * Set status `code`."," *"," * @param {Number} code"," * @return {ServerResponse}"," * @api public"," */","","res.status = function(code){"," this.statusCode = code;"," return this;","};","","/**"," * Set Cache-Control to the given `type` and `options`."," *"," * Options:"," *"," * - `maxAge` in milliseconds"," *"," * @param {String} type"," * @param {Object} options"," * @return {ServerResponse}"," * @api public"," */","","res.cache = function(type, options){"," var val = type;"," options = options || {};"," if (options.maxAge) val += ', max-age=' + (options.maxAge / 1000); "," return this.set('Cache-Control', val);","};","","/**"," * Send a response."," *"," * Examples:"," *"," * res.send(new Buffer('wahoo'));"," * res.send({ some: 'json' });"," * res.send('<p>some html</p>');"," * res.send(404, 'Sorry, cant find that');"," * res.send(404);"," *"," * @param {Mixed} body or status"," * @param {Mixed} body"," * @return {ServerResponse}"," * @api public"," */","","res.send = function(body){"," var req = this.req"," , head = 'HEAD' == req.method;",""," // allow status / body"," if (2 == arguments.length) {"," this.statusCode = body;"," body = arguments[1];"," }",""," switch (typeof body) {"," // response status"," case 'number':"," this.get('Content-Type') || this.contentType('.txt');"," this.statusCode = body;"," body = http.STATUS_CODES[body];"," break;"," // string defaulting to html"," case 'string':"," if (!this.get('Content-Type')) {"," this.charset = this.charset || 'utf-8';"," this.contentType('.html');"," }"," break;"," case 'boolean':"," case 'object':"," if (null == body) {"," body = '';"," } else if (Buffer.isBuffer(body)) {"," this.get('Content-Type') || this.contentType('.bin');"," } else {"," return this.json(body);"," }"," break;"," }",""," // populate Content-Length"," if (undefined !== body && !this.get('Content-Length')) {"," this.set('Content-Length', Buffer.isBuffer(body)"," ? body.length"," : Buffer.byteLength(body));"," }",""," // strip irrelevant headers"," if (204 == this.statusCode || 304 == this.statusCode) {"," this.removeHeader('Content-Type');"," this.removeHeader('Content-Length');"," body = '';"," }",""," // respond"," this.end(head ? null : body);"," return this;","};","","/**"," * Send JSON response."," *"," * Examples:"," *"," * res.json(null);"," * res.json({ user: 'tj' });"," * res.json(500, 'oh noes!');"," * res.json(404, 'I dont have that');"," *"," * @param {Mixed} obj or status"," * @param {Mixed} obj"," * @return {ServerResponse}"," * @api public"," */","","res.json = function(obj){"," // allow status / body"," if (2 == arguments.length) {"," this.statusCode = obj;"," obj = arguments[1];"," }",""," var settings = this.app.settings"," , jsonp = settings['jsonp callback']"," , replacer = settings['json replacer']"," , spaces = settings['json spaces']"," , body = JSON.stringify(obj, replacer, spaces)"," , callback = this.req.query.callback;",""," this.charset = this.charset || 'utf-8';"," this.set('Content-Type', 'application/json');",""," if (callback && jsonp) {"," this.set('Content-Type', 'text/javascript');"," body = callback.replace(/[^\\w$.]/g, '') + '(' + body + ');';"," }",""," return this.send(body);","};","","/**"," * Transfer the file at the given `path`."," * "," * Automatically sets the _Content-Type_ response header field."," * The callback `fn(err)` is invoked when the transfer is complete"," * or when an error occurs. Be sure to check `res.sentHeader`"," * if you wish to attempt responding, as the header and some data"," * may have already been transferred."," *"," * Options:"," *"," * - `maxAge` defaulting to 0"," * - `root` root directory for relative filenames"," *"," * @param {String} path"," * @param {Object|Function} options or fn"," * @param {Function} fn"," * @api public"," */","","res.sendfile = function(path, options, fn){"," var self = this"," , req = self.req"," , next = this.req.next"," , options = options || {};",""," // support function as second arg"," if ('function' == typeof options) {"," fn = options;"," options = {};"," }",""," // callback"," options.callback = function(err){"," if (err) {"," // cast ENOENT"," if ('ENOENT' == err.code) err = 404;",""," // coerce numeric error to an Error"," // TODO: remove"," // TODO: remove docs for headerSent?"," if ('number' == typeof err) err = utils.error(err);",""," // ditch content-disposition to prevent funky responses"," if (!self.headerSent) self.removeHeader('Content-Disposition');",""," // woot! callback available"," if (fn) return fn(err);",""," // lost in limbo if there's no callback"," if (self.headerSent) return;",""," return req.next(err);"," }",""," fn && fn();"," };",""," // transfer"," options.path = encodeURIComponent(path);"," send(this.req, this, next, options);","};","","/**"," * Transfer the file at the given `path` as an attachment."," *"," * Optionally providing an alternate attachment `filename`,"," * and optional callback `fn(err)`. The callback is invoked"," * when the data transfer is complete, or when an error has"," * ocurred. Be sure to check `res.headerSent` if you plan to respond."," *"," * @param {String} path"," * @param {String|Function} filename or fn"," * @param {Function} fn"," * @api public"," */","","res.download = function(path, filename, fn){"," // support function as second arg"," if ('function' == typeof filename) {"," fn = filename;"," filename = null;"," }",""," return this.attachment(filename || path).sendfile(path, fn);","};","","/**"," * Set _Content-Type_ response header passed through `mime.lookup()`."," *"," * Examples:"," *"," * var filename = 'path/to/image.png';"," * res.contentType(filename);"," * // res.headers['Content-Type'] is now \"image/png\""," *"," * res.contentType('.html');"," * res.contentType('html');"," * res.contentType('json');"," * res.contentType('png');"," * res.type('png');"," *"," * @param {String} type"," * @return {ServerResponse} for chaining"," * @api public"," */","","res.contentType =","res.type = function(type){"," return this.set('Content-Type', mime.lookup(type));","};","","/**"," * Respond to the Acceptable formats using an `obj`"," * of mime-type callbacks."," *"," * This method uses `req.accepted`, an array of"," * acceptable types ordered by their quality values."," * When \"Accept\" is not present the _first_ callback"," * is invoked, otherwise the first match is used. When"," * no match is performed the server responds with"," * 406 \"Not Acceptable\"."," *"," * Content-Type is set for you, however if you choose"," * you may alter this within the callback using `res.type()`"," * or `res.set('Content-Type', ...)`."," *"," * res.format({"," * 'text/plain': function(){"," * res.send('hey');"," * },"," * "," * 'text/html': function(){"," * res.send('<p>hey</p>');"," * },"," * "," * 'appliation/json': function(){"," * res.send({ message: 'hey' });"," * }"," * });"," *"," * In addition to canonicalized MIME types you may"," * also use extnames mapped to these types:"," *"," * res.format({"," * text: function(){"," * res.send('hey');"," * },"," * "," * html: function(){"," * res.send('<p>hey</p>');"," * },"," * "," * json: function(){"," * res.send({ message: 'hey' });"," * }"," * });"," *"," * @param {Object} obj"," * @return {ServerResponse} for chaining"," * @api public"," */","","res.format = function(obj){"," var keys = Object.keys(obj)"," , types = []"," , req = this.req"," , next = req.next"," , accepted = req.accepted"," , acceptedlen = accepted.length"," , type"," , key;",""," // normalize extnames -> mime"," if (acceptedlen) {"," for (var i = 0; i < keys.length; ++i) {"," types.push(~keys[i].indexOf('/')"," ? keys[i]"," : mime.lookup(keys[i]));"," }"," }",""," // determine most acceptable format"," out:"," for (var i = 0; i < acceptedlen; ++i) {"," for (var j = 0, jlen = types.length; j < jlen; ++j) {"," if (accept(types[j].split('/'), accepted[i])) {"," key = keys[j];"," type = types[j];"," break out;"," }"," }"," }",""," // default to the first"," if (!acceptedlen) {"," key = keys[0];"," type = types[0];"," }",""," if (key) {"," this.set('Content-Type', type);"," obj[key](req, this, next);"," } else {"," var err = new Error('Not Acceptable');"," err.status = 406;"," err.types = types;"," next(err);"," }",""," return this;","};","","/**"," * Set _Content-Disposition_ header to _attachment_ with optional `filename`."," *"," * @param {String} filename"," * @return {ServerResponse}"," * @api public"," */","","res.attachment = function(filename){"," if (filename) this.type(filename);"," this.set('Content-Disposition', filename"," ? 'attachment; filename=\"' + basename(filename) + '\"'"," : 'attachment');"," return this;","};","","/**"," * Set header `field` to `val`, or pass"," * an object of of header fields."," *"," * Examples:"," *"," * res.set('Accept', 'application/json');"," * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });"," *"," * @param {String|Object} field"," * @param {String} val"," * @return {ServerResponse} for chaining"," * @api public"," */","","res.set = function(field, val){"," if (2 == arguments.length) {"," this.setHeader(field, val);"," } else {"," for (var key in field) {"," this.setHeader(key, field[key]);"," }"," }"," return this;","};","","/**"," * Get value for header `field`."," *"," * @param {String} field"," * @return {String}"," * @api public"," */","","res.get = function(field){"," return this.getHeader(field);","};","","/**"," * Clear cookie `name`."," *"," * @param {String} name"," * @param {Object} options"," * @param {ServerResponse} for chaining"," * @api public"," */","","res.clearCookie = function(name, options){"," var opts = { expires: new Date(1), path: '/' };"," return this.cookie(name, '', options"," ? utils.merge(opts, options)"," : opts);","};","","/**"," * Set a signed cookie with the given `name` and `val`."," * See `res.cookie()` for details."," *"," * @param {String} name"," * @param {String|Object} val"," * @param {Object} options"," * @api public"," */","","res.signedCookie = function(name, val, options){"," var secret = this.req.secret;"," if (!secret) throw new Error('connect.cookieParser(\"secret\") required for signed cookies');"," if ('object' == typeof val) val = 'j:' + JSON.stringify(val);"," val = utils.sign(val, secret);"," return this.cookie(name, val, options);","};","","/**"," * Set cookie `name` to `val`, with the given `options`."," *"," * Options:"," *"," * - `maxAge` max-age in milliseconds, converted to `expires`"," * - `path` defaults to \"/\""," *"," * Examples:"," *"," * // \"Remember Me\" for 15 minutes"," * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });"," *"," * // save as above"," * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })"," *"," * @param {String} name"," * @param {String|Object} val"," * @param {Options} options"," * @api public"," */","","res.cookie = function(name, val, options){"," options = options || {};"," if ('object' == typeof val) val = 'j:' + JSON.stringify(val);"," if ('maxAge' in options) options.expires = new Date(Date.now() + options.maxAge);"," if (null == options.path) options.path = '/';"," var cookie = utils.serializeCookie(name, val, options);"," this.set('Set-Cookie', cookie);"," return this;","};","","/**"," * Redirect to the given `url` with optional response `status`"," * defaulting to 302."," *"," * The given `url` can also be the name of a mapped url, for"," * example by default express supports \"back\" which redirects"," * to the _Referrer_ or _Referer_ headers or \"/\"."," *"," * Examples:"," *"," * res.redirect('/foo/bar');"," * res.redirect('http://example.com');"," * res.redirect(301, 'http://example.com');"," *"," * Mounting:"," *"," * When an application is mounted, and `res.redirect()`"," * is given a path that does _not_ lead with \"/\". For "," * example suppose a \"blog\" app is mounted at \"/blog\","," * the following redirect would result in \"/blog/login\":"," *"," * res.redirect('login');"," *"," * While the leading slash would result in a redirect to \"/login\":"," *"," * res.redirect('/login');"," *"," * @param {String} url"," * @param {Number} code"," * @api public"," */","","res.redirect = function(url){"," var app = this.app"," , req = this.req"," , head = 'HEAD' == req.method"," , status = 302"," , body;",""," // allow status / url"," if (2 == arguments.length) {"," status = url;"," url = arguments[1];"," }",""," // setup redirect map"," var map = { back: req.get('Referrer') || '/' };",""," // perform redirect"," url = map[url] || url;",""," // relative"," if (!~url.indexOf('://')) {"," var path = app.path();",""," // relative to path"," if (0 == url.indexOf('./') || 0 == url.indexOf('..')) {"," url = req.path + '/' + url;"," // relative to mount-point"," } else if ('/' != url[0]) {"," url = path + '/' + url;"," }",""," // Absolute"," var host = req.get('Host');"," url = req.protocol + '://' + host + url;"," }",""," // Support text/{plain,html} by default"," this.format({"," 'text/plain': function(){"," body = statusCodes[status] + '. Redirecting to ' + url;"," },",""," 'text/html': function(){"," body = '<p>' + statusCodes[status] + '. Redirecting to <a href=\"' + url + '\">' + url + '</a></p>';"," }"," })",""," // Respond"," this.statusCode = status;"," this.set('Location', url);"," this.end(head ? null : body);","};","","/**"," * Render `view` with the given `options` and optional callback `fn`."," * When a callback function is given a response will _not_ be made"," * automatically, otherwise a response of _200_ and _text/html_ is given."," *"," * Options:"," * "," * - `status` Response status code (`res.statusCode`)"," * - `charset` Set the charset (`res.charset`)"," *"," * Reserved locals:"," *"," * - `cache` boolean hinting to the engine it should cache"," * - `filename` filename of the view being rendered"," *"," * @param {String} view"," * @param {Object|Function} options or callback function"," * @param {Function} fn"," * @api public"," */","","res.render = function(view, options, fn){"," var self = this"," , options = options || {}"," , req = this.req"," , app = req.app;",""," // support callback function as second arg"," if ('function' == typeof options) {"," fn = options, options = {};"," }",""," function render() {"," // merge res.locals"," options.locals = self.locals;",""," // default callback to respond"," fn = fn || function(err, str){"," if (err) return req.next(err);"," self.send(str);"," };",""," // render"," app.render(view, options, fn);"," }",""," // invoke view callbacks"," var callbacks = app.viewCallbacks"," , pending = callbacks.length"," , len = pending"," , done;",""," if (len) {"," for (var i = 0; i < len; ++i) {"," callbacks[i](req, self, function(err){"," if (done) return;",""," if (err) {"," req.next(err);"," done = true;"," return;"," }",""," --pending || render();"," });"," }"," } else {"," render();"," }","};"]; diff --git a/node_modules/express/lib-cov/router/collection.js b/node_modules/express/lib-cov/router/collection.js deleted file mode 100644 index 33808a9..0000000 --- a/node_modules/express/lib-cov/router/collection.js +++ /dev/null @@ -1,40 +0,0 @@ -/* automatically generated by JSCoverage - do not edit */ -if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; -if (! _$jscoverage['router/collection.js']) { - _$jscoverage['router/collection.js'] = []; - _$jscoverage['router/collection.js'][12] = 0; - _$jscoverage['router/collection.js'][22] = 0; - _$jscoverage['router/collection.js'][23] = 0; - _$jscoverage['router/collection.js'][30] = 0; - _$jscoverage['router/collection.js'][39] = 0; - _$jscoverage['router/collection.js'][40] = 0; - _$jscoverage['router/collection.js'][44] = 0; - _$jscoverage['router/collection.js'][45] = 0; - _$jscoverage['router/collection.js'][46] = 0; - _$jscoverage['router/collection.js'][50] = 0; -} -_$jscoverage['router/collection.js'][12]++; -module.exports = Collection; -_$jscoverage['router/collection.js'][22]++; -function Collection(router) { - _$jscoverage['router/collection.js'][23]++; - Object.defineProperty(this, "router", {value: router}); -} -_$jscoverage['router/collection.js'][30]++; -Collection.prototype.__proto__ = Array.prototype; -_$jscoverage['router/collection.js'][39]++; -Collection.prototype.remove = (function () { - _$jscoverage['router/collection.js'][40]++; - var router = this.router, len = this.length, ret = new Collection(this.router); - _$jscoverage['router/collection.js'][44]++; - for (var i = 0; i < len; ++i) { - _$jscoverage['router/collection.js'][45]++; - if (router.remove(this[i])) { - _$jscoverage['router/collection.js'][46]++; - ret.push(this[i]); - } -} - _$jscoverage['router/collection.js'][50]++; - return ret; -}); -_$jscoverage['router/collection.js'].source = ["","/*!"," * Express - router - Collection"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Expose `Collection`."," */","","module.exports = Collection;","","/**"," * Initialize a new route `Collection`"," * with the given `router`."," * "," * @param {Router} router"," * @api private"," */","","function Collection(router) {"," Object.defineProperty(this, 'router', { value: router });","}","","/**"," * Inherit from `Array.prototype`."," */","","Collection.prototype.__proto__ = Array.prototype;","","/**"," * Remove the routes in this collection."," *"," * @return {Collection} of routes removed"," * @api public"," */","","Collection.prototype.remove = function(){"," var router = this.router"," , len = this.length"," , ret = new Collection(this.router);",""," for (var i = 0; i < len; ++i) {"," if (router.remove(this[i])) {"," ret.push(this[i]);"," }"," }",""," return ret;","};",""]; diff --git a/node_modules/express/lib-cov/router/index.js b/node_modules/express/lib-cov/router/index.js deleted file mode 100644 index abc2c84..0000000 --- a/node_modules/express/lib-cov/router/index.js +++ /dev/null @@ -1,515 +0,0 @@ -/* automatically generated by JSCoverage - do not edit */ -if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; -if (! _$jscoverage['router/index.js']) { - _$jscoverage['router/index.js'] = []; - _$jscoverage['router/index.js'][11] = 0; - _$jscoverage['router/index.js'][21] = 0; - _$jscoverage['router/index.js'][27] = 0; - _$jscoverage['router/index.js'][36] = 0; - _$jscoverage['router/index.js'][37] = 0; - _$jscoverage['router/index.js'][38] = 0; - _$jscoverage['router/index.js'][39] = 0; - _$jscoverage['router/index.js'][40] = 0; - _$jscoverage['router/index.js'][41] = 0; - _$jscoverage['router/index.js'][42] = 0; - _$jscoverage['router/index.js'][43] = 0; - _$jscoverage['router/index.js'][44] = 0; - _$jscoverage['router/index.js'][46] = 0; - _$jscoverage['router/index.js'][47] = 0; - _$jscoverage['router/index.js'][60] = 0; - _$jscoverage['router/index.js'][62] = 0; - _$jscoverage['router/index.js'][63] = 0; - _$jscoverage['router/index.js'][64] = 0; - _$jscoverage['router/index.js'][68] = 0; - _$jscoverage['router/index.js'][72] = 0; - _$jscoverage['router/index.js'][73] = 0; - _$jscoverage['router/index.js'][74] = 0; - _$jscoverage['router/index.js'][80] = 0; - _$jscoverage['router/index.js'][81] = 0; - _$jscoverage['router/index.js'][84] = 0; - _$jscoverage['router/index.js'][85] = 0; - _$jscoverage['router/index.js'][95] = 0; - _$jscoverage['router/index.js'][96] = 0; - _$jscoverage['router/index.js'][97] = 0; - _$jscoverage['router/index.js'][111] = 0; - _$jscoverage['router/index.js'][112] = 0; - _$jscoverage['router/index.js'][116] = 0; - _$jscoverage['router/index.js'][117] = 0; - _$jscoverage['router/index.js'][120] = 0; - _$jscoverage['router/index.js'][121] = 0; - _$jscoverage['router/index.js'][122] = 0; - _$jscoverage['router/index.js'][123] = 0; - _$jscoverage['router/index.js'][137] = 0; - _$jscoverage['router/index.js'][138] = 0; - _$jscoverage['router/index.js'][139] = 0; - _$jscoverage['router/index.js'][171] = 0; - _$jscoverage['router/index.js'][172] = 0; - _$jscoverage['router/index.js'][178] = 0; - _$jscoverage['router/index.js'][179] = 0; - _$jscoverage['router/index.js'][180] = 0; - _$jscoverage['router/index.js'][181] = 0; - _$jscoverage['router/index.js'][182] = 0; - _$jscoverage['router/index.js'][183] = 0; - _$jscoverage['router/index.js'][184] = 0; - _$jscoverage['router/index.js'][188] = 0; - _$jscoverage['router/index.js'][200] = 0; - _$jscoverage['router/index.js'][201] = 0; - _$jscoverage['router/index.js'][204] = 0; - _$jscoverage['router/index.js'][207] = 0; - _$jscoverage['router/index.js'][208] = 0; - _$jscoverage['router/index.js'][217] = 0; - _$jscoverage['router/index.js'][218] = 0; - _$jscoverage['router/index.js'][222] = 0; - _$jscoverage['router/index.js'][225] = 0; - _$jscoverage['router/index.js'][228] = 0; - _$jscoverage['router/index.js'][229] = 0; - _$jscoverage['router/index.js'][233] = 0; - _$jscoverage['router/index.js'][234] = 0; - _$jscoverage['router/index.js'][235] = 0; - _$jscoverage['router/index.js'][238] = 0; - _$jscoverage['router/index.js'][239] = 0; - _$jscoverage['router/index.js'][240] = 0; - _$jscoverage['router/index.js'][241] = 0; - _$jscoverage['router/index.js'][242] = 0; - _$jscoverage['router/index.js'][244] = 0; - _$jscoverage['router/index.js'][245] = 0; - _$jscoverage['router/index.js'][246] = 0; - _$jscoverage['router/index.js'][247] = 0; - _$jscoverage['router/index.js'][248] = 0; - _$jscoverage['router/index.js'][249] = 0; - _$jscoverage['router/index.js'][250] = 0; - _$jscoverage['router/index.js'][251] = 0; - _$jscoverage['router/index.js'][252] = 0; - _$jscoverage['router/index.js'][253] = 0; - _$jscoverage['router/index.js'][255] = 0; - _$jscoverage['router/index.js'][256] = 0; - _$jscoverage['router/index.js'][259] = 0; - _$jscoverage['router/index.js'][261] = 0; - _$jscoverage['router/index.js'][263] = 0; - _$jscoverage['router/index.js'][266] = 0; - _$jscoverage['router/index.js'][267] = 0; - _$jscoverage['router/index.js'][268] = 0; - _$jscoverage['router/index.js'][269] = 0; - _$jscoverage['router/index.js'][273] = 0; - _$jscoverage['router/index.js'][274] = 0; - _$jscoverage['router/index.js'][275] = 0; - _$jscoverage['router/index.js'][276] = 0; - _$jscoverage['router/index.js'][277] = 0; - _$jscoverage['router/index.js'][278] = 0; - _$jscoverage['router/index.js'][279] = 0; - _$jscoverage['router/index.js'][280] = 0; - _$jscoverage['router/index.js'][281] = 0; - _$jscoverage['router/index.js'][282] = 0; - _$jscoverage['router/index.js'][284] = 0; - _$jscoverage['router/index.js'][287] = 0; - _$jscoverage['router/index.js'][301] = 0; - _$jscoverage['router/index.js'][302] = 0; - _$jscoverage['router/index.js'][304] = 0; - _$jscoverage['router/index.js'][315] = 0; - _$jscoverage['router/index.js'][316] = 0; - _$jscoverage['router/index.js'][317] = 0; - _$jscoverage['router/index.js'][318] = 0; - _$jscoverage['router/index.js'][319] = 0; - _$jscoverage['router/index.js'][320] = 0; - _$jscoverage['router/index.js'][321] = 0; - _$jscoverage['router/index.js'][324] = 0; - _$jscoverage['router/index.js'][339] = 0; - _$jscoverage['router/index.js'][340] = 0; - _$jscoverage['router/index.js'][351] = 0; - _$jscoverage['router/index.js'][353] = 0; - _$jscoverage['router/index.js'][354] = 0; - _$jscoverage['router/index.js'][358] = 0; - _$jscoverage['router/index.js'][362] = 0; - _$jscoverage['router/index.js'][365] = 0; - _$jscoverage['router/index.js'][366] = 0; - _$jscoverage['router/index.js'][367] = 0; - _$jscoverage['router/index.js'][368] = 0; - _$jscoverage['router/index.js'][369] = 0; - _$jscoverage['router/index.js'][372] = 0; - _$jscoverage['router/index.js'][373] = 0; - _$jscoverage['router/index.js'][377] = 0; - _$jscoverage['router/index.js'][378] = 0; - _$jscoverage['router/index.js'][380] = 0; - _$jscoverage['router/index.js'][385] = 0; - _$jscoverage['router/index.js'][386] = 0; - _$jscoverage['router/index.js'][402] = 0; - _$jscoverage['router/index.js'][403] = 0; - _$jscoverage['router/index.js'][408] = 0; - _$jscoverage['router/index.js'][411] = 0; - _$jscoverage['router/index.js'][412] = 0; - _$jscoverage['router/index.js'][418] = 0; - _$jscoverage['router/index.js'][419] = 0; - _$jscoverage['router/index.js'][420] = 0; -} -_$jscoverage['router/index.js'][11]++; -var Route = require("./route"), Collection = require("./collection"), utils = require("../utils"), debug = require("debug")("express:router"), parse = require("url").parse; -_$jscoverage['router/index.js'][21]++; -exports = module.exports = Router; -_$jscoverage['router/index.js'][27]++; -var methods = exports.methods = require("./methods"); -_$jscoverage['router/index.js'][36]++; -function Router(options) { - _$jscoverage['router/index.js'][37]++; - options = options || {}; - _$jscoverage['router/index.js'][38]++; - var self = this; - _$jscoverage['router/index.js'][39]++; - this.routes = new Collection(); - _$jscoverage['router/index.js'][40]++; - this.map = {}; - _$jscoverage['router/index.js'][41]++; - this.params = {}; - _$jscoverage['router/index.js'][42]++; - this._params = []; - _$jscoverage['router/index.js'][43]++; - this.caseSensitive = options.caseSensitive; - _$jscoverage['router/index.js'][44]++; - this.strict = options.strict; - _$jscoverage['router/index.js'][46]++; - this.middleware = (function router(req, res, next) { - _$jscoverage['router/index.js'][47]++; - self._dispatch(req, res, next); -}); -} -_$jscoverage['router/index.js'][60]++; -Router.prototype.param = (function (name, fn) { - _$jscoverage['router/index.js'][62]++; - if ("function" == typeof name) { - _$jscoverage['router/index.js'][63]++; - this._params.push(name); - _$jscoverage['router/index.js'][64]++; - return; - } - _$jscoverage['router/index.js'][68]++; - var params = this._params, len = params.length, ret; - _$jscoverage['router/index.js'][72]++; - for (var i = 0; i < len; ++i) { - _$jscoverage['router/index.js'][73]++; - if (ret = params[i](name, fn)) { - _$jscoverage['router/index.js'][74]++; - fn = ret; - } -} - _$jscoverage['router/index.js'][80]++; - if ("function" != typeof fn) { - _$jscoverage['router/index.js'][81]++; - throw new Error("invalid param() call for " + name + ", got " + fn); - } - _$jscoverage['router/index.js'][84]++; - (this.params[name] = this.params[name] || []).push(fn); - _$jscoverage['router/index.js'][85]++; - return this; -}); -_$jscoverage['router/index.js'][95]++; -Router.prototype.all = (function () { - _$jscoverage['router/index.js'][96]++; - return this.find((function () { - _$jscoverage['router/index.js'][97]++; - return true; -})); -}); -_$jscoverage['router/index.js'][111]++; -Router.prototype.remove = (function (route) { - _$jscoverage['router/index.js'][112]++; - var routes = this.map[route.method], len = routes.length; - _$jscoverage['router/index.js'][116]++; - var i = this.routes.indexOf(route); - _$jscoverage['router/index.js'][117]++; - this.routes.splice(i, 1); - _$jscoverage['router/index.js'][120]++; - for (var i = 0; i < len; ++i) { - _$jscoverage['router/index.js'][121]++; - if (route == routes[i]) { - _$jscoverage['router/index.js'][122]++; - routes.splice(i, 1); - _$jscoverage['router/index.js'][123]++; - return true; - } -} -}); -_$jscoverage['router/index.js'][137]++; -Router.prototype.lookup = (function (method, path) { - _$jscoverage['router/index.js'][138]++; - return this.find((function (route) { - _$jscoverage['router/index.js'][139]++; - return path == route.path && (route.method == method || method == "all"); -})); -}); -_$jscoverage['router/index.js'][171]++; -Router.prototype.find = (function (fn) { - _$jscoverage['router/index.js'][172]++; - var len = methods.length, ret = new Collection(this), method, routes, route; - _$jscoverage['router/index.js'][178]++; - for (var i = 0; i < len; ++i) { - _$jscoverage['router/index.js'][179]++; - method = methods[i]; - _$jscoverage['router/index.js'][180]++; - routes = this.map[method]; - _$jscoverage['router/index.js'][181]++; - if (! routes) { - _$jscoverage['router/index.js'][181]++; - continue; - } - _$jscoverage['router/index.js'][182]++; - for (var j = 0, jlen = routes.length; j < jlen; ++j) { - _$jscoverage['router/index.js'][183]++; - route = routes[j]; - _$jscoverage['router/index.js'][184]++; - if (fn(route)) { - _$jscoverage['router/index.js'][184]++; - ret.push(route); - } -} -} - _$jscoverage['router/index.js'][188]++; - return ret; -}); -_$jscoverage['router/index.js'][200]++; -Router.prototype._dispatch = (function (req, res, next) { - _$jscoverage['router/index.js'][201]++; - var params = this.params, self = this; - _$jscoverage['router/index.js'][204]++; - debug("dispatching %s %s", req.method, req.url); - _$jscoverage['router/index.js'][207]++; - (function pass(i, err) { - _$jscoverage['router/index.js'][208]++; - var paramCallbacks, paramIndex = 0, paramVal, route, keys, key, ret; - _$jscoverage['router/index.js'][217]++; - function nextRoute(err) { - _$jscoverage['router/index.js'][218]++; - pass(req._route_index + 1, err); -} - _$jscoverage['router/index.js'][222]++; - req.route = route = self.match(req, i); - _$jscoverage['router/index.js'][225]++; - if (! route && "OPTIONS" == req.method) { - _$jscoverage['router/index.js'][225]++; - return self._options(req, res); - } - _$jscoverage['router/index.js'][228]++; - if (! route) { - _$jscoverage['router/index.js'][228]++; - return next(err); - } - _$jscoverage['router/index.js'][229]++; - debug("matched %s %s", route.method, route.path); - _$jscoverage['router/index.js'][233]++; - req.params = route.params; - _$jscoverage['router/index.js'][234]++; - keys = route.keys; - _$jscoverage['router/index.js'][235]++; - i = 0; - _$jscoverage['router/index.js'][238]++; - function param(err) { - _$jscoverage['router/index.js'][239]++; - paramIndex = 0; - _$jscoverage['router/index.js'][240]++; - key = keys[i++]; - _$jscoverage['router/index.js'][241]++; - paramVal = key && req.params[key.name]; - _$jscoverage['router/index.js'][242]++; - paramCallbacks = key && params[key.name]; - _$jscoverage['router/index.js'][244]++; - try { - _$jscoverage['router/index.js'][245]++; - if ("route" == err) { - _$jscoverage['router/index.js'][246]++; - nextRoute(); - } - else { - _$jscoverage['router/index.js'][247]++; - if (err) { - _$jscoverage['router/index.js'][248]++; - i = 0; - _$jscoverage['router/index.js'][249]++; - callbacks(err); - } - else { - _$jscoverage['router/index.js'][250]++; - if (paramCallbacks && undefined !== paramVal) { - _$jscoverage['router/index.js'][251]++; - paramCallback(); - } - else { - _$jscoverage['router/index.js'][252]++; - if (key) { - _$jscoverage['router/index.js'][253]++; - param(); - } - else { - _$jscoverage['router/index.js'][255]++; - i = 0; - _$jscoverage['router/index.js'][256]++; - callbacks(); - } - } - } - } - } - catch (err) { - _$jscoverage['router/index.js'][259]++; - param(err); - } -} - _$jscoverage['router/index.js'][261]++; - ; - _$jscoverage['router/index.js'][263]++; - param(err); - _$jscoverage['router/index.js'][266]++; - function paramCallback(err) { - _$jscoverage['router/index.js'][267]++; - var fn = paramCallbacks[paramIndex++]; - _$jscoverage['router/index.js'][268]++; - if (err || ! fn) { - _$jscoverage['router/index.js'][268]++; - return param(err); - } - _$jscoverage['router/index.js'][269]++; - fn(req, res, paramCallback, paramVal, key.name); -} - _$jscoverage['router/index.js'][273]++; - function callbacks(err) { - _$jscoverage['router/index.js'][274]++; - var fn = route.callbacks[i++]; - _$jscoverage['router/index.js'][275]++; - try { - _$jscoverage['router/index.js'][276]++; - if ("route" == err) { - _$jscoverage['router/index.js'][277]++; - nextRoute(); - } - else { - _$jscoverage['router/index.js'][278]++; - if (err && fn) { - _$jscoverage['router/index.js'][279]++; - if (fn.length < 4) { - _$jscoverage['router/index.js'][279]++; - return callbacks(err); - } - _$jscoverage['router/index.js'][280]++; - fn(err, req, res, callbacks); - } - else { - _$jscoverage['router/index.js'][281]++; - if (fn) { - _$jscoverage['router/index.js'][282]++; - fn(req, res, callbacks); - } - else { - _$jscoverage['router/index.js'][284]++; - nextRoute(err); - } - } - } - } - catch (err) { - _$jscoverage['router/index.js'][287]++; - callbacks(err); - } -} -})(0); -}); -_$jscoverage['router/index.js'][301]++; -Router.prototype._options = (function (req, res) { - _$jscoverage['router/index.js'][302]++; - var path = parse(req.url).pathname, body = this._optionsFor(path).join(","); - _$jscoverage['router/index.js'][304]++; - res.set("Allow", body).send(body); -}); -_$jscoverage['router/index.js'][315]++; -Router.prototype._optionsFor = (function (path) { - _$jscoverage['router/index.js'][316]++; - var self = this; - _$jscoverage['router/index.js'][317]++; - return methods.filter((function (method) { - _$jscoverage['router/index.js'][318]++; - var routes = self.map[method]; - _$jscoverage['router/index.js'][319]++; - if (! routes || "options" == method) { - _$jscoverage['router/index.js'][319]++; - return; - } - _$jscoverage['router/index.js'][320]++; - for (var i = 0, len = routes.length; i < len; ++i) { - _$jscoverage['router/index.js'][321]++; - if (routes[i].match(path)) { - _$jscoverage['router/index.js'][321]++; - return true; - } -} -})).map((function (method) { - _$jscoverage['router/index.js'][324]++; - return method.toUpperCase(); -})); -}); -_$jscoverage['router/index.js'][339]++; -Router.prototype.match = (function (req, i, head) { - _$jscoverage['router/index.js'][340]++; - var method = req.method.toLowerCase(), url = parse(req.url), path = url.pathname, routes = this.map, i = i || 0, captures, route, keys; - _$jscoverage['router/index.js'][351]++; - if (! head && "head" == method) { - _$jscoverage['router/index.js'][353]++; - route = this.match(req, i, true); - _$jscoverage['router/index.js'][354]++; - if (route) { - _$jscoverage['router/index.js'][354]++; - return route; - } - _$jscoverage['router/index.js'][358]++; - method = "get"; - } - _$jscoverage['router/index.js'][362]++; - if (routes = routes[method]) { - _$jscoverage['router/index.js'][365]++; - for (var len = routes.length; i < len; ++i) { - _$jscoverage['router/index.js'][366]++; - route = routes[i]; - _$jscoverage['router/index.js'][367]++; - if (captures = route.match(path)) { - _$jscoverage['router/index.js'][368]++; - keys = route.keys; - _$jscoverage['router/index.js'][369]++; - route.params = []; - _$jscoverage['router/index.js'][372]++; - for (var j = 1, jlen = captures.length; j < jlen; ++j) { - _$jscoverage['router/index.js'][373]++; - var key = keys[j - 1], val = "string" == typeof captures[j]? decodeURIComponent(captures[j]): captures[j]; - _$jscoverage['router/index.js'][377]++; - if (key) { - _$jscoverage['router/index.js'][378]++; - route.params[key.name] = val; - } - else { - _$jscoverage['router/index.js'][380]++; - route.params.push(val); - } -} - _$jscoverage['router/index.js'][385]++; - req._route_index = i; - _$jscoverage['router/index.js'][386]++; - return route; - } -} - } -}); -_$jscoverage['router/index.js'][402]++; -Router.prototype.route = (function (method, path, callbacks) { - _$jscoverage['router/index.js'][403]++; - var app = this.app, method = method.toLowerCase(), callbacks = utils.flatten([].slice.call(arguments, 2)); - _$jscoverage['router/index.js'][408]++; - if (! path) { - _$jscoverage['router/index.js'][408]++; - throw new Error("Router#" + method + "() requires a path"); - } - _$jscoverage['router/index.js'][411]++; - debug("defined %s %s", method, path); - _$jscoverage['router/index.js'][412]++; - var route = new Route(method, path, callbacks, {sensitive: this.caseSensitive, strict: this.strict}); - _$jscoverage['router/index.js'][418]++; - (this.map[method] = this.map[method] || []).push(route); - _$jscoverage['router/index.js'][419]++; - this.routes.push(route); - _$jscoverage['router/index.js'][420]++; - return this; -}); -_$jscoverage['router/index.js'].source = ["/*!"," * Express - Router"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var Route = require('./route')"," , Collection = require('./collection')"," , utils = require('../utils')"," , debug = require('debug')('express:router')"," , parse = require('url').parse;","","/**"," * Expose `Router` constructor."," */","","exports = module.exports = Router;","","/**"," * Expose HTTP methods."," */","","var methods = exports.methods = require('./methods');","","/**"," * Initialize a new `Router` with the given `options`."," * "," * @param {Object} options"," * @api private"," */","","function Router(options) {"," options = options || {};"," var self = this;"," this.routes = new Collection;"," this.map = {};"," this.params = {};"," this._params = [];"," this.caseSensitive = options.caseSensitive;"," this.strict = options.strict;",""," this.middleware = function router(req, res, next){"," self._dispatch(req, res, next);"," };","}","","/**"," * Register a param callback `fn` for the given `name`."," *"," * @param {String|Function} name"," * @param {Function} fn"," * @return {Router} for chaining"," * @api public"," */","","Router.prototype.param = function(name, fn){"," // param logic"," if ('function' == typeof name) {"," this._params.push(name);"," return;"," }",""," // apply param functions"," var params = this._params"," , len = params.length"," , ret;",""," for (var i = 0; i < len; ++i) {"," if (ret = params[i](name, fn)) {"," fn = ret;"," }"," }",""," // ensure we end up with a"," // middleware function"," if ('function' != typeof fn) {"," throw new Error('invalid param() call for ' + name + ', got ' + fn);"," }",""," (this.params[name] = this.params[name] || []).push(fn);"," return this;","};","","/**"," * Return a `Collection` of all routes defined."," *"," * @return {Collection}"," * @api public"," */","","Router.prototype.all = function(){"," return this.find(function(){"," return true;"," });","};","","/**"," * Remove the given `route`, returns"," * a bool indicating if the route was present"," * or not."," *"," * @param {Route} route"," * @return {Boolean}"," * @api public"," */","","Router.prototype.remove = function(route){"," var routes = this.map[route.method]"," , len = routes.length;",""," // remove from array"," var i = this.routes.indexOf(route);"," this.routes.splice(i, 1);",""," // remove from map"," for (var i = 0; i < len; ++i) {"," if (route == routes[i]) {"," routes.splice(i, 1);"," return true;"," }"," }","};","","/**"," * Return routes with route paths matching `path`."," *"," * @param {String} method"," * @param {String} path"," * @return {Collection}"," * @api public"," */","","Router.prototype.lookup = function(method, path){"," return this.find(function(route){"," return path == route.path"," && (route.method == method"," || method == 'all');"," });","};","","// /**","// * Return routes with regexps that match the given `url`.","// *","// * @param {String} method","// * @param {String} url","// * @return {Collection}","// * @api public","// */","// ","// Router.prototype.match = function(method, url){","// return this.find(function(route){","// return route.match(url)","// && (route.method == method","// || method == 'all');","// });","// };","","/**"," * Find routes based on the return value of `fn`"," * which is invoked once per route."," *"," * @param {Function} fn"," * @return {Collection}"," * @api public"," */","","Router.prototype.find = function(fn){"," var len = methods.length"," , ret = new Collection(this)"," , method"," , routes"," , route;",""," for (var i = 0; i < len; ++i) {"," method = methods[i];"," routes = this.map[method];"," if (!routes) continue;"," for (var j = 0, jlen = routes.length; j < jlen; ++j) {"," route = routes[j];"," if (fn(route)) ret.push(route);"," }"," }",""," return ret;","};","","/**"," * Route dispatcher aka the route \"middleware\"."," *"," * @param {IncomingMessage} req"," * @param {ServerResponse} res"," * @param {Function} next"," * @api private"," */","","Router.prototype._dispatch = function(req, res, next){"," var params = this.params"," , self = this;",""," debug('dispatching %s %s', req.method, req.url);",""," // route dispatch"," (function pass(i, err){"," var paramCallbacks"," , paramIndex = 0"," , paramVal"," , route"," , keys"," , key"," , ret;",""," // match next route"," function nextRoute(err) {"," pass(req._route_index + 1, err);"," }",""," // match route"," req.route = route = self.match(req, i);",""," // implied OPTIONS"," if (!route && 'OPTIONS' == req.method) return self._options(req, res);",""," // no route"," if (!route) return next(err);"," debug('matched %s %s', route.method, route.path);",""," // we have a route"," // start at param 0"," req.params = route.params;"," keys = route.keys;"," i = 0;",""," // param callbacks"," function param(err) {"," paramIndex = 0;"," key = keys[i++];"," paramVal = key && req.params[key.name];"," paramCallbacks = key && params[key.name];",""," try {"," if ('route' == err) {"," nextRoute();"," } else if (err) {"," i = 0;"," callbacks(err);"," } else if (paramCallbacks && undefined !== paramVal) {"," paramCallback();"," } else if (key) {"," param();"," } else {"," i = 0;"," callbacks();"," }"," } catch (err) {"," param(err);"," }"," };",""," param(err);"," "," // single param callbacks"," function paramCallback(err) {"," var fn = paramCallbacks[paramIndex++];"," if (err || !fn) return param(err);"," fn(req, res, paramCallback, paramVal, key.name);"," }",""," // invoke route callbacks"," function callbacks(err) {"," var fn = route.callbacks[i++];"," try {"," if ('route' == err) {"," nextRoute();"," } else if (err && fn) {"," if (fn.length < 4) return callbacks(err);"," fn(err, req, res, callbacks);"," } else if (fn) {"," fn(req, res, callbacks);"," } else {"," nextRoute(err);"," }"," } catch (err) {"," callbacks(err);"," }"," }"," })(0);","};","","/**"," * Respond to __OPTIONS__ method."," *"," * @param {IncomingMessage} req"," * @param {ServerResponse} res"," * @api private"," */","","Router.prototype._options = function(req, res){"," var path = parse(req.url).pathname"," , body = this._optionsFor(path).join(',');"," res.set('Allow', body).send(body);","};","","/**"," * Return an array of HTTP verbs or \"options\" for `path`."," *"," * @param {String} path"," * @return {Array}"," * @api private"," */","","Router.prototype._optionsFor = function(path){"," var self = this;"," return methods.filter(function(method){"," var routes = self.map[method];"," if (!routes || 'options' == method) return;"," for (var i = 0, len = routes.length; i < len; ++i) {"," if (routes[i].match(path)) return true;"," }"," }).map(function(method){"," return method.toUpperCase();"," });","};","","/**"," * Attempt to match a route for `req`"," * with optional starting index of `i`"," * defaulting to 0."," *"," * @param {IncomingMessage} req"," * @param {Number} i"," * @return {Route}"," * @api private"," */","","Router.prototype.match = function(req, i, head){"," var method = req.method.toLowerCase()"," , url = parse(req.url)"," , path = url.pathname"," , routes = this.map"," , i = i || 0"," , captures"," , route"," , keys;",""," // HEAD support"," // TODO: clean this up"," if (!head && 'head' == method) {"," // attempt lookup"," route = this.match(req, i, true);"," if (route) return route;",""," // default to GET as res.render() / res.send()"," // etc support HEAD"," method = 'get';"," }",""," // routes for this method"," if (routes = routes[method]) {",""," // matching routes"," for (var len = routes.length; i < len; ++i) {"," route = routes[i];"," if (captures = route.match(path)) {"," keys = route.keys;"," route.params = [];",""," // params from capture groups"," for (var j = 1, jlen = captures.length; j < jlen; ++j) {"," var key = keys[j-1]"," , val = 'string' == typeof captures[j]"," ? decodeURIComponent(captures[j])"," : captures[j];"," if (key) {"," route.params[key.name] = val;"," } else {"," route.params.push(val);"," }"," }",""," // all done"," req._route_index = i;"," return route;"," }"," }"," }","};","","/**"," * Route `method`, `path`, and one or more callbacks."," *"," * @param {String} method"," * @param {String} path"," * @param {Function} callback..."," * @return {Router} for chaining"," * @api private"," */","","Router.prototype.route = function(method, path, callbacks){"," var app = this.app"," , method = method.toLowerCase()"," , callbacks = utils.flatten([].slice.call(arguments, 2));",""," // ensure path was given"," if (!path) throw new Error('Router#' + method + '() requires a path');",""," // create the route"," debug('defined %s %s', method, path);"," var route = new Route(method, path, callbacks, {"," sensitive: this.caseSensitive"," , strict: this.strict"," });",""," // add it"," (this.map[method] = this.map[method] || []).push(route);"," this.routes.push(route);"," return this;","};"]; diff --git a/node_modules/express/lib-cov/router/methods.js b/node_modules/express/lib-cov/router/methods.js deleted file mode 100644 index cfe9c84..0000000 --- a/node_modules/express/lib-cov/router/methods.js +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by JSCoverage - do not edit */ -if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; -if (! _$jscoverage['router/methods.js']) { - _$jscoverage['router/methods.js'] = []; - _$jscoverage['router/methods.js'][12] = 0; -} -_$jscoverage['router/methods.js'][12]++; -module.exports = ["get", "post", "put", "head", "delete", "options", "trace", "copy", "lock", "mkcol", "move", "propfind", "proppatch", "unlock", "report", "mkactivity", "checkout", "merge", "m-search", "notify", "subscribe", "unsubscribe", "patch"]; -_$jscoverage['router/methods.js'].source = ["","/*!"," * Express - router - methods"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * HTTP methods supported by node."," */","","module.exports = ["," 'get'"," , 'post'"," , 'put'"," , 'head'"," , 'delete'"," , 'options'"," , 'trace'"," , 'copy'"," , 'lock'"," , 'mkcol'"," , 'move'"," , 'propfind'"," , 'proppatch'"," , 'unlock'"," , 'report'"," , 'mkactivity'"," , 'checkout'"," , 'merge'"," , 'm-search'"," , 'notify'"," , 'subscribe'"," , 'unsubscribe'"," , 'patch'","];"]; diff --git a/node_modules/express/lib-cov/router/route.js b/node_modules/express/lib-cov/router/route.js deleted file mode 100644 index 6aae8a1..0000000 --- a/node_modules/express/lib-cov/router/route.js +++ /dev/null @@ -1,68 +0,0 @@ -/* automatically generated by JSCoverage - do not edit */ -if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; -if (! _$jscoverage['router/route.js']) { - _$jscoverage['router/route.js'] = []; - _$jscoverage['router/route.js'][11] = 0; - _$jscoverage['router/route.js'][29] = 0; - _$jscoverage['router/route.js'][30] = 0; - _$jscoverage['router/route.js'][31] = 0; - _$jscoverage['router/route.js'][32] = 0; - _$jscoverage['router/route.js'][33] = 0; - _$jscoverage['router/route.js'][34] = 0; - _$jscoverage['router/route.js'][48] = 0; - _$jscoverage['router/route.js'][49] = 0; - _$jscoverage['router/route.js'][69] = 0; - _$jscoverage['router/route.js'][70] = 0; - _$jscoverage['router/route.js'][71] = 0; - _$jscoverage['router/route.js'][72] = 0; - _$jscoverage['router/route.js'][73] = 0; - _$jscoverage['router/route.js'][77] = 0; - _$jscoverage['router/route.js'][78] = 0; - _$jscoverage['router/route.js'][79] = 0; - _$jscoverage['router/route.js'][88] = 0; -} -_$jscoverage['router/route.js'][11]++; -module.exports = Route; -_$jscoverage['router/route.js'][29]++; -function Route(method, path, callbacks, options) { - _$jscoverage['router/route.js'][30]++; - options = options || {}; - _$jscoverage['router/route.js'][31]++; - this.path = path; - _$jscoverage['router/route.js'][32]++; - this.method = method; - _$jscoverage['router/route.js'][33]++; - this.callbacks = callbacks; - _$jscoverage['router/route.js'][34]++; - this.regexp = normalize(path, this.keys = [], options.sensitive, options.strict); -} -_$jscoverage['router/route.js'][48]++; -Route.prototype.match = (function (path) { - _$jscoverage['router/route.js'][49]++; - return this.regexp.exec(path); -}); -_$jscoverage['router/route.js'][69]++; -function normalize(path, keys, sensitive, strict) { - _$jscoverage['router/route.js'][70]++; - if (path instanceof RegExp) { - _$jscoverage['router/route.js'][70]++; - return path; - } - _$jscoverage['router/route.js'][71]++; - if (path instanceof Array) { - _$jscoverage['router/route.js'][72]++; - path = "(" + path.join("|") + ")"; - } - _$jscoverage['router/route.js'][73]++; - path = path.concat(strict? "": "/?").replace(/\/\(/g, "(?:/").replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, (function (_, slash, format, key, capture, optional) { - _$jscoverage['router/route.js'][77]++; - keys.push({name: key, optional: ! ! optional}); - _$jscoverage['router/route.js'][78]++; - slash = slash || ""; - _$jscoverage['router/route.js'][79]++; - return "" + (optional? "": slash) + "(?:" + (optional? slash: "") + (format || "") + (capture || (format && "([^/.]+?)" || "([^/]+?)")) + ")" + (optional || ""); -})).replace(/([\/.])/g, "\\$1").replace(/\*/g, "(.*)"); - _$jscoverage['router/route.js'][88]++; - return new RegExp("^" + path + "$", sensitive? "": "i"); -} -_$jscoverage['router/route.js'].source = ["/*!"," * Express - router - Route"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Expose `Route`."," */","","module.exports = Route;","","/**"," * Initialize `Route` with the given HTTP `method`, `path`,"," * and an array of `callbacks` and `options`."," *"," * Options:"," *"," * - `sensitive` enable case-sensitive routes"," * - `strict` enable strict matching for trailing slashes"," *"," * @param {String} method"," * @param {String} path"," * @param {Array} callbacks"," * @param {Object} options."," * @api private"," */","","function Route(method, path, callbacks, options) {"," options = options || {};"," this.path = path;"," this.method = method;"," this.callbacks = callbacks;"," this.regexp = normalize(path"," , this.keys = []"," , options.sensitive"," , options.strict);","}","","/**"," * Check if this route matches `path` and return captures made."," *"," * @param {String} path"," * @return {Array}"," * @api private"," */","","Route.prototype.match = function(path){"," return this.regexp.exec(path);","};","","/**"," * Normalize the given path string,"," * returning a regular expression."," *"," * An empty array should be passed,"," * which will contain the placeholder"," * key names. For example \"/user/:id\" will"," * then contain [\"id\"]."," *"," * @param {String|RegExp|Array} path"," * @param {Array} keys"," * @param {Boolean} sensitive"," * @param {Boolean} strict"," * @return {RegExp}"," * @api private"," */","","function normalize(path, keys, sensitive, strict) {"," if (path instanceof RegExp) return path;"," if (path instanceof Array) "," \tpath = '(' + path.join('|') + ')';"," path = path"," .concat(strict ? '' : '/?')"," .replace(/\\/\\(/g, '(?:/')"," .replace(/(\\/)?(\\.)?:(\\w+)(?:(\\(.*?\\)))?(\\?)?/g, function(_, slash, format, key, capture, optional){"," keys.push({ name: key, optional: !! optional });"," slash = slash || '';"," return ''"," + (optional ? '' : slash)"," + '(?:'"," + (optional ? slash : '')"," + (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')'"," + (optional || '');"," })"," .replace(/([\\/.])/g, '\\\\$1')"," .replace(/\\*/g, '(.*)');"," return new RegExp('^' + path + '$', sensitive ? '' : 'i');","}"]; diff --git a/node_modules/express/lib-cov/utils.js b/node_modules/express/lib-cov/utils.js deleted file mode 100644 index e87dad0..0000000 --- a/node_modules/express/lib-cov/utils.js +++ /dev/null @@ -1,151 +0,0 @@ -/* automatically generated by JSCoverage - do not edit */ -if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; -if (! _$jscoverage['utils.js']) { - _$jscoverage['utils.js'] = []; - _$jscoverage['utils.js'][12] = 0; - _$jscoverage['utils.js'][22] = 0; - _$jscoverage['utils.js'][23] = 0; - _$jscoverage['utils.js'][24] = 0; - _$jscoverage['utils.js'][35] = 0; - _$jscoverage['utils.js'][36] = 0; - _$jscoverage['utils.js'][38] = 0; - _$jscoverage['utils.js'][39] = 0; - _$jscoverage['utils.js'][40] = 0; - _$jscoverage['utils.js'][42] = 0; - _$jscoverage['utils.js'][45] = 0; - _$jscoverage['utils.js'][58] = 0; - _$jscoverage['utils.js'][60] = 0; - _$jscoverage['utils.js'][63] = 0; - _$jscoverage['utils.js'][66] = 0; - _$jscoverage['utils.js'][69] = 0; - _$jscoverage['utils.js'][74] = 0; - _$jscoverage['utils.js'][75] = 0; - _$jscoverage['utils.js'][76] = 0; - _$jscoverage['utils.js'][79] = 0; - _$jscoverage['utils.js'][91] = 0; - _$jscoverage['utils.js'][92] = 0; - _$jscoverage['utils.js'][108] = 0; - _$jscoverage['utils.js'][109] = 0; - _$jscoverage['utils.js'][112] = 0; - _$jscoverage['utils.js'][113] = 0; - _$jscoverage['utils.js'][114] = 0; - _$jscoverage['utils.js'][115] = 0; - _$jscoverage['utils.js'][129] = 0; - _$jscoverage['utils.js'][130] = 0; - _$jscoverage['utils.js'][134] = 0; - _$jscoverage['utils.js'][137] = 0; - _$jscoverage['utils.js'][150] = 0; - _$jscoverage['utils.js'][151] = 0; - _$jscoverage['utils.js'][154] = 0; - _$jscoverage['utils.js'][158] = 0; - _$jscoverage['utils.js'][169] = 0; - _$jscoverage['utils.js'][170] = 0; -} -_$jscoverage['utils.js'][12]++; -var mime = require("mime"); -_$jscoverage['utils.js'][22]++; -exports.isAbsolute = (function (path) { - _$jscoverage['utils.js'][23]++; - if ("/" == path[0]) { - _$jscoverage['utils.js'][23]++; - return true; - } - _$jscoverage['utils.js'][24]++; - if (":" == path[1] && "\\" == path[2]) { - _$jscoverage['utils.js'][24]++; - return true; - } -}); -_$jscoverage['utils.js'][35]++; -exports.flatten = (function (arr, ret) { - _$jscoverage['utils.js'][36]++; - var ret = ret || [], len = arr.length; - _$jscoverage['utils.js'][38]++; - for (var i = 0; i < len; ++i) { - _$jscoverage['utils.js'][39]++; - if (Array.isArray(arr[i])) { - _$jscoverage['utils.js'][40]++; - exports.flatten(arr[i], ret); - } - else { - _$jscoverage['utils.js'][42]++; - ret.push(arr[i]); - } -} - _$jscoverage['utils.js'][45]++; - return ret; -}); -_$jscoverage['utils.js'][58]++; -exports.accepts = (function (type, str) { - _$jscoverage['utils.js'][60]++; - if (! str) { - _$jscoverage['utils.js'][60]++; - return true; - } - _$jscoverage['utils.js'][63]++; - if (! ~ type.indexOf("/")) { - _$jscoverage['utils.js'][63]++; - type = mime.lookup(type); - } - _$jscoverage['utils.js'][66]++; - type = type.split("/"); - _$jscoverage['utils.js'][69]++; - var accepted = exports.parseAccept(str), len = accepted.length, obj, ok; - _$jscoverage['utils.js'][74]++; - for (var i = 0; i < len; ++i) { - _$jscoverage['utils.js'][75]++; - obj = accepted[i]; - _$jscoverage['utils.js'][76]++; - if (exports.accept(type, obj)) { - _$jscoverage['utils.js'][76]++; - return true; - } -} - _$jscoverage['utils.js'][79]++; - return false; -}); -_$jscoverage['utils.js'][91]++; -exports.accept = (function (type, other) { - _$jscoverage['utils.js'][92]++; - return (type[0] == other.type || "*" == other.type) && (type[1] == other.subtype || "*" == other.subtype); -}); -_$jscoverage['utils.js'][108]++; -exports.parseAccept = (function (str) { - _$jscoverage['utils.js'][109]++; - return exports.parseQuality(str).map((function (obj) { - _$jscoverage['utils.js'][112]++; - var parts = obj.value.split("/"); - _$jscoverage['utils.js'][113]++; - obj.type = parts[0]; - _$jscoverage['utils.js'][114]++; - obj.subtype = parts[1]; - _$jscoverage['utils.js'][115]++; - return obj; -})); -}); -_$jscoverage['utils.js'][129]++; -exports.parseQuality = (function (str) { - _$jscoverage['utils.js'][130]++; - return str.split(/ *, */).map(quality).filter((function (obj) { - _$jscoverage['utils.js'][134]++; - return obj.quality; -})).sort((function (a, b) { - _$jscoverage['utils.js'][137]++; - return b.quality - a.quality; -})); -}); -_$jscoverage['utils.js'][150]++; -function quality(str) { - _$jscoverage['utils.js'][151]++; - var parts = str.split(/ *; */), val = parts[0]; - _$jscoverage['utils.js'][154]++; - var q = parts[1]? parseFloat(parts[1].split(/ *= */)[1]): 1; - _$jscoverage['utils.js'][158]++; - return ({value: val, quality: q}); -} -_$jscoverage['utils.js'][169]++; -exports.escape = (function (html) { - _$jscoverage['utils.js'][170]++; - return String(html).replace(/&/g, "&").replace(/"/g, """).replace(//g, ">"); -}); -_$jscoverage['utils.js'].source = ["","/*!"," * Express - utils"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var mime = require('mime');","","/**"," * Check if `path` looks absolute."," *"," * @param {String} path"," * @return {Boolean}"," * @api private"," */","","exports.isAbsolute = function(path){"," if ('/' == path[0]) return true;"," if (':' == path[1] && '\\\\' == path[2]) return true;","};","","/**"," * Flatten the given `arr`."," *"," * @param {Array} arr"," * @return {Array}"," * @api private"," */","","exports.flatten = function(arr, ret){"," var ret = ret || []"," , len = arr.length;"," for (var i = 0; i < len; ++i) {"," if (Array.isArray(arr[i])) {"," exports.flatten(arr[i], ret);"," } else {"," ret.push(arr[i]);"," }"," }"," return ret;","};","","/**"," * Check if `type` is acceptable based on"," * the given `str`."," *"," * @param {String} type"," * @param {String} str"," * @return {Boolean}"," * @api private"," */","","exports.accepts = function(type, str){"," // accept anything when Accept is not present"," if (!str) return true;",""," // resolve mime"," if (!~type.indexOf('/')) type = mime.lookup(type);",""," // split type/subtype"," type = type.split('/');",""," // parse"," var accepted = exports.parseAccept(str)"," , len = accepted.length"," , obj"," , ok;",""," for (var i = 0; i < len; ++i) {"," obj = accepted[i];"," if (exports.accept(type, obj)) return true;"," }",""," return false;","};","","/**"," * Check if `type` array is acceptable for `other`."," *"," * @param {Array} type"," * @param {Object} other"," * @return {Boolean}"," * @api private"," */","","exports.accept = function(type, other){"," return (type[0] == other.type || '*' == other.type)"," && (type[1] == other.subtype || '*' == other.subtype);","};","","/**"," * Parse accept `str`, returning"," * an array objects containing"," * `.type` and `.subtype` along"," * with the values provided by"," * `parseQuality()`."," *"," * @param {Type} name"," * @return {Type}"," * @api private"," */","","exports.parseAccept = function(str){"," return exports"," .parseQuality(str)"," .map(function(obj){"," var parts = obj.value.split('/');"," obj.type = parts[0];"," obj.subtype = parts[1];"," return obj;"," });","};","","/**"," * Parse quality `str`, returning an"," * array of objects with `.value` and"," * `.quality`."," *"," * @param {Type} name"," * @return {Type}"," * @api private"," */","","exports.parseQuality = function(str){"," return str"," .split(/ *, */)"," .map(quality)"," .filter(function(obj){"," return obj.quality;"," })"," .sort(function(a, b){"," return b.quality - a.quality;"," });","};","","/**"," * Parse quality `str` returning an"," * object with `.value` and `.quality`."," *"," * @param {String} str"," * @return {Object}"," * @api private"," */","","function quality(str) {"," var parts = str.split(/ *; */)"," , val = parts[0];",""," var q = parts[1]"," ? parseFloat(parts[1].split(/ *= */)[1])"," : 1;",""," return { value: val, quality: q };","}","","/**"," * Escape special characters in the given string of html."," *"," * @param {String} html"," * @return {String}"," * @api private"," */","","exports.escape = function(html) {"," return String(html)"," .replace(/&/g, '&amp;')"," .replace(/\"/g, '&quot;')"," .replace(/</g, '&lt;')"," .replace(/>/g, '&gt;');","};"]; diff --git a/node_modules/express/lib-cov/view.js b/node_modules/express/lib-cov/view.js deleted file mode 100644 index 70b56cc..0000000 --- a/node_modules/express/lib-cov/view.js +++ /dev/null @@ -1,81 +0,0 @@ -/* automatically generated by JSCoverage - do not edit */ -if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; -if (! _$jscoverage['view.js']) { - _$jscoverage['view.js'] = []; - _$jscoverage['view.js'][12] = 0; - _$jscoverage['view.js'][25] = 0; - _$jscoverage['view.js'][41] = 0; - _$jscoverage['view.js'][42] = 0; - _$jscoverage['view.js'][43] = 0; - _$jscoverage['view.js'][44] = 0; - _$jscoverage['view.js'][45] = 0; - _$jscoverage['view.js'][46] = 0; - _$jscoverage['view.js'][47] = 0; - _$jscoverage['view.js'][48] = 0; - _$jscoverage['view.js'][49] = 0; - _$jscoverage['view.js'][50] = 0; - _$jscoverage['view.js'][61] = 0; - _$jscoverage['view.js'][62] = 0; - _$jscoverage['view.js'][65] = 0; - _$jscoverage['view.js'][66] = 0; - _$jscoverage['view.js'][69] = 0; - _$jscoverage['view.js'][70] = 0; - _$jscoverage['view.js'][81] = 0; - _$jscoverage['view.js'][82] = 0; -} -_$jscoverage['view.js'][12]++; -var path = require("path"), utils = require("./utils"), fs = require("fs"), dirname = path.dirname, basename = path.basename, extname = path.extname, exists = path.existsSync, join = path.join; -_$jscoverage['view.js'][25]++; -module.exports = View; -_$jscoverage['view.js'][41]++; -function View(name, options) { - _$jscoverage['view.js'][42]++; - options = options || {}; - _$jscoverage['view.js'][43]++; - this.name = name; - _$jscoverage['view.js'][44]++; - this.root = options.root; - _$jscoverage['view.js'][45]++; - var engines = options.engines; - _$jscoverage['view.js'][46]++; - this.defaultEngine = options.defaultEngine; - _$jscoverage['view.js'][47]++; - var ext = this.ext = extname(name); - _$jscoverage['view.js'][48]++; - if (! ext) { - _$jscoverage['view.js'][48]++; - name += (ext = this.ext = "." + this.defaultEngine); - } - _$jscoverage['view.js'][49]++; - this.engine = engines[ext] || (engines[ext] = require(ext.slice(1)).__express); - _$jscoverage['view.js'][50]++; - this.path = this.lookup(name); -} -_$jscoverage['view.js'][61]++; -View.prototype.lookup = (function (path) { - _$jscoverage['view.js'][62]++; - var ext = this.ext; - _$jscoverage['view.js'][65]++; - if (! utils.isAbsolute(path)) { - _$jscoverage['view.js'][65]++; - path = join(this.root, path); - } - _$jscoverage['view.js'][66]++; - if (exists(path)) { - _$jscoverage['view.js'][66]++; - return path; - } - _$jscoverage['view.js'][69]++; - path = join(dirname(path), basename(path, ext), "index" + ext); - _$jscoverage['view.js'][70]++; - if (exists(path)) { - _$jscoverage['view.js'][70]++; - return path; - } -}); -_$jscoverage['view.js'][81]++; -View.prototype.render = (function (options, fn) { - _$jscoverage['view.js'][82]++; - this.engine(this.path, options, fn); -}); -_$jscoverage['view.js'].source = ["","/*!"," * Express - View"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var path = require('path')"," , utils = require('./utils')"," , fs = require('fs')"," , dirname = path.dirname"," , basename = path.basename"," , extname = path.extname"," , exists = path.existsSync"," , join = path.join;","","/**"," * Expose `View`."," */","","module.exports = View;","","/**"," * Initialize a new `View` with the given `name`."," *"," * Options:"," *"," * - `defaultEngine` the default template engine name "," * - `engines` template engine require() cache "," * - `root` root path for view lookup "," *"," * @param {String} name"," * @param {Object} options"," * @api private"," */","","function View(name, options) {"," options = options || {};"," this.name = name;"," this.root = options.root;"," var engines = options.engines;"," this.defaultEngine = options.defaultEngine;"," var ext = this.ext = extname(name);"," if (!ext) name += (ext = this.ext = '.' + this.defaultEngine);"," this.engine = engines[ext] || (engines[ext] = require(ext.slice(1)).__express);"," this.path = this.lookup(name);","}","","/**"," * Lookup view by the given `path`"," *"," * @param {String} path"," * @return {String}"," * @api private"," */","","View.prototype.lookup = function(path){"," var ext = this.ext;",""," // <path>.<engine>"," if (!utils.isAbsolute(path)) path = join(this.root, path);"," if (exists(path)) return path;",""," // <path>/index.<engine>"," path = join(dirname(path), basename(path, ext), 'index' + ext);"," if (exists(path)) return path;","};","","/**"," * Render with the given `options` and callback `fn(err, str)`."," *"," * @param {Object} options"," * @param {Function} fn"," * @api private"," */","","View.prototype.render = function(options, fn){"," this.engine(this.path, options, fn);","};"]; diff --git a/node_modules/express/lib/application.js b/node_modules/express/lib/application.js deleted file mode 100644 index 6228a46..0000000 --- a/node_modules/express/lib/application.js +++ /dev/null @@ -1,534 +0,0 @@ - -/*! - * Express - proto - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var connect = require('connect') - , Router = require('./router') - , methods = Router.methods.concat('del', 'all') - , middleware = require('./middleware') - , debug = require('debug')('express:application') - , View = require('./view') - , url = require('url') - , utils = connect.utils - , path = require('path') - , http = require('http') - , join = path.join - , fs = require('fs'); - -/** - * Application prototype. - */ - -var app = exports = module.exports = {}; - -/** - * Initialize the server. - * - * - setup default configuration - * - setup default middleware - * - setup route reflection methods - * - * @api private - */ - -app.init = function(){ - var self = this; - this.cache = {}; - this.settings = {}; - this.engines = {}; - this.viewCallbacks = []; - this.defaultConfiguration(); -}; - -/** - * Initialize application configuration. - * - * @api private - */ - -app.defaultConfiguration = function(){ - var self = this; - - // default settings - this.set('env', process.env.NODE_ENV || 'development'); - debug('booting in %s mode', this.get('env')); - - // implicit middleware - this.use(connect.query()); - this.use(middleware.init(this)); - - // app locals - this.locals = function(obj){ - for (var key in obj) self.locals[key] = obj[key]; - return self; - }; - - // response locals - this.locals.use = function(fn){ - if (3 == fn.length) { - self.viewCallbacks.push(fn); - } else { - self.viewCallbacks.push(function(req, res, done){ - fn(req, res); - done(); - }); - } - return this; - }; - - // router - this._router = new Router(this); - this.routes = this._router.routes; - this.__defineGetter__('router', function(){ - this._usedRouter = true; - this._router.caseSensitive = this.enabled('case sensitive routing'); - this._router.strict = this.enabled('strict routing'); - return this._router.middleware; - }); - - // default locals - this.locals.settings = this.settings; - - // default configuration - this.enable('jsonp callback'); - - this.configure('development', function(){ - this.set('json spaces', 2); - }); - - this.configure('production', function(){ - this.enable('view cache'); - }); -}; - -/** - * Proxy `connect#use()` to apply settings to - * mounted applications. - * - * @param {String|Function|Server} route - * @param {Function|Server} fn - * @return {app} for chaining - * @api public - */ - -app.use = function(route, fn){ - var app, home, handle; - - // default route to '/' - if ('string' != typeof route) fn = route, route = '/'; - - // express app - if (fn.handle && fn.set) app = fn; - - // restore .app property on req and res - if (app) { - app.route = route; - fn = function(req, res, next) { - var orig = req.app; - app.handle(req, res, function(err){ - req.app = res.app = orig; - next(err); - }); - }; - } - - connect.proto.use.call(this, route, fn); - - // mounted an app - if (app) { - app.parent = this; - app.emit('mount', this); - } - - return this; -}; - -/** - * Register the given template engine callback `fn` - * as `ext`. For example if you wanted to map the EJS - * template engine to ".html" files, rather than ".ejs" files, - * you could do the following. - * - * app.engine('html', require('ejs').renderFile); - * - * In this case EJS provides a `.renderFile()` method with - * the same signature that Express expects: `(path, options, callback)`. - * - * Some template engines do not follow this convention, the - * [Consolidate.js](https://github.com/visionmedia/consolidate.js) - * library was created to map all of node's popular template - * engines to follow this convention, thus allowing them to - * work seemlessly within Express. - * - * @param {String} ext - * @param {Function} fn - * @return {app} for chaining - * @api public - */ - -app.engine = function(ext, fn){ - if ('function' != typeof fn) throw new Error('callback function required'); - if ('.' != ext[0]) ext = '.' + ext; - this.engines[ext] = fn; - return this; -}; - -/** - * Map the given param placeholder `name`(s) to the given callback(s). - * - * Parameter mapping is used to provide pre-conditions to routes - * which use normalized placeholders. For example a _:user_id_ parameter - * could automatically load a user's information from the database without - * any additional code, - * - * The callback uses the samesignature as middleware, the only differencing - * being that the value of the placeholder is passed, in this case the _id_ - * of the user. Once the `next()` function is invoked, just like middleware - * it will continue on to execute the route, or subsequent parameter functions. - * - * app.param('user_id', function(req, res, next, id){ - * User.find(id, function(err, user){ - * if (err) { - * next(err); - * } else if (user) { - * req.user = user; - * next(); - * } else { - * next(new Error('failed to load user')); - * } - * }); - * }); - * - * @param {String|Array} name - * @param {Function} fn - * @return {app} for chaining - * @api public - */ - -app.param = function(name, fn){ - var self = this - , fns = [].slice.call(arguments, 1); - - // array - if (Array.isArray(name)) { - name.forEach(function(name){ - fns.forEach(function(fn){ - self.param(name, fn); - }); - }); - // param logic - } else if ('function' == typeof name) { - this._router.param(name); - // single - } else { - if (':' == name[0]) name = name.substr(1); - fns.forEach(function(fn){ - self._router.param(name, fn); - }); - } - - return this; -}; - -/** - * Assign `setting` to `val`, or return `setting`'s value. - * - * app.set('foo', 'bar'); - * app.get('foo'); - * // => "bar" - * - * Mounted servers inherit their parent server's settings. - * - * @param {String} setting - * @param {String} val - * @return {Server} for chaining - * @api public - */ - -app.set = function(setting, val){ - if (1 == arguments.length) { - if (this.settings.hasOwnProperty(setting)) { - return this.settings[setting]; - } else if (this.parent) { - return this.parent.set(setting); - } - } else { - this.settings[setting] = val; - return this; - } -}; - -/** - * Return the app's absolute pathname - * based on the parent(s) that have - * mounted it. - * - * For example if the application was - * mounted as "/admin", which itself - * was mounted as "/blog" then the - * return value would be "/blog/admin". - * - * @return {String} - * @api private - */ - -app.path = function(){ - return this.parent - ? this.parent.path() + this.route - : ''; -}; - -/** - * Check if `setting` is enabled (truthy). - * - * app.enabled('foo') - * // => false - * - * app.enable('foo') - * app.enabled('foo') - * // => true - * - * @param {String} setting - * @return {Boolean} - * @api public - */ - -app.enabled = function(setting){ - return !!this.set(setting); -}; - -/** - * Check if `setting` is disabled. - * - * app.disabled('foo') - * // => true - * - * app.enable('foo') - * app.disabled('foo') - * // => false - * - * @param {String} setting - * @return {Boolean} - * @api public - */ - -app.disabled = function(setting){ - return !this.set(setting); -}; - -/** - * Enable `setting`. - * - * @param {String} setting - * @return {app} for chaining - * @api public - */ - -app.enable = function(setting){ - return this.set(setting, true); -}; - -/** - * Disable `setting`. - * - * @param {String} setting - * @return {app} for chaining - * @api public - */ - -app.disable = function(setting){ - return this.set(setting, false); -}; - -/** - * Configure callback for zero or more envs, - * when no `env` is specified that callback will - * be invoked for all environments. Any combination - * can be used multiple times, in any order desired. - * - * Examples: - * - * app.configure(function(){ - * // executed for all envs - * }); - * - * app.configure('stage', function(){ - * // executed staging env - * }); - * - * app.configure('stage', 'production', function(){ - * // executed for stage and production - * }); - * - * Note: - * - * These callbacks are invoked immediately, and - * are effectively sugar for the following. - * - * var env = process.env.NODE_ENV || 'development'; - * - * switch (env) { - * case 'development': - * ... - * break; - * case 'stage': - * ... - * break; - * case 'production': - * ... - * break; - * } - * - * @param {String} env... - * @param {Function} fn - * @return {app} for chaining - * @api public - */ - -app.configure = function(env, fn){ - var envs = 'all' - , args = [].slice.call(arguments); - fn = args.pop(); - if (args.length) envs = args; - if ('all' == envs || ~envs.indexOf(this.settings.env)) fn.call(this); - return this; -}; - -/** - * Delegate `.VERB(...)` calls to `.route(VERB, ...)`. - */ - -methods.forEach(function(method){ - app[method] = function(path){ - if ('get' == method && 1 == arguments.length) return this.set(path); - var args = [method].concat([].slice.call(arguments)); - if (!this._usedRouter) this.use(this.router); - return this._router.route.apply(this._router, args); - } -}); - -/** - * Special-cased "all" method, applying the given route `path`, - * middleware, and callback to _every_ HTTP method. - * - * @param {String} path - * @param {Function} ... - * @return {app} for chaining - * @api public - */ - -app.all = function(path){ - var args = arguments; - methods.forEach(function(method){ - if ('all' == method || 'del' == method) return; - app[method].apply(this, args); - }, this); - return this; -}; - -// del -> delete alias - -app.del = app.delete; - -/** - * Render the given view `name` name with `options` - * and a callback accepting an error and the - * rendered template string. - * - * Example: - * - * app.render('email', { name: 'Tobi' }, function(err, html){ - * // ... - * }) - * - * @param {String} name - * @param {String|Function} options or fn - * @param {Function} fn - * @api public - */ - -app.render = function(name, options, fn){ - var self = this - , opts = {} - , cache = this.cache - , engines = this.engines - , view; - - // support callback function as second arg - if ('function' == typeof options) { - fn = options, options = {}; - } - - // merge app.locals - utils.merge(opts, this.locals); - - // merge options.locals - if (options.locals) utils.merge(opts, options.locals); - - // merge options - utils.merge(opts, options); - - // set .cache unless explicitly provided - opts.cache = null == opts.cache - ? this.enabled('view cache') - : opts.cache; - - // primed cache - if (opts.cache) view = cache[name]; - - // view - if (!view) { - view = new View(name, { - defaultEngine: this.get('view engine') - , root: this.get('views') || process.cwd() + '/views' - , engines: engines - }); - - if (!view.path) { - return fn(new Error('Failed to lookup view "' + name + '"')); - } - - // prime the cache - if (opts.cache) cache[name] = view; - } - - // render - try { - view.render(opts, fn); - } catch (err) { - fn(err); - } -}; - -/** - * Listen for connections. - * - * A node `http.Server` is returned, with this - * application (which is a `Function`) as its - * callback. If you wish to create both an HTTP - * and HTTPS server you may do so with the "http" - * and "https" modules as shown here. - * - * var http = require('http') - * , https = require('https') - * , express = require('express') - * , app = express(); - * - * http.createServer(app).listen(80); - * http.createServer({ ... }, app).listen(443); - * - * @return {http.Server} - * @api public - */ - -app.listen = function(){ - var server = http.createServer(this); - return server.listen.apply(server, arguments); -}; diff --git a/node_modules/express/lib/express.js b/node_modules/express/lib/express.js deleted file mode 100644 index 84a3560..0000000 --- a/node_modules/express/lib/express.js +++ /dev/null @@ -1,91 +0,0 @@ - -/*! - * Express - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , connect = require('connect') - , proto = require('./application') - , Route = require('./router/route') - , Router = require('./router') - , req = require('./request') - , res = require('./response') - , utils = connect.utils; - -/** - * Expose `createApplication()`. - */ - -exports = module.exports = createApplication; - -/** - * Framework version. - */ - -exports.version = '3.0.0alpha1'; - -/** - * Create an express application. - * - * @return {Function} - * @api public - */ - -function createApplication() { - var app = connect(); - utils.merge(app, proto); - app.request = { __proto__: req }; - app.response = { __proto__: res }; - app.init(); - return app; -} - -/** - * Expose connect.middleware as express.* - * for example `express.logger` etc. - */ - -for (var key in connect.middleware) { - Object.defineProperty( - exports - , key - , Object.getOwnPropertyDescriptor(connect.middleware, key)); -} - -/** - * Backwards compat. - */ - -exports.createServer = createApplication; - -/** - * Expose the prototypes. - */ - -exports.application = proto; -exports.request = req; -exports.response = res; - -/** - * Expose constructors. - */ - -exports.Route = Route; -exports.Router = Router; - -/** - * Expose HTTP methods. - */ - -exports.methods = require('./router/methods'); - -// Error handler title - -exports.errorHandler.title = 'Express'; - diff --git a/node_modules/express/lib/middleware.js b/node_modules/express/lib/middleware.js deleted file mode 100644 index 221279f..0000000 --- a/node_modules/express/lib/middleware.js +++ /dev/null @@ -1,37 +0,0 @@ - -/*! - * Express - middleware - init - * Copyright(c) 2010-2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialization middleware, exposing the - * request and response to eachother, as well - * as defaulting the X-Powered-By header field. - * - * @param {Function} app - * @return {Function} - * @api private - */ - -exports.init = function(app){ - return function expressInit(req, res, next){ - var charset; - res.setHeader('X-Powered-By', 'Express'); - req.app = res.app = app; - req.res = res; - res.req = req; - req.next = next; - - req.__proto__ = app.request; - res.__proto__ = app.response; - - res.locals = function(obj){ - for (var key in obj) res.locals[key] = obj[key]; - return res; - }; - - next(); - } -}; diff --git a/node_modules/express/lib/request.js b/node_modules/express/lib/request.js deleted file mode 100644 index 70bd324..0000000 --- a/node_modules/express/lib/request.js +++ /dev/null @@ -1,415 +0,0 @@ - -/*! - * Express - request - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , utils = require('./utils') - , connect = require('connect') - , parse = require('url').parse - , mime = require('mime'); - -/** - * Request prototype. - */ - -var req = exports = module.exports = { - __proto__: http.IncomingMessage.prototype -}; - -/** - * Return request header. - * - * The `Referrer` header field is special-cased, - * both `Referrer` and `Referer` will yield are - * interchangeable. - * - * Examples: - * - * req.get('Content-Type'); - * // => "text/plain" - * - * req.get('content-type'); - * // => "text/plain" - * - * req.get('Something'); - * // => undefined - * - * @param {String} name - * @return {String} - * @api public - */ - -req.get = function(name){ - switch (name = name.toLowerCase()) { - case 'referer': - case 'referrer': - return this.headers.referrer - || this.headers.referer; - default: - return this.headers[name]; - } -}; - -/** - * Check if the given `type(s)` is acceptable, returning - * the best match when true, otherwise `undefined`, in which - * case you should respond with 406 "Not Acceptable". - * - * The `type` value may be a single mime type string - * such as "application/json", the extension name - * such as "json", a comma-delimted list such as "json, html, text/plain", - * or an array `["json", "html", "text/plain"]`. When a list - * or array is given the _best_ match, if any is returned. - * - * Examples: - * - * // Accept: text/html - * req.accepts('html'); - * // => "html" - * - * // Accept: text/*, application/json - * req.accepts('html'); - * // => "html" - * req.accepts('text/html'); - * // => "text/html" - * req.accepts('json, text'); - * // => "json" - * req.accepts('application/json'); - * // => "application/json" - * - * // Accept: text/*, application/json - * req.accepts('image/png'); - * req.accepts('png'); - * // => undefined - * - * // Accept: text/*;q=.5, application/json - * req.accepts(['html', 'json']); - * req.accepts('html, json'); - * // => "json" - * - * @param {String|Array} type(s) - * @return {String} - * @api public - */ - -req.accepts = function(type){ - return utils.accepts(type, this.get('Accept')); -}; - -/** - * Check if the given `charset` is acceptable, - * otherwise you should respond with 406 "Not Acceptable". - * - * @param {String} charset - * @return {Boolean} - * @api public - */ - -req.acceptsCharset = function(charset){ - var accepted = this.acceptedCharsets; - return accepted.length - ? ~accepted.indexOf(charset) - : true; -}; - -/** - * Check if the given `lang` is acceptable, - * otherwise you should respond with 406 "Not Acceptable". - * - * @param {String} lang - * @return {Boolean} - * @api public - */ - -req.acceptsLanguage = function(lang){ - var accepted = this.acceptedLanguages; - return accepted.length - ? ~accepted.indexOf(lang) - : true; -}; - -/** - * Return an array of Accepted media types - * ordered from highest quality to lowest. - * - * Examples: - * - * [ { value: 'application/json', - * quality: 1, - * type: 'application', - * subtype: 'json' }, - * { value: 'text/html', - * quality: 0.5, - * type: 'text', - * subtype: 'html' } ] - * - * @return {Array} - * @api public - */ - -req.__defineGetter__('accepted', function(){ - var accept = this.get('Accept'); - return accept - ? utils.parseAccept(accept) - : []; -}); - -/** - * Return an array of Accepted languages - * ordered from highest quality to lowest. - * - * Examples: - * - * Accept-Language: en;q=.5, en-us - * ['en-us', 'en'] - * - * @return {Array} - * @api public - */ - -req.__defineGetter__('acceptedLanguages', function(){ - var accept = this.get('Accept-Language'); - return accept - ? utils - .parseQuality(accept) - .map(function(obj){ - return obj.value; - }) - : []; -}); - -/** - * Return an array of Accepted charsets - * ordered from highest quality to lowest. - * - * Examples: - * - * Accept-Charset: iso-8859-5;q=.2, unicode-1-1;q=0.8 - * ['unicode-1-1', 'iso-8859-5'] - * - * @return {Array} - * @api public - */ - -req.__defineGetter__('acceptedCharsets', function(){ - var accept = this.get('Accept-Charset'); - return accept - ? utils - .parseQuality(accept) - .map(function(obj){ - return obj.value; - }) - : []; -}); - -/** - * Return the value of param `name` when present or `defaultValue`. - * - * - Checks body params, ex: id=12, {"id":12} - * - Checks route placeholders, ex: _/user/:id_ - * - Checks query string params, ex: ?id=12 - * - * To utilize request bodies, `req.body` - * should be an object. This can be done by using - * the `connect.bodyParser()` middleware. - * - * @param {String} name - * @param {Mixed} defaultValue - * @return {String} - * @api public - */ - -req.param = function(name, defaultValue){ - // req.body - if (this.body && undefined !== this.body[name]) return this.body[name]; - - // route params - if (this.params - && this.params.hasOwnProperty(name) - && undefined !== this.params[name]) { - return this.params[name]; - } - - // query-string - if (undefined !== this.query[name]) return this.query[name]; - - return defaultValue; -}; - -/** - * Check if the incoming request contains the "Content-Type" - * header field, and it contains the give mime `type`. - * - * Examples: - * - * // With Content-Type: text/html; charset=utf-8 - * req.is('html'); - * req.is('text/html'); - * req.is('text/*'); - * // => true - * - * // When Content-Type is application/json - * req.is('json'); - * req.is('application/json'); - * req.is('application/*'); - * // => true - * - * req.is('html'); - * // => false - * - * Now within our route callbacks, we can use to to assert content types - * such as "image/jpeg", "image/png", etc. - * - * app.post('/image/upload', function(req, res, next){ - * if (req.is('image/*')) { - * // do something - * } else { - * next(); - * } - * }); - * - * @param {String} type - * @return {Boolean} - * @api public - */ - -req.is = function(type){ - var ct = this.get('Content-Type'); - if (!ct) return false; - ct = ct.split(';')[0]; - if (!~type.indexOf('/')) type = mime.lookup(type); - if (~type.indexOf('*')) { - type = type.split('/'); - ct = ct.split('/'); - if ('*' == type[0] && type[1] == ct[1]) return true; - if ('*' == type[1] && type[0] == ct[0]) return true; - return false; - } - return !! ~ct.indexOf(type); -}; - -/** - * Return the protocol string "http" or "https" - * when requested with TLS. When the "trust proxy" - * setting is enabled the "X-Forwarded-Proto" header - * field will be trusted. If you're running behind - * a reverse proxy that supplies https for you this - * may be enabled. - * - * @return {String} - * @api public - */ - -req.__defineGetter__('protocol', function(){ - var trustProxy = this.app.settings['trust proxy']; - return this.connection.encrypted - ? 'https' - : trustProxy - ? (this.get('X-Forwarded-Proto') || 'http') - : 'http'; -}); - -/** - * Short-hand for: - * - * req.protocol == 'https' - * - * @return {Boolean} - * @api public - */ - -req.__defineGetter__('secure', function(){ - return 'https' == this.protocol; -}); - -/** - * When "trust proxy" is `true`, parse - * the "X-Forwarded-For" ip address list. - * - * For example if the value were "client, proxy1, proxy2" - * you would receive the array `["proxy2", "proxy1", "client"]` - * where "proxy2" is the furthest down-stream. - * - * @return {Array} - * @api public - */ - -req.__defineGetter__('ips', function(){ - var val = this.get('X-Forwarded-For'); - return val - ? val.split(/ *, */).reverse() - : []; -}); - -/** - * Return subdomains as an array. - * - * For example "tobi.ferrets.example.com" - * would provide `["ferrets", "tobi"]`. - * - * @return {Array} - * @api public - */ - -req.__defineGetter__('subdomains', function(){ - return this.get('Host') - .split('.') - .slice(0, -2) - .reverse(); -}); - -/** - * Short-hand for `url.parse(req.url).pathname`. - * - * @return {String} - * @api public - */ - -req.__defineGetter__('path', function(){ - return parse(this.url).pathname; -}); - -/** - * Check if the request is fresh, aka - * Last-Modified and/or the ETag - * still match. - * - * @return {Boolean} - * @api public - */ - -req.__defineGetter__('fresh', function(){ - return ! this.stale; -}); - -/** - * Check if the request is stale, aka - * "Last-Modified" and / or the "ETag" for the - * resource has changed. - * - * @return {Boolean} - * @api public - */ - -req.__defineGetter__('stale', function(){ - return connect.utils.modified(this, this.res); -}); - -/** - * Check if the request was an _XMLHttpRequest_. - * - * @return {Boolean} - * @api public - */ - -req.__defineGetter__('xhr', function(){ - var val = this.get('X-Requested-With') || ''; - return 'xmlhttprequest' == val.toLowerCase(); -}); diff --git a/node_modules/express/lib/response.js b/node_modules/express/lib/response.js deleted file mode 100644 index d5aed44..0000000 --- a/node_modules/express/lib/response.js +++ /dev/null @@ -1,640 +0,0 @@ - -/*! - * Express - response - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs') - , http = require('http') - , path = require('path') - , connect = require('connect') - , utils = connect.utils - , normalizeType = require('./utils').normalizeType - , normalizeTypes = require('./utils').normalizeTypes - , statusCodes = http.STATUS_CODES - , send = connect.static.send - , mime = require('mime') - , basename = path.basename - , extname = path.extname - , join = path.join; - -/** - * Response prototype. - */ - -var res = module.exports = { - __proto__: http.ServerResponse.prototype -}; - -/** - * Set status `code`. - * - * @param {Number} code - * @return {ServerResponse} - * @api public - */ - -res.status = function(code){ - this.statusCode = code; - return this; -}; - -/** - * Send a response. - * - * Examples: - * - * res.send(new Buffer('wahoo')); - * res.send({ some: 'json' }); - * res.send('

some html

'); - * res.send(404, 'Sorry, cant find that'); - * res.send(404); - * - * @param {Mixed} body or status - * @param {Mixed} body - * @return {ServerResponse} - * @api public - */ - -res.send = function(body){ - var req = this.req - , head = 'HEAD' == req.method; - - // allow status / body - if (2 == arguments.length) { - this.statusCode = body; - body = arguments[1]; - } - - switch (typeof body) { - // response status - case 'number': - this.get('Content-Type') || this.contentType('.txt'); - this.statusCode = body; - body = http.STATUS_CODES[body]; - break; - // string defaulting to html - case 'string': - if (!this.get('Content-Type')) { - this.charset = this.charset || 'utf-8'; - this.contentType('.html'); - } - break; - case 'boolean': - case 'object': - if (null == body) { - body = ''; - } else if (Buffer.isBuffer(body)) { - this.get('Content-Type') || this.contentType('.bin'); - } else { - return this.json(body); - } - break; - } - - // populate Content-Length - if (undefined !== body && !this.get('Content-Length')) { - this.set('Content-Length', Buffer.isBuffer(body) - ? body.length - : Buffer.byteLength(body)); - } - - // strip irrelevant headers - if (204 == this.statusCode || 304 == this.statusCode) { - this.removeHeader('Content-Type'); - this.removeHeader('Content-Length'); - body = ''; - } - - // respond - this.end(head ? null : body); - return this; -}; - -/** - * Send JSON response. - * - * Examples: - * - * res.json(null); - * res.json({ user: 'tj' }); - * res.json(500, 'oh noes!'); - * res.json(404, 'I dont have that'); - * - * @param {Mixed} obj or status - * @param {Mixed} obj - * @return {ServerResponse} - * @api public - */ - -res.json = function(obj){ - // allow status / body - if (2 == arguments.length) { - this.statusCode = obj; - obj = arguments[1]; - } - - var settings = this.app.settings - , jsonp = settings['jsonp callback'] - , replacer = settings['json replacer'] - , spaces = settings['json spaces'] - , body = JSON.stringify(obj, replacer, spaces) - , callback = this.req.query.callback; - - this.charset = this.charset || 'utf-8'; - this.set('Content-Type', 'application/json'); - - if (callback && jsonp) { - this.set('Content-Type', 'text/javascript'); - body = callback.replace(/[^\w$.]/g, '') + '(' + body + ');'; - } - - return this.send(body); -}; - -/** - * Transfer the file at the given `path`. - * - * Automatically sets the _Content-Type_ response header field. - * The callback `fn(err)` is invoked when the transfer is complete - * or when an error occurs. Be sure to check `res.sentHeader` - * if you wish to attempt responding, as the header and some data - * may have already been transferred. - * - * Options: - * - * - `maxAge` defaulting to 0 - * - `root` root directory for relative filenames - * - * Examples: - * - * The following example illustrates how `res.sendfile()` may - * be used as an alternative for the `static()` middleware for - * dynamic situations. The code backing `res.sendfile()` is actually - * the same code, so HTTP cache support etc is identical. - * - * app.get('/user/:uid/photos/:file', function(req, res){ - * var uid = req.params.uid - * , file = req.params.file; - * - * req.user.mayViewFilesFrom(uid, function(yes){ - * if (yes) { - * res.sendfile('/uploads/' + uid + '/' + file); - * } else { - * res.send(403, 'Sorry! you cant see that.'); - * } - * }); - * }); - * - * @param {String} path - * @param {Object|Function} options or fn - * @param {Function} fn - * @api public - */ - -res.sendfile = function(path, options, fn){ - var self = this - , req = self.req - , next = this.req.next - , options = options || {}; - - // support function as second arg - if ('function' == typeof options) { - fn = options; - options = {}; - } - - // callback - options.callback = function(err){ - if (err) { - // cast ENOENT - if ('ENOENT' == err.code) err = 404; - - // coerce numeric error to an Error - // TODO: remove - // TODO: remove docs for headerSent? - if ('number' == typeof err) err = utils.error(err); - - // ditch content-disposition to prevent funky responses - if (!self.headerSent) self.removeHeader('Content-Disposition'); - - // woot! callback available - if (fn) return fn(err); - - // lost in limbo if there's no callback - if (self.headerSent) return; - - return req.next(err); - } - - fn && fn(); - }; - - // transfer - options.path = encodeURIComponent(path); - send(this.req, this, next, options); -}; - -/** - * Transfer the file at the given `path` as an attachment. - * - * Optionally providing an alternate attachment `filename`, - * and optional callback `fn(err)`. The callback is invoked - * when the data transfer is complete, or when an error has - * ocurred. Be sure to check `res.headerSent` if you plan to respond. - * - * This method uses `res.attachment()` and `res.sendfile()`. - * - * @param {String} path - * @param {String|Function} filename or fn - * @param {Function} fn - * @api public - */ - -res.download = function(path, filename, fn){ - // support function as second arg - if ('function' == typeof filename) { - fn = filename; - filename = null; - } - - return this.attachment(filename || path).sendfile(path, fn); -}; - -/** - * Set _Content-Type_ response header with `type` through `mime.lookup()` - * when it does not contain "/", or set the Content-Type to `type` otherwise. - * - * Examples: - * - * res.type('.html'); - * res.type('html'); - * res.type('json'); - * res.type('application/json'); - * res.type('png'); - * - * @param {String} type - * @return {ServerResponse} for chaining - * @api public - */ - -res.contentType = -res.type = function(type){ - return this.set('Content-Type', ~type.indexOf('/') - ? type - : mime.lookup(type)); -}; - -/** - * Respond to the Acceptable formats using an `obj` - * of mime-type callbacks. - * - * This method uses `req.accepted`, an array of - * acceptable types ordered by their quality values. - * When "Accept" is not present the _first_ callback - * is invoked, otherwise the first match is used. When - * no match is performed the server responds with - * 406 "Not Acceptable". - * - * Content-Type is set for you, however if you choose - * you may alter this within the callback using `res.type()` - * or `res.set('Content-Type', ...)`. - * - * res.format({ - * 'text/plain': function(){ - * res.send('hey'); - * }, - * - * 'text/html': function(){ - * res.send('

hey

'); - * }, - * - * 'appliation/json': function(){ - * res.send({ message: 'hey' }); - * } - * }); - * - * In addition to canonicalized MIME types you may - * also use extnames mapped to these types: - * - * res.format({ - * text: function(){ - * res.send('hey'); - * }, - * - * html: function(){ - * res.send('

hey

'); - * }, - * - * json: function(){ - * res.send({ message: 'hey' }); - * } - * }); - * - * @param {Object} obj - * @return {ServerResponse} for chaining - * @api public - */ - -res.format = function(obj){ - var keys = Object.keys(obj) - , req = this.req - , next = req.next - , key = req.accepts(keys); - - this.set('Vary', 'Accept'); - - if (key) { - this.set('Content-Type', normalizeType(key)); - obj[key](req, this, next); - } else { - var err = new Error('Not Acceptable'); - err.status = 406; - err.types = normalizeTypes(keys); - next(err); - } - - return this; -}; - -/** - * Set _Content-Disposition_ header to _attachment_ with optional `filename`. - * - * @param {String} filename - * @return {ServerResponse} - * @api public - */ - -res.attachment = function(filename){ - if (filename) this.type(extname(filename)); - this.set('Content-Disposition', filename - ? 'attachment; filename="' + basename(filename) + '"' - : 'attachment'); - return this; -}; - -/** - * Set header `field` to `val`, or pass - * an object of of header fields. - * - * Examples: - * - * res.set('Accept', 'application/json'); - * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' }); - * - * @param {String|Object} field - * @param {String} val - * @return {ServerResponse} for chaining - * @api public - */ - -res.set = function(field, val){ - if (2 == arguments.length) { - this.setHeader(field, val); - } else { - for (var key in field) { - this.setHeader(key, field[key]); - } - } - return this; -}; - -/** - * Get value for header `field`. - * - * @param {String} field - * @return {String} - * @api public - */ - -res.get = function(field){ - return this.getHeader(field); -}; - -/** - * Clear cookie `name`. - * - * @param {String} name - * @param {Object} options - * @param {ServerResponse} for chaining - * @api public - */ - -res.clearCookie = function(name, options){ - var opts = { expires: new Date(1), path: '/' }; - return this.cookie(name, '', options - ? utils.merge(opts, options) - : opts); -}; - -/** - * Set a signed cookie with the given `name` and `val`. - * See `res.cookie()` for details. - * - * @param {String} name - * @param {String|Object} val - * @param {Object} options - * @api public - */ - -res.signedCookie = function(name, val, options){ - var secret = this.req.secret; - if (!secret) throw new Error('connect.cookieParser("secret") required for signed cookies'); - if ('object' == typeof val) val = 'j:' + JSON.stringify(val); - val = utils.sign(val, secret); - return this.cookie(name, val, options); -}; - -/** - * Set cookie `name` to `val`, with the given `options`. - * - * Options: - * - * - `maxAge` max-age in milliseconds, converted to `expires` - * - `path` defaults to "/" - * - * Examples: - * - * // "Remember Me" for 15 minutes - * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true }); - * - * // save as above - * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true }) - * - * @param {String} name - * @param {String|Object} val - * @param {Options} options - * @api public - */ - -res.cookie = function(name, val, options){ - options = options || {}; - if ('object' == typeof val) val = 'j:' + JSON.stringify(val); - if ('maxAge' in options) options.expires = new Date(Date.now() + options.maxAge); - if (null == options.path) options.path = '/'; - var cookie = utils.serializeCookie(name, val, options); - this.set('Set-Cookie', cookie); - return this; -}; - -/** - * Redirect to the given `url` with optional response `status` - * defaulting to 302. - * - * The given `url` can also be the name of a mapped url, for - * example by default express supports "back" which redirects - * to the _Referrer_ or _Referer_ headers or "/". - * - * Examples: - * - * res.redirect('/foo/bar'); - * res.redirect('http://example.com'); - * res.redirect(301, 'http://example.com'); - * res.redirect('../login'); // /blog/post/1 -> /blog/login - * - * Mounting: - * - * When an application is mounted, and `res.redirect()` - * is given a path that does _not_ lead with "/". For - * example suppose a "blog" app is mounted at "/blog", - * the following redirect would result in "/blog/login": - * - * res.redirect('login'); - * - * While the leading slash would result in a redirect to "/login": - * - * res.redirect('/login'); - * - * @param {String} url - * @param {Number} code - * @api public - */ - -res.redirect = function(url){ - var app = this.app - , req = this.req - , head = 'HEAD' == req.method - , status = 302 - , body; - - // allow status / url - if (2 == arguments.length) { - status = url; - url = arguments[1]; - } - - // setup redirect map - var map = { back: req.get('Referrer') || '/' }; - - // perform redirect - url = map[url] || url; - - // relative - if (!~url.indexOf('://')) { - var path = app.path(); - - // relative to path - if (0 == url.indexOf('./') || 0 == url.indexOf('..')) { - url = req.path + '/' + url; - // relative to mount-point - } else if ('/' != url[0]) { - url = path + '/' + url; - } - - // Absolute - var host = req.get('Host'); - url = req.protocol + '://' + host + url; - } - - // Support text/{plain,html} by default - this.format({ - text: function(){ - body = statusCodes[status] + '. Redirecting to ' + url; - }, - - html: function(){ - body = '

' + statusCodes[status] + '. Redirecting to ' + url + '

'; - } - }) - - // Respond - this.statusCode = status; - this.set('Location', url); - this.end(head ? null : body); -}; - -/** - * Render `view` with the given `options` and optional callback `fn`. - * When a callback function is given a response will _not_ be made - * automatically, otherwise a response of _200_ and _text/html_ is given. - * - * Options: - * - * - `status` Response status code (`res.statusCode`) - * - `charset` Set the charset (`res.charset`) - * - * Reserved locals: - * - * - `cache` boolean hinting to the engine it should cache - * - `filename` filename of the view being rendered - * - * @param {String} view - * @param {Object|Function} options or callback function - * @param {Function} fn - * @api public - */ - -res.render = function(view, options, fn){ - var self = this - , options = options || {} - , req = this.req - , app = req.app; - - // support callback function as second arg - if ('function' == typeof options) { - fn = options, options = {}; - } - - function render() { - // merge res.locals - options.locals = self.locals; - - // default callback to respond - fn = fn || function(err, str){ - if (err) return req.next(err); - self.send(str); - }; - - // render - app.render(view, options, fn); - } - - // invoke view callbacks - var callbacks = app.viewCallbacks - , pending = callbacks.length - , len = pending - , done; - - if (len) { - for (var i = 0; i < len; ++i) { - callbacks[i](req, self, function(err){ - if (done) return; - - if (err) { - req.next(err); - done = true; - return; - } - - --pending || render(); - }); - } - } else { - render(); - } -}; \ No newline at end of file diff --git a/node_modules/express/lib/router/index.js b/node_modules/express/lib/router/index.js deleted file mode 100644 index 496cd56..0000000 --- a/node_modules/express/lib/router/index.js +++ /dev/null @@ -1,295 +0,0 @@ -/*! - * Express - Router - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Route = require('./route') - , utils = require('../utils') - , debug = require('debug')('express:router') - , parse = require('url').parse; - -/** - * Expose `Router` constructor. - */ - -exports = module.exports = Router; - -/** - * Expose HTTP methods. - */ - -var methods = exports.methods = require('./methods'); - -/** - * Initialize a new `Router` with the given `options`. - * - * @param {Object} options - * @api private - */ - -function Router(options) { - options = options || {}; - var self = this; - this.map = {}; - this.params = {}; - this._params = []; - this.caseSensitive = options.caseSensitive; - this.strict = options.strict; - - this.middleware = function router(req, res, next){ - self._dispatch(req, res, next); - }; -} - -/** - * Register a param callback `fn` for the given `name`. - * - * @param {String|Function} name - * @param {Function} fn - * @return {Router} for chaining - * @api public - */ - -Router.prototype.param = function(name, fn){ - // param logic - if ('function' == typeof name) { - this._params.push(name); - return; - } - - // apply param functions - var params = this._params - , len = params.length - , ret; - - for (var i = 0; i < len; ++i) { - if (ret = params[i](name, fn)) { - fn = ret; - } - } - - // ensure we end up with a - // middleware function - if ('function' != typeof fn) { - throw new Error('invalid param() call for ' + name + ', got ' + fn); - } - - (this.params[name] = this.params[name] || []).push(fn); - return this; -}; - -/** - * Route dispatcher aka the route "middleware". - * - * @param {IncomingMessage} req - * @param {ServerResponse} res - * @param {Function} next - * @api private - */ - -Router.prototype._dispatch = function(req, res, next){ - var params = this.params - , self = this; - - debug('dispatching %s %s', req.method, req.url); - - // route dispatch - (function pass(i, err){ - var paramCallbacks - , paramIndex = 0 - , paramVal - , route - , keys - , key - , ret; - - // match next route - function nextRoute(err) { - pass(req._route_index + 1, err); - } - - // match route - req.route = route = self.match(req, i); - - // implied OPTIONS - if (!route && 'OPTIONS' == req.method) return self._options(req, res); - - // no route - if (!route) return next(err); - debug('matched %s %s', route.method, route.path); - - // we have a route - // start at param 0 - req.params = route.params; - keys = route.keys; - i = 0; - - // param callbacks - function param(err) { - paramIndex = 0; - key = keys[i++]; - paramVal = key && req.params[key.name]; - paramCallbacks = key && params[key.name]; - - try { - if ('route' == err) { - nextRoute(); - } else if (err) { - i = 0; - callbacks(err); - } else if (paramCallbacks && undefined !== paramVal) { - paramCallback(); - } else if (key) { - param(); - } else { - i = 0; - callbacks(); - } - } catch (err) { - param(err); - } - }; - - param(err); - - // single param callbacks - function paramCallback(err) { - var fn = paramCallbacks[paramIndex++]; - if (err || !fn) return param(err); - fn(req, res, paramCallback, paramVal, key.name); - } - - // invoke route callbacks - function callbacks(err) { - var fn = route.callbacks[i++]; - try { - if ('route' == err) { - nextRoute(); - } else if (err && fn) { - if (fn.length < 4) return callbacks(err); - fn(err, req, res, callbacks); - } else if (fn) { - fn(req, res, callbacks); - } else { - nextRoute(err); - } - } catch (err) { - callbacks(err); - } - } - })(0); -}; - -/** - * Respond to __OPTIONS__ method. - * - * @param {IncomingMessage} req - * @param {ServerResponse} res - * @api private - */ - -Router.prototype._options = function(req, res){ - var path = parse(req.url).pathname - , body = this._optionsFor(path).join(','); - res.set('Allow', body).send(body); -}; - -/** - * Return an array of HTTP verbs or "options" for `path`. - * - * @param {String} path - * @return {Array} - * @api private - */ - -Router.prototype._optionsFor = function(path){ - var self = this; - return methods.filter(function(method){ - var routes = self.map[method]; - if (!routes || 'options' == method) return; - for (var i = 0, len = routes.length; i < len; ++i) { - if (routes[i].match(path)) return true; - } - }).map(function(method){ - return method.toUpperCase(); - }); -}; - -/** - * Attempt to match a route for `req` - * with optional starting index of `i` - * defaulting to 0. - * - * @param {IncomingMessage} req - * @param {Number} i - * @return {Route} - * @api private - */ - -Router.prototype.match = function(req, i, head){ - var method = req.method.toLowerCase() - , url = parse(req.url) - , path = url.pathname - , routes = this.map - , i = i || 0 - , route; - - // HEAD support - // TODO: clean this up - if (!head && 'head' == method) { - // attempt lookup - route = this.match(req, i, true); - if (route) return route; - - // default to GET as res.render() / res.send() - // etc support HEAD - method = 'get'; - } - - // routes for this method - if (routes = routes[method]) { - - // matching routes - for (var len = routes.length; i < len; ++i) { - route = routes[i]; - if (route.match(path)) { - req._route_index = i; - return route; - } - } - } -}; - -/** - * Route `method`, `path`, and one or more callbacks. - * - * @param {String} method - * @param {String} path - * @param {Function} callback... - * @return {Router} for chaining - * @api private - */ - -Router.prototype.route = function(method, path, callbacks){ - var method = method.toLowerCase() - , callbacks = utils.flatten([].slice.call(arguments, 2)); - - // ensure path was given - if (!path) throw new Error('Router#' + method + '() requires a path'); - - // create the route - debug('defined %s %s', method, path); - var route = new Route(method, path, callbacks, { - sensitive: this.caseSensitive - , strict: this.strict - }); - - // add it - (this.map[method] = this.map[method] || []).push(route); - return this; -}; diff --git a/node_modules/express/lib/router/methods.js b/node_modules/express/lib/router/methods.js deleted file mode 100644 index d4c64a0..0000000 --- a/node_modules/express/lib/router/methods.js +++ /dev/null @@ -1,36 +0,0 @@ - -/*! - * Express - router - methods - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * HTTP methods supported by node. - */ - -module.exports = [ - 'get' - , 'post' - , 'put' - , 'head' - , 'delete' - , 'options' - , 'trace' - , 'copy' - , 'lock' - , 'mkcol' - , 'move' - , 'propfind' - , 'proppatch' - , 'unlock' - , 'report' - , 'mkactivity' - , 'checkout' - , 'merge' - , 'm-search' - , 'notify' - , 'subscribe' - , 'unsubscribe' - , 'patch' -]; \ No newline at end of file diff --git a/node_modules/express/lib/router/route.js b/node_modules/express/lib/router/route.js deleted file mode 100644 index 5c1335a..0000000 --- a/node_modules/express/lib/router/route.js +++ /dev/null @@ -1,78 +0,0 @@ - -/*! - * Express - router - Route - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils'); - -/** - * Expose `Route`. - */ - -module.exports = Route; - -/** - * Initialize `Route` with the given HTTP `method`, `path`, - * and an array of `callbacks` and `options`. - * - * Options: - * - * - `sensitive` enable case-sensitive routes - * - `strict` enable strict matching for trailing slashes - * - * @param {String} method - * @param {String} path - * @param {Array} callbacks - * @param {Object} options. - * @api private - */ - -function Route(method, path, callbacks, options) { - options = options || {}; - this.path = path; - this.method = method; - this.callbacks = callbacks; - this.regexp = utils.pathRegexp(path - , this.keys = [] - , options.sensitive - , options.strict); -} - -/** - * Check if this route matches `path`, if so - * populate `.params`. - * - * @param {String} path - * @return {Boolean} - * @api private - */ - -Route.prototype.match = function(path){ - var keys = this.keys - , params = this.params = [] - , m = this.regexp.exec(path); - - if (!m) return false; - - for (var i = 1, len = m.length; i < len; ++i) { - var key = keys[i - 1]; - - var val = 'string' == typeof m[i] - ? decodeURIComponent(m[i]) - : m[i]; - - if (key) { - params[key.name] = val; - } else { - params.push(val); - } - } - - return true; -}; diff --git a/node_modules/express/lib/utils.js b/node_modules/express/lib/utils.js deleted file mode 100644 index 1f8164a..0000000 --- a/node_modules/express/lib/utils.js +++ /dev/null @@ -1,254 +0,0 @@ - -/*! - * Express - utils - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var mime = require('mime'); - -/** - * Check if `path` looks absolute. - * - * @param {String} path - * @return {Boolean} - * @api private - */ - -exports.isAbsolute = function(path){ - if ('/' == path[0]) return true; - if (':' == path[1] && '\\' == path[2]) return true; -}; - -/** - * Flatten the given `arr`. - * - * @param {Array} arr - * @return {Array} - * @api private - */ - -exports.flatten = function(arr, ret){ - var ret = ret || [] - , len = arr.length; - for (var i = 0; i < len; ++i) { - if (Array.isArray(arr[i])) { - exports.flatten(arr[i], ret); - } else { - ret.push(arr[i]); - } - } - return ret; -}; - -/** - * Normalize the given `type`, for example "html" becomes "text/html". - * - * @param {String} type - * @return {String} - * @api private - */ - -exports.normalizeType = function(type){ - return ~type.indexOf('/') ? type : mime.lookup(type); -}; - -/** - * Normalize `types`, for example "html" becomes "text/html". - * - * @param {Array} types - * @return {Array} - * @api private - */ - -exports.normalizeTypes = function(types){ - var ret = []; - - for (var i = 0; i < types.length; ++i) { - ret.push(~types[i].indexOf('/') - ? types[i] - : mime.lookup(types[i])); - } - - return ret; -}; - -/** - * Return the acceptable type in `types`, if any. - * - * @param {Array} types - * @param {String} str - * @return {String} - * @api private - */ - -exports.acceptsArray = function(types, str){ - // accept anything when Accept is not present - if (!str) return types[0]; - - // parse - var accepted = exports.parseAccept(str) - , normalized = exports.normalizeTypes(types) - , len = accepted.length; - - for (var i = 0; i < len; ++i) { - for (var j = 0, jlen = types.length; j < jlen; ++j) { - if (exports.accept(normalized[j].split('/'), accepted[i])) { - return types[j]; - } - } - } -}; - -/** - * Check if `type(s)` are acceptable based on - * the given `str`. - * - * @param {String|Array} type(s) - * @param {String} str - * @return {Boolean|String} - * @api private - */ - -exports.accepts = function(type, str){ - if ('string' == typeof type) type = type.split(/ *, */); - return exports.acceptsArray(type, str); -}; - -/** - * Check if `type` array is acceptable for `other`. - * - * @param {Array} type - * @param {Object} other - * @return {Boolean} - * @api private - */ - -exports.accept = function(type, other){ - return (type[0] == other.type || '*' == other.type) - && (type[1] == other.subtype || '*' == other.subtype); -}; - -/** - * Parse accept `str`, returning - * an array objects containing - * `.type` and `.subtype` along - * with the values provided by - * `parseQuality()`. - * - * @param {Type} name - * @return {Type} - * @api private - */ - -exports.parseAccept = function(str){ - return exports - .parseQuality(str) - .map(function(obj){ - var parts = obj.value.split('/'); - obj.type = parts[0]; - obj.subtype = parts[1]; - return obj; - }); -}; - -/** - * Parse quality `str`, returning an - * array of objects with `.value` and - * `.quality`. - * - * @param {Type} name - * @return {Type} - * @api private - */ - -exports.parseQuality = function(str){ - return str - .split(/ *, */) - .map(quality) - .filter(function(obj){ - return obj.quality; - }) - .sort(function(a, b){ - return b.quality - a.quality; - }); -}; - -/** - * Parse quality `str` returning an - * object with `.value` and `.quality`. - * - * @param {String} str - * @return {Object} - * @api private - */ - -function quality(str) { - var parts = str.split(/ *; */) - , val = parts[0]; - - var q = parts[1] - ? parseFloat(parts[1].split(/ *= */)[1]) - : 1; - - return { value: val, quality: q }; -} - -/** - * Escape special characters in the given string of html. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function(html) { - return String(html) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(//g, '>'); -}; - -/** - * Normalize the given path string, - * returning a regular expression. - * - * An empty array should be passed, - * which will contain the placeholder - * key names. For example "/user/:id" will - * then contain ["id"]. - * - * @param {String|RegExp|Array} path - * @param {Array} keys - * @param {Boolean} sensitive - * @param {Boolean} strict - * @return {RegExp} - * @api private - */ - -exports.pathRegexp = function(path, keys, sensitive, strict) { - if (path instanceof RegExp) return path; - if (path instanceof Array) - path = '(' + path.join('|') + ')'; - path = path - .concat(strict ? '' : '/?') - .replace(/\/\(/g, '(?:/') - .replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, function(_, slash, format, key, capture, optional){ - keys.push({ name: key, optional: !! optional }); - slash = slash || ''; - return '' - + (optional ? '' : slash) - + '(?:' - + (optional ? slash : '') - + (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')' - + (optional || ''); - }) - .replace(/([\/.])/g, '\\$1') - .replace(/\*/g, '(.*)'); - return new RegExp('^' + path + '$', sensitive ? '' : 'i'); -} \ No newline at end of file diff --git a/node_modules/express/lib/view.js b/node_modules/express/lib/view.js deleted file mode 100644 index 3e2a964..0000000 --- a/node_modules/express/lib/view.js +++ /dev/null @@ -1,81 +0,0 @@ -/*! - * Express - View - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var path = require('path') - , utils = require('./utils') - , dirname = path.dirname - , basename = path.basename - , extname = path.extname - , exists = path.existsSync - , join = path.join; - -/** - * Expose `View`. - */ - -module.exports = View; - -/** - * Initialize a new `View` with the given `name`. - * - * Options: - * - * - `defaultEngine` the default template engine name - * - `engines` template engine require() cache - * - `root` root path for view lookup - * - * @param {String} name - * @param {Object} options - * @api private - */ - -function View(name, options) { - options = options || {}; - this.name = name; - this.root = options.root; - var engines = options.engines; - this.defaultEngine = options.defaultEngine; - var ext = this.ext = extname(name); - if (!ext) name += (ext = this.ext = '.' + this.defaultEngine); - this.engine = engines[ext] || (engines[ext] = require(ext.slice(1)).__express); - this.path = this.lookup(name); -} - -/** - * Lookup view by the given `path` - * - * @param {String} path - * @return {String} - * @api private - */ - -View.prototype.lookup = function(path){ - var ext = this.ext; - - // . - if (!utils.isAbsolute(path)) path = join(this.root, path); - if (exists(path)) return path; - - // /index. - path = join(dirname(path), basename(path, ext), 'index' + ext); - if (exists(path)) return path; -}; - -/** - * Render with the given `options` and callback `fn(err, str)`. - * - * @param {Object} options - * @param {Function} fn - * @api private - */ - -View.prototype.render = function(options, fn){ - this.engine(this.path, options, fn); -}; diff --git a/node_modules/express/node_modules/commander/.npmignore b/node_modules/express/node_modules/commander/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/express/node_modules/commander/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/express/node_modules/commander/.travis.yml b/node_modules/express/node_modules/commander/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/node_modules/express/node_modules/commander/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/node_modules/express/node_modules/commander/History.md b/node_modules/express/node_modules/commander/History.md deleted file mode 100644 index 66c6894..0000000 --- a/node_modules/express/node_modules/commander/History.md +++ /dev/null @@ -1,99 +0,0 @@ - -0.5.2 / 2012-01-17 -================== - - * Added support for 0.7.x - -0.5.1 / 2011-12-20 -================== - - * Fixed `password()` for recent nodes. Closes #36 - -0.5.0 / 2011-12-04 -================== - - * Added sub-command option support [itay] - -0.4.3 / 2011-12-04 -================== - - * Fixed custom help ordering. Closes #32 - -0.4.2 / 2011-11-24 -================== - - * Added travis support - * Fixed: line-buffered input automatically trimmed. Closes #31 - -0.4.1 / 2011-11-18 -================== - - * Removed listening for "close" on --help - -0.4.0 / 2011-11-15 -================== - - * Added support for `--`. Closes #24 - -0.3.3 / 2011-11-14 -================== - - * Fixed: wait for close event when writing help info [Jerry Hamlet] - -0.3.2 / 2011-11-01 -================== - - * Fixed long flag definitions with values [felixge] - -0.3.1 / 2011-10-31 -================== - - * Changed `--version` short flag to `-V` from `-v` - * Changed `.version()` so it's configurable [felixge] - -0.3.0 / 2011-10-31 -================== - - * Added support for long flags only. Closes #18 - -0.2.1 / 2011-10-24 -================== - - * "node": ">= 0.4.x < 0.7.0". Closes #20 - -0.2.0 / 2011-09-26 -================== - - * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] - -0.1.0 / 2011-08-24 -================== - - * Added support for custom `--help` output - -0.0.5 / 2011-08-18 -================== - - * Changed: when the user enters nothing prompt for password again - * Fixed issue with passwords beginning with numbers [NuckChorris] - -0.0.4 / 2011-08-15 -================== - - * Fixed `Commander#args` - -0.0.3 / 2011-08-15 -================== - - * Added default option value support - -0.0.2 / 2011-08-15 -================== - - * Added mask support to `Command#password(str[, mask], fn)` - * Added `Command#password(str, fn)` - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/express/node_modules/commander/Makefile b/node_modules/express/node_modules/commander/Makefile deleted file mode 100644 index 0074625..0000000 --- a/node_modules/express/node_modules/commander/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -TESTS = $(shell find test/test.*.js) - -test: - @./test/run $(TESTS) - -.PHONY: test \ No newline at end of file diff --git a/node_modules/express/node_modules/commander/Readme.md b/node_modules/express/node_modules/commander/Readme.md deleted file mode 100644 index 2efbe7a..0000000 --- a/node_modules/express/node_modules/commander/Readme.md +++ /dev/null @@ -1,263 +0,0 @@ - -# Commander.js - - The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander). - - [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js) - -## Installation - - $ npm install commander - -## Option parsing - - Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('commander'); - -program - .version('0.0.1') - .option('-p, --peppers', 'Add peppers') - .option('-P, --pineapple', 'Add pineapple') - .option('-b, --bbq', 'Add bbq sauce') - .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') - .parse(process.argv); - -console.log('you ordered a pizza with:'); -if (program.peppers) console.log(' - peppers'); -if (program.pineapple) console.log(' - pineappe'); -if (program.bbq) console.log(' - bbq'); -console.log(' - %s cheese', program.cheese); -``` - - Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. - -## Automated --help - - The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: - -``` - $ ./examples/pizza --help - - Usage: pizza [options] - - Options: - - -v, --version output the version number - -p, --peppers Add peppers - -P, --pineapple Add pineappe - -b, --bbq Add bbq sauce - -c, --cheese Add the specified type of cheese [marble] - -h, --help output usage information - -``` - -## Coercion - -```js -function range(val) { - return val.split('..').map(Number); -} - -function list(val) { - return val.split(','); -} - -program - .version('0.0.1') - .usage('[options] ') - .option('-i, --integer ', 'An integer argument', parseInt) - .option('-f, --float ', 'A float argument', parseFloat) - .option('-r, --range ..', 'A range', range) - .option('-l, --list ', 'A list', list) - .option('-o, --optional [value]', 'An optional value') - .parse(process.argv); - -console.log(' int: %j', program.integer); -console.log(' float: %j', program.float); -console.log(' optional: %j', program.optional); -program.range = program.range || []; -console.log(' range: %j..%j', program.range[0], program.range[1]); -console.log(' list: %j', program.list); -console.log(' args: %j', program.args); -``` - -## Custom help - - You can display arbitrary `-h, --help` information - by listening for "--help". Commander will automatically - exit once you are done so that the remainder of your program - does not execute causing undesired behaviours, for example - in the following executable "stuff" will not output when - `--help` is used. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('../'); - -function list(val) { - return val.split(',').map(Number); -} - -program - .version('0.0.1') - .option('-f, --foo', 'enable some foo') - .option('-b, --bar', 'enable some bar') - .option('-B, --baz', 'enable some baz'); - -// must be before .parse() since -// node's emit() is immediate - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' $ custom-help --help'); - console.log(' $ custom-help -h'); - console.log(''); -}); - -program.parse(process.argv); - -console.log('stuff'); -``` - -yielding the following help output: - -``` - -Usage: custom-help [options] - -Options: - - -h, --help output usage information - -v, --version output the version number - -f, --foo enable some foo - -b, --bar enable some bar - -B, --baz enable some baz - -Examples: - - $ custom-help --help - $ custom-help -h - -``` - -## .prompt(msg, fn) - - Single-line prompt: - -```js -program.prompt('name: ', function(name){ - console.log('hi %s', name); -}); -``` - - Multi-line prompt: - -```js -program.prompt('description:', function(name){ - console.log('hi %s', name); -}); -``` - - Coercion: - -```js -program.prompt('Age: ', Number, function(age){ - console.log('age: %j', age); -}); -``` - -```js -program.prompt('Birthdate: ', Date, function(date){ - console.log('date: %s', date); -}); -``` - -## .password(msg[, mask], fn) - -Prompt for password without echoing: - -```js -program.password('Password: ', function(pass){ - console.log('got "%s"', pass); - process.stdin.destroy(); -}); -``` - -Prompt for password with mask char "*": - -```js -program.password('Password: ', '*', function(pass){ - console.log('got "%s"', pass); - process.stdin.destroy(); -}); -``` - -## .confirm(msg, fn) - - Confirm with the given `msg`: - -```js -program.confirm('continue? ', function(ok){ - console.log(' got %j', ok); -}); -``` - -## .choose(list, fn) - - Let the user choose from a `list`: - -```js -var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; - -console.log('Choose the coolest pet:'); -program.choose(list, function(i){ - console.log('you chose %d "%s"', i, list[i]); -}); -``` - -## Links - - - [API documentation](http://visionmedia.github.com/commander.js/) - - [ascii tables](https://github.com/LearnBoost/cli-table) - - [progress bars](https://github.com/visionmedia/node-progress) - - [more progress bars](https://github.com/substack/node-multimeter) - - [examples](https://github.com/visionmedia/commander.js/tree/master/examples) - -## License - -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca> - -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/express/node_modules/commander/index.js b/node_modules/express/node_modules/commander/index.js deleted file mode 100644 index 06ec1e4..0000000 --- a/node_modules/express/node_modules/commander/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/commander'); \ No newline at end of file diff --git a/node_modules/express/node_modules/commander/lib/commander.js b/node_modules/express/node_modules/commander/lib/commander.js deleted file mode 100644 index b9cbd5d..0000000 --- a/node_modules/express/node_modules/commander/lib/commander.js +++ /dev/null @@ -1,992 +0,0 @@ - -/*! - * commander - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , path = require('path') - , tty = require('tty') - , basename = path.basename; - -/** - * Expose the root command. - */ - -exports = module.exports = new Command; - -/** - * Expose `Command`. - */ - -exports.Command = Command; - -/** - * Expose `Option`. - */ - -exports.Option = Option; - -/** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {String} flags - * @param {String} description - * @api public - */ - -function Option(flags, description) { - this.flags = flags; - this.required = ~flags.indexOf('<'); - this.optional = ~flags.indexOf('['); - this.bool = !~flags.indexOf('-no-'); - flags = flags.split(/[ ,|]+/); - if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); - this.long = flags.shift(); - this.description = description; -} - -/** - * Return option name. - * - * @return {String} - * @api private - */ - -Option.prototype.name = function(){ - return this.long - .replace('--', '') - .replace('no-', ''); -}; - -/** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - -Option.prototype.is = function(arg){ - return arg == this.short - || arg == this.long; -}; - -/** - * Initialize a new `Command`. - * - * @param {String} name - * @api public - */ - -function Command(name) { - this.commands = []; - this.options = []; - this.args = []; - this.name = name; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Command.prototype.__proto__ = EventEmitter.prototype; - -/** - * Add command `name`. - * - * The `.action()` callback is invoked when the - * command `name` is specified via __ARGV__, - * and the remaining arguments are applied to the - * function for access. - * - * When the `name` is "*" an un-matched command - * will be passed as the first arg, followed by - * the rest of __ARGV__ remaining. - * - * Examples: - * - * program - * .version('0.0.1') - * .option('-C, --chdir ', 'change the working directory') - * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - * .option('-T, --no-tests', 'ignore test hook') - * - * program - * .command('setup') - * .description('run remote setup commands') - * .action(function(){ - * console.log('setup'); - * }); - * - * program - * .command('exec ') - * .description('run the given remote command') - * .action(function(cmd){ - * console.log('exec "%s"', cmd); - * }); - * - * program - * .command('*') - * .description('deploy the given env') - * .action(function(env){ - * console.log('deploying "%s"', env); - * }); - * - * program.parse(process.argv); - * - * @param {String} name - * @return {Command} the new command - * @api public - */ - -Command.prototype.command = function(name){ - var args = name.split(/ +/); - var cmd = new Command(args.shift()); - this.commands.push(cmd); - cmd.parseExpectedArgs(args); - cmd.parent = this; - return cmd; -}; - -/** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parseExpectedArgs = function(args){ - if (!args.length) return; - var self = this; - args.forEach(function(arg){ - switch (arg[0]) { - case '<': - self.args.push({ required: true, name: arg.slice(1, -1) }); - break; - case '[': - self.args.push({ required: false, name: arg.slice(1, -1) }); - break; - } - }); - return this; -}; - -/** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function(){ - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} for chaining - * @api public - */ - -Command.prototype.action = function(fn){ - var self = this; - this.parent.on(this.name, function(args, unknown){ - // Parse any so-far unknown options - unknown = unknown || []; - var parsed = self.parseOptions(unknown); - - // Output help if necessary - outputHelpIfNecessary(self, parsed.unknown); - - // If there are still any unknown options, then we simply - // die, unless someone asked for help, in which case we give it - // to them, and then we die. - if (parsed.unknown.length > 0) { - self.unknownOption(parsed.unknown[0]); - } - - self.args.forEach(function(arg, i){ - if (arg.required && null == args[i]) { - self.missingArgument(arg.name); - } - }); - - // Always append ourselves to the end of the arguments, - // to make sure we match the number of arguments the user - // expects - if (self.args.length) { - args[self.args.length] = self; - } else { - args.push(self); - } - - fn.apply(this, args); - }); - return this; -}; - -/** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to false - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => true - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {String} flags - * @param {String} description - * @param {Function|Mixed} fn or default - * @param {Mixed} defaultValue - * @return {Command} for chaining - * @api public - */ - -Command.prototype.option = function(flags, description, fn, defaultValue){ - var self = this - , option = new Option(flags, description) - , oname = option.name() - , name = camelcase(oname); - - // default as 3rd arg - if ('function' != typeof fn) defaultValue = fn, fn = null; - - // preassign default value only for --no-*, [optional], or - if (false == option.bool || option.optional || option.required) { - // when --no-* we make sure default is true - if (false == option.bool) defaultValue = true; - // preassign only if we have a default - if (undefined !== defaultValue) self[name] = defaultValue; - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, function(val){ - // coercion - if (null != val && fn) val = fn(val); - - // unassigned or bool - if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { - // if no value, bool true, and we have a default, then use it! - if (null == val) { - self[name] = option.bool - ? defaultValue || true - : false; - } else { - self[name] = val; - } - } else if (null !== val) { - // reassign - self[name] = val; - } - }); - - return this; -}; - -/** - * Parse `argv`, settings options and invoking commands when defined. - * - * @param {Array} argv - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parse = function(argv){ - // store raw args - this.rawArgs = argv; - - // guess name - if (!this.name) this.name = basename(argv[1]); - - // process argv - var parsed = this.parseOptions(this.normalize(argv.slice(2))); - this.args = parsed.args; - return this.parseArgs(this.args, parsed.unknown); -}; - -/** - * Normalize `args`, splitting joined short flags. For example - * the arg "-abc" is equivalent to "-a -b -c". - * - * @param {Array} args - * @return {Array} - * @api private - */ - -Command.prototype.normalize = function(args){ - var ret = [] - , arg; - - for (var i = 0, len = args.length; i < len; ++i) { - arg = args[i]; - if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { - arg.slice(1).split('').forEach(function(c){ - ret.push('-' + c); - }); - } else { - ret.push(arg); - } - } - - return ret; -}; - -/** - * Parse command `args`. - * - * When listener(s) are available those - * callbacks are invoked, otherwise the "*" - * event is emitted and those actions are invoked. - * - * @param {Array} args - * @return {Command} for chaining - * @api private - */ - -Command.prototype.parseArgs = function(args, unknown){ - var cmds = this.commands - , len = cmds.length - , name; - - if (args.length) { - name = args[0]; - if (this.listeners(name).length) { - this.emit(args.shift(), args, unknown); - } else { - this.emit('*', args); - } - } else { - outputHelpIfNecessary(this, unknown); - - // If there were no args and we have unknown options, - // then they are extraneous and we need to error. - if (unknown.length > 0) { - this.unknownOption(unknown[0]); - } - } - - return this; -}; - -/** - * Return an option matching `arg` if any. - * - * @param {String} arg - * @return {Option} - * @api private - */ - -Command.prototype.optionFor = function(arg){ - for (var i = 0, len = this.options.length; i < len; ++i) { - if (this.options[i].is(arg)) { - return this.options[i]; - } - } -}; - -/** - * Parse options from `argv` returning `argv` - * void of these options. - * - * @param {Array} argv - * @return {Array} - * @api public - */ - -Command.prototype.parseOptions = function(argv){ - var args = [] - , len = argv.length - , literal - , option - , arg; - - var unknownOptions = []; - - // parse options - for (var i = 0; i < len; ++i) { - arg = argv[i]; - - // literal args after -- - if ('--' == arg) { - literal = true; - continue; - } - - if (literal) { - args.push(arg); - continue; - } - - // find matching Option - option = this.optionFor(arg); - - // option is defined - if (option) { - // requires arg - if (option.required) { - arg = argv[++i]; - if (null == arg) return this.optionMissingArgument(option); - if ('-' == arg[0]) return this.optionMissingArgument(option, arg); - this.emit(option.name(), arg); - // optional arg - } else if (option.optional) { - arg = argv[i+1]; - if (null == arg || '-' == arg[0]) { - arg = null; - } else { - ++i; - } - this.emit(option.name(), arg); - // bool - } else { - this.emit(option.name()); - } - continue; - } - - // looks like an option - if (arg.length > 1 && '-' == arg[0]) { - unknownOptions.push(arg); - - // If the next argument looks like it might be - // an argument for this option, we pass it on. - // If it isn't, then it'll simply be ignored - if (argv[i+1] && '-' != argv[i+1][0]) { - unknownOptions.push(argv[++i]); - } - continue; - } - - // arg - args.push(arg); - } - - return { args: args, unknown: unknownOptions }; -}; - -/** - * Argument `name` is missing. - * - * @param {String} name - * @api private - */ - -Command.prototype.missingArgument = function(name){ - console.error(); - console.error(" error: missing required argument `%s'", name); - console.error(); - process.exit(1); -}; - -/** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {String} option - * @param {String} flag - * @api private - */ - -Command.prototype.optionMissingArgument = function(option, flag){ - console.error(); - if (flag) { - console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); - } else { - console.error(" error: option `%s' argument missing", option.flags); - } - console.error(); - process.exit(1); -}; - -/** - * Unknown option `flag`. - * - * @param {String} flag - * @api private - */ - -Command.prototype.unknownOption = function(flag){ - console.error(); - console.error(" error: unknown option `%s'", flag); - console.error(); - process.exit(1); -}; - -/** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * @param {String} str - * @param {String} flags - * @return {Command} for chaining - * @api public - */ - -Command.prototype.version = function(str, flags){ - if (0 == arguments.length) return this._version; - this._version = str; - flags = flags || '-V, --version'; - this.option(flags, 'output the version number'); - this.on('version', function(){ - console.log(str); - process.exit(0); - }); - return this; -}; - -/** - * Set the description `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.description = function(str){ - if (0 == arguments.length) return this._description; - this._description = str; - return this; -}; - -/** - * Set / get the command usage `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.usage = function(str){ - var args = this.args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }); - - var usage = '[options' - + (this.commands.length ? '] [command' : '') - + ']' - + (this.args.length ? ' ' + args : ''); - if (0 == arguments.length) return this._usage || usage; - this._usage = str; - - return this; -}; - -/** - * Return the largest option length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestOptionLength = function(){ - return this.options.reduce(function(max, option){ - return Math.max(max, option.flags.length); - }, 0); -}; - -/** - * Return help for options. - * - * @return {String} - * @api private - */ - -Command.prototype.optionHelp = function(){ - var width = this.largestOptionLength(); - - // Prepend the help information - return [pad('-h, --help', width) + ' ' + 'output usage information'] - .concat(this.options.map(function(option){ - return pad(option.flags, width) - + ' ' + option.description; - })) - .join('\n'); -}; - -/** - * Return command help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.commandHelp = function(){ - if (!this.commands.length) return ''; - return [ - '' - , ' Commands:' - , '' - , this.commands.map(function(cmd){ - var args = cmd.args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }).join(' '); - - return cmd.name - + (cmd.options.length - ? ' [options]' - : '') + ' ' + args - + (cmd.description() - ? '\n' + cmd.description() - : ''); - }).join('\n\n').replace(/^/gm, ' ') - , '' - ].join('\n'); -}; - -/** - * Return program help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.helpInformation = function(){ - return [ - '' - , ' Usage: ' + this.name + ' ' + this.usage() - , '' + this.commandHelp() - , ' Options:' - , '' - , '' + this.optionHelp().replace(/^/gm, ' ') - , '' - , '' - ].join('\n'); -}; - -/** - * Prompt for a `Number`. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptForNumber = function(str, fn){ - var self = this; - this.promptSingleLine(str, function parseNumber(val){ - val = Number(val); - if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber); - fn(val); - }); -}; - -/** - * Prompt for a `Date`. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptForDate = function(str, fn){ - var self = this; - this.promptSingleLine(str, function parseDate(val){ - val = new Date(val); - if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate); - fn(val); - }); -}; - -/** - * Single-line prompt. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptSingleLine = function(str, fn){ - if ('function' == typeof arguments[2]) { - return this['promptFor' + (fn.name || fn)](str, arguments[2]); - } - - process.stdout.write(str); - process.stdin.setEncoding('utf8'); - process.stdin.once('data', function(val){ - fn(val.trim()); - }).resume(); -}; - -/** - * Multi-line prompt. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptMultiLine = function(str, fn){ - var buf = []; - console.log(str); - process.stdin.setEncoding('utf8'); - process.stdin.on('data', function(val){ - if ('\n' == val || '\r\n' == val) { - process.stdin.removeAllListeners('data'); - fn(buf.join('\n')); - } else { - buf.push(val.trimRight()); - } - }).resume(); -}; - -/** - * Prompt `str` and callback `fn(val)` - * - * Commander supports single-line and multi-line prompts. - * To issue a single-line prompt simply add white-space - * to the end of `str`, something like "name: ", whereas - * for a multi-line prompt omit this "description:". - * - * - * Examples: - * - * program.prompt('Username: ', function(name){ - * console.log('hi %s', name); - * }); - * - * program.prompt('Description:', function(desc){ - * console.log('description was "%s"', desc.trim()); - * }); - * - * @param {String} str - * @param {Function} fn - * @api public - */ - -Command.prototype.prompt = function(str, fn){ - if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments); - this.promptMultiLine(str, fn); -}; - -/** - * Prompt for password with `str`, `mask` char and callback `fn(val)`. - * - * The mask string defaults to '', aka no output is - * written while typing, you may want to use "*" etc. - * - * Examples: - * - * program.password('Password: ', function(pass){ - * console.log('got "%s"', pass); - * process.stdin.destroy(); - * }); - * - * program.password('Password: ', '*', function(pass){ - * console.log('got "%s"', pass); - * process.stdin.destroy(); - * }); - * - * @param {String} str - * @param {String} mask - * @param {Function} fn - * @api public - */ - -Command.prototype.password = function(str, mask, fn){ - var self = this - , buf = ''; - - // default mask - if ('function' == typeof mask) { - fn = mask; - mask = ''; - } - - process.stdin.resume(); - tty.setRawMode(true); - process.stdout.write(str); - - // keypress - process.stdin.on('keypress', function(c, key){ - if (key && 'enter' == key.name) { - console.log(); - process.stdin.removeAllListeners('keypress'); - tty.setRawMode(false); - if (!buf.trim().length) return self.password(str, mask, fn); - fn(buf); - return; - } - - if (key && key.ctrl && 'c' == key.name) { - console.log('%s', buf); - process.exit(); - } - - process.stdout.write(mask); - buf += c; - }).resume(); -}; - -/** - * Confirmation prompt with `str` and callback `fn(bool)` - * - * Examples: - * - * program.confirm('continue? ', function(ok){ - * console.log(' got %j', ok); - * process.stdin.destroy(); - * }); - * - * @param {String} str - * @param {Function} fn - * @api public - */ - - -Command.prototype.confirm = function(str, fn){ - var self = this; - this.prompt(str, function(ok){ - if (!ok.trim()) { - return self.confirm(str, fn); - } - fn(parseBool(ok)); - }); -}; - -/** - * Choice prompt with `list` of items and callback `fn(index, item)` - * - * Examples: - * - * var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; - * - * console.log('Choose the coolest pet:'); - * program.choose(list, function(i){ - * console.log('you chose %d "%s"', i, list[i]); - * process.stdin.destroy(); - * }); - * - * @param {Array} list - * @param {Function} fn - * @api public - */ - -Command.prototype.choose = function(list, fn){ - var self = this; - - list.forEach(function(item, i){ - console.log(' %d) %s', i + 1, item); - }); - - function again() { - self.prompt(' : ', function(val){ - val = parseInt(val, 10) - 1; - if (null == list[val]) { - again(); - } else { - fn(val, list[val]); - } - }); - } - - again(); -}; - -/** - * Camel-case the given `flag` - * - * @param {String} flag - * @return {String} - * @api private - */ - -function camelcase(flag) { - return flag.split('-').reduce(function(str, word){ - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -/** - * Parse a boolean `str`. - * - * @param {String} str - * @return {Boolean} - * @api private - */ - -function parseBool(str) { - return /^y|yes|ok|true$/i.test(str); -} - -/** - * Pad `str` to `width`. - * - * @param {String} str - * @param {Number} width - * @return {String} - * @api private - */ - -function pad(str, width) { - var len = Math.max(0, width - str.length); - return str + Array(len + 1).join(' '); -} - -/** - * Output help information if necessary - * - * @param {Command} command to output help for - * @param {Array} array of options to search for -h or --help - * @api private - */ - -function outputHelpIfNecessary(cmd, options) { - options = options || []; - for (var i = 0; i < options.length; i++) { - if (options[i] == '--help' || options[i] == '-h') { - process.stdout.write(cmd.helpInformation()); - cmd.emit('--help'); - process.exit(0); - } - } -} diff --git a/node_modules/express/node_modules/commander/package.json b/node_modules/express/node_modules/commander/package.json deleted file mode 100644 index d50d124..0000000 --- a/node_modules/express/node_modules/commander/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "commander", - "version": "0.5.2", - "description": "the complete solution for node.js command-line programs", - "keywords": [ - "command", - "option", - "parser", - "prompt", - "stdin" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/commander.js.git" - }, - "dependencies": {}, - "devDependencies": { - "should": ">= 0.0.1" - }, - "scripts": { - "test": "make test" - }, - "main": "index", - "engines": { - "node": ">= 0.4.x < 0.8.0" - }, - "_id": "commander@0.5.2", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "commander@0.5.2" -} diff --git a/node_modules/express/node_modules/connect/.npmignore b/node_modules/express/node_modules/connect/.npmignore deleted file mode 100644 index 9046dde..0000000 --- a/node_modules/express/node_modules/connect/.npmignore +++ /dev/null @@ -1,12 +0,0 @@ -*.markdown -*.md -.git* -Makefile -benchmarks/ -docs/ -examples/ -install.sh -support/ -test/ -.DS_Store -coverage.html diff --git a/node_modules/express/node_modules/connect/LICENSE b/node_modules/express/node_modules/connect/LICENSE deleted file mode 100644 index 0c5d22d..0000000 --- a/node_modules/express/node_modules/connect/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2010 Sencha Inc. -Copyright (c) 2011 LearnBoost -Copyright (c) 2011 TJ Holowaychuk - -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/express/node_modules/connect/index.js b/node_modules/express/node_modules/connect/index.js deleted file mode 100644 index 23240ee..0000000 --- a/node_modules/express/node_modules/connect/index.js +++ /dev/null @@ -1,4 +0,0 @@ - -module.exports = process.env.CONNECT_COV - ? require('./lib-cov/connect') - : require('./lib/connect'); \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/lib/cache.js b/node_modules/express/node_modules/connect/lib/cache.js deleted file mode 100644 index 052fcdb..0000000 --- a/node_modules/express/node_modules/connect/lib/cache.js +++ /dev/null @@ -1,81 +0,0 @@ - -/*! - * Connect - Cache - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Expose `Cache`. - */ - -module.exports = Cache; - -/** - * LRU cache store. - * - * @param {Number} limit - * @api private - */ - -function Cache(limit) { - this.store = {}; - this.keys = []; - this.limit = limit; -} - -/** - * Touch `key`, promoting the object. - * - * @param {String} key - * @param {Number} i - * @api private - */ - -Cache.prototype.touch = function(key, i){ - this.keys.splice(i,1); - this.keys.push(key); -}; - -/** - * Remove `key`. - * - * @param {String} key - * @api private - */ - -Cache.prototype.remove = function(key){ - delete this.store[key]; -}; - -/** - * Get the object stored for `key`. - * - * @param {String} key - * @return {Array} - * @api private - */ - -Cache.prototype.get = function(key){ - return this.store[key]; -}; - -/** - * Add a cache `key`. - * - * @param {String} key - * @return {Array} - * @api private - */ - -Cache.prototype.add = function(key){ - // initialize store - var len = this.keys.push(key); - - // limit reached, invalidate LRU - if (len > this.limit) this.remove(this.keys.shift()); - - var arr = this.store[key] = []; - arr.createdAt = new Date; - return arr; -}; diff --git a/node_modules/express/node_modules/connect/lib/connect.js b/node_modules/express/node_modules/connect/lib/connect.js deleted file mode 100644 index cbf1820..0000000 --- a/node_modules/express/node_modules/connect/lib/connect.js +++ /dev/null @@ -1,84 +0,0 @@ - -/*! - * Connect - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , proto = require('./proto') - , utils = require('./utils') - , path = require('path') - , basename = path.basename - , fs = require('fs'); - -// node patches - -require('./patch'); - -// expose createServer() as the module - -exports = module.exports = createServer; - -/** - * Framework version. - */ - -exports.version = '2.1.2'; - -/** - * Expose the prototype. - */ - -exports.proto = proto; - -/** - * Auto-load middleware getters. - */ - -exports.middleware = {}; - -/** - * Expose utilities. - */ - -exports.utils = utils; - -/** - * Create a new connect server. - * - * @return {Function} - * @api public - */ - -function createServer() { - function app(req, res){ app.handle(req, res); } - utils.merge(app, proto); - utils.merge(app, EventEmitter.prototype); - app.route = '/'; - app.stack = [].slice.apply(arguments); - return app; -}; - -/** - * Support old `.createServer()` method. - */ - -createServer.createServer = createServer; - -/** - * Auto-load bundled middleware with getters. - */ - -fs.readdirSync(__dirname + '/middleware').forEach(function(filename){ - if (!/\.js$/.test(filename)) return; - var name = basename(filename, '.js'); - function load(){ return require('./middleware/' + name); } - exports.middleware.__defineGetter__(name, load); - exports.__defineGetter__(name, load); -}); diff --git a/node_modules/express/node_modules/connect/lib/index.js b/node_modules/express/node_modules/connect/lib/index.js deleted file mode 100644 index 76ed8a1..0000000 --- a/node_modules/express/node_modules/connect/lib/index.js +++ /dev/null @@ -1,55 +0,0 @@ - -/** - * Connect is a middleware framework for node, - * shipping with over 18 bundled middleware and a rich selection of - * 3rd-party middleware. - * - * var app = connect() - * .use(connect.logger('dev')) - * .use(connect.static('public')) - * .use(function(req, res){ - * res.end('hello world\n'); - * }) - * .listen(3000); - * - * Installation: - * - * $ npm install connect - * - * Middleware: - * - * - [logger](logger.html) request logger with custom format support - * - [csrf](csrf.html) Cross-site request forgery protection - * - [compress](compress.html) Gzip compression middleware - * - [basicAuth](basicAuth.html) basic http authentication - * - [bodyParser](bodyParser.html) extensible request body parser - * - [json](json.html) application/json parser - * - [urlencoded](urlencoded.html) application/x-www-form-urlencoded parser - * - [multipart](multipart.html) multipart/form-data parser - * - [cookieParser](cookieParser.html) cookie parser - * - [session](session.html) session management support with bundled MemoryStore - * - [cookieSession](cookieSession.html) cookie-based session support - * - [methodOverride](methodOverride.html) faux HTTP method support - * - [responseTime](responseTime.html) calculates response-time and exposes via X-Response-Time - * - [staticCache](staticCache.html) memory cache layer for the static() middleware - * - [static](static.html) streaming static file server supporting `Range` and more - * - [directory](directory.html) directory listing middleware - * - [vhost](vhost.html) virtual host sub-domain mapping middleware - * - [favicon](favicon.html) efficient favicon server (with default icon) - * - [limit](limit.html) limit the bytesize of request bodies - * - [query](query.html) automatic querystring parser, populating `req.query` - * - [errorHandler](errorHandler.html) flexible error handler - * - * Internals: - * - * - server [prototype](proto.html) - * - connect [utilities](utils.html) - * - node monkey [patches](patch.html) - * - * Links: - * - * - list of [3rd-party](https://github.com/senchalabs/connect/wiki) middleware - * - GitHub [repository](http://github.com/senchalabs/connect) - * - [test documentation](https://github.com/senchalabs/connect/blob/gh-pages/tests.md) - * - */ \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js b/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js deleted file mode 100644 index ce7ed41..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js +++ /dev/null @@ -1,98 +0,0 @@ - -/*! - * Connect - basicAuth - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , unauthorized = utils.unauthorized; - -/** - * Basic Auth: - * - * Enfore basic authentication by providing a `callback(user, pass)`, - * which must return `true` in order to gain access. Alternatively an async - * method is provided as well, invoking `callback(user, pass, callback)`. Populates - * `req.user`. The final alternative is simply passing username / password - * strings. - * - * Simple username and password - * - * connect(connect.basicAuth('username', 'password')); - * - * Callback verification - * - * connect() - * .use(connect.basicAuth(function(user, pass){ - * return 'tj' == user & 'wahoo' == pass; - * })) - * - * Async callback verification, accepting `fn(err, user)`. - * - * connect() - * .use(connect.basicAuth(function(user, pass, fn){ - * User.authenticate({ user: user, pass: pass }, fn); - * })) - * - * @param {Function|String} callback or username - * @param {String} realm - * @api public - */ - -module.exports = function basicAuth(callback, realm) { - var username, password; - - // user / pass strings - if ('string' == typeof callback) { - username = callback; - password = realm; - if ('string' != typeof password) throw new Error('password argument required'); - realm = arguments[2]; - callback = function(user, pass){ - return user == username && pass == password; - } - } - - realm = realm || 'Authorization Required'; - - return function(req, res, next) { - var authorization = req.headers.authorization; - - if (req.user) return next(); - if (!authorization) return unauthorized(res, realm); - - var parts = authorization.split(' ') - , scheme = parts[0] - , credentials = new Buffer(parts[1], 'base64').toString().split(':') - , user = credentials[0] - , pass = credentials[1]; - - if ('Basic' != scheme) return next(utils.error(400)); - - // async - if (callback.length >= 3) { - var pause = utils.pause(req); - callback(user, pass, function(err, user){ - if (err || !user) return unauthorized(res, realm); - req.user = user; - next(); - pause.resume(); - }); - // sync - } else { - if (callback(user, pass)) { - req.user = user; - next(); - } else { - unauthorized(res, realm); - } - } - } -}; - diff --git a/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js b/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js deleted file mode 100644 index 9f692cd..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js +++ /dev/null @@ -1,61 +0,0 @@ - -/*! - * Connect - bodyParser - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var multipart = require('./multipart') - , urlencoded = require('./urlencoded') - , json = require('./json'); - -/** - * Body parser: - * - * Parse request bodies, supports _application/json_, - * _application/x-www-form-urlencoded_, and _multipart/form-data_. - * - * This is equivalent to: - * - * app.use(connect.json()); - * app.use(connect.urlencoded()); - * app.use(connect.multipart()); - * - * Examples: - * - * connect() - * .use(connect.bodyParser()) - * .use(function(req, res) { - * res.end('viewing user ' + req.body.user.name); - * }); - * - * $ curl -d 'user[name]=tj' http://local/ - * $ curl -d '{"user":{"name":"tj"}}' -H "Content-Type: application/json" http://local/ - * - * View [json](json.html), [urlencoded](urlencoded.html), and [multipart](multipart.html) for more info. - * - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function bodyParser(options){ - var _urlencoded = urlencoded(options) - , _multipart = multipart(options) - , _json = json(options); - - return function bodyParser(req, res, next) { - _json(req, res, function(err){ - if (err) return next(err); - _urlencoded(req, res, function(err){ - if (err) return next(err); - _multipart(req, res, next); - }); - }); - } -}; \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/lib/middleware/compress.js b/node_modules/express/node_modules/connect/lib/middleware/compress.js deleted file mode 100644 index feda4b6..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/compress.js +++ /dev/null @@ -1,142 +0,0 @@ - -/*! - * Connect - compress - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var zlib = require('zlib'); - -/** - * Supported content-encoding methods. - */ - -exports.methods = { - gzip: zlib.createGzip - , deflate: zlib.createDeflate -}; - -/** - * Default filter function. - */ - -exports.filter = function(req, res){ - var type = res.getHeader('Content-Type') || ''; - return type.match(/json|text|javascript/); -}; - -/** - * Compress: - * - * Compress response data with gzip/deflate. - * - * Filter: - * - * A `filter` callback function may be passed to - * replace the default logic of: - * - * exports.filter = function(req, res){ - * var type = res.getHeader('Content-Type') || ''; - * return type.match(/json|text|javascript/); - * }; - * - * Options: - * - * All remaining options are passed to the gzip/deflate - * creation functions. Consult node's docs for additional details. - * - * - `chunkSize` (default: 16*1024) - * - `windowBits` - * - `level`: 0-9 where 0 is no compression, and 9 is slow but best compression - * - `memLevel`: 1-9 low is slower but uses less memory, high is fast but uses more - * - `strategy`: compression strategy - * - * @param {Object} options - * @return {Function} - * @api public - */ - -module.exports = function compress(options) { - var options = options || {} - , names = Object.keys(exports.methods) - , filter = options.filter || exports.filter; - - return function(req, res, next){ - var accept = req.headers['accept-encoding'] - , write = res.write - , end = res.end - , stream - , method; - - // vary - res.setHeader('Vary', 'Accept-Encoding'); - - // proxy - - res.write = function(chunk, encoding){ - if (!this.headerSent) this._implicitHeader(); - return stream - ? stream.write(chunk, encoding) - : write.call(res, chunk, encoding); - }; - - res.end = function(chunk, encoding){ - if (chunk) this.write(chunk, encoding); - return stream - ? stream.end() - : end.call(res); - }; - - res.on('header', function(){ - // default request filter - if (!filter(req, res)) return; - - // SHOULD use identity - if (!accept) return; - - // head - if ('HEAD' == req.method) return; - - // default to gzip - if ('*' == accept.trim()) method = 'gzip'; - - // compression method - if (!method) { - for (var i = 0, len = names.length; i < len; ++i) { - if (~accept.indexOf(names[i])) { - method = names[i]; - break; - } - } - } - - // compression method - if (!method) return; - - // compression stream - stream = exports.methods[method](options); - - // header fields - res.setHeader('Content-Encoding', method); - res.removeHeader('Content-Length'); - - // compression - - stream.on('data', function(chunk){ - write.call(res, chunk); - }); - - stream.on('end', function(){ - end.call(res); - }); - - }); - - next(); - }; -} diff --git a/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js b/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js deleted file mode 100644 index af8b097..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js +++ /dev/null @@ -1,62 +0,0 @@ - -/*! - * Connect - cookieParser - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('./../utils'); - -/** - * Cookie parser: - * - * Parse _Cookie_ header and populate `req.cookies` - * with an object keyed by the cookie names. Optionally - * you may enabled signed cookie support by passing - * a `secret` string, which assigns `req.secret` so - * it may be used by other middleware such as `session()`. - * - * Examples: - * - * connect() - * .use(connect.cookieParser('keyboard cat')) - * .use(function(req, res, next){ - * res.end(JSON.stringify(req.cookies)); - * }) - * - * @param {String} secret - * @return {Function} - * @api public - */ - -module.exports = function cookieParser(secret){ - return function cookieParser(req, res, next) { - var cookie = req.headers.cookie; - if (req.cookies) return next(); - - req.secret = secret; - req.cookies = {}; - req.signedCookies = {}; - - if (cookie) { - try { - req.cookies = utils.parseCookie(cookie); - if (secret) { - req.signedCookies = utils.parseSignedCookies(req.cookies, secret); - var obj = utils.parseJSONCookies(req.signedCookies); - req.signedCookies = obj.cookies; - req.cookieHashes = obj.hashes; - } - req.cookies = utils.parseJSONCookies(req.cookies).cookies; - } catch (err) { - return next(err); - } - } - next(); - }; -}; \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/lib/middleware/cookieSession.js b/node_modules/express/node_modules/connect/lib/middleware/cookieSession.js deleted file mode 100644 index 5e00e4e..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/cookieSession.js +++ /dev/null @@ -1,96 +0,0 @@ - -/*! - * Connect - cookieSession - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('./../utils') - , Cookie = require('./session/cookie') - , debug = require('debug')('connect:cookieSession') - , crc16 = require('crc').crc16; - -// environment - -var env = process.env.NODE_ENV; - -/** - * Cookie Session: - * - * Cookie session middleware. - * - * var app = connect(); - * app.use(connect.cookieParser('tobo!')); - * app.use(connect.cookieSession({ cookie: { maxAge: 60 * 60 * 1000 }})); - * - * Options: - * - * - `key` cookie name defaulting to `connect.sess` - * - `cookie` session cookie settings, defaulting to `{ path: '/', httpOnly: true, maxAge: null }` - * - `proxy` trust the reverse proxy when setting secure cookies (via "x-forwarded-proto") - * - * Clearing sessions: - * - * To clear the session simply set its value to `null`, - * `cookieSession()` will then respond with a 1970 Set-Cookie. - * - * req.session = null; - * - * @param {Object} options - * @return {Function} - * @api public - */ - -module.exports = function cookieSession(options){ - // TODO: utilize Session/Cookie to unify API - var options = options || {} - , key = options.key || 'connect.sess' - , cookie = options.cookie - , trustProxy = options.proxy; - - return function cookieSession(req, res, next) { - req.session = req.signedCookies[key] || {}; - req.session.cookie = new Cookie(req, cookie); - - res.on('header', function(){ - // removed - if (!req.session) { - debug('clear session'); - res.setHeader('Set-Cookie', key + '=; expires=' + new Date(0).toUTCString()); - return; - } - - var cookie = req.session.cookie; - delete req.session.cookie; - - // check security - var proto = (req.headers['x-forwarded-proto'] || '').toLowerCase() - , tls = req.connection.encrypted || (trustProxy && 'https' == proto) - , secured = cookie.secure && tls; - - // only send secure cookies via https - if (cookie.secure && !secured) return debug('not secured'); - - // serialize - debug('serializing %j', req.session); - var val = 'j:' + JSON.stringify(req.session); - - // compare hashes - var originalHash = req.cookieHashes && req.cookieHashes[key]; - var hash = crc16(val); - if (originalHash == hash) return debug('unmodified session'); - - // set-cookie - val = utils.sign(val, req.secret); - val = utils.serializeCookie(key, val, cookie); - debug('set-cookie %j', cookie); - res.setHeader('Set-Cookie', val); - }); - - next(); - }; -}; diff --git a/node_modules/express/node_modules/connect/lib/middleware/csrf.js b/node_modules/express/node_modules/connect/lib/middleware/csrf.js deleted file mode 100644 index d6ff98f..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/csrf.js +++ /dev/null @@ -1,75 +0,0 @@ - -/*! - * Connect - csrf - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , crypto = require('crypto'); - -/** - * Anti CSRF: - * - * CRSF protection middleware. - * - * By default this middleware generates a token named "_csrf" - * which should be added to requests which mutate - * state, within a hidden form field, query-string etc. This - * token is validated against the visitor's `req.session._csrf` - * property. - * - * The default `value` function checks `req.body` generated - * by the `bodyParser()` middleware, `req.query` generated - * by `query()`, and the "X-CSRF-Token" header field. - * - * This middleware requires session support, thus should be added - * somewhere _below_ `session()` and `cookieParser()`. - * - * Options: - * - * - `value` a function accepting the request, returning the token - * - * @param {Object} options - * @api public - */ - -module.exports = function csrf(options) { - var options = options || {} - , value = options.value || defaultValue; - - return function(req, res, next){ - // generate CSRF token - var token = req.session._csrf || (req.session._csrf = utils.uid(24)); - - // ignore GET & HEAD (for now) - if ('GET' == req.method || 'HEAD' == req.method) return next(); - - // determine value - var val = value(req); - - // check - if (val != token) return next(utils.error(403)); - - next(); - } -}; - -/** - * Default value function, checking the `req.body` - * and `req.query` for the CSRF token. - * - * @param {IncomingMessage} req - * @return {String} - * @api private - */ - -function defaultValue(req) { - return (req.body && req.body._csrf) - || (req.query && req.query._csrf) - || (req.headers['x-csrf-token']); -} \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/lib/middleware/directory.js b/node_modules/express/node_modules/connect/lib/middleware/directory.js deleted file mode 100644 index 7dcfb3c..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/directory.js +++ /dev/null @@ -1,227 +0,0 @@ - -/*! - * Connect - directory - * Copyright(c) 2011 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -// TODO: icon / style for directories -// TODO: arrow key navigation -// TODO: make icons extensible - -/** - * Module dependencies. - */ - -var fs = require('fs') - , parse = require('url').parse - , utils = require('../utils') - , path = require('path') - , normalize = path.normalize - , extname = path.extname - , join = path.join; - -/*! - * Icon cache. - */ - -var cache = {}; - -/** - * Directory: - * - * Serve directory listings with the given `root` path. - * - * Options: - * - * - `hidden` display hidden (dot) files. Defaults to false. - * - `icons` display icons. Defaults to false. - * - `filter` Apply this filter function to files. Defaults to false. - * - * @param {String} root - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function directory(root, options){ - options = options || {}; - - // root required - if (!root) throw new Error('directory() root path required'); - var hidden = options.hidden - , icons = options.icons - , filter = options.filter - , root = normalize(root); - - return function directory(req, res, next) { - var accept = req.headers.accept || 'text/plain' - , url = parse(req.url) - , dir = decodeURIComponent(url.pathname) - , path = normalize(join(root, dir)) - , originalUrl = parse(req.originalUrl) - , originalDir = decodeURIComponent(originalUrl.pathname) - , showUp = path != root && path != root + '/'; - - // null byte(s), bad request - if (~path.indexOf('\0')) return next(utils.error(400)); - - // malicious path, forbidden - if (0 != path.indexOf(root)) return next(utils.error(403)); - - // check if we have a directory - fs.stat(path, function(err, stat){ - if (err) return 'ENOENT' == err.code - ? next() - : next(err); - - if (!stat.isDirectory()) return next(); - - // fetch files - fs.readdir(path, function(err, files){ - if (err) return next(err); - if (!hidden) files = removeHidden(files); - if (filter) files = files.filter(filter); - files.sort(); - - // content-negotiation - for (var key in exports) { - if (~accept.indexOf(key) || ~accept.indexOf('*/*')) { - exports[key](req, res, files, next, originalDir, showUp, icons); - return; - } - } - - // not acceptable - next(utils.error(406)); - }); - }); - }; -}; - -/** - * Respond with text/html. - */ - -exports.html = function(req, res, files, next, dir, showUp, icons){ - fs.readFile(__dirname + '/../public/directory.html', 'utf8', function(err, str){ - if (err) return next(err); - fs.readFile(__dirname + '/../public/style.css', 'utf8', function(err, style){ - if (err) return next(err); - if (showUp) files.unshift('..'); - str = str - .replace('{style}', style) - .replace('{files}', html(files, dir, icons)) - .replace('{directory}', dir) - .replace('{linked-path}', htmlPath(dir)); - res.setHeader('Content-Type', 'text/html'); - res.setHeader('Content-Length', str.length); - res.end(str); - }); - }); -}; - -/** - * Respond with application/json. - */ - -exports.json = function(req, res, files){ - files = JSON.stringify(files); - res.setHeader('Content-Type', 'application/json'); - res.setHeader('Content-Length', files.length); - res.end(files); -}; - -/** - * Respond with text/plain. - */ - -exports.plain = function(req, res, files){ - files = files.join('\n') + '\n'; - res.setHeader('Content-Type', 'text/plain'); - res.setHeader('Content-Length', files.length); - res.end(files); -}; - -/** - * Map html `dir`, returning a linked path. - */ - -function htmlPath(dir) { - var curr = []; - return dir.split('/').map(function(part){ - curr.push(part); - return '' + part + ''; - }).join(' / '); -} - -/** - * Map html `files`, returning an html unordered list. - */ - -function html(files, dir, useIcons) { - return '
    ' + files.map(function(file){ - var icon = '' - , classes = []; - - if (useIcons && '..' != file) { - icon = icons[extname(file)] || icons.default; - icon = ''; - classes.push('icon'); - } - - return '
  • ' - + icon + file + '
  • '; - - }).join('\n') + '
'; -} - -/** - * Load and cache the given `icon`. - * - * @param {String} icon - * @return {String} - * @api private - */ - -function load(icon) { - if (cache[icon]) return cache[icon]; - return cache[icon] = fs.readFileSync(__dirname + '/../public/icons/' + icon, 'base64'); -} - -/** - * Filter "hidden" `files`, aka files - * beginning with a `.`. - * - * @param {Array} files - * @return {Array} - * @api private - */ - -function removeHidden(files) { - return files.filter(function(file){ - return '.' != file[0]; - }); -} - -/** - * Icon map. - */ - -var icons = { - '.js': 'page_white_code_red.png' - , '.c': 'page_white_c.png' - , '.h': 'page_white_h.png' - , '.cc': 'page_white_cplusplus.png' - , '.php': 'page_white_php.png' - , '.rb': 'page_white_ruby.png' - , '.cpp': 'page_white_cplusplus.png' - , '.swf': 'page_white_flash.png' - , '.pdf': 'page_white_acrobat.png' - , 'default': 'page_white.png' -}; diff --git a/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js b/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js deleted file mode 100644 index b62aab7..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js +++ /dev/null @@ -1,87 +0,0 @@ -/*! - * Connect - errorHandler - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , url = require('url') - , fs = require('fs'); - -// environment - -var env = process.env.NODE_ENV || 'development'; - -/** - * Error handler: - * - * Development error handler, providing stack traces - * and error message responses for requests accepting text, html, - * or json. - * - * Text: - * - * By default, and when _text/plain_ is accepted a simple stack trace - * or error message will be returned. - * - * JSON: - * - * When _application/json_ is accepted, connect will respond with - * an object in the form of `{ "error": error }`. - * - * HTML: - * - * When accepted connect will output a nice html stack trace. - * - * @return {Function} - * @api public - */ - -exports = module.exports = function errorHandler(){ - return function errorHandler(err, req, res, next){ - if (err.status) res.statusCode = err.status; - if (res.statusCode < 400) res.statusCode = 500; - if ('test' != env) console.error(err.stack); - var accept = req.headers.accept || ''; - // html - if (~accept.indexOf('html')) { - fs.readFile(__dirname + '/../public/style.css', 'utf8', function(e, style){ - fs.readFile(__dirname + '/../public/error.html', 'utf8', function(e, html){ - var stack = (err.stack || '') - .split('\n').slice(1) - .map(function(v){ return '
  • ' + v + '
  • '; }).join(''); - html = html - .replace('{style}', style) - .replace('{stack}', stack) - .replace('{title}', exports.title) - .replace('{statusCode}', res.statusCode) - .replace(/\{error\}/g, utils.escape(err.toString())); - res.setHeader('Content-Type', 'text/html; charset=utf-8'); - res.end(html); - }); - }); - // json - } else if (~accept.indexOf('json')) { - var error = { message: err.message, stack: err.stack }; - for (var prop in err) error[prop] = err[prop]; - var json = JSON.stringify({ error: error }); - res.setHeader('Content-Type', 'application/json'); - res.end(json); - // plain text - } else { - res.writeHead(res.statusCode, { 'Content-Type': 'text/plain' }); - res.end(err.stack); - } - }; -}; - -/** - * Template title, framework authors may override this value. - */ - -exports.title = 'Connect'; diff --git a/node_modules/express/node_modules/connect/lib/middleware/favicon.js b/node_modules/express/node_modules/connect/lib/middleware/favicon.js deleted file mode 100644 index b344218..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/favicon.js +++ /dev/null @@ -1,86 +0,0 @@ - -/*! - * Connect - favicon - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs') - , utils = require('../utils'); - -/*! - * Favicon cache. - */ - -var icon; - -/** - * Favicon: - * - * By default serves the connect favicon, or the favicon - * located by the given `path`. - * - * Options: - * - * - `maxAge` cache-control max-age directive, defaulting to 1 day - * - * Examples: - * - * Serve default favicon: - * - * connect() - * .use(connect.favicon()) - * - * Serve favicon before logging for brevity: - * - * connect() - * .use(connect.favicon()) - * .use(connect.logger('dev')) - * - * Serve custom favicon: - * - * connect() - * .use(connect.favicon('public/favicon.ico)) - * - * @param {String} path - * @param {Object} options - * @return {Function} - * @api public - */ - -module.exports = function favicon(path, options){ - var options = options || {} - , path = path || __dirname + '/../public/favicon.ico' - , maxAge = options.maxAge || 86400000; - - return function favicon(req, res, next){ - if ('/favicon.ico' == req.url) { - if (icon) { - res.writeHead(200, icon.headers); - res.end(icon.body); - } else { - fs.readFile(path, function(err, buf){ - if (err) return next(err); - icon = { - headers: { - 'Content-Type': 'image/x-icon' - , 'Content-Length': buf.length - , 'ETag': '"' + utils.md5(buf) + '"' - , 'Cache-Control': 'public, max-age=' + (maxAge / 1000) - }, - body: buf - }; - res.writeHead(200, icon.headers); - res.end(icon.body); - }); - } - } else { - next(); - } - }; -}; \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/lib/middleware/json.js b/node_modules/express/node_modules/connect/lib/middleware/json.js deleted file mode 100644 index c965205..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/json.js +++ /dev/null @@ -1,61 +0,0 @@ - -/*! - * Connect - json - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils'); - -/** - * JSON: - * - * Parse JSON request bodies, providing the - * parsed object as `req.body`. - * - * Options: - * - * - `strict` when `false` anything `JSON.parse()` accepts will be parsed - * - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function(options){ - var options = options || {} - , strict = options.strict === false - ? false - : true; - - return function json(req, res, next) { - if (req._body) return next(); - req.body = req.body || {}; - - // check Content-Type - if ('application/json' != utils.mime(req)) return next(); - - // flag as parsed - req._body = true; - - // parse - var buf = ''; - req.setEncoding('utf8'); - req.on('data', function(chunk){ buf += chunk }); - req.on('end', function(){ - if (strict && '{' != buf[0] && '[' != buf[0]) return next(utils.error(400)); - try { - req.body = JSON.parse(buf); - next(); - } catch (err){ - err.status = 400; - next(err); - } - }); - } -}; \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/lib/middleware/limit.js b/node_modules/express/node_modules/connect/lib/middleware/limit.js deleted file mode 100644 index d0b9d9b..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/limit.js +++ /dev/null @@ -1,77 +0,0 @@ - -/*! - * Connect - limit - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils'); - -/** - * Limit: - * - * Limit request bodies to the given size in `bytes`. - * - * A string representation of the bytesize may also be passed, - * for example "5mb", "200kb", "1gb", etc. - * - * connect() - * .use(connect.limit('5.5mb')) - * .use(handleImageUpload) - * - * @param {Number|String} bytes - * @return {Function} - * @api public - */ - -module.exports = function limit(bytes){ - if ('string' == typeof bytes) bytes = parse(bytes); - if ('number' != typeof bytes) throw new Error('limit() bytes required'); - return function limit(req, res, next){ - var received = 0 - , len = req.headers['content-length'] - ? parseInt(req.headers['content-length'], 10) - : null; - - // self-awareness - if (req._limit) return next(); - req._limit = true; - - // limit by content-length - if (len && len > bytes) return next(utils.error(413)); - - // limit - req.on('data', function(chunk){ - received += chunk.length; - if (received > bytes) req.destroy(); - }); - - next(); - }; -}; - -/** - * Parse byte `size` string. - * - * @param {String} size - * @return {Number} - * @api private - */ - -function parse(size) { - var parts = size.match(/^(\d+(?:\.\d+)?) *(kb|mb|gb)$/) - , n = parseFloat(parts[1]) - , type = parts[2]; - - var map = { - kb: 1024 - , mb: 1024 * 1024 - , gb: 1024 * 1024 * 1024 - }; - - return map[type] * n; -} \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/lib/middleware/logger.js b/node_modules/express/node_modules/connect/lib/middleware/logger.js deleted file mode 100644 index 816f637..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/logger.js +++ /dev/null @@ -1,331 +0,0 @@ - -/*! - * Connect - logger - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/*! - * Log buffer. - */ - -var buf = []; - -/*! - * Default log buffer duration. - */ - -var defaultBufferDuration = 1000; - -/** - * Logger: - * - * Log requests with the given `options` or a `format` string. - * - * Options: - * - * - `format` Format string, see below for tokens - * - `stream` Output stream, defaults to _stdout_ - * - `buffer` Buffer duration, defaults to 1000ms when _true_ - * - `immediate` Write log line on request instead of response (for response times) - * - * Tokens: - * - * - `:req[header]` ex: `:req[Accept]` - * - `:res[header]` ex: `:res[Content-Length]` - * - `:http-version` - * - `:response-time` - * - `:remote-addr` - * - `:date` - * - `:method` - * - `:url` - * - `:referrer` - * - `:user-agent` - * - `:status` - * - * Formats: - * - * Pre-defined formats that ship with connect: - * - * - `default` ':remote-addr - - [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"' - * - `short` ':remote-addr - :method :url HTTP/:http-version :status :res[content-length] - :response-time ms' - * - `tiny` ':method :url :status :res[content-length] - :response-time ms' - * - `dev` concise output colored by response status for development use - * - * Examples: - * - * connect.logger() // default - * connect.logger('short') - * connect.logger('tiny') - * connect.logger({ immediate: true, format: 'dev' }) - * connect.logger(':method :url - :referrer') - * connect.logger(':req[content-type] -> :res[content-type]') - * connect.logger(function(req, res){ return 'some format string' }) - * - * Defining Tokens: - * - * To define a token, simply invoke `connect.logger.token()` with the - * name and a callback function. The value returned is then available - * as ":type" in this case. - * - * connect.logger.token('type', function(req, res){ return req.headers['content-type']; }) - * - * Defining Formats: - * - * All default formats are defined this way, however it's public API as well: - * - * connect.logger.format('name', 'string or function') - * - * @param {String|Function|Object} format or options - * @return {Function} - * @api public - */ - -exports = module.exports = function logger(options) { - if ('object' == typeof options) { - options = options || {}; - } else if (options) { - options = { format: options }; - } else { - options = {}; - } - - // output on request instead of response - var immediate = options.immediate; - - // format name - var fmt = exports[options.format] || options.format || exports.default; - - // compile format - if ('function' != typeof fmt) fmt = compile(fmt); - - // options - var stream = options.stream || process.stdout - , buffer = options.buffer; - - // buffering support - if (buffer) { - var realStream = stream - , interval = 'number' == typeof buffer - ? buffer - : defaultBufferDuration; - - // flush interval - setInterval(function(){ - if (buf.length) { - realStream.write(buf.join(''), 'ascii'); - buf.length = 0; - } - }, interval); - - // swap the stream - stream = { - write: function(str){ - buf.push(str); - } - }; - } - - return function logger(req, res, next) { - req._startTime = new Date; - - // mount safety - if (req._logging) return next(); - - // flag as logging - req._logging = true; - - // immediate - if (immediate) { - var line = fmt(exports, req, res); - if (null == line) return; - stream.write(line + '\n', 'ascii'); - // proxy end to output logging - } else { - var end = res.end; - res.end = function(chunk, encoding){ - res.end = end; - res.end(chunk, encoding); - var line = fmt(exports, req, res); - if (null == line) return; - stream.write(line + '\n', 'ascii'); - }; - } - - - next(); - }; -}; - -/** - * Compile `fmt` into a function. - * - * @param {String} fmt - * @return {Function} - * @api private - */ - -function compile(fmt) { - fmt = fmt.replace(/"/g, '\\"'); - var js = ' return "' + fmt.replace(/:([-\w]{2,})(?:\[([^\]]+)\])?/g, function(_, name, arg){ - return '"\n + (tokens["' + name + '"](req, res, "' + arg + '") || "-") + "'; - }) + '";' - return new Function('tokens, req, res', js); -}; - -/** - * Define a token function with the given `name`, - * and callback `fn(req, res)`. - * - * @param {String} name - * @param {Function} fn - * @return {Object} exports for chaining - * @api public - */ - -exports.token = function(name, fn) { - exports[name] = fn; - return this; -}; - -/** - * Define a `fmt` with the given `name`. - * - * @param {String} name - * @param {String|Function} fmt - * @return {Object} exports for chaining - * @api public - */ - -exports.format = function(name, str){ - exports[name] = str; - return this; -}; - -/** - * Default format. - */ - -exports.format('default', ':remote-addr - - [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"'); - -/** - * Short format. - */ - -exports.format('short', ':remote-addr - :method :url HTTP/:http-version :status :res[content-length] - :response-time ms'); - -/** - * Tiny format. - */ - -exports.format('tiny', ':method :url :status :res[content-length] - :response-time ms'); - -/** - * dev (colored) - */ - -exports.format('dev', function(tokens, req, res){ - var status = res.statusCode - , color = 32; - - if (status >= 500) color = 31 - else if (status >= 400) color = 33 - else if (status >= 300) color = 36; - - return '\033[90m' + req.method - + ' ' + req.originalUrl + ' ' - + '\033[' + color + 'm' + res.statusCode - + ' \033[90m' - + (new Date - req._startTime) - + 'ms\033[0m'; -}); - -/** - * request url - */ - -exports.token('url', function(req){ - return req.originalUrl; -}); - -/** - * request method - */ - -exports.token('method', function(req){ - return req.method; -}); - -/** - * response time in milliseconds - */ - -exports.token('response-time', function(req){ - return new Date - req._startTime; -}); - -/** - * UTC date - */ - -exports.token('date', function(){ - return new Date().toUTCString(); -}); - -/** - * response status code - */ - -exports.token('status', function(req, res){ - return res.statusCode; -}); - -/** - * normalized referrer - */ - -exports.token('referrer', function(req){ - return req.headers['referer'] || req.headers['referrer']; -}); - -/** - * remote address - */ - -exports.token('remote-addr', function(req){ - return req.socket && (req.socket.remoteAddress || (req.socket.socket && req.socket.socket.remoteAddress)); -}); - -/** - * HTTP version - */ - -exports.token('http-version', function(req){ - return req.httpVersionMajor + '.' + req.httpVersionMinor; -}); - -/** - * UA string - */ - -exports.token('user-agent', function(req){ - return req.headers['user-agent']; -}); - -/** - * request header - */ - -exports.token('req', function(req, res, field){ - return req.headers[field.toLowerCase()]; -}); - -/** - * response header - */ - -exports.token('res', function(req, res, field){ - return (res._headers || {})[field.toLowerCase()]; -}); - diff --git a/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js b/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js deleted file mode 100644 index aaf4014..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js +++ /dev/null @@ -1,40 +0,0 @@ - -/*! - * Connect - methodOverride - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Method Override: - * - * Provides faux HTTP method support. - * - * Pass an optional `key` to use when checking for - * a method override, othewise defaults to _\_method_. - * The original method is available via `req.originalMethod`. - * - * @param {String} key - * @return {Function} - * @api public - */ - -module.exports = function methodOverride(key){ - key = key || "_method"; - return function methodOverride(req, res, next) { - req.originalMethod = req.originalMethod || req.method; - - // req.body - if (req.body && key in req.body) { - req.method = req.body[key].toUpperCase(); - delete req.body[key]; - // check X-HTTP-Method-Override - } else if (req.headers['x-http-method-override']) { - req.method = req.headers['x-http-method-override'].toUpperCase(); - } - - next(); - }; -}; - diff --git a/node_modules/express/node_modules/connect/lib/middleware/multipart.js b/node_modules/express/node_modules/connect/lib/middleware/multipart.js deleted file mode 100644 index f48e4da..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/multipart.js +++ /dev/null @@ -1,99 +0,0 @@ - -/*! - * Connect - multipart - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var formidable = require('formidable') - , utils = require('../utils') - , qs = require('qs'); - -/** - * Multipart: - * - * Parse multipart/form-data request bodies, - * providing the parsed object as `req.body` - * and `req.files`. - * - * Configuration: - * - * The options passed are merged with [formidable](https://github.com/felixge/node-formidable)'s - * `IncomingForm` object, allowing you to configure the upload directory, - * size limits, etc. For example if you wish to change the upload dir do the following. - * - * app.use(connect.multipart({ uploadDir: path })); - * - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function(options){ - options = options || {}; - return function multipart(req, res, next) { - if (req._body) return next(); - req.body = req.body || {}; - req.files = req.files || {}; - - // ignore GET - if ('GET' == req.method || 'HEAD' == req.method) return next(); - - // check Content-Type - if ('multipart/form-data' != utils.mime(req)) return next(); - - // flag as parsed - req._body = true; - - // parse - var form = new formidable.IncomingForm - , data = {} - , files = {} - , done; - - Object.keys(options).forEach(function(key){ - form[key] = options[key]; - }); - - function ondata(name, val, data){ - if (Array.isArray(data[name])) { - data[name].push(val); - } else if (data[name]) { - data[name] = [data[name], val]; - } else { - data[name] = val; - } - } - - form.on('field', function(name, val){ - ondata(name, val, data); - }); - - form.on('file', function(name, val){ - ondata(name, val, files); - }); - - form.on('error', function(err){ - next(err); - done = true; - }); - - form.on('end', function(){ - if (done) return; - try { - req.body = qs.parse(data); - req.files = qs.parse(files); - next(); - } catch (err) { - next(err); - } - }); - - form.parse(req); - } -}; diff --git a/node_modules/express/node_modules/connect/lib/middleware/query.js b/node_modules/express/node_modules/connect/lib/middleware/query.js deleted file mode 100644 index 7986a33..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/query.js +++ /dev/null @@ -1,46 +0,0 @@ -/*! - * Connect - query - * Copyright(c) 2011 TJ Holowaychuk - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var qs = require('qs') - , parse = require('url').parse; - -/** - * Query: - * - * Automatically parse the query-string when available, - * populating the `req.query` object. - * - * Examples: - * - * connect() - * .use(connect.query()) - * .use(function(req, res){ - * res.end(JSON.stringify(req.query)); - * }); - * - * The `options` passed are provided to qs.parse function. - * - * @param {Object} options - * @return {Function} - * @api public - */ - -module.exports = function query(options){ - return function query(req, res, next){ - if (!req.query) { - req.query = ~req.url.indexOf('?') - ? qs.parse(parse(req.url).query, options) - : {}; - } - - next(); - }; -}; diff --git a/node_modules/express/node_modules/connect/lib/middleware/responseTime.js b/node_modules/express/node_modules/connect/lib/middleware/responseTime.js deleted file mode 100644 index 57858f6..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/responseTime.js +++ /dev/null @@ -1,32 +0,0 @@ - -/*! - * Connect - responseTime - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Reponse time: - * - * Adds the `X-Response-Time` header displaying the response - * duration in milliseconds. - * - * @return {Function} - * @api public - */ - -module.exports = function responseTime(){ - return function(req, res, next){ - var start = new Date; - - if (res._responseTime) return next(); - res._responseTime = true; - - res.on('header', function(header){ - var duration = new Date - start; - res.setHeader('X-Response-time', duration + 'ms'); - }); - - next(); - }; -}; diff --git a/node_modules/express/node_modules/connect/lib/middleware/session.js b/node_modules/express/node_modules/connect/lib/middleware/session.js deleted file mode 100644 index 997bcce..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/session.js +++ /dev/null @@ -1,325 +0,0 @@ - -/*! - * Connect - session - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Session = require('./session/session') - , debug = require('debug')('connect:session') - , MemoryStore = require('./session/memory') - , Cookie = require('./session/cookie') - , Store = require('./session/store') - , utils = require('./../utils') - , parse = require('url').parse - , crc16 = require('crc').crc16 - , crypto = require('crypto'); - -// environment - -var env = process.env.NODE_ENV; - -/** - * Expose the middleware. - */ - -exports = module.exports = session; - -/** - * Expose constructors. - */ - -exports.Store = Store; -exports.Cookie = Cookie; -exports.Session = Session; -exports.MemoryStore = MemoryStore; - -/** - * Warning message for `MemoryStore` usage in production. - */ - -var warning = 'Warning: connection.session() MemoryStore is not\n' - + 'designed for a production environment, as it will leak\n' - + 'memory, and will not scale past a single process.'; - -/** - * Session: - * - * Setup session store with the given `options`. - * - * Session data is _not_ saved in the cookie itself, however - * cookies are used, so we must use the [cookieParser()](cookieParser.html) - * middleware _before_ `session()`. - * - * Examples: - * - * connect() - * .use(connect.cookieParser('keyboard cat')) - * .use(connect.session({ key: 'sid', cookie: { secure: true }})) - * - * Options: - * - * - `key` cookie name defaulting to `connect.sid` - * - `store` session store instance - * - `cookie` session cookie settings, defaulting to `{ path: '/', httpOnly: true, maxAge: null }` - * - `proxy` trust the reverse proxy when setting secure cookies (via "x-forwarded-proto") - * - * Cookie option: - * - * By default `cookie.maxAge` is `null`, meaning no "expires" parameter is set - * so the cookie becomes a browser-session cookie. When the user closes the - * browser the cookie (and session) will be removed. - * - * ## req.session - * - * To store or access session data, simply use the request property `req.session`, - * which is (generally) serialized as JSON by the store, so nested objects - * are typically fine. For example below is a user-specific view counter: - * - * connect() - * .use(connect.favicon()) - * .use(connect.cookieParser('keyboard cat')) - * .use(connect.session({ cookie: { maxAge: 60000 }})) - * .use(function(req, res, next){ - * var sess = req.session; - * if (sess.views) { - * res.setHeader('Content-Type', 'text/html'); - * res.write('

    views: ' + sess.views + '

    '); - * res.write('

    expires in: ' + (sess.cookie.maxAge / 1000) + 's

    '); - * res.end(); - * sess.views++; - * } else { - * sess.views = 1; - * res.end('welcome to the session demo. refresh!'); - * } - * } - * )).listen(3000); - * - * ## Session#regenerate() - * - * To regenerate the session simply invoke the method, once complete - * a new SID and `Session` instance will be initialized at `req.session`. - * - * req.session.regenerate(function(err){ - * // will have a new session here - * }); - * - * ## Session#destroy() - * - * Destroys the session, removing `req.session`, will be re-generated next request. - * - * req.session.destroy(function(err){ - * // cannot access session here - * }); - * - * ## Session#reload() - * - * Reloads the session data. - * - * req.session.reload(function(err){ - * // session updated - * }); - * - * ## Session#save() - * - * Save the session. - * - * req.session.save(function(err){ - * // session saved - * }); - * - * ## Session#touch() - * - * Updates the `.maxAge` property. Typically this is - * not necessary to call, as the session middleware does this for you. - * - * ## Session#cookie - * - * Each session has a unique cookie object accompany it. This allows - * you to alter the session cookie per visitor. For example we can - * set `req.session.cookie.expires` to `false` to enable the cookie - * to remain for only the duration of the user-agent. - * - * ## Session#maxAge - * - * Alternatively `req.session.cookie.maxAge` will return the time - * remaining in milliseconds, which we may also re-assign a new value - * to adjust the `.expires` property appropriately. The following - * are essentially equivalent - * - * var hour = 3600000; - * req.session.cookie.expires = new Date(Date.now() + hour); - * req.session.cookie.maxAge = hour; - * - * For example when `maxAge` is set to `60000` (one minute), and 30 seconds - * has elapsed it will return `30000` until the current request has completed, - * at which time `req.session.touch()` is called to reset `req.session.maxAge` - * to its original value. - * - * req.session.cookie.maxAge; - * // => 30000 - * - * Session Store Implementation: - * - * Every session store _must_ implement the following methods - * - * - `.get(sid, callback)` - * - `.set(sid, session, callback)` - * - `.destroy(sid, callback)` - * - * Recommended methods include, but are not limited to: - * - * - `.length(callback)` - * - `.clear(callback)` - * - * For an example implementation view the [connect-redis](http://github.com/visionmedia/connect-redis) repo. - * - * @param {Object} options - * @return {Function} - * @api public - */ - -function session(options){ - var options = options || {} - , key = options.key || 'connect.sid' - , store = options.store || new MemoryStore - , cookie = options.cookie - , trustProxy = options.proxy; - - // notify user that this store is not - // meant for a production environment - if ('production' == env && store instanceof MemoryStore) { - console.warn(warning); - } - - // generates the new session - store.generate = function(req){ - req.sessionID = utils.uid(24); - req.session = new Session(req); - req.session.cookie = new Cookie(req, cookie); - }; - - return function session(req, res, next) { - // self-awareness - if (req.session) return next(); - - // ensure secret is available or bail - if (!req.secret) throw new Error('connect.cookieParser("secret") required for security when using sessions'); - - // parse url - var url = parse(req.url) - , path = url.pathname - , originalHash; - - // expose store - req.sessionStore = store; - - // set-cookie - res.on('header', function(){ - if (!req.session) return; - var cookie = req.session.cookie - , proto = (req.headers['x-forwarded-proto'] || '').toLowerCase() - , tls = req.connection.encrypted || (trustProxy && 'https' == proto) - , secured = cookie.secure && tls - , isNew = req.signedCookies[key] != req.sessionID; - - // only send secure cookies via https - if (cookie.secure && !secured) return debug('not secured'); - - // browser-session length cookie - if (null == cookie.expires) { - if (!isNew) return debug('already set browser-session cookie'); - // compare hashes - } else if (originalHash == hash(req.session)) { - return debug('unmodified session'); - } - - var val = cookie.serialize(key, req.sessionID); - debug('set-cookie %s', val); - res.setHeader('Set-Cookie', val); - }); - - // proxy end() to commit the session - var end = res.end; - res.end = function(data, encoding){ - res.end = end; - if (!req.session) return res.end(data, encoding); - debug('saving'); - req.session.resetMaxAge(); - req.session.save(function(){ - debug('saved'); - res.end(data, encoding); - }); - }; - - // generate the session - function generate() { - store.generate(req); - } - - // get the sessionID from the cookie - req.sessionID = req.signedCookies[key]; - - // generate a session if the browser doesn't send a sessionID - if (!req.sessionID) { - debug('no SID sent, generating session'); - generate(); - next(); - return; - } - - // generate the session object - var pause = utils.pause(req); - debug('fetching %s', req.sessionID); - store.get(req.sessionID, function(err, sess){ - // proxy to resume() events - var _next = next; - next = function(err){ - _next(err); - pause.resume(); - } - - // error handling - if (err) { - debug('error'); - if ('ENOENT' == err.code) { - generate(); - next(); - } else { - next(err); - } - // no session - } else if (!sess) { - debug('no session found'); - generate(); - next(); - // populate req.session - } else { - debug('session found'); - store.createSession(req, sess); - originalHash = hash(sess); - next(); - } - }); - }; -}; - -/** - * Hash the given `sess` object omitting changes - * to `.cookie`. - * - * @param {Object} sess - * @return {String} - * @api private - */ - -function hash(sess) { - return crc16(JSON.stringify(sess, function(key, val){ - if ('cookie' != key) return val; - })); -} diff --git a/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js b/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js deleted file mode 100644 index 5e7f4c3..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js +++ /dev/null @@ -1,129 +0,0 @@ - -/*! - * Connect - session - Cookie - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../../utils'); - -/** - * Initialize a new `Cookie` with the given `options`. - * - * @param {IncomingMessage} req - * @param {Object} options - * @api private - */ - -var Cookie = module.exports = function Cookie(req, options) { - this.path = '/'; - this.maxAge = null; - this.httpOnly = true; - if (options) utils.merge(this, options); - Object.defineProperty(this, 'req', { value: req }); - this.originalMaxAge = undefined == this.originalMaxAge - ? this.maxAge - : this.originalMaxAge; -}; - -/*! - * Prototype. - */ - -Cookie.prototype = { - - /** - * Set expires `date`. - * - * @param {Date} date - * @api public - */ - - set expires(date) { - this._expires = date; - this.originalMaxAge = this.maxAge; - }, - - /** - * Get expires `date`. - * - * @return {Date} - * @api public - */ - - get expires() { - return this._expires; - }, - - /** - * Set expires via max-age in `ms`. - * - * @param {Number} ms - * @api public - */ - - set maxAge(ms) { - this.expires = 'number' == typeof ms - ? new Date(Date.now() + ms) - : ms; - }, - - /** - * Get expires max-age in `ms`. - * - * @return {Number} - * @api public - */ - - get maxAge() { - return this.expires instanceof Date - ? this.expires.valueOf() - Date.now() - : this.expires; - }, - - /** - * Return cookie data object. - * - * @return {Object} - * @api private - */ - - get data() { - return { - originalMaxAge: this.originalMaxAge - , expires: this._expires - , secure: this.secure - , httpOnly: this.httpOnly - , domain: this.domain - , path: this.path - } - }, - - /** - * Return a serialized cookie string. - * - * @return {String} - * @api public - */ - - serialize: function(name, val){ - val = utils.sign(val, this.req.secret); - return utils.serializeCookie(name, val, this.data); - }, - - /** - * Return JSON representation of this cookie. - * - * @return {Object} - * @api private - */ - - toJSON: function(){ - return this.data; - } -}; diff --git a/node_modules/express/node_modules/connect/lib/middleware/session/memory.js b/node_modules/express/node_modules/connect/lib/middleware/session/memory.js deleted file mode 100644 index ec569f5..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/session/memory.js +++ /dev/null @@ -1,131 +0,0 @@ - -/*! - * Connect - session - MemoryStore - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Store = require('./store') - , utils = require('../../utils') - , Session = require('./session'); - -/** - * Initialize a new `MemoryStore`. - * - * @api public - */ - -var MemoryStore = module.exports = function MemoryStore() { - this.sessions = {}; -}; - -/** - * Inherit from `Store.prototype`. - */ - -MemoryStore.prototype.__proto__ = Store.prototype; - -/** - * Attempt to fetch session by the given `sid`. - * - * @param {String} sid - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.get = function(sid, fn){ - var self = this; - process.nextTick(function(){ - var expires - , sess = self.sessions[sid]; - if (sess) { - sess = JSON.parse(sess); - expires = 'string' == typeof sess.cookie.expires - ? new Date(sess.cookie.expires) - : sess.cookie.expires; - if (!expires || new Date < expires) { - fn(null, sess); - } else { - self.destroy(sid, fn); - } - } else { - fn(); - } - }); -}; - -/** - * Commit the given `sess` object associated with the given `sid`. - * - * @param {String} sid - * @param {Session} sess - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.set = function(sid, sess, fn){ - var self = this; - process.nextTick(function(){ - self.sessions[sid] = JSON.stringify(sess); - fn && fn(); - }); -}; - -/** - * Destroy the session associated with the given `sid`. - * - * @param {String} sid - * @api public - */ - -MemoryStore.prototype.destroy = function(sid, fn){ - var self = this; - process.nextTick(function(){ - delete self.sessions[sid]; - fn && fn(); - }); -}; - -/** - * Invoke the given callback `fn` with all active sessions. - * - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.all = function(fn){ - var arr = [] - , keys = Object.keys(this.sessions); - for (var i = 0, len = keys.length; i < len; ++i) { - arr.push(this.sessions[keys[i]]); - } - fn(null, arr); -}; - -/** - * Clear all sessions. - * - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.clear = function(fn){ - this.sessions = {}; - fn && fn(); -}; - -/** - * Fetch number of sessions. - * - * @param {Function} fn - * @api public - */ - -MemoryStore.prototype.length = function(fn){ - fn(null, Object.keys(this.sessions).length); -}; diff --git a/node_modules/express/node_modules/connect/lib/middleware/session/session.js b/node_modules/express/node_modules/connect/lib/middleware/session/session.js deleted file mode 100644 index eba8fcf..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/session/session.js +++ /dev/null @@ -1,117 +0,0 @@ - -/*! - * Connect - session - Session - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../../utils') - , Cookie = require('./cookie'); - -/** - * Create a new `Session` with the given request and `data`. - * - * @param {IncomingRequest} req - * @param {Object} data - * @api private - */ - -var Session = module.exports = function Session(req, data) { - Object.defineProperty(this, 'req', { value: req }); - Object.defineProperty(this, 'id', { value: req.sessionID }); - if ('object' == typeof data) utils.merge(this, data); -}; - -/** - * Update reset `.cookie.maxAge` to prevent - * the cookie from expiring when the - * session is still active. - * - * @return {Session} for chaining - * @api public - */ - -Session.prototype.touch = function(){ - return this.resetMaxAge(); -}; - -/** - * Reset `.maxAge` to `.originalMaxAge`. - * - * @return {Session} for chaining - * @api public - */ - -Session.prototype.resetMaxAge = function(){ - this.cookie.maxAge = this.cookie.originalMaxAge; - return this; -}; - -/** - * Save the session data with optional callback `fn(err)`. - * - * @param {Function} fn - * @return {Session} for chaining - * @api public - */ - -Session.prototype.save = function(fn){ - this.req.sessionStore.set(this.id, this, fn || function(){}); - return this; -}; - -/** - * Re-loads the session data _without_ altering - * the maxAge properties. Invokes the callback `fn(err)`, - * after which time if no exception has occurred the - * `req.session` property will be a new `Session` object, - * although representing the same session. - * - * @param {Function} fn - * @return {Session} for chaining - * @api public - */ - -Session.prototype.reload = function(fn){ - var req = this.req - , store = this.req.sessionStore; - store.get(this.id, function(err, sess){ - if (err) return fn(err); - if (!sess) return fn(new Error('failed to load session')); - store.createSession(req, sess); - fn(); - }); - return this; -}; - -/** - * Destroy `this` session. - * - * @param {Function} fn - * @return {Session} for chaining - * @api public - */ - -Session.prototype.destroy = function(fn){ - delete this.req.session; - this.req.sessionStore.destroy(this.id, fn); - return this; -}; - -/** - * Regenerate this request's session. - * - * @param {Function} fn - * @return {Session} for chaining - * @api public - */ - -Session.prototype.regenerate = function(fn){ - this.req.sessionStore.regenerate(this.req, fn); - return this; -}; diff --git a/node_modules/express/node_modules/connect/lib/middleware/session/store.js b/node_modules/express/node_modules/connect/lib/middleware/session/store.js deleted file mode 100644 index d72d156..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/session/store.js +++ /dev/null @@ -1,86 +0,0 @@ - -/*! - * Connect - session - Store - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , Session = require('./session') - , Cookie = require('./cookie') - , utils = require('../../utils'); - -/** - * Initialize abstract `Store`. - * - * @api private - */ - -var Store = module.exports = function Store(options){}; - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Store.prototype.__proto__ = EventEmitter.prototype; - -/** - * Re-generate the given requests's session. - * - * @param {IncomingRequest} req - * @return {Function} fn - * @api public - */ - -Store.prototype.regenerate = function(req, fn){ - var self = this; - this.destroy(req.sessionID, function(err){ - self.generate(req); - fn(err); - }); -}; - -/** - * Load a `Session` instance via the given `sid` - * and invoke the callback `fn(err, sess)`. - * - * @param {String} sid - * @param {Function} fn - * @api public - */ - -Store.prototype.load = function(sid, fn){ - var self = this; - this.get(sid, function(err, sess){ - if (err) return fn(err); - if (!sess) return fn(); - var req = { sessionID: sid, sessionStore: self }; - sess = self.createSession(req, sess); - fn(null, sess); - }); -}; - -/** - * Create session from JSON `sess` data. - * - * @param {IncomingRequest} req - * @param {Object} sess - * @return {Session} - * @api private - */ - -Store.prototype.createSession = function(req, sess){ - var expires = sess.cookie.expires - , orig = sess.cookie.originalMaxAge - , update = null == update ? true : false; - sess.cookie = new Cookie(req, sess.cookie); - if ('string' == typeof expires) sess.cookie.expires = new Date(expires); - sess.cookie.originalMaxAge = orig; - req.session = new Session(req, sess); - return req.session; -}; \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/lib/middleware/static.js b/node_modules/express/node_modules/connect/lib/middleware/static.js deleted file mode 100644 index 7c5e2f3..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/static.js +++ /dev/null @@ -1,246 +0,0 @@ -/*! - * Connect - staticProvider - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var fs = require('fs') - , path = require('path') - , join = path.join - , basename = path.basename - , normalize = path.normalize - , utils = require('../utils') - , Buffer = require('buffer').Buffer - , parse = require('url').parse - , mime = require('mime'); - -/** - * Static: - * - * Static file server with the given `root` path. - * - * Examples: - * - * var oneDay = 86400000; - * - * connect() - * .use(connect.static(__dirname + '/public')) - * - * connect() - * .use(connect.static(__dirname + '/public', { maxAge: oneDay })) - * - * Options: - * - * - `maxAge` Browser cache maxAge in milliseconds. defaults to 0 - * - `hidden` Allow transfer of hidden files. defaults to false - * - `redirect` Redirect to trailing "/" when the pathname is a dir - * - * @param {String} root - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function static(root, options){ - options = options || {}; - - // root required - if (!root) throw new Error('static() root path required'); - options.root = root; - - return function static(req, res, next) { - options.path = req.url; - options.getOnly = true; - send(req, res, next, options); - }; -}; - -/** - * Expose mime module. - * - * If you wish to extend the mime table use this - * reference to the "mime" module in the npm registry. - */ - -exports.mime = mime; - -/** - * decodeURIComponent. - * - * Allows V8 to only deoptimize this fn instead of all - * of send(). - * - * @param {String} path - * @api private - */ - -function decode(path){ - try { - return decodeURIComponent(path); - } catch (err) { - return err; - } -} - -/** - * Attempt to tranfer the requested file to `res`. - * - * @param {ServerRequest} - * @param {ServerResponse} - * @param {Function} next - * @param {Object} options - * @api private - */ - -var send = exports.send = function(req, res, next, options){ - options = options || {}; - if (!options.path) throw new Error('path required'); - - // setup - var maxAge = options.maxAge || 0 - , ranges = req.headers.range - , head = 'HEAD' == req.method - , get = 'GET' == req.method - , root = options.root ? normalize(options.root) : null - , redirect = false === options.redirect ? false : true - , getOnly = options.getOnly - , fn = options.callback - , hidden = options.hidden - , done; - - // replace next() with callback when available - if (fn) next = fn; - - // ignore non-GET requests - if (getOnly && !get && !head) return next(); - - // parse url - var url = parse(options.path) - , path = decode(url.pathname) - , type; - - if (path instanceof URIError) return next(utils.error(400)); - - // null byte(s) - if (~path.indexOf('\0')) return next(utils.error(400)); - - // when root is not given, consider .. malicious - if (!root && ~path.indexOf('..')) return next(utils.error(403)); - - // index.html support - if ('/' == path[path.length - 1]) path += 'index.html'; - - // join / normalize from optional root dir - path = normalize(join(root, path)); - - // malicious path - if (root && 0 != path.indexOf(root)) return next(utils.error(403)); - - // "hidden" file - if (!hidden && '.' == basename(path)[0]) return next(); - - fs.stat(path, function(err, stat){ - // mime type - type = mime.lookup(path); - - // ignore ENOENT - if (err) { - if (fn) return fn(err); - return ('ENOENT' == err.code || 'ENAMETOOLONG' == err.code) - ? next() - : next(err); - // redirect directory in case index.html is present - } else if (stat.isDirectory()) { - if (!redirect) return next(); - res.statusCode = 301; - res.setHeader('Location', url.pathname + '/'); - res.end('Redirecting to ' + url.pathname + '/'); - return; - } - - // header fields - if (!res.getHeader('Date')) res.setHeader('Date', new Date().toUTCString()); - if (!res.getHeader('Cache-Control')) res.setHeader('Cache-Control', 'public, max-age=' + (maxAge / 1000)); - if (!res.getHeader('Last-Modified')) res.setHeader('Last-Modified', stat.mtime.toUTCString()); - if (!res.getHeader('Content-Type')) { - var charset = mime.charsets.lookup(type); - res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')); - } - res.setHeader('Accept-Ranges', 'bytes'); - - // conditional GET support - if (utils.conditionalGET(req)) { - if (!utils.modified(req, res)) { - req.emit('static'); - return utils.notModified(res); - } - } - - var opts = {} - , len = stat.size; - - // we have a Range request - if (ranges) { - ranges = utils.parseRange(len, ranges); - - // valid - if (ranges) { - opts.start = ranges[0].start; - opts.end = ranges[0].end; - - // unsatisfiable range - if (opts.start > len - 1) { - res.setHeader('Content-Range', 'bytes */' + stat.size); - return next(utils.error(416)); - } - - // limit last-byte-pos to current length - if (opts.end > len - 1) opts.end= len - 1; - - // Content-Range - len = opts.end - opts.start + 1; - res.statusCode = 206; - res.setHeader('Content-Range', 'bytes ' - + opts.start - + '-' - + opts.end - + '/' - + stat.size); - } - } - - res.setHeader('Content-Length', len); - - // transfer - if (head) return res.end(); - - // stream - var stream = fs.createReadStream(path, opts); - req.emit('static', stream); - req.on('close', stream.destroy.bind(stream)); - stream.pipe(res); - - // callback - if (fn) { - function callback(err) { done || fn(err); done = true } - req.on('close', callback); - req.socket.on('error', callback); - stream.on('error', callback); - stream.on('end', callback); - } else { - stream.on('error', function(err){ - if (res.headerSent) { - console.error(err.stack); - req.destroy(); - } else { - next(err); - } - }); - } - }); -}; diff --git a/node_modules/express/node_modules/connect/lib/middleware/staticCache.js b/node_modules/express/node_modules/connect/lib/middleware/staticCache.js deleted file mode 100644 index 34bf132..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/staticCache.js +++ /dev/null @@ -1,188 +0,0 @@ - -/*! - * Connect - staticCache - * Copyright(c) 2011 Sencha Inc. - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , utils = require('../utils') - , Cache = require('../cache') - , url = require('url') - , fs = require('fs'); - -/** - * Static cache: - * - * Enables a memory cache layer on top of - * the `static()` middleware, serving popular - * static files. - * - * By default a maximum of 128 objects are - * held in cache, with a max of 256k each, - * totalling ~32mb. - * - * A Least-Recently-Used (LRU) cache algo - * is implemented through the `Cache` object, - * simply rotating cache objects as they are - * hit. This means that increasingly popular - * objects maintain their positions while - * others get shoved out of the stack and - * garbage collected. - * - * Benchmarks: - * - * static(): 2700 rps - * node-static: 5300 rps - * static() + staticCache(): 7500 rps - * - * Options: - * - * - `maxObjects` max cache objects [128] - * - `maxLength` max cache object length 256kb - * - * @param {Type} name - * @return {Type} - * @api public - */ - -module.exports = function staticCache(options){ - var options = options || {} - , cache = new Cache(options.maxObjects || 128) - , maxlen = options.maxLength || 1024 * 256; - - return function staticCache(req, res, next){ - var path = url.parse(req.url).pathname - , ranges = req.headers.range - , hit = cache.get(path) - , hitCC - , uaCC - , header - , age; - - function miss() { - res.setHeader('X-Cache', 'MISS'); - next(); - } - - // cache static - // TODO: change from staticCache() -> static() - // and make this work for any request - req.on('static', function(stream){ - var headers = res._headers - , cc = utils.parseCacheControl(headers['cache-control'] || '') - , contentLength = headers['content-length'] - , hit; - - // ignore larger files - if (!contentLength || contentLength > maxlen) return; - - // don't cache partial files - if (headers['content-range']) return; - - // dont cache items we shouldn't be - // TODO: real support for must-revalidate / no-cache - if ( cc['no-cache'] - || cc['no-store'] - || cc['private'] - || cc['must-revalidate']) return; - - // if already in cache then validate - if (hit = cache.get(path)){ - if (headers.etag == hit[0].etag) { - hit[0].date = new Date; - return; - } else { - cache.remove(path); - } - } - - // validation notifiactions don't contain a steam - if (null == stream) return; - - // add the cache object - var arr = cache.add(path); - arr.push(headers); - - // store the chunks - stream.on('data', function(chunk){ - arr.push(chunk); - }); - - // flag it as complete - stream.on('end', function(){ - arr.complete = true; - }); - }); - - // cache hit, doesnt support range requests - if (hit && hit.complete && !ranges) { - header = utils.merge({}, hit[0]); - header.Age = age = (new Date - new Date(header.date)) / 1000 | 0; - header.date = new Date().toUTCString(); - - // parse cache-controls - hitCC = utils.parseCacheControl(header['cache-control'] || ''); - uaCC = utils.parseCacheControl(req.headers['cache-control'] || ''); - - // check if we must revalidate(bypass) - if (hitCC['no-cache'] || uaCC['no-cache']) return miss(); - - // check freshness of entity - if (isStale(hitCC, age) || isStale(uaCC, age)) return miss(); - - // conditional GET support - if (utils.conditionalGET(req)) { - if (!utils.modified(req, res, header)) { - header['content-length'] = 0; - res.writeHead(304, header); - return res.end(); - } - } - - // HEAD support - if ('HEAD' == req.method) { - res.writeHead(200, header); - return res.end(); - } - - // respond with cache - header['x-cache'] = 'HIT'; - res.writeHead(200, header); - - // backpressure - function write(i) { - var buf = hit[i]; - if (!buf) return res.end(); - if (false === res.write(buf)) { - res.once('drain', function(){ - write(++i); - }); - } else { - write(++i); - } - } - - return write(1); - } - - miss(); - } -}; - -/** - * Check if cache item is stale - * - * @param {Object} cc - * @param {Number} age - * @return {Boolean} - * @api private - */ - -function isStale(cc, age) { - return cc['max-age'] && cc['max-age'] <= age; -} \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/lib/middleware/urlencoded.js b/node_modules/express/node_modules/connect/lib/middleware/urlencoded.js deleted file mode 100644 index 1d9149c..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/urlencoded.js +++ /dev/null @@ -1,54 +0,0 @@ - -/*! - * Connect - urlencoded - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var utils = require('../utils') - , qs = require('qs'); - -/** - * Urlencoded: - * - * Parse x-ww-form-urlencoded request bodies, - * providing the parsed object as `req.body`. - * - * @param {Object} options - * @return {Function} - * @api public - */ - -exports = module.exports = function(options){ - options = options || {}; - return function urlencoded(req, res, next) { - if (req._body) return next(); - req.body = req.body || {}; - - // check Content-Type - if ('application/x-www-form-urlencoded' != utils.mime(req)) return next(); - - // flag as parsed - req._body = true; - - // parse - var buf = ''; - req.setEncoding('utf8'); - req.on('data', function(chunk){ buf += chunk }); - req.on('end', function(){ - try { - req.body = buf.length - ? qs.parse(buf, options) - : {}; - next(); - } catch (err){ - next(err); - } - }); - } -}; \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/lib/middleware/vhost.js b/node_modules/express/node_modules/connect/lib/middleware/vhost.js deleted file mode 100644 index 897a9d8..0000000 --- a/node_modules/express/node_modules/connect/lib/middleware/vhost.js +++ /dev/null @@ -1,40 +0,0 @@ - -/*! - * Connect - vhost - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Vhost: - * - * Setup vhost for the given `hostname` and `server`. - * - * connect() - * .use(connect.vhost('foo.com', fooApp)) - * .use(connect.vhost('bar.com', barApp)) - * .use(connect.vhost('*.com', mainApp)) - * - * The `server` may be a Connect server or - * a regular Node `http.Server`. - * - * @param {String} hostname - * @param {Server} server - * @return {Function} - * @api public - */ - -module.exports = function vhost(hostname, server){ - if (!hostname) throw new Error('vhost hostname required'); - if (!server) throw new Error('vhost server required'); - var regexp = new RegExp('^' + hostname.replace(/[*]/g, '(.*?)') + '$', 'i'); - if (server.onvhost) server.onvhost(hostname); - return function vhost(req, res, next){ - if (!req.headers.host) return next(); - var host = req.headers.host.split(':')[0]; - if (!regexp.test(host)) return next(); - if ('function' == typeof server) return server(req, res, next); - server.emit('request', req, res); - }; -}; diff --git a/node_modules/express/node_modules/connect/lib/patch.js b/node_modules/express/node_modules/connect/lib/patch.js deleted file mode 100644 index 7cf0012..0000000 --- a/node_modules/express/node_modules/connect/lib/patch.js +++ /dev/null @@ -1,79 +0,0 @@ - -/*! - * Connect - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , res = http.ServerResponse.prototype - , setHeader = res.setHeader - , _renderHeaders = res._renderHeaders - , writeHead = res.writeHead; - -// apply only once - -if (!res._hasConnectPatch) { - - /** - * Provide a public "header sent" flag - * until node does. - * - * @return {Boolean} - * @api public - */ - - res.__defineGetter__('headerSent', function(){ - return this._header; - }); - - /** - * Set header `field` to `val`, special-casing - * the `Set-Cookie` field for multiple support. - * - * @param {String} field - * @param {String} val - * @api public - */ - - res.setHeader = function(field, val){ - var key = field.toLowerCase() - , prev; - - // special-case Set-Cookie - if (this._headers && 'set-cookie' == key) { - if (prev = this.getHeader(field)) { - val = Array.isArray(prev) - ? prev.concat(val) - : [prev, val]; - } - // charset - } else if ('content-type' == key && this.charset) { - val += '; charset=' + this.charset; - } - - return setHeader.call(this, field, val); - }; - - /** - * Proxy to emit "header" event. - */ - - res._renderHeaders = function(){ - if (!this._emittedHeader) this.emit('header'); - this._emittedHeader = true; - return _renderHeaders.call(this); - }; - - res.writeHead = function(){ - if (!this._emittedHeader) this.emit('header'); - this._emittedHeader = true; - return writeHead.apply(this, arguments); - }; - - res._hasConnectPatch = true; -} diff --git a/node_modules/express/node_modules/connect/lib/proto.js b/node_modules/express/node_modules/connect/lib/proto.js deleted file mode 100644 index c9575b3..0000000 --- a/node_modules/express/node_modules/connect/lib/proto.js +++ /dev/null @@ -1,231 +0,0 @@ - -/*! - * Connect - HTTPServer - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , parse = require('url').parse - , utils = require('./utils') - , debug = require('debug')('connect:dispatcher'); - -// prototype - -var app = module.exports = {}; - -// environment - -var env = process.env.NODE_ENV || 'development'; - -/** - * Utilize the given middleware `handle` to the given `route`, - * defaulting to _/_. This "route" is the mount-point for the - * middleware, when given a value other than _/_ the middleware - * is only effective when that segment is present in the request's - * pathname. - * - * For example if we were to mount a function at _/admin_, it would - * be invoked on _/admin_, and _/admin/settings_, however it would - * not be invoked for _/_, or _/posts_. - * - * Examples: - * - * var app = connect(); - * app.use(connect.favicon()); - * app.use(connect.logger()); - * app.use(connect.static(__dirname + '/public')); - * - * If we wanted to prefix static files with _/public_, we could - * "mount" the `static()` middleware: - * - * app.use('/public', connect.static(__dirname + '/public')); - * - * This api is chainable, so the following is valid: - * - * connect - * .use(connect.favicon()) - * .use(connect.logger()) - * .use(connect.static(__dirname + '/public')) - * .listen(3000); - * - * @param {String|Function|Server} route, callback or server - * @param {Function|Server} callback or server - * @return {Server} for chaining - * @api public - */ - -app.use = function(route, fn){ - // default route to '/' - if ('string' != typeof route) { - fn = route; - route = '/'; - } - - // wrap sub-apps - if ('function' == typeof fn.handle) { - var server = fn; - fn.route = route; - fn = function(req, res, next){ - server.handle(req, res, next); - }; - } - - // wrap vanilla http.Servers - if (fn instanceof http.Server) { - fn = fn.listeners('request')[0]; - } - - // strip trailing slash - if ('/' == route[route.length - 1]) { - route = route.slice(0, -1); - } - - // add the middleware - debug('use %s %s', route || '/', fn.name || 'anonymous'); - this.stack.push({ route: route, handle: fn }); - - return this; -}; - -/** - * Handle server requests, punting them down - * the middleware stack. - * - * @api private - */ - -app.handle = function(req, res, out) { - var stack = this.stack - , fqdn = ~req.url.indexOf('://') - , removed = '' - , slashAdded = false - , index = 0; - - function next(err) { - var layer, path, status, c; - - if (slashAdded) { - req.url = req.url.substr(1); - slashAdded = false; - } - - req.url = removed + req.url; - req.originalUrl = req.originalUrl || req.url; - removed = ''; - - // next callback - layer = stack[index++]; - - // all done - if (!layer || res.headerSent) { - // delegate to parent - if (out) return out(err); - - // unhandled error - if (err) { - // default to 500 - if (res.statusCode < 400) res.statusCode = 500; - debug('default %s', res.statusCode); - - // respect err.status - if (err.status) res.statusCode = err.status; - - // production gets a basic error message - var msg = 'production' == env - ? http.STATUS_CODES[res.statusCode] - : err.stack || err.toString(); - - // log to stderr in a non-test env - if ('test' != env) console.error(err.stack || err.toString()); - if (res.headerSent) return req.socket.destroy(); - res.setHeader('Content-Type', 'text/plain'); - res.setHeader('Content-Length', Buffer.byteLength(msg)); - if ('HEAD' == req.method) return res.end(); - res.end(msg); - } else { - debug('default 404'); - res.statusCode = 404; - res.setHeader('Content-Type', 'text/plain'); - if ('HEAD' == req.method) return res.end(); - res.end('Cannot ' + req.method + ' ' + utils.escape(req.originalUrl)); - } - return; - } - - try { - path = parse(req.url).pathname; - if (undefined == path) path = '/'; - - // skip this layer if the route doesn't match. - if (0 != path.indexOf(layer.route)) return next(err); - - c = path[layer.route.length]; - if (c && '/' != c && '.' != c) return next(err); - - // Call the layer handler - // Trim off the part of the url that matches the route - removed = layer.route; - req.url = req.url.substr(removed.length); - - // Ensure leading slash - if (!fqdn && '/' != req.url[0]) { - req.url = '/' + req.url; - slashAdded = true; - } - - debug('%s', layer.handle.name || 'anonymous'); - var arity = layer.handle.length; - if (err) { - if (arity === 4) { - layer.handle(err, req, res, next); - } else { - next(err); - } - } else if (arity < 4) { - layer.handle(req, res, next); - } else { - next(); - } - } catch (e) { - next(e); - } - } - next(); -}; - -/** - * Listen for connections. - * - * This method takes the same arguments - * as node's `http.Server#listen()`. - * - * HTTP and HTTPS: - * - * If you run your application both as HTTP - * and HTTPS you may wrap them individually, - * since your Connect "server" is really just - * a JavaScript `Function`. - * - * var connect = require('connect') - * , http = require('http') - * , https = require('https'); - * - * var app = connect(); - * - * http.createServer(app).listen(80); - * https.createServer(options, app).listen(443); - * - * @return {http.Server} - * @api public - */ - -app.listen = function(){ - var server = http.createServer(this); - return server.listen.apply(server, arguments); -}; diff --git a/node_modules/express/node_modules/connect/lib/public/directory.html b/node_modules/express/node_modules/connect/lib/public/directory.html deleted file mode 100644 index 15164bb..0000000 --- a/node_modules/express/node_modules/connect/lib/public/directory.html +++ /dev/null @@ -1,75 +0,0 @@ - - - listing directory {directory} - - - - - -
    -

    {linked-path}

    - {files} -
    - - \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/lib/public/error.html b/node_modules/express/node_modules/connect/lib/public/error.html deleted file mode 100644 index c5ae73a..0000000 --- a/node_modules/express/node_modules/connect/lib/public/error.html +++ /dev/null @@ -1,13 +0,0 @@ - - - {error} - - - -
    -

    {title}

    -

    {statusCode} {error}

    -
      {stack}
    -
    - - diff --git a/node_modules/express/node_modules/connect/lib/public/favicon.ico b/node_modules/express/node_modules/connect/lib/public/favicon.ico deleted file mode 100644 index 895fc96a76b68b4924f1c51d022e1b82fa0f461f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1406 zcmZQzU<5(|0R}M0U}azs1F|%L7$l?s#Ec9aKoZP=&}i&OouUjIY8@C}uZw4x5z5N2 zvEG^C^vXtt_xtJ?p3O32c(KTx;lsgZhW%5M85Sf}k-mf`L80)|7ga~M{a znlL=>m1Q`#uoPkbC~GtXMnhnDh5$DU1D6mx+;2QAKt3ZQFH}H~1y~00GcqzVg9QXw z_<%(a7y$V|wJgF=E>MgE#Aid|14}IyCM5MhEnxFF;pTzOK(>#80puP=gnOXwAd33` mpMe2}f66m3eB@_fcnmb^7!b1nO#opK8zcsj1F30)+jEP);68^d)m`eN0o>(5%D`Q(1;j>g@G;xlf`0VBQ`PFY?6)!N&f?*K}$p; zB!U=NBn{eB8${1}&-2_L*HuZp@ZP1@clS@cHp)4iM1ewzw59vko7eMM{e9z|%NNdX z0V;`?KKSzTCvTm5bc{L^CIKLUxc2X{i{ISz$8Sgf{q)1nXTP{`{s?9mQ$4&hPiKC- zY8q7(Y1Xu5iCf33=O4Vy(+|zQ?rW#gkKB0f%}?+6{G*qT22|DQB-73`YzA{N4W^=s zq0kQYcbtFfz zLz)H<&|z(Y4kBG67=JY6c|L1R-#TR>fC$3^Y%QEnYO1xHsf)+GU`3F<{J0kR(;pbF3)zyg$H+idfnl-wl5Wkh!vUH z4Z32YP=l_}1rZd1W_D&^$A($A+&a0e&P?xx0!ctY2}*<#p+qPVN*B(YzvAWXa*%bzq z7Fz41LKILT(GWohi9|LgIzSZBhb*Zf6R6O}WYQ4GOi&71s9lmll0x6;8&ILOl$j(c z0Z1T(6Tg09{?wd{moFHNN6PS?$|e>1MxSJ(0Z7o2)J-Zv|>acY@f`(Y@g7GwsEj5NLQo+q|HsxQ5}XSX_d@*^A9ZT9=A{W~j+$GyI1 zc4oqTHx@1FlRjw4XWyPN5i2~l_F3@aBk!0yu^aoRDvXy}8@HCjUVQUsuSH4$T5|r< zzZOn^?Wfa6y|Q($Hx4{ws+)wX6-HP4zo!S?4KJ@7PG@G3G{CjXs(p*kIrj6rHs7_y z+=<-=Q62s9FuWa^X~WKgJIAAZJR&XBB002ovPDHLkV1jCMPILeO diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png b/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png deleted file mode 100644 index 89ee2da0753040d1ba0a3487473a715a8fe89322..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 794 zcmV+#1LgdQP)i_t#ewV_0K6;=bl;e_Jt7$~$sQ)q$+ia<4Ec+jeaGt9oWH@O|2`W6&O0t!k{B9sUvLWxkCaPsd9W(`fa z;j-|^ZI^2XnzhgZWYRW-kP&J>DWPo`%;JaBX}or79k=+Jo@h%4Eo72tqev+cB?PjP zO<|ByL#>Tehyq$jR74O$B9WDW1`tK`LzYyL3A9iAcRxLkJ`I)n}v%Od-3H>j$OTBtk>(k-9o?8PqI=0 zB&f-+KOXVnjyKJlf4iHOtnuiE_4+ZVJ$dHjU<^o^YCjQ-wt^!;rPpBv(@pFO{9rdw98 z_s@3+yta93oyfL>7AD5}r=|`zS3Gm$_|(iSl8XBd9k%=91J0j2=ivT5cJ18ZmDjh{ z$-RMd{jQ#X79#Sc diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_code.png b/node_modules/express/node_modules/connect/lib/public/icons/page_code.png deleted file mode 100644 index f7ea90419d950f9e69d977a1f5847456d96a5f0b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 818 zcmV-21I_%2P)@LCln44|RX7Ti z0HI3&7jPq){odH{?_{%nYVq_;n_c4WbUpvU(&Cvnj!vq|kVC-vpF6vp^;;e0mm6HW z+WPzA`AZ|;pPp$&dNjzrc??4rt`k%Q1l*u-BPD0MQ}Fbm8jnsyezNt7+u{23>t7Em zJtETY?ja9KrVs^!LJ$xEMF3-bAZO;-IQJavE60KA7fO$VY_%N)R6s>g5mW>fL4&aR z*EVgKKTBXm!=L?S0?xM zYqL@C$|EDF2q*3zWW7;PDZ}SK*IE8;i!3U62=qn80C&*I1Le7WwNP5EcX;_oh2dJn zf#HgBe4@r$GcjHjmj2vAfT%(YN?}kK=(*+1*DkNNc1H5R++vfBMhACi<5uFUU+N4+ z<&U*CPmWi}REa7C6-t>2im1CWv5Jkefxa6>)dEj-CAW wWa{_}BJ!}~75?MkfaCnj>Dn=~vkLS70Pk`;z)@TQj{pDw07*qoM6N<$f@imYHUIzs diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png b/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png deleted file mode 100644 index 195dc6d6c365d298e466026b37c1959d96119ea7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 663 zcmV;I0%-k-P)^@R5;6Z z(>-WZK@^7J_sq=QY_e{46@P+~LNG}sRzZsxQHvCsN*h5ir6^j7pq-$xu$N#V1gx}9 zClV7;5)7zih-s3DB)G=7|99>ji@So7-P24n=VQ(@GctDX!^_@$bj%oviY6e4Dh;od zooe%Wvs8LEKQ&&bL&@bwi=STIAI@!-gB2jC5+?y?VR~VkrNxam-`6*8&po|RZ5LpS zNKdJ%c4bTX`XjKsnecf%W>1%6WT?pKNdLLq{=(f(Col?P1+oq@R>)W(n=x!|*BIIh z6DJGw_w`)u6yN|vAhMteYK5#b%r5^v+VCFl1IGssaclZZMS{vs-LJ2$)n7DAr6==K z<29#%AXsBsDoO}SBaXR#_Ap!JKx)(1)3O2pj0_dYWz5By*X74fRT01$Fk%P_RzOMDtV?GU{nsYq#K8iy zb6qzLYDj`_f5$BwC*WE(t0m#xYJ*=jC2|HQYHh=pf#QG7oowi`h!L!{DB$8|qY{~X zu8@sU1tWq;n$XThR0%;45mdqXM892|{CJ@0DS*}>?ami06Q_^tvM~Y3K(_-`#m!8f z8f!QIrH4y#61;0Ym0cCoLl8{IPombPHtnn7%SbTdI&G-d>ZQo!_wBMF9nzX!g8HVY xYTJPGciz9XMh3w2fmZ(7v{)r*QZD48?mrio{~IaoqP z|1Ep}yDQG09bP~E^Dk?@JiKQJ z6-pO(3~IOP)IYisL6D6;oAEd;E%zR}{U$rMRNuD6nQV7nesKS>)yLo7JuDCrD>Abi zbj3uW23?^GA}9jQ{M^8v?ejL?HaT7AX5WPZNkBmfN`w-jL?{tT7ykZt$%Yln?p_m~ z-?>&d(LD(jAd}h=LPltPQbO$*Wbyl@G-_k5jXbb#qffHY03>M1jfEqoPJQ6Mr=Byp=^jfzePZV1 zLjCmNi31hdIJHa%e;5g=1(`u3BRzfeExY%=VCu{loOr{`%2hUR*x>tL^W_TTaj);0 zpPR6CUD1+0>4TQ6zVfH3TQ;%l6#(_%yspK@3gcmG#Q4!WCPyLU93nMKk7E2pcA=l45({2jNho>sdF*A~bA zxX?-cp~y_z_kFf+yqu3m#QiB}03?Z&9vvR5TNgj<)($Vm)xq5G>|o2sFMag&6aNF+ WAT1?sQBYt20000iHtsh1EzPArg^Q zIZrOk#rNsfjaSbMAL;<4h;Z=jvu8dzyz8N&Nb7=z03ZUw?9z%8KQEa6yM5=kUnka& z3?FJk2}L7q>na=T#;<7U*P91xfF`;`6%pVgWgRy0?1ZryL@%z52=-!fGXWGEn4M351L4<+7eDgwo|moqXT+s1&Kmn>-uQQ8mL7XY)w5Zk*(g+<3Y3tmkR!bL zOUKaUtj_pX26sH+=Iorwu}MGd`_%O-_sS}8VpG#fJA)Fcs#ezwtZf?q?Ac70mDv`rVs{$od?VPKeqf<-kUjNtS6ecB*mq<&M97K^6IVsDO zt2$Ru!b+>2S<}_H>$RcInusU_8PMNdf(W{sNlJ3FkrwMJPeBPO#d}Y^a{9TH(#{Y) l0D?dWAV4eUJX#h`!2gmISk&ZKd4B)^002ovPDHLkV1g&sd|Lnj diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_error.png b/node_modules/express/node_modules/connect/lib/public/icons/page_error.png deleted file mode 100644 index f07f449a44ff2761bfc7b752db3d08d0e1238b02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 793 zcmV+!1LpjRP)lHwhvrAu0-@MQwt}+5~MQTtu}C0%;W( z1<{R?aHBz*g;pk%AyQVBR_Zu5m~;ES_vxI-O!vIF|H*|T{l`n#garr?$RMk>)?Y48 z(ZF2yTneKb};DNWF+jK)IF`6_IfJ{i|F3o%Q+l&4_HGBD|ACE8na_6>L z=s{^>-C(a7J$6=8A_%h5W!1K6dcL!D?XX+Ndk)oei?UundDpX_E&1Y&`)3P8#Ny0s z2Ag7_&ZPhyGj%)g&S6V2LNun1;iBQm#Fwlfv zgyESZR$X}2P;=RW!2zid1r$hBL{K7>2qi*f7>pT1=RdT3@-anEoH{ z={KFOO;Dh#bV*jaN>}M>RZqQd`S=6O9C3KpI~I>l%QFYfo;jqQYe5fcn`)+)zMm6P z4X&L(>gnN0!%J4^rhX->?$S5bY<=GEU%jc!KLL8sww-Eg;h z`H-yBHa)yfojYT}&G*GFc$<(Yja_q=lZvj66DC^O5%$B)|Z(CeD=n`|eM04SP; z>-=-l+xdJjA~vR6^xB#o{ehf~tSM`iwaQv$O<8NIHA}W_WOw*~ XD^gE}t;YAo00000NkvXXu0mjfl6ZQ> diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png b/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png deleted file mode 100644 index eb6158eb5ca9c4b64c81e70e0fd894dbc8e2bed9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 817 zcmV-11J3-3P)hdKqhFO_H1|Vn1E?(=|cjAh_&P}y{{^`u< zcYD@PK?$)4i~7o9*6F_$F$4lR(d4AAvrez^(88Hk+)+B7E)M3jc=Ewl4$S^`_qwSF zA%qz@=c2EOsz@0qB1IqsqJU)HaG&+}%`-OM8YqW{K85hqj@4&V9vz!Cm_n0-W#f;# zeEpJde%vdgRn5?(+PY=W*z~|lT2-mtown({ll8&3S5+lWz5K}LTRW{k{eJn3Qz!SU zQ`@qI_n2;K?RG~pYJ9=dj-RWgG;P&wEuoAxL~Q)<>x0b=dED^Outj&xQ^rA;u3pw| zca_ClTh_d9cxXg_U!lLRl0`xU@$=UXO|_dRdtXfKwPawmnf(LC7u}-U>8k6}3u|{8 zs9LHr>MIJZGD^r9h|q2yF24Wuh+PM^yMN9GP1$khlDkdyCY}D{kg}jEf-(kW5jBY> z0rB29ZhG-r=i_R{;+1k0?A-sBM;AP6(k1i9ZuixR4?MqXOvphQgCYj~RnXKKL~J9Q zIDNz~XMfO{ZhUg&BTtMyXJqDVqc<x643?SvKHx004lTvR=0a5$dUw z>Xb470000$S;ka1sfH4I-R8njUol7M4dtApOahDylptpYswf1hD#CwFoz6oEA>(SIECU&IQ%a}GXdnC!9$70`0uH1B00000NkvXXu0mjf!8w72 diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_find.png b/node_modules/express/node_modules/connect/lib/public/icons/page_find.png deleted file mode 100644 index 2f193889f7ea091c292acdd684c595dcb206b5c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 879 zcmV-#1CacQP)@+1&aazfGU7ezSm^v zpACwO+tu0su66!(dT=`e05DeeCnCFJW(8|RKtKa{4LGONnx2V85A4m%PEQ?MEtR-esdM$pB-`H542D0)N2zSC6Imf)4L8?>%ZrW+H>xCKi$unm zvGZq-*Q%Aahx;C*=l+K%-?>XB)6TB$-L$r*`RUvlA`xP1NG2?)ge8@TQ4EN|Jks0u zcDg;oFC#-#R`YbWB`D?Q`1#y7l$LXhjSLf8AvQuB84}i#j0^!#g{VE#(K7h@5pFHy zSenl=@XBEdxp`h2Ji>CR%=qXJ7!e|?paKet-~;#ok#jETyeB(5&Bkhp;!+;51~G=) zH?L7xmDUu_h+a$+xuWom;AWW!mS$%%+436Rjc@}y?l1134kgD0AOf$OmjOR zstUlshZk$ZC!bAyIg{Y29z#&@3SJ;6D4+_eFume9^#TmMccC5u0J!ZCTnO6m$lnD| z5JeFHf`Xs~1vP>RLKI1GKDY<~pjr2&bi(fX;6Nj-ss@Ds0CcoO0H{JsEQkm{q03skAA);_bv3q{k31qwVo&s-q`Z?_e+j^w(WL? zl+uETs5+~xBU2};OqEE9ETLGwsMGe1%iTRNue)9}|0~E4B*@5#oRXZ9oRXZ9TqRep zPrGZuoOON4n@=uPbyP1y4G=+HktC6l(gZoFD>@_lXDrN?wo+zozGt3P=Qh+3L7+}q z2!WK7geXLnO3Vw;o12Skp%_E#+N#9;DDWP?Q-VS3B$v~Ha)dDzWn0zG~O(^_1!n0HYp-( z+;wPIdoFgQlpYV!10V>5@a)1LyGBMvoa}miyp(bxbMTM-FYNyx;V@TfYddyT00000 LNkvXXu0mjf90!wr diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_go.png b/node_modules/express/node_modules/connect/lib/public/icons/page_go.png deleted file mode 100644 index 80fe1ed0cc75fbb67e9398ae686641f8fb287238..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 779 zcmV+m1N8ifP)JNR2Ufr z!Apo%Wf%b9=l#x^8AolrB&K9H?Pg_|78WA8(M3toqE%3B#7*srcF`i*xhupr27%Nr ziguah1+mN)U5GNmyEfQ3-e%_i&-vb-Co#(>FJ+EhQEwjRYVQ(&UYy{U@%vbY||>@4x=B^vIqabI?L* z;-S&DS^V3-ni4^fl|HMkOEbgX)(390>A}|VIypb5Xee4g;7ck zwKh^A3Mi1Mh@eC$5lV!}Fw%sP623U`g3pd_Hr5sunLvTskx4}&Gm%Q6L}(l4x}jCe z*81q1_4-O*ffi~_nMslo?EQ8t*&Ec(pzEw$vc}pKn_Qp0>D7Jr>ATNC3w@9f|Y+U&+)#!t7l&wKp+nP{PQsb+fb=Yf!Fu&5j8vpRj{FT>jD z>d>$sx;A&+`n$HcF}&sYKSyR;=(=9tvvOj@hUG;~4qTYk^_@E=?$*^_pVh_bGnOt~ z;pEw)j{SK$XVc;qy181rT655gW9NG{(yeablViIL>cDI_ux8m>Pp{tY$J0lgo4#ax za?j0EA3s0S!f>{~ykN9h_RhM&g3K(E`q(dE(Rd49+%xMeR9{qlWnmd{s#(SQ>PmFtSQqUjAtB;_Vvt6}AS_5YgM`Uqu`yva+H8^=4U$e4gHb}u zAQ2N{V3A%pO|?Pv?tb6z=jC}SiRa$G^v3q?*6XcYz$p|cq{uLj@#~Fi`J(>5{@&&N zy%T^+;>8cXx%|o77anP?&W1?1A(>-T49z9pyeCl@7YI+Si zKti7=B~``}TImz(G{0PnlQA3P#MAd}sorMjkP!50B7$nAkU^%#nl{Q9lW0@}9fE-> zN(q7tRuiC_T1r|BBtVBTlQ2+70$Rf;eF`Z;lx46Cpu-rEgb)EBKq(b^W8l<^We(`D z43?0=01z<3G6+UUv6`CsWCk6^93!#+<;ws7007{zS3k2k9-zZKFO~(k`>s0y006+1 zgF_jyIhsL-`FMf~JL~C=cV75(CrJ|q;MVO961G=O zm9d)YpJg5g(4i_HKL75eSE}mq$Y}r}hyVdcV~p>6a}oXr80q`oj%+s700000NkvXX Hu0mjfPs|!l diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_key.png b/node_modules/express/node_modules/connect/lib/public/icons/page_key.png deleted file mode 100644 index d6626cb09eb11a298b90a8a27b0d8eab41f49a82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 801 zcmV++1K#|JP)$lC4gU2-`f*>nhR-;k6IP7e>YO!0^w)WK%3$w02v-#>5Ep64PCP| zJihT#O|N+nT7XR2h7dAB?UEAOhJF^mol1i`QtQB`HSY}RE7=r! z)zaVIHr5?>v2Gz&fdYw&2ug$!p+txby(aWZ7(4QT)l2`jX7eMQ{>)lG6ev(fWKxmH zOr%mM5$6B%u~qGtCf40#`mbGj3s!n+^%wnJ&#rl>g<4Z)lB5J6f!?|AP275)Zswr* z%T}4~{;_(?waU!#?JabbF3Cy-kf0{R{z}6$e=5yMQKt3BPcl2>zoTPMqMwF;3!_n|>sT?~bK_-2O_m+o>GJ6h zt=+g$4n7y%1qVJI7*5Yw(hqM=JusY{d}*?U(Oj*gT655eZ>Ksn(qrd7v3}DX1}C>` z+X+8@+4-pVq_fxG zlU}~Ye!0+%>J+pPk+0wV{GM$QaYM?5ux)w2z59=S&H2+K?;gH$bZGzL&g5>G ft+noNiyiPkP9r@8gT|RZ00000NkvXXu0mjfuqTIu diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png b/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png deleted file mode 100644 index 7e568703d6432c530224e443771a04fc1e2e59c6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 839 zcmV-N1GxN&P)73{`^;G#xwAtHz%LU)4b zqTRU=ve1RNa3QT=ZM7C`iJ~QFQ*9t7<~pX$d^7W%^M8FFCkcQj-~0ZRTBCB(J0^iD z-~e!d9LR`f3#|=(>$bPvx_D-~2jC%pJ=n_e_OK zeJ_2b-KdDDh@@UlzBSMC;EPygH_MwjWBnPGQegihBV73D?-x9PlHL9A=(Vg=8^d<4 z<9r=UkxuIm)*CO=9e###7PztDxUv}e?$0)rQicmYhV`pQ%S!g@;K(?TVfhM#E?bM| z=B0gfb6h@a8bf5FVT-SV~6}?X}9lK@@Yynoty&1zdZP@?RfODsl=2XzzU% zS8gIN43How+9%bK2S@Xbc`O>`z5`%^;pXGy8^4f>9^3!Sp@|O&)m;dOa3q6d;4P-l zca|=H_{G&m?D_+&-}r{u-J$5T=(X4R&)q|O^gN8cgv;s#@5sEPT5_Z)oFo9Ac>l+I zc4ng5zHpps|9)<_Rw>5bKzE(M1j)dFWI_%OH$BJSz0?T+02W0)_a>#vFqb!*d|5wB zzBUN|M&ty51O@=i?kiDrjQ{{}e|^rU?OS|RdxxP1p5mAw36cX72#`R6UsoeCQFI~! z0ATITp!vfeYyQ?Dr=^5BAshfEa0nB~JG?nUa2Aur006MC*<9`)86SPS(W^`H2n+xi ztOWohsFfVfVWrI7PSKW}BmkyPoj(-|J?ES|BGd-}fIxr{00@ANnO*ZR`#)pee4I5T Rmm>fG002ovPDHLkV1i|Hc$okI diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_link.png b/node_modules/express/node_modules/connect/lib/public/icons/page_link.png deleted file mode 100644 index 312eab0914ab59271384686255d1be913a6b3add..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 830 zcmV-E1Ht@>P)VWgGzD=Y79#JI$lhEn`|2MpRa?Bt#-nSD~P0P(mbVe{KrOBoKnSsk>m|ML{6l zBosu@om4j#WzNLRAk+{k1JRvL(MfE&vvbb->v>W{*z*1_uMP}0cIRX*?mz+wk%*#O z%0D-+$B*g1nRkvI+_3E8Pr1NC6@5M&4vWaLCnNlr;lNlr4i91z&)eBGqL{L{GNu;Fof}GS9{gM5BJuH;2QWk8yuOZdB3pGR#s8bd~ zAmt<>3Q=YH$t5YJ5;7@+8Uh6=ktBgY6#6Pa%2F?h910?U8cLT43KAj$Z1*==ra&gILO{WkHfs(--F=bly9l~${z@AT>V$oat!YAD@M zBE0v_F{`g#^wOSP-u~!wvlmXdd*uqFqoZ0^{&nEMDU+=!>({S0wrQhFmoB}Yq1)~0 z^{A)L8Xjzdr(W4_exYO6u3a{4*kIeXZMJUR>Q=ksjW_p!rAwDKYUs90>6Q|C>56o@ zbrSq^Xk7Gq#>dAsn@un`Hz$?w$;Ss`%jV7L%9ShgHFV~C)6M>B`Tp%|nqPc&G*A3| z)Qe+}vT4-x^t1~XE@(6wR;^lPWMo9n*~E!cy~)YRsT2{`?fqeIw-e7N@mOA%UcCIq z_kH(_EK7|>pM*1Wt2^DaDAp|cvp*@(ZZDKpYkKC^?97(`0sb&XTXy7N#sB~S07*qo IM6N<$f;YmCWB>pF diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png b/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png deleted file mode 100644 index 246a2f0b426faa0c7f5ba009e32b1deaf88d1288..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 813 zcmV+|1JeA7P)otxGRZMDZ!_a~nK|b_-`n%VosaL{KDuPV10`(1LIen8kX2Xff$3BE zah#djvFGJ&eE^89Pk*-O^+&d>FC~^GjRYVQ(uuPJyS|-v?9lxA-+tM5>1Qu*n+Ir1 z6KhA>X4$XDH6?-|E5oe1E?pQ5-M;2xw_ex!x}I2+b=}mPFW$U%^;o(Zg*LP!K^1kP%8ynsD^= z1y^6xD1#GLjO{VLdh@0GKY7;d$+NGukV)GRLPn^=q=dF%B#XaJrNP`0E6=}e&Gj3d zKJbQre*WXt!60_DnIzgMQc6S#fvjXxsE1v7;T;njHkdy2miIqAS(nX~o%cO+q+b#h z5tIleLWvL=dQE8OC#{%y*Tnku&K`Tuub&_ELI0t_ea{@3f>Jv&sYqld(%}3_GY3Dm z;O{3*Y?v^A`a|D;^qrM=ykI)U6QHd%WhO~VF!SGjGn0GOZrc3mGZudNl9{Q#X5&-F zuGwVReFLBjE5jr!!^-5*L%!I%PkYH#Hs5rMrEBl^)9)9XTD;xjHFxVZMc3~Dw6#k$ z(-S}RE$bgMHv6Z`mS5|u$$78sp4G-8b@lVkl`HtEv+MGn!F&bKcHPi$$oP_;=BrPf z$(~b3&p3CsuQxhoV$%jIR;`lB-s7FDX)xCTXuJ7ZyIQk96uIR=HBt%-P?N*bp`)EF zq14c}QM+O70NTOa@V~_)&GMZ$^cQDlkyOCa(H3Mf+6xhCuZh`VSN{cQBl5Ys9{cp( rh`2H3A^=GuC6HjQ*7|*0>;m{7QlnX3z3MSD00000NkvXXu0mjfR5FYo diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png b/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png deleted file mode 100644 index 968f073fdddc1cc0f0800b1ac4001cd9a55f053d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 703 zcmV;w0zmzVP)AVs!l4K}n~L(tL`6d4Up4iSWnZ3Qg~4n+_J zDGk-qQdogO5JUtO-d5pRp7Nd7_r1^a|M&Zq%mn9Oe((|e0sw%Ur!K7T1pojj=U#f? zQM`qbQrM^DPkwa?DK_be^~z<~RgSMIa<`xP_4P7gg2jCwJ{9^k!fsU=#Ti|%I3p;>90Qd+7|~0h&mIklA#nb>ATL2+v$&u)OBgB z;nsHb)I&QRKeX40H~~cIZxCd}5C} z=79lXoXK%6YlyLtsV$~bSm?Upq|DJh#{|*a7XMm`4QJWZ>s6nL2R1|&J z0VPEwJ9?!n`o5PKAjc->P1Gi8BY*%!5&FVp=#)$mMJYul1Jton}gujiUf??eOy!x&!tsjxy;=Q3_DdcXx=a^OBhW0N~`A@4xB0a*%F? l+@c^sQA%W+?pa#c`9H5UNfS6T{e=Jk002ovPDHLkV1grvM=byV diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_red.png b/node_modules/express/node_modules/connect/lib/public/icons/page_red.png deleted file mode 100644 index 0b18247da5850f3c2486373a3e179acd2772e8aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 641 zcmV-{0)G98P);68^@7JE5sw#jpE*579S@TLkU(6yap1yN*Zuy>-hV%Q_v4Ar&!63c8OBr(ZRhFu z_kWs36-AmgZCT>x!RqM;Zu9tqvoHI~k@UmYo_g(*J3c%2{N8}7I+|qKPQzv}7t>%W zsu&9G)UmCzkDYSw{fBnuW4j;1fKV_nicw`$8C6D=F_qu`zUiK$2Oc?5UVY+D(`I@R zW`KlwqLftWHH3Z2_XVNfKn>VgT~k=@- z+N>c>0|@A_HbI9Jn`v0~7cfIF(TS69zaomDS1QtgvaBBfGEPLHccO2~3jc>n^6}^HAEh-2#VxC7YYcDXv!L9X= z-R*SOUvIs;n`8(LxP4~^2|JsiN^hq6cU}5dn4v1~Kl{eT7pm&f$PoY`hyVe%y8G*S bxB&kH@RuR86sIAS00000NkvXXu0mjfZBi!% diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png b/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png deleted file mode 100644 index cf347c7d4685128a4a447abb9fb8e939417644f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 858 zcmV-g1Eu_lP)`6pHR2Ufr z!EI=jWf;Km|8+n2IrHqe<9xxFVk)&(Nh?w$Xk`TAyvb=#e=0aySC z00NkRDM597_LiNIJ2M^qhuTvB004REvvU8@of{r?P8tmo3;+Pk0F0@*jAMhdOkS&1 zhJPPfQa;pP0|4+Yk%#j>X}o-s#EF1_DMV93FsfPP`G*>Ks>L&)Q}w2g%slu0kBfW1 z+*$*0BC^oTl6>OGIq(9BgG4|C90Dk-N_mPazGrQ7uHZ|>BLD!-KmZ)z1e^#?1Sf(M z!6m}K(^b|i%$TcA5bC}r$tAA?0C)g1@CgWliJ;NAk&ZF+-w#}$`-3nZ32C6IVKrHp zr+(!L2hRfF&AsTw>_@ z1y23;E%Oz}?q^Q2d($ayO;-sON2t7$w(Z|o0Pw1YnSp^}0PI+I5HnDNsFCA?oorkG z5sUIGIq=FSyxcj+xlhkm0en=52Bx3@02o12gdAU$_i?v6iyFMuc7P9#zQ-Hf; zVuV$t9P5`m)F2w1?t6{<8%wk{w-PP#Sj#%1MbsjrSI6n;D_@8q9`~W98dNQf$j=iI z6~hpgww&be%X_HI50Hhx@W==u4TLPB;ei-J-1}G8wH}|{i#Lk-WZAyfv}k4y0|fvU zZTy^$u6L>2nWo(NDSV2@MRD}JQ4(c%G%=dG@_vxH?>gcH#*Ue2HC}9sapf8X?R$Z;XEnm&g zW99mh)5jNw008mK8)r^`_{yH0rNn%u1|SpC(tjf#om=+r#lh+?Kb>DVb9`|C0Bvbv zN3U(>f4-tAC1hosRoA7p(b(hL*V}(j>ug<`&U)|l$6o$)!>PBQ9RQSwn9asj2p*|xhU*R^vq?*Twb0t!lm5}`yW5lRy-U0ZYK?8to!;o!r!XeOE$ z0HB3T+6EEoI4PlR=wonwqJ+TvCoWh&$?CAPVYcU= zD{DS0?AkOtb@-hh^ZLq~FMjxYf19X?pa_YqtgZGvv2TaxcF#KT?O%=_*a-kW_;N|D zakkWsOe!)HsT5WRBiC+p;N-c>0Qwy(1D2MDBC595oXSiR07)sKNk-%9*rDBOO^HUD zZW#;)R&EZpqha<(HK$(tZYU#V29<@0qCXgU{gXeGpc_|pTqQD-WO|}%yKZbeX7k*H z2W~CK$v8NBAq~czrc5A(v51g0Wma7`G8}f=ZcuAiYYxZan@gP(;Ku66M6?bquGiHe z3Q0ya)%Lvk@kLixZfZyU@#UFbv+>pYhcj8TRKSr_sWG8i^X~UA**LvbD3(_Lba3xm ziYcpup*A9qJ$?AA=Og05lndxfwr`!C+O~h|B~4 z01q8H`StcY);%&mId7_+)76ovRpeNWRp&4M?#jx@|E-)x%P*A6t^fc407*qoM6N<$ Ef@ddc(f|Me diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white.png deleted file mode 100644 index 8b8b1ca0000bc8fa8d0379926736029f8fabe364..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-&H;pyTSqH(@-Vl>|&1p(LP>kg~E zYiz5X^`c$+%8#zC{u)yfe-5 zmgid={Z3k(ERKCKrE7DF;=x4^O+ pzO8rLO8p|Ip=x)jHOtWj`bJBmKdh_V<`47(gQu&X%Q~loCIFbEay|e6 diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png deleted file mode 100644 index 8f8095e46fa4965700afe1f9d065d8a37b101676..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 591 zcmV-V0~O9lw>B8WRlD)Gm}Jrz31u-X&&gn2lvjs=i{7nIaL6v2==uw+8Lcs(8j27 z;|c`rmSv@Lx!heopGP^^Ieb3f=R!%Lpp$}iMS-&P3EJ)s48wrJ_Ni0~k|c47D2nj= z{jS6bt|kFpFf|p5cM`_&0Zh|`rfEp0(}=}lT#(6RpzAsUfxv^LSYX>WlAaN$>)*J5 z0#sE+JRUD8iT9*fz{)_^7@6P&!sEjTcD+I9Z4YjT1`wH@fV{cEvneYGFU%maIEU2s55&K(LixD|{p-uiS@?KNj zk-Go8G$hH6g002ovPDHLkV1hVj1#|!a diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png deleted file mode 100644 index 159b24075191fc259cfd80c797a1b0d74c168422..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 664 zcmV;J0%!e+P)7Z7t2}reCh0o`+ zAlt$F2tW%oO@m<=(B8a-_VgLl#~yUMUDWG!0qFPppd^03e+x1WpkO1NhIaKD2A)-@ z=Py8(Wi%R%JtYZG#sTKH@6Z+&!S3Edf8jFJJNKuva#KJQD3X^7;H^fd2di znEN&c58aUG>`>P{Vqq$kLb+TP{?I!d4(|o59X_%|nVEZq2Rk60n7072SWJ{64CV?3 zgS!EB=eYxwQ>P2&$}(iT6UMvuFgHHIEdNA29!EBtg=v~X!DxxEH~}L2zn|52%xalaq@DTdhh{EVwv0IaQ=!?daer zTKp4I`l8SDt;d{8Q`5Ko;BXUi&oAG1l4}59P-{|^S(Rmord5s6qsh<&m@Ab^wqCD) zHyRD}lKLDzpYN&@q5&*47mGzGiqcXpmqR9#K|CH8kXS4RNs`(iEF%HjP%f8ItyaZK z6$%Apvsok(2>~dTO5jTZfq;N?0ch4l01f$k9?4{~Youl-#x{UDMr#AFIkz@SDwPtQ z$gQ^$2|*(Ps9LQiav_8o8Ne<=Zx1*M*syo80sEO1tB%>5 zfdHB`1z+!R@?ghPRKmL)hWEvZE$=*54ose*0JiUNTM_)cMDXhxEKg(?-pD=y<)L4J zT0dSyD0&NhJ$^_8Ko9uom%-ZM4BTM{Tw$9qyPj=-9W;N(Wi@3*-Q4pq`Gcp}^vvNr zyd&PsmG>fpCSZz?K}UIEd;HGgG%0MG>ymxKPwy{>wy(m*Atq7)0000~7 zMNw2LQirBVQoa8G3P(rY+l;L4iy+JwSqmy$9JlSkk z&*$^Eg+c)@!R|v4gdc8+TTn&eWHO0VD&>$!B%o;;WLf4CNs=Inq9d`xA4otCWHK38 zmc{pkX`0Y=9g3oGK{}lVy~OYL|C5lQ&U^l;wrg|7w=BcA9L4-r411?K7f`@348&rw zXD#uW)DK;H`hxO}u%=@Cj{;#u#_;bb1_KgUOT2Hp6;)MvC6P$vQP3=g1O5#aU%I!K zZ1dc@f}YvG&*Spnplm2rIp^VdA^HydZ0X1axdms2!RKi5x-SFA4p@ zC@N|PI$ryHL@t-(!zBsf2-+sYAukhDHU7Lxm88-p zDk^c;sHj}OKUc4lGZU}6umlGVNAJx0%sKDOFwQx|V2pVvxhYKe|L9TNk!~md3BVrm zYPDL8Hk*yU-ER3~LGwJ7N`0ZV&nOhBI{~~A;@ND*=kxg?#^W&`4u`zk?Mg_e)8XlK z`T#M+OaR1!<#Nf_>$S`xrqd}OjYhoJ>q)?3vEX8pY&I()ERjfjrXM$k7e+-Qs3Ihj zNyOuEQ2EGYG7ro!o6VOBQEwuV2z)*tR8>WxP{616FY)p1Pn1d}#9}cxolZC$4n(6- z35hJq0;FlHC{ zp*iF(lgUK(E`($(s9pJ8Kn?(M734H_63WHtf}6SQQ_MXEP!#0|&@>J8dL5TfG&tBw z#tYn{TCGZvAr>cca%YYn^!t73tg8OOJ2FvJ(`YpCyVZi*?Ur+1uUA$hAg8-aK)c;e zQ<)!XwHh|n&ND=$@^)>aF-`~n}#*WMkD*M|f8r$i*z7+W! qF|A!t*4fE(R`<_YIkN&?Jng?3oQ|aAqClPi0000t>5xmo{nArfL4CJwMMm+N`pQ3p^Le$?rMud6Rbxz!-yG7bz2z$^USP5(;udf(gfQ zG~f68y^)EvcNWp#bUoDt2=h+^%o-?-|mo~iieWqLNP<0m@2PTB7ftyb= z@H`K$>v9Pr5X`L|rw&CEN2(9SB7A2SE;d|j9@*F}sd(@*2l|P*fWfK>1drZUrtUA7 zNXO~pKn1cjf~~TLbje1g>EPPzN2GH#UIBxJ{}S9=E`{zs-w#hO?vcH+hJxroI5v?j zD!4lP0WXq8zUx3RAP@|Gq$}6wXCjFLZY^YSWBxN9#&g)ro$%5}aYn#y=tJ_aIT%4d z5d4u`rlp!};XGmbZkJE*kYJoi&N0pd*yxY{0${xD;;Q1h^8f$<07*qoM6N<$f(}t7 Ae*gdg diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png deleted file mode 100644 index 0c76bd1297751b66230f74719504b2adb02b1615..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 603 zcmV-h0;K(kP)^~*-1fljz_B$LUvK}k?BNXe#Y!m=zM!!V#}8bncK5m;8VP zw86G*RI63?Cd%b9bX|ueNlZ|wR6rj|r_)VIP@r2imh3?SN+^{|kY%~8B{maJ@F*OK z&VH9LwOeGt#DRjj0~v~8`>iO7!Ybi;zE$va`A^T#yW`y44;k^#O~K5*jD=qcUhPSc zvyy~q;5H_1WT1l~cqje9yfa+l!hu6xjdOJ8s;8E^+=QQ$tw p?%p!Hy#YapB=@+^9(46X{{RQg%9y;OKjr`c002ovPDHLkV1g7l326WT diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png deleted file mode 100644 index 87a69145075afd8f8fd8b391c5da1249ec8b2889..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 587 zcmV-R0<`^!P)LWh{^|hy<@Q*xw+qo|KpY<+vaXbbW{L4q( zTsjXEJvb}e%bgb=o%W0h?4u1;^bWTqH8}5Th002ovPDHLkV1nrS0P+9; diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png deleted file mode 100644 index c66011fb0fbdcbf210483d676b7131542a0e282b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 592 zcmV-W0k7R5;6x zlV4BMP#DI+Z{WQcKZBTk0lfkj5F$ztWhP#lcuyb@0@rA^#Kpu5KLA&Rgc}o#aSmis zrZC__xY^&#cI&!!{c|4Q_tcec*#b>|Y15wPcY2=o3;-Bl=(t4;6Ok*pL)-{*A;GX^ zS(@WGp6j~k1wBVR9)BB_gar`}HyRBXh7nM!)u5^>N~MyN6bc0-5{W?44iB<`2biXb zR;wk?jIQg@G!5l)SqhrXCU}x$GU-dY1sra}0uCq@153FUULT=jNwSk}0WBjKz}Jdu z<5gB*<^XtpAmp3m^ZEXQZWd1krhft}CoYaF4cSMvTJ01}X3X37KYdx-D0$c{doUe8 ztY{vlGr-e*;N!WAV%_hgUawyYrhegW>^F)pv%uUTFslHn; zvJ)l{%w(~{!O4`KTmK{Q{zCYltLfs&4?nz|6IdlqHCvX;|HGv~!QW?8P~_d#e0$v$ z)5XHEz{3>qMiH`1+qNYf?huS+@L`J9_$cjJF)Hf?@pu;)`9}BXwGUM{2!{y-4|Z{L zG>z?O%Cp8P5T#j1DID7u_*(Jg?7iss8AZQ+&;u_J{FmILf((9eoiL5nGUe>Fgq*U$z0000 zJ3A|*qoWOonz+4ZQ0KNhDB07SX1?#FrNy8%K)_l}y&kh`*KYdy`Y99&tgNgMLSSrc z?B?+B@HO@P-jS~z2Rgc6yy~Y~%>oJpBxsb$5<&nRLqiuR7K=@0SZj~jTs|sv_jWVX zGe?WflejOaq|Vec=s9+ahmXbyJ|T)Sl*?s82sr2H?Ce~HD5WI+Sz&tmWrN()wI2}+ zKqg92t*l^-#ae~;9%KFlWkmwnY=-UK`_|%ICZ#P1gdjK<2n38VXsuC7{WiU!fZFmm zW~Sda9(Qi@pxO}$ARY+;t##Ao27usOqNt7Hwq6K7G1il@xitj=LIM&{N&#SuX;x4x zmG6FhCg-$PI;hQ=;1iZ>F>^~@)IPi;l}fX?SZ!QiO=X<|pSVkNpJuLHzW(FT_~W-v z?vFpkyE>8ee4d=7wKauH5~dd_M7d2Aa=ICC{Nj7Blqv&DQEP#j_VeWV&WXL>c=LLK zsmYg^_JiDb;%U!UxO%qjFAvsDFj-kzT2$GbV(ZopPM$i$z`!7jvEk07BcC=6FMt4` z*0u3Sy`0b~%#(0000K diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png deleted file mode 100644 index a9f31a278e17993d8d4e13beac2f9d5f7b42d08f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 309 zcmV-50m}Y~P)sF~CC`eaI+m%Y8jfzomMvZQaNUIT3LIrJ$h)_W{ zwF|LDNlB-g`Hb_G$;>3F$9JF3WYR|3fy2C+_wH}*xp!_4fF2UN4lt#d26oXwru}hT z0+0%Vz-l&|Tdh_L-Ng1G2*RBtBncRx;99K)&+}s0whhxXp{go}$g&Jk6k|vfypI5M z!1sNGVaV?!*L7i87Bo%cfO@?S`bajL{R<($@$|PtgBRcCGIJ_2a|&kO>G-s2aR3E4 zjssoScUa;zIdOeGHBnH13G)W-zt$kUQgNfG;96b=v&4NzRt&@7nN%v3HsG`<<+F$cumMs448N!W3r&2Z*b~D5^$^d6Jxn@SFK5Q8*uKSR7x{I|H-_N1f+AD zSYC5@2K4OKL$==F9U@CH;ONNL(W}oZICHn;d?~pw?GRIsH*x-68Oy6SuK`)`{E)46 z9^3(-HXa#X89SBv?u_YP)WjsQrp;}0X?Bxrvf12IKW8>3t`e~W9|JS<{btTNbNT@EQIWBSNJTX8AMGXD z-SsH|s#>j9Xf~VMtyT-YMD}5^SWHTY5->o`k|d#AE_YQd79j`%GMS7FNvG3b7^Vy9 zn0HYCJy5MyQLoqKnW|JOp-?D*<2V^msZ>BOv0ANd2n7t@{=V;sZrQ>3c})5_%ms4z z7!qXwHHe~!QFj8aR~&*-3F?O|;#(ESIXP~Os%|~y^7c15*q5`gz2-5ol!fU92NIGT z_ves+>+Tf3gfcL?!nimYmR}cw*|BGULzI^7!;k#3K^YO#;!+vM@N~(99+<;fdqr zYPJm+pXYFYk;neQyXXEcTQDNQx57i`Okp9A#n?<7!{#tnKJdsF>utb@JH7dU01gfL zEK2hoPZAnO5+je3&^i*hWM`qCW^vLK!O*?U-#IvXV?#6koWqrwnD{j&K`7N>^tR3G z8zr1(qVOzcF#nF1&0MZ5C$l8*E^Uth0000zE0Ay_3@1Z_7#f-XWL#E{8Al7>L$ z0Rx7lnddoqAyfT%&#`$;v0@*5YdW3w z7mLNoa=FAshK% zDiy@zakyMAxr-H?iQDZi^!t5;Eno2A=?>mMx`Vg(Z!?<53LHLvfTPa`$mjDcX*Qdv zR;ylN4OH+m)fVX&Z#yZpUae;ss@a$K&})gHovkhr@w#xyPVlfVgXti1_357y%I-UHDvRWYvPEX+#g+j4Q9ayba zh7uQN1j%HQgA=Fp9DfODAU^*3*FCs^6IpO7xg`RUXyP)(;=d!ly=#I^l3e0Cub`{H Z`5PU3+D2e&<<>s`J(VpX#y^kqzQ;#=2x({YMw9Q&ndHT&`BD$#%Ql?{+)-OuSA`r}MWJ zVg+2Gc(GW}a=BERPNy^;kEz$|38dTYlFQ{%5S!g@|8f8D_!Nu9_Ni2glF1}xG8xi! zorc39&F6EPOeWOt_XS`W2H_Bo$MXugy}SEctJQj=(TLXTHL(jRXfzs>NF=0SHk;94 zF!&HjdZNX(3U3;LY64IMX__Xv%_wjLC!J2`0Jw?X=zPK$C$`&dYPDKaC={e16bcE@ zgun^<0k;ak*=xLE)@(Lqu~MmsFoMCLY&0Qog`NO(h@kyxaA%EbwJLy8sU*Vi`~52K zX0wrqW;_LmMq@evX4iAM9Od(Q0eHP$1%L|xAh@vrqB`HPQLon}f3aAka=9!3hr=O- z5F9`#J_7Jhah=U(4RjaRhkS4Xkk98kDz-`i!r|~~AQ1TFcDw(@<8g{aBE)l)PNxNE zI(RPyc>9e{@WGSMU%i7*v{!&P$WLz25)0oc=Dl-yy%xYZAm4b-rttL7UjR#%`#j_F R;_m(?iiXTHIMmcoLoO94I8;j@ zv^2DJ5#orqydFJX|Gm$_Bi_vyew+j6{r}$Qc@D1%fQqeAhJj)1!z4pP83k2MV2~s! zSt^w(<#HLFVBg_#xz1W8ioi(WY&Hu~6zil?DI^jJgu`K35(hkP)H%@Imesbg#5!Ps_$Ni*SiR8&sKb9?M`0-mH)gtg&YgRX#*TXz@Z+| z;|2H@xzE0TfuORhuO2k6#K8#sW^J`mQ0+E@$K`QkFV+DTlI$w{GJ;zid{*v9xeIe_ z$|Bp`@iKkgoFK3{4Z)#DWKV~W4K@5WZN+Ql_7%YxNqSx7%cWud&cX>)_PvD*UzxZg a%Kia9Rjz_59@~-t0000)l$0ECbfb-0$}>7z|u>IvuoHEmW&j4lzv=KA+EpIObc7e7{sGA)QVmnM@*^ z%|h38^m;wC+ilpk%>l#V5LCqP_y2_Cayd^XlX;j*r54R*lW!zbqtSpQNyz8(JVmWm zyV4S$2{Uhyc{Cb0QQbf{ZGT{Kr zvJi{K_&f+q^Pv4MK$hhS4TgFj_FD*rLOePdE-E^T7ZzTFCRUB`*?9&h(a#C!-v8lWG#k3AOJQaUey6Oasked^kDPe=Khg@7s584 zg`XfS1)&u*_c;I76#%`kkBfiZgKKo@0)9d6vZw=ExQUtV?eW{Y1Xv}=4X(2zy85d> Y0C^(qLv?Ui{{R3007*qoM6N<$f-gW7od5s; diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png deleted file mode 100644 index b93e77600def75c9a144d3d0a5088a62c02cbb0b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 618 zcmV-w0+s!VP)$>5Y&axjp2O=VLu>*f>1L;s0)kkvKC!*u?s6CVL=HJ6oP~pNfZc; zsKr=bq;7MITw8NXw{SZm%59TId2x_9BQ zV86`NuvGI!>o^V!Na!=$7GJE{Cq`b+XwknM{UcGHFTTfmuS+ zm-zYC!P3+zmY;SG$?!fYkOih`QYaLxyF}A86h$GGN}kFj)_o*0e zjPMP%zTG7FYMAfO2Nn1D`D0Cj?Wl>5q%@CE10nX)KxpNmwk+!IWkzywiYD( zqUXiYYIq3qcRyMGJ;IY`(Gz~E$J$zu2+R{)xGlE*88b3WK6V*J>}2iPY1HH|tER0W z_+^^FdppY?o)Gt5M2`%xwRDH@R3G}^i1l4|6uchm0X0f!@&YdVLB5K&dd7Rv{)DXX zt^&vP;}kqj3f>94j+4xd93>s|Q!Ezi>?r8(Il$P}PFxSqu{d*!Y%*#cX(R0f|Juz# z3o0_xI14Al->1uky@W-rCI_%l&>PK^TXNSN{byMk2AI5vbwp!K-%-@!-vPR3iikL1L7HA!^!~ChCFU#lnGzp88=I z67V8PHBo4(l$u?-AKmT8?#_0rKW9dUNRbpLc`}piywAM9$xZ-3fR1C75T(BjCn-l* zjUcci2oXXo-}iqun@#)+`W@kL_-U&|2>MxZy~3IdmRm&8b)9!2%ksg3R)nNnT*TJOC=6{2hG86Dz+<^p6qfG5$i^UNUh+u)CD7O2 zK>Ioazn;U|+X0x$=feveYZL1W*Fm%e5P1sajd#eW#^5(ddx76*pt$^)b}$Q4oPabL zLc^HF>Z{8za;f$LtN0P$6C?1{X*jtXkRJ8IEeyiSzencvH3Ux_y>y^}wfJrRCQN#9 z?&e+C>sSAfrE%mZD5RfZ`gSndD)=P?+nG5Oq$zmY&-v+gc7R6c0u8^Ke#|XOq?gF@othF3zFpM8Il<8BJrWqBtF>b#_ye4{0)Xbu6j&@UIhRE002ov JPDHLkV1nWI9dZBw diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png deleted file mode 100644 index b977d7e52e2446ea01201c5c7209ac3a05f12c9f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 663 zcmV;I0%-k-P)^@R5;6x zlTS!gQ5431_q{u#M2 zg&W%y6a}>qj1Z|7Vu&-DW6d~k-n;jnHsjb-q#u0C^W!_5^C=MlKq<8oNCQ6qS00!X z5eI;XP=g!^f}j{hku}E1zZ?XCjE;`p19k(Rh%^AQQ54xysU+ocx$c#f61Z4HnT#3u~FR(3>BnZniMIF4DouI8Hi4u>cAK%EN)5PO(ip3(% zIgBx+QYirR){Z8QwV$9Z(Mpt=L-Or3#bf-G@66}txq0yc*T(zNTBDT0T8rO^JeNbSI-Tzf5!pBioy4NwAN^?iN#{;fH1Jke4Xa`^fR8m z%h6dq%xX)S?7`zae))(Xst^Scp6B8FejQW?RLTM8@0=vnnntuRGBM2dpo>gbCnTD= z^<;=JuqdSf@O>Z8^XdR?s+KEfhDdB_#ahFj^giCtzT(s8kA$AViyTqaAR;KGaLzUU z<=GqA4bRwpX|IG~*x>pZ!@zLr`XQ`od>m(`;jz|M_*1GDO#$7;n74ppb8=eiqh760 x0yt}J1#p`gw$`o!R{d7zU9~!Un@nJV{4bstt4Au+Up@c;002ovPDHLkV1kWhGjjj{ diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png deleted file mode 100644 index 581843637079359a6a58fcdccf0763690c67b063..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 676 zcmV;V0$crwP)_k3`4d{s8lK_6bi^@vq&To98fNoK}7)fx$e2^Y&@<^jR_Ee+8}KG;X`@ z@bCyiolqX>bb1ZIs%QGnjzFU~L8H~d?e;*XP(h(S262}XyZ3a0h07r{KV?E70l+e- zE`%3x|M5#q+;HOC(h@A^M)7Rn13dm0&>K$j%k_F4wOWlsNCIH+!c_#{eS&TL8v4yc zcpnPEY`cQzZ$ILq{U-MA6Z6Z|1p!FZjQ}tXSb25J@HphEqX-6Hqo?-_Zn@{d#>2Ml zJGhxTAd&emK$lV-QK&VM&ix0Xy{GyS3Wp(+E1^8BhD3T0a)m-Lw@Lu4zQRrP)9(3F z^>$hh@N>OAXrmPYunLi|fJ$_*5i`46;M>~*5D{bp>-OL3{+!MJa`3kv~Q#QfQ%c z)1s}QE<_XaYBG;IuRF=td#+}fi4h(6HgoUyJLi0t(*dA^B)%@8kkG&bdM5P5^Z5WF z%d%>m^SbN0XeV)wbUOXn5Ag#A$gJx+7-OCkMM1S%MWIlTkbFLmOeW(&n&wUd&;`>p zVcRy$Z{K0=?SpNnP^;BYEEXleFbq(UY&LrXX$6qkJ~)8+b{=jj3HEXds;Z(?D%}}L zX3`39&dy=Zyar!ehA}e>w)(*vrCct{PI9^2Jpj&OZS8<3-@{0(gNv%1{)zAiLY+_^ zl}e>Ofd4&#Irj#7>=o=Uhv5IJ@?sN0^J|(WL2Uun$4}si6}TG-s3T#p&6GE<<2W)O zf{^Y2HlO#*QDvTp3v&d@;8*}aUC4lisG9(w7@d5Y8y)}U#FwCkqp*Mcgme4{&gGRf zlBfd`nF9cQBKB2_L{F8G2)7pAf$i)Ds`|}-c>pc^LRW{w4SQ)3N^BbZx)6BlCZts! zKph%`(m#xg-q3I7=(us;9<)*2%iuQ1J`oV3gU6V~T}^JU5714JN33&GwEEru0d}Uo U{MPL+lmGw#07*qoM6N<$f^vibe*gdg diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png deleted file mode 100644 index 8d719df5205f7415ce657e5c277db4533c82f346..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 639 zcmV-_0)YLAP)p{{sC7)XB-g4w*W1a1)XtvxrMYa1o?wn&v~3 zHnC|#(>B_M1d`_7gfzLiHy=0c<2kQQdXu*33(xYN_xYW39(cz9jEVT%VokB8|DoF~ z8u%Q5sdl@4VB7X#uh+v_;yOGY&pRi?378ghv)P1cngiAAb<}D#l*?rWDV0j_dc6Zk z-|P~AJZQCA=yWcQjG8fYnimzj*3KqTfN0Cy!G^$7)+bQ$+mHVd1J zvwOR^5Lm<|R+uyB1Nu4vL?d4qa3tn?9H7SZH@~u=fFHEDfSH|bHU6kh0O3%cLdyny z{`9S2Sw~WMy0MPy!64i`jdk4Z3>^+KIL_fN2V_d&ywBt`^IJpxUI$=YAph~5`;xCe Z{s%Y0vkUXDnO6V+002ovPDHLkV1loX8z=w( diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png deleted file mode 100644 index 106f5aa3611a4807ec8c21701c631730275089a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 402 zcmV;D0d4+?P)<@FR}JvtGRKa0_WfK^c7uXaFH3q@Y!Hnl8VySc`OtkPN3;#l*y*l23+99h*9JzA00}rAC!#M1dZ#v9YOBH|eC*${MmzzYjBu!!-< zK8tujf&(6i)1biy*F>4{f*Kd(IU-JsG&#b_@NgTnx@40)2@2%c;*=?-2Za=}O}7&( w%_K#(S>e1j&gfY?mR})n>>0+8p`iTe2d1K2h8#$+)&Kwi07*qoM6N<$f(2cptN;K2 diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png deleted file mode 100644 index e4a1ecba1b60e54f3777717ed105cdde745b7184..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 516 zcmV+f0{i`mP)o)wchR-92qq~y6`XqbKmElbB3z{pkZs0VPF`CFvS?7jDn^mFo>d9Y&06* z&1MsS!M-CH3ee+h_sy)Ms%B*ec3R0RpVi9?*mU84yoq(Bw8 z<4(999dJJE!V%pWT~HGRIAb;(#O%2K3?uRpz}AfgE8e9q&OSdr^e^}lC$QXZz;S2A z)w>^oHy>?v)q--`!pmuBe96PxP0u*inQvyFW(llfv9 zXV1s*Jh`y2H%B3ZTA(AzpsQ?hb6_PyZ=c1?_B4fbl>G%!@ubJln=!)x0000#DY{xaiib^#X=YT4@yE_&2#eBulEdzjE`u&@G%2(&u{J-<}d(^uY4W_kMfEX z@!X)AR9F&FL?RJyJRUzvBoeqN{5kY`z3wcM0+du73~_0|*lac! z42Dw(Eg1o{Ash}P8jXrqN+1w`*XxDD;ShmPCZC7#4;wWbHoMvBl$=zF-`?*9j*Nbjd=v@OWt_BgKxP-3wd zy37?ATx&$b+&zRM!K;BD%Okw`Sb@&Pak8$KRX19jWZmC0&n*Ggv%j8nvSPDFw zEkV65AGOoBQ8kf`R|}Px*&INNS%osq9b{Fq2I(x6@xM>tg=vRLF?I`0rWzHyRc>}g~)F_Qn`A>)C_iwK%Z zrIJ;xR)UI1Y4Ozts|-Nho;q zVk9-bX)%F~!;63iu$Fk=VJn3~fmb5S@@)ZqjBT2{f`vT`b2}zxb0$o;EF@G3&BHK^ zc)`1kUzo^Qkk$?KFKHNBD?nP-MJ3b@&4fg;g5l2wMi^g?9qj+~@b;62o_U1_S1J`g z7m^UMg25FX1MJ5AQxAJ5F5WDt=$=-@JV-!LHA2vuxl9kN>PS8x??^AINH6LjF*#nbk4}=n3gfWp$kEX5IpHS zYiQ{@d7Nl&d$#+7-TckP&Q}N91e-C#5QQ<|d}62BjvZR2H60wE-&H<>}%WqH(_V;zPbB1rgSSSC(0? zWlQ#?N3UgnJ9m2C29w!SwoOo5_2Iq!<8vCyEoDoj@#oV($oJEg6Bj@;nD|2g8 s%L|>IZ381yx9RvPhV4J)*SeoEV4lyr#k*`nfWBbxboFyt=akR{0DpOPi2wiq diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png deleted file mode 100644 index d61648452284da1bc28b10385f95b5d2bf027901..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 616 zcmV-u0+;=XP)-tZUVHjYHp;RjQ0M0pRlXN=mLv{hk9Ebp9&~+Wj-T9IkpzWPWd#fZ)d=zV^~S`;LE*!&u-?g42^wwN&Xr1~#d5ifl_2*B1OoS}CDno^8a50ArfE8;stQF>AP54J@H~%T zFz84s;dO!QJKD36(~!QOg!t_^gfFcSKDU4yK0+Ypg$NT^mIYcQ6bk*3P(lBLh7Df_ zTu=2xC#+-_%)|{Cv8zz0t|0y4D5M`xAc{gwOKc`ou<*&VjUREFHs1qd<_xSkKeTBt zgyCi=@jj;&Ns^GsWWaIUl0Y2azcDlF@u{(P*!+EH;lnU~b|Lv{4|4Hdkh!qoQHiE$ zY#y>KFA0QEw=4Z|uV{0A^`Y=D}hB$GP&<$bi8q(u;p^0(my3Rz7fP}|# zGZ&#uor4@c3q9r|f?H6-UZmfgKx(iV(MQ`MPWB>iC~SxnN5H*zb*A3#zWwgu&c|}3 zn^g87H{pdeasl%Lhmab&jC?lES}7C?4BFDNA<}20hoY@w_IU%i*T;}}wh!589}7~7 z#Ug`-R~4j&+K_y4kW@X7qLr-)S5qVKU)tO;+kXJ++{vPI@{hVK|PhMVVx_`)vx~zUs}c9O-Ok{00000NkvXXu0mjf DS5_-g diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png deleted file mode 100644 index bf7bd1c9bfd78d689c73ba67cf914182933ee68c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 614 zcmV-s0-61ZP)OOAS;jTeL{ZSdz-%)SMH9tDF;N4B6%j=d15J&5qy`F#vB?Ar zqS1nH@%ny_XSI*Y>) z1f5QYdmzT>YciP<3WehS<{GovEaLGv27>{*-7f0&I$yJ^L%ZGPv1YT$V|u;*+ZCWz ztHI~CDVsuy($SfR6-`N~K?9GTB#l%%0h7 z-q`K-y~E)+s8lMyTrPL8^_pUo)9G|SluG5pPqw6!LJB_PzyJUM07*qoM6N<$f^=yZ AYybcN diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png deleted file mode 100644 index f6b74cc40f82fc83e4dfa6e9647ccc1b34e6ed7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 554 zcmV+_0@eMAP)Vb2f>2}Fa82O3m(Ob=t*sniin`NpInLyMJgI`saru@YOPfh zy4g0#G*cV!#N%;Gq9_VH9?v%kjS3Rb1j8^;C={$Gp=lbj z*(?%?geA!5^Pok%UauwjA)v4g2`HedDw4_Mk4hhBQt?e7YJ5(hcj|3dNu^TOPGnjB zTTsqd3GIZ=Bb`n=7no)dflv&K(lsWw?lH6T1Yht0F9qgIuzh}ym0%n<3d3EBWB*pg z+G!I0lbAEXyd>k|QNuwr4=KX1D+tLPv)j@C1=N4sA4NF9A>HcO3G47*Y6!+SrUH-7 z1hb;^#S=r|`aMh>J#dWruAEf}gcR(DRUC`ZUev&$Sbh0SgLiTXeeHEU<$_YV;9281 zym`igIE%Sm8DpDw7@71Tv^EB5xSdUR*0$Mqp+Wq8OoaZtOg52&)zZ;;M=7#C1Yd6x svjx>8ad4e2x|*xHHwRjcjs6zA0XLDUqKT6dS^xk507*qoM6N<$f*wetruo^Ag2=LamM1T#~4RmC^m`_ zs}H7d&XJ}mg+hU?tu0noRvyjI&o2SRAeYZFesYkts79I^jJ7!A7%6nJwq8O?iT55M z1OQ` zbL{!Cp5o*IRmE9PInMCSPjTwfT~J+EYkz}tjxY=fg5Yf6EQ@DG$0kMJ9h^&$W}9BU zP1oj2;?MWVkKIEl)r=Y;L^Cx2q|>!)qJJ8zE7-V*-Cf7V8_2#1c0N975t~+&QUpQJ z5(uo(-O_`%Rj@U@t>JYAgd!>L?0Idxtd#oW2gc!jinsAEva8|kF4#Ic**mmml_{d^$s}Q5Q)KCys4sfck5bP1SyeHwh2`A<@N&t2j0^lgHC_^(pAAPCNjwl+>AN%C4Ll>_8Hjda%9 oS~i=#*e)>KsPlg0=2)Qg6BCqJ=F8HdGXMYp07*qoM6N<$f@i)wr~m)} diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png deleted file mode 100644 index a65bcb3e1e9613cd9e4950850db43d7025a5fdf9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 779 zcmV+m1N8ifP)JNR5;6x zll@CmQ5eTZ^k*a#RQf}fVOdd`5NJh6S(>6Cf$wEW#f&JyAR#GAn9>Gml;nOf3WCDa z5({5&UB$(IF?G#$x4X@Ickg!Y-HU!Z_rzX=qAq-XI_LS^=lOCT0|0{#{kBkYDS7{3 zD`iu%E=`cDX_^#^#n$5SIQ|4Zhsk8>N|zXHXG@*41$i-7`Jr{8`3S_OEcmY|RF48wXkk?WpdVM4OePBSbfh z#4_=eXJg@3epx~gi>QbUmO}Bm(ENN3+@c?jWiKvSrm(o|W}Ud*?vy~fn1!V~Cl4kB zI-;c!8f~-v)jX82%EG($>?;KSD$64f2&4qQ#=Yyrcpy$57RAVuV#vKMP)0hT$r6m# zc^F^XaJ8R9Q|}x^NoJYIvYZkq-z}Tnj@UJK2l2H zG}p+VvtjP2Z%bsb$~7QLJ9#pC0dKi`ppOd^_V;ME6tdzC0PtV|r=@e@37O`%0k^=5^`%cf$eu00N17Ro!{^30krz>a%3j34C?*{Mt2^a4~ zK=P+Qq%|f;Tc&+9ps;@Mw`EE%rgs&#y=j6BUGg96oIqdwj9-fiy*N(|@o)eD002ov JPDHLkV1j#pUPb@_ diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png deleted file mode 100644 index 23a37b891c2f5faa3b8128d45373ceab794ca609..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 688 zcmV;h0#E&kP)PK^TXt2QS_@2qt2T|9~baC-vaPn=ziepcfAwB$0!O2Q)E}1e8!q+9)KT5JVKU z7HNY}h##OS-BxWHWjD0wrPDeEfUClHs%Q6&2u@FTOJkKMQN|_Rlw6rQz$gPzqGNtj z#ruSeFeh835JJFiM6vp@6M5bXj%k7CMt%SIwfbF_fD-3*Os`9Ly_Q3WQ_SX33E{pX z9_WIeeTCGQ3wYALpBcK+P-iuw;3i&7xCua37k5# z`>c`M@sGeC7cdsdz`aE9lOz!hPholbyz%T85LYf6O*@SA+9&+^7k>+4M8$A8iNQq{ zQvn8k?-+dU`Z@gK0z$EtPV#+`^OH`R@cE-cuE&_!D)SZGxmQxeobP_Zwq zMEgi6ePN45N`|V1so0uE8^}1xw8s;VM%Ai@7} z2-&Cyvez_-O4?6uv{zTaj|YeYEk34i~K@`8YW2g{x* zc;7z3lItpVy_et{Z-ZZ)<@*%{l7Ao8mu@V7*gz<_1##mwW*%LEwCdzNsVLYx2*T-J z#HeQ*_a=R~KDdVNk$EVgAIRl$oQi_(`_IrdJciDpH|Xe{K-YsMtc!cRnFi$qzsr4z z5*$;ecov%3->1{YNy6-Gf(Ecy&_I$CjI#laeuE+S120^|Vjsf)W&i*H07*qoM6N<$ Ef)^4A_ab^avY?n0hpS-#mn_4{O$e%cm-@NH=3`90Wq+3`~HKArSdfX`&Z12 z(CY$VW-MNtXX4xy%yUeE?}*~0-|iByA@ZrwXgph4S*bhcc5{HB!DFVm_v}P*g7+Q~K}7K0lcp(^N@X>U zV`{ZpeIf${R6Hgg4FL^`X$Eu75k(PE6ycl$AW0Ic)#@rR7Z(7;V?i-dR1K935Jgcx zPfkwK>2wGokf!Nih^ARp6-6arYFG#(9Ta!x93nFEjoA==z(g?#sDg?Owk?Mg7K+>l zWYsf(<`#+$h9Sp6gFOg_dd+80SkUpk&xM7h0`Sov9W73spU;GP073|VfZ&Gd$J$*0<~TV5aPS|qWH57|VJz+d0000vYep8SaFV10Q$h+;hIUPX_=v5b}%>Tm<(&j1&5;I!55C)oN0s(P%ZB zP3Q#ahfpXKWF@S?jm4U#fv)QovMhrriclyNs6-G12#3R##4PSZ0VY(dRWJ;Lwuq{# zAW0Gwi$yA^R4RZ!;W+L`f&%x{=D^VK#BBWL4Ys{;*!A7Q;!=dN<&D8*GzGaF4`hV4 zDbY0{NrMX>ZqF=0((gR5-zL$kC*b)!fwu{Euru|XrG<$^n#@)7i_>rCmRxnDq>$Y%gJaCkRd|tE*a2x05Pe!I^e13o69#&RQZ36s0 zB=O|K2Yi(jsMqThn}9t?f5E-)L^naZ+db$&%M$!bCdm=jv7?t_lB?3&%Ltq(>ESw? c;MI421LCcoDG!2@;{X5v07*qoM6N<$f`UZt7XSbN diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png deleted file mode 100644 index 134b6693687b2fa5fe36d48a9c0b8001f937c741..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 650 zcmV;50(Jd~P)VHAd+bMNh~)LLRqN>D)-jd9UvB%+hyKX5U|&4t0)fzgD-MPpQ$nHU%yoz=vI zMGb>1Xu!6Hw$NT~@Au<4P-+{9;Uw?&oj31uzH>xX0T7Xkz!(tn|Ed9-s_FqyReC13 z(ll)vW1O{Ck5ihay12Ob2ABc@RUI;zHpaMiyRDs0r>|D4rHw{ItJSJnYjt~jTbGuW z`X(~}?!&86q40R8<4zYw;$qi0^3ec=c&<&H;r`8W%H=Xymf^i;Wo6~<+}zx2UMzpC z*6MZN?(FMv`n|KO3(KFiUaucP0;Z!@LcUNa%8#vGK5aZ>wDgB0Gi=t*argWJcdlMQ z2#MpEX0wU+9&0U?N(F#OgpviU_Y{jYMsj65U3|PjwUOY}lUYj?MTiK_Il}NCVx-Eh zDx-TzMk7se+M#W_>?A1-x}ZXw3kkyz5kW)_hkjsi@RhKadN#H$Hq)$07*qoM6N<$f}lhwPXGV_ diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png deleted file mode 100644 index c4eff0387d5888c638ba09473ba6d2369f7b56f0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 588 zcmV-S0<-;zP)HU2HvUSp%6 z*n}iP63IK?dpo;h@sj9~pcxo;VVTc-XLiP@DgefqE#NE=@oyUd-&HjLpsLIuSFXV-EMck)oQ(A`s%*^&wf0(rNiNHsU%=0Rw;WC z(kbc37l6fo`-0uR!pYkYv8U^3?nsh^@pw!K0TH3uYyx1_2>|JbXPmfskJ|1YAw9w! z9`N)1^Aesr;y5Nr5-ODn)oOL|CGi}f9!&iVwpK$khlIX10X$H6^A_stBJqvLhU$?V`QXqKme*s~gVDJ4A;LTs_e15jhc1;By a82kqHEPVYFAD2!50000JNR5;6( zlS@kiVHAe7MZY2;Xi-5)WxDDgv@tCUl*&p14T@Z~3ThM5LP4tuQfLu@EnG;nXc<8S z6&3BN?fx-cv-Kp6>HRiNTHE>$X( zD&=w+?GWC>?RLAGC6Yix;an~UmSt)tSf}1VS6N1N2ONORdD? zaj}w6DAZZdOud9Ep?M?{iQWbE5^9HLLZZF|1kdy0Tu4InEuboP9@nvbZ-P0n4AZTy zyMRIxRDmUE#LdqYuD=-Qz4N^bC`_#S7vcLn1M}{J(Wl3#c4VWczu&)AjUlh(11>gp>f`wv{KnjF%!aA*Jk N002ovPDHLkV1kkt*XsZP diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png deleted file mode 100644 index f59b7c4365fa1720af1aa04eb47167ddaa6eeed4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 626 zcmV-&0*(ENP)ZS(e|#C2>JN4>y}l*tQ*E7zP@R2CCJnkW?xa6bgk%(hgtZ z0=~d?U3i`+Mvi4!&~+WPT1^NX#{u6&QIx+DE(oR{&T5&-ovF?@wGw)P&AtpHZa|G%V*GUUqL@@!d4V$`8=##4)ytY959JG zdc&Kho)&AL70^i z!PEmeeDWCB-UbK(*4JST44^tV2z_J(dn~+vBMJT97_7rzFio=~XczIv?PQ5$v%u~y zu(bteXb5I1h2zCV{Jc2~V{{yzZipgsP6;k264$*#5q?GzCm|CPa9CKqm4b116h3Pu z?+%Cm52plC8|5P0@igf2GV1KkCfk{Zecu=G@VNrf>s%g9c5D%@cfxVb6$nY`1IW=4 zt10QqSps_2JLp0f3I0j0u>#qA;v!+T))KEbCg|mo3q0pG{OR}p0fPds8+K~d>Hq)$ M07*qoM6N<$g1S2e3jhEB diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png deleted file mode 100644 index 44084add79b9a0fc3354d16bbd4b4b5ff8095da7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-$R@9E+gqH(@-qA%AW0|7U8+xDRI z0k`B18}ImRw2g{jTGP$Pmx3yI6F_2s&$|`cJ!i0UN zB3H;=r{#{FwLaNVJ&hZl9+MTHGx1T^-A=Q0?hRb#8a~x50X%;`b6ik3cw=#XdxWy= zgrpBoDjpwP&g9<9h3x!k_B!?vuTJVkmIJ-U N;OXk;vd$@?2>|rNdMN+^ diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png deleted file mode 100644 index 3a1441c9a12062a4bb3d706000d3ca14399aebca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 565 zcmV-50?Pe~P)SCZIX8XZzY2l?gCw6LlgWJ5Avz#QX4|&mI8LN)w~J1vgL=KLAhlWz*=#m~gyvxa z&;iC6gb?aZvMdXxX`<0+D1hs_pqJ!wxqlEH;CJ)je~uL(gpi@v>!I0f_Kl=E(E+Tq z26na*9gribxx-Oft(HnstyXUUy!39&E-cI%J5Rsy;(PGZH{g{ty!HVC&yGPT3H8x# zw{^gBPW)O0FMoh{k%l<`1a|To_Wl&u&-GXm8izU|&<&utILc4wc6s@u1bmTz6x{qg zTw@7=FQRcg&r`h+gcR$*Jbv+*DPk7v)B@e0o2 z6IlBXW&8xh@9)YKiV~2>+z&XKd24JT55YWz&JtfvCg4r^~bLP79-yS@n$OW00000NkvXXu0mjf DStt2z diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png deleted file mode 100644 index e7708292adabf4821612bfca032cbd019c63180b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 634 zcmV-=0)_pFP)KrcWDBzIw9XCtIF5G<@j zP(;CSqHxUrerI>~wKyloM4~t_Ofl@UFEj6$Bmm6p1aK6H{5zI_FOn(%k{CiRq?CT< zoV}Ey-7=-5nVFes;1m!f?EqZLIs4k$n%39XN4dPbtX{9DZnvvaiWV0aH9I>yf;2<< zHmo7WNC<&iE4ji-iKJpsBApDKiAiqWy8R$FV|M@E-RCB03vjWNGQZJxKCc-cSB=dq z#v3snoDMC=4<2BDgiZrv0Veh~mz(X=S@;fbe>CJO_5|oe2o3=wgfW(StLzI-qr&kc zhXEJ?9=`nWXzrUKL_p*Kr9u@95MU9EKqp2vi+%&1&gUn&>Ut_d3>wiyiAJg5G7j%G z#$sf%Kqau!AAHP&4Q?edl!FWqpT=C{D}$15WC#5QQ<|d}62BjvZR2H60wE-%6;pyTSA|c6o&@eC9QG)Hj&ExYL zO&oVL^)+cM^qd@ApywS>pwx0H@RDN}hq;7mU-SKczYQ-hnrr=;iDAQMZQ+*g=YOM= z!QlMQEn7FbaD->uKAYgo_j9)W&$$zS*W9}m(ey0q$&7l-XEWO0Y(9M=SnhLbwy;d>@~SY$Ku*0xPvIOQeV1x7u_z-2-X>_74(yfh7C znXL|3GZ+d2`3re2hs?MKC#5QQ<|d}62BjvZR2H60wE-$R>*?YcqH(@;f-l!01CbW>s1Izr z3LkoHh<3E?TVANoG4CX|$empRCCS=R(U(hVJfm~E?IkDKRK&NP2|n`v>d(vV;W1uY zrFGVdwn;4b{qUtE`?GB`)E1ga&i2|7ncUL1b!KMq^QnT#_gn?_Z8(c`1Q~Vy3oL!N z$M8vHL&U1J3SJF!56azQU3B6>r|ZQ{U6)pC|tRy7$(5JQ<@7eB8yk=XcNf-aBIe#;8c_B$^=N z{-Iq&o3%O}V4~G($=zcP(LI|+6dq{?rby~MXwJQ*=!bOvl%?k zYY;jP^@M_k03MHL+-9?_3W5MN=moFW3xmPHU=-4Bw;62MrIhg_lwHEsv)V9U4x>+9cG2kIz8fWo`WyMMfz zdg-)p!<(hFR{VYSDJHEJn09O@#)%q0l?GUg9eS2~vKPUtd+=ak5lWLd-jI=;cjEf# zt$1;~?G!t@s+VLwL=P+Ks;E z!Jkh#NeohG;&02OFD7^EY zP!_PL2~i9VnPEW6Fz?O3dVF_U$duAL$=SU7&hNc@-drC5A4z=IgjR%B|D)?dOEaGb zuwod-$hPex$8oSoqK;@Z8u3EBfK@V2CKKqo?yA%2pjNA)(P%)HWf#)x^$?52W{|1b zPXOA$IfrSQV2q(qC_vLR)a!L9isAxjoeoJRlgE&G0Ga8krBVsGjZJJ-x6y1i(eL-q zwB%+o53no?l}ZJh#drAjlc6nhs3RTn;1IH+x;K#|X)!=#fM76)$IqT4^N}IF%aQ#o zTKS@*)|#L#jiCPi9~);c`x>TR|0{+9a?O5Exg#~V5W2C7G9nAAN(~f z2caqx&t~GhnK;qW3~&OuEke?%u(8Jxs_+ZVVz1^-uLrP95TahadGG$+(D&+%2QMF8 eFxE8s%l`oWamgLPAe&$S0000dKE@duOisOkyZ-5 zuwDqkAi_*y5o3Xrq7ieT<<3p#-R^dGySwea-CgZZZITBc?#1u+FtBuUCJUZe;~j-%Tu@ZpYB;$&ydfdZG#(j;(iB#^yRlqv#C*LO zXWXM0cpKKBlj#L6awm|;A38Zs3mg;sQZmCAZT8m@X{AlP6 zVI=SsiA16x=>2%^XV3U0y4~G+MNE!B{!#;~%L2l(14PX>EblXb{rnCSlVKe0dyf-O zuY#uOf}m&2xq80;4d3i|cuNw}U@sg3VKRU)>Os_1L3pl5mK*|?X3#a}K+EVZt&w?w zefXKP^ZqnW-3y9AhYJZ~r4m*!Z3OSz3d}2Q`nDM_f_u>L%8Cb}8`?bl)x?gwAy>zp z06y57kT6sry1g2l{|V%UW?)JwnbzUugbvpOF3=oZDo}spfs2EWKOH{_^59;ue!o^A z@e7dWS|QI`Ff-E$USJ`LqDF}zH%R}YOlMiv63A=qK^d}n!5_(fW%^k4U_D`_meIDi kNMKea>saR;>gt<+0gk_zsk5>Xc>n+a07*qoM6N<$f>Jg*?*IS* diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png deleted file mode 100644 index 1eb880947ddf3e745c29e8d9dc90f09c7e6e323c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-$R?&;zfqH(@;q9b3Efq-lM(nr^( z=EYR73-9e)UYMWsXy%?aZsD68Yyv^2$~6QgEcljw%kx>O(f-gQ?@fOOx3A-0+Qw?O zRx~W)kn~Qe2d6f9nMG#g9Q04Mk==M~N!Dglvxk!fgVh#w@ZV$IY1+Xc`d{d2UcaP~ zfWp)_Ivqj}l2SPy^9ZWy6rG9Yx4v67_uA&&9|XA~5-#3)W3%em1peD8RWH^#O%XoM zxMPud%}GTj#~*+7JMxTd!`{^Q+>(D3*|@KV`*G2;{QnANOxu1$r2xIe;OXk;vd$@? F2>@zac~<}c diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png deleted file mode 100644 index ae8ecbf47672a874c0958d0d113a56162c2bd364..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmV;60(AX}P)hkjP zNW|QGv-YFNLN^qH@tJycPNG5ti6B7;r4mEr#lr@*T8*M85D`{ZR^BWwF23T<%MYIh zdC)S*p=|xk^!~H=+HSZ183~y8v4|mYmZxt&)5{{~>J`>E223Q5>T$=~mtA71q-jdG z+eJhOAyBW^0k9Gk1+rX8)zFx((CG^&tDY>6XaS~Fy!WJON|Gdujg5^~Vzt@o%BcYLiNiTQSD`zL^ociBz_>bDlpw3kriQ@Z`bVsGz-_6N>$&gTDiKDTKR^ z-hB*tHa^>!oD~5TK^0UK5rZ}RBm50Bv}S-yA%s=Ha5RYb{)!z2N&$&64gfhybBu8p lh~_|?8^bu;BRYt{<}Yrwd83Y=s?Goa002ovPDHLkV1l%3CP4rI diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png deleted file mode 100644 index 6ed2490ed1432d5d667a76235360824a1088e928..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 734 zcmV<40wMj0P)JT{hN;C#tgf#9krG=I>5!<*aE1_(spcgF}<`n4i zJi-}^6UUeU4jUFwdCiVPDm%`Zx^UBa8J(mnR6wEgz^}o8;)M*Y(@l_!Kfv)}4+NuM zaPXE50z)r)9=D=SR|RIqfQ^j}Hu!fzMeQBo+@PZk1G8hOw|vBTvkx`HM)Xe9q3xao z@`p0`NO!2904FHSLA6E@Y-O6zH$DQzvq@aHsz}}<(!v(Z_+EodX%R&NZW75g+nENo zV0020rxE^;7d!067AN>6*+&YLp$9uH6F-=In`XC{Cn%+o|5)b&boEPr02w@|P*oGm QmjD0&07*qoM6N<$g78X0Q~&?~ diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png deleted file mode 100644 index fecadd08afed92536be91ab12d8e37b6bf410d5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 613 zcmV-r0-F7aP)wK%m(L+9IV|s|#(WRl-O^4GvaQsnHq|OstfO zIJ3}3<01}YGARE4m!7=)QisvlHUo!Qymx-@-t*p_129Ko-#pVI)6#!*kLj-AGXWNR zyA_{wKii_amK7^YT-v z6#plaNm#8`-kz@OvjIt^4%IN{@J3bR zRI}ME1Mv85p|%;RK>ViR>APPLB4;;BpCtqE@P+*7!G>I4UjNx~e>r3HA^tWCQ@S)l z{BslcSwL-CxQ&_ZZSv_g0Tu{yi*X){Mt|W7)lbE`SQxFP00000NkvXXu0mjf;)M*S diff --git a/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png b/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png deleted file mode 100644 index fd4bbccdf1643f4ff5022fbc59b82546e259317e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 386 zcmV-|0e$|7P)_QM!1S$Bhw4w+iRuFWf;tfR6D%SMJrb+tx zC9R6{2>Ou6#juIy6u(I?|;&Owi$sRB4^20apB5xE2 z#B9XekY66S6lzfCL!eEQRgo0LokTA55@Y#%_wN!TXPw^Q4IIXsG~v#u_4t;x_HM16EQ@QRY+rut&97&UefsPmLrQ5P zBC2kcbux9L%2bJz$P$XV$*zSxb2e@6_3O#;&!FD<&hLjGn%~%en;7)djE^d6!t$lW7GyIOKlQ46hr`Z zjLNuRDP_53dNoN?wd&HMgL^m1DXFU<5dQsrceN>fSz00000)O9XRTN^$%%`*Fg>ryDtc(lF@?b>dE!20r+y z#Q*>(wbV5H`-E4Do={CJp7=ERhw15hgZi)?jRG88 zzVz(5;g?Td1izJyO33bhjg2Qc7FVY@f9!o)Gu?DII~vm-Dc?}3M!fsgjP?F(7`rgg z+xOk8XD)e?Zl=5+un`5!7kr?F=eq)K-5uqr%yU$1hLv){Vlm=)*5~`lwMciiXFu*g z)*Jkz6AF>#zb(Vx`Iv{bdGZHtlW)v(y5k^|xgSUc9%0}S20nrYrO}78ofk?bV!5)4 z=Ngz@+$9N1>>mA%IWx`Fqa240bWkiW;2TZgd8CZS0U}@mknC;!2;wi$eI@`h0y2JS`Eae0CW}q(2(%!m8 zWq$`PDU>LT1_y*bBv#P5<@q0@ttz$hIH}YMDvAigCc=y*)jY-VOpTd;A8@3t7Xh4r z0KTWOk;N2Ox4!&&^4B*no$WtTX!BXB)rg!y8dvGgKBQKLJNXRRp0}Bsjd1|LNQX~c zbC~fjrk2iL@4dYF*vt;}dFn(%h)n_-vzEIHMOKRkdF%3Lq|zBgKm_h>TEq!))nWjq zzn;B!?!(dQcHu$#=JF`cS&W~C`WHFW^B!~MI#k)>1Vk&eQy8P1O`J6V04{D@|7d6^ zyBABnh-d^H0FX&L07M||E0n_dp4v&Q%PSE9p#R#Hq)`5I_(B5CE#q dxjPz0{s-<+c#AC!i7@~G002ovPDHLkV1iPlpuqqD diff --git a/node_modules/express/node_modules/connect/lib/public/style.css b/node_modules/express/node_modules/connect/lib/public/style.css deleted file mode 100644 index 32b6507..0000000 --- a/node_modules/express/node_modules/connect/lib/public/style.css +++ /dev/null @@ -1,141 +0,0 @@ -body { - margin: 0; - padding: 80px 100px; - font: 13px "Helvetica Neue", "Lucida Grande", "Arial"; - background: #ECE9E9 -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#ECE9E9)); - background: #ECE9E9 -moz-linear-gradient(top, #fff, #ECE9E9); - background-repeat: no-repeat; - color: #555; - -webkit-font-smoothing: antialiased; -} -h1, h2, h3 { - margin: 0; - font-size: 22px; - color: #343434; -} -h1 em, h2 em { - padding: 0 5px; - font-weight: normal; -} -h1 { - font-size: 60px; -} -h2 { - margin-top: 10px; -} -h3 { - margin: 5px 0 10px 0; - padding-bottom: 5px; - border-bottom: 1px solid #eee; - font-size: 18px; -} -ul { - margin: 0; - padding: 0; -} -ul li { - margin: 5px 0; - padding: 3px 8px; - list-style: none; -} -ul li:hover { - cursor: pointer; - color: #2e2e2e; -} -ul li .path { - padding-left: 5px; - font-weight: bold; -} -ul li .line { - padding-right: 5px; - font-style: italic; -} -ul li:first-child .path { - padding-left: 0; -} -p { - line-height: 1.5; -} -a { - color: #555; - text-decoration: none; -} -a:hover { - color: #303030; -} -#stacktrace { - margin-top: 15px; -} -.directory h1 { - margin-bottom: 15px; - font-size: 18px; -} -ul#files { - width: 100%; - height: 500px; -} -ul#files li { - padding: 0; -} -ul#files li img { - position: absolute; - top: 5px; - left: 5px; -} -ul#files li a { - position: relative; - display: block; - margin: 1px; - width: 30%; - height: 25px; - line-height: 25px; - text-indent: 8px; - float: left; - border: 1px solid transparent; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - overflow: hidden; - text-overflow: ellipsis; -} -ul#files li a.icon { - text-indent: 25px; -} -ul#files li a:focus, -ul#files li a:hover { - outline: none; - background: rgba(255,255,255,0.65); - border: 1px solid #ececec; -} -ul#files li a.highlight { - -webkit-transition: background .4s ease-in-out; - background: #ffff4f; - border-color: #E9DC51; -} -#search { - display: block; - position: fixed; - top: 20px; - right: 20px; - width: 90px; - -webkit-transition: width ease 0.2s, opacity ease 0.4s; - -moz-transition: width ease 0.2s, opacity ease 0.4s; - -webkit-border-radius: 32px; - -moz-border-radius: 32px; - -webkit-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.25), inset 0px 1px 3px rgba(0, 0, 0, 0.7), 0px 1px 0px rgba(255, 255, 255, 0.03); - -moz-box-shadow: inset 0px 0px 3px rgba(0, 0, 0, 0.25), inset 0px 1px 3px rgba(0, 0, 0, 0.7), 0px 1px 0px rgba(255, 255, 255, 0.03); - -webkit-font-smoothing: antialiased; - text-align: left; - font: 13px "Helvetica Neue", Arial, sans-serif; - padding: 4px 10px; - border: none; - background: transparent; - margin-bottom: 0; - outline: none; - opacity: 0.7; - color: #888; -} -#search:focus { - width: 120px; - opacity: 1.0; -} diff --git a/node_modules/express/node_modules/connect/lib/utils.js b/node_modules/express/node_modules/connect/lib/utils.js deleted file mode 100644 index c5bb5b7..0000000 --- a/node_modules/express/node_modules/connect/lib/utils.js +++ /dev/null @@ -1,490 +0,0 @@ - -/*! - * Connect - utils - * Copyright(c) 2010 Sencha Inc. - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var http = require('http') - , crypto = require('crypto') - , crc16 = require('crc').crc16 - , Path = require('path') - , fs = require('fs'); - -/** - * Extract the mime type from the given request's - * _Content-Type_ header. - * - * @param {IncomingMessage} req - * @return {String} - * @api private - */ - -exports.mime = function(req) { - var str = req.headers['content-type'] || ''; - return str.split(';')[0]; -}; - -/** - * Generate an `Error` from the given status `code`. - * - * @param {Number} code - * @return {Error} - * @api private - */ - -exports.error = function(code){ - var err = new Error(http.STATUS_CODES[code]); - err.status = code; - return err; -}; - -/** - * Return md5 hash of the given string and optional encoding, - * defaulting to hex. - * - * utils.md5('wahoo'); - * // => "e493298061761236c96b02ea6aa8a2ad" - * - * @param {String} str - * @param {String} encoding - * @return {String} - * @api public - */ - -exports.md5 = function(str, encoding){ - return crypto - .createHash('md5') - .update(str) - .digest(encoding || 'hex'); -}; - -/** - * Merge object b with object a. - * - * var a = { foo: 'bar' } - * , b = { bar: 'baz' }; - * - * utils.merge(a, b); - * // => { foo: 'bar', bar: 'baz' } - * - * @param {Object} a - * @param {Object} b - * @return {Object} - * @api private - */ - -exports.merge = function(a, b){ - if (a && b) { - for (var key in b) { - a[key] = b[key]; - } - } - return a; -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - - -/** - * Return a unique identifier with the given `len`. - * - * utils.uid(10); - * // => "FDaS435D2z" - * - * @param {Number} len - * @return {String} - * @api private - */ - -exports.uid = function(len) { - return crypto.randomBytes(Math.ceil(len * 3 / 4)) - .toString('base64') - .slice(0, len); -}; - -/** - * Sign the given `val` with `secret`. - * - * @param {String} val - * @param {String} secret - * @return {String} - * @api private - */ - -exports.sign = function(val, secret){ - return val + '.' + crypto - .createHmac('sha256', secret) - .update(val) - .digest('base64') - .replace(/=+$/, ''); -}; - -/** - * Unsign and decode the given `val` with `secret`, - * returning `false` if the signature is invalid. - * - * @param {String} val - * @param {String} secret - * @return {String|Boolean} - * @api private - */ - -exports.unsign = function(val, secret){ - var str = val.slice(0,val.lastIndexOf('.')); - return exports.sign(str, secret) == val - ? str - : false; -}; - -/** - * Parse signed cookies, returning an object - * containing the decoded key/value pairs, - * while removing the signed key from `obj`. - * - * TODO: tag signed cookies with "s:" - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -exports.parseSignedCookies = function(obj, secret){ - var ret = {}; - Object.keys(obj).forEach(function(key){ - var val = obj[key] - , signed = exports.unsign(val, secret); - - if (signed) { - ret[key] = signed; - delete obj[key]; - } - }); - return ret; -}; - -/** - * Parse JSON cookies. - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -exports.parseJSONCookies = function(obj){ - var hashes = {}; - - Object.keys(obj).forEach(function(key){ - var val = obj[key]; - if (0 == val.indexOf('j:')) { - try { - hashes[key] = crc16(val); // only crc json cookies for now - obj[key] = JSON.parse(val.slice(2)); - } catch (err) { - // nothing - } - } - }); - - return { - cookies: obj, - hashes: hashes - }; -}; - -/** - * Parse the given cookie string into an object. - * - * @param {String} str - * @return {Object} - * @api private - */ - -exports.parseCookie = function(str){ - var obj = {} - , pairs = str.split(/[;,] */); - for (var i = 0, len = pairs.length; i < len; ++i) { - var pair = pairs[i] - , eqlIndex = pair.indexOf('=') - , key = pair.substr(0, eqlIndex).trim() - , val = pair.substr(++eqlIndex, pair.length).trim(); - - // quoted values - if ('"' == val[0]) val = val.slice(1, -1); - - // only assign once - if (undefined == obj[key]) { - val = val.replace(/\+/g, ' '); - try { - obj[key] = decodeURIComponent(val); - } catch (err) { - if (err instanceof URIError) { - obj[key] = val; - } else { - throw err; - } - } - } - } - return obj; -}; - -/** - * Serialize the given object into a cookie string. - * - * utils.serializeCookie('name', 'tj', { httpOnly: true }) - * // => "name=tj; httpOnly" - * - * @param {String} name - * @param {String} val - * @param {Object} obj - * @return {String} - * @api private - */ - -exports.serializeCookie = function(name, val, obj){ - var pairs = [name + '=' + encodeURIComponent(val)] - , obj = obj || {}; - - if (obj.domain) pairs.push('domain=' + obj.domain); - if (obj.path) pairs.push('path=' + obj.path); - if (obj.expires) pairs.push('expires=' + obj.expires.toUTCString()); - if (obj.httpOnly) pairs.push('httpOnly'); - if (obj.secure) pairs.push('secure'); - - return pairs.join('; '); -}; - -/** - * Pause `data` and `end` events on the given `obj`. - * Middleware performing async tasks _should_ utilize - * this utility (or similar), to re-emit data once - * the async operation has completed, otherwise these - * events may be lost. - * - * var pause = utils.pause(req); - * fs.readFile(path, function(){ - * next(); - * pause.resume(); - * }); - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -exports.pause = function(obj){ - var onData - , onEnd - , events = []; - - // buffer data - obj.on('data', onData = function(data, encoding){ - events.push(['data', data, encoding]); - }); - - // buffer end - obj.on('end', onEnd = function(data, encoding){ - events.push(['end', data, encoding]); - }); - - return { - end: function(){ - obj.removeListener('data', onData); - obj.removeListener('end', onEnd); - }, - resume: function(){ - this.end(); - for (var i = 0, len = events.length; i < len; ++i) { - obj.emit.apply(obj, events[i]); - } - } - }; -}; - -/** - * Check `req` and `res` to see if it has been modified. - * - * @param {IncomingMessage} req - * @param {ServerResponse} res - * @return {Boolean} - * @api private - */ - -exports.modified = function(req, res, headers) { - var headers = headers || res._headers || {} - , modifiedSince = req.headers['if-modified-since'] - , lastModified = headers['last-modified'] - , noneMatch = req.headers['if-none-match'] - , etag = headers['etag']; - - if (noneMatch) noneMatch = noneMatch.split(/ *, */); - - // check If-None-Match - if (noneMatch && etag && ~noneMatch.indexOf(etag)) { - return false; - } - - // check If-Modified-Since - if (modifiedSince && lastModified) { - modifiedSince = new Date(modifiedSince); - lastModified = new Date(lastModified); - // Ignore invalid dates - if (!isNaN(modifiedSince.getTime())) { - if (lastModified <= modifiedSince) return false; - } - } - - return true; -}; - -/** - * Strip `Content-*` headers from `res`. - * - * @param {ServerResponse} res - * @api private - */ - -exports.removeContentHeaders = function(res){ - Object.keys(res._headers).forEach(function(field){ - if (0 == field.indexOf('content')) { - res.removeHeader(field); - } - }); -}; - -/** - * Check if `req` is a conditional GET request. - * - * @param {IncomingMessage} req - * @return {Boolean} - * @api private - */ - -exports.conditionalGET = function(req) { - return req.headers['if-modified-since'] - || req.headers['if-none-match']; -}; - -/** - * Respond with 401 "Unauthorized". - * - * @param {ServerResponse} res - * @param {String} realm - * @api private - */ - -exports.unauthorized = function(res, realm) { - res.statusCode = 401; - res.setHeader('WWW-Authenticate', 'Basic realm="' + realm + '"'); - res.end('Unauthorized'); -}; - -/** - * Respond with 304 "Not Modified". - * - * @param {ServerResponse} res - * @param {Object} headers - * @api private - */ - -exports.notModified = function(res) { - exports.removeContentHeaders(res); - res.statusCode = 304; - res.end(); -}; - -/** - * Return an ETag in the form of `"-"` - * from the given `stat`. - * - * @param {Object} stat - * @return {String} - * @api private - */ - -exports.etag = function(stat) { - return '"' + stat.size + '-' + Number(stat.mtime) + '"'; -}; - -/** - * Parse "Range" header `str` relative to the given file `size`. - * - * @param {Number} size - * @param {String} str - * @return {Array} - * @api private - */ - -exports.parseRange = function(size, str){ - var valid = true; - var arr = str.substr(6).split(',').map(function(range){ - var range = range.split('-') - , start = parseInt(range[0], 10) - , end = parseInt(range[1], 10); - - // -500 - if (isNaN(start)) { - start = size - end; - end = size - 1; - // 500- - } else if (isNaN(end)) { - end = size - 1; - } - - // Invalid - if (isNaN(start) - || isNaN(end) - || start > end - || start < 0) valid = false; - - return { - start: start, - end: end - }; - }); - - return valid ? arr : null; -}; - -/** - * Parse the given Cache-Control `str`. - * - * @param {String} str - * @return {Object} - * @api private - */ - -exports.parseCacheControl = function(str){ - var directives = str.split(',') - , obj = {}; - - for(var i = 0, len = directives.length; i < len; i++) { - var parts = directives[i].split('=') - , key = parts.shift().trim() - , val = parseInt(parts.shift(), 10); - - obj[key] = isNaN(val) ? true : val; - } - - return obj; -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/.gitmodules b/node_modules/express/node_modules/connect/node_modules/crc/.gitmodules deleted file mode 100644 index 2319e18..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "tests/nodeunit"] - path = tests/nodeunit - url = git://github.com/caolan/nodeunit.git diff --git a/node_modules/express/node_modules/connect/node_modules/crc/README.md b/node_modules/express/node_modules/connect/node_modules/crc/README.md deleted file mode 100644 index 01482b3..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# JavaScript CRC 8, 16 and 32. - -This is a basic port/copy of the JavaScript CRC implementation. The module works with any CommonJS system supporting `module.exports` notation as well as in the browser. When loaded in the browser, all functions end up under the `window.crc` "namespace". - -Original code is taken from http://www.digsys.se/JavaScript/CRC.aspx - -## Functions - -The following functions are implemented: - - crc8(String) #=> Number - crcArc(String) #=> Number - crc16(String) #=> Number - fcs16(String) #=> Number - crc32(String) #=> Number - hex8(Number) #=> String - hex16(Number) #=> String - hex32(Number) #=> String - -## Installation - - git clone git://github.com/alexgorbatchev/node-crc.git - -or - - npm install crc - diff --git a/node_modules/express/node_modules/connect/node_modules/crc/lib/crc.js b/node_modules/express/node_modules/connect/node_modules/crc/lib/crc.js deleted file mode 100644 index 9eb9f0a..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/lib/crc.js +++ /dev/null @@ -1,362 +0,0 @@ -(function() -{ - // CRC-8 in table form - // - // Copyright (c) 1989 AnDan Software. You may use this program, or - // code or tables extracted from it, as long as this notice is not - // removed or changed. - var CRC8_TAB = new Array( - // C/C++ language: - // - // unsigned char CRC8_TAB[] = {...}; - 0x00,0x1B,0x36,0x2D,0x6C,0x77,0x5A,0x41,0xD8,0xC3,0xEE,0xF5,0xB4,0xAF,0x82,0x99,0xD3,0xC8,0xE5, - 0xFE,0xBF,0xA4,0x89,0x92,0x0B,0x10,0x3D,0x26,0x67,0x7C,0x51,0x4A,0xC5,0xDE,0xF3,0xE8,0xA9,0xB2, - 0x9F,0x84,0x1D,0x06,0x2B,0x30,0x71,0x6A,0x47,0x5C,0x16,0x0D,0x20,0x3B,0x7A,0x61,0x4C,0x57,0xCE, - 0xD5,0xF8,0xE3,0xA2,0xB9,0x94,0x8F,0xE9,0xF2,0xDF,0xC4,0x85,0x9E,0xB3,0xA8,0x31,0x2A,0x07,0x1C, - 0x5D,0x46,0x6B,0x70,0x3A,0x21,0x0C,0x17,0x56,0x4D,0x60,0x7B,0xE2,0xF9,0xD4,0xCF,0x8E,0x95,0xB8, - 0xA3,0x2C,0x37,0x1A,0x01,0x40,0x5B,0x76,0x6D,0xF4,0xEF,0xC2,0xD9,0x98,0x83,0xAE,0xB5,0xFF,0xE4, - 0xC9,0xD2,0x93,0x88,0xA5,0xBE,0x27,0x3C,0x11,0x0A,0x4B,0x50,0x7D,0x66,0xB1,0xAA,0x87,0x9C,0xDD, - 0xC6,0xEB,0xF0,0x69,0x72,0x5F,0x44,0x05,0x1E,0x33,0x28,0x62,0x79,0x54,0x4F,0x0E,0x15,0x38,0x23, - 0xBA,0xA1,0x8C,0x97,0xD6,0xCD,0xE0,0xFB,0x74,0x6F,0x42,0x59,0x18,0x03,0x2E,0x35,0xAC,0xB7,0x9A, - 0x81,0xC0,0xDB,0xF6,0xED,0xA7,0xBC,0x91,0x8A,0xCB,0xD0,0xFD,0xE6,0x7F,0x64,0x49,0x52,0x13,0x08, - 0x25,0x3E,0x58,0x43,0x6E,0x75,0x34,0x2F,0x02,0x19,0x80,0x9B,0xB6,0xAD,0xEC,0xF7,0xDA,0xC1,0x8B, - 0x90,0xBD,0xA6,0xE7,0xFC,0xD1,0xCA,0x53,0x48,0x65,0x7E,0x3F,0x24,0x09,0x12,0x9D,0x86,0xAB,0xB0, - 0xF1,0xEA,0xC7,0xDC,0x45,0x5E,0x73,0x68,0x29,0x32,0x1F,0x04,0x4E,0x55,0x78,0x63,0x22,0x39,0x14, - 0x0F,0x96,0x8D,0xA0,0xBB,0xFA,0xE1,0xCC,0xD7 - ); - - function crc8Add(crc,c) - // 'crc' should be initialized to 0x00. - { - return CRC8_TAB[(crc^c)&0xFF]; - }; - // C/C++ language: - // - // inline unsigned char crc8Add(unsigned char crc, unsigned char c) - // { - // return CRC8_TAB[crc^c]; - // } - - // CRC-16 (as it is in SEA's ARC) in table form - // - // The logic for this method of calculating the CRC 16 bit polynomial - // is taken from an article by David Schwaderer in the April 1985 - // issue of PC Tech Journal. - var CRC_ARC_TAB = new Array( - // C/C++ language: - // - // unsigned short CRC_ARC_TAB[] = {...}; - 0x0000,0xC0C1,0xC181,0x0140,0xC301,0x03C0,0x0280,0xC241,0xC601,0x06C0,0x0780,0xC741,0x0500, - 0xC5C1,0xC481,0x0440,0xCC01,0x0CC0,0x0D80,0xCD41,0x0F00,0xCFC1,0xCE81,0x0E40,0x0A00,0xCAC1, - 0xCB81,0x0B40,0xC901,0x09C0,0x0880,0xC841,0xD801,0x18C0,0x1980,0xD941,0x1B00,0xDBC1,0xDA81, - 0x1A40,0x1E00,0xDEC1,0xDF81,0x1F40,0xDD01,0x1DC0,0x1C80,0xDC41,0x1400,0xD4C1,0xD581,0x1540, - 0xD701,0x17C0,0x1680,0xD641,0xD201,0x12C0,0x1380,0xD341,0x1100,0xD1C1,0xD081,0x1040,0xF001, - 0x30C0,0x3180,0xF141,0x3300,0xF3C1,0xF281,0x3240,0x3600,0xF6C1,0xF781,0x3740,0xF501,0x35C0, - 0x3480,0xF441,0x3C00,0xFCC1,0xFD81,0x3D40,0xFF01,0x3FC0,0x3E80,0xFE41,0xFA01,0x3AC0,0x3B80, - 0xFB41,0x3900,0xF9C1,0xF881,0x3840,0x2800,0xE8C1,0xE981,0x2940,0xEB01,0x2BC0,0x2A80,0xEA41, - 0xEE01,0x2EC0,0x2F80,0xEF41,0x2D00,0xEDC1,0xEC81,0x2C40,0xE401,0x24C0,0x2580,0xE541,0x2700, - 0xE7C1,0xE681,0x2640,0x2200,0xE2C1,0xE381,0x2340,0xE101,0x21C0,0x2080,0xE041,0xA001,0x60C0, - 0x6180,0xA141,0x6300,0xA3C1,0xA281,0x6240,0x6600,0xA6C1,0xA781,0x6740,0xA501,0x65C0,0x6480, - 0xA441,0x6C00,0xACC1,0xAD81,0x6D40,0xAF01,0x6FC0,0x6E80,0xAE41,0xAA01,0x6AC0,0x6B80,0xAB41, - 0x6900,0xA9C1,0xA881,0x6840,0x7800,0xB8C1,0xB981,0x7940,0xBB01,0x7BC0,0x7A80,0xBA41,0xBE01, - 0x7EC0,0x7F80,0xBF41,0x7D00,0xBDC1,0xBC81,0x7C40,0xB401,0x74C0,0x7580,0xB541,0x7700,0xB7C1, - 0xB681,0x7640,0x7200,0xB2C1,0xB381,0x7340,0xB101,0x71C0,0x7080,0xB041,0x5000,0x90C1,0x9181, - 0x5140,0x9301,0x53C0,0x5280,0x9241,0x9601,0x56C0,0x5780,0x9741,0x5500,0x95C1,0x9481,0x5440, - 0x9C01,0x5CC0,0x5D80,0x9D41,0x5F00,0x9FC1,0x9E81,0x5E40,0x5A00,0x9AC1,0x9B81,0x5B40,0x9901, - 0x59C0,0x5880,0x9841,0x8801,0x48C0,0x4980,0x8941,0x4B00,0x8BC1,0x8A81,0x4A40,0x4E00,0x8EC1, - 0x8F81,0x4F40,0x8D01,0x4DC0,0x4C80,0x8C41,0x4400,0x84C1,0x8581,0x4540,0x8701,0x47C0,0x4680, - 0x8641,0x8201,0x42C0,0x4380,0x8341,0x4100,0x81C1,0x8081,0x4040 - ); - - function crcArcAdd(crc,c) - // 'crc' should be initialized to 0x0000. - { - return CRC_ARC_TAB[(crc^c)&0xFF]^((crc>>8)&0xFF); - }; - // C/C++ language: - // - // inline unsigned short crcArcAdd(unsigned short crc, unsigned char c) - // { - // return CRC_ARC_TAB[(unsigned char)crc^c]^(unsigned short)(crc>>8); - // } - - // CRC-16 (as it is in ZMODEM) in table form - // - // Copyright (c) 1989 AnDan Software. You may use this program, or - // code or tables extracted from it, as long as this notice is not - // removed or changed. - var CRC16_TAB = new Array( - // C/C++ language: - // - // unsigned short CRC16_TAB[] = {...}; - 0x0000,0x1021,0x2042,0x3063,0x4084,0x50A5,0x60C6,0x70E7,0x8108,0x9129,0xA14A,0xB16B,0xC18C, - 0xD1AD,0xE1CE,0xF1EF,0x1231,0x0210,0x3273,0x2252,0x52B5,0x4294,0x72F7,0x62D6,0x9339,0x8318, - 0xB37B,0xA35A,0xD3BD,0xC39C,0xF3FF,0xE3DE,0x2462,0x3443,0x0420,0x1401,0x64E6,0x74C7,0x44A4, - 0x5485,0xA56A,0xB54B,0x8528,0x9509,0xE5EE,0xF5CF,0xC5AC,0xD58D,0x3653,0x2672,0x1611,0x0630, - 0x76D7,0x66F6,0x5695,0x46B4,0xB75B,0xA77A,0x9719,0x8738,0xF7DF,0xE7FE,0xD79D,0xC7BC,0x48C4, - 0x58E5,0x6886,0x78A7,0x0840,0x1861,0x2802,0x3823,0xC9CC,0xD9ED,0xE98E,0xF9AF,0x8948,0x9969, - 0xA90A,0xB92B,0x5AF5,0x4AD4,0x7AB7,0x6A96,0x1A71,0x0A50,0x3A33,0x2A12,0xDBFD,0xCBDC,0xFBBF, - 0xEB9E,0x9B79,0x8B58,0xBB3B,0xAB1A,0x6CA6,0x7C87,0x4CE4,0x5CC5,0x2C22,0x3C03,0x0C60,0x1C41, - 0xEDAE,0xFD8F,0xCDEC,0xDDCD,0xAD2A,0xBD0B,0x8D68,0x9D49,0x7E97,0x6EB6,0x5ED5,0x4EF4,0x3E13, - 0x2E32,0x1E51,0x0E70,0xFF9F,0xEFBE,0xDFDD,0xCFFC,0xBF1B,0xAF3A,0x9F59,0x8F78,0x9188,0x81A9, - 0xB1CA,0xA1EB,0xD10C,0xC12D,0xF14E,0xE16F,0x1080,0x00A1,0x30C2,0x20E3,0x5004,0x4025,0x7046, - 0x6067,0x83B9,0x9398,0xA3FB,0xB3DA,0xC33D,0xD31C,0xE37F,0xF35E,0x02B1,0x1290,0x22F3,0x32D2, - 0x4235,0x5214,0x6277,0x7256,0xB5EA,0xA5CB,0x95A8,0x8589,0xF56E,0xE54F,0xD52C,0xC50D,0x34E2, - 0x24C3,0x14A0,0x0481,0x7466,0x6447,0x5424,0x4405,0xA7DB,0xB7FA,0x8799,0x97B8,0xE75F,0xF77E, - 0xC71D,0xD73C,0x26D3,0x36F2,0x0691,0x16B0,0x6657,0x7676,0x4615,0x5634,0xD94C,0xC96D,0xF90E, - 0xE92F,0x99C8,0x89E9,0xB98A,0xA9AB,0x5844,0x4865,0x7806,0x6827,0x18C0,0x08E1,0x3882,0x28A3, - 0xCB7D,0xDB5C,0xEB3F,0xFB1E,0x8BF9,0x9BD8,0xABBB,0xBB9A,0x4A75,0x5A54,0x6A37,0x7A16,0x0AF1, - 0x1AD0,0x2AB3,0x3A92,0xFD2E,0xED0F,0xDD6C,0xCD4D,0xBDAA,0xAD8B,0x9DE8,0x8DC9,0x7C26,0x6C07, - 0x5C64,0x4C45,0x3CA2,0x2C83,0x1CE0,0x0CC1,0xEF1F,0xFF3E,0xCF5D,0xDF7C,0xAF9B,0xBFBA,0x8FD9, - 0x9FF8,0x6E17,0x7E36,0x4E55,0x5E74,0x2E93,0x3EB2,0x0ED1,0x1EF0 - ); - - function crc16Add(crc,c) - // 'crc' should be initialized to 0x0000. - { - return CRC16_TAB[((crc>>8)^c)&0xFF]^((crc<<8)&0xFFFF); - }; - // C/C++ language: - // - // inline unsigned short crc16Add(unsigned short crc, unsigned char c) - // { - // return CRC16_TAB[(unsigned char)(crc>>8)^c]^(unsigned short)(crc<<8); - // } - - // FCS-16 (as it is in PPP) in table form - // - // Described in RFC-1662 by William Allen Simpson, see RFC-1662 for references. - // - // Modified by Anders Danielsson, March 10, 2006. - var FCS_16_TAB = new Array( - // C/C++ language: - // - // unsigned short FCS_16_TAB[256] = {...}; - 0x0000,0x1189,0x2312,0x329B,0x4624,0x57AD,0x6536,0x74BF,0x8C48,0x9DC1,0xAF5A,0xBED3,0xCA6C, - 0xDBE5,0xE97E,0xF8F7,0x1081,0x0108,0x3393,0x221A,0x56A5,0x472C,0x75B7,0x643E,0x9CC9,0x8D40, - 0xBFDB,0xAE52,0xDAED,0xCB64,0xF9FF,0xE876,0x2102,0x308B,0x0210,0x1399,0x6726,0x76AF,0x4434, - 0x55BD,0xAD4A,0xBCC3,0x8E58,0x9FD1,0xEB6E,0xFAE7,0xC87C,0xD9F5,0x3183,0x200A,0x1291,0x0318, - 0x77A7,0x662E,0x54B5,0x453C,0xBDCB,0xAC42,0x9ED9,0x8F50,0xFBEF,0xEA66,0xD8FD,0xC974,0x4204, - 0x538D,0x6116,0x709F,0x0420,0x15A9,0x2732,0x36BB,0xCE4C,0xDFC5,0xED5E,0xFCD7,0x8868,0x99E1, - 0xAB7A,0xBAF3,0x5285,0x430C,0x7197,0x601E,0x14A1,0x0528,0x37B3,0x263A,0xDECD,0xCF44,0xFDDF, - 0xEC56,0x98E9,0x8960,0xBBFB,0xAA72,0x6306,0x728F,0x4014,0x519D,0x2522,0x34AB,0x0630,0x17B9, - 0xEF4E,0xFEC7,0xCC5C,0xDDD5,0xA96A,0xB8E3,0x8A78,0x9BF1,0x7387,0x620E,0x5095,0x411C,0x35A3, - 0x242A,0x16B1,0x0738,0xFFCF,0xEE46,0xDCDD,0xCD54,0xB9EB,0xA862,0x9AF9,0x8B70,0x8408,0x9581, - 0xA71A,0xB693,0xC22C,0xD3A5,0xE13E,0xF0B7,0x0840,0x19C9,0x2B52,0x3ADB,0x4E64,0x5FED,0x6D76, - 0x7CFF,0x9489,0x8500,0xB79B,0xA612,0xD2AD,0xC324,0xF1BF,0xE036,0x18C1,0x0948,0x3BD3,0x2A5A, - 0x5EE5,0x4F6C,0x7DF7,0x6C7E,0xA50A,0xB483,0x8618,0x9791,0xE32E,0xF2A7,0xC03C,0xD1B5,0x2942, - 0x38CB,0x0A50,0x1BD9,0x6F66,0x7EEF,0x4C74,0x5DFD,0xB58B,0xA402,0x9699,0x8710,0xF3AF,0xE226, - 0xD0BD,0xC134,0x39C3,0x284A,0x1AD1,0x0B58,0x7FE7,0x6E6E,0x5CF5,0x4D7C,0xC60C,0xD785,0xE51E, - 0xF497,0x8028,0x91A1,0xA33A,0xB2B3,0x4A44,0x5BCD,0x6956,0x78DF,0x0C60,0x1DE9,0x2F72,0x3EFB, - 0xD68D,0xC704,0xF59F,0xE416,0x90A9,0x8120,0xB3BB,0xA232,0x5AC5,0x4B4C,0x79D7,0x685E,0x1CE1, - 0x0D68,0x3FF3,0x2E7A,0xE70E,0xF687,0xC41C,0xD595,0xA12A,0xB0A3,0x8238,0x93B1,0x6B46,0x7ACF, - 0x4854,0x59DD,0x2D62,0x3CEB,0x0E70,0x1FF9,0xF78F,0xE606,0xD49D,0xC514,0xB1AB,0xA022,0x92B9, - 0x8330,0x7BC7,0x6A4E,0x58D5,0x495C,0x3DE3,0x2C6A,0x1EF1,0x0F78 - ); - - function fcs16Add(fcs,c) - // 'fcs' should be initialized to 0xFFFF and after the computation it should be - // complemented (inverted). - // - // If the FCS-16 is calculated over the data and over the complemented FCS-16, the - // result will always be 0xF0B8 (without the complementation). - { - return FCS_16_TAB[(fcs^c)&0xFF]^((fcs>>8)&0xFF); - }; - - // C/C++ language: - // - // inline unsigned short fcs16Add(unsigned short fcs, unsigned char c) - // { - // return FCS_16_TAB[(unsigned char)fcs^c]^(unsigned short)(fcs>>8); - // } - - // - // CRC-32 (as it is in ZMODEM) in table form - // - // Copyright (C) 1986 Gary S. Brown. You may use this program, or - // code or tables extracted from it, as desired without restriction. - // - // Modified by Anders Danielsson, February 5, 1989 and March 10, 2006. - // - // This is also known as FCS-32 (as it is in PPP), described in - // RFC-1662 by William Allen Simpson, see RFC-1662 for references. - // - var CRC32_TAB = new Array( /* CRC polynomial 0xEDB88320 */ - // C/C++ language: - // - // unsigned long CRC32_TAB[] = {...}; - 0x00000000,0x77073096,0xEE0E612C,0x990951BA,0x076DC419,0x706AF48F,0xE963A535,0x9E6495A3, - 0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988,0x09B64C2B,0x7EB17CBD,0xE7B82D07,0x90BF1D91, - 0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE,0x1ADAD47D,0x6DDDE4EB,0xF4D4B551,0x83D385C7, - 0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC,0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5, - 0x3B6E20C8,0x4C69105E,0xD56041E4,0xA2677172,0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B, - 0x35B5A8FA,0x42B2986C,0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59, - 0x26D930AC,0x51DE003A,0xC8D75180,0xBFD06116,0x21B4F4B5,0x56B3C423,0xCFBA9599,0xB8BDA50F, - 0x2802B89E,0x5F058808,0xC60CD9B2,0xB10BE924,0x2F6F7C87,0x58684C11,0xC1611DAB,0xB6662D3D, - 0x76DC4190,0x01DB7106,0x98D220BC,0xEFD5102A,0x71B18589,0x06B6B51F,0x9FBFE4A5,0xE8B8D433, - 0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818,0x7F6A0DBB,0x086D3D2D,0x91646C97,0xE6635C01, - 0x6B6B51F4,0x1C6C6162,0x856530D8,0xF262004E,0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457, - 0x65B0D9C6,0x12B7E950,0x8BBEB8EA,0xFCB9887C,0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0xFBD44C65, - 0x4DB26158,0x3AB551CE,0xA3BC0074,0xD4BB30E2,0x4ADFA541,0x3DD895D7,0xA4D1C46D,0xD3D6F4FB, - 0x4369E96A,0x346ED9FC,0xAD678846,0xDA60B8D0,0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9, - 0x5005713C,0x270241AA,0xBE0B1010,0xC90C2086,0x5768B525,0x206F85B3,0xB966D409,0xCE61E49F, - 0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4,0x59B33D17,0x2EB40D81,0xB7BD5C3B,0xC0BA6CAD, - 0xEDB88320,0x9ABFB3B6,0x03B6E20C,0x74B1D29A,0xEAD54739,0x9DD277AF,0x04DB2615,0x73DC1683, - 0xE3630B12,0x94643B84,0x0D6D6A3E,0x7A6A5AA8,0xE40ECF0B,0x9309FF9D,0x0A00AE27,0x7D079EB1, - 0xF00F9344,0x8708A3D2,0x1E01F268,0x6906C2FE,0xF762575D,0x806567CB,0x196C3671,0x6E6B06E7, - 0xFED41B76,0x89D32BE0,0x10DA7A5A,0x67DD4ACC,0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5, - 0xD6D6A3E8,0xA1D1937E,0x38D8C2C4,0x4FDFF252,0xD1BB67F1,0xA6BC5767,0x3FB506DD,0x48B2364B, - 0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60,0xDF60EFC3,0xA867DF55,0x316E8EEF,0x4669BE79, - 0xCB61B38C,0xBC66831A,0x256FD2A0,0x5268E236,0xCC0C7795,0xBB0B4703,0x220216B9,0x5505262F, - 0xC5BA3BBE,0xB2BD0B28,0x2BB45A92,0x5CB36A04,0xC2D7FFA7,0xB5D0CF31,0x2CD99E8B,0x5BDEAE1D, - 0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A,0x9C0906A9,0xEB0E363F,0x72076785,0x05005713, - 0x95BF4A82,0xE2B87A14,0x7BB12BAE,0x0CB61B38,0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21, - 0x86D3D2D4,0xF1D4E242,0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777, - 0x88085AE6,0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45, - 0xA00AE278,0xD70DD2EE,0x4E048354,0x3903B3C2,0xA7672661,0xD06016F7,0x4969474D,0x3E6E77DB, - 0xAED16A4A,0xD9D65ADC,0x40DF0B66,0x37D83BF0,0xA9BCAE53,0xDEBB9EC5,0x47B2CF7F,0x30B5FFE9, - 0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6,0xBAD03605,0xCDD70693,0x54DE5729,0x23D967BF, - 0xB3667A2E,0xC4614AB8,0x5D681B02,0x2A6F2B94,0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D - ); - - function crc32Add(crc,c) - // 'crc' should be initialized to 0xFFFFFFFF and after the computation it should be - // complemented (inverted). - // - // CRC-32 is also known as FCS-32. - // - // If the FCS-32 is calculated over the data and over the complemented FCS-32, the - // result will always be 0xDEBB20E3 (without the complementation). - { - return CRC32_TAB[(crc^c)&0xFF]^((crc>>8)&0xFFFFFF); - }; - // - // C/C++ language: - // - // inline unsigned long crc32Add(unsigned long crc, unsigned char c) - // { - // return CRC32_TAB[(unsigned char)crc^c]^(crc>>8); - // } - // - - function crc8(str) - { - var n, - len = str.length, - crc = 0 - ; - - for(i = 0; i < len; i++) - crc = crc8Add(crc, str.charCodeAt(i)); - - return crc; - }; - - function crcArc(str) - { - var i, - len = str.length, - crc = 0 - ; - - for(i = 0; i < len; i++) - crc = crcArcAdd(crc, str.charCodeAt(i)); - - return crc; - }; - - function crc16(str) - { - var i, - len = str.length, - crc = 0 - ; - - for(i = 0; i < len; i++) - crc = crc16Add(crc, str.charCodeAt(i)); - - return crc; - }; - - function fcs16(str) - { - var i, - len = str.length, - fcs = 0xFFFF - ; - - for(i = 0; i < len; i++) - fcs = fcs16Add(fcs,str.charCodeAt(i)); - - return fcs^0xFFFF; - }; - - function crc32(str) - { - var i, - len = str.length, - crc = 0xFFFFFFFF - ; - - for(i = 0; i < len; i++) - crc = crc32Add(crc, str.charCodeAt(i)); - - return crc^0xFFFFFFFF; - }; - - /** - * Convert value as 8-bit unsigned integer to 2 digit hexadecimal number. - */ - function hex8(val) - { - var n = val & 0xFF, - str = n.toString(16).toUpperCase() - ; - - while(str.length < 2) - str = "0" + str; - - return str; - }; - - /** - * Convert value as 16-bit unsigned integer to 4 digit hexadecimal number. - */ - function hex16(val) - { - return hex8(val >> 8) + hex8(val); - }; - - /** - * Convert value as 32-bit unsigned integer to 8 digit hexadecimal number. - */ - function hex32(val) - { - return hex16(val >> 16) + hex16(val); - }; - - var target, property; - - if(typeof(window) == 'undefined') - { - target = module; - property = 'exports'; - } - else - { - target = window; - property = 'crc'; - } - - target[property] = { - 'crc8' : crc8, - 'crcArc' : crcArc, - 'crc16' : crc16, - 'fcs16' : fcs16, - 'crc32' : crc32, - 'hex8' : hex8, - 'hex16' : hex16, - 'hex32' : hex32 - }; -})(); diff --git a/node_modules/express/node_modules/connect/node_modules/crc/package.json b/node_modules/express/node_modules/connect/node_modules/crc/package.json deleted file mode 100644 index 8fa6ef6..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "crc", - "version": "0.1.0", - "description": "CRC JavaScript implementation", - "author": { - "name": "Alex Gorbatchev", - "email": "alex.gorbatchev@gmail.com" - }, - "contributors": [], - "main": "./lib/crc.js", - "scripts": {}, - "directories": {}, - "repository": { - "type": "git", - "url": "git://github.com/alexgorbatchev/node-crc.git" - }, - "_id": "crc@0.1.0", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "crc@0.1.0" -} diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/crc_tests.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/crc_tests.js deleted file mode 100755 index 93eea42..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/crc_tests.js +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env ./nodeunit/bin/nodeunit - -var crc = require('../lib/crc'); - -var fixture = { - 'crc8': [ - ['hello world', 64] - ], - - 'crc16': [ - ['hello world', 15332] - ], - - 'crc32': [ - ['hello world', 222957957] - ], - - 'crcArc': [ - ['hello world', 14785] - ], - - 'fcs16': [ - ['hello world', 44550] - ], - - 'hex8': [ - [64, '40'] - ], - - 'hex16': [ - [15332, '3BE4'] - ], - - 'hex32': [ - [222957957, '0D4A1185'] - ] -}; - -var suite = module.exports['crc'] = {}; - -for(var func in fixture) -{ - var list = fixture[func]; - - for(var i = 0; i < list.length; i++) - { - var input = list[i][0], - output = list[i][1], - name = [ func, input, output ].join(' - ') - ; - - suite[name] = (function(func, input, output) - { - - return function(assert) - { - assert.deepEqual(crc[func](input), output); - assert.done(); - }; - - })(func, input, output); - } -}; - diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/.npmignore b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/.npmignore deleted file mode 100644 index 1a82501..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -dist -stamp-build -test/fixtures/dir2 diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/CONTRIBUTORS.md b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/CONTRIBUTORS.md deleted file mode 100644 index ebaa38e..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/CONTRIBUTORS.md +++ /dev/null @@ -1,56 +0,0 @@ -Nodeunit contributors (sorted alphabeticaly) -============================================ - -* **[Alex Gorbatchev](https://github.com/alexgorbatchev)** - - * Deeper default object inspection - * Timeout to ensure flushing of console output (default reporter) - -* **[Alex Wolfe](https://github.com/alexkwolfe)** - - * HTML test reporter - -* **[Caolan McMahon](https://github.com/caolan)** - - * Author and maintainer - * Most features develpopment - -* **[Carl Fürstenberg](https://github.com/azatoth)** - - * Debian-friendly Makefile, supports both 'node' and 'nodejs' executables - * Sandbox utility - * Minimal test reporter - -* **[Gerad Suyderhoud](https://github.com/gerad)** - - * First comand-line tool - -* **[Kadir Pekel](https://github.com/coffeemate)** - - * Improvements to default test reporter - * HTTP test utility - -* **[Oleg Efimov](https://github.com/Sannis)** - - * Adding 'make lint' and fixing nodelint errors - * Option parsing, --help text and config file support - * Reporters option for command-line tool - -* **[Orlando Vazquez](https://github.com/orlandov)** - - * Added jUnit XML reporter - -* **[Ryan Dahl](https://github.com/ry)** - - * Add package.json - -* **[Sam Stephenson](https://github.com/sstephenson)** - - * Coffee-script support - -* **[Thomas Mayfield](https://github.com/thegreatape)** - - * Async setUp and tearDown support for testCase - -**[Full contributors list](https://github.com/caolan/nodeunit/contributors).** - diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/LICENSE b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Caolan McMahon - -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/express/node_modules/connect/node_modules/crc/tests/nodeunit/Makefile b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/Makefile deleted file mode 100644 index f3e57cc..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/Makefile +++ /dev/null @@ -1,126 +0,0 @@ -PACKAGE = nodeunit -NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node) - -PREFIX ?= /usr/local -BINDIR ?= $(PREFIX)/bin -DATADIR ?= $(PREFIX)/share -MANDIR ?= $(PREFIX)/share/man -LIBDIR ?= $(PREFIX)/lib -NODEJSLIBDIR ?= $(LIBDIR)/$(NODEJS) - -BUILDDIR = dist - -DOCS = $(shell find doc -name '*.md' \ - |sed 's|.md|.1|g' \ - |sed 's|doc/|man1/|g' \ - ) - - -$(shell if [ ! -d $(BUILDDIR) ]; then mkdir $(BUILDDIR); fi) - -all: build doc - -browser: - # super hacky build script for browser version! - mkdir -p $(BUILDDIR)/browser - rm -rf $(BUILDDIR)/browser/* - # build browser version of nodeunit.js - cat share/license.js >> $(BUILDDIR)/browser/nodeunit.js - echo "nodeunit = (function(){" >> $(BUILDDIR)/browser/nodeunit.js - cat deps/json2.js >> $(BUILDDIR)/browser/nodeunit.js - # make assert global - echo "var assert = this.assert = {};" >> $(BUILDDIR)/browser/nodeunit.js - echo "var types = {};" >> $(BUILDDIR)/browser/nodeunit.js - echo "var core = {};" >> $(BUILDDIR)/browser/nodeunit.js - echo "var nodeunit = {};" >> $(BUILDDIR)/browser/nodeunit.js - echo "var reporter = {};" >> $(BUILDDIR)/browser/nodeunit.js - cat deps/async.js >> $(BUILDDIR)/browser/nodeunit.js - echo "(function(exports){" >> $(BUILDDIR)/browser/nodeunit.js - cat lib/assert.js >> $(BUILDDIR)/browser/nodeunit.js - echo "})(assert);" >> $(BUILDDIR)/browser/nodeunit.js - echo "(function(exports){" >> $(BUILDDIR)/browser/nodeunit.js - cat lib/types.js >> $(BUILDDIR)/browser/nodeunit.js - echo "})(types);" >> $(BUILDDIR)/browser/nodeunit.js - echo "(function(exports){" >> $(BUILDDIR)/browser/nodeunit.js - cat lib/core.js >> $(BUILDDIR)/browser/nodeunit.js - echo "})(core);" >> $(BUILDDIR)/browser/nodeunit.js - echo "(function(exports){" >> $(BUILDDIR)/browser/nodeunit.js - cat lib/reporters/browser.js >> $(BUILDDIR)/browser/nodeunit.js - echo "})(reporter);" >> $(BUILDDIR)/browser/nodeunit.js - echo "nodeunit = core;" >> $(BUILDDIR)/browser/nodeunit.js - echo "nodeunit.assert = assert;" >> $(BUILDDIR)/browser/nodeunit.js - echo "nodeunit.reporter = reporter;" >> $(BUILDDIR)/browser/nodeunit.js - echo "nodeunit.run = reporter.run;" >> $(BUILDDIR)/browser/nodeunit.js - echo "return nodeunit; })();" >> $(BUILDDIR)/browser/nodeunit.js - sed -i "/\@REMOVE_LINE_FOR_BROWSER/d" $(BUILDDIR)/browser/nodeunit.js - # copy nodeunit.css - cp share/nodeunit.css $(BUILDDIR)/browser/nodeunit.css - # create nodeunit.min.js - uglifyjs $(BUILDDIR)/browser/nodeunit.js > $(BUILDDIR)/browser/nodeunit.min.js - # create test scripts - mkdir -p $(BUILDDIR)/browser/test - cp test/test.html $(BUILDDIR)/browser/test/test.html - # test-base.js - echo "(function (exports) {" > $(BUILDDIR)/browser/test/test-base.js - cat test/test-base.js >> $(BUILDDIR)/browser/test/test-base.js - echo "})(this.test_base = {});" >> $(BUILDDIR)/browser/test/test-base.js - sed -i "/\@REMOVE_LINE_FOR_BROWSER/d" $(BUILDDIR)/browser/test/test-base.js - # test-runmodule.js - echo "(function (exports) {" > $(BUILDDIR)/browser/test/test-runmodule.js - cat test/test-runmodule.js >> $(BUILDDIR)/browser/test/test-runmodule.js - echo "})(this.test_runmodule = {});" >> $(BUILDDIR)/browser/test/test-runmodule.js - sed -i "/\@REMOVE_LINE_FOR_BROWSER/d" $(BUILDDIR)/browser/test/test-runmodule.js - # test-runtest.js - echo "(function (exports) {" > $(BUILDDIR)/browser/test/test-runtest.js - cat test/test-runtest.js >> $(BUILDDIR)/browser/test/test-runtest.js - echo "})(this.test_runtest = {});" >> $(BUILDDIR)/browser/test/test-runtest.js - sed -i "/\@REMOVE_LINE_FOR_BROWSER/d" $(BUILDDIR)/browser/test/test-runtest.js - # test-testcase.js - echo "(function (exports) {" > $(BUILDDIR)/browser/test/test-testcase.js - cat test/test-testcase.js >> $(BUILDDIR)/browser/test/test-testcase.js - echo "})(this.test_testcase = {});" >> $(BUILDDIR)/browser/test/test-testcase.js - sed -i "/\@REMOVE_LINE_FOR_BROWSER/d" $(BUILDDIR)/browser/test/test-testcase.js - # copy nodeunit.js to dist/browser/test to make it easier for me to host and - # run on windows VMs with IE - cp $(BUILDDIR)/browser/nodeunit.js $(BUILDDIR)/browser/test/nodeunit.js - cp $(BUILDDIR)/browser/nodeunit.css $(BUILDDIR)/browser/test/nodeunit.css - -build: stamp-build - -stamp-build: $(wildcard deps/* lib/*.js) - touch $@; - mkdir -p $(BUILDDIR)/nodeunit - cp -R bin deps index.js lib package.json $(BUILDDIR)/nodeunit - printf '#!/bin/sh\n$(NODEJS) $(NODEJSLIBDIR)/$(PACKAGE)/bin/nodeunit $$@' > $(BUILDDIR)/nodeunit.sh - -test: - $(NODEJS) ./bin/nodeunit test - -install: build - install --directory $(NODEJSLIBDIR) - cp -a $(BUILDDIR)/nodeunit $(NODEJSLIBDIR) - install --mode=0755 $(BUILDDIR)/nodeunit.sh $(BINDIR)/nodeunit - install --directory $(MANDIR)/man1/ - cp -a man1/nodeunit.1 $(MANDIR)/man1/ - -uninstall: - rm -rf $(NODEJSLIBDIR)/nodeunit $(NODEJSLIBDIR)/nodeunit.js $(BINDIR)/nodeunit - rm -rf $(MANDIR)/man1/nodeunit.1 - -clean: - rm -rf $(BUILDDIR) stamp-build - -lint: - nodelint --config nodelint.cfg ./index.js ./bin/nodeunit ./bin/nodeunit.json ./lib/*.js ./lib/reporters/*.js ./test/*.js - -doc: man1 $(DOCS) - @true - -man1: - @if ! test -d man1 ; then mkdir -p man1 ; fi - -# use `npm install ronn` for this to work. -man1/%.1: doc/%.md - ronn --roff $< > $@ - -.PHONY: browser test install uninstall build all diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/README.md b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/README.md deleted file mode 100644 index 67026a2..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/README.md +++ /dev/null @@ -1,430 +0,0 @@ -Nodeunit -======== - -Simple syntax, powerful tools. Nodeunit provides easy async unit testing for -node.js and the browser. - -* Simple to use -* Just export the tests from a module -* Works with node.js and in the browser. -* Helps you avoid common pitfalls when testing asynchronous code -* Easy to add test cases with setUp and tearDown functions if you wish -* Flexible reporters for custom output, built-in support for HTML and jUnit XML -* Allows the use of mocks and stubs - -__Contributors__ - -* [alexgorbatchev](https://github.com/alexgorbatchev) -* [alexkwolfe](https://github.com/alexkwolfe) -* [azatoth](https://github.com/azatoth) -* [coffeemate](https://github.com/coffeemate) -* [orlandov](https://github.com/orlandov) -* [Sannis](https://github.com/Sannis) -* [sstephenson](https://github.com/sstephenson) -* [thegreatape](https://github.com/thegreatape) -* and thanks to [cjohansen](https://github.com/cjohansen) for input and advice - on implementing setUp and tearDown functions. See - [cjohansen's fork](https://github.com/cjohansen/nodeunit). - -Also, check out gerad's [nodeunit-dsl](https://github.com/gerad/nodeunit-dsl) -project, which implements a 'pretty dsl on top of nodeunit'. - -More contributor information can be found in the CONTRIBUTORS.md file. - -Usage ------ - -Here is an example unit test module: - - exports.testSomething = function(test){ - test.expect(1); - test.ok(true, "this assertion should pass"); - test.done(); - }; - - exports.testSomethingElse = function(test){ - test.ok(false, "this assertion should fail"); - test.done(); - }; - -When run using the included test runner, this will output the following: - - - -Installation ------------- - -There are two options for installing nodeunit: - -1. Clone / download nodeunit from [github](https://github.com/caolan/nodeunit), - then: - - make && sudo make install - -2. Install via npm: - - npm install nodeunit - -API Documentation ------------------ - -Nodeunit uses the functions available in the node.js -[assert module](http://nodejs.org/api.html#assert-280): - -* __ok(value, [message])__ - Tests if value is a true value. -* __equal(actual, expected, [message])__ - Tests shallow, coercive equality - with the equal comparison operator ( == ). -* __notEqual(actual, expected, [message])__ - Tests shallow, coercive - non-equality with the not equal comparison operator ( != ). -* __deepEqual(actual, expected, [message])__ - Tests for deep equality. -* __notDeepEqual(actual, expected, [message])__ - Tests for any deep - inequality. -* __strictEqual(actual, expected, [message])__ - Tests strict equality, as - determined by the strict equality operator ( === ) -* __notStrictEqual(actual, expected, [message])__ - Tests strict non-equality, - as determined by the strict not equal operator ( !== ) -* __throws(block, [error], [message])__ - Expects block to throw an error. -* __doesNotThrow(block, [error], [message])__ - Expects block not to throw an - error. -* __ifError(value)__ - Tests if value is not a false value, throws if it is a - true value. Useful when testing the first argument, error in callbacks. - -Nodeunit also provides the following functions within tests: - -* __expect(amount)__ - Specify how many assertions are expected to run within a - test. Very useful for ensuring that all your callbacks and assertions are - run. -* __done()__ - Finish the current test function, and move on to the next. ALL - tests should call this! - -Nodeunit aims to be simple and easy to learn. This is achieved through using -existing structures (such as node.js modules) to maximum effect, and reducing -the API where possible, to make it easier to digest. - -Tests are simply exported from a module, but they are still run in the order -they are defined. - -__Note:__ Users of old nodeunit versions may remember using ok, equals and same -in the style of qunit, instead of the assert functions above. These functions -still exist for backwards compatibility, and are simply aliases to their assert -module counterparts. - - -Asynchronous Testing --------------------- - -When testing asynchronous code, there are a number of sharp edges to watch out -for. Thankfully, nodeunit is designed to help you avoid as many of these -pitfalls as possible. For the most part, testing asynchronous code in nodeunit -_just works_. - - -### Tests run in series - -While running tests in parallel seems like a good idea for speeding up your -test suite, in practice I've found it means writing much more complicated -tests. Because of node's module cache, running tests in parallel means mocking -and stubbing is pretty much impossible. One of the nicest things about testing -in javascript is the ease of doing stubs: - - var _readFile = fs.readFile; - fs.readFile = function(path, callback){ - // its a stub! - }; - // test function that uses fs.readFile - - // we're done - fs.readFile = _readFile; - -You cannot do this when running tests in parallel. In order to keep testing as -simple as possible, nodeunit avoids it. Thankfully, most unit-test suites run -fast anyway. - - -### Explicit ending of tests - -When testing async code its important that tests end at the correct point, not -just after a given number of assertions. Otherwise your tests can run short, -ending before all assertions have completed. Its important to detect too -many assertions as well as too few. Combining explicit ending of tests with -an expected number of assertions helps to avoid false test passes, so be sure -to use the test.expect() method at the start of your test functions, and -test.done() when finished. - - -Groups, setUp and tearDown --------------------------- - -Nodeunit allows the nesting of test functions: - - exports.test1 = function (test) { - ... - } - - exports.group = { - test2: function (test) { - ... - }, - test3: function (test) { - ... - } - } - -This would be run as: - - test1 - group - test2 - group - test3 - -Using these groups its possible to add setUp and tearDown functions to your -tests. Nodeunit has a utility function called testCase which allows you to -define a setUp function, which is run before each test, and a tearDown -function, which is run after each test calls test.done(): - - var testCase = require('nodeunit').testCase; - - module.exports = testCase({ - setUp: function (callback) { - this.foo = 'bar'; - callback(); - }, - tearDown: function (callback) { - // clean up - callback(); - }, - test1: function (test) { - test.equals(this.foo, 'bar'); - test.done(); - } - }); - -In this way, its possible to have multiple groups of tests in a module, each -group with its own setUp and tearDown functions. - - -Running Tests -------------- - -Nodeunit comes with a basic command-line test runner, which can be installed -using 'sudo make install'. Example usage: - - nodeunit testmodule1.js testfolder [...] - -The default test reporter uses color output, because I think that's more fun :) I -intend to add a no-color option in future. To give you a feeling of the fun you'll -be having writing tests, lets fix the example at the start of the README: - - - -Ahhh, Doesn't that feel better? - -When using the included test runner, it will exit using the failed number of -assertions as the exit code. Exiting with 0 when all tests pass. - - -### Command-line Options - -* __--reporter FILE__ - you can set the test reporter to a custom module or -on of the modules in nodeunit/lib/reporters, when omitted, the default test runner -is used. -* __--list-reporters__ - list available build-in reporters. -* __--config FILE__ - load config options from a JSON file, allows -the customisation of color schemes for the default test reporter etc. See -bin/nodeunit.json for current available options. -* __--version__ or __-v__ - report nodeunit version -* __--help__ - show nodeunit help - - -Running tests in the browser ----------------------------- - -Nodeunit tests can also be run inside the browser. For example usage, see -the examples/browser folder. The basic syntax is as follows: - -__test.html__ - - - - Example Test Suite - - - - - - -

    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 completed = []; - - 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, function (fn) { - fn(); - }); - }; - - addListener(function () { - if (completed.length === keys.length) { - callback(null); - } - }); - - _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 { - completed.push(k); - taskComplete(); - } - }; - var requires = task.slice(0, Math.abs(task.length - 1)) || []; - var ready = function () { - return _reduce(requires, function (a, x) { - return (a && _indexOf(completed, x) !== -1); - }, true); - }; - if (ready()) { - task[task.length - 1](taskCallback); - } - else { - var listener = function () { - if (ready()) { - removeListener(listener); - task[task.length - 1](taskCallback); - } - }; - addListener(listener); - } - }); - }; - - async.waterfall = function (tasks, callback) { - if (!tasks.length) { - return callback(); - } - callback = callback || function () {}; - 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 || null); - }); - } - }, 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 || null); - }); - } - }, 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 tasks = []; - var q = { - concurrency: concurrency, - push: function (data, callback) { - tasks.push({data: data, callback: callback}); - async.nextTick(q.process); - }, - process: function () { - if (workers < q.concurrency && tasks.length) { - var task = tasks.splice(0, 1)[0]; - workers += 1; - worker(task.data, function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - q.process(); - }); - } - }, - length: function () { - return tasks.length; - } - }; - 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');*/ - -}()); diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/deps/ejs.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/deps/ejs.js deleted file mode 100644 index f6abf29..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/deps/ejs.js +++ /dev/null @@ -1,125 +0,0 @@ - -/*! - * EJS - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var sys = require('sys'); - -/** - * Library version. - */ - -exports.version = '0.0.3'; - -/** - * Intermediate js cache. - * - * @type Object - */ - -var cache = {}; - -/** - * Clear intermediate js cache. - * - * @api public - */ - -exports.clearCache = function(){ - cache = {}; -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -} - -/** - * Parse the given `str` of ejs, returning the function body. - * - * @param {String} str - * @return {String} - * @api public - */ - -var parse = exports.parse = function(str){ - return 'var buf = [];\n' - + "with (locals) {\nbuf.push('" - + String(str) - .replace(/[\r\t]/g, " ") - .replace(/\n/g, "\\n") - .split("<%").join("\t") - .replace(/((^|%>)[^\t]*)'/g, "$1\r") - .replace(/\t=(.*?)%>/g, "', escape($1) ,'") - .replace(/\t-(.*?)%>/g, "', $1 ,'") - .split("\t").join("');") - .split("%>").join("buf.push('") - .split("\r").join("\\'") - + "');\n}\nreturn buf.join('');"; -}; - -/** - * Compile the given `str` of ejs into a `Function`. - * - * @param {String} str - * @param {Object} options - * @return {Function} - * @api public - */ - -var compile = exports.compile = function(str, options){ - if (options.debug) sys.puts(parse(str)); - return new Function('locals, escape', parse(str)); -}; - -/** - * Render the given `str` of ejs. - * - * Options: - * - * - `locals` Local variables object - * - `cache` Compiled functions are cached, requires `filename` - * - `filename` Used by `cache` to key caches - * - `context|scope` Function execution context - * - `debug` Output generated function body - * - * @param {String} str - * @param {Object} options - * @return {String} - * @api public - */ - -exports.render = function(str, options){ - var fn, - options = options || {}; - if (options.cache) { - if (options.filename) { - fn = cache[options.filename] = compile(str, options); - } else { - throw new Error('"cache" option requires "filename".'); - } - } else { - fn = compile(str, options); - } - return fn.call( - options.context || options.scope, - options.locals || {}, - escape); -}; \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/deps/json2.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/deps/json2.js deleted file mode 100644 index 22b44d9..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/deps/json2.js +++ /dev/null @@ -1,483 +0,0 @@ -/* - http://www.JSON.org/json2.js - 2010-11-17 - - Public Domain. - - NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. - - See http://www.JSON.org/js.html - - - This code should be minified before deployment. - See http://javascript.crockford.com/jsmin.html - - USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO - NOT CONTROL. - - - This file creates a global JSON object containing two methods: stringify - and parse. - - JSON.stringify(value, replacer, space) - value any JavaScript value, usually an object or array. - - replacer an optional parameter that determines how object - values are stringified for objects. It can be a - function or an array of strings. - - space an optional parameter that specifies the indentation - of nested structures. If it is omitted, the text will - be packed without extra whitespace. If it is a number, - it will specify the number of spaces to indent at each - level. If it is a string (such as '\t' or ' '), - it contains the characters used to indent at each level. - - This method produces a JSON text from a JavaScript value. - - When an object value is found, if the object contains a toJSON - method, its toJSON method will be called and the result will be - stringified. A toJSON method does not serialize: it returns the - value represented by the name/value pair that should be serialized, - or undefined if nothing should be serialized. The toJSON method - will be passed the key associated with the value, and this will be - bound to the value - - For example, this would serialize Dates as ISO strings. - - Date.prototype.toJSON = function (key) { - function f(n) { - // Format integers to have at least two digits. - return n < 10 ? '0' + n : n; - } - - return this.getUTCFullYear() + '-' + - f(this.getUTCMonth() + 1) + '-' + - f(this.getUTCDate()) + 'T' + - f(this.getUTCHours()) + ':' + - f(this.getUTCMinutes()) + ':' + - f(this.getUTCSeconds()) + 'Z'; - }; - - You can provide an optional replacer method. It will be passed the - key and value of each member, with this bound to the containing - object. The value that is returned from your method will be - serialized. If your method returns undefined, then the member will - be excluded from the serialization. - - If the replacer parameter is an array of strings, then it will be - used to select the members to be serialized. It filters the results - such that only members with keys listed in the replacer array are - stringified. - - Values that do not have JSON representations, such as undefined or - functions, will not be serialized. Such values in objects will be - dropped; in arrays they will be replaced with null. You can use - a replacer function to replace those with JSON values. - JSON.stringify(undefined) returns undefined. - - The optional space parameter produces a stringification of the - value that is filled with line breaks and indentation to make it - easier to read. - - If the space parameter is a non-empty string, then that string will - be used for indentation. If the space parameter is a number, then - the indentation will be that many spaces. - - Example: - - text = JSON.stringify(['e', {pluribus: 'unum'}]); - // text is '["e",{"pluribus":"unum"}]' - - - text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); - // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' - - text = JSON.stringify([new Date()], function (key, value) { - return this[key] instanceof Date ? - 'Date(' + this[key] + ')' : value; - }); - // text is '["Date(---current time---)"]' - - - JSON.parse(text, reviver) - This method parses a JSON text to produce an object or array. - It can throw a SyntaxError exception. - - The optional reviver parameter is a function that can filter and - transform the results. It receives each of the keys and values, - and its return value is used instead of the original value. - If it returns what it received, then the structure is not modified. - If it returns undefined then the member is deleted. - - Example: - - // Parse the text. Values that look like ISO date strings will - // be converted to Date objects. - - myData = JSON.parse(text, function (key, value) { - var a; - if (typeof value === 'string') { - a = -/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); - if (a) { - return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], - +a[5], +a[6])); - } - } - return value; - }); - - myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { - var d; - if (typeof value === 'string' && - value.slice(0, 5) === 'Date(' && - value.slice(-1) === ')') { - d = new Date(value.slice(5, -1)); - if (d) { - return d; - } - } - return value; - }); - - - This is a reference implementation. You are free to copy, modify, or - redistribute. -*/ - -/*jslint evil: true, strict: false, regexp: false */ - -/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, - call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, - getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, - lastIndex, length, parse, prototype, push, replace, slice, stringify, - test, toJSON, toString, valueOf -*/ - - -// Create a JSON object only if one does not already exist. We create the -// methods in a closure to avoid creating global variables. - -if (!this.JSON) { - this.JSON = {}; -} - -(function () { - "use strict"; - - function f(n) { - // Format integers to have at least two digits. - return n < 10 ? '0' + n : n; - } - - if (typeof Date.prototype.toJSON !== 'function') { - - Date.prototype.toJSON = function (key) { - - return isFinite(this.valueOf()) ? - this.getUTCFullYear() + '-' + - f(this.getUTCMonth() + 1) + '-' + - f(this.getUTCDate()) + 'T' + - f(this.getUTCHours()) + ':' + - f(this.getUTCMinutes()) + ':' + - f(this.getUTCSeconds()) + 'Z' : null; - }; - - String.prototype.toJSON = - Number.prototype.toJSON = - Boolean.prototype.toJSON = function (key) { - return this.valueOf(); - }; - } - - var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - gap, - indent, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep; - - - function quote(string) { - -// If the string contains no control characters, no quote characters, and no -// backslash characters, then we can safely slap some quotes around it. -// Otherwise we must also replace the offending characters with safe escape -// sequences. - - escapable.lastIndex = 0; - return escapable.test(string) ? - '"' + string.replace(escapable, function (a) { - var c = meta[a]; - return typeof c === 'string' ? c : - '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : - '"' + string + '"'; - } - - - function str(key, holder) { - -// Produce a string from holder[key]. - - var i, // The loop counter. - k, // The member key. - v, // The member value. - length, - mind = gap, - partial, - value = holder[key]; - -// If the value has a toJSON method, call it to obtain a replacement value. - - if (value && typeof value === 'object' && - typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - -// If we were called with a replacer function, then call the replacer to -// obtain a replacement value. - - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - -// What happens next depends on the value's type. - - switch (typeof value) { - case 'string': - return quote(value); - - case 'number': - -// JSON numbers must be finite. Encode non-finite numbers as null. - - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - -// If the value is a boolean or null, convert it to a string. Note: -// typeof null does not produce 'null'. The case is included here in -// the remote chance that this gets fixed someday. - - return String(value); - -// If the type is 'object', we might be dealing with an object or an array or -// null. - - case 'object': - -// Due to a specification blunder in ECMAScript, typeof null is 'object', -// so watch out for that case. - - if (!value) { - return 'null'; - } - -// Make an array to hold the partial results of stringifying this object value. - - gap += indent; - partial = []; - -// Is the value an array? - - if (Object.prototype.toString.apply(value) === '[object Array]') { - -// The value is an array. Stringify every element. Use null as a placeholder -// for non-JSON values. - - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } - -// Join all of the elements together, separated with commas, and wrap them in -// brackets. - - v = partial.length === 0 ? '[]' : - gap ? '[\n' + gap + - partial.join(',\n' + gap) + '\n' + - mind + ']' : - '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - -// If the replacer is an array, use it to select the members to be stringified. - - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - k = rep[i]; - if (typeof k === 'string') { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } else { - -// Otherwise, iterate through all of the keys in the object. - - for (k in value) { - if (Object.hasOwnProperty.call(value, k)) { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - -// Join all of the member texts together, separated with commas, -// and wrap them in braces. - - v = partial.length === 0 ? '{}' : - gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + - mind + '}' : '{' + partial.join(',') + '}'; - gap = mind; - return v; - } - } - -// If the JSON object does not yet have a stringify method, give it one. - - if (typeof JSON.stringify !== 'function') { - JSON.stringify = function (value, replacer, space) { - -// The stringify method takes a value and an optional replacer, and an optional -// space parameter, and returns a JSON text. The replacer can be a function -// that can replace values, or an array of strings that will select the keys. -// A default replacer method can be provided. Use of the space parameter can -// produce text that is more easily readable. - - var i; - gap = ''; - indent = ''; - -// If the space parameter is a number, make an indent string containing that -// many spaces. - - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - -// If the space parameter is a string, it will be used as the indent string. - - } else if (typeof space === 'string') { - indent = space; - } - -// If there is a replacer, it must be a function or an array. -// Otherwise, throw an error. - - rep = replacer; - if (replacer && typeof replacer !== 'function' && - (typeof replacer !== 'object' || - typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - -// Make a fake root object containing our value under the key of ''. -// Return the result of stringifying the value. - - return str('', {'': value}); - }; - } - - -// If the JSON object does not yet have a parse method, give it one. - - if (typeof JSON.parse !== 'function') { - JSON.parse = function (text, reviver) { - -// The parse method takes a text and an optional reviver function, and returns -// a JavaScript value if the text is a valid JSON text. - - var j; - - function walk(holder, key) { - -// The walk method is used to recursively walk the resulting structure so -// that modifications can be made. - - var k, v, value = holder[key]; - if (value && typeof value === 'object') { - for (k in value) { - if (Object.hasOwnProperty.call(value, k)) { - v = walk(value, k); - if (v !== undefined) { - value[k] = v; - } else { - delete value[k]; - } - } - } - } - return reviver.call(holder, key, value); - } - - -// Parsing happens in four stages. In the first stage, we replace certain -// Unicode characters with escape sequences. JavaScript handles many characters -// incorrectly, either silently deleting them, or treating them as line endings. - - text = String(text); - cx.lastIndex = 0; - if (cx.test(text)) { - text = text.replace(cx, function (a) { - return '\\u' + - ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }); - } - -// In the second stage, we run the text against regular expressions that look -// for non-JSON patterns. We are especially concerned with '()' and 'new' -// because they can cause invocation, and '=' because it can cause mutation. -// But just to be safe, we want to reject all unexpected forms. - -// We split the second stage into 4 regexp operations in order to work around -// crippling inefficiencies in IE's and Safari's regexp engines. First we -// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we -// replace all simple value tokens with ']' characters. Third, we delete all -// open brackets that follow a colon or comma or that begin the text. Finally, -// we look to see that the remaining characters are only whitespace or ']' or -// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. - - if (/^[\],:{}\s]*$/ -.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') -.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') -.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { - -// In the third stage we use the eval function to compile the text into a -// JavaScript structure. The '{' operator is subject to a syntactic ambiguity -// in JavaScript: it can begin a block or an object literal. We wrap the text -// in parens to eliminate the ambiguity. - - j = eval('(' + text + ')'); - -// In the optional fourth stage, we recursively walk the new structure, passing -// each name/value pair to a reviver function for possible transformation. - - return typeof reviver === 'function' ? - walk({'': j}, '') : j; - } - -// If the text is not JSON parseable, then a SyntaxError is thrown. - - throw new SyntaxError('JSON.parse'); - }; - } -}()); diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/doc/nodeunit.md b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/doc/nodeunit.md deleted file mode 100644 index efde75c..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/doc/nodeunit.md +++ /dev/null @@ -1,60 +0,0 @@ -nodeunit(1) -- simple node.js unit testing tool -=============================================== - -## SYNOPSIS - - nodeunit [options] [ ...] - -## DESCRIPTION - -Nodeunit is a simple unit testing tool based on the node.js assert module. - -* Simple to use -* Just export the tests from a module -* Helps you avoid common pitfalls when testing asynchronous code -* Easy to add test cases with setUp and tearDown functions if you wish -* Allows the use of mocks and stubs - -## OPTIONS - - __--config FILE__: - Load config options from a JSON file, allows the customisation - of color schemes for the default test reporter etc. - See bin/nodeunit.json for current available options. - - __--reporter FILE__: - You can set the test reporter to a custom module or on of the modules - in nodeunit/lib/reporters, when omitted, the default test runner is used. - - __--list-reporters__: - List available build-in reporters. - - __-h__, __--help__: - Display the help and exit. - - __-v__, __--version__: - Output version information and exit. - - ____: - You can run nodeunit on specific files or on all *\*.js* files inside - a directory. - -## AUTHORS - -Written by Caolan McMahon and other nodeunit contributors. -Contributors list: . - -## REPORTING BUGS - -Report nodeunit bugs to . - -## COPYRIGHT - -Copyright © 2010 Caolan McMahon. -Nodeunit has been released under the MIT license: -. - -## SEE ALSO - -node(1) - diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/nodeunit.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/nodeunit.js deleted file mode 100644 index 8c12b0f..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/nodeunit.js +++ /dev/null @@ -1,1757 +0,0 @@ -/*! - * Nodeunit - * https://github.com/caolan/nodeunit - * Copyright (c) 2010 Caolan McMahon - * MIT Licensed - * - * json2.js - * http://www.JSON.org/json2.js - * Public Domain. - * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. - */ -nodeunit = (function(){ -/* - http://www.JSON.org/json2.js - 2010-11-17 - - Public Domain. - - NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. - - See http://www.JSON.org/js.html - - - This code should be minified before deployment. - See http://javascript.crockford.com/jsmin.html - - USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO - NOT CONTROL. - - - This file creates a global JSON object containing two methods: stringify - and parse. - - JSON.stringify(value, replacer, space) - value any JavaScript value, usually an object or array. - - replacer an optional parameter that determines how object - values are stringified for objects. It can be a - function or an array of strings. - - space an optional parameter that specifies the indentation - of nested structures. If it is omitted, the text will - be packed without extra whitespace. If it is a number, - it will specify the number of spaces to indent at each - level. If it is a string (such as '\t' or ' '), - it contains the characters used to indent at each level. - - This method produces a JSON text from a JavaScript value. - - When an object value is found, if the object contains a toJSON - method, its toJSON method will be called and the result will be - stringified. A toJSON method does not serialize: it returns the - value represented by the name/value pair that should be serialized, - or undefined if nothing should be serialized. The toJSON method - will be passed the key associated with the value, and this will be - bound to the value - - For example, this would serialize Dates as ISO strings. - - Date.prototype.toJSON = function (key) { - function f(n) { - // Format integers to have at least two digits. - return n < 10 ? '0' + n : n; - } - - return this.getUTCFullYear() + '-' + - f(this.getUTCMonth() + 1) + '-' + - f(this.getUTCDate()) + 'T' + - f(this.getUTCHours()) + ':' + - f(this.getUTCMinutes()) + ':' + - f(this.getUTCSeconds()) + 'Z'; - }; - - You can provide an optional replacer method. It will be passed the - key and value of each member, with this bound to the containing - object. The value that is returned from your method will be - serialized. If your method returns undefined, then the member will - be excluded from the serialization. - - If the replacer parameter is an array of strings, then it will be - used to select the members to be serialized. It filters the results - such that only members with keys listed in the replacer array are - stringified. - - Values that do not have JSON representations, such as undefined or - functions, will not be serialized. Such values in objects will be - dropped; in arrays they will be replaced with null. You can use - a replacer function to replace those with JSON values. - JSON.stringify(undefined) returns undefined. - - The optional space parameter produces a stringification of the - value that is filled with line breaks and indentation to make it - easier to read. - - If the space parameter is a non-empty string, then that string will - be used for indentation. If the space parameter is a number, then - the indentation will be that many spaces. - - Example: - - text = JSON.stringify(['e', {pluribus: 'unum'}]); - // text is '["e",{"pluribus":"unum"}]' - - - text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); - // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' - - text = JSON.stringify([new Date()], function (key, value) { - return this[key] instanceof Date ? - 'Date(' + this[key] + ')' : value; - }); - // text is '["Date(---current time---)"]' - - - JSON.parse(text, reviver) - This method parses a JSON text to produce an object or array. - It can throw a SyntaxError exception. - - The optional reviver parameter is a function that can filter and - transform the results. It receives each of the keys and values, - and its return value is used instead of the original value. - If it returns what it received, then the structure is not modified. - If it returns undefined then the member is deleted. - - Example: - - // Parse the text. Values that look like ISO date strings will - // be converted to Date objects. - - myData = JSON.parse(text, function (key, value) { - var a; - if (typeof value === 'string') { - a = -/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); - if (a) { - return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], - +a[5], +a[6])); - } - } - return value; - }); - - myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { - var d; - if (typeof value === 'string' && - value.slice(0, 5) === 'Date(' && - value.slice(-1) === ')') { - d = new Date(value.slice(5, -1)); - if (d) { - return d; - } - } - return value; - }); - - - This is a reference implementation. You are free to copy, modify, or - redistribute. -*/ - -/*jslint evil: true, strict: false, regexp: false */ - -/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, - call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, - getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, - lastIndex, length, parse, prototype, push, replace, slice, stringify, - test, toJSON, toString, valueOf -*/ - - -// Create a JSON object only if one does not already exist. We create the -// methods in a closure to avoid creating global variables. - -if (!this.JSON) { - this.JSON = {}; -} - -(function () { - "use strict"; - - function f(n) { - // Format integers to have at least two digits. - return n < 10 ? '0' + n : n; - } - - if (typeof Date.prototype.toJSON !== 'function') { - - Date.prototype.toJSON = function (key) { - - return isFinite(this.valueOf()) ? - this.getUTCFullYear() + '-' + - f(this.getUTCMonth() + 1) + '-' + - f(this.getUTCDate()) + 'T' + - f(this.getUTCHours()) + ':' + - f(this.getUTCMinutes()) + ':' + - f(this.getUTCSeconds()) + 'Z' : null; - }; - - String.prototype.toJSON = - Number.prototype.toJSON = - Boolean.prototype.toJSON = function (key) { - return this.valueOf(); - }; - } - - var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - gap, - indent, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep; - - - function quote(string) { - -// If the string contains no control characters, no quote characters, and no -// backslash characters, then we can safely slap some quotes around it. -// Otherwise we must also replace the offending characters with safe escape -// sequences. - - escapable.lastIndex = 0; - return escapable.test(string) ? - '"' + string.replace(escapable, function (a) { - var c = meta[a]; - return typeof c === 'string' ? c : - '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : - '"' + string + '"'; - } - - - function str(key, holder) { - -// Produce a string from holder[key]. - - var i, // The loop counter. - k, // The member key. - v, // The member value. - length, - mind = gap, - partial, - value = holder[key]; - -// If the value has a toJSON method, call it to obtain a replacement value. - - if (value && typeof value === 'object' && - typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - -// If we were called with a replacer function, then call the replacer to -// obtain a replacement value. - - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - -// What happens next depends on the value's type. - - switch (typeof value) { - case 'string': - return quote(value); - - case 'number': - -// JSON numbers must be finite. Encode non-finite numbers as null. - - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - -// If the value is a boolean or null, convert it to a string. Note: -// typeof null does not produce 'null'. The case is included here in -// the remote chance that this gets fixed someday. - - return String(value); - -// If the type is 'object', we might be dealing with an object or an array or -// null. - - case 'object': - -// Due to a specification blunder in ECMAScript, typeof null is 'object', -// so watch out for that case. - - if (!value) { - return 'null'; - } - -// Make an array to hold the partial results of stringifying this object value. - - gap += indent; - partial = []; - -// Is the value an array? - - if (Object.prototype.toString.apply(value) === '[object Array]') { - -// The value is an array. Stringify every element. Use null as a placeholder -// for non-JSON values. - - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } - -// Join all of the elements together, separated with commas, and wrap them in -// brackets. - - v = partial.length === 0 ? '[]' : - gap ? '[\n' + gap + - partial.join(',\n' + gap) + '\n' + - mind + ']' : - '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - -// If the replacer is an array, use it to select the members to be stringified. - - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - k = rep[i]; - if (typeof k === 'string') { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } else { - -// Otherwise, iterate through all of the keys in the object. - - for (k in value) { - if (Object.hasOwnProperty.call(value, k)) { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - -// Join all of the member texts together, separated with commas, -// and wrap them in braces. - - v = partial.length === 0 ? '{}' : - gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + - mind + '}' : '{' + partial.join(',') + '}'; - gap = mind; - return v; - } - } - -// If the JSON object does not yet have a stringify method, give it one. - - if (typeof JSON.stringify !== 'function') { - JSON.stringify = function (value, replacer, space) { - -// The stringify method takes a value and an optional replacer, and an optional -// space parameter, and returns a JSON text. The replacer can be a function -// that can replace values, or an array of strings that will select the keys. -// A default replacer method can be provided. Use of the space parameter can -// produce text that is more easily readable. - - var i; - gap = ''; - indent = ''; - -// If the space parameter is a number, make an indent string containing that -// many spaces. - - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - -// If the space parameter is a string, it will be used as the indent string. - - } else if (typeof space === 'string') { - indent = space; - } - -// If there is a replacer, it must be a function or an array. -// Otherwise, throw an error. - - rep = replacer; - if (replacer && typeof replacer !== 'function' && - (typeof replacer !== 'object' || - typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - -// Make a fake root object containing our value under the key of ''. -// Return the result of stringifying the value. - - return str('', {'': value}); - }; - } - - -// If the JSON object does not yet have a parse method, give it one. - - if (typeof JSON.parse !== 'function') { - JSON.parse = function (text, reviver) { - -// The parse method takes a text and an optional reviver function, and returns -// a JavaScript value if the text is a valid JSON text. - - var j; - - function walk(holder, key) { - -// The walk method is used to recursively walk the resulting structure so -// that modifications can be made. - - var k, v, value = holder[key]; - if (value && typeof value === 'object') { - for (k in value) { - if (Object.hasOwnProperty.call(value, k)) { - v = walk(value, k); - if (v !== undefined) { - value[k] = v; - } else { - delete value[k]; - } - } - } - } - return reviver.call(holder, key, value); - } - - -// Parsing happens in four stages. In the first stage, we replace certain -// Unicode characters with escape sequences. JavaScript handles many characters -// incorrectly, either silently deleting them, or treating them as line endings. - - text = String(text); - cx.lastIndex = 0; - if (cx.test(text)) { - text = text.replace(cx, function (a) { - return '\\u' + - ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }); - } - -// In the second stage, we run the text against regular expressions that look -// for non-JSON patterns. We are especially concerned with '()' and 'new' -// because they can cause invocation, and '=' because it can cause mutation. -// But just to be safe, we want to reject all unexpected forms. - -// We split the second stage into 4 regexp operations in order to work around -// crippling inefficiencies in IE's and Safari's regexp engines. First we -// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we -// replace all simple value tokens with ']' characters. Third, we delete all -// open brackets that follow a colon or comma or that begin the text. Finally, -// we look to see that the remaining characters are only whitespace or ']' or -// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. - - if (/^[\],:{}\s]*$/ -.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') -.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') -.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { - -// In the third stage we use the eval function to compile the text into a -// JavaScript structure. The '{' operator is subject to a syntactic ambiguity -// in JavaScript: it can begin a block or an object literal. We wrap the text -// in parens to eliminate the ambiguity. - - j = eval('(' + text + ')'); - -// In the optional fourth stage, we recursively walk the new structure, passing -// each name/value pair to a reviver function for possible transformation. - - return typeof reviver === 'function' ? - walk({'': j}, '') : j; - } - -// If the text is not JSON parseable, then a SyntaxError is thrown. - - throw new SyntaxError('JSON.parse'); - }; - } -}()); -var assert = {}; -var types = {}; -var core = {}; -var nodeunit = {}; -var reporter = {}; -(function(){ - - var async = {}; - - // global on the server, window in the browser - var root = this; - var 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 b ? 1 : 0; - }), function(x){return x.value;})); - }) - }; - - async.auto = function(tasks, callback){ - callback = callback || function(){}; - var keys = _keys(tasks); - if(!keys.length) return callback(null); - - var completed = []; - - var listeners = []; - var addListener = function(fn){ - listeners.unshift(fn); - }; - var removeListener = function(fn){ - for(var i=0; i -// -// 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 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. - - -var pSlice = Array.prototype.slice; - -// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. - -var assert = exports; - -// 2. The AssertionError is defined in assert. -// new assert.AssertionError({message: message, actual: actual, expected: expected}) - -assert.AssertionError = function AssertionError (options) { - this.name = "AssertionError"; - this.message = options.message; - this.actual = options.actual; - this.expected = options.expected; - this.operator = options.operator; - var stackStartFunction = options.stackStartFunction || fail; - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, stackStartFunction); - } -}; -// code from util.inherits in node -assert.AssertionError.super_ = Error; - - -// EDITED FOR BROWSER COMPATIBILITY: replaced Object.create call -// TODO: test what effect this may have -var ctor = function () { this.constructor = assert.AssertionError; }; -ctor.prototype = Error.prototype; -assert.AssertionError.prototype = new ctor(); - - -assert.AssertionError.prototype.toString = function() { - if (this.message) { - return [this.name+":", this.message].join(' '); - } else { - return [ this.name+":" - , JSON.stringify(this.expected ) - , this.operator - , JSON.stringify(this.actual) - ].join(" "); - } -}; - -// assert.AssertionError instanceof Error - -assert.AssertionError.__proto__ = Error.prototype; - -// At present only the three keys mentioned above are used and -// understood by the spec. Implementations or sub modules can pass -// other keys to the AssertionError's constructor - they will be -// ignored. - -// 3. All of the following functions must throw an AssertionError -// when a corresponding condition is not met, with a message that -// may be undefined if not provided. All assertion methods provide -// both the actual and expected values to the assertion error for -// display purposes. - -function fail(actual, expected, message, operator, stackStartFunction) { - throw new assert.AssertionError({ - message: message, - actual: actual, - expected: expected, - operator: operator, - stackStartFunction: stackStartFunction - }); -} - -// EXTENSION! allows for well behaved errors defined elsewhere. -assert.fail = fail; - -// 4. Pure assertion tests whether a value is truthy, as determined -// by !!guard. -// assert.ok(guard, message_opt); -// This statement is equivalent to assert.equal(true, guard, -// message_opt);. To test strictly for the value true, use -// assert.strictEqual(true, guard, message_opt);. - -assert.ok = function ok(value, message) { - if (!!!value) fail(value, true, message, "==", assert.ok); -}; - -// 5. The equality assertion tests shallow, coercive equality with -// ==. -// assert.equal(actual, expected, message_opt); - -assert.equal = function equal(actual, expected, message) { - if (actual != expected) fail(actual, expected, message, "==", assert.equal); -}; - -// 6. The non-equality assertion tests for whether two objects are not equal -// with != assert.notEqual(actual, expected, message_opt); - -assert.notEqual = function notEqual(actual, expected, message) { - if (actual == expected) { - fail(actual, expected, message, "!=", assert.notEqual); - } -}; - -// 7. The equivalence assertion tests a deep equality relation. -// assert.deepEqual(actual, expected, message_opt); - -assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected)) { - fail(actual, expected, message, "deepEqual", assert.deepEqual); - } -}; - -function _deepEqual(actual, expected) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { - if (actual.length != expected.length) return false; - - for (var i = 0; i < actual.length; i++) { - if (actual[i] !== expected[i]) return false; - } - - return true; - - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == "object", - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical "prototype" property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } -} - -function isUndefinedOrNull (value) { - return value === null || value === undefined; -} - -function isArguments (object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function objEquiv (a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical "prototype" property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b); - } - try{ - var ka = _keys(a), - kb = _keys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key] )) - return false; - } - return true; -} - -// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); - -assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected)) { - fail(actual, expected, message, "notDeepEqual", assert.notDeepEqual); - } -}; - -// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); - -assert.strictEqual = function strictEqual(actual, expected, message) { - if (actual !== expected) { - fail(actual, expected, message, "===", assert.strictEqual); - } -}; - -// 10. The strict non-equality assertion tests for strict inequality, as determined by !==. -// assert.notStrictEqual(actual, expected, message_opt); - -assert.notStrictEqual = function notStrictEqual(actual, expected, message) { - if (actual === expected) { - fail(actual, expected, message, "!==", assert.notStrictEqual); - } -}; - -function _throws (shouldThrow, block, err, message) { - var exception = null, - threw = false, - typematters = true; - - message = message || ""; - - //handle optional arguments - if (arguments.length == 3) { - if (typeof(err) == "string") { - message = err; - typematters = false; - } - } else if (arguments.length == 2) { - typematters = false; - } - - try { - block(); - } catch (e) { - threw = true; - exception = e; - } - - if (shouldThrow && !threw) { - fail( "Missing expected exception" - + (err && err.name ? " ("+err.name+")." : '.') - + (message ? " " + message : "") - ); - } - if (!shouldThrow && threw && typematters && exception instanceof err) { - fail( "Got unwanted exception" - + (err && err.name ? " ("+err.name+")." : '.') - + (message ? " " + message : "") - ); - } - if ((shouldThrow && threw && typematters && !(exception instanceof err)) || - (!shouldThrow && threw)) { - throw exception; - } -}; - -// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); - -assert.throws = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [true].concat(pSlice.call(arguments))); -}; - -// EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [false].concat(pSlice.call(arguments))); -}; - -assert.ifError = function (err) { if (err) {throw err;}}; -})(assert); -(function(exports){ -/*! - * Nodeunit - * Copyright (c) 2010 Caolan McMahon - * MIT Licensed - * - * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS! - * Only code on that line will be removed, its mostly to avoid requiring code - * that is node specific - */ - -/** - * Module dependencies - */ - - - -/** - * Creates assertion objects representing the result of an assert call. - * Accepts an object or AssertionError as its argument. - * - * @param {object} obj - * @api public - */ - -exports.assertion = function (obj) { - return { - method: obj.method || '', - message: obj.message || (obj.error && obj.error.message) || '', - error: obj.error, - passed: function () { - return !this.error; - }, - failed: function () { - return Boolean(this.error); - } - }; -}; - -/** - * Creates an assertion list object representing a group of assertions. - * Accepts an array of assertion objects. - * - * @param {Array} arr - * @param {Number} duration - * @api public - */ - -exports.assertionList = function (arr, duration) { - var that = arr || []; - that.failures = function () { - var failures = 0; - for (var i=0; i'; -}; - - -/** - * Run all tests within each module, reporting the results - * - * @param {Array} files - * @api public - */ - -exports.run = function (modules, options) { - var start = new Date().getTime(); - exports.addStyles(); - - var html = ''; - nodeunit.runModules(modules, { - moduleStart: function (name) { - html += '

    ' + name + '

    '; - html += '
      '; - }, - testDone: function (name, assertions) { - if (!assertions.failures()) { - html += '
    1. ' + name + '
    2. '; - } - else { - html += '
    3. ' + name; - for (var i=0; i'; - } - html += '
      ';
      -                        html += a.error.stack || a.error;
      -                        html += '
      '; - } - }; - html += '
    4. '; - } - }, - moduleDone: function () { - html += '
    '; - }, - done: function (assertions) { - var end = new Date().getTime(); - var duration = end - start; - if (assertions.failures()) { - html += '

    FAILURES: ' + assertions.failures() + - '/' + assertions.length + ' assertions failed (' + - assertions.duration + 'ms)

    '; - } - else { - html += '

    OK: ' + assertions.length + - ' assertions (' + assertions.duration + 'ms)

    '; - } - document.body.innerHTML += html; - } - }); -}; -})(reporter); -nodeunit = core; -nodeunit.assert = assert; -nodeunit.reporter = reporter; -nodeunit.run = reporter.run; -return nodeunit; })(); diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/suite1.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/suite1.js deleted file mode 100644 index 0d5fc90..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/suite1.js +++ /dev/null @@ -1,12 +0,0 @@ -this.suite1 = { - 'test one': function (test) { - test.ok(true, 'everythings ok'); - setTimeout(function () { - test.done(); - }, 10); - }, - 'apples and oranges': function (test) { - test.equal('apples', 'oranges', 'comparing apples and oranges'); - test.done(); - } -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/suite2.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/suite2.js deleted file mode 100644 index c7288e8..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/suite2.js +++ /dev/null @@ -1,13 +0,0 @@ -this.suite2 = { - 'another test': function (test) { - setTimeout(function () { - // lots of assertions - test.ok(true, 'everythings ok'); - test.ok(true, 'everythings ok'); - test.ok(true, 'everythings ok'); - test.ok(true, 'everythings ok'); - test.ok(true, 'everythings ok'); - test.done(); - }, 10); - } -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/test.html b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/test.html deleted file mode 100644 index e9f8180..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/examples/browser/test.html +++ /dev/null @@ -1,16 +0,0 @@ - - - Example tests - - - - - - - - diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/img/example_fail.png b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/img/example_fail.png deleted file mode 100644 index 78ff4258cd574420da27fcf38b4711d02db58a92..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38642 zcmb@tbzGF)_C9ssGbm1XfCP(A*P0&5y9@3f#9A}JAMQ%F#y)$mkCCdMT<*n;VoFAjVzS1hKYv%| zBd->WPTC)m&h!1bI*F>)gA6A1>@P0~pMHFi1asqeRj8Rih*(hK>zkM3dvWjhI`zO) zY|-3l1IF#Xu^*Fy0U?yceirb*eh5lWdtR)+j}0fBNRwKCH*ktrH>Rj4(Coz5UG&T# zO8w^zuXSgbA0+r~_ZL}Y>Klg@!M_}T%5#to!*a7~J@C1eAL$)@tD@3ydDJ87dyjXz=`ru<6`>V#rfDM2M~{f-DaKPU#oYx4W2&Mkyw7q>MCxKm$1 zkaO-ctg}91e9xGqeufJR+qoQO)2d2-u%wRR`9snvH;@T5;`yG7}mZGTrl-_&f=-o2s$yCjF)VZ<^AMP}_GM&ahHesO%(y}KQ zS*bddn%l<~#SFk_xYf#Pu6wVm04DoB*ecyKZ9KgUA9v~9GFB1|2p!Em8~5G_#b0<2 zJhkULl2=32a1I&jX~VcoEv;esz1`Wuls(c6`vM5GtLjb%H+=)0`{cFZxMm?{8#RQD zK?fn?uL`cN4VW75dn-VF{5F5>(2V##_Few`vYnwICDx+4|Bz%^?SAIPNvy;p$g6kf zr=ji9M4xSY2)Z|`oiER&&Dr_JFT2RFASVwDT$b80%f?HeXD;dR8)}eHRoL$uQIAz; zfF^!9i*0Xgl%;AP?dPc|Vpj#F_r#qo>PR5KMbt3eet_lVG`2i;lNKQ6xcQN$=R|If zl(~+Ic6XA=i;Ilq4LKJq{Bs=hMRJKEZTcdoXE`!(JfKhsVMu~tv7 zlUplJD8rt)_QY@4$NI)*+PUku-ou9psKvOuSX1$9Z%v#;hjeukl9Z&Mg;-K zktqK;SEeum|E%aewe~#6)?U8i+@aJ0%3v1(N@8_Zp`iJ2cQQAt+83|AodU2RbyL^6 z9Vcg$b0Y#$Ig4DK0wRcZ|ASnfhrL+49FsJZJ0?i1nN(;6ulJ=V-^HKtAr9{rujgm& zaI~T#=$B6D5wtqhb9*H;XPhBF#i>O`fDH7ACVOacVv$sBdcDyFxjo}kEUOpZ!BP$K zajawX@;Npp0FjMM({1dB4m0zu8|w2G8TWk*aXe_`Wi!_(9Sn7t+7Z6xqPG0NtJNdNq~-85Z{k(8C;()3M@JM^ zvV(^E1x3mq%?R4|)sftjHf9sJ3g)j9xgF|QJ7^q`;5`3&*&lQNlYFFzt1!eJc(tHZ?EUW4LyJgIM4ON3^B>DX)UghJ9Y;1(_!=j>BP^k9zi$ zb+x|Ta6S_nX-2N11Z^5mP8RK#FD)msZ82%IYcG-2mnSud@y}dixeN7aj_^XUg_fw+ z+bNdU*E($VcZ-cK?aQGZoma77&zGl;7-~W?2RX(IGOiZO{Hf`QFFUF<${AJdh)CO0 zu38kx4Kpz1+foENO*wahae!w5CKLcek2A@UhG5HH_$W~bCh*EC#(KKdT%uku;Do9g zIcoX(>Uo0*^yVU5^toG>uDgPno8d$F;_QSQ-<=HtlY;~&gN!~n7QL;<(o@`d6K2WM zH58a;NLhD=m?nk8&g+lP6c$=RE_}D&tQkGX&zYO^(* zd%T;0R^7vWvHk1*>r}SI`f2Zu^3sN0Kw@da>dm<`{(Jx)_Ck`&ht+(Q5ylEl()@O} z+>-&r$c%E2dvoGs{k}$+O-OXpm!Ycf8h4)^;I`mm$z#a4ZQ6iBhntboT4b@Eu+B-q20eZm5+`f4aNJ;6nL)zl(ulHC=fd?!W7r58k-r=a z-(6#R_nxh1h=S?L8@gx>H;E^&&~Ww37{UAskbjIU&H_ye07dR;^jHM!+Zugl*3&s& zfkO!|=BodwTGZpot zXK#3~7b=se>}fKSf5HhriXJIRCZ~w?TA_#IvwT!3o%044hLI|i@0`NwO^Xv7}#@;PQ#$X19 z9-4j|;6>ZU7~}UZyYh462%LQ?CbQ={pVS_)b{ZOC! zJ1{IKb>@wVjsE^6r|4bUGGA28QTKzOb3r-itNFnm+Ujqo>jEMIT%2bCYh7uEzXv+J z1UBaPC$D>j*aYL$-=Na8yn26+vGmJu-x35|cng{`&7t=B(PFX^_hV<1{`%?((nZZV zKYqn+GWeXYy=K!7LT9!9xhY!KmIU)w{=s_VY4^?&@@y_9DOv13B{k;Q+S+3#iXg+) zfG?Gz?de|^wF(w{_{+rBXs)|WTu)m#KT7uBg=Cq{8^OsZhN%WLWUWG)4}xC@X^nk< zjs9C8V~iH+*LOy?#ZOzqkp|?`)%N*FpjR&o6Q^D=|^yQ?uxNOb8*LtVV%VyHrAYf+i9 zK}aht=BM|uRs45ee6{)4S2k9Ag)zL?J8=i!r0A1|9xyc0*00=kS7R|T zV3_!jg4+!N_f0*-!8RbZWSWfU=0E;G>N%7*%#&>!@2aVS2wh9#*Z>WLd8P~UZLBk5 zF!4nyHCeZOP(6Z;`;-%P;wsrp*h78SECu}(EruA!w zzFkAhI~D(WHb2LLZih==5FCFVG4TrQeIA?iCGc0YG6{)Qa7amM+C1Ic;Ij~vDMj^k z0YXpSdRc6cj<>qa@ocQr|3Q^WqQ&zL;YJB13~3(lmn&`vjXuv{ffTI!OyJb zoYlL(n0Jo&KC!$f19QFE;D2)=6V0i^Wi>Fb%70(CRZTdvg?ttU-wECHF>D5%^HmFI zm>0blEnzQu-Ybg^JU{3*4ye=BL>>CW=6@Zk8_dqJ-wIx3M71}1ZxYxnKLZOPpje1$ z4zS3L7FmJ@#T_JIjgJfb*j)wD-ir_^?FCyBeAuBS9JlK%>}c;u>?cQ^BvYwp^C9%N zgOq#>-Caw(b_e{(W=zw-+}?ZWMv3Zd_9wr04?miUAISUV4g~wWiE2q}nW*!3mb0ag*8~Y?f;?bc#R{8o#Tzb7bFS0Xl`n%52LH9aRuwWB`#WWN3So@5|QTK_vf%8cRP7p2+ z#r>3q(Nq3{kVQOP;*Vv^Nv-08W0XTR3<*OrQhwIQGe+;{_YTXHJJ_F)F7g^2lR6J( zK4f3NRNIG@6-`7P>CwMtZHOUKxIfh+TZP)1$Xv$upAV+w?Yb{Zs(nRuIsd%-D5Dp1 z;p^Un2t@^?zB64Fe4FiMMw#7xIQyrSCLifV#}uQ%$5B3X)pc&ufvE48O84&|(Z36? z#s-Ts(P+S{&6`TI%X2n)4Wrrz|2=+2(xDK9`faMb)&i%$V3|TylYhjs$2(NnFHRc6 zQ;8|YxFLMouV5T|t#yC&`hM0xSRT^ZP?T?!23<_=1ndOm>fjw0Z@Ys87yYEJOX_cH z|9rSF77#`#nfJv(**^0=-L$cS*e$%_+poaD`2*kk{{T`d@B85lK9U{Z`H4&l>KgIR zXbGCH^h>y2 zS1@c4Nh;RsC7><>Kgx6zfF=X8@83|^_L5}1D90i@KB>ecypMOywc}Uv4F#&?$Iajq z5dP_Ogd@$uFE{-V!G)xkXG#7~Wz3#;W;I+K4elGWLY^`reCAWZZpQL#{UYTamkr#G zdWrF_7{0pt-g)p?g4t5J#iMn1OZAh0$V@D(O_!r8KNUx-)+I&L@E?Rue#xM|c{UU% zakZa_nKaV#@`d?_NyqE~+-odW5z3?=i8*`*psWO>f`9n_Q`FqFLuXmqqz2y_jEH~~ zvB%O9rh{wk(N~Xt3;JGXa*?^}wLWTHTT4lPv_t>ieCWB~Ftdngb_OAk^+bmeS6RtZ zrXPS)&h7_>`$@J4gvu_4$$jY*tqiI@bZUCZ{$C-8=dV@Qw9F9w%JyP(KV8-nIUS2eWx|sQE`YQlGXPN#x;o*!0VW)8DDljXlfB$u^Yi|E%*tC8D+FHmAqY7}!ZZ=MnqX z?;`<#{Pu9OnzJ(T+xY~_Z??qygcu$X)iq*NU9I#`u(dha!6MIoR(v=M*nVTIgl>4v zkfv!>tzWF2!)v$juM^s}Zo>5-`<#D+wE7rAv!egr^>VGFgdGQA@$2i!|eU=F*5>{^A8 z_v7=wue!Voqx736yMlNvde+Ns!bI&XJDwj9f_gpUrBas8e@jV09LQeh++y}1FfGMW zofwaMya^5#E}a`p`o0p}^gFXNqVka2`_R5rLDxlwfsxMc)W!4eq$HvOrwtjrxqPA4 z(M|L>K&V77I)wh}d83JhRnsqE&-&VcUIhR|7WE3b0H z_VLwM!IrY24{V6G*dJkM-R#M>h?kgj*BekO9Cj=$8e1X8K7D_t{^dLGlj?U~Ket@H zw~DiCgS?x0gATX&%ph*ix&QzW zM>|2ksc%7ns11u)QDNU({{=u$@!Xk7dK!dgvrlWxlh+c-@DMKgZm5gc2G3M&QTXyC z-lAqsV`;+X6b7~a*`;38(Cls>UkXSN5>upHZK}FEc-ng!Uhk+fG2VZoEiHQ=CvPvK zs&yAGZ0Kz}+z%C(c-VFsK1=cwRU)Bq;(8|eY{cmgF{ew!(?9sPV&7sIn<|kfk+L@* zdG8Ko=FM^Y<-I|(0}=SMdw|T=>0nZib1aK6Ld+xl&WZDL7L@{lH#fypk&5PCA8~-M z5@U5*kx!2@C~3#M~<8$R4nX#*R@pCFz6uq)N^>Eo&eKH9GmbTNkdj17L5< zzYk!=^4R!p&_>aNxnu_62F8FmfDhe63=v#VVeFR=3;>!DW#i$%nECC29srDDC<5{K zAg$JS_92Esi-gd8Z~!0#jU4g?KplDSMB54hIYWOYj1L+_Y)hfsXz2`XFCfGK2to>A z@|Ks#&kU4eFOAZb>R`PhPw%}EPbp1D<;Gi!9entU_rKoX!bW`?^^M?zr`7F?WxxT( zF~%RXbDDH=3EWo?)3G6F9ym*O02uNDa*JkoAI0Oe5kqv)<^en)2>5{xh$<7du|ZHU zgep4YULh%ia7> zEMct2B6O&S8SF;tVZQ9#}Sz#ohc zT6)RK02u%)8!@4O4m`xT2VG6OpGUAn;DD3PD?tnS0C@@-0~QfAK{c>-AP%hoH6T%d z9fQZ|e1;Hm1Q?sgwF0A)u%3|9bz!t?%q7&&ebCBgTYO|uW-N(`sX;$)+-)||hk0D0 zvXd<)buX|kfy2+;RwHLb6cffP(j@^2JP76z2f!x52mpC|3=TJd9>5tJ*nszkPXY@< z1Qep_qXQ7^C3;9PAP0~_%m4}ii3YR*k?4^RBQYcKBhk_U!cl0)>Vr0E0NsHk9cU}9 zSm!_!L2cE05Xmcq652SxgZg9$FcM?v21KG=qy6D;TLgm8&T++@Ho_Q2P)?o7UNiR* z(*yUN`ken2dKUVxBaOJlBJZ8!!%JKF>XlN`?J{D;=|hZ0_BL* zkW|1OP4Uzm4=@9&PS1s4OUa&v#;vHmCHm2J!hsA@yGQ%vK6aHjT{GbljfClxX#(0L zkc+16jI=>-^MP~$-+@K+P+(N&nT1%}OUMmi2SlMcq3sCsED$Y8xH^-{EC zj9J`BG(wEBCfh>IhY=sN3QS?ag;N}NyYVTs4@M7JL<3MW+eA6KAqD`MdKe)atAY0p z_^?dah5m=G4I82gJc9^JFhXzv;2yw(^$raW_y#-=svHb5RdbU;3@t))HYbcYjc9AprNCN%-p63 zh(h?=xUPIBUO+BR3oDWxk56e;^;nLX(MW-LOaLMZaG~Ol6Uq;^0Vd$)cz^7-l#RF& z7?N=M?MN2DMNL{~YoHSFf~4)HPnD6gV+*L8Z{CJuA}Ilx=s1<(q_17c`((j!zV zcjn2s<>74O063s&+;M0{nDJ^oVW@z4{G#A+pd32@@B_9_HwTT-uJ>}=QL~DqyD^B) zOT3TXgt7EM0u>?DfFvLo-k|kgX-OBEGfxk0QA9y(GWNIqxhG zJ{rla7#`qYD0B&kzoFi_nWg-S%CAY~e*4hK_BN{+1k=K;DGuUJL5Al=0jnTlJK1Kj zvS&T5nz076B_b<~HfH>KCmmDlj_?uFkOQCJ%H05bh1r4`iSZ8_mq;9cqLu@-IPVm0 z6vj<=$y>8x+78VUMW>~5nihJ8Q`YckDaRmB9B(Dsl%85gL=gTA_->GeBFmW4Q-kc zMRD=$)O~ht@T>p;dy_^U%+}_-yitSU(?34Ls8Eamfc7OhhLB+8781j4X;;16uAb6G zg>gd3w|;IG7CDIXNy10}N%^{jb~*Cx?z$~+2wpqbCxl?XI2(QEez{330*w;}qew&N z34WJqqtZ+=eN;IArxw6ruUwD?d<)bc?a5+ixf7ovvf*;~ODZUOiU2^R^qYnQL}tiS-plP3E1$lT8}m!=!=#%4uTU z@(j+=?2lN%*WqLUoTO%}?W44bv2Ea#vlAQ{E#KT2k+f>bt`royKQ$@Ui|y;h(QG+9 zyX2wNyu!14?3V94e>e3it2%aQ1fgU^V9~(uwcRw33)UagoT!nxXAWmT*c$B8=zGkoP zgu2ET=%|$CzbNfzq3DvJlLJ*yH~N@)Crn`?Wc@KIrJTP=I{p_*D_>8b#T%}*2P3(7dl?ldBHKK8%Lr( zW5pfk?=&wz_zwaqZ#VZnZ=I2KFcFjtk7u*04s_eRt z;a14w-L3!@;!2e|-7Ih;aKO^brQcK!Mja#Myk`U)l$wiPGHdZ z>*{?l{|bZ#j1bjKF5*x8mbyyzZoWo7{+m&`h#uD_Il!+>72SBEvGY|gEzQSmy|XuO zl8D0-fZU;C3mVMP6~Q>qcHU=m-5^k?m}=M_LO^rAWwNO}bzxJc%La#&EIZi<`D-Of z@01}MUWRhK|59cA?|WO0Y5}q&F*o+{pZ}H{T_0+zm-MpP#xdI%s0^o3h?Bfei32HX zZ)0;#DW{lOt{$-;jQbrTo1DRMq#yHKk|!DUX7IN$)s{)%!6F3@kWR4Z@jotGE5R8bS|$EDTo@{V1bdCrDE&sW6Ny$fC`Tfa)HD1qB-+Qw7ep8H&T z7Jfsnf1|Uy7{gSW|M6|)>Kg?l3Y}}^N80?5u-JHOaOofkX2i{PCCu*}^iJ7u(lPbBiF_Yo%|=F5V8 z4J9LG^9fV)e0YIji;WhF22i~R!GH3uk9`MfjfS}%t0#L|&y7mJxk5M7Q_eI{*Mu`p zA8fMu{msuG-z}RP{L1!BgHiRcVxllqc7{w~K^Y+YHw>`mOdh2`Y4_@wUYMA_-sqBN zp2bBs7R{1dY!~Ik-U$;fX}R*Gg0{%}<}+Yp-1nn!6`w&7guf>T;9sy%;7kP24H&@QaNPIM2dQ3i4M2Qb%?h zZAfj!Xp}*6Oz?ETMkuk;ELY=vLxmAaXuSFmJ>AK@a{~_rL z!lgq68cQY}_xwM+`qOr1PVEJ%Oq>0JD*^}_U-`6}no43|4S8m*-dd?OV&Wr9JEWjH z{cE`?@zBfB+roa*=A^8Syx^hNg;%Oq$2vBpVvFhUWs7%ToRigN^>$7n7z>B^POl_> zrIwc)8C&anrki@Y)|t*FrFFOhzDS^Nq^%BZDqCJ_4Xz@K!?W4mdmeRByEXfJfF@^W z?;at4l4mxfCp6xogp~zMQO?bKp!weH5l|Pn*WWjP`Kj=g!&=VlZmT$aUvEwc&1Chg zbZ51nR$>os#d{Eb*%=_=O_hH~I6W}`mCrQtmg1ce2DEu}Y{cy?DmDB!y_3kH9W!-H zJ~DeFT8yUd&PGXylY)#2$M)|k{|oh8iLYntJid8A+2okXc(66eXJ0g$3uhn;`Sy(2 z@HH)1Wa8DPmlYCy31uHt>T+6FWpJIoG}w6`#d`C-+fBplC&^GZ@EIyCy%&sP>^f>K ziS<`C&NOyBN)+c-0e|Xg7Td9p7$NQQ3YBlAbm-SpjL)Zj#aB_g$|z1|{;EkbMfkOD z5LGIJpXW3MG0cR5mvud|Op_m@pKZ|TAb$qm>(2F&xtGRzXG(g%&7}Hm zY2+Ha4!;y0@cVrNC#2^})+0`|(qL~!d|Z0gJfPC!Zp%^=3#iEj|6xpFx6WhBg5xGt z;^%^nTt(z#=a6~kYk_|YstVbZ6+2e6kIe9A7H!@`bpoDEfGJEZc!|*Nj3a;THak1y zXw{Qb>t5I%t1`0OQ>B;W?O@bxF@I&Rq%b$BV2r?Vr6m0ypzk;rODxJL>9=N81Ud@L z-L*{q=Q*cw9BK6ZVOZhk!!8tcC5J zGnvfo-1%=*Ll0Pbj&Po3ox@7b8a;4rhZ3A>UYQT{et9gj2K628LpK!=$=fyOuQe8) z{Qa{-q|P)mcY4+H&A=SuB$>6rkgd1LP$6-!U&K6JizET9Ejg{EM%3O^lRl5)PT&+v zWliDv-Ti9>{a%`^@6Fr4B~_v;rs|@D_tOYz;bfMtm*R`Xo5ngLJ@{i=x0+q8Y60+T zV<+~W39e6VYDZr-eHyPN(e@$~qHX0bO+IWH_}^2!xOi_NIXB!dO;EEm{X=jg>Z}U zTl+Iz6is_LWQzLatp-r0Y4$!WZr%8V7uH4BdsDBv4`&9JD8M4n5S!*HbxY6H_kCh5 z$Ce(hzai|a447%4dhxj%r1}!gnpsla8(3KLS0T1V#Sy9lkCHNR#B!KM>a)ExRyhoR z=r?XUHBgS0N$CK9N>W&?-QPXX%?N|yRK=SnnXhMWng*ptvBkQw-<-}I6IA4-A?Q%f75sR zt;fTZt#Y*vrKJgU+$zK~)UF-QYIPEQs@}c-8e{TaNtP`h#^|+>dJk?WbzGpR)UE;! z;2;?muP}K}uVN7SNjNvExzY6@qdWK4!v{&+auqhq8Hzo~u}CM;j@$zlBj3QM$J;ls zWZ2`Y=;Z%URQY!}_vEIZ#zm>X4plMsmZc~dc*jARH{Lz;7X!}SJaL>w*K;`BmjV(=rYqz^U2>UT5FNT zFDIK0BQ_sg(LDiE|6L+5HRl#a%+>H_&x~_?xhHqezL;(!JSut4vl3fkGW}r7kInZ5 z9=0en6lv;KIGg6Dz?jqh$itPKeERoDAm+OT%GUGcs)y2X!!IaM&?ibuNOC3FaFPrIj)Mje zF9&h4b0juz9}hJWOgP1$q*W|uFDx&-C6Bof=!?d*2Q5FWPNG3j^W((kvzp%@%83i@4^pT$Y{FK~KhuA_jXWSi{3HuNfUt=~xmOeUP6yn~ z{k}5V@|-li^wOU|h#S2VZ5#;;o_TD_E-%=4`MHa~vgquKdCHGu1t!$POeg2Xn?9%_ z$7QRWDr;I)Z>G8FTmDOhF+G7LkJ>?5VOZ8a4A74M#+#%%N`6!EM!{!_S>7K6&F zV)mpBIEq2q)T@=@2pPKw*SGgt9Q)s@&%~s9Ft`6iaQk0bK(mjZb2BNs&iXTX{tUMS z_L1f9mCPeBnj8aA5)!Lw28LMAcD?Zr$H5wXLXvNPAs5BB?U2t}^Tq=9`0pyB&dl%& zf$vFdF+Icfg4_OT9-*eW(Lq&7S*8Be z;BBwq2n=AHuabQeb^+Qf5c&OWl<3o=#;b-9azJiW!C(Sk2WEF1Beuz5FJRGwoPAbwJ=g?~`^Cr>!A{Rk`_6Kbi} zZ%O^mOUvo_=1A6StqP?(e^OY#chY-7>~WUdd=TEP_?4dD;&$FxEVk7-{$y8Vua+n3 zOaT;>h!{08f;2eTAU4Yw|uwuMC_c6>1ZWYLy)=0YBqbJ{pxa7 z>oetBbNrwZUsV@hZCsJpvRjKE8wb7D*ZZxQe^}0B9b6z9??BnNV;DDx-T!<4!AD~Y zRO!9sqUWt&?*S|c6=|%D4zxShMjLAz!Tdoo$AhmmYK;b1QI(H}my^^p72*8#iG0u1 zeu5FV(yV0fz-#A{xc^JvLmz{$$mo&GoN;Ve8p67Oy1D7rSZPNHex^D@Lp3qgDl{p* z#w^V7V3&;Z>Fm#=#P@fz>lnYcmvD&23IGP+_WI1(5&cz>(9u?m=D|iHS04q3AC~-! z`lqJp0gt9=n>f1$byAH8i9M&{n<}D{MtT{a)N>Z+^LSWSUCuhFcqKUYd!?}1sIZWM zI~;X4!!_je&L8Y$#cI_~Q@y<4*M10QHHXA{UG>lQLvhv@hZKgWc*SG(jO7H+5Xek0 z$9AQ2=~_?m*7EY0nY1k|d(JNV*k`;4Llis@Evz_{I{UD`g=UzRUE3L{~n2B*|N7nBcydYqF2nyCe@yIIy|l{$TS8p(6GXQjuw$UI#T^z6O6+{|ZYH>EMUiN+VUw@i zO-S-X&s7dwP8wFDL$?r%cXawH0oX^;VztQ&Tv^=gpTd`pa~-$eLM20F<~* ztYo;sN04RnPp6DwX*)+>E`*Qf-fH~ey>v_R6aZz=G{Wi70DAnRv*QUl<(*vKT&)Y_j~xr4&^?g@^SFF8Amn_#vT zuYA_$(7w*4bE6T4bmg(UL<#S{n4b?+Iv36KRh%B53Z(IS>3Qs5JD_Y~UU;XP&#_Oe z+{@YsOQfZ2;o2p+>S}Bb#Ss>Vnm@qjy*{7Yf8#A`rY~0CgW(TL?)^NG%qlx_iNENz zPj#_5GL4I{dv)z`kj7EsJqEoHg{m8>zW*LGd1+=uj8e~jO@axuB^5i>sr>SO z0Hk6e-+Wf^N_x?_NaegA^t@7>g41!O_oDvb_R`fKT%&*C!VDH!#Y*QJ7^4~on|qzn z{2r6V4$XQ!TZd-c7iVX_CK#8?iBg#>Tpy+R&GSpJ=8L~OZQ3NNJqYL3Jk>#g`atnu zBT2D{KoBL<2s?Ig=rGbbPq0U_U`%=Zq_$~Gc0()=SJC=zCIXm zsl{JlYHiB{Dk8?LHB=$|!SkmbN2-WK@sFRDYkM%552uz*4WaYvb`Xm(zT>hHtR=DH z>X4TY<^NMZB+n&DLVBk z?cWcKJA81)f*R%0tgM_rK^cg%BZ4Au*ene>NokVUA^X zmJjq3Bse;K`$yo5^*4?6#V&l%Igm{#)@4c?@Z5+)TzeL*P6U zS_cit-i!6&AUr?TbK+bc(aU&HgpJU2%)D+?Xyn+}f1u*~o1+t2Xfi?}%hNSuSxXFc zn{lnaF0S`7-=W2!BYY4jnXwt-eKgs4<%x~@8&bUg$E^XG`2|eVuQ>aGt`ISCJCi+ z#82GBIyR!TGa_!_VW6o%xgQ-t-jtd~nijUXk_=dW6n33eErsK@_*$H?@@E}9F+-@+ zs3kS`T9`p^=7i#haAhKtue9vYdnVM%Mp)tXBbwN>7Vt&QfS!zGu!h1w<&0N?7bVJr zQF25qr3E*(%HFqcm$&=y1CQfW`>}RMS{f~WZ5);3$Wc(b&i@iz5P9Nu&$Csue#gip z9HeTsx5-Kd3OmKX{tLtNg%C|rxf}YP9r4xpM%-|z>0fy5UyrUp9jIFZZ;%_bU&rFH zIrHsrL@K@eyrb)D=DR9y|}t0 zzCK$;oRYL!Za{O0_8nKQ1=e;#l&hUSn!|pZKbfE`ZKRs~9?f;4-26M$UQ>+hU#uUwUw8qQ zJNUT&z}uWWR@17Ee!EOe)qcK*LT)g|(vXak8om9{7H?J+gB%gzN&N&bX4Dd5zPRn~ zUk=O0D^mx9C~%t^%YTp$E8D>Pfz@e86I;i@dD84Ne`dvw$rGe zZX5$q!U)(_f3tV8r9alY=62F20%eRvigE;UArzbHw_dgR-dhD()K@&L_(riY?q16} zSZ3o+lN6k4A@^s<4!hLwgp$+ht_7i;Ebta41#jE82}4X)wE{4Q6J&R_>%aq1<{-og zFpMWV#!b7xNzZNvLR2gKU*NCs^|_4c{z;9#e|G3K81}iOF4U=d=Vc-PDIR2Lw$t#V z%!!NJWFk9Qvp*2Lj_0#+CMY@R3H4qqwqi>166A^0xBfIu^AAUh5%&rCmy8ia_Lq!N zv9s}sLJU<9^tMkWlK^i$PD;#yS5I7$T>EcdHVP}D~{G;3@CI`KdyPCSTR zid7=cj! z5t2((htk*}qMQX`C5-=1Kb|IxqvdoIq2cKx{N0_1LqR*Ud-`qkjtSp+!1>oLXt~g8 z*$%1%r%jtbtnbDsZvDHeLI@i?O)wOf0Xtx)! z&|(Uicl|Krc7gMpjOkmEstq!wpzn4b`@Km~HK7z&X3g|ETv~Fumfp#YiE$KhMl}x$ zIQa#2wuqkg42)|b1Y{Ik`-}hIL8E+a&r|D|d@Mj;&>fxRCB;9Q*o>mSpWhSm(|X#Z z;THRw;BEo_g$@02_@CI&vEN};5S@6{`F!Z#5Yw3(3hU!o6B*2~@39V(V))$=BqWx9 z$P$jF?>~e|K^Y<&iFD4GpV0!^_?4|Ks1fZ=TC}<1Bnf|O0nQEsqKU2=Z8j+mYH++f zbJcYW4U_#3o9`QQ+~yC%#8uJ0RQXrDz`wR*m<*lOdOuC&*=VMC;d|P);YVY9qTgJz z*z9sV$Ce)@vk3i{ohdRoH!T(#RW>^Ls(7Un2-gGlBaGRI@_cWV#5nJ!hCbX1pGB?La) z#p8rTfz&?-puZdP%vy5|T-Yn59UL5@Bk!(hx*E&1Cp2faSADq;Bxoz`Y~)L`L3lV( z*z@|bgHPxMD~~K5u{{I;R2v6i+8PcnUU>AqW%p>p)12~U!D4oZ<#@g@Chyt8JyB-V z;ldJ*IM9rep^HO40-<=KKu0wYUJ=7RKsA82zpm-SY0d=yftccenovx2ZDBUo$@GX| ze?6)jcwp%FrR0S{VUguoz1pF^JGPODqg}Zj1ZP^g9E$# zmy&~bct|sJuJXF}kyQ{qfy<1A$Y*gq$?&qGh6(aoWrh7bjzQZYM;;06sgJoU0x#{j z;ZFN0x2|r58=slBKwTL{mw$m90V5;A((?|3;aBCt-FyX~-SM6V08325;c}D_SDfr_ zJ+m_B?MnAhavd3sn_f;L$**F2D`(&;k2Uu;Bv$#q;0!`9*3_I;ayaE=g?Skj4aa|i z7tb{Db=_KaQr8gM@wKv_%r_rh>J%tn*tAs~i42%sxM0QCGUV(wJ#`o-Q6CP(LDkT& zDt>_N>T{k4=vJ^7(^9DiYL};`0Fp8-XSqryRCR-8wrKZZ*&AkRA3&(Dz$EkMfuDZniUV*0usOY0kZ$1uT?b{U2 zs5lh;+YJtfFevJf-f@Sn6tfIi8aJ`}bUNq(_hk7S z7YMmn`HFrejfZ`@Wq2AET6K>7Y>B1TIHe&;*DclElQk{e(_4LD7&@~r>Z0P-e@QdV z&*U90kfC5?#$o<+@7m6K`TIB*;#dGhG*8s!E>|2rk~EKHsolR`Mh)YLBVv7m6Rh%K z&Qn;eH)sr#-*S%T#PlB}ushiu%XR5o>bRd|-q&Eil=@|$TXqZQ%%fyZGk0DH|3^w` z_^t7U%b>xYbHT0;Q>`+$1&?Us2b<*Tt{*F(o`+;*$oi!-b zvQN1`Fsw7+U*aRQQG98gyW5nK4lBD@jW-H;7&rM~x*H^a_TenF-3vV1tS20C%p&jW zY5?LClT@kc;lw}sVc=duEsA=2&aLj<)6Hr8=RB$8Li&!pUj85I-UBGAZS59CQBjd3 zAQ?nNGEGLZ5+!HJw9o`eP0mRrLjy`ik`g87oRrWc0VU^_&>*p)p=mO2xzFC`oE`pK zb?d%Y@4Z=6Q9u>NnymHB@r^OQvC0gc8!J|rI$N{qx}+}Gd;D>`;!bd_hJ7WSPj~cX zn4MofUSbOVgq$c%XH|%`T=Sj{LXK8$ospV)WbRS!LOe{z1}>1RI?2`#+G2-*zDV~V ze=lXQ5j%=GbZlbeW7M_Y`)$T-`cQ5_HZ zKbtQ8)pALcdJS|>KK0`SU;eZ$%}^(D-j6Luf-fl%tuPIfqEiM=-GZ~nV-}5=qOM8P z_tR{jo(>DvVzi_Cm&Lx*|1ljDs?F?VCzd7nsu`RJ%WB$~)PAdu^B-%)t_xuGCcXwc zkyE{`gvkBUYuHwcd>=_{-q%zUU?1+VdDE|{wSC<KF)imsc^=Q37Fce4 zUy!Oe{_MYjy1v(y-A`v6P544c(tOd_36)( ztG55L4gi;6b*9ss=DMvDtWXH$PHo&-DaBKqw#}1SIO?BwElF;gZ(RD1D*zL}NAK|@ zzP7de4U1I5o_wbl;f%MGAh0Bo-)@a0Yoia9f8|POe($UA&-fAbUiKo@$84ctd~f=Y z^m#I&GHH!998X_aa4gNKjPLiB^$K>_6dK)kY*Gw=yW&4t4B_am`a+)V@BNKI|6l`9)=>PH z6i>qmR$ou9{&mGv;j5E+SLJXzUM#<_m*?>f4345*Zs+ zA0inTNPlSDe!~HzFZDK+t(9?bIyp+Zj7t^$9M0^Vw0p1;?1J3M$O;u1D0Nlu9IIME zU!2}P2!yS2a+xAs_G(;q?%Siks6uS$T%kzxXA;Ep;glKBbOwmbs{t+zp+NOO@AWkw zy9KX-dF}e-#AT0yZW1A%HLb-Ab;HOj*S=_TPhG^n&ti`jRs#mG76P2#)}>Ko+{MUO z5a(tnsp}hDhU1@%tUjCJikZyv9drgmT2D)3#?K_G$rUg+35}U){lFrb>Ngp?u^z36 z?q*xCD6tQpM5b@&IGd-swzmj&S;Ahg}DT$VBXS@pzwc3XUv+7_v0p&m(#}t zh#=H(Ui-d{?OH&`91k zhogCnem?UY&9{jcvU%?u5cu$;gUhh0_RQ52|Mtwu%{_OTA&IrQ`1HAV`-RwC3Ykk{ z_^bq(`okqb=zDYT_9<7CAQq#>IE;$hw6(Jvr&xHod45)o%)<*)dMm_H+FPvb8-ZM? zuy&&;&sKIBfGI2ba3=IULMX*#adGep7Ae`+3MLd>o{dimT(vf zeETp*hSKplRASOXSI;_Ndh}RZr36JW!(ul5j%nboJr-I#JOm>kAc%%V0&C;3kAgFD z7$h~}E?;zG-SHAJQNnVuzwr4<+lRp)#|+}{sv+v3^o&X){ukfD`PPH<=%f-D6WQ&M ztMrY24`Mv)Kkm_;hX_d5D0IE8Uvn!~JC)Ewt$?rWqU0l+>+g5R^55?&jbHlKSGls( zg-agkfT16?;L0MSP>*p{pl!c`+HTY`@1lfMZ=BTeKBaY$A|41kI?3;zjE6@=VGV2G zxj`C8>^vP)Y9;5strr?P^t-{cq$k^jfqCAJLsDTA?oLVw5;+(T;Y8p(R8+t;Tq!NR zC_&E7)2v>LK3Vn4MCzNV4y6uOH~C5)F_;3Lp_kCOhpG85{q0I6tzt>}wqdJ>3K@oI z+hU8KB<_3p0lVqEI7GyLQP*A#;`$tfQ3%-YEe)+DL)*r;^o-cr3bI&YrJoV=IT?FC zT|jWv3ef^1D^3iCo?JV=EujqTf@bmPk;&m3^<9Q3bGs|?mXBb(Wo#`KHn&Tz0Yg@Q zU-VbAO*ufTZ0?jaRHSbWTm2>`@te6-%f(M^O{{b_C2b#WRDXO1IhTM|yS$t{x2g1z z6g}canP^^OOktyzK>QZh+Ly~0eTw#Cipo7j!kpkVp>peIvjr1%W9nk*$tY?61A}IY zw&Uqa^WtJ!NHm9TAd2C0&5+mAk? z^C%fyyHO$sk%Te_bA@jgIc;JG+>V3snc~Wl>O0-PlTgV!pGH(7~C2yxf^r&g1J;1l;bTUENHVWpq+aHZ^Q;1I7dpc&<}16yEKyZ5PP^+LOUrAEh{p z{^EhvQsqVu;rbe5({jYK<;V)~lCw2Htel6TYh? zYOm+>6j++q;d$;+232)YG@=rDO`?{D^S9a_JGU48FxoUvOF&FP5~n#hm95Zk@KkAO zH^z$>Zzt!vQ18+@s~FXdR}GbXLcv?M1SQfzp#(Tik+hyDp9LO>ip0Kv3XGS6h5p+M z3<4Yz>6Amfy}HbjZO~uul5%+TeV391enI?vR1~T`PscH$oFzd$Jej378STqk zE5A1%KSAWW-V1gUHHf>Wd9keR-c93x5Rh$c=i%wNt3t}NmP+d1b zA}nyMqI)sHYj!nqZPM{+n)%Q`{o=8#Pa3%h`{p(% zhp(FKSpFE@%e$qz9tNKbi&iwzftJQRO*K(7SlaAE@^=r!&kVe)*~`}zQQ8cW^s#JX zj!#~rqhh_2@-BM}2o@`?;}jJ6_BAn*c4&0N^D3moKmKuDF&jo;Q^(MbvrN+@H=pYq zE>xCs67M#rh@^B4JUgrZkm~5>xhB`PYuICF*WRu@Fe25px5{4U!Q1Ayd6e8nWav>S zo9gS+HaRWDp}dnIbnFc3ub#}#@r@5i6|OIq;Z;Aoh*1 z*>3D8^{7+)(vBh}WTTH4&B?o(vPVJ(N2gLLp%T7dA*rME&QwoeU?1S*e``LKHb%rf z7Dmw1i5T?&YmdmA*8vCPfF}(2e^2JJJx^_wwx4Y@m+~Z(zDcF)5~9|YU9V%oxT5uj z<@r2s1sw>kf13Z|W%4FQHhh_CiKC)cxPxZ)B>Hg~CEx;@yM;_qR_8=SnWpnM0F(3| z1O2=!7UE6soC62~t0Dd_e6j)5#)+bM6nd7mN))|^MH6oD?0m46-Daq|W0G^YtRbfu z8^SleV$`=+ZOQxyp6ujBTivFFcr!eHW%or5T;MCU=P>Q88fPSLekLW;Fg0Z12z|?z zAM582}NN%osFfLmko$|ooY4AI8|eS4r7 zj;UBevlauu=pV0Zl5uRQzNRi(*#>@@6>O;x!>RnzNj*86EtnY5ep=(`p~h*rx3{iT zAm+>&7Uz}~c#ynqP#xC7%(48N#HYX%?B#$LLr1p8@qt)xW<5`R)wB1gy>t5Qjq6Xe zi6O%z(y+?yhq;eErD5VCaN~5Z57L#T?Y_(XYoV2!?IO3J`1G5i4W}M>gv-%s3wGq`7!QD+wXS??A}|<&LVvOb-=B z4gH+^&ISw07y3Cl<0rc(N&8u(ywz+$<=a0&LuAwyh3uDG!mdfCx-*$iJYv%-R(0~3 zvs?K%ERS(Ok$x@DPMK??9tS*I?&|(kLO0?%!S?DLMM8@+Z<+#_qB%MOB9^lrO9DMI zsW|iaEBuLxjJI*I`1@YfhwAlt!m9Z+%1yjys}nm5Ja+yKA4j!oXA;&iSx$#uKEAI> zAn}jZzOGLCDsH!_@*-$FI2GdDbYf|~(bICuhf_$}^dKS)VZ1`gh_m(4MF%=UU|{)G zAh%+iigr!gco1RfW5&^;m(akmLT1NMrBHfJ3darXD`3L)$xk!=Hr!WX)3_%QcR(+v zmbx>BLGymfsI%^}k4KpSnc}w@pZ0!sp10wjk|Ha-nY&%|}* zZzGx2LKm5NLgx0IQ$jd#bT}`s#06)Bte0JiZK(r?Ua5CdpJagk%y>4&etqv)<1#83rq@R zIHRX7{xN)v^xiR3cS;l~5g9lWm;^lJU>?5#D^?qR=~Ot%$W71K^?2JE_lCdM&;0)I zN=*vnhX zxAAFba>2?b?*s*SuJWYdZmq++XU@qhTsCrolxgEs3ipT()_`J)4xpMv`kg&KNVEIZ zm?Y>W4;m%AY(t?ojV-3_@8INS?On@5I)q3OCxr+X#7###F}AFCVLFj?xXhftYU;xT zx2dv&H^9oi4O8B{S8d@yA?)U(I(?sg$ycD4OrGBDYh^@V{hrL?QjWn)4zTf7v zYZtG>^z#AH>dYW4>k1fC2X?)O^X=LSfFkxosURDv1!m^3#>acFZWLc$xab7aguE1H zkRln>YD?^_>50wsEEIJ-J$mW+{$7vjoUTTyDF2%2hwxxTRl?#hshfMOQM}Of)KcrgJ`b&4e_?rNmx~XLZd`W zV-2g%lBwMI`U(&CrodNPJN1_o(p$?tZ6;+C+Hns@A>*;2Yx~4YH)3WqjV-r@ml__> zfjXR75}3BC4$4-sg$^P&8D;U>4vOX5n!;$5FNu57_&w~Ds_UW-W56yyzr`IjJ-g9Y zku@&D!BDSO@jKoU@0(Tp6Vh6lfT%)|>%$kmD^_L(-g~Okaf=QwG;MI+zc!g`-5mWB zFda*$-5hWmd`meCmD=7D^Go@7xf$&=o2oh{HhCb7h+P%r4xKM!p!{|F2&s%#sIfFt zP#^-83m5K!)mgKMLF%?3B-Y$Eda0SElwoz`UHebBs)x6-&w2_rB86w#Y{Gp4jVzv} zQL9v|cETzTb3GWlgaT-1kS-F;ihQL$;OqvdZ*(3ad^xgFisn-wfIFNz!OF!=m8>zb z#4G~GEf}eY^U+Ux@Lnjjl|wQU^d&mA=&TgdagA)a9Px&XVB%6-MS5X}Y@7dQ@tyHT zZ#qu?28$z5t$uvf4@D_@=9_^53TERrBO(Ggu@w`I(?lhyf z%vnE6soAM?szx@mn86BJdU~t7QXpLk_lNW)`DNBK_(bn_++!Nvk3h>|Y@%&a1a~q;>N51n zfPRcuK2s3hvWFxcv)Va6(OPMa>XB{KO!zeK8ilyk-U0>Jy(a4%njsq0U=XTdy{OeR z^9z0)uvZ>~KI*&+Mu=~BBiB6gBeK9elJc_OmwFxzs=5`BNcS51n2(dxuXC(D436>^ z_spt*-cqk8)#U6czLnBL1Zg%dW04NO_wZ}hw08eTS!WQ4l1bEh9jE~2bD-mfYS{3G zGPo2(U9+-p6SoYe)vI8j>+q^}*=&4N+$6d`kO@^2i^rTxpFZRibFnax4)SdxQ)LW3 zx|lEUuXZ*69vQ2ySLJB^KLIaWC=`(-_2QU?N%|UXYz!%dB+HTiUJ2D)8Jwx^|k1_!)5z>yDYj2KHCbB~itk1-EDsSN5@B zkZ{UiZU5#e1^jg0mpYs+G-HgY3vE(Dv@Ps|Rc#cn-@fAZ@eeP6ei(0AZ}I?gvi?yx zN!&v^uC@k?i`7v*N6ULjeVa?0w~+B!;y{(1^f;ifzD+QtlNflICZb%N*en{Xy0}iS5}2mSF$@osm9^vv{A4DW!LN*?lY3 zL*Df?N3BfCYuqdDqrzBs+R2ym=Q#BDk0iu#?CHN+ zg6@supFet9JmtzEMi!Pkql)Zawm3dH<(cnqoE_SPVKg0<3gh6;Mw-`l(`*j{?;a=ke#p5%W3ec zM`bL-gh%ZUbQjU=ky&W%dRQH;(&PeI!AZt+p&`Fs%LJRKaWvH-gE$c5=apTd=iNqs zP(58JOV;b#^|`Aww_O^f7wGf-?Z=YI*!(wK=W{zG3hf?c=)kbiew1sY9?r$${{}3h z6br{I6q5&-Px=RXq2K_{xI<8Fva4gj!KOsgkk3-)sD$Z#WD4rFG@?pO&FdBJ zPgaOAb5xQNXp^*8*~oUWbHCHS<G_)66l`nA~XL(tb@thJ)`M`&_9l;;7yy zW}jhXdC!Z1tbNPEzSmY|Ix9|@&)Z2UA=_zPl_si%1qKBphRcr88xI5>)`jbwyT`I} zm(|#NQcjoG+OH4#@qerbegd8HNCr93!k(SvznA`F*n!WoqNzVik{symD*d0&}?l_XiN5E--Orn2431 zY*?kARp^MArQ4HWF8RzgQe;>^-@u(*%EL#PAbgBj=iV;1W_~iE=3R;d(43&@e%=WntM{GdtvcWOacgUMXlSUsyd1FHX8Im)?#q?t{Ns?Vb^3_D)x_$N&Y?^;qquxwYS}&d~dDiehSv3(f^H zymIX(BODN1w9>^GhIY1^O`JH%6cpIjvW-#& z-gXEq*P9Ah${(<#gp{s^GOXq zbt!fFkhk|Oel+a7X=yjIbpY~SaeheF>=@2ry$GaqY&#wy^UAXbpb@n^jf;IO11gjd zV{I?9(FFbPxF`AlgusBmE9(ykCJ(nLcn$)B*gMLUM>&Su43k5~n_@L0PV8An^aHKu zN`QX2DXbA;NG!G5%CXVD5G0s)r9n!~e3tH(sJ|cH^6X`V@8bo(n93D3&A1&@)>p}P zfrUw4yn?*tC8~ZFJWe5^3AD*4BIfn8xs{J*?o4^Sql)_&>nPPu!tE-1%Rq3APkZB; zq{HuwOn^>%{6Z{6=HOxQp7rFUT+k z2)?yB)N^q)X%AQ8OQ*nb92OA`EIOlCIhP$}TQKf`!JwU%6X&z{r zGs;v4nCByOi&=FYn5|Igg|WL&DDp0?nHa>s*Ll-o2-3Ihd=)HS#6Ht6&O6oJ9Zvyz z*j*ie^19KFBQ(|#`uPJ9(Yy{7uMm6rPR1l^LA3qr9=Z#VnSeuCVak0EC1Pm^t2B9) z)AaLm|275r4VWFimYz82+-}Z5rIfN`sYwem7Pd8Ku6vxpgny!BGjZq=6be%Bn}n2r z+8Q7jb!OYyrQ{{XvQ4z6&!?p)LO6b&zmmJtZ2pSiog@lKgTBL zJeXsZZ9YDVcsa5C6~owFDkc-d?D;u5<=lFZ?vzM_JV?ji&S#Dr#a!Sj+zziUPP%V|At4h`-8& z(>%6Sa8Atg(`tX$Qw>mc=G93uzC9ojx0i}75Vvc4=L35%s_NCi{s9IFZoty`2X`0n zGyKHi`ODbYhRJzVRt8PU;Vq6q@MZ3~(#bDybPzZc^Rm!L`v+o(duO56Mt|%yt!1QD zMw|pqeIjGCGh;dtEAG5>MRl;RvhA=SC3idcgm`HpVBcU zrHD};-pq{B)~?4sr@&_Z0UGhI!Ttjp2WIKOp=guRSb|Zv?9sl=%ANk!%OtJyb?1OO zDgHz2#KWJhlTx*IM&QQc$I-JW$p%yh?5YAgV@?ho`UD)Y+OP7D2nt(Oa} zDf}WZEAX`jYz}CvzTldGc9KmQuXdnIHpH~aI-6XMrPHq|keo(~XJ%BUg{J8fYP$s^ z@L9%yqU!65-CB^OwcG2nE<)GG+#=NwZx6uN641ZguaKY1y&oXCo4wFh(s&}-$z(;3 z>ycy^8-3t%gnPtdn<1E&cGq*bt95p)(!n2m)L2qir*qii*t=iu)++olRp9zO5(o67^km1*{fGl04i}vXCF*~p%w)&@ zJqJJksgyA}HVOco?@K^h6ooc6Z-ZragzNUUB3Ie*7>!RlU)+-0_ZJ-= zc<*%9U%!`0CJmn}T?U^>zMRgxYq_(2Y-)X3!r7?p!!W)62e=dpC8Cm%Grc}3tZ^qf z?~>dQLJifLlOT=V8C5_B_!P>>TIlFl$o3=$EX8IXcC~JbQ1arz#q6yMiInF=UDzZu zK9^|gnt6gfd!W|gQ3^NHc)F4LhtF>L1uMI{E zn`xV3&*bmKp&?4lh1ucZDq4C#N0FOB?0~Sa^^t02{}#FV>=5~Bqbsp=@25BpH#B)` z-UEEbwat=PI2CS`SRb~;Je&O7|EITWO7 z%5LSku?V#6AEaHwHpx_F^%Bt~A%A3guoG|W+79Ui*W$XzgGi*8;FbN;r7swob$=zV z_HTbN$JJ$V^mGM47>2o9Q2GNO{qH8xiBxfZ*;^>3`$xOl9D1`rvuo%m| z(xW4{yiKIhf8kTgi(b3Y=6V5POlZD$Tl1CAcYR}s&0!AKDH$!qsEdEn&7E{$g=6W4g9<8pJlDU!b;{7yDXzjp8)uO~8wi|at*xa8}repE^fnr>tGGSn)MCqrQU_1Pc zeijUkvp7@NVVi4%@K-}ZK-emJp2j!7$Fkyq0;_%daIm-yfQ>(5~;iyl+Zh@docGdFi@DwMhL^ zS8g5Gk<&FP`?H|~SOzHMGG{^>=Tcq;m3+^XGkytp*C3iT_!{Fdlw$yAy>a3K%k5gKbw>+_#BO$%KBuz;_e)R{*Q@{3_U4gHErYILC4U>qdW+WbR zbC2OlQv98&#KEC1pjw(^_ynIsFa^|WRi3luCsvurM3!4GEZE0h6*M|WDe$jQ?L!ut zvoAI!LIoqQ;1HGKT|Ud?a9*O{Yv!QIwd4>wbl6$rP2Cu+Ip3)E0Qv1#L%Inl-ae|u zKJ6}w#|{_=QaGPy`t3I(s)1t$<{pwHJNOk7o#ed*6meJs3@~!7l ze7%%p`sA2WAWLj}I<>Wn+smCG{)HP3L2%WJ%z}sKc zJAdOWX)YJ|^%$sjI;(HJKMt#N-xv)(H^u`XK%!1e@Bl(Ze5tt)!F;!mHch2HE#>Pk-Gq7(Qdk`#Q$SynyWw(N7C_Iq=cV zK^uR`JItq0U6SIb6-o6^TY^oGtNjvHjx5OhN=>M-W|%kHS{UUc7}rxp$7sQR>hPVv zd;omvjpZQrBzmI!A|}L>-Vr(sY`v1J*R#$^4O1CxLgF^PeY3uzx0I`f?#cOm^{%_a zLu8$5WkkyXB8>c(4b`Y96PxSf%mqnp)jL?R+v9`oGX6Fz=ILU}Qg6*ix+Cx+LBljc zcBhGPwzzQJ0&9WA5#fP=)a4}-=^D?h`Z{p$q#3MI(;d{3-oQgz&#Qm&`-we({`jVDxlS$* z{=XDq)wIqeEP76G-%O zPHr7VLju!4O$KFr%->+~dmn?Kyi2;xVS=wFa)0n*XC3&qVb zJ%Pxe5w~)cUvG>(QM3WfzboTXs(A?B5RUjBTo(uGM_qug#k2InzJa9rvZQg}xszO7 zaXFGf0;T1?aJctpS#sHB1W}Ywt^y#*ujmJr>_2|oJ|^07(l?Cb@qfq zqb=)qijnWfRt}+L+4Dio2dEuzIT^4+dmk9ar*eyV%^{Xn{WG`f5_zBf+N$M0?0%nm`2IvjwXT@T-!^#hOtNUk?G|MZ8b=>#XZlanTZZ^x09ooy~DtzDF(_a8lv7>n-u1@ zg-Sn)&0+c9uyXef%?&f--?eXo*|?~=Po8D#j%^HsIlr-`bEoeg{El=h=sc~r^38rV zOzh+9 z!2MAy90MH?{;8V1>+}WlXqdrjzAwUrr9hvrZ%_~kB(v+dx(>)6Z#u$mPgke%uVTtP zC)FEE6~a-!%zTt@v(sO608WAZ`LB9;4+yn{8ACJ7+D&h!9f&eXPuUCowB?nigec!N ztp4$CBlhb}#`ydvAMNI81pqf)dE;&%Y*^9xO^@TL+J-^P`t#SN&*fDkLeaMmmmXMP zLGK;Kr+OxV>!=T;;nFjGB3$@3s!P5{U_#sXylLcg%)Zy z5=MN=jmy94rOn*8?wKct&!IBcH7^c38hugFt~H^vwNg2;vP!G9#hKg6n1S-`W2e4Z z(tCGe@1{2wu|Tb5yblfC+#E+7Ni&W8tMf@_Nu(zlP8*)^;^_(upL^iY2bAuGKaV$G zj8GA^bbhBBq2ze1Q8+kvj={uK!{vKm84DMvTHk7daIQ=`#!27-#Li|{R`8B`Y`)!q30ZR~B}G1)}{PDma*PH{H1bYp6T z`z;EeYXhjM_6hyn87)rI>%lgz(7|`oq|yNLwhzacEtC&DL-N}@YMq-zDgvOLH0bQd zNlhKfPb~0R0!tQZXR=HI#X3uFY@EZXX?clA$VJW(1y1uk3J)SKIz}W%#e^foTdWs% z2`?VJPV@W;@z2^_tBS#+;Qj5|YcDuk^Bdp2UmLC0djTnXH2yznX&p1bjK7 zB$10^ND~nL&Q~fXvcpXa4tVKjUN7{3+RVfmzTH9Hrmx}oiVm{j{f`#F+Li5G7gj~= zu|i;Krl4=HQ59c|1}oWZFM)wW(O-uYK4W)>(c7gis*3Y~WHfzc`PF5#gv_QyOFu2Y zT1+6zSeSEr`rFiGjsSl+=`9AZH_K)*J@gshmNgQY%1E2MJQp#0i+BCmZ>GY*y*=&V zDaZ&F7*zpII&nR_(Ne#r6hQ)k4Hj+Aa_;M%BSDX^FbP=}gFris`NYx*tR83mS&m6* zl}NMsYUSpr@a5NJVD%X_0HIJhmQ7@ZPX_FeJHQJ}Haz*fjh+4Qz9Ir!=Uxa+vX`U4 zlql;Aq_=}YpmYAWSE{hhBk!`sLO;z1 zOhXIo)ndHISt($8gt#6LW=Ya5B=t09=)^o+|J3$n_PQMr;l22J1gBb)HuV~)9C7n6{Jh%P8=ZNXZmm$0vc;(#>(HSNIZtmc9&C-d#sL!H-em@rf z^%wjTtozgV5|IIuz^h4g6=k35{OJe(?|&aD)%O>#Q_i1r{T~C(VU7)OH#n=N+!rSqcys_1<$};4+qxnGwTzR z7eq#D%N@&WCnak;OPWn)Lk8?Y+%ZtkDTVt_bke~I+5WzA!Fp*vA^0Izgw1EIyF+7< zz?5kBJK9)>K#sckyTV`QKKb~ z-Q3-E(2BRQDHjRD2VzlhyHx^L<=Rh^H@?C&0KUoD?{sLvPe?C{w~VW)!r7&SW<1xw z?neLGbP$E4ugd3L3dOaxM??gWBjuK|a!0_v%H?KYR@DDLD(nq<;@fjOs-3-gq{f@4VLk7~D7h0n}XT~Mt*T?anu z&mFB%0uO@UKKUV%WG$oxyyTqL?wq*0J^?*MMFkODwPh;P8OY(=iP74?s21XI^Dfdb zdv>DwrOLltfi57f`-W)VWGoSW@2-3N{nsyCe_HQ&YDs3&^+tI1hD1-nz<5YdH6Px} zJ%5etDdW6yH}8UkhFK%L@{5CPMj0E6fRO(f21poX8x;<>bLRwv`lC5Ec+@YpR!z#~ zMI{P+HM&gT2XTA>`H+7>^E9`V9b80vtLHdoKh+TSRdBp^YF+B(p^qqnS^DN)NB&ma z;MYvd*Fdd)m79!cXGi$ni~mN|i$vRRuj16ad0``~=yn>%ia0!E_@P5_=^>)|-Fq7{ zl4E{>rkD^@_?QKyiAP8ZvFNWreJeMuJ1gsRAj3ZU4L6UyLpdPXiQk{L+B5|^xoMuJ zys6tE7}Bx%4*&V{vRl^Cx!@gBq%fPfJPD~0+3NVjbm4W7*SD@OA5B{)R@qXALPef} zvRK7;KI=2{BmQPPy}A5g#<4dN5{Uf73y0s9Q&d#!o4=&77r8~|VRGiH zmU<6z)-!N{5e=i^`PnHWtSb+T?l1OT!|dk+NuT0JFV;(Iqw3Gzy~{8vVQ+V}cnW44 zG*q|B&Qw-Ea~IPK;e~IE#Kqk`jxf*^ue)FzCuQvN5>nYcK_lN7>9D@D|BEK2;9TCDXj)T?k%ppcA{B5@3ju_4BbOb8Yoq@G zHh?kpyQawY)uxHo4!KnaYZG{s&nfEmTK0!if6qFK z!iAG_3s34@jdSTei~+b;fM8$D&nf3@EcZpex?HTJo$ELY9FNbRxNh_!Cy=#RC3UtlO*tx?Wk**h zL#=L(m;A58L{;NqXgbfjM|QVHZ{83*_!)R3G%`dKBQe7Uw2KGEhtgyXflA*p*r%bkVt zuFx0ErL7|^KP!dhK$Yk zzv;?m2OdC8X>P8&Vg04`uOZMI&A#_X*Oy8bBm1QWv#~R>R^2sHBtOS%p=AOYY=boH z$?Y0Nx`I9^m09uAcHx2j&n$TODu;pD{x`VhB^goi^+fm53-EXrJcPc+DW$4o1NhZs4*HsH9&EhqUj)H2i?ASp$p9t28aIuOdkfG z=ys!WT}W^-G~+Rt>cGqBit@RM{7;6-wU?{NpKqq>1fkaB^ zftvrSh0uPY(}=U@lxh6Ff|YKfcq`B4NVl|!9Fz@B=(P42CG5Yt=Q{4(Ddu}0=X1O2 ze7Y?U6@mP?fcMac^z^49)Bb4P>6C!4%Cxfk{*UAQx25Gr)1SQ;p3%N<&KBF(YUE00 zc`g;1ZBKgtS51zbWA-WGV+2`nRt5|$8s-?3bI~Vd%u9)#_LYc~d@9Z&?jeN zG=Ysr?RJ5e-p6y9REt;bT%#Ki5~GlrzRxSIo*XWLr?xKEyt6<=hs6h;7xIx>zf2o5 zRbwkp`1RPU0#H1_s8kbt9`o?WAA?c}FLbPu9w1o3^uQbt2YzDh#AK>!%IY_Jj3;?v zpmB-R$H2#NK*PeWU{lee0yHdQejlqk_ii36>a6PW_!r-&^99DGPsuxAl zL8&b;o)W;Xv!d(dkK65JK>aE(qsfMnDR>ZWCpw=cI!~S&_`;{cMpJE98An#$MITqfvTwywY@EY+U&*gJ$F81j-Sv1c*uHDJL+n4sg9qDz5d#g)Ypf%%>RvcFXfr*RfrA0ljqt0 z^VQ8lj1ucGOFvPfWs<=_4=gW!19iLZ!ufh(pvrr5U=*@zf*Wv}%unCs-PF;YnxEWD z#RYCiOY!?FEr`eT0rU+;(v!ha)HtscXl7yT9{bcvX%9c0*tugYGj?E2X9C@YAG+h` z(}y~1f@PFn8cL5!NAgh?S;)uWEw!(M{Iz~cN_-Zh)i%8`=qxkO(kgFM_aXA``=kA< zTZ(Yoj`1-Vers7%FqV>UsANEmuUiXO@BReg{v}#j*+uF#Ecb0fHp=8Xq z*tsRo4p8}Q@*p2e+y;u;<+34kOse5*Zb)EnA0OTm&T4ozmD?Bri#-?*6BO3k_d7Yf zZSUloUj2Nl!i zsjU~W^eYI0*~^7`|0lw?Bd(clKFCR|i}qx?3g2au-P@F68(j9yii{qNiJoR!Bzkc& z@8pK)$!A?J1Oj`q@;ksh;_=~Sp`SggL#FafBnodPC+ zP4}65b@<~2986>6t9G)2*Mk(bFVbAgICj}kG5Atw-3q*3Y|M3f`pg!_3%{XzGOQe0 zTj{qIU&quh0quCNovI5Eu^iP}NkkRmeH_0@1@Nrs>cKK8}`^iR) zN#**u{F9eC9ysV~>CU@TrE!IHky+bF}|wT34G%f z-i>@S;Pa2yHmf#A0ZY?H+RBsrn(JYBFoyjFats*NU9+Rz(elZ2gu9i2Kx*VV&Y89# zZ)U6HOmUB$(U2v1G8qLq@}d#jTHt5&qH^BqlQlgktF%it`Dd8R>hWu-WFrra)zh*1^p zvA-&P45%pRjVkX=t+M$+F0SN)GOtG|zicL1rLJ~FaIw5x!5h|dFuw4;ZUqAW-A%$wk^1fOPvcL**yegx7UrF}7Ut4V zH-HJF<=&;&7j;qhReCZ?1Fwb!uq&7In8PaTek?UYyK%6vGYfLK4_dUR57ZWuXk zTmNG86SCfu*>k)xZu{GO)^^J!iF6!e*f=vb-)tuEfXFft_=kA?U*(;zheL`Af#U z*t77y61#_SfJkqxWG2TYcb@vXWAt|;AyrZ8vv{RoG{_gym2$lYlyXvZgREk23nxGn zOW}_Yoz-=_ikmi##LXk!41LfS^-kR%QeMTSu{1sXygzDXApt-Kr+{26_Y>>jJgu%R zXJF<=$|y58*AQ^SCa6B_n;v4oKpIc2w7#EMeF)9<6MST2Yjbx_>LYMn05qYv7}7>a ze}<@!&hw;`-`#-eul8gWLo^K)r7pQlj-}_;S5EGTN2Hd*0u6;qNQOkw~$&Zq2HRi4s8)FoKBg}gAfF5xJz+9Qe3y7g?2 z&&FOPs4(_1K-&Wvj|*hEs!*|9B?Tfw;*_-AQ46R$n`tsfXjsSC2@Em9_MW$H)-0oO z`(A$VviD_R8lXmGq)lL8=>nwP3@sYWML8_Etvro)wFCqQ=y2pC{1mW$!2(Zk&~=HrqH{!*Pvj_yd^F0SEQL9~8SbfxDYV;Ie2 zgiMGk&E!q2NTq=>|0=7v?|DT6cajkJ2cb5Uj{71p7DiP^iYrI1t0%wv1fHb za(3IA1Tbz3LS5o7ir!T8nE;Rkh2^pn+Z^%`&-DFrbN*=xlWbh66Y^$7>>ZK4r@9Y= zAv5tBOyH0?JrY)wF?#a}7ChxPYQe8FlY>!5AiUxax6q^dPcnxUI?Bt%ESAV%k`)`4oXu0=1HUX`+s zKto{>clCuTIpwxJs)}hbuMv_d+SjW4@N(z3ZtJpCi1ww5DOrHahL~37cY|kQvq7K( zYvrbeb;N;2u6>O-lh{=d^-H#3FR{GQJ@*w*#sg~J@fE^r4al#}EfHsxVr+W<3~>2> dIw>#b47SyGy<(*`td+SByB|ALdGOqozX44z_s;+T diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/img/example_pass.png b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/img/example_pass.png deleted file mode 100644 index 069d71698cd7cf33e3269ad0f17066774eb4bb7b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14133 zcmeHucT`hrzh;!9f=W@ONIl3=nt;-Kj!{HFdan@?LhlfIEEJ`xG$mB&EupsnL8|m# z1BvvW&}%{_e)oR2%y;gcweFo+v(~J6|Jljjdu8qYw%^n8L0eOW_A1*|002O%`s|4= z0C4dw0B|9h`Xc4bEpn9r>=efa;S+`o1Y!vwnek2Gh+up01y(RpEHyP+gy**PHPcQ@>rf zBvc!7r~A*m({-8q5kINLyTz#AM^L?uc*h@c(K|#?Q2qzq+f9qtUYP+Sl53wA8(@{c zzxb@n-?K_MqvuXutQ(L$x~GM&<2$0hKzXWvZhw}r*7wiClOYMi)mHhqKFyBkjnoyg z8gS+nR}DI_baf@k^{6(}Y)q0H4Z&qUoAt&BK7Kp%AXG#o2`68 zqU3_XGbsyKj=3{p{iXXnoL$Aofa`TRz|{WU?%p5IWJ`CKQ12wY6S0@PKd#WeNB*YB zS`*-JHc;PHFz)q9l;ng}svhz_={34uqY@j_G@D_r9yPrm%Qm<~R+>&U7t9d`F8v6* zM6Y6wei=C1T{@4kZOeZYE$XcoD>7ua^@1pQPvVQDSGch5F z3pxX^(=oZephgI%5PItC>~9@Dt*Fb{GnFM!`1VApcNSW$$|81k*kgSoCl4X~)cLd% zwbI~f`=mkEr)l8T8905Kfgv&3!q3?Zs&1KAs;putD(`UucE!7Uc#gL3P|bL)pTMY4 z=vpUevVod_^Rjii!sws8A%jw^r^}}cbqTs^_Nr5IK)Hr`C&!Ih@q>*8TX=kRL#q(q z;dOlr=Zy8W{sq=69ZM<351iNfL&OEXE)(0T;sSol2hlc?!DT0LFQvUsehz+prPuM{ z63;aV6Hqa;=%^%N#lYs zF}fAy<>jB1*jG1lEkx#1aK2d&;p*zrg3Z_%YfQfU7OCAhJykZUQ2#GKQ znfhKltR|pd9aF+4<~>AKYyQZTH#{;jB7QZy_oOuM=!90V!{?#;(W`jXHGVZ?`4ZUb z$s-2H*{lUQgw~(;T>p)Rntw0@#vc;o;kChgB;GLX(6-0WuA>V z3r?fy)1y9YilK;&-!k@y+dd;rw5=aw!@+9wv8)!Axh{)sOtfX`pp~e{AdJrJG5yP? z+41t})QT{=)m(0K_vF}l=mat3bL)s4YY0Qjpw)Ed=a3rwuAVtZP4fH6)DJ~i(=xtB z3CD%royh9Dw(wX{wp+#HZXA~GN-k;m^<(!k+#B+R=?-h@1XG^@wsEl^>X3Y>%F6f~ zgK(r#Cw3D18wlbp7`rdDcekX18aYlr-wFe#Rn;W*b6v0 zJ4#O1u3brxIxRGkk#~{2QFcX84~L&;R8YVQ(nmXHy6$hD6A9eZ`ExSFt+N(yCCR$| zWA{4T8?*H4smO34tpTT%L*dOam+{*@%XTmx1yc>R1qiCCY0g5AJ24F zA>>pSfW2)&BlNVPc-Lj+m!5P z=z<~Rjerc_Gu}rnMI&Zi1>E}*)VQ;z9vsVvwqC2d@5xzEw)~Gkzu6^F~!Ng%=e=C`}eVT-RW-xm9rCAjpC)ug=lPdH(%3PERc6lb)^8;XyCZ zo9d(JCW`8kQtE6O6mJ=u;u|5C{YcGB-_-tw)pD)z`2FBY=)mi6>#WqYKJK-HH z*uXzpNclMxzdD``clk}>iIe5Q((-OYb_K`DfNl99&h0bJ5Z?033 zy=D#IF_UP?{FJ@r%bcQx5l$12mwo%66nQV2DnUyJ<_Wk>TLzHbThtSJ{N$iY5p@Z; zf)08)-sV-JoI}Ju{8#rK&Ofhc1A;d z)S0X(Es|TdUwgzih*I*+r7UWlk+YV%X^wFGE~U0)u3o=9o4}->cg9&;RRE&av5yFV zX|?WL1J~8mrH6+@pGD@o^ab6@^gX`pYb>tk(UZN7IUS;jl`KBxD1LT6-x$% zXQ^{t_~~bP(&WM}u&7W}CXd*iDE+}YFW7)!T?&GGJv zh!Png;VM&8!!pcC8-Bhhjb!;@>t+V!htj_&%xsU8r|%Xih1vLN)=NqhT7S``R?aeT zv`gxd0p&j;*_K$y7lCOcj0qrD|99 z;?8_6NwUb1V7GqCwn589JWMK+MLvz?QVewXehu8m&X8?6d-hGL^TS492m@#p)!`b-?trEuGfMC@g3sq)BvJqX=W-VLwk4Q1gl%x6ilAX=FDj%qdw#e&dAuJ@ zZ)j0E{M%8m&A|{+Ej;TEVRc;~=&=N4Je`TXFs~+LKZLL%; zE2>}4%VlH#%ZqjUSit^U3og*D@zXbE9HhIZAVXKLbMj zz+6B4(pZ!m_NUXd8_bkW`a2eH3gpCx=1C9Wx4;MPn_g(tCimkc6Zv7aoOoTsWUU~1 z>u2vGF@fzh1UCw>sZyVKa9XmpBAC9I;J?xYQ8RN;Qg=WuTX?on$hv8<=boWlF^#|8Z5kS;PI`LS{ zR;R7k_NlYHhD@x4IF=CHw*c{G zTIpy%;;gLZ-+PxP?X#$T5bN)tUn6w;R_R|kZUB}UejIC>z2DM zef^;sj#2|IS_h3r9EQ>lQ2cf%0j} zP)$o+KR|W3QD_d)Q`O(UE0e->^5cjAz;WY>v9R&uKHu==cLmp4?3GCRueZ-vA5>Bsnkp?zBA z%ZsKl&o^E$gwc%zmo3_w#bN7vv?gAx&h!Z|tBj4<*!1I}-&z%UUqVx5eG&Y~Nkbh& zos`7S)&=)#;#2%#+9NzWCwXydo*K79ZKO~oEy<0J*g>~ccxB4+!t&aM$A*6_nFu=j zpyKHSJb{~Q!j$F6E@jsdR#|@S!!n6@PG#kC@dCiDwSa=`mXd6f5;uJd9DRH843`pY zSQ1R zw<57GqjDqAVg47+?8_bATo)@QC;)RLB#~Yiu*=>d4dKBHH=I)HV;GnU0C-LIR$E;# z>%Q8b01;lZVgRvHP*$Z4lRo}7C*tZa5YzegTZ>wN%_E(2XcnBf%rRaxTU=q2dw*kj zuEd%?@sBi-sq-i38chhNs@BX0*zT#d5_rpN`sEv$)EdrJzC#t@uYMqmKtUsmu ztWZj5&d5rAzX}BvHucCu)YK!?)U?pE%7ow|uIN)bF5)05m2I_0T#HjfIBtoF>*)Yn zc=ZK9ZRRaPA}d=YG$CbNZ}&?a+^^<3Zid;8_ z9oKVv)hLVjaF^I7z8rT&Oe)5XGazI2$;-L08_)p_HTf?d%d<*DxMe;rN$z8e9*!9< z-cxdNcMREuA&r;1r4C93FT)qj)pHvC?^QIGH}D6M8(c20oE#e^SW$Lhtw~NBy0e|z zoDCw5oi-C;v=+8oy-f^lRvH)?$7fWzb{7EW+JO`TxCp=hl>kL!7rr;W8)t@VxN&+ZJEd{R?`^sQh~aB2k#c*V#(f>(9wfNq(eIF zWNjdi=zV(n{GJsRVEz5be6AxaiSVvK9&IX7ucP{5?@Z~Mm6LRX1BRmQ z!kj**RVcP&b}F_RKl1U>LM*ckB1litx#n{D>W_7s4UHx56lwqfJsd)N_Om!%H&>X` zaA588Q->dop5x@e>St>9LO=SuySvp+oidONAnNu>5!KHG}O$na|w(AmkU95cV0s8 zA^aWN)Aompqs2Q#rxU+8D>d0^m#zzPCt)P%qQoJ^{?>EV`(gq%_QTU%iWdu;@_eh( ztGApG%4&6c9|o^gVPqbNthBwgSBKt9QSFjg;X6MK)M$J&GQpRk4oq@I)_=0?PoheZ zxB_@B7@_jw3p)IptD-w3G``#kQ)}olp`rbj8>8dn-*NX{y@TC;Qe7yV@5v9niT#jaIZvP%;rP@?C)?h*6{1W`A>JXPe?3KD>~I z#i4I@O(C0EjQJSn!o6u*uj>F()ZSdlHI{t=F_JG_yO|y8^FX#?IgneMT+ut zY;T?PjNXuBt*dG>={R0K*rK9kuYV%0TSTap*`z7RoZVHKUnw<@PhTI1t0Cvf`Z;o4 z9if)A`@wfx7Cf_I6lrk*aQsfEmCG`YZz*#k?MnbiO<+W+UbHf-DkwGn;obcm;ql(P ziiLSHw<&vl{*1VsITHwD*SmakZ(KIZ|LJN1+X7|nOJ%F{Vs<*Oa^%q9`e3ERNFqvxN|Xa7%Wu>K@-r-t!tq1S!!;D?+I!GnCcep#u2!6&N5$NVZrF5!7_Qjw+K7g=f@n` z{<3V*vxN%TB^VKu@7l^&#VHbzTpD6~?v{q+jo zx1|WDPDTc^RW5;tnN#8SjTn1urEJVJJnJv97W&#V4QTG&6bfYkC8ijQ2fZ42|2lDi zbFU_Gu|m4f zRw92#1&7A1u($@u+FFd}@x^IzO+9D|G~ADbUv*@;1=#M?4l0Lef%n#DoM~v}lN3n3 z!{SCB%lCRbhf6YbI9t6y{A?wEuQS2DGw!5hR&O~%MhEBVfxVSBh4WB~!0KRg##Q^i z=Q4hX-qzKE`k1Wa>S(T^qkcD_R`gRalC;f|W|va8@P10?6R|zuEV)s_+1Io28>?y5 z7pbPMbLAp)$c7yE3Z_Ip0v7v)#}9enfXRH^*`$ST6hb5N{HOru+YNVAM1iKO9}gow zXVVi7e^F20n!w%E=&rlEY691^T+?PT;2RXg(mVah(DXp)#a@9cdX)CXThab`RUv1GSWNyC>{Sf z`9(|vsq6+@(n;+P@-PPKdt{ny!74q-AHsH%bmAT-aCby7=l(PCug_J0c!(D%Fq7ss z@lixW#^NMjRx)^xzW4&*&%TCf4Pf#C$PAcsJBb;RJSyDQ?V*8s2Cn=4Mz&l|U%r^!mo%kzm!FTI%AU%eNl zO2KRY+K%6$_My$_xv}8of)-Ag{iegEWycq*a!^-?Gy^qESY|N=jKVlXV5N&w8E22J zU#eg^mkU?3tYf^cgZ=;5Wd}qc(f@5y`0Yqwk}sU}3h|{Oq=| zoAiH^{6{N6txRq=J1fT2-POZWgSQZu&pTdUhGK!|q~okh-a)`0(<`EpF~yeESp8rP zxOY6FQS=$qk~EoWXeK1wbDF#Y$%z+pUMuz2G~(5Lj8CmNU#U>mRWp0!V@PSk z5UL=`lHvdN$~gIC>1LJHJM4R)!HYOuHT6@hGJS~sOxw=dp1sR?cVr@K!=Gk^v;r`< zG$y-piPKWH43Z%ja_^20WWKP*a8p&ZZ(7Ea_|5sl)bc{) z7j@A%-Nbt(sWZG8>j4q}B9SKvdwubI`Moknp0PjsRq`GqET}0L+q|~H*q@W$Q)85R zxEv_k%panK8|Z5%H%?6W4Qym#H7d;I__r!?GyCEQY2|`<$TYyV*&bxgA44JM(KnS&*X@ z82QiF8-eCd6EY9_?`)|o&#>bQR@r81{^$!1?B?WR;qs}*mMSN@a!+)a-H6ayS)*YZ z8#vk`+iPNz!&@Xkv~0VoPy1Pp49CW&6RlWC%Lt3wrnm3j6|@1?Q`io-lNAK$8xPxN z7hn?zqQ8nABwFTV%#jhAcc^? znU$}$K?JrD*d=W2JtSLKA!h#4M0ymx4#Pr4dmbX|JNZMZr*Oe#T<@a?sd?i4weXc3 z>9-0P=ZRHTs49mGuhi|=AtX_`C9?BvAFM0l?Dm9(uI^_vn%viav6-N9;NSYcEL{f5 z_x>)5Qd_B?*x8My!>&h~eAWM0zBa4l93`2mHR<6aa)JpedH1efLuvB7B$b`7YL}rt z!}d+gX2tTlfNpieBFBvx1!KOD$|N&q(6jKYVN;&akGg_|^K#r1o68kn$Jd!cwxq(p z6=c>erm9Sl2Q8~=9P{HAyh8t-EaPLc6$v&Ae5{~0eEB&cYv*LvA0o<4hdrJK#AgIE1g!e)PeV>w-!Cn|eP^})5 z$TNGL8IfeTvne53rc2H9s_TQ~h{|CUwcW|gccn-)tO8yHzGT6*`(u3~9mbb4_HOp= zSa(XBd6nhJ>-7pN3++9IPwv82Ef3cIrPqYg? z5M^|2!FG$akE5mS)2jQPezazuq=^xxG2R_ymC1ZMQ?rg%Bp>32RzWr%oMbd`rg7T9Z6#4QdrN8fvz+Ap8)9v&QI z%6f|@L?x?1WIKFCy@Q8P_w?}2|IVu8QOIZI`~QG8}VFKcMR5l9T>V}syjUi#?& z0o%bg*@|kgW6hELVa&X_(XQpNA;F2M`u@%npN*J#9Ix#&tYhP}&+1?qVZ@ctjkZg! z`L?rP->kRcW8CbAu5)HVh@xgia-1d*v$-1ZeSc=;Z*Gi!$}yI~m4iH6Om|hev0J

    ' + name + '

    '); - sys.puts('
      '); - }, - testDone: function (name, assertions) { - if (!assertions.failures()) { - sys.puts('
    1. ' + name + '
    2. '); - } - else { - sys.puts('
    3. ' + name); - assertions.forEach(function (a) { - if (a.failed()) { - a = utils.betterErrors(a); - if (a.error instanceof AssertionError && a.message) { - sys.puts('
      ' + - 'Assertion Message: ' + a.message + - '
      '); - } - sys.puts('
      ');
      -                        sys.puts(a.error.stack);
      -                        sys.puts('
      '); - } - }); - sys.puts('
    4. '); - } - }, - moduleDone: function () { - sys.puts('
    '); - }, - done: function (assertions) { - var end = new Date().getTime(); - var duration = end - start; - if (assertions.failures()) { - sys.puts( - '

    FAILURES: ' + assertions.failures() + - '/' + assertions.length + ' assertions failed (' + - assertions.duration + 'ms)

    ' - ); - } - else { - sys.puts( - '

    OK: ' + assertions.length + - ' assertions (' + assertions.duration + 'ms)

    ' - ); - } - sys.puts(''); - // should be able to flush stdout here, but doesn't seem to work, - // instead delay the exit to give enough to time flush. - setTimeout(function () { - process.reallyExit(assertions.failures()); - }, 10); - } - }); - -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/index.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/index.js deleted file mode 100644 index bbaf800..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/index.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - 'junit': require('./junit'), - 'default': require('./default'), - 'skip_passed': require('./skip_passed'), - 'minimal': require('./minimal'), - 'html': require('./html') - // browser test reporter is not listed because it cannot be used - // with the command line tool, only inside a browser. -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/junit.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/junit.js deleted file mode 100644 index bc1e1ec..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/junit.js +++ /dev/null @@ -1,183 +0,0 @@ -/*! - * Nodeunit - * Copyright (c) 2010 Caolan McMahon - * MIT Licensed - */ - -/** - * Module dependencies - */ - -var nodeunit = require('../nodeunit'), - utils = require('../utils'), - fs = require('fs'), - sys = require('sys'), - path = require('path'), - async = require('../../deps/async'), - AssertionError = require('assert').AssertionError, - child_process = require('child_process'), - ejs = require('../../deps/ejs'); - - -/** - * Reporter info string - */ - -exports.info = "jUnit XML test reports"; - - -/** - * Ensures a directory exists using mkdir -p. - * - * @param {String} path - * @param {Function} callback - * @api private - */ - -var ensureDir = function (path, callback) { - var mkdir = child_process.spawn('mkdir', ['-p', path]); - mkdir.on('error', function (err) { - callback(err); - callback = function(){}; - }); - mkdir.on('exit', function (code) { - if (code === 0) callback(); - else callback(new Error('mkdir exited with code: ' + code)); - }); -}; - - -/** - * Returns absolute version of a path. Relative paths are interpreted - * relative to process.cwd() or the cwd parameter. Paths that are already - * absolute are returned unaltered. - * - * @param {String} p - * @param {String} cwd - * @return {String} - * @api public - */ - -var abspath = function (p, /*optional*/cwd) { - if (p[0] === '/') return p; - cwd = cwd || process.cwd(); - return path.normalize(path.join(cwd, p)); -}; - - -/** - * Run all tests within each module, reporting the results to the command-line, - * then writes out junit-compatible xml documents. - * - * @param {Array} files - * @api public - */ - -exports.run = function (files, opts, callback) { - if (!opts.output) { - console.error( - 'Error: No output directory defined.\n' + - '\tEither add an "output" property to your nodeunit.json config ' + - 'file, or\n\tuse the --output command line option.' - ); - return; - } - opts.output = abspath(opts.output); - var error = function (str) { - return opts.error_prefix + str + opts.error_suffix; - }; - var ok = function (str) { - return opts.ok_prefix + str + opts.ok_suffix; - }; - var bold = function (str) { - return opts.bold_prefix + str + opts.bold_suffix; - }; - - var start = new Date().getTime(); - var paths = files.map(function (p) { - return path.join(process.cwd(), p); - }); - - var modules = {} - var curModule; - - nodeunit.runFiles(paths, { - moduleStart: function (name) { - curModule = { - errorCount: 0, - failureCount: 0, - tests: 0, - testcases: [], - name: name - }; - modules[name] = curModule; - }, - testDone: function (name, assertions) { - var testcase = {name: name}; - for (var i=0; i [ \.\.\.] -. -.fi -. -.SH "DESCRIPTION" -Nodeunit is a simple unit testing tool based on the node\.js assert module\. -. -.IP "\(bu" 4 -Simple to use -. -.IP "\(bu" 4 -Just export the tests from a module -. -.IP "\(bu" 4 -Helps you avoid common pitfalls when testing asynchronous code -. -.IP "\(bu" 4 -Easy to add test cases with setUp and tearDown functions if you wish -. -.IP "\(bu" 4 -Allows the use of mocks and stubs -. -.IP "" 0 -. -.SH "OPTIONS" - \fB\-\-config FILE\fR: -. -.br - Load config options from a JSON file, allows the customisation - of color schemes for the default test reporter etc\. - See bin/nodeunit\.json for current available options\. -. -.P - \fB\-\-reporter FILE\fR: -. -.br - You can set the test reporter to a custom module or on of the modules - in nodeunit/lib/reporters, when omitted, the default test runner is used\. -. -.P - \fB\-\-list\-reporters\fR: -. -.br - List available build\-in reporters\. -. -.P - \fB\-h\fR, \fB\-\-help\fR: -. -.br - Display the help and exit\. -. -.P - \fB\-v\fR, \fB\-\-version\fR: -. -.br - Output version information and exit\. -. -.P - \fB\fR: - You can run nodeunit on specific files or on all \fI*\.js\fR files inside -. -.br - a directory\. -. -.SH "AUTHORS" -Written by Caolan McMahon and other nodeunit contributors\. -. -.br -Contributors list: \fIhttp://github\.com/caolan/nodeunit/contributors\fR\|\. -. -.SH "REPORTING BUGS" -Report nodeunit bugs to \fIhttp://github\.com/caolan/nodeunit/issues\fR\|\. -. -.SH "COPYRIGHT" -Copyright © 2010 Caolan McMahon\. -. -.br -Nodeunit has been released under the MIT license: -. -.br -\fIhttp://github\.com/caolan/nodeunit/raw/master/LICENSE\fR\|\. -. -.SH "SEE ALSO" -node(1) diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/nodelint.cfg b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/nodelint.cfg deleted file mode 100644 index 457a967..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/nodelint.cfg +++ /dev/null @@ -1,4 +0,0 @@ -var options = { - indent: 4, - onevar: false -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/package.json b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/package.json deleted file mode 100644 index 20cd2fa..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ "name": "nodeunit" -, "description": "Easy unit testing for node.js and the browser." -, "maintainers": - [ { "name": "Caolan McMahon" - , "web": "https://github.com/caolan" - } - ] -, "contributors" : - [ { "name": "Alex Gorbatchev" - , "web": "https://github.com/alexgorbatchev" - } - , { "name": "Alex Wolfe" - , "web": "https://github.com/alexkwolfe" - } - , { "name": "Carl Fürstenberg" - , "web": "https://github.com/azatoth" - } - , { "name": "Gerad Suyderhoud" - , "web": "https://github.com/gerad" - } - , { "name": "Kadir Pekel" - , "web": "https://github.com/coffeemate" - } - , { "name": "Oleg Efimov" - , "web": "https://github.com/Sannis" - } - , { "name": "Orlando Vazquez" - , "web": "https://github.com/orlandov" - } - , { "name": "Ryan Dahl" - , "web": "https://github.com/ry" - } - , { "name": "Sam Stephenson" - , "web": "https://github.com/sstephenson" - } - , { "name": "Thomas Mayfield" - , "web": "https://github.com/thegreatape" - } - ] -, "version": "0.5.0" -, "repository" : - { "type" : "git" - , "url" : "http://github.com/caolan/nodeunit.git" - } -, "bugs" : { "web" : "http://github.com/caolan/nodeunit/issues" } -, "licenses" : - [ { "type" : "MIT" - , "url" : "http://github.com/caolan/nodeunit/raw/master/LICENSE" - } - ] -, "directories" : { "lib": "./lib", "doc" : "./doc", "man" : "./man1" } -, "bin" : { "nodeunit" : "./bin/nodeunit" } -} diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/share/junit.xml.ejs b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/share/junit.xml.ejs deleted file mode 100644 index c1db5bb..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/share/junit.xml.ejs +++ /dev/null @@ -1,19 +0,0 @@ - -<% for (var i=0; i < suites.length; i++) { %> - <% var suite=suites[i]; %> - - <% for (var j=0; j < suite.testcases.length; j++) { %> - <% var testcase=suites[i].testcases[j]; %> - - <% if (testcase.failure) { %> - - <% if (testcase.failure.backtrace) { %><%= testcase.failure.backtrace %><% } %> - - <% } %> - - <% } %> - -<% } %> diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/share/license.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/share/license.js deleted file mode 100644 index f0f326f..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/share/license.js +++ /dev/null @@ -1,11 +0,0 @@ -/*! - * Nodeunit - * https://github.com/caolan/nodeunit - * Copyright (c) 2010 Caolan McMahon - * MIT Licensed - * - * json2.js - * http://www.JSON.org/json2.js - * Public Domain. - * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. - */ diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/share/nodeunit.css b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/share/nodeunit.css deleted file mode 100644 index 274434a..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/share/nodeunit.css +++ /dev/null @@ -1,70 +0,0 @@ -/*! - * Styles taken from qunit.css - */ - -h1#nodeunit-header, h1.nodeunit-header { - padding: 15px; - font-size: large; - background-color: #06b; - color: white; - font-family: 'trebuchet ms', verdana, arial; - margin: 0; -} - -h1#nodeunit-header a { - color: white; -} - -h2#nodeunit-banner { - height: 2em; - border-bottom: 1px solid white; - background-color: #eee; - margin: 0; - font-family: 'trebuchet ms', verdana, arial; -} -h2#nodeunit-banner.pass { - background-color: green; -} -h2#nodeunit-banner.fail { - background-color: red; -} - -h2#nodeunit-userAgent, h2.nodeunit-userAgent { - padding: 10px; - background-color: #eee; - color: black; - margin: 0; - font-size: small; - font-weight: normal; - font-family: 'trebuchet ms', verdana, arial; - font-size: 10pt; -} - -div#nodeunit-testrunner-toolbar { - background: #eee; - border-top: 1px solid black; - padding: 10px; - font-family: 'trebuchet ms', verdana, arial; - margin: 0; - font-size: 10pt; -} - -ol#nodeunit-tests { - font-family: 'trebuchet ms', verdana, arial; - font-size: 10pt; -} -ol#nodeunit-tests li strong { - cursor:pointer; -} -ol#nodeunit-tests .pass { - color: green; -} -ol#nodeunit-tests .fail { - color: red; -} - -p#nodeunit-testresult { - margin-left: 1em; - font-size: 10pt; - font-family: 'trebuchet ms', verdana, arial; -} diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/coffee/mock_coffee_module.coffee b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/coffee/mock_coffee_module.coffee deleted file mode 100644 index a1c069b..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/coffee/mock_coffee_module.coffee +++ /dev/null @@ -1,4 +0,0 @@ -j = 0 -j += i for i in [0..5] - -exports.name = "mock_coffee_#{j}" diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/dir/mock_module3.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/dir/mock_module3.js deleted file mode 100644 index 3021776..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/dir/mock_module3.js +++ /dev/null @@ -1 +0,0 @@ -exports.name = 'mock_module3'; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/dir/mock_module4.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/dir/mock_module4.js deleted file mode 100644 index 876f9ca..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/dir/mock_module4.js +++ /dev/null @@ -1 +0,0 @@ -exports.name = 'mock_module4'; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/mock_module1.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/mock_module1.js deleted file mode 100644 index 4c093ad..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/mock_module1.js +++ /dev/null @@ -1 +0,0 @@ -exports.name = 'mock_module1'; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/mock_module2.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/mock_module2.js deleted file mode 100644 index a63d012..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/mock_module2.js +++ /dev/null @@ -1 +0,0 @@ -exports.name = 'mock_module2'; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/raw_jscode1.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/raw_jscode1.js deleted file mode 100644 index 2ef7115..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/raw_jscode1.js +++ /dev/null @@ -1,3 +0,0 @@ -function hello_world(arg) { - return "_" + arg + "_"; -} diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/raw_jscode2.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/raw_jscode2.js deleted file mode 100644 index 55a764e..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/raw_jscode2.js +++ /dev/null @@ -1,3 +0,0 @@ -function get_a_variable() { - return typeof a_variable; -} diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/raw_jscode3.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/raw_jscode3.js deleted file mode 100644 index 1fd1e78..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/fixtures/raw_jscode3.js +++ /dev/null @@ -1 +0,0 @@ -var t=t?t+1:1; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-base.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-base.js deleted file mode 100644 index 64b8c8b..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-base.js +++ /dev/null @@ -1,219 +0,0 @@ -/* - * This module is not a plain nodeunit test suite, but instead uses the - * assert module to ensure a basic level of functionality is present, - * allowing the rest of the tests to be written using nodeunit itself. - * - * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS! - * You can use @REMOVE_LINE_FOR_BROWSER to remove code from the browser build. - * Only code on that line will be removed, its mostly to avoid requiring code - * that is node specific - */ - -var assert = require('assert'), // @REMOVE_LINE_FOR_BROWSER - async = require('../deps/async'), // @REMOVE_LINE_FOR_BROWSER - nodeunit = require('../lib/nodeunit'); // @REMOVE_LINE_FOR_BROWSER - - -// NOT A TEST - util function to make testing faster. -// retries the assertion until it passes or the timeout is reached, -// at which point it throws the assertion error -var waitFor = function (fn, timeout, callback, start) { - start = start || new Date().getTime(); - callback = callback || function () {}; - try { - fn(); - callback(); - } - catch (e) { - if (e instanceof assert.AssertionError) { - var now = new Date().getTime(); - if (now - start >= timeout) { - throw e; - } - else { - async.nextTick(function () { - waitFor(fn, timeout, callback, start); - }); - } - } - else { - throw e; - } - } -}; - - -// TESTS: - -// Are exported tests actually run? - store completed tests in this variable -// for checking later -var tests_called = {}; - -// most basic test that should run, the tests_called object is tested -// at the end of this module to ensure the tests were actually run by nodeunit -exports.testCalled = function (test) { - tests_called.testCalled = true; - test.done(); -}; - -// generates test functions for nodeunit assertions -var makeTest = function (method, args_pass, args_fail) { - return function (test) { - var test1_called = false; - var test2_called = false; - - // test pass - nodeunit.runTest( - 'testname', - function (test) { - test[method].apply(test, args_pass); - test.done(); - }, - {testDone: function (name, assertions) { - assert.equal(assertions.length, 1); - assert.equal(assertions.failures(), 0); - }}, - function () { - test1_called = true; - } - ); - - // test failure - nodeunit.runTest( - 'testname', - function (test) { - test[method].apply(test, args_fail); - test.done(); - }, - {testDone: function (name, assertions) { - assert.equal(assertions.length, 1); - assert.equal(assertions.failures(), 1); - }}, - function () { - test2_called = true; - } - ); - - // ensure tests were run - waitFor(function () { - assert.ok(test1_called); - assert.ok(test2_called); - tests_called[method] = true; - }, 500, test.done); - }; -}; - -// ensure basic assertions are working: -exports.testOk = makeTest('ok', [true], [false]); -exports.testEquals = makeTest('equals', [1, 1], [1, 2]); -exports.testSame = makeTest('same', - [{test: 'test'}, {test: 'test'}], - [{test: 'test'}, {monkey: 'penguin'}] -); - -// from the assert module: -exports.testEqual = makeTest('equal', [1, 1], [1, 2]); -exports.testNotEqual = makeTest('notEqual', [1, 2], [1, 1]); -exports.testDeepEqual = makeTest('deepEqual', - [{one: 1}, {one: 1}], [{one: 1}, {two: 2}] -); -exports.testNotDeepEqual = makeTest('notDeepEqual', - [{one: 1}, {two: 2}], [{one: 1}, {one: 1}] -); -exports.testStrictEqual = makeTest('strictEqual', [1, 1], [1, true]); -exports.testNotStrictEqual = makeTest('notStrictEqual', [true, 1], [1, 1]); -exports.testThrows = makeTest('throws', - [function () { - throw new Error('test'); - }], - [function () { - return; - }] -); -exports.testDoesNotThrows = makeTest('doesNotThrow', - [function () { - return; - }], - [function () { - throw new Error('test'); - }] -); -exports.testIfError = makeTest('ifError', [false], [new Error('test')]); - - -exports.testExpect = function (test) { - var test1_called = false, - test2_called = false, - test3_called = false; - - // correct number of tests run - nodeunit.runTest( - 'testname', - function (test) { - test.expect(2); - test.ok(true); - test.ok(true); - test.done(); - }, - {testDone: function (name, assertions) { - test.equals(assertions.length, 2); - test.equals(assertions.failures(), 0); - }}, - function () { - test1_called = true; - } - ); - - // no tests run - nodeunit.runTest( - 'testname', - function (test) { - test.expect(2); - test.done(); - }, - {testDone: function (name, assertions) { - test.equals(assertions.length, 1); - test.equals(assertions.failures(), 1); - }}, - function () { - test2_called = true; - } - ); - - // incorrect number of tests run - nodeunit.runTest( - 'testname', - function (test) { - test.expect(2); - test.ok(true); - test.ok(true); - test.ok(true); - test.done(); - }, - {testDone: function (name, assertions) { - test.equals(assertions.length, 4); - test.equals(assertions.failures(), 1); - }}, - function () { - test3_called = true; - } - ); - - // ensure callbacks fired - waitFor(function () { - assert.ok(test1_called); - assert.ok(test2_called); - assert.ok(test3_called); - tests_called.expect = true; - }, 500, test.done); -}; - - -// tests are async, so wait for them to be called -waitFor(function () { - assert.ok(tests_called.testCalled); - assert.ok(tests_called.ok); - assert.ok(tests_called.equals); - assert.ok(tests_called.same); - assert.ok(tests_called.expect); -}, 10000); diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-failing-callbacks.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-failing-callbacks.js deleted file mode 100644 index 08f7eb5..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-failing-callbacks.js +++ /dev/null @@ -1,114 +0,0 @@ -var nodeunit = require('../lib/nodeunit'); - - -exports.testFailingLog = function (test) { - test.expect(3); - - // this is meant to bubble to the top, and will be ignored for the purposes - // of testing: - var ignored_error = new Error('ignore this callback error'); - var err_handler = function (err) { - if (err && err.message !== ignored_error.message) { - throw err; - } - }; - process.addListener('uncaughtException', err_handler); - - // A failing callback should not affect the test outcome - var testfn = function (test) { - test.ok(true, 'test.ok'); - test.done(); - }; - nodeunit.runTest('testname', testfn, { - log: function (assertion) { - test.ok(true, 'log called'); - throw ignored_error; - }, - testDone: function (name, assertions) { - test.equals(assertions.failures(), 0, 'failures'); - test.equals(assertions.length, 1, 'total'); - process.removeListener('uncaughtException', err_handler); - } - }, test.done); -}; - -exports.testFailingTestDone = function (test) { - test.expect(2); - - var ignored_error = new Error('ignore this callback error'); - var err_handler = function (err) { - if (err && err.message !== ignored_error.message) { - throw err; - } - }; - process.addListener('uncaughtException', err_handler); - - // A failing callback should not affect the test outcome - var testfn = function (test) { - test.done(); - }; - nodeunit.runTest('testname', testfn, { - log: function (assertion) { - test.ok(false, 'log should not be called'); - }, - testDone: function (name, assertions) { - test.equals(assertions.failures(), 0, 'failures'); - test.equals(assertions.length, 0, 'total'); - process.nextTick(function () { - process.removeListener('uncaughtException', err_handler); - test.done(); - }); - throw ignored_error; - } - }, function () {}); -}; - -exports.testAssertionObj = function (test) { - test.expect(4); - var testfn = function (test) { - test.ok(true, 'ok true'); - test.done(); - }; - nodeunit.runTest('testname', testfn, { - log: function (assertion) { - test.ok(assertion.passed() === true, 'assertion.passed'); - test.ok(assertion.failed() === false, 'assertion.failed'); - }, - testDone: function (name, assertions) { - test.equals(assertions.failures(), 0, 'failures'); - test.equals(assertions.length, 1, 'total'); - } - }, test.done); -}; - -exports.testLogOptional = function (test) { - test.expect(2); - var testfn = function (test) { - test.ok(true, 'ok true'); - test.done(); - }; - nodeunit.runTest('testname', testfn, { - testDone: function (name, assertions) { - test.equals(assertions.failures(), 0, 'failures'); - test.equals(assertions.length, 1, 'total'); - } - }, test.done); -}; - -exports.testExpectWithFailure = function (test) { - test.expect(3); - var testfn = function (test) { - test.expect(1); - test.ok(false, 'test.ok'); - test.done(); - }; - nodeunit.runTest('testname', testfn, { - log: function (assertion) { - test.equals(assertion.method, 'ok', 'assertion.method'); - }, - testDone: function (name, assertions) { - test.equals(assertions.failures(), 1, 'failures'); - test.equals(assertions.length, 1, 'total'); - } - }, test.done); -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-httputil.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-httputil.js deleted file mode 100644 index e5ee25c..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-httputil.js +++ /dev/null @@ -1,55 +0,0 @@ -var nodeunit = require('../lib/nodeunit'); -var httputil = require('../lib/utils').httputil; - -exports.testHttpUtilBasics = function (test) { - - test.expect(6); - - httputil(function (req, resp) { - test.equal(req.method, 'PUT'); - test.equal(req.url, '/newpair'); - test.equal(req.headers.foo, 'bar'); - - resp.writeHead(500, {'content-type': 'text/plain'}); - resp.end('failed'); - }, function (server, client) { - client.fetch('PUT', '/newpair', {'foo': 'bar'}, function (resp) { - test.equal(resp.statusCode, 500); - test.equal(resp.headers['content-type'], 'text/plain'); - test.equal(resp.body, 'failed'); - - server.close(); - test.done(); - }); - }); -}; - -exports.testHttpUtilJsonHandling = function (test) { - - test.expect(9); - - httputil(function (req, resp) { - test.equal(req.method, 'GET'); - test.equal(req.url, '/'); - test.equal(req.headers.foo, 'bar'); - - var testdata = {foo1: 'bar', foo2: 'baz'}; - - resp.writeHead(200, {'content-type': 'application/json'}); - resp.end(JSON.stringify(testdata)); - - }, function (server, client) { - client.fetch('GET', '/', {'foo': 'bar'}, function (resp) { - test.equal(resp.statusCode, 200); - test.equal(resp.headers['content-type'], 'application/json'); - - test.ok(resp.bodyAsObject); - test.equal(typeof resp.bodyAsObject, 'object'); - test.equal(resp.bodyAsObject.foo1, 'bar'); - test.equal(resp.bodyAsObject.foo2, 'baz'); - - server.close(); - test.done(); - }); - }); -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-runfiles.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-runfiles.js deleted file mode 100644 index b9ef754..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-runfiles.js +++ /dev/null @@ -1,214 +0,0 @@ -var assert = require('assert'), - sys = require('sys'), - fs = require('fs'), - path = require('path'), - nodeunit = require('../lib/nodeunit'); - - -var setup = function (fn) { - return function (test) { - process.chdir(__dirname); - require.paths.push(__dirname); - var env = { - mock_module1: require('./fixtures/mock_module1'), - mock_module2: require('./fixtures/mock_module2'), - mock_module3: require('./fixtures/dir/mock_module3'), - mock_module4: require('./fixtures/dir/mock_module4') - }; - fn.call(env, test); - }; -}; - - -exports.testRunFiles = setup(function (test) { - test.expect(24); - var runModule_copy = nodeunit.runModule; - - var runModule_calls = []; - var modules = []; - - var opts = { - moduleStart: function () { - return 'moduleStart'; - }, - testDone: function () { - return 'testDone'; - }, - testStart: function () { - return 'testStart'; - }, - log: function () { - return 'log'; - }, - done: function (assertions) { - test.equals(assertions.failures(), 0, 'failures'); - test.equals(assertions.length, 4, 'length'); - test.ok(typeof assertions.duration === "number"); - - var called_with = function (name) { - return runModule_calls.some(function (m) { - return m.name === name; - }); - }; - test.ok(called_with('mock_module1'), 'mock_module1 ran'); - test.ok(called_with('mock_module2'), 'mock_module2 ran'); - test.ok(called_with('mock_module3'), 'mock_module3 ran'); - test.ok(called_with('mock_module4'), 'mock_module4 ran'); - test.equals(runModule_calls.length, 4); - - nodeunit.runModule = runModule_copy; - test.done(); - } - }; - - nodeunit.runModule = function (name, mod, options, callback) { - test.equals(options.testDone, opts.testDone); - test.equals(options.testStart, opts.testStart); - test.equals(options.log, opts.log); - test.ok(typeof name === "string"); - runModule_calls.push(mod); - var m = [{failed: function () { - return false; - }}]; - modules.push(m); - callback(null, m); - }; - - nodeunit.runFiles( - ['fixtures/mock_module1.js', 'fixtures/mock_module2.js', 'fixtures/dir'], - opts - ); -}); - -exports.testRunFilesEmpty = function (test) { - test.expect(3); - nodeunit.runFiles([], { - moduleStart: function () { - test.ok(false, 'should not be called'); - }, - testDone: function () { - test.ok(false, 'should not be called'); - }, - testStart: function () { - test.ok(false, 'should not be called'); - }, - log: function () { - test.ok(false, 'should not be called'); - }, - done: function (assertions) { - test.equals(assertions.failures(), 0, 'failures'); - test.equals(assertions.length, 0, 'length'); - test.ok(typeof assertions.duration === "number"); - test.done(); - } - }); -}; - - -exports.testEmptyDir = function (test) { - var dir2 = __dirname + '/fixtures/dir2'; - - // git doesn't like empty directories, so we have to create one - path.exists(dir2, function (exists) { - if (!exists) { - fs.mkdirSync(dir2, 0777); - } - - // runFiles on empty directory: - nodeunit.runFiles([dir2], { - moduleStart: function () { - test.ok(false, 'should not be called'); - }, - testDone: function () { - test.ok(false, 'should not be called'); - }, - testStart: function () { - test.ok(false, 'should not be called'); - }, - log: function () { - test.ok(false, 'should not be called'); - }, - done: function (assertions) { - test.equals(assertions.failures(), 0, 'failures'); - test.equals(assertions.length, 0, 'length'); - test.ok(typeof assertions.duration === "number"); - test.done(); - } - }); - }); -}; - - -var CoffeeScript; -try { - CoffeeScript = require('coffee-script'); -} catch (e) { -} - -if (CoffeeScript) { - exports.testCoffeeScript = function (test) { - process.chdir(__dirname); - require.paths.push(__dirname); - var env = { - mock_coffee_module: require('./fixtures/coffee/mock_coffee_module') - }; - - test.expect(9); - var runModule_copy = nodeunit.runModule; - - var runModule_calls = []; - var modules = []; - - var opts = { - moduleStart: function () { - return 'moduleStart'; - }, - testDone: function () { - return 'testDone'; - }, - testStart: function () { - return 'testStart'; - }, - log: function () { - return 'log'; - }, - done: function (assertions) { - test.equals(assertions.failures(), 0, 'failures'); - test.equals(assertions.length, 1, 'length'); - test.ok(typeof assertions.duration === "number"); - - var called_with = function (name) { - return runModule_calls.some(function (m) { - return m.name === name; - }); - }; - test.ok( - called_with('mock_coffee_15'), - 'mock_coffee_module ran' - ); - test.equals(runModule_calls.length, 1); - - nodeunit.runModule = runModule_copy; - test.done(); - } - }; - - nodeunit.runModule = function (name, mod, options, callback) { - test.equals(options.testDone, opts.testDone); - test.equals(options.testStart, opts.testStart); - test.equals(options.log, opts.log); - test.ok(typeof name === "string"); - runModule_calls.push(mod); - var m = [{failed: function () { - return false; - }}]; - modules.push(m); - callback(null, m); - }; - - nodeunit.runFiles( - ['fixtures/coffee/mock_coffee_module.coffee'], - opts - ); - }; -} diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-runmodule.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-runmodule.js deleted file mode 100644 index 218e8db..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-runmodule.js +++ /dev/null @@ -1,125 +0,0 @@ -/* THIS FILE SHOULD BE BROWSER-COMPATIBLE JS! - * You can use @REMOVE_LINE_FOR_BROWSER to remove code from the browser build. - * Only code on that line will be removed, its mostly to avoid requiring code - * that is node specific - */ - -var nodeunit = require('../lib/nodeunit'); // @REMOVE_LINE_FOR_BROWSER - - -exports.testRunModule = function (test) { - test.expect(11); - var call_order = []; - var testmodule = { - test1: function (test) { - call_order.push('test1'); - test.ok(true, 'ok true'); - test.done(); - }, - test2: function (test) { - call_order.push('test2'); - test.ok(false, 'ok false'); - test.ok(false, 'ok false'); - test.done(); - }, - test3: function (test) { - call_order.push('test3'); - test.done(); - } - }; - nodeunit.runModule('testmodule', testmodule, { - log: function (assertion) { - call_order.push('log'); - }, - testStart: function (name) { - call_order.push('testStart'); - test.ok( - name.toString() === 'test1' || - name.toString() === 'test2' || - name.toString() === 'test3', - 'testStart called with test name ' - ); - }, - testDone: function (name, assertions) { - call_order.push('testDone'); - test.ok( - name.toString() === 'test1' || - name.toString() === 'test2' || - name.toString() === 'test3', - 'testDone called with test name' - ); - }, - moduleDone: function (name, assertions) { - call_order.push('moduleDone'); - test.equals(assertions.length, 3); - test.equals(assertions.failures(), 2); - test.equals(name, 'testmodule'); - test.ok(typeof assertions.duration === "number"); - test.same(call_order, [ - 'testStart', 'test1', 'log', 'testDone', - 'testStart', 'test2', 'log', 'log', 'testDone', - 'testStart', 'test3', 'testDone', - 'moduleDone' - ]); - } - }, test.done); -}; - -exports.testRunModuleEmpty = function (test) { - nodeunit.runModule('module with no exports', {}, { - log: function (assertion) { - test.ok(false, 'log should not be called'); - }, - testStart: function (name) { - test.ok(false, 'testStart should not be called'); - }, - testDone: function (name, assertions) { - test.ok(false, 'testDone should not be called'); - }, - moduleDone: function (name, assertions) { - test.equals(assertions.length, 0); - test.equals(assertions.failures(), 0); - test.equals(name, 'module with no exports'); - test.ok(typeof assertions.duration === "number"); - } - }, test.done); -}; - -exports.testNestedTests = function (test) { - var call_order = []; - var m = { - test1: function (test) { - test.done(); - }, - suite: { - t1: function (test) { - test.done(); - }, - t2: function (test) { - test.done(); - }, - another_suite: { - t3: function (test) { - test.done(); - } - } - } - }; - nodeunit.runModule('modulename', m, { - testStart: function (name) { - call_order.push(['testStart'].concat(name)); - }, - testDone: function (name, assertions) { - call_order.push(['testDone'].concat(name)); - } - }, function () { - test.same(call_order, [ - ['testStart', 'test1'], ['testDone', 'test1'], - ['testStart', 'suite', 't1'], ['testDone', 'suite', 't1'], - ['testStart', 'suite', 't2'], ['testDone', 'suite', 't2'], - ['testStart', 'suite', 'another_suite', 't3'], - ['testDone', 'suite', 'another_suite', 't3'] - ]); - test.done(); - }); -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-runtest.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-runtest.js deleted file mode 100644 index 8fc3d52..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-runtest.js +++ /dev/null @@ -1,46 +0,0 @@ -/* THIS FILE SHOULD BE BROWSER-COMPATIBLE JS! - * You can use @REMOVE_LINE_FOR_BROWSER to remove code from the browser build. - * Only code on that line will be removed, its mostly to avoid requiring code - * that is node specific - */ - -var nodeunit = require('../lib/nodeunit'); // @REMOVE_LINE_FOR_BROWSER - - -exports.testArgs = function (test) { - test.ok(test.expect instanceof Function, 'test.expect'); - test.ok(test.done instanceof Function, 'test.done'); - test.ok(test.ok instanceof Function, 'test.ok'); - test.ok(test.same instanceof Function, 'test.same'); - test.ok(test.equals instanceof Function, 'test.equals'); - test.done(); -}; - -exports.testDoneCallback = function (test) { - test.expect(4); - nodeunit.runTest('testname', exports.testArgs, { - testDone: function (name, assertions) { - test.equals(assertions.failures(), 0, 'failures'); - test.equals(assertions.length, 5, 'length'); - test.ok(typeof assertions.duration === "number"); - test.equals(name, 'testname'); - } - }, test.done); -}; - -exports.testThrowError = function (test) { - test.expect(3); - var err = new Error('test'); - var testfn = function (test) { - throw err; - }; - nodeunit.runTest('testname', testfn, { - log: function (assertion) { - test.same(assertion.error, err, 'assertion.error'); - }, - testDone: function (name, assertions) { - test.equals(assertions.failures(), 1); - test.equals(assertions.length, 1); - } - }, test.done); -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-sandbox.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-sandbox.js deleted file mode 100644 index 1b249d7..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-sandbox.js +++ /dev/null @@ -1,31 +0,0 @@ -var nodeunit = require('../lib/nodeunit'); -var sandbox = require('../lib/utils').sandbox; -var testCase = nodeunit.testCase; - -exports.testSimpleSandbox = function (test) { - var raw_jscode1 = sandbox(__dirname + '/fixtures/raw_jscode1.js'); - test.equal(raw_jscode1.hello_world('foo'), '_foo_', 'evaluation ok'); - test.done(); -}; - -exports.testSandboxContext = function (test) { - var a_variable = 42; // should not be visible in the sandbox - var raw_jscode2 = sandbox(__dirname + '/fixtures/raw_jscode2.js'); - a_variable = 42; // again for the win - test.equal( - raw_jscode2.get_a_variable(), - 'undefined', - 'the variable should not be defined' - ); - test.done(); -}; - -exports.testSandboxMultiple = function (test) { - var raw_jscode3 = sandbox([ - __dirname + '/fixtures/raw_jscode3.js', - __dirname + '/fixtures/raw_jscode3.js', - __dirname + '/fixtures/raw_jscode3.js' - ]); - test.equal(raw_jscode3.t, 3, 'two files loaded'); - test.done(); -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-testcase.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-testcase.js deleted file mode 100644 index a3ea331..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test-testcase.js +++ /dev/null @@ -1,234 +0,0 @@ -/* THIS FILE SHOULD BE BROWSER-COMPATIBLE JS! - * You can use @REMOVE_LINE_FOR_BROWSER to remove code from the browser build. - * Only code on that line will be removed, its mostly to avoid requiring code - * that is node specific - */ - -var nodeunit = require('../lib/nodeunit'); // @REMOVE_LINE_FOR_BROWSER -var testCase = nodeunit.testCase; - -exports.testTestCase = function (test) { - test.expect(7); - var call_order = []; - var s = testCase({ - setUp: function (callback) { - call_order.push('setUp'); - test.equals(this.one, undefined); - this.one = 1; - callback(); - }, - tearDown: function (callback) { - call_order.push('tearDown'); - test.ok(true, 'tearDown called'); - callback(); - }, - test1: function (t) { - call_order.push('test1'); - test.equals(this.one, 1); - this.one = 2; - t.done(); - }, - test2: function (t) { - call_order.push('test2'); - test.equals(this.one, 1); - t.done(); - } - }); - nodeunit.runSuite(null, s, {}, function () { - test.same(call_order, [ - 'setUp', 'test1', 'tearDown', - 'setUp', 'test2', 'tearDown' - ]); - test.done(); - }); -}; - -exports.tearDownAfterError = function (test) { - test.expect(1); - var s = testCase({ - tearDown: function (callback) { - test.ok(true, 'tearDown called'); - callback(); - }, - test: function (t) { - throw new Error('some error'); - } - }); - nodeunit.runSuite(null, s, {}, function () { - test.done(); - }); -}; - -exports.catchSetUpError = function (test) { - test.expect(2); - var test_error = new Error('test error'); - var s = testCase({ - setUp: function (callback) { - throw test_error; - }, - test: function (t) { - test.ok(false, 'test function should not be called'); - t.done(); - } - }); - nodeunit.runSuite(null, s, {}, function (err, assertions) { - test.equal(assertions.length, 1); - test.equal(assertions[0].error, test_error); - test.done(); - }); -}; - -exports.setUpErrorCallback = function (test) { - test.expect(2); - var test_error = new Error('test error'); - var s = testCase({ - setUp: function (callback) { - callback(test_error); - }, - test: function (t) { - test.ok(false, 'test function should not be called'); - t.done(); - } - }); - nodeunit.runSuite(null, s, {}, function (err, assertions) { - test.equal(assertions.length, 1); - test.equal(assertions[0].error, test_error); - test.done(); - }); -}; - -exports.catchTearDownError = function (test) { - test.expect(2); - var test_error = new Error('test error'); - var s = testCase({ - tearDown: function (callback) { - throw test_error; - }, - test: function (t) { - t.done(); - } - }); - nodeunit.runSuite(null, s, {}, function (err, assertions) { - test.equal(assertions.length, 1); - test.equal(assertions[0].error, test_error); - test.done(); - }); -}; - -exports.tearDownErrorCallback = function (test) { - test.expect(2); - var test_error = new Error('test error'); - var s = testCase({ - tearDown: function (callback) { - callback(test_error); - }, - test: function (t) { - t.done(); - } - }); - nodeunit.runSuite(null, s, {}, function (err, assertions) { - test.equal(assertions.length, 1); - test.equal(assertions[0].error, test_error); - test.done(); - }); -}; - -exports.testErrorAndtearDownError = function (test) { - test.expect(3); - var error1 = new Error('test error one'); - var error2 = new Error('test error two'); - var s = testCase({ - tearDown: function (callback) { - callback(error2); - }, - test: function (t) { - t.done(error1); - } - }); - nodeunit.runSuite(null, s, {}, function (err, assertions) { - test.equal(assertions.length, 2); - test.equal(assertions[0].error, error1); - test.equal(assertions[1].error, error2); - test.done(); - }); -}; - -exports.testCaseGroups = function (test) { - var call_order = []; - var s = testCase({ - setUp: function (callback) { - call_order.push('setUp'); - callback(); - }, - tearDown: function (callback) { - call_order.push('tearDown'); - callback(); - }, - test1: function (test) { - call_order.push('test1'); - test.done(); - }, - group1: { - test2: function (test) { - call_order.push('group1.test2'); - test.done(); - } - } - }); - nodeunit.runSuite(null, s, {}, function (err, assertions) { - test.same(call_order, [ - 'setUp', - 'test1', - 'tearDown', - 'setUp', - 'group1.test2', - 'tearDown' - ]); - test.done(); - }); -}; - -exports.nestedTestCases = function (test) { - var call_order = []; - var s = testCase({ - setUp: function (callback) { - call_order.push('setUp'); - callback(); - }, - tearDown: function (callback) { - call_order.push('tearDown'); - callback(); - }, - test1: function (test) { - call_order.push('test1'); - test.done(); - }, - group1: testCase({ - setUp: function (callback) { - call_order.push('group1.setUp'); - callback(); - }, - tearDown: function (callback) { - call_order.push('group1.tearDown'); - callback(); - }, - test2: function (test) { - call_order.push('group1.test2'); - test.done(); - } - }) - }); - nodeunit.runSuite(null, s, {}, function (err, assertions) { - test.same(call_order, [ - 'setUp', - 'test1', - 'tearDown', - 'setUp', - 'group1.setUp', - 'group1.test2', - 'group1.tearDown', - 'tearDown' - ]); - test.done(); - }); -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test.html b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test.html deleted file mode 100644 index 31bda30..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/test/test.html +++ /dev/null @@ -1,26 +0,0 @@ - - - Nodeunit Test Suite - - - - - - - - - -

    Nodeunit Test Suite

    - - - diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore b/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore deleted file mode 100644 index 4fbabb3..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -/test/tmp/ -*.upload -*.un~ -*.http diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml b/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/Makefile b/node_modules/express/node_modules/connect/node_modules/formidable/Makefile deleted file mode 100644 index 8945872..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -SHELL := /bin/bash - -test: - @./test/run.js - -build: npm test - -npm: - npm install . - -clean: - rm test/tmp/* - -.PHONY: test clean build diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md b/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md deleted file mode 100644 index cfa2462..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md +++ /dev/null @@ -1,303 +0,0 @@ -# Formidable - -[![Build Status](https://secure.travis-ci.org/felixge/node-formidable.png?branch=master)](http://travis-ci.org/felixge/node-formidable) - -## Purpose - -A node.js module for parsing form data, especially file uploads. - -## Current status - -This module was developed for [Transloadit](http://transloadit.com/), a service focused on uploading -and encoding images and videos. It has been battle-tested against hundreds of GB of file uploads from -a large variety of clients and is considered production-ready. - -## Features - -* Fast (~500mb/sec), non-buffering multipart parser -* Automatically writing file uploads to disk -* Low memory footprint -* Graceful error handling -* Very high test coverage - -## Changelog - -### v1.0.9 - -* Emit progress when content length header parsed (Tim Koschützki) -* Fix Readme syntax due to GitHub changes (goob) -* Replace references to old 'sys' module in Readme with 'util' (Peter Sugihara) - -### v1.0.8 - -* Strip potentially unsafe characters when using `keepExtensions: true`. -* Switch to utest / urun for testing -* Add travis build - -### v1.0.7 - -* Remove file from package that was causing problems when installing on windows. (#102) -* Fix typos in Readme (Jason Davies). - -### v1.0.6 - -* Do not default to the default to the field name for file uploads where - filename="". - -### v1.0.5 - -* Support filename="" in multipart parts -* Explain unexpected end() errors in parser better - -**Note:** Starting with this version, formidable emits 'file' events for empty -file input fields. Previously those were incorrectly emitted as regular file -input fields with value = "". - -### v1.0.4 - -* Detect a good default tmp directory regardless of platform. (#88) - -### v1.0.3 - -* Fix problems with utf8 characters (#84) / semicolons in filenames (#58) -* Small performance improvements -* New test suite and fixture system - -### v1.0.2 - -* Exclude node\_modules folder from git -* Implement new `'aborted'` event -* Fix files in example folder to work with recent node versions -* Make gently a devDependency - -[See Commits](https://github.com/felixge/node-formidable/compare/v1.0.1...v1.0.2) - -### v1.0.1 - -* Fix package.json to refer to proper main directory. (#68, Dean Landolt) - -[See Commits](https://github.com/felixge/node-formidable/compare/v1.0.0...v1.0.1) - -### v1.0.0 - -* Add support for multipart boundaries that are quoted strings. (Jeff Craig) - -This marks the beginning of development on version 2.0 which will include -several architectural improvements. - -[See Commits](https://github.com/felixge/node-formidable/compare/v0.9.11...v1.0.0) - -### v0.9.11 - -* Emit `'progress'` event when receiving data, regardless of parsing it. (Tim Koschützki) -* Use [W3C FileAPI Draft](http://dev.w3.org/2006/webapi/FileAPI/) properties for File class - -**Important:** The old property names of the File class will be removed in a -future release. - -[See Commits](https://github.com/felixge/node-formidable/compare/v0.9.10...v0.9.11) - -### Older releases - -These releases were done before starting to maintain the above Changelog: - -* [v0.9.10](https://github.com/felixge/node-formidable/compare/v0.9.9...v0.9.10) -* [v0.9.9](https://github.com/felixge/node-formidable/compare/v0.9.8...v0.9.9) -* [v0.9.8](https://github.com/felixge/node-formidable/compare/v0.9.7...v0.9.8) -* [v0.9.7](https://github.com/felixge/node-formidable/compare/v0.9.6...v0.9.7) -* [v0.9.6](https://github.com/felixge/node-formidable/compare/v0.9.5...v0.9.6) -* [v0.9.5](https://github.com/felixge/node-formidable/compare/v0.9.4...v0.9.5) -* [v0.9.4](https://github.com/felixge/node-formidable/compare/v0.9.3...v0.9.4) -* [v0.9.3](https://github.com/felixge/node-formidable/compare/v0.9.2...v0.9.3) -* [v0.9.2](https://github.com/felixge/node-formidable/compare/v0.9.1...v0.9.2) -* [v0.9.1](https://github.com/felixge/node-formidable/compare/v0.9.0...v0.9.1) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0) -* [v0.1.0](https://github.com/felixge/node-formidable/commits/v0.1.0) - -## Installation - -Via [npm](http://github.com/isaacs/npm): - - npm install formidable@latest - -Manually: - - git clone git://github.com/felixge/node-formidable.git formidable - vim my.js - # var formidable = require('./formidable'); - -Note: Formidable requires [gently](http://github.com/felixge/node-gently) to run the unit tests, but you won't need it for just using the library. - -## Example - -Parse an incoming file upload. - - var formidable = require('formidable'), - http = require('http'), - - util = require('util'); - - http.createServer(function(req, res) { - if (req.url == '/upload' && req.method.toLowerCase() == 'post') { - // parse a file upload - var form = new formidable.IncomingForm(); - form.parse(req, function(err, fields, files) { - res.writeHead(200, {'content-type': 'text/plain'}); - res.write('received upload:\n\n'); - res.end(util.inspect({fields: fields, files: files})); - }); - return; - } - - // show a file upload form - res.writeHead(200, {'content-type': 'text/html'}); - res.end( - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    ' - ); - }).listen(80); - -## API - -### formidable.IncomingForm - -__new formidable.IncomingForm()__ - -Creates a new incoming form. - -__incomingForm.encoding = 'utf-8'__ - -The encoding to use for incoming form fields. - -__incomingForm.uploadDir = process.env.TMP || '/tmp' || process.cwd()__ - -The directory for placing file uploads in. You can move them later on using -`fs.rename()`. The default directory is picked at module load time depending on -the first existing directory from those listed above. - -__incomingForm.keepExtensions = false__ - -If you want the files written to `incomingForm.uploadDir` to include the extensions of the original files, set this property to `true`. - -__incomingForm.type__ - -Either 'multipart' or 'urlencoded' depending on the incoming request. - -__incomingForm.maxFieldsSize = 2 * 1024 * 1024__ - -Limits the amount of memory a field (not file) can allocate in bytes. -If this value is exceeded, an `'error'` event is emitted. The default -size is 2MB. - -__incomingForm.bytesReceived__ - -The amount of bytes received for this form so far. - -__incomingForm.bytesExpected__ - -The expected number of bytes in this form. - -__incomingForm.parse(request, [cb])__ - -Parses an incoming node.js `request` containing form data. If `cb` is provided, all fields an files are collected and passed to the callback: - - incomingForm.parse(req, function(err, fields, files) { - // ... - }); - -__incomingForm.onPart(part)__ - -You may overwrite this method if you are interested in directly accessing the multipart stream. Doing so will disable any `'field'` / `'file'` events processing which would occur otherwise, making you fully responsible for handling the processing. - - incomingForm.onPart = function(part) { - part.addListener('data', function() { - // ... - }); - } - -If you want to use formidable to only handle certain parts for you, you can do so: - - incomingForm.onPart = function(part) { - if (!part.filename) { - // let formidable handle all non-file parts - incomingForm.handlePart(part); - } - } - -Check the code in this method for further inspiration. - -__Event: 'progress' (bytesReceived, bytesExpected)__ - -Emitted after each incoming chunk of data that has been parsed. Can be used to roll your own progress bar. - -__Event: 'field' (name, value)__ - -Emitted whenever a field / value pair has been received. - -__Event: 'fileBegin' (name, file)__ - -Emitted whenever a new file is detected in the upload stream. Use this even if -you want to stream the file to somewhere else while buffering the upload on -the file system. - -__Event: 'file' (name, file)__ - -Emitted whenever a field / file pair has been received. `file` is an instance of `File`. - -__Event: 'error' (err)__ - -Emitted when there is an error processing the incoming form. A request that experiences an error is automatically paused, you will have to manually call `request.resume()` if you want the request to continue firing `'data'` events. - -__Event: 'aborted'__ - -Emitted when the request was aborted by the user. Right now this can be due to a 'timeout' or 'close' event on the socket. In the future there will be a separate 'timeout' event (needs a change in the node core). - -__Event: 'end' ()__ - -Emitted when the entire request has been received, and all contained files have finished flushing to disk. This is a great place for you to send your response. - -### formidable.File - -__file.size = 0__ - -The size of the uploaded file in bytes. If the file is still being uploaded (see `'fileBegin'` event), this property says how many bytes of the file have been written to disk yet. - -__file.path = null__ - -The path this file is being written to. You can modify this in the `'fileBegin'` event in -case you are unhappy with the way formidable generates a temporary path for your files. - -__file.name = null__ - -The name this file had according to the uploading client. - -__file.type = null__ - -The mime type of this file, according to the uploading client. - -__file.lastModifiedDate = null__ - -A date object (or `null`) containing the time this file was last written to. Mostly -here for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/). - -## License - -Formidable is licensed under the MIT license. - -## Ports - -* [multipart-parser](http://github.com/FooBarWidget/multipart-parser): a C++ parser based on formidable - -## Credits - -* [Ryan Dahl](http://twitter.com/ryah) for his work on [http-parser](http://github.com/ry/http-parser) which heavily inspired multipart_parser.js diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/TODO b/node_modules/express/node_modules/connect/node_modules/formidable/TODO deleted file mode 100644 index e1107f2..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/TODO +++ /dev/null @@ -1,3 +0,0 @@ -- Better bufferMaxSize handling approach -- Add tests for JSON parser pull request and merge it -- Implement QuerystringParser the same way as MultipartParser diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js b/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js deleted file mode 100644 index bff41f1..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js +++ /dev/null @@ -1,70 +0,0 @@ -require('../test/common'); -var multipartParser = require('../lib/multipart_parser'), - MultipartParser = multipartParser.MultipartParser, - parser = new MultipartParser(), - Buffer = require('buffer').Buffer, - boundary = '-----------------------------168072824752491622650073', - mb = 100, - buffer = createMultipartBuffer(boundary, mb * 1024 * 1024), - callbacks = - { partBegin: -1, - partEnd: -1, - headerField: -1, - headerValue: -1, - partData: -1, - end: -1, - }; - - -parser.initWithBoundary(boundary); -parser.onHeaderField = function() { - callbacks.headerField++; -}; - -parser.onHeaderValue = function() { - callbacks.headerValue++; -}; - -parser.onPartBegin = function() { - callbacks.partBegin++; -}; - -parser.onPartData = function() { - callbacks.partData++; -}; - -parser.onPartEnd = function() { - callbacks.partEnd++; -}; - -parser.onEnd = function() { - callbacks.end++; -}; - -var start = +new Date(), - nparsed = parser.write(buffer), - duration = +new Date - start, - mbPerSec = (mb / (duration / 1000)).toFixed(2); - -console.log(mbPerSec+' mb/sec'); - -assert.equal(nparsed, buffer.length); - -function createMultipartBuffer(boundary, size) { - var head = - '--'+boundary+'\r\n' - + 'content-disposition: form-data; name="field1"\r\n' - + '\r\n' - , tail = '\r\n--'+boundary+'--\r\n' - , buffer = new Buffer(size); - - buffer.write(head, 'ascii', 0); - buffer.write(tail, 'ascii', buffer.length - tail.length); - return buffer; -} - -process.on('exit', function() { - for (var k in callbacks) { - assert.equal(0, callbacks[k], k+' count off by '+callbacks[k]); - } -}); diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js b/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js deleted file mode 100644 index f6c15a6..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js +++ /dev/null @@ -1,43 +0,0 @@ -require('../test/common'); -var http = require('http'), - util = require('util'), - formidable = require('formidable'), - server; - -server = http.createServer(function(req, res) { - if (req.url == '/') { - res.writeHead(200, {'content-type': 'text/html'}); - res.end( - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    ' - ); - } else if (req.url == '/post') { - var form = new formidable.IncomingForm(), - fields = []; - - form - .on('error', function(err) { - res.writeHead(200, {'content-type': 'text/plain'}); - res.end('error:\n\n'+util.inspect(err)); - }) - .on('field', function(field, value) { - console.log(field, value); - fields.push([field, value]); - }) - .on('end', function() { - console.log('-> post done'); - res.writeHead(200, {'content-type': 'text/plain'}); - res.end('received fields:\n\n '+util.inspect(fields)); - }); - form.parse(req); - } else { - res.writeHead(404, {'content-type': 'text/plain'}); - res.end('404'); - } -}); -server.listen(TEST_PORT); - -console.log('listening on http://localhost:'+TEST_PORT+'/'); diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js b/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js deleted file mode 100644 index 050cdd9..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js +++ /dev/null @@ -1,48 +0,0 @@ -require('../test/common'); -var http = require('http'), - util = require('util'), - formidable = require('formidable'), - server; - -server = http.createServer(function(req, res) { - if (req.url == '/') { - res.writeHead(200, {'content-type': 'text/html'}); - res.end( - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    ' - ); - } else if (req.url == '/upload') { - var form = new formidable.IncomingForm(), - files = [], - fields = []; - - form.uploadDir = TEST_TMP; - - form - .on('field', function(field, value) { - console.log(field, value); - fields.push([field, value]); - }) - .on('file', function(field, file) { - console.log(field, file); - files.push([field, file]); - }) - .on('end', function() { - console.log('-> upload done'); - res.writeHead(200, {'content-type': 'text/plain'}); - res.write('received fields:\n\n '+util.inspect(fields)); - res.write('\n\n'); - res.end('received files:\n\n '+util.inspect(files)); - }); - form.parse(req); - } else { - res.writeHead(404, {'content-type': 'text/plain'}); - res.end('404'); - } -}); -server.listen(TEST_PORT); - -console.log('listening on http://localhost:'+TEST_PORT+'/'); diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/index.js b/node_modules/express/node_modules/connect/node_modules/formidable/index.js deleted file mode 100644 index be41032..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/formidable'); \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js b/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js deleted file mode 100644 index 6dc8720..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js +++ /dev/null @@ -1,61 +0,0 @@ -if (global.GENTLY) require = GENTLY.hijack(require); - -var util = require('./util'), - WriteStream = require('fs').WriteStream, - EventEmitter = require('events').EventEmitter; - -function File(properties) { - EventEmitter.call(this); - - this.size = 0; - this.path = null; - this.name = null; - this.type = null; - this.lastModifiedDate = null; - - this._writeStream = null; - - for (var key in properties) { - this[key] = properties[key]; - } - - this._backwardsCompatibility(); -} -module.exports = File; -util.inherits(File, EventEmitter); - -// @todo Next release: Show error messages when accessing these -File.prototype._backwardsCompatibility = function() { - var self = this; - this.__defineGetter__('length', function() { - return self.size; - }); - this.__defineGetter__('filename', function() { - return self.name; - }); - this.__defineGetter__('mime', function() { - return self.type; - }); -}; - -File.prototype.open = function() { - this._writeStream = new WriteStream(this.path); -}; - -File.prototype.write = function(buffer, cb) { - var self = this; - this._writeStream.write(buffer, function() { - self.lastModifiedDate = new Date(); - self.size += buffer.length; - self.emit('progress', self.size); - cb(); - }); -}; - -File.prototype.end = function(cb) { - var self = this; - this._writeStream.end(function() { - self.emit('end'); - cb(); - }); -}; diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js b/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js deleted file mode 100644 index b1e2bfb..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js +++ /dev/null @@ -1,378 +0,0 @@ -if (global.GENTLY) require = GENTLY.hijack(require); - -var fs = require('fs'); -var util = require('./util'), - path = require('path'), - File = require('./file'), - MultipartParser = require('./multipart_parser').MultipartParser, - QuerystringParser = require('./querystring_parser').QuerystringParser, - StringDecoder = require('string_decoder').StringDecoder, - EventEmitter = require('events').EventEmitter; - -function IncomingForm() { - if (!(this instanceof IncomingForm)) return new IncomingForm; - EventEmitter.call(this); - - this.error = null; - this.ended = false; - - this.maxFieldsSize = 2 * 1024 * 1024; - this.keepExtensions = false; - this.uploadDir = IncomingForm.UPLOAD_DIR; - this.encoding = 'utf-8'; - this.headers = null; - this.type = null; - - this.bytesReceived = null; - this.bytesExpected = null; - - this._parser = null; - this._flushing = 0; - this._fieldsSize = 0; -}; -util.inherits(IncomingForm, EventEmitter); -exports.IncomingForm = IncomingForm; - -IncomingForm.UPLOAD_DIR = (function() { - var dirs = [process.env.TMP, '/tmp', process.cwd()]; - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var isDirectory = false; - - try { - isDirectory = fs.statSync(dir).isDirectory(); - } catch (e) {} - - if (isDirectory) return dir; - } -})(); - -IncomingForm.prototype.parse = function(req, cb) { - this.pause = function() { - try { - req.pause(); - } catch (err) { - // the stream was destroyed - if (!this.ended) { - // before it was completed, crash & burn - this._error(err); - } - return false; - } - return true; - }; - - this.resume = function() { - try { - req.resume(); - } catch (err) { - // the stream was destroyed - if (!this.ended) { - // before it was completed, crash & burn - this._error(err); - } - return false; - } - - return true; - }; - - this.writeHeaders(req.headers); - - var self = this; - req - .on('error', function(err) { - self._error(err); - }) - .on('aborted', function() { - self.emit('aborted'); - }) - .on('data', function(buffer) { - self.write(buffer); - }) - .on('end', function() { - if (self.error) { - return; - } - - var err = self._parser.end(); - if (err) { - self._error(err); - } - }); - - if (cb) { - var fields = {}, files = {}; - this - .on('field', function(name, value) { - fields[name] = value; - }) - .on('file', function(name, file) { - files[name] = file; - }) - .on('error', function(err) { - cb(err, fields, files); - }) - .on('end', function() { - cb(null, fields, files); - }); - } - - return this; -}; - -IncomingForm.prototype.writeHeaders = function(headers) { - this.headers = headers; - this._parseContentLength(); - this._parseContentType(); -}; - -IncomingForm.prototype.write = function(buffer) { - if (!this._parser) { - this._error(new Error('unintialized parser')); - return; - } - - this.bytesReceived += buffer.length; - this.emit('progress', this.bytesReceived, this.bytesExpected); - - var bytesParsed = this._parser.write(buffer); - if (bytesParsed !== buffer.length) { - this._error(new Error('parser error, '+bytesParsed+' of '+buffer.length+' bytes parsed')); - } - - return bytesParsed; -}; - -IncomingForm.prototype.pause = function() { - // this does nothing, unless overwritten in IncomingForm.parse - return false; -}; - -IncomingForm.prototype.resume = function() { - // this does nothing, unless overwritten in IncomingForm.parse - return false; -}; - -IncomingForm.prototype.onPart = function(part) { - // this method can be overwritten by the user - this.handlePart(part); -}; - -IncomingForm.prototype.handlePart = function(part) { - var self = this; - - if (part.filename === undefined) { - var value = '' - , decoder = new StringDecoder(this.encoding); - - part.on('data', function(buffer) { - self._fieldsSize += buffer.length; - if (self._fieldsSize > self.maxFieldsSize) { - self._error(new Error('maxFieldsSize exceeded, received '+self._fieldsSize+' bytes of field data')); - return; - } - value += decoder.write(buffer); - }); - - part.on('end', function() { - self.emit('field', part.name, value); - }); - return; - } - - this._flushing++; - - var file = new File({ - path: this._uploadPath(part.filename), - name: part.filename, - type: part.mime, - }); - - this.emit('fileBegin', part.name, file); - - file.open(); - - part.on('data', function(buffer) { - self.pause(); - file.write(buffer, function() { - self.resume(); - }); - }); - - part.on('end', function() { - file.end(function() { - self._flushing--; - self.emit('file', part.name, file); - self._maybeEnd(); - }); - }); -}; - -IncomingForm.prototype._parseContentType = function() { - if (!this.headers['content-type']) { - this._error(new Error('bad content-type header, no content-type')); - return; - } - - if (this.headers['content-type'].match(/urlencoded/i)) { - this._initUrlencoded(); - return; - } - - if (this.headers['content-type'].match(/multipart/i)) { - var m; - if (m = this.headers['content-type'].match(/boundary=(?:"([^"]+)"|([^;]+))/i)) { - this._initMultipart(m[1] || m[2]); - } else { - this._error(new Error('bad content-type header, no multipart boundary')); - } - return; - } - - this._error(new Error('bad content-type header, unknown content-type: '+this.headers['content-type'])); -}; - -IncomingForm.prototype._error = function(err) { - if (this.error) { - return; - } - - this.error = err; - this.pause(); - this.emit('error', err); -}; - -IncomingForm.prototype._parseContentLength = function() { - if (this.headers['content-length']) { - this.bytesReceived = 0; - this.bytesExpected = parseInt(this.headers['content-length'], 10); - this.emit('progress', this.bytesReceived, this.bytesExpected); - } -}; - -IncomingForm.prototype._newParser = function() { - return new MultipartParser(); -}; - -IncomingForm.prototype._initMultipart = function(boundary) { - this.type = 'multipart'; - - var parser = new MultipartParser(), - self = this, - headerField, - headerValue, - part; - - parser.initWithBoundary(boundary); - - parser.onPartBegin = function() { - part = new EventEmitter(); - part.headers = {}; - part.name = null; - part.filename = null; - part.mime = null; - headerField = ''; - headerValue = ''; - }; - - parser.onHeaderField = function(b, start, end) { - headerField += b.toString(self.encoding, start, end); - }; - - parser.onHeaderValue = function(b, start, end) { - headerValue += b.toString(self.encoding, start, end); - }; - - parser.onHeaderEnd = function() { - headerField = headerField.toLowerCase(); - part.headers[headerField] = headerValue; - - var m; - if (headerField == 'content-disposition') { - if (m = headerValue.match(/name="([^"]+)"/i)) { - part.name = m[1]; - } - - part.filename = self._fileName(headerValue); - } else if (headerField == 'content-type') { - part.mime = headerValue; - } - - headerField = ''; - headerValue = ''; - }; - - parser.onHeadersEnd = function() { - self.onPart(part); - }; - - parser.onPartData = function(b, start, end) { - part.emit('data', b.slice(start, end)); - }; - - parser.onPartEnd = function() { - part.emit('end'); - }; - - parser.onEnd = function() { - self.ended = true; - self._maybeEnd(); - }; - - this._parser = parser; -}; - -IncomingForm.prototype._fileName = function(headerValue) { - var m = headerValue.match(/filename="(.*?)"($|; )/i) - if (!m) return; - - var filename = m[1].substr(m[1].lastIndexOf('\\') + 1); - filename = filename.replace(/%22/g, '"'); - filename = filename.replace(/&#([\d]{4});/g, function(m, code) { - return String.fromCharCode(code); - }); - return filename; -}; - -IncomingForm.prototype._initUrlencoded = function() { - this.type = 'urlencoded'; - - var parser = new QuerystringParser() - , self = this; - - parser.onField = function(key, val) { - self.emit('field', key, val); - }; - - parser.onEnd = function() { - self.ended = true; - self._maybeEnd(); - }; - - this._parser = parser; -}; - -IncomingForm.prototype._uploadPath = function(filename) { - var name = ''; - for (var i = 0; i < 32; i++) { - name += Math.floor(Math.random() * 16).toString(16); - } - - if (this.keepExtensions) { - var ext = path.extname(filename); - ext = ext.replace(/(\.[a-z0-9]+).*/, '$1') - - name += ext; - } - - return path.join(this.uploadDir, name); -}; - -IncomingForm.prototype._maybeEnd = function() { - if (!this.ended || this._flushing) { - return; - } - - this.emit('end'); -}; diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js b/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js deleted file mode 100644 index 7a6e3e1..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js +++ /dev/null @@ -1,3 +0,0 @@ -var IncomingForm = require('./incoming_form').IncomingForm; -IncomingForm.IncomingForm = IncomingForm; -module.exports = IncomingForm; diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js b/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js deleted file mode 100644 index 9ca567c..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js +++ /dev/null @@ -1,312 +0,0 @@ -var Buffer = require('buffer').Buffer, - s = 0, - S = - { PARSER_UNINITIALIZED: s++, - START: s++, - START_BOUNDARY: s++, - HEADER_FIELD_START: s++, - HEADER_FIELD: s++, - HEADER_VALUE_START: s++, - HEADER_VALUE: s++, - HEADER_VALUE_ALMOST_DONE: s++, - HEADERS_ALMOST_DONE: s++, - PART_DATA_START: s++, - PART_DATA: s++, - PART_END: s++, - END: s++, - }, - - f = 1, - F = - { PART_BOUNDARY: f, - LAST_BOUNDARY: f *= 2, - }, - - LF = 10, - CR = 13, - SPACE = 32, - HYPHEN = 45, - COLON = 58, - A = 97, - Z = 122, - - lower = function(c) { - return c | 0x20; - }; - -for (var s in S) { - exports[s] = S[s]; -} - -function MultipartParser() { - this.boundary = null; - this.boundaryChars = null; - this.lookbehind = null; - this.state = S.PARSER_UNINITIALIZED; - - this.index = null; - this.flags = 0; -}; -exports.MultipartParser = MultipartParser; - -MultipartParser.stateToString = function(stateNumber) { - for (var state in S) { - var number = S[state]; - if (number === stateNumber) return state; - } -}; - -MultipartParser.prototype.initWithBoundary = function(str) { - this.boundary = new Buffer(str.length+4); - this.boundary.write('\r\n--', 'ascii', 0); - this.boundary.write(str, 'ascii', 4); - this.lookbehind = new Buffer(this.boundary.length+8); - this.state = S.START; - - this.boundaryChars = {}; - for (var i = 0; i < this.boundary.length; i++) { - this.boundaryChars[this.boundary[i]] = true; - } -}; - -MultipartParser.prototype.write = function(buffer) { - var self = this, - i = 0, - len = buffer.length, - prevIndex = this.index, - index = this.index, - state = this.state, - flags = this.flags, - lookbehind = this.lookbehind, - boundary = this.boundary, - boundaryChars = this.boundaryChars, - boundaryLength = this.boundary.length, - boundaryEnd = boundaryLength - 1, - bufferLength = buffer.length, - c, - cl, - - mark = function(name) { - self[name+'Mark'] = i; - }, - clear = function(name) { - delete self[name+'Mark']; - }, - callback = function(name, buffer, start, end) { - if (start !== undefined && start === end) { - return; - } - - var callbackSymbol = 'on'+name.substr(0, 1).toUpperCase()+name.substr(1); - if (callbackSymbol in self) { - self[callbackSymbol](buffer, start, end); - } - }, - dataCallback = function(name, clear) { - var markSymbol = name+'Mark'; - if (!(markSymbol in self)) { - return; - } - - if (!clear) { - callback(name, buffer, self[markSymbol], buffer.length); - self[markSymbol] = 0; - } else { - callback(name, buffer, self[markSymbol], i); - delete self[markSymbol]; - } - }; - - for (i = 0; i < len; i++) { - c = buffer[i]; - switch (state) { - case S.PARSER_UNINITIALIZED: - return i; - case S.START: - index = 0; - state = S.START_BOUNDARY; - case S.START_BOUNDARY: - if (index == boundary.length - 2) { - if (c != CR) { - return i; - } - index++; - break; - } else if (index - 1 == boundary.length - 2) { - if (c != LF) { - return i; - } - index = 0; - callback('partBegin'); - state = S.HEADER_FIELD_START; - break; - } - - if (c != boundary[index+2]) { - return i; - } - index++; - break; - case S.HEADER_FIELD_START: - state = S.HEADER_FIELD; - mark('headerField'); - index = 0; - case S.HEADER_FIELD: - if (c == CR) { - clear('headerField'); - state = S.HEADERS_ALMOST_DONE; - break; - } - - index++; - if (c == HYPHEN) { - break; - } - - if (c == COLON) { - if (index == 1) { - // empty header field - return i; - } - dataCallback('headerField', true); - state = S.HEADER_VALUE_START; - break; - } - - cl = lower(c); - if (cl < A || cl > Z) { - return i; - } - break; - case S.HEADER_VALUE_START: - if (c == SPACE) { - break; - } - - mark('headerValue'); - state = S.HEADER_VALUE; - case S.HEADER_VALUE: - if (c == CR) { - dataCallback('headerValue', true); - callback('headerEnd'); - state = S.HEADER_VALUE_ALMOST_DONE; - } - break; - case S.HEADER_VALUE_ALMOST_DONE: - if (c != LF) { - return i; - } - state = S.HEADER_FIELD_START; - break; - case S.HEADERS_ALMOST_DONE: - if (c != LF) { - return i; - } - - callback('headersEnd'); - state = S.PART_DATA_START; - break; - case S.PART_DATA_START: - state = S.PART_DATA - mark('partData'); - case S.PART_DATA: - prevIndex = index; - - if (index == 0) { - // boyer-moore derrived algorithm to safely skip non-boundary data - i += boundaryEnd; - while (i < bufferLength && !(buffer[i] in boundaryChars)) { - i += boundaryLength; - } - i -= boundaryEnd; - c = buffer[i]; - } - - if (index < boundary.length) { - if (boundary[index] == c) { - if (index == 0) { - dataCallback('partData', true); - } - index++; - } else { - index = 0; - } - } else if (index == boundary.length) { - index++; - if (c == CR) { - // CR = part boundary - flags |= F.PART_BOUNDARY; - } else if (c == HYPHEN) { - // HYPHEN = end boundary - flags |= F.LAST_BOUNDARY; - } else { - index = 0; - } - } else if (index - 1 == boundary.length) { - if (flags & F.PART_BOUNDARY) { - index = 0; - if (c == LF) { - // unset the PART_BOUNDARY flag - flags &= ~F.PART_BOUNDARY; - callback('partEnd'); - callback('partBegin'); - state = S.HEADER_FIELD_START; - break; - } - } else if (flags & F.LAST_BOUNDARY) { - if (c == HYPHEN) { - callback('partEnd'); - callback('end'); - state = S.END; - } else { - index = 0; - } - } else { - index = 0; - } - } - - if (index > 0) { - // when matching a possible boundary, keep a lookbehind reference - // in case it turns out to be a false lead - lookbehind[index-1] = c; - } else if (prevIndex > 0) { - // if our boundary turned out to be rubbish, the captured lookbehind - // belongs to partData - callback('partData', lookbehind, 0, prevIndex); - prevIndex = 0; - mark('partData'); - - // reconsider the current character even so it interrupted the sequence - // it could be the beginning of a new sequence - i--; - } - - break; - case S.END: - break; - default: - return i; - } - } - - dataCallback('headerField'); - dataCallback('headerValue'); - dataCallback('partData'); - - this.index = index; - this.state = state; - this.flags = flags; - - return len; -}; - -MultipartParser.prototype.end = function() { - if (this.state != S.END) { - return new Error('MultipartParser.end(): stream ended unexpectedly: ' + this.explain()); - } -}; - -MultipartParser.prototype.explain = function() { - return 'state = ' + MultipartParser.stateToString(this.state); -}; diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js b/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js deleted file mode 100644 index 63f109e..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js +++ /dev/null @@ -1,25 +0,0 @@ -if (global.GENTLY) require = GENTLY.hijack(require); - -// This is a buffering parser, not quite as nice as the multipart one. -// If I find time I'll rewrite this to be fully streaming as well -var querystring = require('querystring'); - -function QuerystringParser() { - this.buffer = ''; -}; -exports.QuerystringParser = QuerystringParser; - -QuerystringParser.prototype.write = function(buffer) { - this.buffer += buffer.toString('ascii'); - return buffer.length; -}; - -QuerystringParser.prototype.end = function() { - var fields = querystring.parse(this.buffer); - for (var field in fields) { - this.onField(field, fields[field]); - } - this.buffer = ''; - - this.onEnd(); -}; \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js b/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js deleted file mode 100644 index e9493e9..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js +++ /dev/null @@ -1,6 +0,0 @@ -// Backwards compatibility ... -try { - module.exports = require('util'); -} catch (e) { - module.exports = require('sys'); -} diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/package.json b/node_modules/express/node_modules/connect/node_modules/formidable/package.json deleted file mode 100644 index 1645a03..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "formidable", - "version": "1.0.9", - "dependencies": {}, - "devDependencies": { - "gently": "0.8.0", - "findit": "0.1.1", - "hashish": "0.0.4", - "urun": "0.0.4", - "utest": "0.0.3" - }, - "directories": { - "lib": "./lib" - }, - "main": "./lib/index", - "scripts": { - "test": "make test" - }, - "engines": { - "node": "*" - }, - "_id": "formidable@1.0.9", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "formidable@1.0.9" -} diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js deleted file mode 100644 index eb432ad..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js +++ /dev/null @@ -1,19 +0,0 @@ -var mysql = require('..'); -var path = require('path'); - -var root = path.join(__dirname, '../'); -exports.dir = { - root : root, - lib : root + '/lib', - fixture : root + '/test/fixture', - tmp : root + '/test/tmp', -}; - -exports.port = 13532; - -exports.formidable = require('..'); -exports.assert = require('assert'); - -exports.require = function(lib) { - return require(exports.dir.lib + '/' + lib); -}; diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt b/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt deleted file mode 100644 index e7a4785..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt +++ /dev/null @@ -1 +0,0 @@ -I am a text file with a funky name! diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt b/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt deleted file mode 100644 index 9b6903e..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt +++ /dev/null @@ -1 +0,0 @@ -I am a plain text file diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md b/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md deleted file mode 100644 index 3c9dbe3..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md +++ /dev/null @@ -1,3 +0,0 @@ -* Opera does not allow submitting this file, it shows a warning to the - user that the file could not be found instead. Tested in 9.8, 11.51 on OSX. - Reported to Opera on 08.09.2011 (tracking email DSK-346009@bugs.opera.com). diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js deleted file mode 100644 index 0bae449..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports['generic.http'] = [ - {type: 'file', name: 'upload', filename: '', fixture: 'plain.txt'}, -]; diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js deleted file mode 100644 index eb76fdc..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js +++ /dev/null @@ -1,21 +0,0 @@ -var properFilename = 'funkyfilename.txt'; - -function expect(filename) { - return [ - {type: 'field', name: 'title', value: 'Weird filename'}, - {type: 'file', name: 'upload', filename: filename, fixture: properFilename}, - ]; -}; - -var webkit = " ? % * | \" < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"; -var ffOrIe = " ? % * | \" < > . ☃ ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt"; - -module.exports = { - 'osx-chrome-13.http' : expect(webkit), - 'osx-firefox-3.6.http' : expect(ffOrIe), - 'osx-safari-5.http' : expect(webkit), - 'xp-chrome-12.http' : expect(webkit), - 'xp-ie-7.http' : expect(ffOrIe), - 'xp-ie-8.http' : expect(ffOrIe), - 'xp-safari-5.http' : expect(webkit), -}; diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js deleted file mode 100644 index a476169..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js +++ /dev/null @@ -1,72 +0,0 @@ -exports['rfc1867'] = - { boundary: 'AaB03x', - raw: - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="field1"\r\n'+ - '\r\n'+ - 'Joe Blow\r\nalmost tricked you!\r\n'+ - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ - 'Content-Type: text/plain\r\n'+ - '\r\n'+ - '... contents of file1.txt ...\r\r\n'+ - '--AaB03x--\r\n', - parts: - [ { headers: { - 'content-disposition': 'form-data; name="field1"', - }, - data: 'Joe Blow\r\nalmost tricked you!', - }, - { headers: { - 'content-disposition': 'form-data; name="pics"; filename="file1.txt"', - 'Content-Type': 'text/plain', - }, - data: '... contents of file1.txt ...\r', - } - ] - }; - -exports['noTrailing\r\n'] = - { boundary: 'AaB03x', - raw: - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="field1"\r\n'+ - '\r\n'+ - 'Joe Blow\r\nalmost tricked you!\r\n'+ - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ - 'Content-Type: text/plain\r\n'+ - '\r\n'+ - '... contents of file1.txt ...\r\r\n'+ - '--AaB03x--', - parts: - [ { headers: { - 'content-disposition': 'form-data; name="field1"', - }, - data: 'Joe Blow\r\nalmost tricked you!', - }, - { headers: { - 'content-disposition': 'form-data; name="pics"; filename="file1.txt"', - 'Content-Type': 'text/plain', - }, - data: '... contents of file1.txt ...\r', - } - ] - }; - -exports['emptyHeader'] = - { boundary: 'AaB03x', - raw: - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="field1"\r\n'+ - ': foo\r\n'+ - '\r\n'+ - 'Joe Blow\r\nalmost tricked you!\r\n'+ - '--AaB03x\r\n'+ - 'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+ - 'Content-Type: text/plain\r\n'+ - '\r\n'+ - '... contents of file1.txt ...\r\r\n'+ - '--AaB03x--\r\n', - expectError: true, - }; diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js deleted file mode 100644 index 66ad259..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js +++ /dev/null @@ -1,89 +0,0 @@ -var hashish = require('hashish'); -var fs = require('fs'); -var findit = require('findit'); -var path = require('path'); -var http = require('http'); -var net = require('net'); -var assert = require('assert'); - -var common = require('../common'); -var formidable = common.formidable; - -var server = http.createServer(); -server.listen(common.port, findFixtures); - -function findFixtures() { - var fixtures = []; - findit - .sync(common.dir.fixture + '/js') - .forEach(function(jsPath) { - if (!/\.js$/.test(jsPath)) return; - - var group = path.basename(jsPath, '.js'); - hashish.forEach(require(jsPath), function(fixture, name) { - fixtures.push({ - name : group + '/' + name, - fixture : fixture, - }); - }); - }); - - testNext(fixtures); -} - -function testNext(fixtures) { - var fixture = fixtures.shift(); - if (!fixture) return server.close(); - - var name = fixture.name; - var fixture = fixture.fixture; - - uploadFixture(name, function(err, parts) { - if (err) throw err; - - fixture.forEach(function(expectedPart, i) { - var parsedPart = parts[i]; - assert.equal(parsedPart.type, expectedPart.type); - assert.equal(parsedPart.name, expectedPart.name); - - if (parsedPart.type === 'file') { - var filename = parsedPart.value.name; - assert.equal(filename, expectedPart.filename); - } - }); - - testNext(fixtures); - }); -}; - -function uploadFixture(name, cb) { - server.once('request', function(req, res) { - var form = new formidable.IncomingForm(); - form.uploadDir = common.dir.tmp; - form.parse(req); - - function callback() { - var realCallback = cb; - cb = function() {}; - realCallback.apply(null, arguments); - } - - var parts = []; - form - .on('error', callback) - .on('fileBegin', function(name, value) { - parts.push({type: 'file', name: name, value: value}); - }) - .on('field', function(name, value) { - parts.push({type: 'field', name: name, value: value}); - }) - .on('end', function() { - callback(null, parts); - }); - }); - - var socket = net.createConnection(common.port); - var file = fs.createReadStream(common.dir.fixture + '/http/' + name); - - file.pipe(socket); -} diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js deleted file mode 100644 index 2b98598..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js +++ /dev/null @@ -1,24 +0,0 @@ -var path = require('path'), - fs = require('fs'); - -try { - global.Gently = require('gently'); -} catch (e) { - throw new Error('this test suite requires node-gently'); -} - -exports.lib = path.join(__dirname, '../../lib'); - -global.GENTLY = new Gently(); - -global.assert = require('assert'); -global.TEST_PORT = 13532; -global.TEST_FIXTURES = path.join(__dirname, '../fixture'); -global.TEST_TMP = path.join(__dirname, '../tmp'); - -// Stupid new feature in node that complains about gently attaching too many -// listeners to process 'exit'. This is a workaround until I can think of a -// better way to deal with this. -if (process.setMaxListeners) { - process.setMaxListeners(10000); -} diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js deleted file mode 100644 index 75232aa..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js +++ /dev/null @@ -1,80 +0,0 @@ -var common = require('../common'); -var CHUNK_LENGTH = 10, - multipartParser = require(common.lib + '/multipart_parser'), - MultipartParser = multipartParser.MultipartParser, - parser = new MultipartParser(), - fixtures = require(TEST_FIXTURES + '/multipart'), - Buffer = require('buffer').Buffer; - -Object.keys(fixtures).forEach(function(name) { - var fixture = fixtures[name], - buffer = new Buffer(Buffer.byteLength(fixture.raw, 'binary')), - offset = 0, - chunk, - nparsed, - - parts = [], - part = null, - headerField, - headerValue, - endCalled = ''; - - parser.initWithBoundary(fixture.boundary); - parser.onPartBegin = function() { - part = {headers: {}, data: ''}; - parts.push(part); - headerField = ''; - headerValue = ''; - }; - - parser.onHeaderField = function(b, start, end) { - headerField += b.toString('ascii', start, end); - }; - - parser.onHeaderValue = function(b, start, end) { - headerValue += b.toString('ascii', start, end); - } - - parser.onHeaderEnd = function() { - part.headers[headerField] = headerValue; - headerField = ''; - headerValue = ''; - }; - - parser.onPartData = function(b, start, end) { - var str = b.toString('ascii', start, end); - part.data += b.slice(start, end); - } - - parser.onEnd = function() { - endCalled = true; - } - - buffer.write(fixture.raw, 'binary', 0); - - while (offset < buffer.length) { - if (offset + CHUNK_LENGTH < buffer.length) { - chunk = buffer.slice(offset, offset+CHUNK_LENGTH); - } else { - chunk = buffer.slice(offset, buffer.length); - } - offset = offset + CHUNK_LENGTH; - - nparsed = parser.write(chunk); - if (nparsed != chunk.length) { - if (fixture.expectError) { - return; - } - puts('-- ERROR --'); - p(chunk.toString('ascii')); - throw new Error(chunk.length+' bytes written, but only '+nparsed+' bytes parsed!'); - } - } - - if (fixture.expectError) { - throw new Error('expected parse error did not happen'); - } - - assert.ok(endCalled); - assert.deepEqual(parts, fixture.parts); -}); diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js deleted file mode 100644 index 52ceedb..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js +++ /dev/null @@ -1,104 +0,0 @@ -var common = require('../common'); -var WriteStreamStub = GENTLY.stub('fs', 'WriteStream'); - -var File = require(common.lib + '/file'), - EventEmitter = require('events').EventEmitter, - file, - gently; - -function test(test) { - gently = new Gently(); - file = new File(); - test(); - gently.verify(test.name); -} - -test(function constructor() { - assert.ok(file instanceof EventEmitter); - assert.strictEqual(file.size, 0); - assert.strictEqual(file.path, null); - assert.strictEqual(file.name, null); - assert.strictEqual(file.type, null); - assert.strictEqual(file.lastModifiedDate, null); - - assert.strictEqual(file._writeStream, null); - - (function testSetProperties() { - var file2 = new File({foo: 'bar'}); - assert.equal(file2.foo, 'bar'); - })(); -}); - -test(function open() { - var WRITE_STREAM; - file.path = '/foo'; - - gently.expect(WriteStreamStub, 'new', function (path) { - WRITE_STREAM = this; - assert.strictEqual(path, file.path); - }); - - file.open(); - assert.strictEqual(file._writeStream, WRITE_STREAM); -}); - -test(function write() { - var BUFFER = {length: 10}, - CB_STUB, - CB = function() { - CB_STUB.apply(this, arguments); - }; - - file._writeStream = {}; - - gently.expect(file._writeStream, 'write', function (buffer, cb) { - assert.strictEqual(buffer, BUFFER); - - gently.expect(file, 'emit', function (event, bytesWritten) { - assert.ok(file.lastModifiedDate instanceof Date); - assert.equal(event, 'progress'); - assert.equal(bytesWritten, file.size); - }); - - CB_STUB = gently.expect(function writeCb() { - assert.equal(file.size, 10); - }); - - cb(); - - gently.expect(file, 'emit', function (event, bytesWritten) { - assert.equal(event, 'progress'); - assert.equal(bytesWritten, file.size); - }); - - CB_STUB = gently.expect(function writeCb() { - assert.equal(file.size, 20); - }); - - cb(); - }); - - file.write(BUFFER, CB); -}); - -test(function end() { - var CB_STUB, - CB = function() { - CB_STUB.apply(this, arguments); - }; - - file._writeStream = {}; - - gently.expect(file._writeStream, 'end', function (cb) { - gently.expect(file, 'emit', function (event) { - assert.equal(event, 'end'); - }); - - CB_STUB = gently.expect(function endCb() { - }); - - cb(); - }); - - file.end(CB); -}); diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js deleted file mode 100644 index b64df8b..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js +++ /dev/null @@ -1,726 +0,0 @@ -var common = require('../common'); -var MultipartParserStub = GENTLY.stub('./multipart_parser', 'MultipartParser'), - QuerystringParserStub = GENTLY.stub('./querystring_parser', 'QuerystringParser'), - EventEmitterStub = GENTLY.stub('events', 'EventEmitter'), - FileStub = GENTLY.stub('./file'); - -var formidable = require(common.lib + '/index'), - IncomingForm = formidable.IncomingForm, - events = require('events'), - fs = require('fs'), - path = require('path'), - Buffer = require('buffer').Buffer, - fixtures = require(TEST_FIXTURES + '/multipart'), - form, - gently; - -function test(test) { - gently = new Gently(); - gently.expect(EventEmitterStub, 'call'); - form = new IncomingForm(); - test(); - gently.verify(test.name); -} - -test(function constructor() { - assert.strictEqual(form.error, null); - assert.strictEqual(form.ended, false); - assert.strictEqual(form.type, null); - assert.strictEqual(form.headers, null); - assert.strictEqual(form.keepExtensions, false); - assert.strictEqual(form.uploadDir, '/tmp'); - assert.strictEqual(form.encoding, 'utf-8'); - assert.strictEqual(form.bytesReceived, null); - assert.strictEqual(form.bytesExpected, null); - assert.strictEqual(form.maxFieldsSize, 2 * 1024 * 1024); - assert.strictEqual(form._parser, null); - assert.strictEqual(form._flushing, 0); - assert.strictEqual(form._fieldsSize, 0); - assert.ok(form instanceof EventEmitterStub); - assert.equal(form.constructor.name, 'IncomingForm'); - - (function testSimpleConstructor() { - gently.expect(EventEmitterStub, 'call'); - var form = IncomingForm(); - assert.ok(form instanceof IncomingForm); - })(); - - (function testSimpleConstructorShortcut() { - gently.expect(EventEmitterStub, 'call'); - var form = formidable(); - assert.ok(form instanceof IncomingForm); - })(); -}); - -test(function parse() { - var REQ = {headers: {}} - , emit = {}; - - gently.expect(form, 'writeHeaders', function(headers) { - assert.strictEqual(headers, REQ.headers); - }); - - var events = ['error', 'aborted', 'data', 'end']; - gently.expect(REQ, 'on', events.length, function(event, fn) { - assert.equal(event, events.shift()); - emit[event] = fn; - return this; - }); - - form.parse(REQ); - - (function testPause() { - gently.expect(REQ, 'pause'); - assert.strictEqual(form.pause(), true); - })(); - - (function testPauseCriticalException() { - form.ended = false; - - var ERR = new Error('dasdsa'); - gently.expect(REQ, 'pause', function() { - throw ERR; - }); - - gently.expect(form, '_error', function(err) { - assert.strictEqual(err, ERR); - }); - - assert.strictEqual(form.pause(), false); - })(); - - (function testPauseHarmlessException() { - form.ended = true; - - var ERR = new Error('dasdsa'); - gently.expect(REQ, 'pause', function() { - throw ERR; - }); - - assert.strictEqual(form.pause(), false); - })(); - - (function testResume() { - gently.expect(REQ, 'resume'); - assert.strictEqual(form.resume(), true); - })(); - - (function testResumeCriticalException() { - form.ended = false; - - var ERR = new Error('dasdsa'); - gently.expect(REQ, 'resume', function() { - throw ERR; - }); - - gently.expect(form, '_error', function(err) { - assert.strictEqual(err, ERR); - }); - - assert.strictEqual(form.resume(), false); - })(); - - (function testResumeHarmlessException() { - form.ended = true; - - var ERR = new Error('dasdsa'); - gently.expect(REQ, 'resume', function() { - throw ERR; - }); - - assert.strictEqual(form.resume(), false); - })(); - - (function testEmitError() { - var ERR = new Error('something bad happened'); - gently.expect(form, '_error',function(err) { - assert.strictEqual(err, ERR); - }); - emit.error(ERR); - })(); - - (function testEmitAborted() { - gently.expect(form, 'emit',function(event) { - assert.equal(event, 'aborted'); - }); - - emit.aborted(); - })(); - - - (function testEmitData() { - var BUFFER = [1, 2, 3]; - gently.expect(form, 'write', function(buffer) { - assert.strictEqual(buffer, BUFFER); - }); - emit.data(BUFFER); - })(); - - (function testEmitEnd() { - form._parser = {}; - - (function testWithError() { - var ERR = new Error('haha'); - gently.expect(form._parser, 'end', function() { - return ERR; - }); - - gently.expect(form, '_error', function(err) { - assert.strictEqual(err, ERR); - }); - - emit.end(); - })(); - - (function testWithoutError() { - gently.expect(form._parser, 'end'); - emit.end(); - })(); - - (function testAfterError() { - form.error = true; - emit.end(); - })(); - })(); - - (function testWithCallback() { - gently.expect(EventEmitterStub, 'call'); - var form = new IncomingForm(), - REQ = {headers: {}}, - parseCalled = 0; - - gently.expect(form, 'writeHeaders'); - gently.expect(REQ, 'on', 4, function() { - return this; - }); - - gently.expect(form, 'on', 4, function(event, fn) { - if (event == 'field') { - fn('field1', 'foo'); - fn('field1', 'bar'); - fn('field2', 'nice'); - } - - if (event == 'file') { - fn('file1', '1'); - fn('file1', '2'); - fn('file2', '3'); - } - - if (event == 'end') { - fn(); - } - return this; - }); - - form.parse(REQ, gently.expect(function parseCbOk(err, fields, files) { - assert.deepEqual(fields, {field1: 'bar', field2: 'nice'}); - assert.deepEqual(files, {file1: '2', file2: '3'}); - })); - - gently.expect(form, 'writeHeaders'); - gently.expect(REQ, 'on', 4, function() { - return this; - }); - - var ERR = new Error('test'); - gently.expect(form, 'on', 3, function(event, fn) { - if (event == 'field') { - fn('foo', 'bar'); - } - - if (event == 'error') { - fn(ERR); - gently.expect(form, 'on'); - } - return this; - }); - - form.parse(REQ, gently.expect(function parseCbErr(err, fields, files) { - assert.strictEqual(err, ERR); - assert.deepEqual(fields, {foo: 'bar'}); - })); - })(); -}); - -test(function pause() { - assert.strictEqual(form.pause(), false); -}); - -test(function resume() { - assert.strictEqual(form.resume(), false); -}); - - -test(function writeHeaders() { - var HEADERS = {}; - gently.expect(form, '_parseContentLength'); - gently.expect(form, '_parseContentType'); - - form.writeHeaders(HEADERS); - assert.strictEqual(form.headers, HEADERS); -}); - -test(function write() { - var parser = {}, - BUFFER = [1, 2, 3]; - - form._parser = parser; - form.bytesExpected = 523423; - - (function testBasic() { - gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { - assert.equal(event, 'progress'); - assert.equal(bytesReceived, BUFFER.length); - assert.equal(bytesExpected, form.bytesExpected); - }); - - gently.expect(parser, 'write', function(buffer) { - assert.strictEqual(buffer, BUFFER); - return buffer.length; - }); - - assert.equal(form.write(BUFFER), BUFFER.length); - assert.equal(form.bytesReceived, BUFFER.length); - })(); - - (function testParserError() { - gently.expect(form, 'emit'); - - gently.expect(parser, 'write', function(buffer) { - assert.strictEqual(buffer, BUFFER); - return buffer.length - 1; - }); - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/parser error/i)); - }); - - assert.equal(form.write(BUFFER), BUFFER.length - 1); - assert.equal(form.bytesReceived, BUFFER.length + BUFFER.length); - })(); - - (function testUninitialized() { - delete form._parser; - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/unintialized parser/i)); - }); - form.write(BUFFER); - })(); -}); - -test(function parseContentType() { - var HEADERS = {}; - - form.headers = {'content-type': 'application/x-www-form-urlencoded'}; - gently.expect(form, '_initUrlencoded'); - form._parseContentType(); - - // accept anything that has 'urlencoded' in it - form.headers = {'content-type': 'broken-client/urlencoded-stupid'}; - gently.expect(form, '_initUrlencoded'); - form._parseContentType(); - - var BOUNDARY = '---------------------------57814261102167618332366269'; - form.headers = {'content-type': 'multipart/form-data; boundary='+BOUNDARY}; - - gently.expect(form, '_initMultipart', function(boundary) { - assert.equal(boundary, BOUNDARY); - }); - form._parseContentType(); - - (function testQuotedBoundary() { - form.headers = {'content-type': 'multipart/form-data; boundary="' + BOUNDARY + '"'}; - - gently.expect(form, '_initMultipart', function(boundary) { - assert.equal(boundary, BOUNDARY); - }); - form._parseContentType(); - })(); - - (function testNoBoundary() { - form.headers = {'content-type': 'multipart/form-data'}; - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/no multipart boundary/i)); - }); - form._parseContentType(); - })(); - - (function testNoContentType() { - form.headers = {}; - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/no content-type/i)); - }); - form._parseContentType(); - })(); - - (function testUnknownContentType() { - form.headers = {'content-type': 'invalid'}; - - gently.expect(form, '_error', function(err) { - assert.ok(err.message.match(/unknown content-type/i)); - }); - form._parseContentType(); - })(); -}); - -test(function parseContentLength() { - var HEADERS = {}; - - form.headers = {}; - form._parseContentLength(); - assert.strictEqual(form.bytesReceived, null); - assert.strictEqual(form.bytesExpected, null); - - form.headers['content-length'] = '8'; - gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { - assert.equal(event, 'progress'); - assert.equal(bytesReceived, 0); - assert.equal(bytesExpected, 8); - }); - form._parseContentLength(); - assert.strictEqual(form.bytesReceived, 0); - assert.strictEqual(form.bytesExpected, 8); - - // JS can be evil, lets make sure we are not - form.headers['content-length'] = '08'; - gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) { - assert.equal(event, 'progress'); - assert.equal(bytesReceived, 0); - assert.equal(bytesExpected, 8); - }); - form._parseContentLength(); - assert.strictEqual(form.bytesExpected, 8); -}); - -test(function _initMultipart() { - var BOUNDARY = '123', - PARSER; - - gently.expect(MultipartParserStub, 'new', function() { - PARSER = this; - }); - - gently.expect(MultipartParserStub.prototype, 'initWithBoundary', function(boundary) { - assert.equal(boundary, BOUNDARY); - }); - - form._initMultipart(BOUNDARY); - assert.equal(form.type, 'multipart'); - assert.strictEqual(form._parser, PARSER); - - (function testRegularField() { - var PART; - gently.expect(EventEmitterStub, 'new', function() { - PART = this; - }); - - gently.expect(form, 'onPart', function(part) { - assert.strictEqual(part, PART); - assert.deepEqual - ( part.headers - , { 'content-disposition': 'form-data; name="field1"' - , 'foo': 'bar' - } - ); - assert.equal(part.name, 'field1'); - - var strings = ['hello', ' world']; - gently.expect(part, 'emit', 2, function(event, b) { - assert.equal(event, 'data'); - assert.equal(b.toString(), strings.shift()); - }); - - gently.expect(part, 'emit', function(event, b) { - assert.equal(event, 'end'); - }); - }); - - PARSER.onPartBegin(); - PARSER.onHeaderField(new Buffer('content-disposition'), 0, 10); - PARSER.onHeaderField(new Buffer('content-disposition'), 10, 19); - PARSER.onHeaderValue(new Buffer('form-data; name="field1"'), 0, 14); - PARSER.onHeaderValue(new Buffer('form-data; name="field1"'), 14, 24); - PARSER.onHeaderEnd(); - PARSER.onHeaderField(new Buffer('foo'), 0, 3); - PARSER.onHeaderValue(new Buffer('bar'), 0, 3); - PARSER.onHeaderEnd(); - PARSER.onHeadersEnd(); - PARSER.onPartData(new Buffer('hello world'), 0, 5); - PARSER.onPartData(new Buffer('hello world'), 5, 11); - PARSER.onPartEnd(); - })(); - - (function testFileField() { - var PART; - gently.expect(EventEmitterStub, 'new', function() { - PART = this; - }); - - gently.expect(form, 'onPart', function(part) { - assert.deepEqual - ( part.headers - , { 'content-disposition': 'form-data; name="field2"; filename="C:\\Documents and Settings\\IE\\Must\\Die\\Sun"et.jpg"' - , 'content-type': 'text/plain' - } - ); - assert.equal(part.name, 'field2'); - assert.equal(part.filename, 'Sun"et.jpg'); - assert.equal(part.mime, 'text/plain'); - - gently.expect(part, 'emit', function(event, b) { - assert.equal(event, 'data'); - assert.equal(b.toString(), '... contents of file1.txt ...'); - }); - - gently.expect(part, 'emit', function(event, b) { - assert.equal(event, 'end'); - }); - }); - - PARSER.onPartBegin(); - PARSER.onHeaderField(new Buffer('content-disposition'), 0, 19); - PARSER.onHeaderValue(new Buffer('form-data; name="field2"; filename="C:\\Documents and Settings\\IE\\Must\\Die\\Sun"et.jpg"'), 0, 85); - PARSER.onHeaderEnd(); - PARSER.onHeaderField(new Buffer('Content-Type'), 0, 12); - PARSER.onHeaderValue(new Buffer('text/plain'), 0, 10); - PARSER.onHeaderEnd(); - PARSER.onHeadersEnd(); - PARSER.onPartData(new Buffer('... contents of file1.txt ...'), 0, 29); - PARSER.onPartEnd(); - })(); - - (function testEnd() { - gently.expect(form, '_maybeEnd'); - PARSER.onEnd(); - assert.ok(form.ended); - })(); -}); - -test(function _fileName() { - // TODO - return; -}); - -test(function _initUrlencoded() { - var PARSER; - - gently.expect(QuerystringParserStub, 'new', function() { - PARSER = this; - }); - - form._initUrlencoded(); - assert.equal(form.type, 'urlencoded'); - assert.strictEqual(form._parser, PARSER); - - (function testOnField() { - var KEY = 'KEY', VAL = 'VAL'; - gently.expect(form, 'emit', function(field, key, val) { - assert.equal(field, 'field'); - assert.equal(key, KEY); - assert.equal(val, VAL); - }); - - PARSER.onField(KEY, VAL); - })(); - - (function testOnEnd() { - gently.expect(form, '_maybeEnd'); - - PARSER.onEnd(); - assert.equal(form.ended, true); - })(); -}); - -test(function _error() { - var ERR = new Error('bla'); - - gently.expect(form, 'pause'); - gently.expect(form, 'emit', function(event, err) { - assert.equal(event, 'error'); - assert.strictEqual(err, ERR); - }); - - form._error(ERR); - assert.strictEqual(form.error, ERR); - - // make sure _error only does its thing once - form._error(ERR); -}); - -test(function onPart() { - var PART = {}; - gently.expect(form, 'handlePart', function(part) { - assert.strictEqual(part, PART); - }); - - form.onPart(PART); -}); - -test(function handlePart() { - (function testUtf8Field() { - var PART = new events.EventEmitter(); - PART.name = 'my_field'; - - gently.expect(form, 'emit', function(event, field, value) { - assert.equal(event, 'field'); - assert.equal(field, 'my_field'); - assert.equal(value, 'hello world: €'); - }); - - form.handlePart(PART); - PART.emit('data', new Buffer('hello')); - PART.emit('data', new Buffer(' world: ')); - PART.emit('data', new Buffer([0xE2])); - PART.emit('data', new Buffer([0x82, 0xAC])); - PART.emit('end'); - })(); - - (function testBinaryField() { - var PART = new events.EventEmitter(); - PART.name = 'my_field2'; - - gently.expect(form, 'emit', function(event, field, value) { - assert.equal(event, 'field'); - assert.equal(field, 'my_field2'); - assert.equal(value, 'hello world: '+new Buffer([0xE2, 0x82, 0xAC]).toString('binary')); - }); - - form.encoding = 'binary'; - form.handlePart(PART); - PART.emit('data', new Buffer('hello')); - PART.emit('data', new Buffer(' world: ')); - PART.emit('data', new Buffer([0xE2])); - PART.emit('data', new Buffer([0x82, 0xAC])); - PART.emit('end'); - })(); - - (function testFieldSize() { - form.maxFieldsSize = 8; - var PART = new events.EventEmitter(); - PART.name = 'my_field'; - - gently.expect(form, '_error', function(err) { - assert.equal(err.message, 'maxFieldsSize exceeded, received 9 bytes of field data'); - }); - - form.handlePart(PART); - form._fieldsSize = 1; - PART.emit('data', new Buffer(7)); - PART.emit('data', new Buffer(1)); - })(); - - (function testFilePart() { - var PART = new events.EventEmitter(), - FILE = new events.EventEmitter(), - PATH = '/foo/bar'; - - PART.name = 'my_file'; - PART.filename = 'sweet.txt'; - PART.mime = 'sweet.txt'; - - gently.expect(form, '_uploadPath', function(filename) { - assert.equal(filename, PART.filename); - return PATH; - }); - - gently.expect(FileStub, 'new', function(properties) { - assert.equal(properties.path, PATH); - assert.equal(properties.name, PART.filename); - assert.equal(properties.type, PART.mime); - FILE = this; - - gently.expect(form, 'emit', function (event, field, file) { - assert.equal(event, 'fileBegin'); - assert.strictEqual(field, PART.name); - assert.strictEqual(file, FILE); - }); - - gently.expect(FILE, 'open'); - }); - - form.handlePart(PART); - assert.equal(form._flushing, 1); - - var BUFFER; - gently.expect(form, 'pause'); - gently.expect(FILE, 'write', function(buffer, cb) { - assert.strictEqual(buffer, BUFFER); - gently.expect(form, 'resume'); - // @todo handle cb(new Err) - cb(); - }); - - PART.emit('data', BUFFER = new Buffer('test')); - - gently.expect(FILE, 'end', function(cb) { - gently.expect(form, 'emit', function(event, field, file) { - assert.equal(event, 'file'); - assert.strictEqual(file, FILE); - }); - - gently.expect(form, '_maybeEnd'); - - cb(); - assert.equal(form._flushing, 0); - }); - - PART.emit('end'); - })(); -}); - -test(function _uploadPath() { - (function testUniqueId() { - var UUID_A, UUID_B; - gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, uuid) { - assert.equal(uploadDir, form.uploadDir); - UUID_A = uuid; - }); - form._uploadPath(); - - gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, uuid) { - UUID_B = uuid; - }); - form._uploadPath(); - - assert.notEqual(UUID_A, UUID_B); - })(); - - (function testFileExtension() { - form.keepExtensions = true; - var FILENAME = 'foo.jpg', - EXT = '.bar'; - - gently.expect(GENTLY.hijacked.path, 'extname', function(filename) { - assert.equal(filename, FILENAME); - gently.restore(path, 'extname'); - - return EXT; - }); - - gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, name) { - assert.equal(path.extname(name), EXT); - }); - form._uploadPath(FILENAME); - })(); -}); - -test(function _maybeEnd() { - gently.expect(form, 'emit', 0); - form._maybeEnd(); - - form.ended = true; - form._flushing = 1; - form._maybeEnd(); - - gently.expect(form, 'emit', function(event) { - assert.equal(event, 'end'); - }); - - form.ended = true; - form._flushing = 0; - form._maybeEnd(); -}); diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js deleted file mode 100644 index d8dc968..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +++ /dev/null @@ -1,50 +0,0 @@ -var common = require('../common'); -var multipartParser = require(common.lib + '/multipart_parser'), - MultipartParser = multipartParser.MultipartParser, - events = require('events'), - Buffer = require('buffer').Buffer, - parser; - -function test(test) { - parser = new MultipartParser(); - test(); -} - -test(function constructor() { - assert.equal(parser.boundary, null); - assert.equal(parser.state, 0); - assert.equal(parser.flags, 0); - assert.equal(parser.boundaryChars, null); - assert.equal(parser.index, null); - assert.equal(parser.lookbehind, null); - assert.equal(parser.constructor.name, 'MultipartParser'); -}); - -test(function initWithBoundary() { - var boundary = 'abc'; - parser.initWithBoundary(boundary); - assert.deepEqual(Array.prototype.slice.call(parser.boundary), [13, 10, 45, 45, 97, 98, 99]); - assert.equal(parser.state, multipartParser.START); - - assert.deepEqual(parser.boundaryChars, {10: true, 13: true, 45: true, 97: true, 98: true, 99: true}); -}); - -test(function parserError() { - var boundary = 'abc', - buffer = new Buffer(5); - - parser.initWithBoundary(boundary); - buffer.write('--ad', 'ascii', 0); - assert.equal(parser.write(buffer), 3); -}); - -test(function end() { - (function testError() { - assert.equal(parser.end().message, 'MultipartParser.end(): stream ended unexpectedly: ' + parser.explain()); - })(); - - (function testRegular() { - parser.state = multipartParser.END; - assert.strictEqual(parser.end(), undefined); - })(); -}); diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js deleted file mode 100644 index 54d3e2d..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js +++ /dev/null @@ -1,45 +0,0 @@ -var common = require('../common'); -var QuerystringParser = require(common.lib + '/querystring_parser').QuerystringParser, - Buffer = require('buffer').Buffer, - gently, - parser; - -function test(test) { - gently = new Gently(); - parser = new QuerystringParser(); - test(); - gently.verify(test.name); -} - -test(function constructor() { - assert.equal(parser.buffer, ''); - assert.equal(parser.constructor.name, 'QuerystringParser'); -}); - -test(function write() { - var a = new Buffer('a=1'); - assert.equal(parser.write(a), a.length); - - var b = new Buffer('&b=2'); - parser.write(b); - assert.equal(parser.buffer, a + b); -}); - -test(function end() { - var FIELDS = {a: ['b', {c: 'd'}], e: 'f'}; - - gently.expect(GENTLY.hijacked.querystring, 'parse', function(str) { - assert.equal(str, parser.buffer); - return FIELDS; - }); - - gently.expect(parser, 'onField', Object.keys(FIELDS).length, function(key, val) { - assert.deepEqual(FIELDS[key], val); - }); - - gently.expect(parser, 'onEnd'); - - parser.buffer = 'my buffer'; - parser.end(); - assert.equal(parser.buffer, ''); -}); diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js deleted file mode 100644 index fcfdb94..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js +++ /dev/null @@ -1,72 +0,0 @@ -var common = require('../common'); -var BOUNDARY = '---------------------------10102754414578508781458777923', - FIXTURE = TEST_FIXTURES+'/multi_video.upload', - fs = require('fs'), - util = require(common.lib + '/util'), - http = require('http'), - formidable = require(common.lib + '/index'), - server = http.createServer(); - -server.on('request', function(req, res) { - var form = new formidable.IncomingForm(), - uploads = {}; - - form.uploadDir = TEST_TMP; - form.parse(req); - - form - .on('fileBegin', function(field, file) { - assert.equal(field, 'upload'); - - var tracker = {file: file, progress: [], ended: false}; - uploads[file.filename] = tracker; - file - .on('progress', function(bytesReceived) { - tracker.progress.push(bytesReceived); - assert.equal(bytesReceived, file.length); - }) - .on('end', function() { - tracker.ended = true; - }); - }) - .on('field', function(field, value) { - assert.equal(field, 'title'); - assert.equal(value, ''); - }) - .on('file', function(field, file) { - assert.equal(field, 'upload'); - assert.strictEqual(uploads[file.filename].file, file); - }) - .on('end', function() { - assert.ok(uploads['shortest_video.flv']); - assert.ok(uploads['shortest_video.flv'].ended); - assert.ok(uploads['shortest_video.flv'].progress.length > 3); - assert.equal(uploads['shortest_video.flv'].progress.slice(-1), uploads['shortest_video.flv'].file.length); - assert.ok(uploads['shortest_video.mp4']); - assert.ok(uploads['shortest_video.mp4'].ended); - assert.ok(uploads['shortest_video.mp4'].progress.length > 3); - - server.close(); - res.writeHead(200); - res.end('good'); - }); -}); - -server.listen(TEST_PORT, function() { - var client = http.createClient(TEST_PORT), - stat = fs.statSync(FIXTURE), - headers = { - 'content-type': 'multipart/form-data; boundary='+BOUNDARY, - 'content-length': stat.size, - } - request = client.request('POST', '/', headers), - fixture = new fs.ReadStream(FIXTURE); - - fixture - .on('data', function(b) { - request.write(b); - }) - .on('end', function() { - request.end(); - }); -}); diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js deleted file mode 100755 index 50b2361..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('urun')(__dirname) diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js b/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js deleted file mode 100644 index bcf61d7..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js +++ /dev/null @@ -1,63 +0,0 @@ -var common = require('../common'); -var test = require('utest'); -var assert = common.assert; -var IncomingForm = common.require('incoming_form').IncomingForm; -var path = require('path'); - -var from; -test('IncomingForm', { - before: function() { - form = new IncomingForm(); - }, - - '#_fileName with regular characters': function() { - var filename = 'foo.txt'; - assert.equal(form._fileName(makeHeader(filename)), 'foo.txt'); - }, - - '#_fileName with unescaped quote': function() { - var filename = 'my".txt'; - assert.equal(form._fileName(makeHeader(filename)), 'my".txt'); - }, - - '#_fileName with escaped quote': function() { - var filename = 'my%22.txt'; - assert.equal(form._fileName(makeHeader(filename)), 'my".txt'); - }, - - '#_fileName with bad quote and additional sub-header': function() { - var filename = 'my".txt'; - var header = makeHeader(filename) + '; foo="bar"'; - assert.equal(form._fileName(header), filename); - }, - - '#_fileName with semicolon': function() { - var filename = 'my;.txt'; - assert.equal(form._fileName(makeHeader(filename)), 'my;.txt'); - }, - - '#_fileName with utf8 character': function() { - var filename = 'my☃.txt'; - assert.equal(form._fileName(makeHeader(filename)), 'my☃.txt'); - }, - - '#_uploadPath strips harmful characters from extension when keepExtensions': function() { - form.keepExtensions = true; - - var ext = path.extname(form._uploadPath('fine.jpg?foo=bar')); - assert.equal(ext, '.jpg'); - - var ext = path.extname(form._uploadPath('fine?foo=bar')); - assert.equal(ext, ''); - - var ext = path.extname(form._uploadPath('super.cr2+dsad')); - assert.equal(ext, '.cr2'); - - var ext = path.extname(form._uploadPath('super.bar')); - assert.equal(ext, '.bar'); - }, -}); - -function makeHeader(filename) { - return 'Content-Disposition: form-data; name="upload"; filename="' + filename + '"'; -} diff --git a/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js b/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js deleted file mode 100644 index 9f1cef8..0000000 --- a/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js +++ /dev/null @@ -1,47 +0,0 @@ -var http = require('http'); -var fs = require('fs'); -var connections = 0; - -var server = http.createServer(function(req, res) { - var socket = req.socket; - console.log('Request: %s %s -> %s', req.method, req.url, socket.filename); - - req.on('end', function() { - if (req.url !== '/') { - res.end(JSON.stringify({ - method: req.method, - url: req.url, - filename: socket.filename, - })); - return; - } - - res.writeHead(200, {'content-type': 'text/html'}); - res.end( - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    ' - ); - }); -}); - -server.on('connection', function(socket) { - connections++; - - socket.id = connections; - socket.filename = 'connection-' + socket.id + '.http'; - socket.file = fs.createWriteStream(socket.filename); - socket.pipe(socket.file); - - console.log('--> %s', socket.filename); - socket.on('close', function() { - console.log('<-- %s', socket.filename); - }); -}); - -var port = process.env.PORT || 8080; -server.listen(port, function() { - console.log('Recording connections on port %s', port); -}); diff --git a/node_modules/express/node_modules/connect/node_modules/mime/LICENSE b/node_modules/express/node_modules/connect/node_modules/mime/LICENSE deleted file mode 100644 index 451fc45..0000000 --- a/node_modules/express/node_modules/connect/node_modules/mime/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Benjamin Thomas, Robert Kieffer - -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/express/node_modules/connect/node_modules/mime/README.md b/node_modules/express/node_modules/connect/node_modules/mime/README.md deleted file mode 100644 index a157de1..0000000 --- a/node_modules/express/node_modules/connect/node_modules/mime/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# mime - -Support for mapping between file extensions and MIME types. This module uses the latest version of the Apache "mime.types" file (maps over 620 types to 800+ extensions). It is also trivially easy to add your own types and extensions, should you need to do that. - -## Install - -Install with [npm](http://github.com/isaacs/npm): - - npm install mime - -## API - Queries - -### mime.lookup(path) -Get the mime type associated with a file. This is method is case-insensitive. Everything in path up to and including the last '/' or '.' is ignored, so you can pass it paths, filenames, or extensions, like so: - - var mime = require('mime'); - - mime.lookup('/path/to/file.txt'); // => 'text/plain' - mime.lookup('file.txt'); // => 'text/plain' - mime.lookup('.txt'); // => 'text/plain' - mime.lookup('htm'); // => 'text/html' - -### mime.extension(type) - lookup the default extension for type - - mime.extension('text/html'); // => 'html' - mime.extension('application/octet-stream'); // => 'bin' - -### mime.charsets.lookup() - map mime-type to charset - - mime.charsets.lookup('text/plain'); // => 'UTF-8' - -(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) - -## API - Customizing - -The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/bentomas/node-mime/wiki/Requesting-New-Types). -### mime.define() - Add custom mime/extension mappings - - mime.define({ - 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], - 'application/x-my-type': ['x-mt', 'x-mtt'], - // etc ... - }); - - mime.lookup('x-sft'); // => 'text/x-some-format' - mime.extension('text/x-some-format'); // => 'x-sf' - -### mime.load(filepath) - Load mappings from an Apache ".types" format file - - mime.load('./my_project.types'); diff --git a/node_modules/express/node_modules/connect/node_modules/mime/mime.js b/node_modules/express/node_modules/connect/node_modules/mime/mime.js deleted file mode 100644 index 5fac753..0000000 --- a/node_modules/express/node_modules/connect/node_modules/mime/mime.js +++ /dev/null @@ -1,92 +0,0 @@ -var path = require('path'), - fs = require('fs'); - -var mime = module.exports = { - /** Map of extension to mime type */ - types: {}, - - /** Map of mime type to extension */ - extensions :{}, - - /** - * Define mimetype -> extension mappings. Each key is a mime-type that maps - * to an array of extensions associated with the type. The first extension is - * used as the default extension for the type. - * - * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); - * - * @param map (Object) type definitions - */ - define: function(map) { - for (var type in map) { - var exts = map[type]; - - for (var i = 0; i < exts.length; i++) { - mime.types[exts[i]] = type; - } - - // Default extension is the first one we encounter - if (!mime.extensions[type]) { - mime.extensions[type] = exts[0]; - } - } - }, - - /** - * Load an Apache2-style ".types" file - * - * This may be called multiple times (it's expected). Where files declare - * overlapping types/extensions, the last file wins. - * - * @param file (String) path of file to load. - */ - load: function(file) { - // Read file and split into lines - var map = {}, - content = fs.readFileSync(file, 'ascii'), - lines = content.split(/[\r\n]+/); - - lines.forEach(function(line, lineno) { - // Clean up whitespace/comments, and split into fields - var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); - map[fields.shift()] = fields; - }); - - mime.define(map); - }, - - /** - * Lookup a mime type based on extension - */ - lookup: function(path, fallback) { - var ext = path.replace(/.*[\.\/]/, '').toLowerCase(); - return mime.types[ext] || fallback || mime.default_type; - }, - - /** - * Return file extension associated with a mime type - */ - extension: function(mimeType) { - return mime.extensions[mimeType]; - }, - - /** - * Lookup a charset based on mime type. - */ - charsets: { - lookup: function (mimeType, fallback) { - // Assume text types are utf8. Modify mime logic as needed. - return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; - } - } -}; - -// Load our local copy of -// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -mime.load(path.join(__dirname, 'types/mime.types')); - -// Overlay enhancements submitted by the node.js community -mime.load(path.join(__dirname, 'types/node.types')); - -// Set the default type -mime.default_type = mime.types.bin; diff --git a/node_modules/express/node_modules/connect/node_modules/mime/package.json b/node_modules/express/node_modules/connect/node_modules/mime/package.json deleted file mode 100644 index 33ec0cd..0000000 --- a/node_modules/express/node_modules/connect/node_modules/mime/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com", - "url": "http://github.com/broofa" - }, - "contributors": [ - { - "name": "Benjamin Thomas", - "email": "benjamin@benjaminthomas.org", - "url": "http://github.com/bentomas" - } - ], - "dependencies": {}, - "description": "A comprehensive library for mime-type mapping", - "devDependencies": { - "async_testing": "" - }, - "keywords": [ - "util", - "mime" - ], - "main": "mime.js", - "name": "mime", - "repository": { - "url": "git://github.com/bentomas/node-mime.git", - "type": "git" - }, - "version": "1.2.4", - "_id": "mime@1.2.4", - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "mime@1.2.4" -} diff --git a/node_modules/express/node_modules/connect/node_modules/mime/test.js b/node_modules/express/node_modules/connect/node_modules/mime/test.js deleted file mode 100644 index b904895..0000000 --- a/node_modules/express/node_modules/connect/node_modules/mime/test.js +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Requires the async_testing module - * - * Usage: node test.js - */ -var mime = require('./mime'); -exports["test mime lookup"] = function(test) { - // easy - test.equal('text/plain', mime.lookup('text.txt')); - - // hidden file or multiple periods - test.equal('text/plain', mime.lookup('.text.txt')); - - // just an extension - test.equal('text/plain', mime.lookup('.txt')); - - // just an extension without a dot - test.equal('text/plain', mime.lookup('txt')); - - // default - test.equal('application/octet-stream', mime.lookup('text.nope')); - - // fallback - test.equal('fallback', mime.lookup('text.fallback', 'fallback')); - - test.finish(); -}; - -exports["test extension lookup"] = function(test) { - // easy - test.equal('txt', mime.extension(mime.types.text)); - test.equal('html', mime.extension(mime.types.htm)); - test.equal('bin', mime.extension('application/octet-stream')); - - test.finish(); -}; - -exports["test mime lookup uppercase"] = function(test) { - // easy - test.equal('text/plain', mime.lookup('TEXT.TXT')); - - // just an extension - test.equal('text/plain', mime.lookup('.TXT')); - - // just an extension without a dot - test.equal('text/plain', mime.lookup('TXT')); - - // default - test.equal('application/octet-stream', mime.lookup('TEXT.NOPE')); - - // fallback - test.equal('fallback', mime.lookup('TEXT.FALLBACK', 'fallback')); - - test.finish(); -}; - -exports["test custom types"] = function(test) { - test.equal('application/octet-stream', mime.lookup('file.buffer')); - test.equal('audio/mp4', mime.lookup('file.m4a')); - - test.finish(); -}; - -exports["test charset lookup"] = function(test) { - // easy - test.equal('UTF-8', mime.charsets.lookup('text/plain')); - - // none - test.ok(typeof mime.charsets.lookup(mime.types.js) == 'undefined'); - - // fallback - test.equal('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); - - test.finish(); -}; - -if (module == require.main) { - require('async_testing').run(__filename, process.ARGV); -} diff --git a/node_modules/express/node_modules/connect/node_modules/mime/types/mime.types b/node_modules/express/node_modules/connect/node_modules/mime/types/mime.types deleted file mode 100644 index 6a90929..0000000 --- a/node_modules/express/node_modules/connect/node_modules/mime/types/mime.types +++ /dev/null @@ -1,1479 +0,0 @@ -# This file maps Internet media types to unique file extension(s). -# Although created for httpd, this file is used by many software systems -# and has been placed in the public domain for unlimited redisribution. -# -# The table below contains both registered and (common) unregistered types. -# A type that has no unique extension can be ignored -- they are listed -# here to guide configurations toward known types and to make it easier to -# identify "new" types. File extensions are also commonly used to indicate -# content languages and encodings, so choose them carefully. -# -# Internet media types should be registered as described in RFC 4288. -# The registry is at . -# -# MIME type (lowercased) Extensions -# ============================================ ========== -# application/1d-interleaved-parityfec -# application/3gpp-ims+xml -# application/activemessage -application/andrew-inset ez -# application/applefile -application/applixware aw -application/atom+xml atom -application/atomcat+xml atomcat -# application/atomicmail -application/atomsvc+xml atomsvc -# application/auth-policy+xml -# application/batch-smtp -# application/beep+xml -# application/cals-1840 -application/ccxml+xml ccxml -application/cdmi-capability cdmia -application/cdmi-container cdmic -application/cdmi-domain cdmid -application/cdmi-object cdmio -application/cdmi-queue cdmiq -# application/cea-2018+xml -# application/cellml+xml -# application/cfw -# application/cnrp+xml -# application/commonground -# application/conference-info+xml -# application/cpl+xml -# application/csta+xml -# application/cstadata+xml -application/cu-seeme cu -# application/cybercash -application/davmount+xml davmount -# application/dca-rft -# application/dec-dx -# application/dialog-info+xml -# application/dicom -# application/dns -# application/dskpp+xml -application/dssc+der dssc -application/dssc+xml xdssc -# application/dvcs -application/ecmascript ecma -# application/edi-consent -# application/edi-x12 -# application/edifact -application/emma+xml emma -# application/epp+xml -application/epub+zip epub -# application/eshop -# application/example -application/exi exi -# application/fastinfoset -# application/fastsoap -# application/fits -application/font-tdpfr pfr -# application/framework-attributes+xml -# application/h224 -# application/held+xml -# application/http -application/hyperstudio stk -# application/ibe-key-request+xml -# application/ibe-pkg-reply+xml -# application/ibe-pp-data -# application/iges -# application/im-iscomposing+xml -# application/index -# application/index.cmd -# application/index.obj -# application/index.response -# application/index.vnd -# application/iotp -application/ipfix ipfix -# application/ipp -# application/isup -application/java-archive jar -application/java-serialized-object ser -application/java-vm class -application/javascript js -application/json json -# application/kpml-request+xml -# application/kpml-response+xml -application/lost+xml lostxml -application/mac-binhex40 hqx -application/mac-compactpro cpt -# application/macwriteii -application/mads+xml mads -application/marc mrc -application/marcxml+xml mrcx -application/mathematica ma nb mb -# application/mathml-content+xml -# application/mathml-presentation+xml -application/mathml+xml mathml -# application/mbms-associated-procedure-description+xml -# application/mbms-deregister+xml -# application/mbms-envelope+xml -# application/mbms-msk+xml -# application/mbms-msk-response+xml -# application/mbms-protection-description+xml -# application/mbms-reception-report+xml -# application/mbms-register+xml -# application/mbms-register-response+xml -# application/mbms-user-service-description+xml -application/mbox mbox -# application/media_control+xml -application/mediaservercontrol+xml mscml -application/metalink4+xml meta4 -application/mets+xml mets -# application/mikey -application/mods+xml mods -# application/moss-keys -# application/moss-signature -# application/mosskey-data -# application/mosskey-request -application/mp21 m21 mp21 -application/mp4 mp4s -# application/mpeg4-generic -# application/mpeg4-iod -# application/mpeg4-iod-xmt -# application/msc-ivr+xml -# application/msc-mixer+xml -application/msword doc dot -application/mxf mxf -# application/nasdata -# application/news-checkgroups -# application/news-groupinfo -# application/news-transmission -# application/nss -# application/ocsp-request -# application/ocsp-response -application/octet-stream bin dms lha lrf lzh so iso dmg dist distz pkg bpk dump elc deploy -application/oda oda -application/oebps-package+xml opf -application/ogg ogx -application/onenote onetoc onetoc2 onetmp onepkg -# application/parityfec -application/patch-ops-error+xml xer -application/pdf pdf -application/pgp-encrypted pgp -# application/pgp-keys -application/pgp-signature asc sig -application/pics-rules prf -# application/pidf+xml -# application/pidf-diff+xml -application/pkcs10 p10 -application/pkcs7-mime p7m p7c -application/pkcs7-signature p7s -application/pkcs8 p8 -application/pkix-attr-cert ac -application/pkix-cert cer -application/pkix-crl crl -application/pkix-pkipath pkipath -application/pkixcmp pki -application/pls+xml pls -# application/poc-settings+xml -application/postscript ai eps ps -# application/prs.alvestrand.titrax-sheet -application/prs.cww cww -# application/prs.nprend -# application/prs.plucker -# application/prs.rdf-xml-crypt -# application/prs.xsf+xml -application/pskc+xml pskcxml -# application/qsig -application/rdf+xml rdf -application/reginfo+xml rif -application/relax-ng-compact-syntax rnc -# application/remote-printing -application/resource-lists+xml rl -application/resource-lists-diff+xml rld -# application/riscos -# application/rlmi+xml -application/rls-services+xml rs -application/rsd+xml rsd -application/rss+xml rss -application/rtf rtf -# application/rtx -# application/samlassertion+xml -# application/samlmetadata+xml -application/sbml+xml sbml -application/scvp-cv-request scq -application/scvp-cv-response scs -application/scvp-vp-request spq -application/scvp-vp-response spp -application/sdp sdp -# application/set-payment -application/set-payment-initiation setpay -# application/set-registration -application/set-registration-initiation setreg -# application/sgml -# application/sgml-open-catalog -application/shf+xml shf -# application/sieve -# application/simple-filter+xml -# application/simple-message-summary -# application/simplesymbolcontainer -# application/slate -# application/smil -application/smil+xml smi smil -# application/soap+fastinfoset -# application/soap+xml -application/sparql-query rq -application/sparql-results+xml srx -# application/spirits-event+xml -application/srgs gram -application/srgs+xml grxml -application/sru+xml sru -application/ssml+xml ssml -# application/tamp-apex-update -# application/tamp-apex-update-confirm -# application/tamp-community-update -# application/tamp-community-update-confirm -# application/tamp-error -# application/tamp-sequence-adjust -# application/tamp-sequence-adjust-confirm -# application/tamp-status-query -# application/tamp-status-response -# application/tamp-update -# application/tamp-update-confirm -application/tei+xml tei teicorpus -application/thraud+xml tfi -# application/timestamp-query -# application/timestamp-reply -application/timestamped-data tsd -# application/tve-trigger -# application/ulpfec -# application/vemmi -# application/vividence.scriptfile -# application/vnd.3gpp.bsf+xml -application/vnd.3gpp.pic-bw-large plb -application/vnd.3gpp.pic-bw-small psb -application/vnd.3gpp.pic-bw-var pvb -# application/vnd.3gpp.sms -# application/vnd.3gpp2.bcmcsinfo+xml -# application/vnd.3gpp2.sms -application/vnd.3gpp2.tcap tcap -application/vnd.3m.post-it-notes pwn -application/vnd.accpac.simply.aso aso -application/vnd.accpac.simply.imp imp -application/vnd.acucobol acu -application/vnd.acucorp atc acutc -application/vnd.adobe.air-application-installer-package+zip air -application/vnd.adobe.fxp fxp fxpl -# application/vnd.adobe.partial-upload -application/vnd.adobe.xdp+xml xdp -application/vnd.adobe.xfdf xfdf -# application/vnd.aether.imp -# application/vnd.ah-barcode -application/vnd.ahead.space ahead -application/vnd.airzip.filesecure.azf azf -application/vnd.airzip.filesecure.azs azs -application/vnd.amazon.ebook azw -application/vnd.americandynamics.acc acc -application/vnd.amiga.ami ami -# application/vnd.amundsen.maze+xml -application/vnd.android.package-archive apk -application/vnd.anser-web-certificate-issue-initiation cii -application/vnd.anser-web-funds-transfer-initiation fti -application/vnd.antix.game-component atx -application/vnd.apple.installer+xml mpkg -application/vnd.apple.mpegurl m3u8 -# application/vnd.arastra.swi -application/vnd.aristanetworks.swi swi -application/vnd.audiograph aep -# application/vnd.autopackage -# application/vnd.avistar+xml -application/vnd.blueice.multipass mpm -# application/vnd.bluetooth.ep.oob -application/vnd.bmi bmi -application/vnd.businessobjects rep -# application/vnd.cab-jscript -# application/vnd.canon-cpdl -# application/vnd.canon-lips -# application/vnd.cendio.thinlinc.clientconf -application/vnd.chemdraw+xml cdxml -application/vnd.chipnuts.karaoke-mmd mmd -application/vnd.cinderella cdy -# application/vnd.cirpack.isdn-ext -application/vnd.claymore cla -application/vnd.cloanto.rp9 rp9 -application/vnd.clonk.c4group c4g c4d c4f c4p c4u -application/vnd.cluetrust.cartomobile-config c11amc -application/vnd.cluetrust.cartomobile-config-pkg c11amz -# application/vnd.commerce-battelle -application/vnd.commonspace csp -application/vnd.contact.cmsg cdbcmsg -application/vnd.cosmocaller cmc -application/vnd.crick.clicker clkx -application/vnd.crick.clicker.keyboard clkk -application/vnd.crick.clicker.palette clkp -application/vnd.crick.clicker.template clkt -application/vnd.crick.clicker.wordbank clkw -application/vnd.criticaltools.wbs+xml wbs -application/vnd.ctc-posml pml -# application/vnd.ctct.ws+xml -# application/vnd.cups-pdf -# application/vnd.cups-postscript -application/vnd.cups-ppd ppd -# application/vnd.cups-raster -# application/vnd.cups-raw -application/vnd.curl.car car -application/vnd.curl.pcurl pcurl -# application/vnd.cybank -application/vnd.data-vision.rdz rdz -application/vnd.dece.data uvf uvvf uvd uvvd -application/vnd.dece.ttml+xml uvt uvvt -application/vnd.dece.unspecified uvx uvvx -application/vnd.denovo.fcselayout-link fe_launch -# application/vnd.dir-bi.plate-dl-nosuffix -application/vnd.dna dna -application/vnd.dolby.mlp mlp -# application/vnd.dolby.mobile.1 -# application/vnd.dolby.mobile.2 -application/vnd.dpgraph dpg -application/vnd.dreamfactory dfac -application/vnd.dvb.ait ait -# application/vnd.dvb.dvbj -# application/vnd.dvb.esgcontainer -# application/vnd.dvb.ipdcdftnotifaccess -# application/vnd.dvb.ipdcesgaccess -# application/vnd.dvb.ipdcesgaccess2 -# application/vnd.dvb.ipdcesgpdd -# application/vnd.dvb.ipdcroaming -# application/vnd.dvb.iptv.alfec-base -# application/vnd.dvb.iptv.alfec-enhancement -# application/vnd.dvb.notif-aggregate-root+xml -# application/vnd.dvb.notif-container+xml -# application/vnd.dvb.notif-generic+xml -# application/vnd.dvb.notif-ia-msglist+xml -# application/vnd.dvb.notif-ia-registration-request+xml -# application/vnd.dvb.notif-ia-registration-response+xml -# application/vnd.dvb.notif-init+xml -# application/vnd.dvb.pfr -application/vnd.dvb.service svc -# application/vnd.dxr -application/vnd.dynageo geo -# application/vnd.easykaraoke.cdgdownload -# application/vnd.ecdis-update -application/vnd.ecowin.chart mag -# application/vnd.ecowin.filerequest -# application/vnd.ecowin.fileupdate -# application/vnd.ecowin.series -# application/vnd.ecowin.seriesrequest -# application/vnd.ecowin.seriesupdate -# application/vnd.emclient.accessrequest+xml -application/vnd.enliven nml -application/vnd.epson.esf esf -application/vnd.epson.msf msf -application/vnd.epson.quickanime qam -application/vnd.epson.salt slt -application/vnd.epson.ssf ssf -# application/vnd.ericsson.quickcall -application/vnd.eszigno3+xml es3 et3 -# application/vnd.etsi.aoc+xml -# application/vnd.etsi.cug+xml -# application/vnd.etsi.iptvcommand+xml -# application/vnd.etsi.iptvdiscovery+xml -# application/vnd.etsi.iptvprofile+xml -# application/vnd.etsi.iptvsad-bc+xml -# application/vnd.etsi.iptvsad-cod+xml -# application/vnd.etsi.iptvsad-npvr+xml -# application/vnd.etsi.iptvservice+xml -# application/vnd.etsi.iptvsync+xml -# application/vnd.etsi.iptvueprofile+xml -# application/vnd.etsi.mcid+xml -# application/vnd.etsi.overload-control-policy-dataset+xml -# application/vnd.etsi.sci+xml -# application/vnd.etsi.simservs+xml -# application/vnd.etsi.tsl+xml -# application/vnd.etsi.tsl.der -# application/vnd.eudora.data -application/vnd.ezpix-album ez2 -application/vnd.ezpix-package ez3 -# application/vnd.f-secure.mobile -application/vnd.fdf fdf -application/vnd.fdsn.mseed mseed -application/vnd.fdsn.seed seed dataless -# application/vnd.ffsns -# application/vnd.fints -application/vnd.flographit gph -application/vnd.fluxtime.clip ftc -# application/vnd.font-fontforge-sfd -application/vnd.framemaker fm frame maker book -application/vnd.frogans.fnc fnc -application/vnd.frogans.ltf ltf -application/vnd.fsc.weblaunch fsc -application/vnd.fujitsu.oasys oas -application/vnd.fujitsu.oasys2 oa2 -application/vnd.fujitsu.oasys3 oa3 -application/vnd.fujitsu.oasysgp fg5 -application/vnd.fujitsu.oasysprs bh2 -# application/vnd.fujixerox.art-ex -# application/vnd.fujixerox.art4 -# application/vnd.fujixerox.hbpl -application/vnd.fujixerox.ddd ddd -application/vnd.fujixerox.docuworks xdw -application/vnd.fujixerox.docuworks.binder xbd -# application/vnd.fut-misnet -application/vnd.fuzzysheet fzs -application/vnd.genomatix.tuxedo txd -# application/vnd.geocube+xml -application/vnd.geogebra.file ggb -application/vnd.geogebra.tool ggt -application/vnd.geometry-explorer gex gre -application/vnd.geonext gxt -application/vnd.geoplan g2w -application/vnd.geospace g3w -# application/vnd.globalplatform.card-content-mgt -# application/vnd.globalplatform.card-content-mgt-response -application/vnd.gmx gmx -application/vnd.google-earth.kml+xml kml -application/vnd.google-earth.kmz kmz -application/vnd.grafeq gqf gqs -# application/vnd.gridmp -application/vnd.groove-account gac -application/vnd.groove-help ghf -application/vnd.groove-identity-message gim -application/vnd.groove-injector grv -application/vnd.groove-tool-message gtm -application/vnd.groove-tool-template tpl -application/vnd.groove-vcard vcg -application/vnd.hal+xml hal -application/vnd.handheld-entertainment+xml zmm -application/vnd.hbci hbci -# application/vnd.hcl-bireports -application/vnd.hhe.lesson-player les -application/vnd.hp-hpgl hpgl -application/vnd.hp-hpid hpid -application/vnd.hp-hps hps -application/vnd.hp-jlyt jlt -application/vnd.hp-pcl pcl -application/vnd.hp-pclxl pclxl -# application/vnd.httphone -application/vnd.hydrostatix.sof-data sfd-hdstx -application/vnd.hzn-3d-crossword x3d -# application/vnd.ibm.afplinedata -# application/vnd.ibm.electronic-media -application/vnd.ibm.minipay mpy -application/vnd.ibm.modcap afp listafp list3820 -application/vnd.ibm.rights-management irm -application/vnd.ibm.secure-container sc -application/vnd.iccprofile icc icm -application/vnd.igloader igl -application/vnd.immervision-ivp ivp -application/vnd.immervision-ivu ivu -# application/vnd.informedcontrol.rms+xml -# application/vnd.informix-visionary -# application/vnd.infotech.project -# application/vnd.infotech.project+xml -application/vnd.insors.igm igm -application/vnd.intercon.formnet xpw xpx -application/vnd.intergeo i2g -# application/vnd.intertrust.digibox -# application/vnd.intertrust.nncp -application/vnd.intu.qbo qbo -application/vnd.intu.qfx qfx -# application/vnd.iptc.g2.conceptitem+xml -# application/vnd.iptc.g2.knowledgeitem+xml -# application/vnd.iptc.g2.newsitem+xml -# application/vnd.iptc.g2.packageitem+xml -application/vnd.ipunplugged.rcprofile rcprofile -application/vnd.irepository.package+xml irp -application/vnd.is-xpr xpr -application/vnd.isac.fcs fcs -application/vnd.jam jam -# application/vnd.japannet-directory-service -# application/vnd.japannet-jpnstore-wakeup -# application/vnd.japannet-payment-wakeup -# application/vnd.japannet-registration -# application/vnd.japannet-registration-wakeup -# application/vnd.japannet-setstore-wakeup -# application/vnd.japannet-verification -# application/vnd.japannet-verification-wakeup -application/vnd.jcp.javame.midlet-rms rms -application/vnd.jisp jisp -application/vnd.joost.joda-archive joda -application/vnd.kahootz ktz ktr -application/vnd.kde.karbon karbon -application/vnd.kde.kchart chrt -application/vnd.kde.kformula kfo -application/vnd.kde.kivio flw -application/vnd.kde.kontour kon -application/vnd.kde.kpresenter kpr kpt -application/vnd.kde.kspread ksp -application/vnd.kde.kword kwd kwt -application/vnd.kenameaapp htke -application/vnd.kidspiration kia -application/vnd.kinar kne knp -application/vnd.koan skp skd skt skm -application/vnd.kodak-descriptor sse -application/vnd.las.las+xml lasxml -# application/vnd.liberty-request+xml -application/vnd.llamagraphics.life-balance.desktop lbd -application/vnd.llamagraphics.life-balance.exchange+xml lbe -application/vnd.lotus-1-2-3 123 -application/vnd.lotus-approach apr -application/vnd.lotus-freelance pre -application/vnd.lotus-notes nsf -application/vnd.lotus-organizer org -application/vnd.lotus-screencam scm -application/vnd.lotus-wordpro lwp -application/vnd.macports.portpkg portpkg -# application/vnd.marlin.drm.actiontoken+xml -# application/vnd.marlin.drm.conftoken+xml -# application/vnd.marlin.drm.license+xml -# application/vnd.marlin.drm.mdcf -application/vnd.mcd mcd -application/vnd.medcalcdata mc1 -application/vnd.mediastation.cdkey cdkey -# application/vnd.meridian-slingshot -application/vnd.mfer mwf -application/vnd.mfmp mfm -application/vnd.micrografx.flo flo -application/vnd.micrografx.igx igx -application/vnd.mif mif -# application/vnd.minisoft-hp3000-save -# application/vnd.mitsubishi.misty-guard.trustweb -application/vnd.mobius.daf daf -application/vnd.mobius.dis dis -application/vnd.mobius.mbk mbk -application/vnd.mobius.mqy mqy -application/vnd.mobius.msl msl -application/vnd.mobius.plc plc -application/vnd.mobius.txf txf -application/vnd.mophun.application mpn -application/vnd.mophun.certificate mpc -# application/vnd.motorola.flexsuite -# application/vnd.motorola.flexsuite.adsi -# application/vnd.motorola.flexsuite.fis -# application/vnd.motorola.flexsuite.gotap -# application/vnd.motorola.flexsuite.kmr -# application/vnd.motorola.flexsuite.ttc -# application/vnd.motorola.flexsuite.wem -# application/vnd.motorola.iprm -application/vnd.mozilla.xul+xml xul -application/vnd.ms-artgalry cil -# application/vnd.ms-asf -application/vnd.ms-cab-compressed cab -application/vnd.ms-excel xls xlm xla xlc xlt xlw -application/vnd.ms-excel.addin.macroenabled.12 xlam -application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb -application/vnd.ms-excel.sheet.macroenabled.12 xlsm -application/vnd.ms-excel.template.macroenabled.12 xltm -application/vnd.ms-fontobject eot -application/vnd.ms-htmlhelp chm -application/vnd.ms-ims ims -application/vnd.ms-lrm lrm -# application/vnd.ms-office.activex+xml -application/vnd.ms-officetheme thmx -application/vnd.ms-pki.seccat cat -application/vnd.ms-pki.stl stl -# application/vnd.ms-playready.initiator+xml -application/vnd.ms-powerpoint ppt pps pot -application/vnd.ms-powerpoint.addin.macroenabled.12 ppam -application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm -application/vnd.ms-powerpoint.slide.macroenabled.12 sldm -application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm -application/vnd.ms-powerpoint.template.macroenabled.12 potm -application/vnd.ms-project mpp mpt -# application/vnd.ms-tnef -# application/vnd.ms-wmdrm.lic-chlg-req -# application/vnd.ms-wmdrm.lic-resp -# application/vnd.ms-wmdrm.meter-chlg-req -# application/vnd.ms-wmdrm.meter-resp -application/vnd.ms-word.document.macroenabled.12 docm -application/vnd.ms-word.template.macroenabled.12 dotm -application/vnd.ms-works wps wks wcm wdb -application/vnd.ms-wpl wpl -application/vnd.ms-xpsdocument xps -application/vnd.mseq mseq -# application/vnd.msign -# application/vnd.multiad.creator -# application/vnd.multiad.creator.cif -# application/vnd.music-niff -application/vnd.musician mus -application/vnd.muvee.style msty -# application/vnd.ncd.control -# application/vnd.ncd.reference -# application/vnd.nervana -# application/vnd.netfpx -application/vnd.neurolanguage.nlu nlu -application/vnd.noblenet-directory nnd -application/vnd.noblenet-sealer nns -application/vnd.noblenet-web nnw -# application/vnd.nokia.catalogs -# application/vnd.nokia.conml+wbxml -# application/vnd.nokia.conml+xml -# application/vnd.nokia.isds-radio-presets -# application/vnd.nokia.iptv.config+xml -# application/vnd.nokia.landmark+wbxml -# application/vnd.nokia.landmark+xml -# application/vnd.nokia.landmarkcollection+xml -# application/vnd.nokia.n-gage.ac+xml -application/vnd.nokia.n-gage.data ngdat -application/vnd.nokia.n-gage.symbian.install n-gage -# application/vnd.nokia.ncd -# application/vnd.nokia.pcd+wbxml -# application/vnd.nokia.pcd+xml -application/vnd.nokia.radio-preset rpst -application/vnd.nokia.radio-presets rpss -application/vnd.novadigm.edm edm -application/vnd.novadigm.edx edx -application/vnd.novadigm.ext ext -# application/vnd.ntt-local.file-transfer -# application/vnd.ntt-local.sip-ta_remote -# application/vnd.ntt-local.sip-ta_tcp_stream -application/vnd.oasis.opendocument.chart odc -application/vnd.oasis.opendocument.chart-template otc -application/vnd.oasis.opendocument.database odb -application/vnd.oasis.opendocument.formula odf -application/vnd.oasis.opendocument.formula-template odft -application/vnd.oasis.opendocument.graphics odg -application/vnd.oasis.opendocument.graphics-template otg -application/vnd.oasis.opendocument.image odi -application/vnd.oasis.opendocument.image-template oti -application/vnd.oasis.opendocument.presentation odp -application/vnd.oasis.opendocument.presentation-template otp -application/vnd.oasis.opendocument.spreadsheet ods -application/vnd.oasis.opendocument.spreadsheet-template ots -application/vnd.oasis.opendocument.text odt -application/vnd.oasis.opendocument.text-master odm -application/vnd.oasis.opendocument.text-template ott -application/vnd.oasis.opendocument.text-web oth -# application/vnd.obn -# application/vnd.oipf.contentaccessdownload+xml -# application/vnd.oipf.contentaccessstreaming+xml -# application/vnd.oipf.cspg-hexbinary -# application/vnd.oipf.dae.svg+xml -# application/vnd.oipf.dae.xhtml+xml -# application/vnd.oipf.mippvcontrolmessage+xml -# application/vnd.oipf.pae.gem -# application/vnd.oipf.spdiscovery+xml -# application/vnd.oipf.spdlist+xml -# application/vnd.oipf.ueprofile+xml -# application/vnd.oipf.userprofile+xml -application/vnd.olpc-sugar xo -# application/vnd.oma-scws-config -# application/vnd.oma-scws-http-request -# application/vnd.oma-scws-http-response -# application/vnd.oma.bcast.associated-procedure-parameter+xml -# application/vnd.oma.bcast.drm-trigger+xml -# application/vnd.oma.bcast.imd+xml -# application/vnd.oma.bcast.ltkm -# application/vnd.oma.bcast.notification+xml -# application/vnd.oma.bcast.provisioningtrigger -# application/vnd.oma.bcast.sgboot -# application/vnd.oma.bcast.sgdd+xml -# application/vnd.oma.bcast.sgdu -# application/vnd.oma.bcast.simple-symbol-container -# application/vnd.oma.bcast.smartcard-trigger+xml -# application/vnd.oma.bcast.sprov+xml -# application/vnd.oma.bcast.stkm -# application/vnd.oma.cab-address-book+xml -# application/vnd.oma.cab-pcc+xml -# application/vnd.oma.dcd -# application/vnd.oma.dcdc -application/vnd.oma.dd2+xml dd2 -# application/vnd.oma.drm.risd+xml -# application/vnd.oma.group-usage-list+xml -# application/vnd.oma.poc.detailed-progress-report+xml -# application/vnd.oma.poc.final-report+xml -# application/vnd.oma.poc.groups+xml -# application/vnd.oma.poc.invocation-descriptor+xml -# application/vnd.oma.poc.optimized-progress-report+xml -# application/vnd.oma.push -# application/vnd.oma.scidm.messages+xml -# application/vnd.oma.xcap-directory+xml -# application/vnd.omads-email+xml -# application/vnd.omads-file+xml -# application/vnd.omads-folder+xml -# application/vnd.omaloc-supl-init -application/vnd.openofficeorg.extension oxt -# application/vnd.openxmlformats-officedocument.custom-properties+xml -# application/vnd.openxmlformats-officedocument.customxmlproperties+xml -# application/vnd.openxmlformats-officedocument.drawing+xml -# application/vnd.openxmlformats-officedocument.drawingml.chart+xml -# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml -# application/vnd.openxmlformats-officedocument.extended-properties+xml -# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml -# application/vnd.openxmlformats-officedocument.presentationml.comments+xml -# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml -application/vnd.openxmlformats-officedocument.presentationml.presentation pptx -# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml -application/vnd.openxmlformats-officedocument.presentationml.slide sldx -# application/vnd.openxmlformats-officedocument.presentationml.slide+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml -application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx -# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml -# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml -# application/vnd.openxmlformats-officedocument.presentationml.tags+xml -application/vnd.openxmlformats-officedocument.presentationml.template potx -# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx -# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml -# application/vnd.openxmlformats-officedocument.theme+xml -# application/vnd.openxmlformats-officedocument.themeoverride+xml -# application/vnd.openxmlformats-officedocument.vmldrawing -# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.document docx -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx -# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml -# application/vnd.openxmlformats-package.core-properties+xml -# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml -# application/vnd.openxmlformats-package.relationships+xml -# application/vnd.quobject-quoxdocument -# application/vnd.osa.netdeploy -application/vnd.osgeo.mapguide.package mgp -# application/vnd.osgi.bundle -application/vnd.osgi.dp dp -# application/vnd.otps.ct-kip+xml -application/vnd.palm pdb pqa oprc -# application/vnd.paos.xml -application/vnd.pawaafile paw -application/vnd.pg.format str -application/vnd.pg.osasli ei6 -# application/vnd.piaccess.application-licence -application/vnd.picsel efif -application/vnd.pmi.widget wg -# application/vnd.poc.group-advertisement+xml -application/vnd.pocketlearn plf -application/vnd.powerbuilder6 pbd -# application/vnd.powerbuilder6-s -# application/vnd.powerbuilder7 -# application/vnd.powerbuilder7-s -# application/vnd.powerbuilder75 -# application/vnd.powerbuilder75-s -# application/vnd.preminet -application/vnd.previewsystems.box box -application/vnd.proteus.magazine mgz -application/vnd.publishare-delta-tree qps -application/vnd.pvi.ptid1 ptid -# application/vnd.pwg-multiplexed -# application/vnd.pwg-xhtml-print+xml -# application/vnd.qualcomm.brew-app-res -application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb -# application/vnd.radisys.moml+xml -# application/vnd.radisys.msml+xml -# application/vnd.radisys.msml-audit+xml -# application/vnd.radisys.msml-audit-conf+xml -# application/vnd.radisys.msml-audit-conn+xml -# application/vnd.radisys.msml-audit-dialog+xml -# application/vnd.radisys.msml-audit-stream+xml -# application/vnd.radisys.msml-conf+xml -# application/vnd.radisys.msml-dialog+xml -# application/vnd.radisys.msml-dialog-base+xml -# application/vnd.radisys.msml-dialog-fax-detect+xml -# application/vnd.radisys.msml-dialog-fax-sendrecv+xml -# application/vnd.radisys.msml-dialog-group+xml -# application/vnd.radisys.msml-dialog-speech+xml -# application/vnd.radisys.msml-dialog-transform+xml -# application/vnd.rainstor.data -# application/vnd.rapid -application/vnd.realvnc.bed bed -application/vnd.recordare.musicxml mxl -application/vnd.recordare.musicxml+xml musicxml -# application/vnd.renlearn.rlprint -application/vnd.rig.cryptonote cryptonote -application/vnd.rim.cod cod -application/vnd.rn-realmedia rm -application/vnd.route66.link66+xml link66 -# application/vnd.ruckus.download -# application/vnd.s3sms -application/vnd.sailingtracker.track st -# application/vnd.sbm.cid -# application/vnd.sbm.mid2 -# application/vnd.scribus -# application/vnd.sealed.3df -# application/vnd.sealed.csf -# application/vnd.sealed.doc -# application/vnd.sealed.eml -# application/vnd.sealed.mht -# application/vnd.sealed.net -# application/vnd.sealed.ppt -# application/vnd.sealed.tiff -# application/vnd.sealed.xls -# application/vnd.sealedmedia.softseal.html -# application/vnd.sealedmedia.softseal.pdf -application/vnd.seemail see -application/vnd.sema sema -application/vnd.semd semd -application/vnd.semf semf -application/vnd.shana.informed.formdata ifm -application/vnd.shana.informed.formtemplate itp -application/vnd.shana.informed.interchange iif -application/vnd.shana.informed.package ipk -application/vnd.simtech-mindmapper twd twds -application/vnd.smaf mmf -# application/vnd.smart.notebook -application/vnd.smart.teacher teacher -# application/vnd.software602.filler.form+xml -# application/vnd.software602.filler.form-xml-zip -application/vnd.solent.sdkm+xml sdkm sdkd -application/vnd.spotfire.dxp dxp -application/vnd.spotfire.sfs sfs -# application/vnd.sss-cod -# application/vnd.sss-dtf -# application/vnd.sss-ntf -application/vnd.stardivision.calc sdc -application/vnd.stardivision.draw sda -application/vnd.stardivision.impress sdd -application/vnd.stardivision.math smf -application/vnd.stardivision.writer sdw vor -application/vnd.stardivision.writer-global sgl -application/vnd.stepmania.stepchart sm -# application/vnd.street-stream -application/vnd.sun.xml.calc sxc -application/vnd.sun.xml.calc.template stc -application/vnd.sun.xml.draw sxd -application/vnd.sun.xml.draw.template std -application/vnd.sun.xml.impress sxi -application/vnd.sun.xml.impress.template sti -application/vnd.sun.xml.math sxm -application/vnd.sun.xml.writer sxw -application/vnd.sun.xml.writer.global sxg -application/vnd.sun.xml.writer.template stw -# application/vnd.sun.wadl+xml -application/vnd.sus-calendar sus susp -application/vnd.svd svd -# application/vnd.swiftview-ics -application/vnd.symbian.install sis sisx -application/vnd.syncml+xml xsm -application/vnd.syncml.dm+wbxml bdm -application/vnd.syncml.dm+xml xdm -# application/vnd.syncml.dm.notification -# application/vnd.syncml.ds.notification -application/vnd.tao.intent-module-archive tao -application/vnd.tmobile-livetv tmo -application/vnd.trid.tpt tpt -application/vnd.triscape.mxs mxs -application/vnd.trueapp tra -# application/vnd.truedoc -# application/vnd.ubisoft.webplayer -application/vnd.ufdl ufd ufdl -application/vnd.uiq.theme utz -application/vnd.umajin umj -application/vnd.unity unityweb -application/vnd.uoml+xml uoml -# application/vnd.uplanet.alert -# application/vnd.uplanet.alert-wbxml -# application/vnd.uplanet.bearer-choice -# application/vnd.uplanet.bearer-choice-wbxml -# application/vnd.uplanet.cacheop -# application/vnd.uplanet.cacheop-wbxml -# application/vnd.uplanet.channel -# application/vnd.uplanet.channel-wbxml -# application/vnd.uplanet.list -# application/vnd.uplanet.list-wbxml -# application/vnd.uplanet.listcmd -# application/vnd.uplanet.listcmd-wbxml -# application/vnd.uplanet.signal -application/vnd.vcx vcx -# application/vnd.vd-study -# application/vnd.vectorworks -# application/vnd.verimatrix.vcas -# application/vnd.vidsoft.vidconference -application/vnd.visio vsd vst vss vsw -application/vnd.visionary vis -# application/vnd.vividence.scriptfile -application/vnd.vsf vsf -# application/vnd.wap.sic -# application/vnd.wap.slc -application/vnd.wap.wbxml wbxml -application/vnd.wap.wmlc wmlc -application/vnd.wap.wmlscriptc wmlsc -application/vnd.webturbo wtb -# application/vnd.wfa.wsc -# application/vnd.wmc -# application/vnd.wmf.bootstrap -# application/vnd.wolfram.mathematica -# application/vnd.wolfram.mathematica.package -application/vnd.wolfram.player nbp -application/vnd.wordperfect wpd -application/vnd.wqd wqd -# application/vnd.wrq-hp3000-labelled -application/vnd.wt.stf stf -# application/vnd.wv.csp+wbxml -# application/vnd.wv.csp+xml -# application/vnd.wv.ssp+xml -application/vnd.xara xar -application/vnd.xfdl xfdl -# application/vnd.xfdl.webform -# application/vnd.xmi+xml -# application/vnd.xmpie.cpkg -# application/vnd.xmpie.dpkg -# application/vnd.xmpie.plan -# application/vnd.xmpie.ppkg -# application/vnd.xmpie.xlim -application/vnd.yamaha.hv-dic hvd -application/vnd.yamaha.hv-script hvs -application/vnd.yamaha.hv-voice hvp -application/vnd.yamaha.openscoreformat osf -application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg -# application/vnd.yamaha.remote-setup -application/vnd.yamaha.smaf-audio saf -application/vnd.yamaha.smaf-phrase spf -# application/vnd.yamaha.tunnel-udpencap -application/vnd.yellowriver-custom-menu cmp -application/vnd.zul zir zirz -application/vnd.zzazz.deck+xml zaz -application/voicexml+xml vxml -# application/vq-rtcpxr -# application/watcherinfo+xml -# application/whoispp-query -# application/whoispp-response -application/widget wgt -application/winhlp hlp -# application/wita -# application/wordperfect5.1 -application/wsdl+xml wsdl -application/wspolicy+xml wspolicy -application/x-7z-compressed 7z -application/x-abiword abw -application/x-ace-compressed ace -application/x-authorware-bin aab x32 u32 vox -application/x-authorware-map aam -application/x-authorware-seg aas -application/x-bcpio bcpio -application/x-bittorrent torrent -application/x-bzip bz -application/x-bzip2 bz2 boz -application/x-cdlink vcd -application/x-chat chat -application/x-chess-pgn pgn -# application/x-compress -application/x-cpio cpio -application/x-csh csh -application/x-debian-package deb udeb -application/x-director dir dcr dxr cst cct cxt w3d fgd swa -application/x-doom wad -application/x-dtbncx+xml ncx -application/x-dtbook+xml dtb -application/x-dtbresource+xml res -application/x-dvi dvi -application/x-font-bdf bdf -# application/x-font-dos -# application/x-font-framemaker -application/x-font-ghostscript gsf -# application/x-font-libgrx -application/x-font-linux-psf psf -application/x-font-otf otf -application/x-font-pcf pcf -application/x-font-snf snf -# application/x-font-speedo -# application/x-font-sunos-news -application/x-font-ttf ttf ttc -application/x-font-type1 pfa pfb pfm afm -application/x-font-woff woff -# application/x-font-vfont -application/x-futuresplash spl -application/x-gnumeric gnumeric -application/x-gtar gtar -# application/x-gzip -application/x-hdf hdf -application/x-java-jnlp-file jnlp -application/x-latex latex -application/x-mobipocket-ebook prc mobi -application/x-ms-application application -application/x-ms-wmd wmd -application/x-ms-wmz wmz -application/x-ms-xbap xbap -application/x-msaccess mdb -application/x-msbinder obd -application/x-mscardfile crd -application/x-msclip clp -application/x-msdownload exe dll com bat msi -application/x-msmediaview mvb m13 m14 -application/x-msmetafile wmf -application/x-msmoney mny -application/x-mspublisher pub -application/x-msschedule scd -application/x-msterminal trm -application/x-mswrite wri -application/x-netcdf nc cdf -application/x-pkcs12 p12 pfx -application/x-pkcs7-certificates p7b spc -application/x-pkcs7-certreqresp p7r -application/x-rar-compressed rar -application/x-sh sh -application/x-shar shar -application/x-shockwave-flash swf -application/x-silverlight-app xap -application/x-stuffit sit -application/x-stuffitx sitx -application/x-sv4cpio sv4cpio -application/x-sv4crc sv4crc -application/x-tar tar -application/x-tcl tcl -application/x-tex tex -application/x-tex-tfm tfm -application/x-texinfo texinfo texi -application/x-ustar ustar -application/x-wais-source src -application/x-x509-ca-cert der crt -application/x-xfig fig -application/x-xpinstall xpi -# application/x400-bp -# application/xcap-att+xml -# application/xcap-caps+xml -application/xcap-diff+xml xdf -# application/xcap-el+xml -# application/xcap-error+xml -# application/xcap-ns+xml -# application/xcon-conference-info-diff+xml -# application/xcon-conference-info+xml -application/xenc+xml xenc -application/xhtml+xml xhtml xht -# application/xhtml-voice+xml -application/xml xml xsl -application/xml-dtd dtd -# application/xml-external-parsed-entity -# application/xmpp+xml -application/xop+xml xop -application/xslt+xml xslt -application/xspf+xml xspf -application/xv+xml mxml xhvml xvml xvm -application/yang yang -application/yin+xml yin -application/zip zip -# audio/1d-interleaved-parityfec -# audio/32kadpcm -# audio/3gpp -# audio/3gpp2 -# audio/ac3 -audio/adpcm adp -# audio/amr -# audio/amr-wb -# audio/amr-wb+ -# audio/asc -# audio/atrac-advanced-lossless -# audio/atrac-x -# audio/atrac3 -audio/basic au snd -# audio/bv16 -# audio/bv32 -# audio/clearmode -# audio/cn -# audio/dat12 -# audio/dls -# audio/dsr-es201108 -# audio/dsr-es202050 -# audio/dsr-es202211 -# audio/dsr-es202212 -# audio/dvi4 -# audio/eac3 -# audio/evrc -# audio/evrc-qcp -# audio/evrc0 -# audio/evrc1 -# audio/evrcb -# audio/evrcb0 -# audio/evrcb1 -# audio/evrcwb -# audio/evrcwb0 -# audio/evrcwb1 -# audio/example -# audio/g719 -# audio/g722 -# audio/g7221 -# audio/g723 -# audio/g726-16 -# audio/g726-24 -# audio/g726-32 -# audio/g726-40 -# audio/g728 -# audio/g729 -# audio/g7291 -# audio/g729d -# audio/g729e -# audio/gsm -# audio/gsm-efr -# audio/gsm-hr-08 -# audio/ilbc -# audio/l16 -# audio/l20 -# audio/l24 -# audio/l8 -# audio/lpc -audio/midi mid midi kar rmi -# audio/mobile-xmf -audio/mp4 mp4a -# audio/mp4a-latm -# audio/mpa -# audio/mpa-robust -audio/mpeg mpga mp2 mp2a mp3 m2a m3a -# audio/mpeg4-generic -audio/ogg oga ogg spx -# audio/parityfec -# audio/pcma -# audio/pcma-wb -# audio/pcmu-wb -# audio/pcmu -# audio/prs.sid -# audio/qcelp -# audio/red -# audio/rtp-enc-aescm128 -# audio/rtp-midi -# audio/rtx -# audio/smv -# audio/smv0 -# audio/smv-qcp -# audio/sp-midi -# audio/speex -# audio/t140c -# audio/t38 -# audio/telephone-event -# audio/tone -# audio/uemclip -# audio/ulpfec -# audio/vdvi -# audio/vmr-wb -# audio/vnd.3gpp.iufp -# audio/vnd.4sb -# audio/vnd.audiokoz -# audio/vnd.celp -# audio/vnd.cisco.nse -# audio/vnd.cmles.radio-events -# audio/vnd.cns.anp1 -# audio/vnd.cns.inf1 -audio/vnd.dece.audio uva uvva -audio/vnd.digital-winds eol -# audio/vnd.dlna.adts -# audio/vnd.dolby.heaac.1 -# audio/vnd.dolby.heaac.2 -# audio/vnd.dolby.mlp -# audio/vnd.dolby.mps -# audio/vnd.dolby.pl2 -# audio/vnd.dolby.pl2x -# audio/vnd.dolby.pl2z -# audio/vnd.dolby.pulse.1 -audio/vnd.dra dra -audio/vnd.dts dts -audio/vnd.dts.hd dtshd -# audio/vnd.everad.plj -# audio/vnd.hns.audio -audio/vnd.lucent.voice lvp -audio/vnd.ms-playready.media.pya pya -# audio/vnd.nokia.mobile-xmf -# audio/vnd.nortel.vbk -audio/vnd.nuera.ecelp4800 ecelp4800 -audio/vnd.nuera.ecelp7470 ecelp7470 -audio/vnd.nuera.ecelp9600 ecelp9600 -# audio/vnd.octel.sbc -# audio/vnd.qcelp -# audio/vnd.rhetorex.32kadpcm -audio/vnd.rip rip -# audio/vnd.sealedmedia.softseal.mpeg -# audio/vnd.vmx.cvsd -# audio/vorbis -# audio/vorbis-config -audio/webm weba -audio/x-aac aac -audio/x-aiff aif aiff aifc -audio/x-mpegurl m3u -audio/x-ms-wax wax -audio/x-ms-wma wma -audio/x-pn-realaudio ram ra -audio/x-pn-realaudio-plugin rmp -audio/x-wav wav -chemical/x-cdx cdx -chemical/x-cif cif -chemical/x-cmdf cmdf -chemical/x-cml cml -chemical/x-csml csml -# chemical/x-pdb -chemical/x-xyz xyz -image/bmp bmp -image/cgm cgm -# image/example -# image/fits -image/g3fax g3 -image/gif gif -image/ief ief -# image/jp2 -image/jpeg jpeg jpg jpe -# image/jpm -# image/jpx -image/ktx ktx -# image/naplps -image/png png -image/prs.btif btif -# image/prs.pti -image/svg+xml svg svgz -# image/t38 -image/tiff tiff tif -# image/tiff-fx -image/vnd.adobe.photoshop psd -# image/vnd.cns.inf2 -image/vnd.dece.graphic uvi uvvi uvg uvvg -image/vnd.dvb.subtitle sub -image/vnd.djvu djvu djv -image/vnd.dwg dwg -image/vnd.dxf dxf -image/vnd.fastbidsheet fbs -image/vnd.fpx fpx -image/vnd.fst fst -image/vnd.fujixerox.edmics-mmr mmr -image/vnd.fujixerox.edmics-rlc rlc -# image/vnd.globalgraphics.pgb -# image/vnd.microsoft.icon -# image/vnd.mix -image/vnd.ms-modi mdi -image/vnd.net-fpx npx -# image/vnd.radiance -# image/vnd.sealed.png -# image/vnd.sealedmedia.softseal.gif -# image/vnd.sealedmedia.softseal.jpg -# image/vnd.svf -image/vnd.wap.wbmp wbmp -image/vnd.xiff xif -image/webp webp -image/x-cmu-raster ras -image/x-cmx cmx -image/x-freehand fh fhc fh4 fh5 fh7 -image/x-icon ico -image/x-pcx pcx -image/x-pict pic pct -image/x-portable-anymap pnm -image/x-portable-bitmap pbm -image/x-portable-graymap pgm -image/x-portable-pixmap ppm -image/x-rgb rgb -image/x-xbitmap xbm -image/x-xpixmap xpm -image/x-xwindowdump xwd -# message/cpim -# message/delivery-status -# message/disposition-notification -# message/example -# message/external-body -# message/feedback-report -# message/global -# message/global-delivery-status -# message/global-disposition-notification -# message/global-headers -# message/http -# message/imdn+xml -# message/news -# message/partial -message/rfc822 eml mime -# message/s-http -# message/sip -# message/sipfrag -# message/tracking-status -# message/vnd.si.simp -# model/example -model/iges igs iges -model/mesh msh mesh silo -model/vnd.collada+xml dae -model/vnd.dwf dwf -# model/vnd.flatland.3dml -model/vnd.gdl gdl -# model/vnd.gs-gdl -# model/vnd.gs.gdl -model/vnd.gtw gtw -# model/vnd.moml+xml -model/vnd.mts mts -# model/vnd.parasolid.transmit.binary -# model/vnd.parasolid.transmit.text -model/vnd.vtu vtu -model/vrml wrl vrml -# multipart/alternative -# multipart/appledouble -# multipart/byteranges -# multipart/digest -# multipart/encrypted -# multipart/example -# multipart/form-data -# multipart/header-set -# multipart/mixed -# multipart/parallel -# multipart/related -# multipart/report -# multipart/signed -# multipart/voice-message -# text/1d-interleaved-parityfec -text/calendar ics ifb -text/css css -text/csv csv -# text/directory -# text/dns -# text/ecmascript -# text/enriched -# text/example -text/html html htm -# text/javascript -text/n3 n3 -# text/parityfec -text/plain txt text conf def list log in -# text/prs.fallenstein.rst -text/prs.lines.tag dsc -# text/vnd.radisys.msml-basic-layout -# text/red -# text/rfc822-headers -text/richtext rtx -# text/rtf -# text/rtp-enc-aescm128 -# text/rtx -text/sgml sgml sgm -# text/t140 -text/tab-separated-values tsv -text/troff t tr roff man me ms -text/turtle ttl -# text/ulpfec -text/uri-list uri uris urls -# text/vnd.abc -text/vnd.curl curl -text/vnd.curl.dcurl dcurl -text/vnd.curl.scurl scurl -text/vnd.curl.mcurl mcurl -# text/vnd.dmclientscript -# text/vnd.esmertec.theme-descriptor -text/vnd.fly fly -text/vnd.fmi.flexstor flx -text/vnd.graphviz gv -text/vnd.in3d.3dml 3dml -text/vnd.in3d.spot spot -# text/vnd.iptc.newsml -# text/vnd.iptc.nitf -# text/vnd.latex-z -# text/vnd.motorola.reflex -# text/vnd.ms-mediapackage -# text/vnd.net2phone.commcenter.command -# text/vnd.si.uricatalogue -text/vnd.sun.j2me.app-descriptor jad -# text/vnd.trolltech.linguist -# text/vnd.wap.si -# text/vnd.wap.sl -text/vnd.wap.wml wml -text/vnd.wap.wmlscript wmls -text/x-asm s asm -text/x-c c cc cxx cpp h hh dic -text/x-fortran f for f77 f90 -text/x-pascal p pas -text/x-java-source java -text/x-setext etx -text/x-uuencode uu -text/x-vcalendar vcs -text/x-vcard vcf -# text/xml -# text/xml-external-parsed-entity -# video/1d-interleaved-parityfec -video/3gpp 3gp -# video/3gpp-tt -video/3gpp2 3g2 -# video/bmpeg -# video/bt656 -# video/celb -# video/dv -# video/example -video/h261 h261 -video/h263 h263 -# video/h263-1998 -# video/h263-2000 -video/h264 h264 -# video/h264-rcdo -# video/h264-svc -video/jpeg jpgv -# video/jpeg2000 -video/jpm jpm jpgm -video/mj2 mj2 mjp2 -# video/mp1s -# video/mp2p -# video/mp2t -video/mp4 mp4 mp4v mpg4 -# video/mp4v-es -video/mpeg mpeg mpg mpe m1v m2v -# video/mpeg4-generic -# video/mpv -# video/nv -video/ogg ogv -# video/parityfec -# video/pointer -video/quicktime qt mov -# video/raw -# video/rtp-enc-aescm128 -# video/rtx -# video/smpte292m -# video/ulpfec -# video/vc1 -# video/vnd.cctv -video/vnd.dece.hd uvh uvvh -video/vnd.dece.mobile uvm uvvm -# video/vnd.dece.mp4 -video/vnd.dece.pd uvp uvvp -video/vnd.dece.sd uvs uvvs -video/vnd.dece.video uvv uvvv -# video/vnd.directv.mpeg -# video/vnd.directv.mpeg-tts -# video/vnd.dlna.mpeg-tts -video/vnd.fvt fvt -# video/vnd.hns.video -# video/vnd.iptvforum.1dparityfec-1010 -# video/vnd.iptvforum.1dparityfec-2005 -# video/vnd.iptvforum.2dparityfec-1010 -# video/vnd.iptvforum.2dparityfec-2005 -# video/vnd.iptvforum.ttsavc -# video/vnd.iptvforum.ttsmpeg2 -# video/vnd.motorola.video -# video/vnd.motorola.videop -video/vnd.mpegurl mxu m4u -video/vnd.ms-playready.media.pyv pyv -# video/vnd.nokia.interleaved-multimedia -# video/vnd.nokia.videovoip -# video/vnd.objectvideo -# video/vnd.sealed.mpeg1 -# video/vnd.sealed.mpeg4 -# video/vnd.sealed.swf -# video/vnd.sealedmedia.softseal.mov -video/vnd.uvvu.mp4 uvu uvvu -video/vnd.vivo viv -video/webm webm -video/x-f4v f4v -video/x-fli fli -video/x-flv flv -video/x-m4v m4v -video/x-ms-asf asf asx -video/x-ms-wm wm -video/x-ms-wmv wmv -video/x-ms-wmx wmx -video/x-ms-wvx wvx -video/x-msvideo avi -video/x-sgi-movie movie -x-conference/x-cooltalk ice diff --git a/node_modules/express/node_modules/connect/node_modules/mime/types/node.types b/node_modules/express/node_modules/connect/node_modules/mime/types/node.types deleted file mode 100644 index fdabaa4..0000000 --- a/node_modules/express/node_modules/connect/node_modules/mime/types/node.types +++ /dev/null @@ -1,43 +0,0 @@ -# What: Google Chrome Extension -# Why: To allow apps to (work) be served with the right content type header. -# http://codereview.chromium.org/2830017 -# Added by: niftylettuce -application/x-chrome-extension crx - -# What: OTF Message Silencer -# Why: To silence the "Resource interpreted as font but transferred with MIME -# type font/otf" message that occurs in Google Chrome -# Added by: niftylettuce -font/opentype otf - -# What: HTC support -# Why: To properly render .htc files such as CSS3PIE -# Added by: niftylettuce -text/x-component htc - -# What: HTML5 application cache manifest -# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps -# per https://developer.mozilla.org/en/offline_resources_in_firefox -# Added by: louisremi -text/cache-manifest appcache manifest - -# What: node binary buffer format -# Why: semi-standard extension w/in the node community -# Added by: tootallnate -application/octet-stream buffer - -# What: The "protected" MP-4 formats used by iTunes. -# Why: Required for streaming music to browsers (?) -# Added by: broofa -application/mp4 m4p -audio/mp4 m4a - -# What: Music playlist format (http://en.wikipedia.org/wiki/M3U) -# Why: See https://github.com/bentomas/node-mime/pull/6 -# Added by: mjrusso -application/x-mpegURL m3u8 - -# What: Video format, Part of RFC1890 -# Why: See https://github.com/bentomas/node-mime/pull/6 -# Added by: mjrusso -video/MP2T ts diff --git a/node_modules/express/node_modules/connect/node_modules/qs/.gitmodules b/node_modules/express/node_modules/connect/node_modules/qs/.gitmodules deleted file mode 100644 index 49e31da..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "support/expresso"] - path = support/expresso - url = git://github.com/visionmedia/expresso.git -[submodule "support/should"] - path = support/should - url = git://github.com/visionmedia/should.js.git diff --git a/node_modules/express/node_modules/connect/node_modules/qs/.npmignore b/node_modules/express/node_modules/connect/node_modules/qs/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/express/node_modules/connect/node_modules/qs/.travis.yml b/node_modules/express/node_modules/connect/node_modules/qs/.travis.yml deleted file mode 100644 index 2c0a8f6..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.4 \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/node_modules/qs/History.md b/node_modules/express/node_modules/connect/node_modules/qs/History.md deleted file mode 100644 index 3eaf7df..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/History.md +++ /dev/null @@ -1,73 +0,0 @@ - -0.4.2 / 2012-02-08 -================== - - * Fixed: ensure objects are created when appropriate not arrays [aheckmann] - -0.4.1 / 2012-01-26 -================== - - * Fixed stringify()ing numbers. Closes #23 - -0.4.0 / 2011-11-21 -================== - - * Allow parsing of an existing object (for `bodyParser()`) [jackyz] - * Replaced expresso with mocha - -0.3.2 / 2011-11-08 -================== - - * Fixed global variable leak - -0.3.1 / 2011-08-17 -================== - - * Added `try/catch` around malformed uri components - * Add test coverage for Array native method bleed-though - -0.3.0 / 2011-07-19 -================== - - * Allow `array[index]` and `object[property]` syntaxes [Aria Stewart] - -0.2.0 / 2011-06-29 -================== - - * Added `qs.stringify()` [Cory Forsyth] - -0.1.0 / 2011-04-13 -================== - - * Added jQuery-ish array support - -0.0.7 / 2011-03-13 -================== - - * Fixed; handle empty string and `== null` in `qs.parse()` [dmit] - allows for convenient `qs.parse(url.parse(str).query)` - -0.0.6 / 2011-02-14 -================== - - * Fixed; support for implicit arrays - -0.0.4 / 2011-02-09 -================== - - * Fixed `+` as a space - -0.0.3 / 2011-02-08 -================== - - * Fixed case when right-hand value contains "]" - -0.0.2 / 2011-02-07 -================== - - * Fixed "=" presence in key - -0.0.1 / 2011-02-07 -================== - - * Initial release \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/node_modules/qs/Makefile b/node_modules/express/node_modules/connect/node_modules/qs/Makefile deleted file mode 100644 index e4df837..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @./node_modules/.bin/mocha - -.PHONY: test \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/node_modules/qs/Readme.md b/node_modules/express/node_modules/connect/node_modules/qs/Readme.md deleted file mode 100644 index db0d145..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/Readme.md +++ /dev/null @@ -1,54 +0,0 @@ -# node-querystring - - query string parser for node supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others. - -## Installation - - $ npm install qs - -## Examples - -```js -var qs = require('qs'); - -qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com'); -// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } } - -qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}) -// => user[name]=Tobi&user[email]=tobi%40learnboost.com -``` - -## Testing - -Install dev dependencies: - - $ npm install -d - -and execute: - - $ make test - -## License - -(The MIT License) - -Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca> - -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/express/node_modules/connect/node_modules/qs/benchmark.js b/node_modules/express/node_modules/connect/node_modules/qs/benchmark.js deleted file mode 100644 index 97e2c93..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/benchmark.js +++ /dev/null @@ -1,17 +0,0 @@ - -var qs = require('./'); - -var times = 100000 - , start = new Date - , n = times; - -console.log('times: %d', times); - -while (n--) qs.parse('foo=bar'); -console.log('simple: %dms', new Date - start); - -var start = new Date - , n = times; - -while (n--) qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); -console.log('nested: %dms', new Date - start); \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/node_modules/qs/examples.js b/node_modules/express/node_modules/connect/node_modules/qs/examples.js deleted file mode 100644 index 27617b7..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/examples.js +++ /dev/null @@ -1,51 +0,0 @@ - -/** - * Module dependencies. - */ - -var qs = require('./'); - -var obj = qs.parse('foo'); -console.log(obj) - -var obj = qs.parse('foo=bar=baz'); -console.log(obj) - -var obj = qs.parse('users[]'); -console.log(obj) - -var obj = qs.parse('name=tj&email=tj@vision-media.ca'); -console.log(obj) - -var obj = qs.parse('users[]=tj&users[]=tobi&users[]=jane'); -console.log(obj) - -var obj = qs.parse('user[name][first]=tj&user[name][last]=holowaychuk'); -console.log(obj) - -var obj = qs.parse('users[][name][first]=tj&users[][name][last]=holowaychuk'); -console.log(obj) - -var obj = qs.parse('a=a&a=b&a=c'); -console.log(obj) - -var obj = qs.parse('user[tj]=tj&user[tj]=TJ'); -console.log(obj) - -var obj = qs.parse('user[names]=tj&user[names]=TJ&user[names]=Tyler'); -console.log(obj) - -var obj = qs.parse('user[name][first]=tj&user[name][first]=TJ'); -console.log(obj) - -var obj = qs.parse('user[0]=tj&user[1]=TJ'); -console.log(obj) - -var obj = qs.parse('user[0]=tj&user[]=TJ'); -console.log(obj) - -var obj = qs.parse('user[0]=tj&user[foo]=TJ'); -console.log(obj) - -var str = qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }}); -console.log(str); \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/node_modules/qs/index.js b/node_modules/express/node_modules/connect/node_modules/qs/index.js deleted file mode 100644 index d177d20..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/querystring'); \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/node_modules/qs/lib/querystring.js b/node_modules/express/node_modules/connect/node_modules/qs/lib/querystring.js deleted file mode 100644 index 6c72712..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/lib/querystring.js +++ /dev/null @@ -1,264 +0,0 @@ - -/*! - * querystring - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Library version. - */ - -exports.version = '0.4.2'; - -/** - * Object#toString() ref for stringify(). - */ - -var toString = Object.prototype.toString; - -/** - * Cache non-integer test regexp. - */ - -var isint = /^[0-9]+$/; - -function promote(parent, key) { - if (parent[key].length == 0) return parent[key] = {}; - var t = {}; - for (var i in parent[key]) t[i] = parent[key][i]; - parent[key] = t; - return t; -} - -function parse(parts, parent, key, val) { - var part = parts.shift(); - // end - if (!part) { - if (Array.isArray(parent[key])) { - parent[key].push(val); - } else if ('object' == typeof parent[key]) { - parent[key] = val; - } else if ('undefined' == typeof parent[key]) { - parent[key] = val; - } else { - parent[key] = [parent[key], val]; - } - // array - } else { - var obj = parent[key] = parent[key] || []; - if (']' == part) { - if (Array.isArray(obj)) { - if ('' != val) obj.push(val); - } else if ('object' == typeof obj) { - obj[Object.keys(obj).length] = val; - } else { - obj = parent[key] = [parent[key], val]; - } - // prop - } else if (~part.indexOf(']')) { - part = part.substr(0, part.length - 1); - if (!isint.test(part) && Array.isArray(obj)) obj = promote(parent, key); - parse(parts, obj, part, val); - // key - } else { - if (!isint.test(part) && Array.isArray(obj)) obj = promote(parent, key); - parse(parts, obj, part, val); - } - } -} - -/** - * Merge parent key/val pair. - */ - -function merge(parent, key, val){ - if (~key.indexOf(']')) { - var parts = key.split('[') - , len = parts.length - , last = len - 1; - parse(parts, parent, 'base', val); - // optimize - } else { - if (!isint.test(key) && Array.isArray(parent.base)) { - var t = {}; - for (var k in parent.base) t[k] = parent.base[k]; - parent.base = t; - } - set(parent.base, key, val); - } - - return parent; -} - -/** - * Parse the given obj. - */ - -function parseObject(obj){ - var ret = { base: {} }; - Object.keys(obj).forEach(function(name){ - merge(ret, name, obj[name]); - }); - return ret.base; -} - -/** - * Parse the given str. - */ - -function parseString(str){ - return String(str) - .split('&') - .reduce(function(ret, pair){ - try{ - pair = decodeURIComponent(pair.replace(/\+/g, ' ')); - } catch(e) { - // ignore - } - - var eql = pair.indexOf('=') - , brace = lastBraceInKey(pair) - , key = pair.substr(0, brace || eql) - , val = pair.substr(brace || eql, pair.length) - , val = val.substr(val.indexOf('=') + 1, val.length); - - // ?foo - if ('' == key) key = pair, val = ''; - - return merge(ret, key, val); - }, { base: {} }).base; -} - -/** - * Parse the given query `str` or `obj`, returning an object. - * - * @param {String} str | {Object} obj - * @return {Object} - * @api public - */ - -exports.parse = function(str){ - if (null == str || '' == str) return {}; - return 'object' == typeof str - ? parseObject(str) - : parseString(str); -}; - -/** - * Turn the given `obj` into a query string - * - * @param {Object} obj - * @return {String} - * @api public - */ - -var stringify = exports.stringify = function(obj, prefix) { - if (Array.isArray(obj)) { - return stringifyArray(obj, prefix); - } else if ('[object Object]' == toString.call(obj)) { - return stringifyObject(obj, prefix); - } else if ('string' == typeof obj) { - return stringifyString(obj, prefix); - } else { - return prefix + '=' + obj; - } -}; - -/** - * Stringify the given `str`. - * - * @param {String} str - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyString(str, prefix) { - if (!prefix) throw new TypeError('stringify expects an object'); - return prefix + '=' + encodeURIComponent(str); -} - -/** - * Stringify the given `arr`. - * - * @param {Array} arr - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyArray(arr, prefix) { - var ret = []; - if (!prefix) throw new TypeError('stringify expects an object'); - for (var i = 0; i < arr.length; i++) { - ret.push(stringify(arr[i], prefix + '[]')); - } - return ret.join('&'); -} - -/** - * Stringify the given `obj`. - * - * @param {Object} obj - * @param {String} prefix - * @return {String} - * @api private - */ - -function stringifyObject(obj, prefix) { - var ret = [] - , keys = Object.keys(obj) - , key; - - for (var i = 0, len = keys.length; i < len; ++i) { - key = keys[i]; - ret.push(stringify(obj[key], prefix - ? prefix + '[' + encodeURIComponent(key) + ']' - : encodeURIComponent(key))); - } - - return ret.join('&'); -} - -/** - * Set `obj`'s `key` to `val` respecting - * the weird and wonderful syntax of a qs, - * where "foo=bar&foo=baz" becomes an array. - * - * @param {Object} obj - * @param {String} key - * @param {String} val - * @api private - */ - -function set(obj, key, val) { - var v = obj[key]; - if (undefined === v) { - obj[key] = val; - } else if (Array.isArray(v)) { - v.push(val); - } else { - obj[key] = [v, val]; - } -} - -/** - * Locate last brace in `str` within the key. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function lastBraceInKey(str) { - var len = str.length - , brace - , c; - for (var i = 0; i < len; ++i) { - c = str[i]; - if (']' == c) brace = false; - if ('[' == c) brace = true; - if ('=' == c && !brace) return i; - } -} diff --git a/node_modules/express/node_modules/connect/node_modules/qs/package.json b/node_modules/express/node_modules/connect/node_modules/qs/package.json deleted file mode 100644 index 37e65de..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "qs", - "description": "querystring parser", - "version": "0.4.2", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-querystring.git" - }, - "devDependencies": { - "mocha": "*", - "should": "*" - }, - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "main": "index", - "engines": { - "node": "*" - }, - "_id": "qs@0.4.2", - "dependencies": {}, - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "qs@0.4.2" -} diff --git a/node_modules/express/node_modules/connect/node_modules/qs/test/mocha.opts b/node_modules/express/node_modules/connect/node_modules/qs/test/mocha.opts deleted file mode 100644 index 521cbb2..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/test/mocha.opts +++ /dev/null @@ -1,2 +0,0 @@ ---require should ---ui exports diff --git a/node_modules/express/node_modules/connect/node_modules/qs/test/parse.js b/node_modules/express/node_modules/connect/node_modules/qs/test/parse.js deleted file mode 100644 index f219e27..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/test/parse.js +++ /dev/null @@ -1,167 +0,0 @@ - -/** - * Module dependencies. - */ - -var qs = require('../'); - -module.exports = { - 'test basics': function(){ - qs.parse('0=foo').should.eql({ '0': 'foo' }); - - qs.parse('foo=c++') - .should.eql({ foo: 'c ' }); - - qs.parse('a[>=]=23') - .should.eql({ a: { '>=': '23' }}); - - qs.parse('a[<=>]==23') - .should.eql({ a: { '<=>': '=23' }}); - - qs.parse('a[==]=23') - .should.eql({ a: { '==': '23' }}); - - qs.parse('foo') - .should.eql({ foo: '' }); - - qs.parse('foo=bar') - .should.eql({ foo: 'bar' }); - - qs.parse('foo%3Dbar=baz') - .should.eql({ foo: 'bar=baz' }); - - qs.parse(' foo = bar = baz ') - .should.eql({ ' foo ': ' bar = baz ' }); - - qs.parse('foo=bar=baz') - .should.eql({ foo: 'bar=baz' }); - - qs.parse('foo=bar&bar=baz') - .should.eql({ foo: 'bar', bar: 'baz' }); - - qs.parse('foo=bar&baz') - .should.eql({ foo: 'bar', baz: '' }); - - qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World') - .should.eql({ - cht: 'p3' - , chd: 't:60,40' - , chs: '250x100' - , chl: 'Hello|World' - }); - }, - - 'test nesting': function(){ - qs.parse('ops[>=]=25') - .should.eql({ ops: { '>=': '25' }}); - - qs.parse('user[name]=tj') - .should.eql({ user: { name: 'tj' }}); - - qs.parse('user[name][first]=tj&user[name][last]=holowaychuk') - .should.eql({ user: { name: { first: 'tj', last: 'holowaychuk' }}}); - }, - - 'test escaping': function(){ - qs.parse('foo=foo%20bar') - .should.eql({ foo: 'foo bar' }); - }, - - 'test arrays': function(){ - qs.parse('images[]') - .should.eql({ images: [] }); - - qs.parse('user[]=tj') - .should.eql({ user: ['tj'] }); - - qs.parse('user[]=tj&user[]=tobi&user[]=jane') - .should.eql({ user: ['tj', 'tobi', 'jane'] }); - - qs.parse('user[names][]=tj&user[names][]=tyler') - .should.eql({ user: { names: ['tj', 'tyler'] }}); - - qs.parse('user[names][]=tj&user[names][]=tyler&user[email]=tj@vision-media.ca') - .should.eql({ user: { names: ['tj', 'tyler'], email: 'tj@vision-media.ca' }}); - - qs.parse('items=a&items=b') - .should.eql({ items: ['a', 'b'] }); - - qs.parse('user[names]=tj&user[names]=holowaychuk&user[names]=TJ') - .should.eql({ user: { names: ['tj', 'holowaychuk', 'TJ'] }}); - - qs.parse('user[name][first]=tj&user[name][first]=TJ') - .should.eql({ user: { name: { first: ['tj', 'TJ'] }}}); - - var o = qs.parse('existing[fcbaebfecc][name][last]=tj') - o.should.eql({ existing: { 'fcbaebfecc': { name: { last: 'tj' }}}}) - Array.isArray(o.existing).should.be.false; - }, - - 'test right-hand brackets': function(){ - qs.parse('pets=["tobi"]') - .should.eql({ pets: '["tobi"]' }); - - qs.parse('operators=[">=", "<="]') - .should.eql({ operators: '[">=", "<="]' }); - - qs.parse('op[>=]=[1,2,3]') - .should.eql({ op: { '>=': '[1,2,3]' }}); - - qs.parse('op[>=]=[1,2,3]&op[=]=[[[[1]]]]') - .should.eql({ op: { '>=': '[1,2,3]', '=': '[[[[1]]]]' }}); - }, - - 'test duplicates': function(){ - qs.parse('items=bar&items=baz&items=raz') - .should.eql({ items: ['bar', 'baz', 'raz'] }); - }, - - 'test empty': function(){ - qs.parse('').should.eql({}); - qs.parse(undefined).should.eql({}); - qs.parse(null).should.eql({}); - }, - - 'test arrays with indexes': function(){ - qs.parse('foo[0]=bar&foo[1]=baz').should.eql({ foo: ['bar', 'baz'] }); - qs.parse('foo[1]=bar&foo[0]=baz').should.eql({ foo: ['baz', 'bar'] }); - qs.parse('foo[base64]=RAWR').should.eql({ foo: { base64: 'RAWR' }}); - qs.parse('foo[64base]=RAWR').should.eql({ foo: { '64base': 'RAWR' }}); - }, - - 'test arrays becoming objects': function(){ - qs.parse('foo[0]=bar&foo[bad]=baz').should.eql({ foo: { 0: "bar", bad: "baz" }}); - qs.parse('foo[bad]=baz&foo[0]=bar').should.eql({ foo: { 0: "bar", bad: "baz" }}); - }, - - 'test bleed-through of Array native properties/methods': function(){ - Array.prototype.protoProperty = true; - Array.prototype.protoFunction = function () {}; - qs.parse('foo=bar').should.eql({ foo: 'bar' }); - }, - - 'test malformed uri': function(){ - qs.parse('{%:%}').should.eql({ '{%:%}': '' }); - qs.parse('foo=%:%}').should.eql({ 'foo': '%:%}' }); - }, - - 'test semi-parsed': function(){ - qs.parse({ 'user[name]': 'tobi' }) - .should.eql({ user: { name: 'tobi' }}); - - qs.parse({ 'user[name]': 'tobi', 'user[email][main]': 'tobi@lb.com' }) - .should.eql({ user: { name: 'tobi', email: { main: 'tobi@lb.com' } }}); - } - - // 'test complex': function(){ - // qs.parse('users[][name][first]=tj&users[foo]=bar') - // .should.eql({ - // users: [ { name: 'tj' }, { name: 'tobi' }, { foo: 'bar' }] - // }); - // - // qs.parse('users[][name][first]=tj&users[][name][first]=tobi') - // .should.eql({ - // users: [ { name: 'tj' }, { name: 'tobi' }] - // }); - // } -}; diff --git a/node_modules/express/node_modules/connect/node_modules/qs/test/stringify.js b/node_modules/express/node_modules/connect/node_modules/qs/test/stringify.js deleted file mode 100644 index c2195cb..0000000 --- a/node_modules/express/node_modules/connect/node_modules/qs/test/stringify.js +++ /dev/null @@ -1,103 +0,0 @@ - -/** - * Module dependencies. - */ - -var qs = require('../') - , should = require('should') - , str_identities = { - 'basics': [ - { str: 'foo=bar', obj: {'foo' : 'bar'}}, - { str: 'foo=%22bar%22', obj: {'foo' : '\"bar\"'}}, - { str: 'foo=', obj: {'foo': ''}}, - { str: 'foo=1&bar=2', obj: {'foo' : '1', 'bar' : '2'}}, - { str: 'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F', obj: {'my weird field': "q1!2\"'w$5&7/z8)?"}}, - { str: 'foo%3Dbaz=bar', obj: {'foo=baz': 'bar'}}, - { str: 'foo=bar&bar=baz', obj: {foo: 'bar', bar: 'baz'}} - ], - 'escaping': [ - { str: 'foo=foo%20bar', obj: {foo: 'foo bar'}}, - { str: 'cht=p3&chd=t%3A60%2C40&chs=250x100&chl=Hello%7CWorld', obj: { - cht: 'p3' - , chd: 't:60,40' - , chs: '250x100' - , chl: 'Hello|World' - }} - ], - 'nested': [ - { str: 'foo[]=bar&foo[]=quux', obj: {'foo' : ['bar', 'quux']}}, - { str: 'foo[]=bar', obj: {foo: ['bar']}}, - { str: 'foo[]=1&foo[]=2', obj: {'foo' : ['1', '2']}}, - { str: 'foo=bar&baz[]=1&baz[]=2&baz[]=3', obj: {'foo' : 'bar', 'baz' : ['1', '2', '3']}}, - { str: 'foo[]=bar&baz[]=1&baz[]=2&baz[]=3', obj: {'foo' : ['bar'], 'baz' : ['1', '2', '3']}}, - { str: 'x[y][z]=1', obj: {'x' : {'y' : {'z' : '1'}}}}, - { str: 'x[y][z][]=1', obj: {'x' : {'y' : {'z' : ['1']}}}}, - { str: 'x[y][z]=2', obj: {'x' : {'y' : {'z' : '2'}}}}, - { str: 'x[y][z][]=1&x[y][z][]=2', obj: {'x' : {'y' : {'z' : ['1', '2']}}}}, - { str: 'x[y][][z]=1', obj: {'x' : {'y' : [{'z' : '1'}]}}}, - { str: 'x[y][][z][]=1', obj: {'x' : {'y' : [{'z' : ['1']}]}}}, - { str: 'x[y][][z]=1&x[y][][w]=2', obj: {'x' : {'y' : [{'z' : '1', 'w' : '2'}]}}}, - { str: 'x[y][][v][w]=1', obj: {'x' : {'y' : [{'v' : {'w' : '1'}}]}}}, - { str: 'x[y][][z]=1&x[y][][v][w]=2', obj: {'x' : {'y' : [{'z' : '1', 'v' : {'w' : '2'}}]}}}, - { str: 'x[y][][z]=1&x[y][][z]=2', obj: {'x' : {'y' : [{'z' : '1'}, {'z' : '2'}]}}}, - { str: 'x[y][][z]=1&x[y][][w]=a&x[y][][z]=2&x[y][][w]=3', obj: {'x' : {'y' : [{'z' : '1', 'w' : 'a'}, {'z' : '2', 'w' : '3'}]}}}, - { str: 'user[name][first]=tj&user[name][last]=holowaychuk', obj: { user: { name: { first: 'tj', last: 'holowaychuk' }}}} - ], - 'errors': [ - { obj: 'foo=bar', message: 'stringify expects an object' }, - { obj: ['foo', 'bar'], message: 'stringify expects an object' } - ], - 'numbers': [ - { str: 'limit[]=1&limit[]=2&limit[]=3', obj: { limit: [1, 2, '3'] }}, - { str: 'limit=1', obj: { limit: 1 }} - ] - }; - - -// Assert error -function err(fn, msg){ - var err; - try { - fn(); - } catch (e) { - should.equal(e.message, msg); - return; - } - throw new Error('no exception thrown, expected "' + msg + '"'); -} - -function test(type) { - var str, obj; - for (var i = 0; i < str_identities[type].length; i++) { - str = str_identities[type][i].str; - obj = str_identities[type][i].obj; - qs.stringify(obj).should.eql(str); - } -} - -module.exports = { - 'test basics': function() { - test('basics'); - }, - - 'test escaping': function() { - test('escaping'); - }, - - 'test nested': function() { - test('nested'); - }, - - 'test numbers': function(){ - test('numbers'); - }, - - 'test errors': function() { - var obj, message; - for (var i = 0; i < str_identities['errors'].length; i++) { - message = str_identities['errors'][i].message; - obj = str_identities['errors'][i].obj; - err(function(){ qs.stringify(obj) }, message); - } - } -}; \ No newline at end of file diff --git a/node_modules/express/node_modules/connect/package.json b/node_modules/express/node_modules/connect/package.json deleted file mode 100644 index 1b66a65..0000000 --- a/node_modules/express/node_modules/connect/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "connect", - "version": "2.1.2", - "description": "High performance middleware framework", - "keywords": [ - "framework", - "web", - "middleware", - "connect", - "rack" - ], - "repository": { - "type": "git", - "url": "git://github.com/senchalabs/connect.git" - }, - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca", - "url": "http://tjholowaychuk.com" - }, - "dependencies": { - "qs": "0.4.2", - "mime": "1.2.4", - "formidable": "1.0.9", - "crc": "0.1.0", - "debug": "*" - }, - "devDependencies": { - "should": "*", - "mocha": "*", - "jade": "*", - "dox": "*" - }, - "main": "index", - "engines": { - "node": ">= 0.5.0 < 0.7.0" - }, - "_id": "connect@2.1.2", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "connect@2.1.2" -} diff --git a/node_modules/express/node_modules/debug/.npmignore b/node_modules/express/node_modules/debug/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/express/node_modules/debug/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/express/node_modules/debug/History.md b/node_modules/express/node_modules/debug/History.md deleted file mode 100644 index f3c1a98..0000000 --- a/node_modules/express/node_modules/debug/History.md +++ /dev/null @@ -1,41 +0,0 @@ - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/express/node_modules/debug/Makefile b/node_modules/express/node_modules/debug/Makefile deleted file mode 100644 index 36a3ed7..0000000 --- a/node_modules/express/node_modules/debug/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @echo "populate me" - -.PHONY: test \ No newline at end of file diff --git a/node_modules/express/node_modules/debug/Readme.md b/node_modules/express/node_modules/debug/Readme.md deleted file mode 100644 index 419fcdf..0000000 --- a/node_modules/express/node_modules/debug/Readme.md +++ /dev/null @@ -1,130 +0,0 @@ - -# debug - - tiny node.js debugging utility. - -## Installation - -``` -$ npm install debug -``` - -## Example - - This module is modelled after node core's debugging technique, allowing you to enable one or more topic-specific debugging functions, for example core does the following within many modules: - -```js -var debug; -if (process.env.NODE_DEBUG && /cluster/.test(process.env.NODE_DEBUG)) { - debug = function(x) { - var prefix = process.pid + ',' + - (process.env.NODE_WORKER_ID ? 'Worker' : 'Master'); - console.error(prefix, x); - }; -} else { - debug = function() { }; -} -``` - - This concept is extremely simple but it works well. With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. - -Example _app.js_: - -```js -var debug = require('debug')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); -``` - -Example _worker.js_: - -```js -var debug = require('debug')('worker'); - -setInterval(function(){ - debug('doing some work'); -}, 1000); -``` - - The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: - - ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) - - ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) - -## Millisecond diff - - When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. - - ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) - - When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: - - ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) - -## Conventions - - If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". - -## Wildcards - - The "*" character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. - - You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=* -connect:*` would include all debuggers except those starting with "connect:". - -## Browser support - - Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. - -```js -a = debug('worker:a'); -b = debug('worker:b'); - -setInterval(function(){ - a('doing some work'); -}, 1000); - -setInterval(function(){ - a('doing some work'); -}, 1200); -``` - -## License - -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca> - -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/express/node_modules/debug/debug.js b/node_modules/express/node_modules/debug/debug.js deleted file mode 100644 index b2f0798..0000000 --- a/node_modules/express/node_modules/debug/debug.js +++ /dev/null @@ -1,122 +0,0 @@ - -/*! - * debug - * Copyright(c) 2012 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Create a debugger with the given `name`. - * - * @param {String} name - * @return {Type} - * @api public - */ - -function debug(name) { - if (!debug.enabled(name)) return function(){}; - - return function(fmt){ - var curr = new Date; - var ms = curr - (debug[name] || curr); - debug[name] = curr; - - fmt = name - + ' ' - + fmt - + ' +' + debug.humanize(ms); - - // This hackery is required for IE8 - // where `console.log` doesn't have 'apply' - window.console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); - } -} - -/** - * The currently active debug mode names. - */ - -debug.names = []; -debug.skips = []; - -/** - * Enables a debug mode by name. This can include modes - * separated by a colon and wildcards. - * - * @param {String} name - * @api public - */ - -debug.enable = function(name) { - localStorage.debug = name; - - var split = (name || '').split(/[\s,]+/) - , len = split.length; - - for (var i = 0; i < len; i++) { - name = split[i].replace('*', '.*?'); - if (name[0] === '-') { - debug.skips.push(new RegExp('^' + name.substr(1) + '$')); - } - else { - debug.names.push(new RegExp('^' + name + '$')); - } - } -}; - -/** - * Disable debug output. - * - * @api public - */ - -debug.disable = function(){ - debug.enable(''); -}; - -/** - * Humanize the given `ms`. - * - * @param {Number} m - * @return {String} - * @api private - */ - -debug.humanize = function(ms) { - var sec = 1000 - , min = 60 * 1000 - , hour = 60 * min; - - if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; - if (ms >= min) return (ms / min).toFixed(1) + 'm'; - if (ms >= sec) return (ms / sec | 0) + 's'; - return ms + 'ms'; -}; - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -debug.enabled = function(name) { - for (var i = 0, len = debug.skips.length; i < len; i++) { - if (debug.skips[i].test(name)) { - return false; - } - } - for (var i = 0, len = debug.names.length; i < len; i++) { - if (debug.names[i].test(name)) { - return true; - } - } - return false; -}; - -// persist - -if (window.localStorage) debug.enable(localStorage.debug); \ No newline at end of file diff --git a/node_modules/express/node_modules/debug/example/app.js b/node_modules/express/node_modules/debug/example/app.js deleted file mode 100644 index 05374d9..0000000 --- a/node_modules/express/node_modules/debug/example/app.js +++ /dev/null @@ -1,19 +0,0 @@ - -var debug = require('../')('http') - , http = require('http') - , name = 'My App'; - -// fake app - -debug('booting %s', name); - -http.createServer(function(req, res){ - debug(req.method + ' ' + req.url); - res.end('hello\n'); -}).listen(3000, function(){ - debug('listening'); -}); - -// fake worker of some kind - -require('./worker'); \ No newline at end of file diff --git a/node_modules/express/node_modules/debug/example/browser.html b/node_modules/express/node_modules/debug/example/browser.html deleted file mode 100644 index 7510eee..0000000 --- a/node_modules/express/node_modules/debug/example/browser.html +++ /dev/null @@ -1,24 +0,0 @@ - - - debug() - - - - - - - diff --git a/node_modules/express/node_modules/debug/example/wildcards.js b/node_modules/express/node_modules/debug/example/wildcards.js deleted file mode 100644 index 1fdac20..0000000 --- a/node_modules/express/node_modules/debug/example/wildcards.js +++ /dev/null @@ -1,10 +0,0 @@ - -var debug = { - foo: require('../')('test:foo'), - bar: require('../')('test:bar'), - baz: require('../')('test:baz') -}; - -debug.foo('foo') -debug.bar('bar') -debug.baz('baz') \ No newline at end of file diff --git a/node_modules/express/node_modules/debug/example/worker.js b/node_modules/express/node_modules/debug/example/worker.js deleted file mode 100644 index 7f6d288..0000000 --- a/node_modules/express/node_modules/debug/example/worker.js +++ /dev/null @@ -1,22 +0,0 @@ - -// DEBUG=* node example/worker -// DEBUG=worker:* node example/worker -// DEBUG=worker:a node example/worker -// DEBUG=worker:b node example/worker - -var a = require('../')('worker:a') - , b = require('../')('worker:b'); - -function work() { - a('doing lots of uninteresting work'); - setTimeout(work, Math.random() * 1000); -} - -work(); - -function workb() { - b('doing some work'); - setTimeout(workb, Math.random() * 2000); -} - -workb(); \ No newline at end of file diff --git a/node_modules/express/node_modules/debug/index.js b/node_modules/express/node_modules/debug/index.js deleted file mode 100644 index ee54454..0000000 --- a/node_modules/express/node_modules/debug/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/debug'); \ No newline at end of file diff --git a/node_modules/express/node_modules/debug/lib/debug.js b/node_modules/express/node_modules/debug/lib/debug.js deleted file mode 100644 index 984dfb5..0000000 --- a/node_modules/express/node_modules/debug/lib/debug.js +++ /dev/null @@ -1,147 +0,0 @@ - -/*! - * debug - * Copyright(c) 2012 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var tty = require('tty'); - -/** - * Expose `debug()` as the module. - */ - -module.exports = debug; - -/** - * Library version. - */ - -exports.version = '0.6.0'; - -/** - * Enabled debuggers. - */ - -var names = [] - , skips = []; - -(process.env.DEBUG || '') - .split(/[\s,]+/) - .forEach(function(name){ - name = name.replace('*', '.*?'); - if (name[0] === '-') { - skips.push(new RegExp('^' + name.substr(1) + '$')); - } else { - names.push(new RegExp('^' + name + '$')); - } - }); - -/** - * Colors. - */ - -var colors = [6, 2, 3, 4, 5, 1]; - -/** - * Previous debug() call. - */ - -var prev = {}; - -/** - * Previously assigned color. - */ - -var prevColor = 0; - -/** - * Is stdout a TTY? Colored output is disabled when `true`. - */ - -var isatty = tty.isatty(2); - -/** - * Select a color. - * - * @return {Number} - * @api private - */ - -function color() { - return colors[prevColor++ % colors.length]; -} - -/** - * Humanize the given `ms`. - * - * @param {Number} m - * @return {String} - * @api private - */ - -function humanize(ms) { - var sec = 1000 - , min = 60 * 1000 - , hour = 60 * min; - - if (ms >= hour) return (ms / hour).toFixed(1) + 'h'; - if (ms >= min) return (ms / min).toFixed(1) + 'm'; - if (ms >= sec) return (ms / sec | 0) + 's'; - return ms + 'ms'; -} - -/** - * Create a debugger with the given `name`. - * - * @param {String} name - * @return {Type} - * @api public - */ - -function debug(name) { - function disabled(){} - disabled.enabled = false; - - var match = skips.some(function(re){ - return re.test(name); - }); - - if (match) return disabled; - - match = names.some(function(re){ - return re.test(name); - }); - - if (!match) return disabled; - var c = color(); - - function colored(fmt) { - var curr = new Date; - var ms = curr - (prev[name] || curr); - prev[name] = curr; - - fmt = ' \033[9' + c + 'm' + name + ' ' - + '\033[3' + c + 'm\033[90m' - + fmt + '\033[3' + c + 'm' - + ' +' + humanize(ms) + '\033[0m'; - - console.error.apply(this, arguments); - } - - function plain(fmt) { - fmt = new Date().toUTCString() - + ' ' + name + ' ' + fmt; - console.error.apply(this, arguments); - } - - colored.enabled = plain.enabled = true; - - return isatty - ? colored - : plain; -} diff --git a/node_modules/express/node_modules/debug/package.json b/node_modules/express/node_modules/debug/package.json deleted file mode 100644 index 0e54ea7..0000000 --- a/node_modules/express/node_modules/debug/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "debug", - "version": "0.6.0", - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "dependencies": {}, - "devDependencies": { - "mocha": "*" - }, - "main": "index", - "engines": { - "node": "*" - }, - "_id": "debug@0.6.0", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "debug@*" -} diff --git a/node_modules/express/node_modules/mime/LICENSE b/node_modules/express/node_modules/mime/LICENSE deleted file mode 100644 index 451fc45..0000000 --- a/node_modules/express/node_modules/mime/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Benjamin Thomas, Robert Kieffer - -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/express/node_modules/mime/README.md b/node_modules/express/node_modules/mime/README.md deleted file mode 100644 index d8b66a8..0000000 --- a/node_modules/express/node_modules/mime/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# mime - -Comprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community. - -## Install - -Install with [npm](http://github.com/isaacs/npm): - - npm install mime - -## API - Queries - -### mime.lookup(path) -Get the mime type associated with a file. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. - - var mime = require('mime'); - - mime.lookup('/path/to/file.txt'); // => 'text/plain' - mime.lookup('file.txt'); // => 'text/plain' - mime.lookup('.TXT'); // => 'text/plain' - mime.lookup('htm'); // => 'text/html' - -### mime.extension(type) -Get the default extension for `type` - - mime.extension('text/html'); // => 'html' - mime.extension('application/octet-stream'); // => 'bin' - -### mime.charsets.lookup() - -Map mime-type to charset - - mime.charsets.lookup('text/plain'); // => 'UTF-8' - -(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) - -## API - Defining Custom Types - -The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/bentomas/node-mime/wiki/Requesting-New-Types). - -### mime.define() - -Add custom mime/extension mappings - - mime.define({ - 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], - 'application/x-my-type': ['x-mt', 'x-mtt'], - // etc ... - }); - - mime.lookup('x-sft'); // => 'text/x-some-format' - -The first entry in the extensions array is returned by `mime.extension()`. E.g. - - mime.extension('text/x-some-format'); // => 'x-sf' - -### mime.load(filepath) - -Load mappings from an Apache ".types" format file - - mime.load('./my_project.types'); - -The .types file format is simple - See the `types` dir for examples. diff --git a/node_modules/express/node_modules/mime/mime.js b/node_modules/express/node_modules/mime/mime.js deleted file mode 100644 index 64dbeec..0000000 --- a/node_modules/express/node_modules/mime/mime.js +++ /dev/null @@ -1,93 +0,0 @@ -var path = require('path'), - fs = require('fs'); - -var mime = module.exports = { - // Map of extension to mime type - types: Object.create(null), - - // Map of mime type to extension - extensions :Object.create(null), - - /** - * Define mimetype -> extension mappings. Each key is a mime-type that maps - * to an array of extensions associated with the type. The first extension is - * used as the default extension for the type. - * - * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); - * - * @param map (Object) type definitions - */ - define: function(map) { - for (var type in map) { - var exts = map[type]; - - for (var i = 0; i < exts.length; i++) { - mime.types[exts[i]] = type; - } - - // Default extension is the first one we encounter - if (!mime.extensions[type]) { - mime.extensions[type] = exts[0]; - } - } - }, - - /** - * Load an Apache2-style ".types" file - * - * This may be called multiple times (it's expected). Where files declare - * overlapping types/extensions, the last file wins. - * - * @param file (String) path of file to load. - */ - load: function(file) { - // Read file and split into lines - var map = {}, - content = fs.readFileSync(file, 'ascii'), - lines = content.split(/[\r\n]+/); - - lines.forEach(function(line, lineno) { - // Clean up whitespace/comments, and split into fields - var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); - map[fields.shift()] = fields; - }); - - mime.define(map); - }, - - /** - * Lookup a mime type based on extension - */ - lookup: function(path, fallback) { - var ext = path.replace(/.*[\.\/]/, '').toLowerCase(); - - return mime.types[ext] || fallback || mime.default_type - }, - - /** - * Return file extension associated with a mime type - */ - extension: function(mimeType) { - return mime.extensions[mimeType]; - }, - - /** - * Lookup a charset based on mime type. - */ - charsets: { - lookup: function (mimeType, fallback) { - // Assume text types are utf8. Modify mime logic as needed. - return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; - } - } -}; - -// Load our local copy of -// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -mime.load(path.join(__dirname, 'types/mime.types')); - -// Overlay enhancements submitted by the node.js community -mime.load(path.join(__dirname, 'types/node.types')); - -// Set the default type -mime.default_type = mime.types.bin; diff --git a/node_modules/express/node_modules/mime/package.json b/node_modules/express/node_modules/mime/package.json deleted file mode 100644 index 1534055..0000000 --- a/node_modules/express/node_modules/mime/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com", - "url": "http://github.com/broofa" - }, - "contributors": [ - { - "name": "Benjamin Thomas", - "email": "benjamin@benjaminthomas.org", - "url": "http://github.com/bentomas" - } - ], - "dependencies": {}, - "description": "A comprehensive library for mime-type mapping", - "devDependencies": {}, - "keywords": [ - "util", - "mime" - ], - "main": "mime.js", - "name": "mime", - "repository": { - "url": "git://github.com/bentomas/node-mime.git", - "type": "git" - }, - "version": "1.2.5", - "_id": "mime@1.2.5", - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "mime@1.2.5" -} diff --git a/node_modules/express/node_modules/mime/test.js b/node_modules/express/node_modules/mime/test.js deleted file mode 100644 index 8a8a5b1..0000000 --- a/node_modules/express/node_modules/mime/test.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Usage: node test.js - */ - -var mime = require('./mime'); -var assert = require('assert'); - -function eq(a, b) { - console.log('Test: ' + a + ' === ' + b); - assert.strictEqual.apply(null, arguments); -} - -console.log(Object.keys(mime.extensions).length + ' types'); -console.log(Object.keys(mime.types).length + ' extensions\n'); - -// -// Test mime lookups -// - -eq('text/plain', mime.lookup('text.txt')); -eq('text/plain', mime.lookup('.text.txt')); -eq('text/plain', mime.lookup('.txt')); -eq('text/plain', mime.lookup('txt')); -eq('application/octet-stream', mime.lookup('text.nope')); -eq('fallback', mime.lookup('text.fallback', 'fallback')); -eq('application/octet-stream', mime.lookup('constructor')); -eq('text/plain', mime.lookup('TEXT.TXT')); - -// -// Test extensions -// - -eq('txt', mime.extension(mime.types.text)); -eq('html', mime.extension(mime.types.htm)); -eq('bin', mime.extension('application/octet-stream')); -eq(undefined, mime.extension('constructor')); - -// -// Test node types -// - -eq('application/octet-stream', mime.lookup('file.buffer')); -eq('audio/mp4', mime.lookup('file.m4a')); - -// -// Test charsets -// - -eq('UTF-8', mime.charsets.lookup('text/plain')); -eq(undefined, mime.charsets.lookup(mime.types.js)); -eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); - -console.log('\nOK'); diff --git a/node_modules/express/node_modules/mime/types/mime.types b/node_modules/express/node_modules/mime/types/mime.types deleted file mode 100644 index b3cae2e..0000000 --- a/node_modules/express/node_modules/mime/types/mime.types +++ /dev/null @@ -1,1510 +0,0 @@ -# This file maps Internet media types to unique file extension(s). -# Although created for httpd, this file is used by many software systems -# and has been placed in the public domain for unlimited redisribution. -# -# The table below contains both registered and (common) unregistered types. -# A type that has no unique extension can be ignored -- they are listed -# here to guide configurations toward known types and to make it easier to -# identify "new" types. File extensions are also commonly used to indicate -# content languages and encodings, so choose them carefully. -# -# Internet media types should be registered as described in RFC 4288. -# The registry is at . -# -# MIME type (lowercased) Extensions -# ============================================ ========== -# application/1d-interleaved-parityfec -# application/3gpp-ims+xml -# application/activemessage -application/andrew-inset ez -# application/applefile -application/applixware aw -application/atom+xml atom -application/atomcat+xml atomcat -# application/atomicmail -application/atomsvc+xml atomsvc -# application/auth-policy+xml -# application/batch-smtp -# application/beep+xml -# application/calendar+xml -# application/cals-1840 -# application/ccmp+xml -application/ccxml+xml ccxml -application/cdmi-capability cdmia -application/cdmi-container cdmic -application/cdmi-domain cdmid -application/cdmi-object cdmio -application/cdmi-queue cdmiq -# application/cea-2018+xml -# application/cellml+xml -# application/cfw -# application/cnrp+xml -# application/commonground -# application/conference-info+xml -# application/cpl+xml -# application/csta+xml -# application/cstadata+xml -application/cu-seeme cu -# application/cybercash -application/davmount+xml davmount -# application/dca-rft -# application/dec-dx -# application/dialog-info+xml -# application/dicom -# application/dns -# application/dskpp+xml -application/dssc+der dssc -application/dssc+xml xdssc -# application/dvcs -application/ecmascript ecma -# application/edi-consent -# application/edi-x12 -# application/edifact -application/emma+xml emma -# application/epp+xml -application/epub+zip epub -# application/eshop -# application/example -application/exi exi -# application/fastinfoset -# application/fastsoap -# application/fits -application/font-tdpfr pfr -# application/framework-attributes+xml -# application/h224 -# application/held+xml -# application/http -application/hyperstudio stk -# application/ibe-key-request+xml -# application/ibe-pkg-reply+xml -# application/ibe-pp-data -# application/iges -# application/im-iscomposing+xml -# application/index -# application/index.cmd -# application/index.obj -# application/index.response -# application/index.vnd -application/inkml+xml ink inkml -# application/iotp -application/ipfix ipfix -# application/ipp -# application/isup -application/java-archive jar -application/java-serialized-object ser -application/java-vm class -application/javascript js -application/json json -# application/kpml-request+xml -# application/kpml-response+xml -application/lost+xml lostxml -application/mac-binhex40 hqx -application/mac-compactpro cpt -# application/macwriteii -application/mads+xml mads -application/marc mrc -application/marcxml+xml mrcx -application/mathematica ma nb mb -# application/mathml-content+xml -# application/mathml-presentation+xml -application/mathml+xml mathml -# application/mbms-associated-procedure-description+xml -# application/mbms-deregister+xml -# application/mbms-envelope+xml -# application/mbms-msk+xml -# application/mbms-msk-response+xml -# application/mbms-protection-description+xml -# application/mbms-reception-report+xml -# application/mbms-register+xml -# application/mbms-register-response+xml -# application/mbms-user-service-description+xml -application/mbox mbox -# application/media_control+xml -application/mediaservercontrol+xml mscml -application/metalink4+xml meta4 -application/mets+xml mets -# application/mikey -application/mods+xml mods -# application/moss-keys -# application/moss-signature -# application/mosskey-data -# application/mosskey-request -application/mp21 m21 mp21 -application/mp4 mp4s -# application/mpeg4-generic -# application/mpeg4-iod -# application/mpeg4-iod-xmt -# application/msc-ivr+xml -# application/msc-mixer+xml -application/msword doc dot -application/mxf mxf -# application/nasdata -# application/news-checkgroups -# application/news-groupinfo -# application/news-transmission -# application/nss -# application/ocsp-request -# application/ocsp-response -application/octet-stream bin dms lha lrf lzh so iso dmg dist distz pkg bpk dump elc deploy -application/oda oda -application/oebps-package+xml opf -application/ogg ogx -application/onenote onetoc onetoc2 onetmp onepkg -application/oxps oxps -# application/parityfec -application/patch-ops-error+xml xer -application/pdf pdf -application/pgp-encrypted pgp -# application/pgp-keys -application/pgp-signature asc sig -application/pics-rules prf -# application/pidf+xml -# application/pidf-diff+xml -application/pkcs10 p10 -application/pkcs7-mime p7m p7c -application/pkcs7-signature p7s -application/pkcs8 p8 -application/pkix-attr-cert ac -application/pkix-cert cer -application/pkix-crl crl -application/pkix-pkipath pkipath -application/pkixcmp pki -application/pls+xml pls -# application/poc-settings+xml -application/postscript ai eps ps -# application/prs.alvestrand.titrax-sheet -application/prs.cww cww -# application/prs.nprend -# application/prs.plucker -# application/prs.rdf-xml-crypt -# application/prs.xsf+xml -application/pskc+xml pskcxml -# application/qsig -application/rdf+xml rdf -application/reginfo+xml rif -application/relax-ng-compact-syntax rnc -# application/remote-printing -application/resource-lists+xml rl -application/resource-lists-diff+xml rld -# application/riscos -# application/rlmi+xml -application/rls-services+xml rs -application/rpki-ghostbusters gbr -application/rpki-manifest mft -application/rpki-roa roa -# application/rpki-updown -application/rsd+xml rsd -application/rss+xml rss -application/rtf rtf -# application/rtx -# application/samlassertion+xml -# application/samlmetadata+xml -application/sbml+xml sbml -application/scvp-cv-request scq -application/scvp-cv-response scs -application/scvp-vp-request spq -application/scvp-vp-response spp -application/sdp sdp -# application/set-payment -application/set-payment-initiation setpay -# application/set-registration -application/set-registration-initiation setreg -# application/sgml -# application/sgml-open-catalog -application/shf+xml shf -# application/sieve -# application/simple-filter+xml -# application/simple-message-summary -# application/simplesymbolcontainer -# application/slate -# application/smil -application/smil+xml smi smil -# application/soap+fastinfoset -# application/soap+xml -application/sparql-query rq -application/sparql-results+xml srx -# application/spirits-event+xml -application/srgs gram -application/srgs+xml grxml -application/sru+xml sru -application/ssml+xml ssml -# application/tamp-apex-update -# application/tamp-apex-update-confirm -# application/tamp-community-update -# application/tamp-community-update-confirm -# application/tamp-error -# application/tamp-sequence-adjust -# application/tamp-sequence-adjust-confirm -# application/tamp-status-query -# application/tamp-status-response -# application/tamp-update -# application/tamp-update-confirm -application/tei+xml tei teicorpus -application/thraud+xml tfi -# application/timestamp-query -# application/timestamp-reply -application/timestamped-data tsd -# application/tve-trigger -# application/ulpfec -# application/vcard+xml -# application/vemmi -# application/vividence.scriptfile -# application/vnd.3gpp.bsf+xml -application/vnd.3gpp.pic-bw-large plb -application/vnd.3gpp.pic-bw-small psb -application/vnd.3gpp.pic-bw-var pvb -# application/vnd.3gpp.sms -# application/vnd.3gpp2.bcmcsinfo+xml -# application/vnd.3gpp2.sms -application/vnd.3gpp2.tcap tcap -application/vnd.3m.post-it-notes pwn -application/vnd.accpac.simply.aso aso -application/vnd.accpac.simply.imp imp -application/vnd.acucobol acu -application/vnd.acucorp atc acutc -application/vnd.adobe.air-application-installer-package+zip air -application/vnd.adobe.fxp fxp fxpl -# application/vnd.adobe.partial-upload -application/vnd.adobe.xdp+xml xdp -application/vnd.adobe.xfdf xfdf -# application/vnd.aether.imp -# application/vnd.ah-barcode -application/vnd.ahead.space ahead -application/vnd.airzip.filesecure.azf azf -application/vnd.airzip.filesecure.azs azs -application/vnd.amazon.ebook azw -application/vnd.americandynamics.acc acc -application/vnd.amiga.ami ami -# application/vnd.amundsen.maze+xml -application/vnd.android.package-archive apk -application/vnd.anser-web-certificate-issue-initiation cii -application/vnd.anser-web-funds-transfer-initiation fti -application/vnd.antix.game-component atx -application/vnd.apple.installer+xml mpkg -application/vnd.apple.mpegurl m3u8 -# application/vnd.arastra.swi -application/vnd.aristanetworks.swi swi -application/vnd.astraea-software.iota iota -application/vnd.audiograph aep -# application/vnd.autopackage -# application/vnd.avistar+xml -application/vnd.blueice.multipass mpm -# application/vnd.bluetooth.ep.oob -application/vnd.bmi bmi -application/vnd.businessobjects rep -# application/vnd.cab-jscript -# application/vnd.canon-cpdl -# application/vnd.canon-lips -# application/vnd.cendio.thinlinc.clientconf -application/vnd.chemdraw+xml cdxml -application/vnd.chipnuts.karaoke-mmd mmd -application/vnd.cinderella cdy -# application/vnd.cirpack.isdn-ext -application/vnd.claymore cla -application/vnd.cloanto.rp9 rp9 -application/vnd.clonk.c4group c4g c4d c4f c4p c4u -application/vnd.cluetrust.cartomobile-config c11amc -application/vnd.cluetrust.cartomobile-config-pkg c11amz -# application/vnd.collection+json -# application/vnd.commerce-battelle -application/vnd.commonspace csp -application/vnd.contact.cmsg cdbcmsg -application/vnd.cosmocaller cmc -application/vnd.crick.clicker clkx -application/vnd.crick.clicker.keyboard clkk -application/vnd.crick.clicker.palette clkp -application/vnd.crick.clicker.template clkt -application/vnd.crick.clicker.wordbank clkw -application/vnd.criticaltools.wbs+xml wbs -application/vnd.ctc-posml pml -# application/vnd.ctct.ws+xml -# application/vnd.cups-pdf -# application/vnd.cups-postscript -application/vnd.cups-ppd ppd -# application/vnd.cups-raster -# application/vnd.cups-raw -# application/vnd.curl -application/vnd.curl.car car -application/vnd.curl.pcurl pcurl -# application/vnd.cybank -application/vnd.data-vision.rdz rdz -application/vnd.dece.data uvf uvvf uvd uvvd -application/vnd.dece.ttml+xml uvt uvvt -application/vnd.dece.unspecified uvx uvvx -application/vnd.dece.zip uvz uvvz -application/vnd.denovo.fcselayout-link fe_launch -# application/vnd.dir-bi.plate-dl-nosuffix -application/vnd.dna dna -application/vnd.dolby.mlp mlp -# application/vnd.dolby.mobile.1 -# application/vnd.dolby.mobile.2 -application/vnd.dpgraph dpg -application/vnd.dreamfactory dfac -application/vnd.dvb.ait ait -# application/vnd.dvb.dvbj -# application/vnd.dvb.esgcontainer -# application/vnd.dvb.ipdcdftnotifaccess -# application/vnd.dvb.ipdcesgaccess -# application/vnd.dvb.ipdcesgaccess2 -# application/vnd.dvb.ipdcesgpdd -# application/vnd.dvb.ipdcroaming -# application/vnd.dvb.iptv.alfec-base -# application/vnd.dvb.iptv.alfec-enhancement -# application/vnd.dvb.notif-aggregate-root+xml -# application/vnd.dvb.notif-container+xml -# application/vnd.dvb.notif-generic+xml -# application/vnd.dvb.notif-ia-msglist+xml -# application/vnd.dvb.notif-ia-registration-request+xml -# application/vnd.dvb.notif-ia-registration-response+xml -# application/vnd.dvb.notif-init+xml -# application/vnd.dvb.pfr -application/vnd.dvb.service svc -# application/vnd.dxr -application/vnd.dynageo geo -# application/vnd.easykaraoke.cdgdownload -# application/vnd.ecdis-update -application/vnd.ecowin.chart mag -# application/vnd.ecowin.filerequest -# application/vnd.ecowin.fileupdate -# application/vnd.ecowin.series -# application/vnd.ecowin.seriesrequest -# application/vnd.ecowin.seriesupdate -# application/vnd.emclient.accessrequest+xml -application/vnd.enliven nml -# application/vnd.eprints.data+xml -application/vnd.epson.esf esf -application/vnd.epson.msf msf -application/vnd.epson.quickanime qam -application/vnd.epson.salt slt -application/vnd.epson.ssf ssf -# application/vnd.ericsson.quickcall -application/vnd.eszigno3+xml es3 et3 -# application/vnd.etsi.aoc+xml -# application/vnd.etsi.cug+xml -# application/vnd.etsi.iptvcommand+xml -# application/vnd.etsi.iptvdiscovery+xml -# application/vnd.etsi.iptvprofile+xml -# application/vnd.etsi.iptvsad-bc+xml -# application/vnd.etsi.iptvsad-cod+xml -# application/vnd.etsi.iptvsad-npvr+xml -# application/vnd.etsi.iptvservice+xml -# application/vnd.etsi.iptvsync+xml -# application/vnd.etsi.iptvueprofile+xml -# application/vnd.etsi.mcid+xml -# application/vnd.etsi.overload-control-policy-dataset+xml -# application/vnd.etsi.sci+xml -# application/vnd.etsi.simservs+xml -# application/vnd.etsi.tsl+xml -# application/vnd.etsi.tsl.der -# application/vnd.eudora.data -application/vnd.ezpix-album ez2 -application/vnd.ezpix-package ez3 -# application/vnd.f-secure.mobile -application/vnd.fdf fdf -application/vnd.fdsn.mseed mseed -application/vnd.fdsn.seed seed dataless -# application/vnd.ffsns -# application/vnd.fints -application/vnd.flographit gph -application/vnd.fluxtime.clip ftc -# application/vnd.font-fontforge-sfd -application/vnd.framemaker fm frame maker book -application/vnd.frogans.fnc fnc -application/vnd.frogans.ltf ltf -application/vnd.fsc.weblaunch fsc -application/vnd.fujitsu.oasys oas -application/vnd.fujitsu.oasys2 oa2 -application/vnd.fujitsu.oasys3 oa3 -application/vnd.fujitsu.oasysgp fg5 -application/vnd.fujitsu.oasysprs bh2 -# application/vnd.fujixerox.art-ex -# application/vnd.fujixerox.art4 -# application/vnd.fujixerox.hbpl -application/vnd.fujixerox.ddd ddd -application/vnd.fujixerox.docuworks xdw -application/vnd.fujixerox.docuworks.binder xbd -# application/vnd.fut-misnet -application/vnd.fuzzysheet fzs -application/vnd.genomatix.tuxedo txd -# application/vnd.geocube+xml -application/vnd.geogebra.file ggb -application/vnd.geogebra.tool ggt -application/vnd.geometry-explorer gex gre -application/vnd.geonext gxt -application/vnd.geoplan g2w -application/vnd.geospace g3w -# application/vnd.globalplatform.card-content-mgt -# application/vnd.globalplatform.card-content-mgt-response -application/vnd.gmx gmx -application/vnd.google-earth.kml+xml kml -application/vnd.google-earth.kmz kmz -application/vnd.grafeq gqf gqs -# application/vnd.gridmp -application/vnd.groove-account gac -application/vnd.groove-help ghf -application/vnd.groove-identity-message gim -application/vnd.groove-injector grv -application/vnd.groove-tool-message gtm -application/vnd.groove-tool-template tpl -application/vnd.groove-vcard vcg -# application/vnd.hal+json -application/vnd.hal+xml hal -application/vnd.handheld-entertainment+xml zmm -application/vnd.hbci hbci -# application/vnd.hcl-bireports -application/vnd.hhe.lesson-player les -application/vnd.hp-hpgl hpgl -application/vnd.hp-hpid hpid -application/vnd.hp-hps hps -application/vnd.hp-jlyt jlt -application/vnd.hp-pcl pcl -application/vnd.hp-pclxl pclxl -# application/vnd.httphone -application/vnd.hydrostatix.sof-data sfd-hdstx -application/vnd.hzn-3d-crossword x3d -# application/vnd.ibm.afplinedata -# application/vnd.ibm.electronic-media -application/vnd.ibm.minipay mpy -application/vnd.ibm.modcap afp listafp list3820 -application/vnd.ibm.rights-management irm -application/vnd.ibm.secure-container sc -application/vnd.iccprofile icc icm -application/vnd.igloader igl -application/vnd.immervision-ivp ivp -application/vnd.immervision-ivu ivu -# application/vnd.informedcontrol.rms+xml -# application/vnd.informix-visionary -# application/vnd.infotech.project -# application/vnd.infotech.project+xml -application/vnd.insors.igm igm -application/vnd.intercon.formnet xpw xpx -application/vnd.intergeo i2g -# application/vnd.intertrust.digibox -# application/vnd.intertrust.nncp -application/vnd.intu.qbo qbo -application/vnd.intu.qfx qfx -# application/vnd.iptc.g2.conceptitem+xml -# application/vnd.iptc.g2.knowledgeitem+xml -# application/vnd.iptc.g2.newsitem+xml -# application/vnd.iptc.g2.packageitem+xml -application/vnd.ipunplugged.rcprofile rcprofile -application/vnd.irepository.package+xml irp -application/vnd.is-xpr xpr -application/vnd.isac.fcs fcs -application/vnd.jam jam -# application/vnd.japannet-directory-service -# application/vnd.japannet-jpnstore-wakeup -# application/vnd.japannet-payment-wakeup -# application/vnd.japannet-registration -# application/vnd.japannet-registration-wakeup -# application/vnd.japannet-setstore-wakeup -# application/vnd.japannet-verification -# application/vnd.japannet-verification-wakeup -application/vnd.jcp.javame.midlet-rms rms -application/vnd.jisp jisp -application/vnd.joost.joda-archive joda -application/vnd.kahootz ktz ktr -application/vnd.kde.karbon karbon -application/vnd.kde.kchart chrt -application/vnd.kde.kformula kfo -application/vnd.kde.kivio flw -application/vnd.kde.kontour kon -application/vnd.kde.kpresenter kpr kpt -application/vnd.kde.kspread ksp -application/vnd.kde.kword kwd kwt -application/vnd.kenameaapp htke -application/vnd.kidspiration kia -application/vnd.kinar kne knp -application/vnd.koan skp skd skt skm -application/vnd.kodak-descriptor sse -application/vnd.las.las+xml lasxml -# application/vnd.liberty-request+xml -application/vnd.llamagraphics.life-balance.desktop lbd -application/vnd.llamagraphics.life-balance.exchange+xml lbe -application/vnd.lotus-1-2-3 123 -application/vnd.lotus-approach apr -application/vnd.lotus-freelance pre -application/vnd.lotus-notes nsf -application/vnd.lotus-organizer org -application/vnd.lotus-screencam scm -application/vnd.lotus-wordpro lwp -application/vnd.macports.portpkg portpkg -# application/vnd.marlin.drm.actiontoken+xml -# application/vnd.marlin.drm.conftoken+xml -# application/vnd.marlin.drm.license+xml -# application/vnd.marlin.drm.mdcf -application/vnd.mcd mcd -application/vnd.medcalcdata mc1 -application/vnd.mediastation.cdkey cdkey -# application/vnd.meridian-slingshot -application/vnd.mfer mwf -application/vnd.mfmp mfm -application/vnd.micrografx.flo flo -application/vnd.micrografx.igx igx -application/vnd.mif mif -# application/vnd.minisoft-hp3000-save -# application/vnd.mitsubishi.misty-guard.trustweb -application/vnd.mobius.daf daf -application/vnd.mobius.dis dis -application/vnd.mobius.mbk mbk -application/vnd.mobius.mqy mqy -application/vnd.mobius.msl msl -application/vnd.mobius.plc plc -application/vnd.mobius.txf txf -application/vnd.mophun.application mpn -application/vnd.mophun.certificate mpc -# application/vnd.motorola.flexsuite -# application/vnd.motorola.flexsuite.adsi -# application/vnd.motorola.flexsuite.fis -# application/vnd.motorola.flexsuite.gotap -# application/vnd.motorola.flexsuite.kmr -# application/vnd.motorola.flexsuite.ttc -# application/vnd.motorola.flexsuite.wem -# application/vnd.motorola.iprm -application/vnd.mozilla.xul+xml xul -application/vnd.ms-artgalry cil -# application/vnd.ms-asf -application/vnd.ms-cab-compressed cab -application/vnd.ms-excel xls xlm xla xlc xlt xlw -application/vnd.ms-excel.addin.macroenabled.12 xlam -application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb -application/vnd.ms-excel.sheet.macroenabled.12 xlsm -application/vnd.ms-excel.template.macroenabled.12 xltm -application/vnd.ms-fontobject eot -application/vnd.ms-htmlhelp chm -application/vnd.ms-ims ims -application/vnd.ms-lrm lrm -# application/vnd.ms-office.activex+xml -application/vnd.ms-officetheme thmx -application/vnd.ms-pki.seccat cat -application/vnd.ms-pki.stl stl -# application/vnd.ms-playready.initiator+xml -application/vnd.ms-powerpoint ppt pps pot -application/vnd.ms-powerpoint.addin.macroenabled.12 ppam -application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm -application/vnd.ms-powerpoint.slide.macroenabled.12 sldm -application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm -application/vnd.ms-powerpoint.template.macroenabled.12 potm -application/vnd.ms-project mpp mpt -# application/vnd.ms-tnef -# application/vnd.ms-wmdrm.lic-chlg-req -# application/vnd.ms-wmdrm.lic-resp -# application/vnd.ms-wmdrm.meter-chlg-req -# application/vnd.ms-wmdrm.meter-resp -application/vnd.ms-word.document.macroenabled.12 docm -application/vnd.ms-word.template.macroenabled.12 dotm -application/vnd.ms-works wps wks wcm wdb -application/vnd.ms-wpl wpl -application/vnd.ms-xpsdocument xps -application/vnd.mseq mseq -# application/vnd.msign -# application/vnd.multiad.creator -# application/vnd.multiad.creator.cif -# application/vnd.music-niff -application/vnd.musician mus -application/vnd.muvee.style msty -application/vnd.mynfc taglet -# application/vnd.ncd.control -# application/vnd.ncd.reference -# application/vnd.nervana -# application/vnd.netfpx -application/vnd.neurolanguage.nlu nlu -application/vnd.noblenet-directory nnd -application/vnd.noblenet-sealer nns -application/vnd.noblenet-web nnw -# application/vnd.nokia.catalogs -# application/vnd.nokia.conml+wbxml -# application/vnd.nokia.conml+xml -# application/vnd.nokia.isds-radio-presets -# application/vnd.nokia.iptv.config+xml -# application/vnd.nokia.landmark+wbxml -# application/vnd.nokia.landmark+xml -# application/vnd.nokia.landmarkcollection+xml -# application/vnd.nokia.n-gage.ac+xml -application/vnd.nokia.n-gage.data ngdat -application/vnd.nokia.n-gage.symbian.install n-gage -# application/vnd.nokia.ncd -# application/vnd.nokia.pcd+wbxml -# application/vnd.nokia.pcd+xml -application/vnd.nokia.radio-preset rpst -application/vnd.nokia.radio-presets rpss -application/vnd.novadigm.edm edm -application/vnd.novadigm.edx edx -application/vnd.novadigm.ext ext -# application/vnd.ntt-local.file-transfer -# application/vnd.ntt-local.sip-ta_remote -# application/vnd.ntt-local.sip-ta_tcp_stream -application/vnd.oasis.opendocument.chart odc -application/vnd.oasis.opendocument.chart-template otc -application/vnd.oasis.opendocument.database odb -application/vnd.oasis.opendocument.formula odf -application/vnd.oasis.opendocument.formula-template odft -application/vnd.oasis.opendocument.graphics odg -application/vnd.oasis.opendocument.graphics-template otg -application/vnd.oasis.opendocument.image odi -application/vnd.oasis.opendocument.image-template oti -application/vnd.oasis.opendocument.presentation odp -application/vnd.oasis.opendocument.presentation-template otp -application/vnd.oasis.opendocument.spreadsheet ods -application/vnd.oasis.opendocument.spreadsheet-template ots -application/vnd.oasis.opendocument.text odt -application/vnd.oasis.opendocument.text-master odm -application/vnd.oasis.opendocument.text-template ott -application/vnd.oasis.opendocument.text-web oth -# application/vnd.obn -# application/vnd.oftn.l10n+json -# application/vnd.oipf.contentaccessdownload+xml -# application/vnd.oipf.contentaccessstreaming+xml -# application/vnd.oipf.cspg-hexbinary -# application/vnd.oipf.dae.svg+xml -# application/vnd.oipf.dae.xhtml+xml -# application/vnd.oipf.mippvcontrolmessage+xml -# application/vnd.oipf.pae.gem -# application/vnd.oipf.spdiscovery+xml -# application/vnd.oipf.spdlist+xml -# application/vnd.oipf.ueprofile+xml -# application/vnd.oipf.userprofile+xml -application/vnd.olpc-sugar xo -# application/vnd.oma-scws-config -# application/vnd.oma-scws-http-request -# application/vnd.oma-scws-http-response -# application/vnd.oma.bcast.associated-procedure-parameter+xml -# application/vnd.oma.bcast.drm-trigger+xml -# application/vnd.oma.bcast.imd+xml -# application/vnd.oma.bcast.ltkm -# application/vnd.oma.bcast.notification+xml -# application/vnd.oma.bcast.provisioningtrigger -# application/vnd.oma.bcast.sgboot -# application/vnd.oma.bcast.sgdd+xml -# application/vnd.oma.bcast.sgdu -# application/vnd.oma.bcast.simple-symbol-container -# application/vnd.oma.bcast.smartcard-trigger+xml -# application/vnd.oma.bcast.sprov+xml -# application/vnd.oma.bcast.stkm -# application/vnd.oma.cab-address-book+xml -# application/vnd.oma.cab-feature-handler+xml -# application/vnd.oma.cab-pcc+xml -# application/vnd.oma.cab-user-prefs+xml -# application/vnd.oma.dcd -# application/vnd.oma.dcdc -application/vnd.oma.dd2+xml dd2 -# application/vnd.oma.drm.risd+xml -# application/vnd.oma.group-usage-list+xml -# application/vnd.oma.pal+xml -# application/vnd.oma.poc.detailed-progress-report+xml -# application/vnd.oma.poc.final-report+xml -# application/vnd.oma.poc.groups+xml -# application/vnd.oma.poc.invocation-descriptor+xml -# application/vnd.oma.poc.optimized-progress-report+xml -# application/vnd.oma.push -# application/vnd.oma.scidm.messages+xml -# application/vnd.oma.xcap-directory+xml -# application/vnd.omads-email+xml -# application/vnd.omads-file+xml -# application/vnd.omads-folder+xml -# application/vnd.omaloc-supl-init -application/vnd.openofficeorg.extension oxt -# application/vnd.openxmlformats-officedocument.custom-properties+xml -# application/vnd.openxmlformats-officedocument.customxmlproperties+xml -# application/vnd.openxmlformats-officedocument.drawing+xml -# application/vnd.openxmlformats-officedocument.drawingml.chart+xml -# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml -# application/vnd.openxmlformats-officedocument.extended-properties+xml -# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml -# application/vnd.openxmlformats-officedocument.presentationml.comments+xml -# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml -application/vnd.openxmlformats-officedocument.presentationml.presentation pptx -# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml -application/vnd.openxmlformats-officedocument.presentationml.slide sldx -# application/vnd.openxmlformats-officedocument.presentationml.slide+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml -application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx -# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml -# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml -# application/vnd.openxmlformats-officedocument.presentationml.tags+xml -application/vnd.openxmlformats-officedocument.presentationml.template potx -# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx -# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml -# application/vnd.openxmlformats-officedocument.theme+xml -# application/vnd.openxmlformats-officedocument.themeoverride+xml -# application/vnd.openxmlformats-officedocument.vmldrawing -# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.document docx -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx -# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml -# application/vnd.openxmlformats-package.core-properties+xml -# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml -# application/vnd.openxmlformats-package.relationships+xml -# application/vnd.quobject-quoxdocument -# application/vnd.osa.netdeploy -application/vnd.osgeo.mapguide.package mgp -# application/vnd.osgi.bundle -application/vnd.osgi.dp dp -# application/vnd.otps.ct-kip+xml -application/vnd.palm pdb pqa oprc -# application/vnd.paos.xml -application/vnd.pawaafile paw -application/vnd.pg.format str -application/vnd.pg.osasli ei6 -# application/vnd.piaccess.application-licence -application/vnd.picsel efif -application/vnd.pmi.widget wg -# application/vnd.poc.group-advertisement+xml -application/vnd.pocketlearn plf -application/vnd.powerbuilder6 pbd -# application/vnd.powerbuilder6-s -# application/vnd.powerbuilder7 -# application/vnd.powerbuilder7-s -# application/vnd.powerbuilder75 -# application/vnd.powerbuilder75-s -# application/vnd.preminet -application/vnd.previewsystems.box box -application/vnd.proteus.magazine mgz -application/vnd.publishare-delta-tree qps -application/vnd.pvi.ptid1 ptid -# application/vnd.pwg-multiplexed -# application/vnd.pwg-xhtml-print+xml -# application/vnd.qualcomm.brew-app-res -application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb -# application/vnd.radisys.moml+xml -# application/vnd.radisys.msml+xml -# application/vnd.radisys.msml-audit+xml -# application/vnd.radisys.msml-audit-conf+xml -# application/vnd.radisys.msml-audit-conn+xml -# application/vnd.radisys.msml-audit-dialog+xml -# application/vnd.radisys.msml-audit-stream+xml -# application/vnd.radisys.msml-conf+xml -# application/vnd.radisys.msml-dialog+xml -# application/vnd.radisys.msml-dialog-base+xml -# application/vnd.radisys.msml-dialog-fax-detect+xml -# application/vnd.radisys.msml-dialog-fax-sendrecv+xml -# application/vnd.radisys.msml-dialog-group+xml -# application/vnd.radisys.msml-dialog-speech+xml -# application/vnd.radisys.msml-dialog-transform+xml -# application/vnd.rainstor.data -# application/vnd.rapid -application/vnd.realvnc.bed bed -application/vnd.recordare.musicxml mxl -application/vnd.recordare.musicxml+xml musicxml -# application/vnd.renlearn.rlprint -application/vnd.rig.cryptonote cryptonote -application/vnd.rim.cod cod -application/vnd.rn-realmedia rm -application/vnd.route66.link66+xml link66 -# application/vnd.ruckus.download -# application/vnd.s3sms -application/vnd.sailingtracker.track st -# application/vnd.sbm.cid -# application/vnd.sbm.mid2 -# application/vnd.scribus -# application/vnd.sealed.3df -# application/vnd.sealed.csf -# application/vnd.sealed.doc -# application/vnd.sealed.eml -# application/vnd.sealed.mht -# application/vnd.sealed.net -# application/vnd.sealed.ppt -# application/vnd.sealed.tiff -# application/vnd.sealed.xls -# application/vnd.sealedmedia.softseal.html -# application/vnd.sealedmedia.softseal.pdf -application/vnd.seemail see -application/vnd.sema sema -application/vnd.semd semd -application/vnd.semf semf -application/vnd.shana.informed.formdata ifm -application/vnd.shana.informed.formtemplate itp -application/vnd.shana.informed.interchange iif -application/vnd.shana.informed.package ipk -application/vnd.simtech-mindmapper twd twds -application/vnd.smaf mmf -# application/vnd.smart.notebook -application/vnd.smart.teacher teacher -# application/vnd.software602.filler.form+xml -# application/vnd.software602.filler.form-xml-zip -application/vnd.solent.sdkm+xml sdkm sdkd -application/vnd.spotfire.dxp dxp -application/vnd.spotfire.sfs sfs -# application/vnd.sss-cod -# application/vnd.sss-dtf -# application/vnd.sss-ntf -application/vnd.stardivision.calc sdc -application/vnd.stardivision.draw sda -application/vnd.stardivision.impress sdd -application/vnd.stardivision.math smf -application/vnd.stardivision.writer sdw vor -application/vnd.stardivision.writer-global sgl -application/vnd.stepmania.package smzip -application/vnd.stepmania.stepchart sm -# application/vnd.street-stream -application/vnd.sun.xml.calc sxc -application/vnd.sun.xml.calc.template stc -application/vnd.sun.xml.draw sxd -application/vnd.sun.xml.draw.template std -application/vnd.sun.xml.impress sxi -application/vnd.sun.xml.impress.template sti -application/vnd.sun.xml.math sxm -application/vnd.sun.xml.writer sxw -application/vnd.sun.xml.writer.global sxg -application/vnd.sun.xml.writer.template stw -# application/vnd.sun.wadl+xml -application/vnd.sus-calendar sus susp -application/vnd.svd svd -# application/vnd.swiftview-ics -application/vnd.symbian.install sis sisx -application/vnd.syncml+xml xsm -application/vnd.syncml.dm+wbxml bdm -application/vnd.syncml.dm+xml xdm -# application/vnd.syncml.dm.notification -# application/vnd.syncml.ds.notification -application/vnd.tao.intent-module-archive tao -application/vnd.tcpdump.pcap pcap cap dmp -application/vnd.tmobile-livetv tmo -application/vnd.trid.tpt tpt -application/vnd.triscape.mxs mxs -application/vnd.trueapp tra -# application/vnd.truedoc -# application/vnd.ubisoft.webplayer -application/vnd.ufdl ufd ufdl -application/vnd.uiq.theme utz -application/vnd.umajin umj -application/vnd.unity unityweb -application/vnd.uoml+xml uoml -# application/vnd.uplanet.alert -# application/vnd.uplanet.alert-wbxml -# application/vnd.uplanet.bearer-choice -# application/vnd.uplanet.bearer-choice-wbxml -# application/vnd.uplanet.cacheop -# application/vnd.uplanet.cacheop-wbxml -# application/vnd.uplanet.channel -# application/vnd.uplanet.channel-wbxml -# application/vnd.uplanet.list -# application/vnd.uplanet.list-wbxml -# application/vnd.uplanet.listcmd -# application/vnd.uplanet.listcmd-wbxml -# application/vnd.uplanet.signal -application/vnd.vcx vcx -# application/vnd.vd-study -# application/vnd.vectorworks -# application/vnd.verimatrix.vcas -# application/vnd.vidsoft.vidconference -application/vnd.visio vsd vst vss vsw -application/vnd.visionary vis -# application/vnd.vividence.scriptfile -application/vnd.vsf vsf -# application/vnd.wap.sic -# application/vnd.wap.slc -application/vnd.wap.wbxml wbxml -application/vnd.wap.wmlc wmlc -application/vnd.wap.wmlscriptc wmlsc -application/vnd.webturbo wtb -# application/vnd.wfa.wsc -# application/vnd.wmc -# application/vnd.wmf.bootstrap -# application/vnd.wolfram.mathematica -# application/vnd.wolfram.mathematica.package -application/vnd.wolfram.player nbp -application/vnd.wordperfect wpd -application/vnd.wqd wqd -# application/vnd.wrq-hp3000-labelled -application/vnd.wt.stf stf -# application/vnd.wv.csp+wbxml -# application/vnd.wv.csp+xml -# application/vnd.wv.ssp+xml -application/vnd.xara xar -application/vnd.xfdl xfdl -# application/vnd.xfdl.webform -# application/vnd.xmi+xml -# application/vnd.xmpie.cpkg -# application/vnd.xmpie.dpkg -# application/vnd.xmpie.plan -# application/vnd.xmpie.ppkg -# application/vnd.xmpie.xlim -application/vnd.yamaha.hv-dic hvd -application/vnd.yamaha.hv-script hvs -application/vnd.yamaha.hv-voice hvp -application/vnd.yamaha.openscoreformat osf -application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg -# application/vnd.yamaha.remote-setup -application/vnd.yamaha.smaf-audio saf -application/vnd.yamaha.smaf-phrase spf -# application/vnd.yamaha.through-ngn -# application/vnd.yamaha.tunnel-udpencap -application/vnd.yellowriver-custom-menu cmp -application/vnd.zul zir zirz -application/vnd.zzazz.deck+xml zaz -application/voicexml+xml vxml -# application/vq-rtcpxr -# application/watcherinfo+xml -# application/whoispp-query -# application/whoispp-response -application/widget wgt -application/winhlp hlp -# application/wita -# application/wordperfect5.1 -application/wsdl+xml wsdl -application/wspolicy+xml wspolicy -application/x-7z-compressed 7z -application/x-abiword abw -application/x-ace-compressed ace -application/x-authorware-bin aab x32 u32 vox -application/x-authorware-map aam -application/x-authorware-seg aas -application/x-bcpio bcpio -application/x-bittorrent torrent -application/x-bzip bz -application/x-bzip2 bz2 boz -application/x-cdlink vcd -application/x-chat chat -application/x-chess-pgn pgn -# application/x-compress -application/x-cpio cpio -application/x-csh csh -application/x-debian-package deb udeb -application/x-director dir dcr dxr cst cct cxt w3d fgd swa -application/x-doom wad -application/x-dtbncx+xml ncx -application/x-dtbook+xml dtb -application/x-dtbresource+xml res -application/x-dvi dvi -application/x-font-bdf bdf -# application/x-font-dos -# application/x-font-framemaker -application/x-font-ghostscript gsf -# application/x-font-libgrx -application/x-font-linux-psf psf -application/x-font-otf otf -application/x-font-pcf pcf -application/x-font-snf snf -# application/x-font-speedo -# application/x-font-sunos-news -application/x-font-ttf ttf ttc -application/x-font-type1 pfa pfb pfm afm -application/x-font-woff woff -# application/x-font-vfont -application/x-futuresplash spl -application/x-gnumeric gnumeric -application/x-gtar gtar -# application/x-gzip -application/x-hdf hdf -application/x-java-jnlp-file jnlp -application/x-latex latex -application/x-mobipocket-ebook prc mobi -application/x-ms-application application -application/x-ms-wmd wmd -application/x-ms-wmz wmz -application/x-ms-xbap xbap -application/x-msaccess mdb -application/x-msbinder obd -application/x-mscardfile crd -application/x-msclip clp -application/x-msdownload exe dll com bat msi -application/x-msmediaview mvb m13 m14 -application/x-msmetafile wmf -application/x-msmoney mny -application/x-mspublisher pub -application/x-msschedule scd -application/x-msterminal trm -application/x-mswrite wri -application/x-netcdf nc cdf -application/x-pkcs12 p12 pfx -application/x-pkcs7-certificates p7b spc -application/x-pkcs7-certreqresp p7r -application/x-rar-compressed rar -application/x-sh sh -application/x-shar shar -application/x-shockwave-flash swf -application/x-silverlight-app xap -application/x-stuffit sit -application/x-stuffitx sitx -application/x-sv4cpio sv4cpio -application/x-sv4crc sv4crc -application/x-tar tar -application/x-tcl tcl -application/x-tex tex -application/x-tex-tfm tfm -application/x-texinfo texinfo texi -application/x-ustar ustar -application/x-wais-source src -application/x-x509-ca-cert der crt -application/x-xfig fig -application/x-xpinstall xpi -# application/x400-bp -# application/xcap-att+xml -# application/xcap-caps+xml -application/xcap-diff+xml xdf -# application/xcap-el+xml -# application/xcap-error+xml -# application/xcap-ns+xml -# application/xcon-conference-info-diff+xml -# application/xcon-conference-info+xml -application/xenc+xml xenc -application/xhtml+xml xhtml xht -# application/xhtml-voice+xml -application/xml xml xsl -application/xml-dtd dtd -# application/xml-external-parsed-entity -# application/xmpp+xml -application/xop+xml xop -application/xslt+xml xslt -application/xspf+xml xspf -application/xv+xml mxml xhvml xvml xvm -application/yang yang -application/yin+xml yin -application/zip zip -# audio/1d-interleaved-parityfec -# audio/32kadpcm -# audio/3gpp -# audio/3gpp2 -# audio/ac3 -audio/adpcm adp -# audio/amr -# audio/amr-wb -# audio/amr-wb+ -# audio/asc -# audio/atrac-advanced-lossless -# audio/atrac-x -# audio/atrac3 -audio/basic au snd -# audio/bv16 -# audio/bv32 -# audio/clearmode -# audio/cn -# audio/dat12 -# audio/dls -# audio/dsr-es201108 -# audio/dsr-es202050 -# audio/dsr-es202211 -# audio/dsr-es202212 -# audio/dv -# audio/dvi4 -# audio/eac3 -# audio/evrc -# audio/evrc-qcp -# audio/evrc0 -# audio/evrc1 -# audio/evrcb -# audio/evrcb0 -# audio/evrcb1 -# audio/evrcwb -# audio/evrcwb0 -# audio/evrcwb1 -# audio/example -# audio/fwdred -# audio/g719 -# audio/g722 -# audio/g7221 -# audio/g723 -# audio/g726-16 -# audio/g726-24 -# audio/g726-32 -# audio/g726-40 -# audio/g728 -# audio/g729 -# audio/g7291 -# audio/g729d -# audio/g729e -# audio/gsm -# audio/gsm-efr -# audio/gsm-hr-08 -# audio/ilbc -# audio/ip-mr_v2.5 -# audio/l16 -# audio/l20 -# audio/l24 -# audio/l8 -# audio/lpc -audio/midi mid midi kar rmi -# audio/mobile-xmf -audio/mp4 mp4a -# audio/mp4a-latm -# audio/mpa -# audio/mpa-robust -audio/mpeg mpga mp2 mp2a mp3 m2a m3a -# audio/mpeg4-generic -audio/ogg oga ogg spx -# audio/parityfec -# audio/pcma -# audio/pcma-wb -# audio/pcmu-wb -# audio/pcmu -# audio/prs.sid -# audio/qcelp -# audio/red -# audio/rtp-enc-aescm128 -# audio/rtp-midi -# audio/rtx -# audio/smv -# audio/smv0 -# audio/smv-qcp -# audio/sp-midi -# audio/speex -# audio/t140c -# audio/t38 -# audio/telephone-event -# audio/tone -# audio/uemclip -# audio/ulpfec -# audio/vdvi -# audio/vmr-wb -# audio/vnd.3gpp.iufp -# audio/vnd.4sb -# audio/vnd.audiokoz -# audio/vnd.celp -# audio/vnd.cisco.nse -# audio/vnd.cmles.radio-events -# audio/vnd.cns.anp1 -# audio/vnd.cns.inf1 -audio/vnd.dece.audio uva uvva -audio/vnd.digital-winds eol -# audio/vnd.dlna.adts -# audio/vnd.dolby.heaac.1 -# audio/vnd.dolby.heaac.2 -# audio/vnd.dolby.mlp -# audio/vnd.dolby.mps -# audio/vnd.dolby.pl2 -# audio/vnd.dolby.pl2x -# audio/vnd.dolby.pl2z -# audio/vnd.dolby.pulse.1 -audio/vnd.dra dra -audio/vnd.dts dts -audio/vnd.dts.hd dtshd -# audio/vnd.dvb.file dvb -# audio/vnd.everad.plj -# audio/vnd.hns.audio -audio/vnd.lucent.voice lvp -audio/vnd.ms-playready.media.pya pya -# audio/vnd.nokia.mobile-xmf -# audio/vnd.nortel.vbk -audio/vnd.nuera.ecelp4800 ecelp4800 -audio/vnd.nuera.ecelp7470 ecelp7470 -audio/vnd.nuera.ecelp9600 ecelp9600 -# audio/vnd.octel.sbc -# audio/vnd.qcelp -# audio/vnd.rhetorex.32kadpcm -audio/vnd.rip rip -# audio/vnd.sealedmedia.softseal.mpeg -# audio/vnd.vmx.cvsd -# audio/vorbis -# audio/vorbis-config -audio/webm weba -audio/x-aac aac -audio/x-aiff aif aiff aifc -audio/x-mpegurl m3u -audio/x-ms-wax wax -audio/x-ms-wma wma -audio/x-pn-realaudio ram ra -audio/x-pn-realaudio-plugin rmp -audio/x-wav wav -chemical/x-cdx cdx -chemical/x-cif cif -chemical/x-cmdf cmdf -chemical/x-cml cml -chemical/x-csml csml -# chemical/x-pdb -chemical/x-xyz xyz -image/bmp bmp -image/cgm cgm -# image/example -# image/fits -image/g3fax g3 -image/gif gif -image/ief ief -# image/jp2 -image/jpeg jpeg jpg jpe -# image/jpm -# image/jpx -image/ktx ktx -# image/naplps -image/png png -image/prs.btif btif -# image/prs.pti -image/svg+xml svg svgz -# image/t38 -image/tiff tiff tif -# image/tiff-fx -image/vnd.adobe.photoshop psd -# image/vnd.cns.inf2 -image/vnd.dece.graphic uvi uvvi uvg uvvg -image/vnd.dvb.subtitle sub -image/vnd.djvu djvu djv -image/vnd.dwg dwg -image/vnd.dxf dxf -image/vnd.fastbidsheet fbs -image/vnd.fpx fpx -image/vnd.fst fst -image/vnd.fujixerox.edmics-mmr mmr -image/vnd.fujixerox.edmics-rlc rlc -# image/vnd.globalgraphics.pgb -# image/vnd.microsoft.icon -# image/vnd.mix -image/vnd.ms-modi mdi -image/vnd.net-fpx npx -# image/vnd.radiance -# image/vnd.sealed.png -# image/vnd.sealedmedia.softseal.gif -# image/vnd.sealedmedia.softseal.jpg -# image/vnd.svf -image/vnd.wap.wbmp wbmp -image/vnd.xiff xif -image/webp webp -image/x-cmu-raster ras -image/x-cmx cmx -image/x-freehand fh fhc fh4 fh5 fh7 -image/x-icon ico -image/x-pcx pcx -image/x-pict pic pct -image/x-portable-anymap pnm -image/x-portable-bitmap pbm -image/x-portable-graymap pgm -image/x-portable-pixmap ppm -image/x-rgb rgb -image/x-xbitmap xbm -image/x-xpixmap xpm -image/x-xwindowdump xwd -# message/cpim -# message/delivery-status -# message/disposition-notification -# message/example -# message/external-body -# message/feedback-report -# message/global -# message/global-delivery-status -# message/global-disposition-notification -# message/global-headers -# message/http -# message/imdn+xml -# message/news -# message/partial -message/rfc822 eml mime -# message/s-http -# message/sip -# message/sipfrag -# message/tracking-status -# message/vnd.si.simp -# model/example -model/iges igs iges -model/mesh msh mesh silo -model/vnd.collada+xml dae -model/vnd.dwf dwf -# model/vnd.flatland.3dml -model/vnd.gdl gdl -# model/vnd.gs-gdl -# model/vnd.gs.gdl -model/vnd.gtw gtw -# model/vnd.moml+xml -model/vnd.mts mts -# model/vnd.parasolid.transmit.binary -# model/vnd.parasolid.transmit.text -model/vnd.vtu vtu -model/vrml wrl vrml -# multipart/alternative -# multipart/appledouble -# multipart/byteranges -# multipart/digest -# multipart/encrypted -# multipart/example -# multipart/form-data -# multipart/header-set -# multipart/mixed -# multipart/parallel -# multipart/related -# multipart/report -# multipart/signed -# multipart/voice-message -# text/1d-interleaved-parityfec -text/calendar ics ifb -text/css css -text/csv csv -# text/directory -# text/dns -# text/ecmascript -# text/enriched -# text/example -# text/fwdred -text/html html htm -# text/javascript -text/n3 n3 -# text/parityfec -text/plain txt text conf def list log in -# text/prs.fallenstein.rst -text/prs.lines.tag dsc -# text/vnd.radisys.msml-basic-layout -# text/red -# text/rfc822-headers -text/richtext rtx -# text/rtf -# text/rtp-enc-aescm128 -# text/rtx -text/sgml sgml sgm -# text/t140 -text/tab-separated-values tsv -text/troff t tr roff man me ms -text/turtle ttl -# text/ulpfec -text/uri-list uri uris urls -text/vcard vcard -# text/vnd.abc -text/vnd.curl curl -text/vnd.curl.dcurl dcurl -text/vnd.curl.scurl scurl -text/vnd.curl.mcurl mcurl -# text/vnd.dmclientscript -text/vnd.dvb.subtitle sub -# text/vnd.esmertec.theme-descriptor -text/vnd.fly fly -text/vnd.fmi.flexstor flx -text/vnd.graphviz gv -text/vnd.in3d.3dml 3dml -text/vnd.in3d.spot spot -# text/vnd.iptc.newsml -# text/vnd.iptc.nitf -# text/vnd.latex-z -# text/vnd.motorola.reflex -# text/vnd.ms-mediapackage -# text/vnd.net2phone.commcenter.command -# text/vnd.si.uricatalogue -text/vnd.sun.j2me.app-descriptor jad -# text/vnd.trolltech.linguist -# text/vnd.wap.si -# text/vnd.wap.sl -text/vnd.wap.wml wml -text/vnd.wap.wmlscript wmls -text/x-asm s asm -text/x-c c cc cxx cpp h hh dic -text/x-fortran f for f77 f90 -text/x-pascal p pas -text/x-java-source java -text/x-setext etx -text/x-uuencode uu -text/x-vcalendar vcs -text/x-vcard vcf -# text/xml -# text/xml-external-parsed-entity -# video/1d-interleaved-parityfec -video/3gpp 3gp -# video/3gpp-tt -video/3gpp2 3g2 -# video/bmpeg -# video/bt656 -# video/celb -# video/dv -# video/example -video/h261 h261 -video/h263 h263 -# video/h263-1998 -# video/h263-2000 -video/h264 h264 -# video/h264-rcdo -# video/h264-svc -video/jpeg jpgv -# video/jpeg2000 -video/jpm jpm jpgm -video/mj2 mj2 mjp2 -# video/mp1s -# video/mp2p -# video/mp2t -video/mp4 mp4 mp4v mpg4 -# video/mp4v-es -video/mpeg mpeg mpg mpe m1v m2v -# video/mpeg4-generic -# video/mpv -# video/nv -video/ogg ogv -# video/parityfec -# video/pointer -video/quicktime qt mov -# video/raw -# video/rtp-enc-aescm128 -# video/rtx -# video/smpte292m -# video/ulpfec -# video/vc1 -# video/vnd.cctv -video/vnd.dece.hd uvh uvvh -video/vnd.dece.mobile uvm uvvm -# video/vnd.dece.mp4 -video/vnd.dece.pd uvp uvvp -video/vnd.dece.sd uvs uvvs -video/vnd.dece.video uvv uvvv -# video/vnd.directv.mpeg -# video/vnd.directv.mpeg-tts -# video/vnd.dlna.mpeg-tts -video/vnd.dvb.file dvb -video/vnd.fvt fvt -# video/vnd.hns.video -# video/vnd.iptvforum.1dparityfec-1010 -# video/vnd.iptvforum.1dparityfec-2005 -# video/vnd.iptvforum.2dparityfec-1010 -# video/vnd.iptvforum.2dparityfec-2005 -# video/vnd.iptvforum.ttsavc -# video/vnd.iptvforum.ttsmpeg2 -# video/vnd.motorola.video -# video/vnd.motorola.videop -video/vnd.mpegurl mxu m4u -video/vnd.ms-playready.media.pyv pyv -# video/vnd.nokia.interleaved-multimedia -# video/vnd.nokia.videovoip -# video/vnd.objectvideo -# video/vnd.sealed.mpeg1 -# video/vnd.sealed.mpeg4 -# video/vnd.sealed.swf -# video/vnd.sealedmedia.softseal.mov -video/vnd.uvvu.mp4 uvu uvvu -video/vnd.vivo viv -video/webm webm -video/x-f4v f4v -video/x-fli fli -video/x-flv flv -video/x-m4v m4v -video/x-ms-asf asf asx -video/x-ms-wm wm -video/x-ms-wmv wmv -video/x-ms-wmx wmx -video/x-ms-wvx wvx -video/x-msvideo avi -video/x-sgi-movie movie -x-conference/x-cooltalk ice diff --git a/node_modules/express/node_modules/mime/types/node.types b/node_modules/express/node_modules/mime/types/node.types deleted file mode 100644 index f7da49f..0000000 --- a/node_modules/express/node_modules/mime/types/node.types +++ /dev/null @@ -1,48 +0,0 @@ -# What: Google Chrome Extension -# Why: To allow apps to (work) be served with the right content type header. -# http://codereview.chromium.org/2830017 -# Added by: niftylettuce -application/x-chrome-extension crx - -# What: OTF Message Silencer -# Why: To silence the "Resource interpreted as font but transferred with MIME -# type font/otf" message that occurs in Google Chrome -# Added by: niftylettuce -font/opentype otf - -# What: HTC support -# Why: To properly render .htc files such as CSS3PIE -# Added by: niftylettuce -text/x-component htc - -# What: HTML5 application cache manifest -# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps -# per https://developer.mozilla.org/en/offline_resources_in_firefox -# Added by: louisremi -text/cache-manifest appcache manifest - -# What: node binary buffer format -# Why: semi-standard extension w/in the node community -# Added by: tootallnate -application/octet-stream buffer - -# What: The "protected" MP-4 formats used by iTunes. -# Why: Required for streaming music to browsers (?) -# Added by: broofa -application/mp4 m4p -audio/mp4 m4a - -# What: Music playlist format (http://en.wikipedia.org/wiki/M3U) -# Why: See https://github.com/bentomas/node-mime/pull/6 -# Added by: mjrusso -application/x-mpegURL m3u8 - -# What: Video format, Part of RFC1890 -# Why: See https://github.com/bentomas/node-mime/pull/6 -# Added by: mjrusso -video/MP2T ts - -# What: The FLAC lossless codec format -# Why: Streaming and serving FLAC audio -# Added by: jacobrask -audio/flac flac \ No newline at end of file diff --git a/node_modules/express/node_modules/mkdirp/.gitignore.orig b/node_modules/express/node_modules/mkdirp/.gitignore.orig deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/express/node_modules/mkdirp/.gitignore.orig +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/express/node_modules/mkdirp/.gitignore.rej b/node_modules/express/node_modules/mkdirp/.gitignore.rej deleted file mode 100644 index 69244ff..0000000 --- a/node_modules/express/node_modules/mkdirp/.gitignore.rej +++ /dev/null @@ -1,5 +0,0 @@ ---- /dev/null -+++ .gitignore -@@ -0,0 +1,2 @@ -+node_modules/ -+npm-debug.log \ No newline at end of file diff --git a/node_modules/express/node_modules/mkdirp/.npmignore b/node_modules/express/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/express/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/express/node_modules/mkdirp/.travis.yml b/node_modules/express/node_modules/mkdirp/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/node_modules/express/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/node_modules/express/node_modules/mkdirp/LICENSE b/node_modules/express/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/express/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/express/node_modules/mkdirp/README.markdown b/node_modules/express/node_modules/mkdirp/README.markdown deleted file mode 100644 index 40de04f..0000000 --- a/node_modules/express/node_modules/mkdirp/README.markdown +++ /dev/null @@ -1,61 +0,0 @@ -mkdirp -====== - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -example -======= - -pow.js ------- - var mkdirp = require('mkdirp'); - - mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') - }); - -Output - pow! - -And now /tmp/foo/bar/baz exists, huzzah! - -methods -======= - -var mkdirp = require('mkdirp'); - -mkdirp(dir, mode, cb) ---------------------- - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -mkdirp.sync(dir, mode) ----------------------- - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -install -======= - -With [npm](http://npmjs.org) do: - - npm install mkdirp - -license -======= - -MIT/X11 diff --git a/node_modules/express/node_modules/mkdirp/examples/pow.js b/node_modules/express/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/node_modules/express/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/express/node_modules/mkdirp/examples/pow.js.orig b/node_modules/express/node_modules/mkdirp/examples/pow.js.orig deleted file mode 100644 index 7741462..0000000 --- a/node_modules/express/node_modules/mkdirp/examples/pow.js.orig +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', 0755, function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/express/node_modules/mkdirp/examples/pow.js.rej b/node_modules/express/node_modules/mkdirp/examples/pow.js.rej deleted file mode 100644 index 81e7f43..0000000 --- a/node_modules/express/node_modules/mkdirp/examples/pow.js.rej +++ /dev/null @@ -1,19 +0,0 @@ ---- examples/pow.js -+++ examples/pow.js -@@ -1,6 +1,15 @@ --var mkdirp = require('mkdirp').mkdirp; -+var mkdirp = require('../').mkdirp, -+ mkdirpSync = require('../').mkdirpSync; - - mkdirp('/tmp/foo/bar/baz', 0755, function (err) { - if (err) console.error(err) - else console.log('pow!') - }); -+ -+try { -+ mkdirpSync('/tmp/bar/foo/baz', 0755); -+ console.log('double pow!'); -+} -+catch (ex) { -+ console.log(ex); -+} \ No newline at end of file diff --git a/node_modules/express/node_modules/mkdirp/index.js b/node_modules/express/node_modules/mkdirp/index.js deleted file mode 100644 index 6d81c62..0000000 --- a/node_modules/express/node_modules/mkdirp/index.js +++ /dev/null @@ -1,83 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f, made) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, mode, cb, made); - }); - break; - - case 'EEXIST': - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original EEXIST be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - - default: - cb(er, made); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode, made) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - if (!made) made = null; - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), mode, made); - sync(p, mode, made); - break; - - case 'EEXIST' : - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - default : - throw err0 - break; - } - } - - return made; -}; diff --git a/node_modules/express/node_modules/mkdirp/package.json b/node_modules/express/node_modules/mkdirp/package.json deleted file mode 100644 index eafbdd1..0000000 --- a/node_modules/express/node_modules/mkdirp/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.3.1", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "git://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "~0.2.4" - }, - "license": "MIT/X11", - "engines": { - "node": "*" - }, - "_id": "mkdirp@0.3.1", - "dependencies": {}, - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "mkdirp@0.3.1" -} diff --git a/node_modules/express/node_modules/mkdirp/test/chmod.js b/node_modules/express/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8..0000000 --- a/node_modules/express/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/express/node_modules/mkdirp/test/clobber.js b/node_modules/express/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb7099..0000000 --- a/node_modules/express/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/express/node_modules/mkdirp/test/mkdirp.js b/node_modules/express/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70..0000000 --- a/node_modules/express/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/express/node_modules/mkdirp/test/perm.js b/node_modules/express/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abb..0000000 --- a/node_modules/express/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/express/node_modules/mkdirp/test/perm_sync.js b/node_modules/express/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f60..0000000 --- a/node_modules/express/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/node_modules/express/node_modules/mkdirp/test/race.js b/node_modules/express/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a0447..0000000 --- a/node_modules/express/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/node_modules/express/node_modules/mkdirp/test/rel.js b/node_modules/express/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 7985824..0000000 --- a/node_modules/express/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/express/node_modules/mkdirp/test/return.js b/node_modules/express/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e5..0000000 --- a/node_modules/express/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/node_modules/express/node_modules/mkdirp/test/return_sync.js b/node_modules/express/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d3..0000000 --- a/node_modules/express/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/node_modules/express/node_modules/mkdirp/test/sync.js b/node_modules/express/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 7530cad..0000000 --- a/node_modules/express/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, 0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/express/node_modules/mkdirp/test/umask.js b/node_modules/express/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe..0000000 --- a/node_modules/express/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/express/node_modules/mkdirp/test/umask_sync.js b/node_modules/express/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 4bd5376..0000000 --- a/node_modules/express/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, 0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }); - }); -}); diff --git a/node_modules/express/package.json b/node_modules/express/package.json deleted file mode 100644 index 5722b4d..0000000 --- a/node_modules/express/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "express", - "description": "Sinatra inspired web development framework", - "version": "3.0.0alpha1", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "contributors": [ - { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - { - "name": "Aaron Heckmann", - "email": "aaron.heckmann+github@gmail.com" - }, - { - "name": "Ciaran Jessup", - "email": "ciaranj@gmail.com" - }, - { - "name": "Guillermo Rauch", - "email": "rauchg@gmail.com" - } - ], - "dependencies": { - "connect": "2.1.2", - "commander": "0.5.2", - "mime": "1.2.5", - "mkdirp": "0.3.1", - "debug": "*" - }, - "devDependencies": { - "ejs": "*", - "mocha": "*", - "jade": "*", - "stylus": "*", - "should": "*", - "connect-redis": "*", - "github-flavored-markdown": "*" - }, - "keywords": [ - "express", - "framework", - "sinatra", - "web", - "rest", - "restful", - "router" - ], - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/express.git" - }, - "main": "index", - "bin": { - "express": "./bin/express" - }, - "scripts": { - "prepublish": "npm prune", - "test": "make test" - }, - "engines": { - "node": ">= 0.5.0 < 0.7.0" - }, - "_id": "express@3.0.0alpha1", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "express" -} diff --git a/node_modules/express/test.js b/node_modules/express/test.js deleted file mode 100644 index efa14a6..0000000 --- a/node_modules/express/test.js +++ /dev/null @@ -1,16 +0,0 @@ - -var express = require('./') - , app = express(); - -app.set('json replacer', function(key, value){ - if ('_' == key[0]) return; - return value; -}); - -var user = { name: 'Tobi' }; - -app.get('/user', function(req, res){ - res.send(user); -}); - -app.listen(3000); diff --git a/node_modules/jade/.npmignore b/node_modules/jade/.npmignore deleted file mode 100644 index b9af3d4..0000000 --- a/node_modules/jade/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -test -support -benchmarks -examples -lib-cov -coverage.html -.gitmodules -.travis.yml -History.md -Readme.md -Makefile -test/ -support/ -benchmarks/ -examples/ diff --git a/node_modules/jade/LICENSE b/node_modules/jade/LICENSE deleted file mode 100644 index 8ad0e0d..0000000 --- a/node_modules/jade/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2009-2010 TJ Holowaychuk - -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/jade/bin/jade b/node_modules/jade/bin/jade deleted file mode 100755 index 7e6002f..0000000 --- a/node_modules/jade/bin/jade +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var fs = require('fs') - , program = require('commander') - , path = require('path') - , basename = path.basename - , dirname = path.dirname - , resolve = path.resolve - , join = path.join - , mkdirp = require('mkdirp') - , jade = require('../'); - -// jade options - -var options = {}; - -// options - -program - .version(jade.version) - .usage('[options] [dir|file ...]') - .option('-o, --obj ', 'javascript options object') - .option('-O, --out ', 'output the compiled html to ') - .option('-p, --path ', 'filename used to resolve includes') - .option('-P, --pretty', 'compile pretty html output') - .option('-c, --client', 'compile for client-side runtime.js') - .option('-D, --no-debug', 'compile without debugging (smaller functions)') - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' # translate jade the templates dir'); - console.log(' $ jade templates'); - console.log(''); - console.log(' # create {foo,bar}.html'); - console.log(' $ jade {foo,bar}.jade'); - console.log(''); - console.log(' # jade over stdio'); - console.log(' $ jade < my.jade > my.html'); - console.log(''); - console.log(' # jade over stdio'); - console.log(' $ echo "h1 Jade!" | jade'); - console.log(''); - console.log(' # foo, bar dirs rendering to /tmp'); - console.log(' $ jade foo bar --out /tmp '); - console.log(''); -}); - -program.parse(process.argv); - -// options given, parse them - -if (program.obj) options = eval('(' + program.obj + ')'); - -// --filename - -if (program.path) options.filename = program.path; - -// --no-debug - -options.compileDebug = program.debug; - -// --client - -options.client = program.client; - -// --pretty - -options.pretty = program.pretty; - -// left-over args are file paths - -var files = program.args; - -// compile files - -if (files.length) { - console.log(); - files.forEach(renderFile); - process.on('exit', console.log); -// stdio -} else { - stdin(); -} - -/** - * Compile from stdin. - */ - -function stdin() { - var buf = ''; - process.stdin.setEncoding('utf8'); - process.stdin.on('data', function(chunk){ buf += chunk; }); - process.stdin.on('end', function(){ - var fn = jade.compile(buf, options); - var output = options.client - ? fn.toString() - : fn(options); - process.stdout.write(output); - }).resume(); -} - -/** - * Process the given path, compiling the jade files found. - * Always walk the subdirectories. - */ - -function renderFile(path) { - var re = /\.jade$/; - fs.lstat(path, function(err, stat) { - if (err) throw err; - // Found jade file - if (stat.isFile() && re.test(path)) { - fs.readFile(path, 'utf8', function(err, str){ - if (err) throw err; - options.filename = path; - var fn = jade.compile(str, options); - var extname = options.client ? '.js' : '.html'; - path = path.replace(re, extname); - if (program.out) path = join(program.out, basename(path)); - var dir = resolve(dirname(path)); - mkdirp(dir, 0755, function(err){ - if (err) throw err; - var output = options.client - ? fn.toString() - : fn(options); - fs.writeFile(path, output, function(err){ - if (err) throw err; - console.log(' \033[90mrendered \033[36m%s\033[0m', path); - }); - }); - }); - // Found directory - } else if (stat.isDirectory()) { - fs.readdir(path, function(err, files) { - if (err) throw err; - files.map(function(filename) { - return path + '/' + filename; - }).forEach(renderFile); - }); - } - }); -} diff --git a/node_modules/jade/index.js b/node_modules/jade/index.js deleted file mode 100644 index 8ad059f..0000000 --- a/node_modules/jade/index.js +++ /dev/null @@ -1,4 +0,0 @@ - -module.exports = process.env.JADE_COV - ? require('./lib-cov/jade') - : require('./lib/jade'); \ No newline at end of file diff --git a/node_modules/jade/jade.1 b/node_modules/jade/jade.1 deleted file mode 100644 index d4fe00f..0000000 --- a/node_modules/jade/jade.1 +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - Application Error - - - - - \ No newline at end of file diff --git a/node_modules/jade/jade.js b/node_modules/jade/jade.js deleted file mode 100644 index 9e325dc..0000000 --- a/node_modules/jade/jade.js +++ /dev/null @@ -1,3179 +0,0 @@ -(function() { - -// CommonJS require() - -function require(p){ - var path = require.resolve(p) - , mod = require.modules[path]; - if (!mod) throw new Error('failed to require "' + p + '"'); - if (!mod.exports) { - mod.exports = {}; - mod.call(mod.exports, mod, mod.exports, require.relative(path)); - } - return mod.exports; - } - -require.modules = {}; - -require.resolve = function (path){ - var orig = path - , reg = path + '.js' - , index = path + '/index.js'; - return require.modules[reg] && reg - || require.modules[index] && index - || orig; - }; - -require.register = function (path, fn){ - require.modules[path] = fn; - }; - -require.relative = function (parent) { - return function(p){ - if ('.' != p.charAt(0)) return require(p); - - var path = parent.split('/') - , segs = p.split('/'); - path.pop(); - - for (var i = 0; i < segs.length; i++) { - var seg = segs[i]; - if ('..' == seg) path.pop(); - else if ('.' != seg) path.push(seg); - } - - return require(path.join('/')); - }; - }; - - -require.register("compiler.js", function(module, exports, require){ - -/*! - * Jade - Compiler - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var nodes = require('./nodes') - , filters = require('./filters') - , doctypes = require('./doctypes') - , selfClosing = require('./self-closing') - , inlineTags = require('./inline-tags') - , utils = require('./utils'); - - - if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } - } - - if (!String.prototype.trimLeft) { - String.prototype.trimLeft = function(){ - return this.replace(/^\s+/, ''); - } - } - - - -/** - * Initialize `Compiler` with the given `node`. - * - * @param {Node} node - * @param {Object} options - * @api public - */ - -var Compiler = module.exports = function Compiler(node, options) { - this.options = options = options || {}; - this.node = node; - this.hasCompiledDoctype = false; - this.hasCompiledTag = false; - this.pp = options.pretty || false; - this.debug = false !== options.compileDebug; - this.indents = 0; - if (options.doctype) this.setDoctype(options.doctype); -}; - -/** - * Compiler prototype. - */ - -Compiler.prototype = { - - /** - * Compile parse tree to JavaScript. - * - * @api public - */ - - compile: function(){ - this.buf = ['var interp;']; - this.lastBufferedIdx = -1; - this.visit(this.node); - return this.buf.join('\n'); - }, - - /** - * Sets the default doctype `name`. Sets terse mode to `true` when - * html 5 is used, causing self-closing tags to end with ">" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {string} name - * @api public - */ - - setDoctype: function(name){ - var doctype = doctypes[(name || 'default').toLowerCase()]; - doctype = doctype || ''; - this.doctype = doctype; - this.terse = '5' == name || 'html' == name; - this.xml = 0 == this.doctype.indexOf('" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {Doctype} doctype - * @api public - */ - - visitDoctype: function(doctype){ - if (doctype && (doctype.val || !this.doctype)) { - this.setDoctype(doctype.val || 'default'); - } - - if (this.doctype) this.buffer(this.doctype); - this.hasCompiledDoctype = true; - }, - - /** - * Visit `mixin`, generating a function that - * may be called within the template. - * - * @param {Mixin} mixin - * @api public - */ - - visitMixin: function(mixin){ - var name = mixin.name.replace(/-/g, '_') + '_mixin' - , args = mixin.args || ''; - - if (mixin.block) { - this.buf.push('var ' + name + ' = function(' + args + '){'); - this.visit(mixin.block); - this.buf.push('}'); - } else { - this.buf.push(name + '(' + args + ');'); - } - }, - - /** - * Visit `tag` buffering tag markup, generating - * attributes, visiting the `tag`'s code and block. - * - * @param {Tag} tag - * @api public - */ - - visitTag: function(tag){ - this.indents++; - var name = tag.name; - - if (!this.hasCompiledTag) { - if (!this.hasCompiledDoctype && 'html' == name) { - this.visitDoctype(); - } - this.hasCompiledTag = true; - } - - // pretty print - if (this.pp && inlineTags.indexOf(name) == -1) { - this.buffer('\\n' + Array(this.indents).join(' ')); - } - - if (~selfClosing.indexOf(name) && !this.xml) { - this.buffer('<' + name); - this.visitAttributes(tag.attrs); - this.terse - ? this.buffer('>') - : this.buffer('/>'); - } else { - // Optimize attributes buffering - if (tag.attrs.length) { - this.buffer('<' + name); - if (tag.attrs.length) this.visitAttributes(tag.attrs); - this.buffer('>'); - } else { - this.buffer('<' + name + '>'); - } - if (tag.code) this.visitCode(tag.code); - if (tag.text) this.buffer(utils.text(tag.text.nodes[0].trimLeft())); - this.escape = 'pre' == tag.name; - this.visit(tag.block); - - // pretty print - if (this.pp && !~inlineTags.indexOf(name) && !tag.textOnly) { - this.buffer('\\n' + Array(this.indents).join(' ')); - } - - this.buffer(''); - } - this.indents--; - }, - - /** - * Visit `filter`, throwing when the filter does not exist. - * - * @param {Filter} filter - * @api public - */ - - visitFilter: function(filter){ - var fn = filters[filter.name]; - - // unknown filter - if (!fn) { - if (filter.isASTFilter) { - throw new Error('unknown ast filter "' + filter.name + ':"'); - } else { - throw new Error('unknown filter ":' + filter.name + '"'); - } - } - if (filter.isASTFilter) { - this.buf.push(fn(filter.block, this, filter.attrs)); - } else { - var text = filter.block.nodes.join(''); - filter.attrs = filter.attrs || {}; - filter.attrs.filename = this.options.filename; - this.buffer(utils.text(fn(text, filter.attrs))); - } - }, - - /** - * Visit `text` node. - * - * @param {Text} text - * @api public - */ - - visitText: function(text){ - text = utils.text(text.nodes.join('')); - if (this.escape) text = escape(text); - this.buffer(text); - this.buffer('\\n'); - }, - - /** - * Visit a `comment`, only buffering when the buffer flag is set. - * - * @param {Comment} comment - * @api public - */ - - visitComment: function(comment){ - if (!comment.buffer) return; - if (this.pp) this.buffer('\\n' + Array(this.indents + 1).join(' ')); - this.buffer(''); - }, - - /** - * Visit a `BlockComment`. - * - * @param {Comment} comment - * @api public - */ - - visitBlockComment: function(comment){ - if (!comment.buffer) return; - if (0 == comment.val.trim().indexOf('if')) { - this.buffer(''); - } else { - this.buffer(''); - } - }, - - /** - * Visit `code`, respecting buffer / escape flags. - * If the code is followed by a block, wrap it in - * a self-calling function. - * - * @param {Code} code - * @api public - */ - - visitCode: function(code){ - // Wrap code blocks with {}. - // we only wrap unbuffered code blocks ATM - // since they are usually flow control - - // Buffer code - if (code.buffer) { - var val = code.val.trimLeft(); - this.buf.push('var __val__ = ' + val); - val = 'null == __val__ ? "" : __val__'; - if (code.escape) val = 'escape(' + val + ')'; - this.buf.push("buf.push(" + val + ");"); - } else { - this.buf.push(code.val); - } - - // Block support - if (code.block) { - if (!code.buffer) this.buf.push('{'); - this.visit(code.block); - if (!code.buffer) this.buf.push('}'); - } - }, - - /** - * Visit `each` block. - * - * @param {Each} each - * @api public - */ - - visitEach: function(each){ - this.buf.push('' - + '// iterate ' + each.obj + '\n' - + '(function(){\n' - + ' if (\'number\' == typeof ' + each.obj + '.length) {\n' - + ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n' - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - this.buf.push('' - + ' }\n' - + ' } else {\n' - + ' for (var ' + each.key + ' in ' + each.obj + ') {\n' - + ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){' - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - this.buf.push(' }\n'); - - this.buf.push(' }\n }\n}).call(this);\n'); - }, - - /** - * Visit `attrs`. - * - * @param {Array} attrs - * @api public - */ - - visitAttributes: function(attrs){ - var buf = [] - , classes = [] - , escaped = {}; - - if (this.terse) buf.push('terse: true'); - - attrs.forEach(function(attr){ - escaped[attr.name] = attr.escaped; - if (attr.name == 'class') { - classes.push('(' + attr.val + ')'); - } else { - var pair = "'" + attr.name + "':(" + attr.val + ')'; - buf.push(pair); - } - }); - - if (classes.length) { - classes = classes.join(" + ' ' + "); - buf.push("class: " + classes); - } - - buf = buf.join(', ').replace('class:', '"class":'); - this.buf.push("buf.push(attrs({ " + buf + " }, " + JSON.stringify(escaped) + "));"); - } -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -} - -}); // module: compiler.js - -require.register("doctypes.js", function(module, exports, require){ - -/*! - * Jade - doctypes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - '5': '' - , 'xml': '' - , 'default': '' - , 'transitional': '' - , 'strict': '' - , 'frameset': '' - , '1.1': '' - , 'basic': '' - , 'mobile': '' -}; -}); // module: doctypes.js - -require.register("filters.js", function(module, exports, require){ - -/*! - * Jade - filters - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - - /** - * Wrap text with CDATA block. - */ - - cdata: function(str){ - return ''; - }, - - /** - * Transform sass to css, wrapped in style tags. - */ - - sass: function(str){ - str = str.replace(/\\n/g, '\n'); - var sass = require('sass').render(str).replace(/\n/g, '\\n'); - return ''; - }, - - /** - * Transform stylus to css, wrapped in style tags. - */ - - stylus: function(str, options){ - var ret; - str = str.replace(/\\n/g, '\n'); - var stylus = require('stylus'); - stylus(str, options).render(function(err, css){ - if (err) throw err; - ret = css.replace(/\n/g, '\\n'); - }); - return ''; - }, - - /** - * Transform less to css, wrapped in style tags. - */ - - less: function(str){ - var ret; - str = str.replace(/\\n/g, '\n'); - require('less').render(str, function(err, css){ - if (err) throw err; - ret = ''; - }); - return ret; - }, - - /** - * Transform markdown to html. - */ - - markdown: function(str){ - var md; - - // support markdown / discount - try { - md = require('markdown'); - } catch (err){ - try { - md = require('discount'); - } catch (err) { - try { - md = require('markdown-js'); - } catch (err) { - try { - md = require('marked'); - } catch (err) { - throw new - Error('Cannot find markdown library, install markdown, discount, or marked.'); - } - } - } - } - - str = str.replace(/\\n/g, '\n'); - return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,'''); - }, - - /** - * Transform coffeescript to javascript. - */ - - coffeescript: function(str){ - str = str.replace(/\\n/g, '\n'); - var js = require('coffee-script').compile(str).replace(/\\/g, '\\\\').replace(/\n/g, '\\n'); - return ''; - } -}; - -}); // module: filters.js - -require.register("inline-tags.js", function(module, exports, require){ - -/*! - * Jade - inline tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'a' - , 'abbr' - , 'acronym' - , 'b' - , 'br' - , 'code' - , 'em' - , 'font' - , 'i' - , 'img' - , 'ins' - , 'kbd' - , 'map' - , 'samp' - , 'small' - , 'span' - , 'strong' - , 'sub' - , 'sup' -]; -}); // module: inline-tags.js - -require.register("jade.js", function(module, exports, require){ -/*! - * Jade - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Parser = require('./parser') - , Lexer = require('./lexer') - , Compiler = require('./compiler') - , runtime = require('./runtime') - -/** - * Library version. - */ - -exports.version = '0.22.1'; - -/** - * Expose self closing tags. - */ - -exports.selfClosing = require('./self-closing'); - -/** - * Default supported doctypes. - */ - -exports.doctypes = require('./doctypes'); - -/** - * Text filters. - */ - -exports.filters = require('./filters'); - -/** - * Utilities. - */ - -exports.utils = require('./utils'); - -/** - * Expose `Compiler`. - */ - -exports.Compiler = Compiler; - -/** - * Expose `Parser`. - */ - -exports.Parser = Parser; - -/** - * Expose `Lexer`. - */ - -exports.Lexer = Lexer; - -/** - * Nodes. - */ - -exports.nodes = require('./nodes'); - -/** - * Jade runtime helpers. - */ - -exports.runtime = runtime; - -/** - * Template function cache. - */ - -exports.cache = {}; - -/** - * Parse the given `str` of jade and return a function body. - * - * @param {String} str - * @param {Object} options - * @return {String} - * @api private - */ - -function parse(str, options){ - try { - // Parse - var parser = new Parser(str, options.filename, options); - - // Compile - var compiler = new (options.compiler || Compiler)(parser.parse(), options) - , js = compiler.compile(); - - // Debug compiler - if (options.debug) { - console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' ')); - } - - return '' - + 'var buf = [];\n' - + (options.self - ? 'var self = locals || {};\n' + js - : 'with (locals || {}) {\n' + js + '\n}\n') - + 'return buf.join("");'; - } catch (err) { - parser = parser.context(); - runtime.rethrow(err, parser.filename, parser.lexer.lineno); - } -} - -/** - * Compile a `Function` representation of the given jade `str`. - * - * Options: - * - * - `compileDebug` when `false` debugging code is stripped from the compiled template - * - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()` - * for use with the Jade client-side runtime.js - * - * @param {String} str - * @param {Options} options - * @return {Function} - * @api public - */ - -exports.compile = function(str, options){ - var options = options || {} - , client = options.client - , filename = options.filename - ? JSON.stringify(options.filename) - : 'undefined' - , fn; - - if (options.compileDebug !== false) { - fn = [ - 'var __jade = [{ lineno: 1, filename: ' + filename + ' }];' - , 'try {' - , parse(String(str), options) - , '} catch (err) {' - , ' rethrow(err, __jade[0].filename, __jade[0].lineno);' - , '}' - ].join('\n'); - } else { - fn = parse(String(str), options); - } - - if (client) { - fn = 'var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;\n' + fn; - } - - fn = new Function('locals, attrs, escape, rethrow', fn); - - if (client) return fn; - - return function(locals){ - return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow); - }; -}; - -/** - * Render the given `str` of jade and invoke - * the callback `fn(err, str)`. - * - * Options: - * - * - `cache` enable template caching - * - `filename` filename required for `include` / `extends` and caching - * - * @param {String} str - * @param {Object|Function} options or fn - * @param {Function} fn - * @api public - */ - -exports.render = function(str, options, fn){ - // swap args - if ('function' == typeof options) { - fn = options, options = {}; - } - - // cache requires .filename - if (options.cache && !options.filename) { - return fn(new Error('the "filename" option is required for caching')); - } - - try { - var path = options.filename; - var tmpl = options.cache - ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) - : exports.compile(str, options); - fn(null, tmpl(options)); - } catch (err) { - fn(err); - } -}; - -/** - * Render a Jade file at the given `path` and callback `fn(err, str)`. - * - * @param {String} path - * @param {Object|Function} options or callback - * @param {Function} fn - * @api public - */ - -exports.renderFile = function(path, options, fn){ - var key = path + ':string'; - - if ('function' == typeof options) { - fn = options, options = {}; - } - - try { - options.filename = path; - var str = options.cache - ? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) - : fs.readFileSync(path, 'utf8'); - exports.render(str, options, fn); - } catch (err) { - fn(err); - } -}; - -/** - * Express support. - */ - -exports.__express = exports.renderFile; - -}); // module: jade.js - -require.register("lexer.js", function(module, exports, require){ - -/*! - * Jade - Lexer - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize `Lexer` with the given `str`. - * - * Options: - * - * - `colons` allow colons for attr delimiters - * - * @param {String} str - * @param {Object} options - * @api private - */ - -var Lexer = module.exports = function Lexer(str, options) { - options = options || {}; - this.input = str.replace(/\r\n|\r/g, '\n'); - this.colons = options.colons; - this.deferredTokens = []; - this.lastIndents = 0; - this.lineno = 1; - this.stash = []; - this.indentStack = []; - this.indentRe = null; - this.pipeless = false; -}; - -/** - * Lexer prototype. - */ - -Lexer.prototype = { - - /** - * Construct a token with the given `type` and `val`. - * - * @param {String} type - * @param {String} val - * @return {Object} - * @api private - */ - - tok: function(type, val){ - return { - type: type - , line: this.lineno - , val: val - } - }, - - /** - * Consume the given `len` of input. - * - * @param {Number} len - * @api private - */ - - consume: function(len){ - this.input = this.input.substr(len); - }, - - /** - * Scan for `type` with the given `regexp`. - * - * @param {String} type - * @param {RegExp} regexp - * @return {Object} - * @api private - */ - - scan: function(regexp, type){ - var captures; - if (captures = regexp.exec(this.input)) { - this.consume(captures[0].length); - return this.tok(type, captures[1]); - } - }, - - /** - * Defer the given `tok`. - * - * @param {Object} tok - * @api private - */ - - defer: function(tok){ - this.deferredTokens.push(tok); - }, - - /** - * Lookahead `n` tokens. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - var fetch = n - this.stash.length; - while (fetch-- > 0) this.stash.push(this.next()); - return this.stash[--n]; - }, - - /** - * Return the indexOf `start` / `end` delimiters. - * - * @param {String} start - * @param {String} end - * @return {Number} - * @api private - */ - - indexOfDelimiters: function(start, end){ - var str = this.input - , nstart = 0 - , nend = 0 - , pos = 0; - for (var i = 0, len = str.length; i < len; ++i) { - if (start == str.charAt(i)) { - ++nstart; - } else if (end == str.charAt(i)) { - if (++nend == nstart) { - pos = i; - break; - } - } - } - return pos; - }, - - /** - * Stashed token. - */ - - stashed: function() { - return this.stash.length - && this.stash.shift(); - }, - - /** - * Deferred token. - */ - - deferred: function() { - return this.deferredTokens.length - && this.deferredTokens.shift(); - }, - - /** - * end-of-source. - */ - - eos: function() { - if (this.input.length) return; - if (this.indentStack.length) { - this.indentStack.shift(); - return this.tok('outdent'); - } else { - return this.tok('eos'); - } - }, - - /** - * Blank line. - */ - - blank: function() { - var captures; - if (this.pipeless) return; - if (captures = /^\n *\n/.exec(this.input)) { - this.consume(captures[0].length - 1); - return this.next(); - } - }, - - /** - * Comment. - */ - - comment: function() { - var captures; - if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('comment', captures[2]); - tok.buffer = '-' != captures[1]; - return tok; - } - }, - - /** - * Tag. - */ - - tag: function() { - var captures; - if (captures = /^(\w[-:\w]*)/.exec(this.input)) { - this.consume(captures[0].length); - var tok, name = captures[1]; - if (':' == name[name.length - 1]) { - name = name.slice(0, -1); - tok = this.tok('tag', name); - this.defer(this.tok(':')); - while (' ' == this.input[0]) this.input = this.input.substr(1); - } else { - tok = this.tok('tag', name); - } - return tok; - } - }, - - /** - * Filter. - */ - - filter: function() { - return this.scan(/^:(\w+)/, 'filter'); - }, - - /** - * Doctype. - */ - - doctype: function() { - return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype'); - }, - - /** - * Id. - */ - - id: function() { - return this.scan(/^#([\w-]+)/, 'id'); - }, - - /** - * Class. - */ - - className: function() { - return this.scan(/^\.([\w-]+)/, 'class'); - }, - - /** - * Text. - */ - - text: function() { - return this.scan(/^(?:\| ?)?([^\n]+)/, 'text'); - }, - - /** - * Extends. - */ - - "extends": function() { - return this.scan(/^extends? +([^\n]+)/, 'extends'); - }, - - /** - * Block prepend. - */ - - prepend: function() { - var captures; - if (captures = /^prepend +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'prepend' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block append. - */ - - append: function() { - var captures; - if (captures = /^append +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'append' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block. - */ - - block: function() { - var captures; - if (captures = /^block +(?:(prepend|append) +)?([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = captures[1] || 'replace' - , name = captures[2] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Yield. - */ - - yield: function() { - return this.scan(/^yield */, 'yield'); - }, - - /** - * Include. - */ - - include: function() { - return this.scan(/^include +([^\n]+)/, 'include'); - }, - - /** - * Case. - */ - - "case": function() { - return this.scan(/^case +([^\n]+)/, 'case'); - }, - - /** - * When. - */ - - when: function() { - return this.scan(/^when +([^:\n]+)/, 'when'); - }, - - /** - * Default. - */ - - "default": function() { - return this.scan(/^default */, 'default'); - }, - - /** - * Assignment. - */ - - assignment: function() { - var captures; - if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) { - this.consume(captures[0].length); - var name = captures[1] - , val = captures[2]; - return this.tok('code', 'var ' + name + ' = (' + val + ');'); - } - }, - - /** - * Mixin. - */ - - mixin: function(){ - var captures; - if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('mixin', captures[1]); - tok.args = captures[2]; - return tok; - } - }, - - /** - * Conditional. - */ - - conditional: function() { - var captures; - if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var type = captures[1] - , js = captures[2]; - - switch (type) { - case 'if': js = 'if (' + js + ')'; break; - case 'unless': js = 'if (!(' + js + '))'; break; - case 'else if': js = 'else if (' + js + ')'; break; - case 'else': js = 'else'; break; - } - - return this.tok('code', js); - } - }, - - /** - * While. - */ - - "while": function() { - var captures; - if (captures = /^while +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - return this.tok('code', 'while (' + captures[1] + ')'); - } - }, - - /** - * Each. - */ - - each: function() { - var captures; - if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('each', captures[1]); - tok.key = captures[2] || '$index'; - tok.code = captures[3]; - return tok; - } - }, - - /** - * Code. - */ - - code: function() { - var captures; - if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var flags = captures[1]; - captures[1] = captures[2]; - var tok = this.tok('code', captures[1]); - tok.escape = flags[0] === '='; - tok.buffer = flags[0] === '=' || flags[1] === '='; - return tok; - } - }, - - /** - * Attributes. - */ - - attrs: function() { - if ('(' == this.input.charAt(0)) { - var index = this.indexOfDelimiters('(', ')') - , str = this.input.substr(1, index-1) - , tok = this.tok('attrs') - , len = str.length - , colons = this.colons - , states = ['key'] - , escapedAttr - , key = '' - , val = '' - , quote - , c - , p; - - function state(){ - return states[states.length - 1]; - } - - function interpolate(attr) { - return attr.replace(/#\{([^}]+)\}/g, function(_, expr){ - return quote + " + (" + expr + ") + " + quote; - }); - } - - this.consume(index + 1); - tok.attrs = {}; - tok.escaped = {}; - - function parse(c) { - var real = c; - // TODO: remove when people fix ":" - if (colons && ':' == c) c = '='; - switch (c) { - case ',': - case '\n': - switch (state()) { - case 'expr': - case 'array': - case 'string': - case 'object': - val += c; - break; - default: - states.push('key'); - val = val.trim(); - key = key.trim(); - if ('' == key) return; - key = key.replace(/^['"]|['"]$/g, ''); - tok.escaped[key] = escapedAttr; - tok.attrs[key] = '' == val - ? true - : interpolate(val); - key = val = ''; - } - break; - case '=': - switch (state()) { - case 'key char': - key += real; - break; - case 'val': - case 'expr': - case 'array': - case 'string': - case 'object': - val += real; - break; - default: - escapedAttr = '!' != p; - states.push('val'); - } - break; - case '(': - if ('val' == state() - || 'expr' == state()) states.push('expr'); - val += c; - break; - case ')': - if ('expr' == state() - || 'val' == state()) states.pop(); - val += c; - break; - case '{': - if ('val' == state()) states.push('object'); - val += c; - break; - case '}': - if ('object' == state()) states.pop(); - val += c; - break; - case '[': - if ('val' == state()) states.push('array'); - val += c; - break; - case ']': - if ('array' == state()) states.pop(); - val += c; - break; - case '"': - case "'": - switch (state()) { - case 'key': - states.push('key char'); - break; - case 'key char': - states.pop(); - break; - case 'string': - if (c == quote) states.pop(); - val += c; - break; - default: - states.push('string'); - val += c; - quote = c; - } - break; - case '': - break; - default: - switch (state()) { - case 'key': - case 'key char': - key += c; - break; - default: - val += c; - } - } - p = c; - } - - for (var i = 0; i < len; ++i) { - parse(str.charAt(i)); - } - - parse(','); - - return tok; - } - }, - - /** - * Indent | Outdent | Newline. - */ - - indent: function() { - var captures, re; - - // established regexp - if (this.indentRe) { - captures = this.indentRe.exec(this.input); - // determine regexp - } else { - // tabs - re = /^\n(\t*) */; - captures = re.exec(this.input); - - // spaces - if (captures && !captures[1].length) { - re = /^\n( *)/; - captures = re.exec(this.input); - } - - // established - if (captures && captures[1].length) this.indentRe = re; - } - - if (captures) { - var tok - , indents = captures[1].length; - - ++this.lineno; - this.consume(indents + 1); - - if (' ' == this.input[0] || '\t' == this.input[0]) { - throw new Error('Invalid indentation, you can use tabs or spaces but not both'); - } - - // blank line - if ('\n' == this.input[0]) return this.tok('newline'); - - // outdent - if (this.indentStack.length && indents < this.indentStack[0]) { - while (this.indentStack.length && this.indentStack[0] > indents) { - this.stash.push(this.tok('outdent')); - this.indentStack.shift(); - } - tok = this.stash.pop(); - // indent - } else if (indents && indents != this.indentStack[0]) { - this.indentStack.unshift(indents); - tok = this.tok('indent', indents); - // newline - } else { - tok = this.tok('newline'); - } - - return tok; - } - }, - - /** - * Pipe-less text consumed only when - * pipeless is true; - */ - - pipelessText: function() { - if (this.pipeless) { - if ('\n' == this.input[0]) return; - var i = this.input.indexOf('\n'); - if (-1 == i) i = this.input.length; - var str = this.input.substr(0, i); - this.consume(str.length); - return this.tok('text', str); - } - }, - - /** - * ':' - */ - - colon: function() { - return this.scan(/^: */, ':'); - }, - - /** - * Return the next token object, or those - * previously stashed by lookahead. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.stashed() - || this.next(); - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - next: function() { - return this.deferred() - || this.blank() - || this.eos() - || this.pipelessText() - || this.yield() - || this.doctype() - || this["case"]() - || this.when() - || this["default"]() - || this["extends"]() - || this.append() - || this.prepend() - || this.block() - || this.include() - || this.mixin() - || this.conditional() - || this.each() - || this["while"]() - || this.assignment() - || this.tag() - || this.filter() - || this.code() - || this.id() - || this.className() - || this.attrs() - || this.indent() - || this.comment() - || this.colon() - || this.text(); - } -}; - -}); // module: lexer.js - -require.register("nodes/block-comment.js", function(module, exports, require){ - -/*! - * Jade - nodes - BlockComment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `BlockComment` with the given `block`. - * - * @param {String} val - * @param {Block} block - * @param {Boolean} buffer - * @api public - */ - -var BlockComment = module.exports = function BlockComment(val, block, buffer) { - this.block = block; - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -BlockComment.prototype = new Node; -BlockComment.prototype.constructor = BlockComment; - -}); // module: nodes/block-comment.js - -require.register("nodes/block.js", function(module, exports, require){ - -/*! - * Jade - nodes - Block - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Block` with an optional `node`. - * - * @param {Node} node - * @api public - */ - -var Block = module.exports = function Block(node){ - this.nodes = []; - if (node) this.push(node); -}; - -/** - * Inherit from `Node`. - */ - -Block.prototype = new Node; -Block.prototype.constructor = Block; - - -/** - * Replace the nodes in `other` with the nodes - * in `this` block. - * - * @param {Block} other - * @api private - */ - -Block.prototype.replace = function(other){ - other.nodes = this.nodes; -}; - -/** - * Pust the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.push = function(node){ - return this.nodes.push(node); -}; - -/** - * Check if this block is empty. - * - * @return {Boolean} - * @api public - */ - -Block.prototype.isEmpty = function(){ - return 0 == this.nodes.length; -}; - -/** - * Unshift the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.unshift = function(node){ - return this.nodes.unshift(node); -}; - -/** - * Return the "last" block, or the first `yield` node. - * - * @return {Block} - * @api private - */ - -Block.prototype.includeBlock = function(){ - var ret = this - , node; - - for (var i = 0, len = this.nodes.length; i < len; ++i) { - node = this.nodes[i]; - if (node.yield) return node; - else if (node.textOnly) continue; - else if (node.includeBlock) ret = node.includeBlock(); - else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock(); - } - - return ret; -}; - - -}); // module: nodes/block.js - -require.register("nodes/case.js", function(module, exports, require){ - -/*! - * Jade - nodes - Case - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Case` with `expr`. - * - * @param {String} expr - * @api public - */ - -var Case = exports = module.exports = function Case(expr, block){ - this.expr = expr; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Case.prototype = new Node; -Case.prototype.constructor = Case; - - -var When = exports.When = function When(expr, block){ - this.expr = expr; - this.block = block; - this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -When.prototype = new Node; -When.prototype.constructor = When; - - - -}); // module: nodes/case.js - -require.register("nodes/code.js", function(module, exports, require){ - -/*! - * Jade - nodes - Code - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Code` node with the given code `val`. - * Code may also be optionally buffered and escaped. - * - * @param {String} val - * @param {Boolean} buffer - * @param {Boolean} escape - * @api public - */ - -var Code = module.exports = function Code(val, buffer, escape) { - this.val = val; - this.buffer = buffer; - this.escape = escape; - if (val.match(/^ *else/)) this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -Code.prototype = new Node; -Code.prototype.constructor = Code; - -}); // module: nodes/code.js - -require.register("nodes/comment.js", function(module, exports, require){ - -/*! - * Jade - nodes - Comment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Comment` with the given `val`, optionally `buffer`, - * otherwise the comment may render in the output. - * - * @param {String} val - * @param {Boolean} buffer - * @api public - */ - -var Comment = module.exports = function Comment(val, buffer) { - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -Comment.prototype = new Node; -Comment.prototype.constructor = Comment; - -}); // module: nodes/comment.js - -require.register("nodes/doctype.js", function(module, exports, require){ - -/*! - * Jade - nodes - Doctype - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Doctype` with the given `val`. - * - * @param {String} val - * @api public - */ - -var Doctype = module.exports = function Doctype(val) { - this.val = val; -}; - -/** - * Inherit from `Node`. - */ - -Doctype.prototype = new Node; -Doctype.prototype.constructor = Doctype; - -}); // module: nodes/doctype.js - -require.register("nodes/each.js", function(module, exports, require){ - -/*! - * Jade - nodes - Each - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize an `Each` node, representing iteration - * - * @param {String} obj - * @param {String} val - * @param {String} key - * @param {Block} block - * @api public - */ - -var Each = module.exports = function Each(obj, val, key, block) { - this.obj = obj; - this.val = val; - this.key = key; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Each.prototype = new Node; -Each.prototype.constructor = Each; - -}); // module: nodes/each.js - -require.register("nodes/filter.js", function(module, exports, require){ - -/*! - * Jade - nodes - Filter - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node') - , Block = require('./block'); - -/** - * Initialize a `Filter` node with the given - * filter `name` and `block`. - * - * @param {String} name - * @param {Block|Node} block - * @api public - */ - -var Filter = module.exports = function Filter(name, block, attrs) { - this.name = name; - this.block = block; - this.attrs = attrs; - this.isASTFilter = block instanceof Block; -}; - -/** - * Inherit from `Node`. - */ - -Filter.prototype = new Node; -Filter.prototype.constructor = Filter; - -}); // module: nodes/filter.js - -require.register("nodes/index.js", function(module, exports, require){ - -/*! - * Jade - nodes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -exports.Node = require('./node'); -exports.Tag = require('./tag'); -exports.Code = require('./code'); -exports.Each = require('./each'); -exports.Case = require('./case'); -exports.Text = require('./text'); -exports.Block = require('./block'); -exports.Mixin = require('./mixin'); -exports.Filter = require('./filter'); -exports.Comment = require('./comment'); -exports.Literal = require('./literal'); -exports.BlockComment = require('./block-comment'); -exports.Doctype = require('./doctype'); - -}); // module: nodes/index.js - -require.register("nodes/literal.js", function(module, exports, require){ - -/*! - * Jade - nodes - Literal - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Literal` node with the given `str. - * - * @param {String} str - * @api public - */ - -var Literal = module.exports = function Literal(str) { - this.str = str - .replace(/\\/g, "\\\\") - .replace(/\n|\r\n/g, "\\n") - .replace(/'/g, "\\'"); -}; - -/** - * Inherit from `Node`. - */ - -Literal.prototype = new Node; -Literal.prototype.constructor = Literal; - - -}); // module: nodes/literal.js - -require.register("nodes/mixin.js", function(module, exports, require){ - -/*! - * Jade - nodes - Mixin - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Mixin` with `name` and `block`. - * - * @param {String} name - * @param {String} args - * @param {Block} block - * @api public - */ - -var Mixin = module.exports = function Mixin(name, args, block){ - this.name = name; - this.args = args; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Mixin.prototype = new Node; -Mixin.prototype.constructor = Mixin; - - - -}); // module: nodes/mixin.js - -require.register("nodes/node.js", function(module, exports, require){ - -/*! - * Jade - nodes - Node - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize a `Node`. - * - * @api public - */ - -var Node = module.exports = function Node(){}; -}); // module: nodes/node.js - -require.register("nodes/tag.js", function(module, exports, require){ - -/*! - * Jade - nodes - Tag - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'), - Block = require('./block'); - -/** - * Initialize a `Tag` node with the given tag `name` and optional `block`. - * - * @param {String} name - * @param {Block} block - * @api public - */ - -var Tag = module.exports = function Tag(name, block) { - this.name = name; - this.attrs = []; - this.block = block || new Block; -}; - -/** - * Inherit from `Node`. - */ - -Tag.prototype = new Node; -Tag.prototype.constructor = Tag; - - -/** - * Set attribute `name` to `val`, keep in mind these become - * part of a raw js object literal, so to quote a value you must - * '"quote me"', otherwise or example 'user.name' is literal JavaScript. - * - * @param {String} name - * @param {String} val - * @param {Boolean} escaped - * @return {Tag} for chaining - * @api public - */ - -Tag.prototype.setAttribute = function(name, val, escaped){ - this.attrs.push({ name: name, val: val, escaped: escaped }); - return this; -}; - -/** - * Remove attribute `name` when present. - * - * @param {String} name - * @api public - */ - -Tag.prototype.removeAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - delete this.attrs[i]; - } - } -}; - -/** - * Get attribute value by `name`. - * - * @param {String} name - * @return {String} - * @api public - */ - -Tag.prototype.getAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - return this.attrs[i].val; - } - } -}; - -}); // module: nodes/tag.js - -require.register("nodes/text.js", function(module, exports, require){ - -/*! - * Jade - nodes - Text - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Text` node with optional `line`. - * - * @param {String} line - * @api public - */ - -var Text = module.exports = function Text(line) { - this.nodes = []; - if ('string' == typeof line) this.push(line); -}; - -/** - * Inherit from `Node`. - */ - -Text.prototype = new Node; -Text.prototype.constructor = Text; - - -/** - * Push the given `node.` - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Text.prototype.push = function(node){ - return this.nodes.push(node); -}; - -}); // module: nodes/text.js - -require.register("parser.js", function(module, exports, require){ - -/*! - * Jade - Parser - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Lexer = require('./lexer') - , nodes = require('./nodes'); - -/** - * Initialize `Parser` with the given input `str` and `filename`. - * - * @param {String} str - * @param {String} filename - * @param {Object} options - * @api public - */ - -var Parser = exports = module.exports = function Parser(str, filename, options){ - this.input = str; - this.lexer = new Lexer(str, options); - this.filename = filename; - this.blocks = {}; - this.options = options; - this.contexts = [this]; -}; - -/** - * Tags that may not contain tags. - */ - -var textOnly = exports.textOnly = ['script', 'style']; - -/** - * Parser prototype. - */ - -Parser.prototype = { - - /** - * Push `parser` onto the context stack, - * or pop and return a `Parser`. - */ - - context: function(parser){ - if (parser) { - this.contexts.push(parser); - } else { - return this.contexts.pop(); - } - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.lexer.advance(); - }, - - /** - * Skip `n` tokens. - * - * @param {Number} n - * @api private - */ - - skip: function(n){ - while (n--) this.advance(); - }, - - /** - * Single token lookahead. - * - * @return {Object} - * @api private - */ - - peek: function() { - return this.lookahead(1); - }, - - /** - * Return lexer lineno. - * - * @return {Number} - * @api private - */ - - line: function() { - return this.lexer.lineno; - }, - - /** - * `n` token lookahead. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - return this.lexer.lookahead(n); - }, - - /** - * Parse input returning a string of js for evaluation. - * - * @return {String} - * @api public - */ - - parse: function(){ - var block = new nodes.Block, parser; - block.line = this.line(); - - while ('eos' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - - if (parser = this.extending) { - this.context(parser); - var ast = parser.parse(); - this.context(); - return ast; - } - - return block; - }, - - /** - * Expect the given type, or throw an exception. - * - * @param {String} type - * @api private - */ - - expect: function(type){ - if (this.peek().type === type) { - return this.advance(); - } else { - throw new Error('expected "' + type + '", but got "' + this.peek().type + '"'); - } - }, - - /** - * Accept the given `type`. - * - * @param {String} type - * @api private - */ - - accept: function(type){ - if (this.peek().type === type) { - return this.advance(); - } - }, - - /** - * tag - * | doctype - * | mixin - * | include - * | filter - * | comment - * | text - * | each - * | code - * | yield - * | id - * | class - */ - - parseExpr: function(){ - switch (this.peek().type) { - case 'tag': - return this.parseTag(); - case 'mixin': - return this.parseMixin(); - case 'block': - return this.parseBlock(); - case 'case': - return this.parseCase(); - case 'when': - return this.parseWhen(); - case 'default': - return this.parseDefault(); - case 'extends': - return this.parseExtends(); - case 'include': - return this.parseInclude(); - case 'doctype': - return this.parseDoctype(); - case 'filter': - return this.parseFilter(); - case 'comment': - return this.parseComment(); - case 'text': - return this.parseText(); - case 'each': - return this.parseEach(); - case 'code': - return this.parseCode(); - case 'yield': - this.advance(); - var block = new nodes.Block; - block.yield = true; - return block; - case 'id': - case 'class': - var tok = this.advance(); - this.lexer.defer(this.lexer.tok('tag', 'div')); - this.lexer.defer(tok); - return this.parseExpr(); - default: - throw new Error('unexpected token "' + this.peek().type + '"'); - } - }, - - /** - * Text - */ - - parseText: function(){ - var tok = this.expect('text') - , node = new nodes.Text(tok.val); - node.line = this.line(); - return node; - }, - - /** - * ':' expr - * | block - */ - - parseBlockExpansion: function(){ - if (':' == this.peek().type) { - this.advance(); - return new nodes.Block(this.parseExpr()); - } else { - return this.block(); - } - }, - - /** - * case - */ - - parseCase: function(){ - var val = this.expect('case').val - , node = new nodes.Case(val); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * when - */ - - parseWhen: function(){ - var val = this.expect('when').val - return new nodes.Case.When(val, this.parseBlockExpansion()); - }, - - /** - * default - */ - - parseDefault: function(){ - this.expect('default'); - return new nodes.Case.When('default', this.parseBlockExpansion()); - }, - - /** - * code - */ - - parseCode: function(){ - var tok = this.expect('code') - , node = new nodes.Code(tok.val, tok.buffer, tok.escape) - , block - , i = 1; - node.line = this.line(); - while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i; - block = 'indent' == this.lookahead(i).type; - if (block) { - this.skip(i-1); - node.block = this.block(); - } - return node; - }, - - /** - * comment - */ - - parseComment: function(){ - var tok = this.expect('comment') - , node; - - if ('indent' == this.peek().type) { - node = new nodes.BlockComment(tok.val, this.block(), tok.buffer); - } else { - node = new nodes.Comment(tok.val, tok.buffer); - } - - node.line = this.line(); - return node; - }, - - /** - * doctype - */ - - parseDoctype: function(){ - var tok = this.expect('doctype') - , node = new nodes.Doctype(tok.val); - node.line = this.line(); - return node; - }, - - /** - * filter attrs? text-block - */ - - parseFilter: function(){ - var block - , tok = this.expect('filter') - , attrs = this.accept('attrs'); - - this.lexer.pipeless = true; - block = this.parseTextBlock(); - this.lexer.pipeless = false; - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * tag ':' attrs? block - */ - - parseASTFilter: function(){ - var block - , tok = this.expect('tag') - , attrs = this.accept('attrs'); - - this.expect(':'); - block = this.block(); - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * each block - */ - - parseEach: function(){ - var tok = this.expect('each') - , node = new nodes.Each(tok.code, tok.val, tok.key); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * 'extends' name - */ - - parseExtends: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - if (!this.filename) - throw new Error('the "filename" option is required to extend templates'); - - var path = this.expect('extends').val.trim() - , dir = dirname(this.filename); - - var path = join(dir, path + '.jade') - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - - parser.blocks = this.blocks; - parser.contexts = this.contexts; - this.extending = parser; - - // TODO: null node - return new nodes.Literal(''); - }, - - /** - * 'block' name block - */ - - parseBlock: function(){ - var block = this.expect('block') - , mode = block.mode - , name = block.val.trim(); - - block = 'indent' == this.peek().type - ? this.block() - : new nodes.Block(new nodes.Literal('')); - - var prev = this.blocks[name]; - - if (prev) { - switch (prev.mode) { - case 'append': - block.nodes = block.nodes.concat(prev.nodes); - prev = block; - break; - case 'prepend': - block.nodes = prev.nodes.concat(block.nodes); - prev = block; - break; - } - } - - block.mode = mode; - return this.blocks[name] = prev || block; - }, - - /** - * include block? - */ - - parseInclude: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - var path = this.expect('include').val.trim() - , dir = dirname(this.filename); - - if (!this.filename) - throw new Error('the "filename" option is required to use includes'); - - // no extension - if (!~basename(path).indexOf('.')) { - path += '.jade'; - } - - // non-jade - if ('.jade' != path.substr(-5)) { - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8'); - return new nodes.Literal(str); - } - - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - - this.context(parser); - var ast = parser.parse(); - this.context(); - ast.filename = path; - - if ('indent' == this.peek().type) { - ast.includeBlock().push(this.block()); - } - - return ast; - }, - - /** - * mixin block - */ - - parseMixin: function(){ - var tok = this.expect('mixin') - , name = tok.val - , args = tok.args; - var block = 'indent' == this.peek().type - ? this.block() - : null; - return new nodes.Mixin(name, args, block); - }, - - /** - * indent (text | newline)* outdent - */ - - parseTextBlock: function(){ - var text = new nodes.Text; - text.line = this.line(); - var spaces = this.expect('indent').val; - if (null == this._spaces) this._spaces = spaces; - var indent = Array(spaces - this._spaces + 1).join(' '); - while ('outdent' != this.peek().type) { - switch (this.peek().type) { - case 'newline': - text.push('\\n'); - this.advance(); - break; - case 'indent': - text.push('\\n'); - this.parseTextBlock().nodes.forEach(function(node){ - text.push(node); - }); - text.push('\\n'); - break; - default: - text.push(indent + this.advance().val); - } - } - - if (spaces == this._spaces) this._spaces = null; - this.expect('outdent'); - return text; - }, - - /** - * indent expr* outdent - */ - - block: function(){ - var block = new nodes.Block; - block.line = this.line(); - this.expect('indent'); - while ('outdent' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - this.expect('outdent'); - return block; - }, - - /** - * tag (attrs | class | id)* (text | code | ':')? newline* block? - */ - - parseTag: function(){ - // ast-filter look-ahead - var i = 2; - if ('attrs' == this.lookahead(i).type) ++i; - if (':' == this.lookahead(i).type) { - if ('indent' == this.lookahead(++i).type) { - return this.parseASTFilter(); - } - } - - var name = this.advance().val - , tag = new nodes.Tag(name) - , dot; - - tag.line = this.line(); - - // (attrs | class | id)* - out: - while (true) { - switch (this.peek().type) { - case 'id': - case 'class': - var tok = this.advance(); - tag.setAttribute(tok.type, "'" + tok.val + "'"); - continue; - case 'attrs': - var tok = this.advance() - , obj = tok.attrs - , escaped = tok.escaped - , names = Object.keys(obj); - - for (var i = 0, len = names.length; i < len; ++i) { - var name = names[i] - , val = obj[name]; - tag.setAttribute(name, val, escaped[name]); - } - continue; - default: - break out; - } - } - - // check immediate '.' - if ('.' == this.peek().val) { - dot = tag.textOnly = true; - this.advance(); - } - - // (text | code | ':')? - switch (this.peek().type) { - case 'text': - tag.text = this.parseText(); - break; - case 'code': - tag.code = this.parseCode(); - break; - case ':': - this.advance(); - tag.block = new nodes.Block; - tag.block.push(this.parseExpr()); - break; - } - - // newline* - while ('newline' == this.peek().type) this.advance(); - - tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name); - - // script special-case - if ('script' == tag.name) { - var type = tag.getAttribute('type'); - if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) { - tag.textOnly = false; - } - } - - // block? - if ('indent' == this.peek().type) { - if (tag.textOnly) { - this.lexer.pipeless = true; - tag.block = this.parseTextBlock(); - this.lexer.pipeless = false; - } else { - var block = this.block(); - if (tag.block) { - for (var i = 0, len = block.nodes.length; i < len; ++i) { - tag.block.push(block.nodes[i]); - } - } else { - tag.block = block; - } - } - } - - return tag; - } -}; - -}); // module: parser.js - -require.register("runtime.js", function(module, exports, require){ - -/*! - * Jade - runtime - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Lame Array.isArray() polyfill for now. - */ - -if (!Array.isArray) { - Array.isArray = function(arr){ - return '[object Array]' == Object.prototype.toString.call(arr); - }; -} - -/** - * Lame Object.keys() polyfill for now. - */ - -if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } -} - -/** - * Render the given attributes object. - * - * @param {Object} obj - * @param {Object} escaped - * @return {String} - * @api private - */ - -exports.attrs = function attrs(obj, escaped){ - var buf = [] - , terse = obj.terse; - - delete obj.terse; - var keys = Object.keys(obj) - , len = keys.length; - - if (len) { - buf.push(''); - for (var i = 0; i < len; ++i) { - var key = keys[i] - , val = obj[key]; - - if ('boolean' == typeof val || null == val) { - if (val) { - terse - ? buf.push(key) - : buf.push(key + '="' + key + '"'); - } - } else if (0 == key.indexOf('data') && 'string' != typeof val) { - buf.push(key + "='" + JSON.stringify(val) + "'"); - } else if ('class' == key && Array.isArray(val)) { - buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); - } else if (escaped[key]) { - buf.push(key + '="' + exports.escape(val) + '"'); - } else { - buf.push(key + '="' + val + '"'); - } - } - } - - return buf.join(' '); -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - -/** - * Re-throw the given `err` in context to the - * the jade in `filename` at the given `lineno`. - * - * @param {Error} err - * @param {String} filename - * @param {String} lineno - * @api private - */ - -exports.rethrow = function rethrow(err, filename, lineno){ - if (!filename) throw err; - - var context = 3 - , str = require('fs').readFileSync(filename, 'utf8') - , lines = str.split('\n') - , start = Math.max(lineno - context, 0) - , end = Math.min(lines.length, lineno + context); - - // Error context - var context = lines.slice(start, end).map(function(line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' > ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'Jade') + ':' + lineno - + '\n' + context + '\n\n' + err.message; - throw err; -}; - -}); // module: runtime.js - -require.register("self-closing.js", function(module, exports, require){ - -/*! - * Jade - self closing tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'meta' - , 'img' - , 'link' - , 'input' - , 'source' - , 'area' - , 'base' - , 'col' - , 'br' - , 'hr' -]; -}); // module: self-closing.js - -require.register("utils.js", function(module, exports, require){ - -/*! - * Jade - utils - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Convert interpolation in the given string to JavaScript. - * - * @param {String} str - * @return {String} - * @api private - */ - -var interpolate = exports.interpolate = function(str){ - return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ - return escape - ? str - : "' + " - + ('!' == flag ? '' : 'escape') - + "((interp = " + code.replace(/\\'/g, "'") - + ") == null ? '' : interp) + '"; - }); -}; - -/** - * Escape single quotes in `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -var escape = exports.escape = function(str) { - return str.replace(/'/g, "\\'"); -}; - -/** - * Interpolate, and escape the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.text = function(str){ - return interpolate(escape(str)); -}; -}); // module: utils.js - -window.jade = require("jade"); -})(); diff --git a/node_modules/jade/jade.md b/node_modules/jade/jade.md deleted file mode 100644 index be313aa..0000000 --- a/node_modules/jade/jade.md +++ /dev/null @@ -1,368 +0,0 @@ -jade(1) -- jade template engine -=========================================== - -## Synopsis - - jade [-h|--help] [-v|--version] [-o|--obj STR] - [-O|--out DIR] [-p|--path PATH] [-P|--pretty] - [-c|--client] [-D|--no-debug] - -## Examples - - translate jade the templates dir - - $ jade templates - - create {foo,bar}.html - - $ jade {foo,bar}.jade - - jade over stdio - - $ jade < my.jade > my.html - - jade over s - - $ echo "h1 Jade!" | jade - - foo, bar dirs rendering to /tmp - - $ jade foo bar --out /tmp - - compile client-side templates without debugging - instrumentation, making the output javascript - very light-weight. This requires runtime.js - in your projects. - - $ jade --client --no-debug < my.jade - -## Tags - - Tags are simply nested via whitespace, closing - tags defined for you. These indents are called "blocks". - - ul - li - a Foo - li - a Bar - - You may have several tags in one "block": - - ul - li - a Foo - a Bar - a Baz - -## Attributes - - Tag attributes look similar to HTML, however - the values are regular JavaScript, here are - some examples: - - a(href='google.com') Google - a(class='button', href='google.com') Google - - As mentioned the attribute values are just JavaScript, - this means ternary operations and other JavaScript expressions - work just fine: - - body(class=user.authenticated ? 'authenticated' : 'anonymous') - a(href=user.website || 'http://google.com') - - Multiple lines work too: - - input(type='checkbox', - name='agreement', - checked) - - Multiple lines without the comma work fine: - - input(type='checkbox' - name='agreement' - checked) - - Funky whitespace? fine: - - input( - type='checkbox' - name='agreement' - checked) - -## Boolean attributes - - Boolean attributes are mirrored by Jade, and accept - bools, aka _true_ or _false_. When no value is specified - _true_ is assumed. For example: - - input(type="checkbox", checked) - // => "" - - For example if the checkbox was for an agreement, perhaps `user.agreed` - was _true_ the following would also output 'checked="checked"': - - input(type="checkbox", checked=user.agreed) - -## Class attributes - - The _class_ attribute accepts an array of classes, - this can be handy when generated from a javascript - function etc: - - classes = ['foo', 'bar', 'baz'] - a(class=classes) - // => "" - -## Class literal - - Classes may be defined using a ".CLASSNAME" syntax: - - .button - // => "
    " - - Or chained: - - .large.button - // => "
    " - - The previous defaulted to divs, however you - may also specify the tag type: - - h1.title My Title - // => "

    My Title

    " - -## Id literal - - Much like the class literal there's an id literal: - - #user-1 - // => "
    " - - Again we may specify the tag as well: - - ul#menu - li: a(href='/home') Home - li: a(href='/store') Store - li: a(href='/contact') Contact - - Finally all of these may be used in any combination, - the following are all valid tags: - - a.button#contact(style: 'color: red') Contact - a.button(style: 'color: red')#contact Contact - a(style: 'color: red').button#contact Contact - -## Block expansion - - Jade supports the concept of "block expansion", in which - using a trailing ":" after a tag will inject a block: - - ul - li: a Foo - li: a Bar - li: a Baz - -## Text - - Arbitrary text may follow tags: - - p Welcome to my site - - yields: - -

    Welcome to my site

    - -## Pipe text - - Another form of text is "pipe" text. Pipes act - as the text margin for large bodies of text. - - p - | This is a large - | body of text for - | this tag. - | - | Nothing too - | exciting. - - yields: - -

    This is a large - body of text for - this tag. - - Nothing too - exciting. -

    - - Using pipes we can also specify regular Jade tags - within the text: - - p - | Click to visit - a(href='http://google.com') Google - | if you want. - -## Text only tags - - As an alternative to pipe text you may add - a trailing "." to indicate that the block - contains nothing but plain-text, no tags: - - p. - This is a large - body of text for - this tag. - - Nothing too - exciting. - - Some tags are text-only by default, for example - _script_, _textarea_, and _style_ tags do not - contain nested HTML so Jade implies the trailing ".": - - script - if (foo) { - bar(); - } - - style - body { - padding: 50px; - font: 14px Helvetica; - } - -## Template script tags - - Sometimes it's useful to define HTML in script - tags using Jade, typically for client-side templates. - - To do this simply give the _script_ tag an arbitrary - _type_ attribute such as _text/x-template_: - - script(type='text/template') - h1 Look! - p Jade still works in here! - -## Interpolation - - Both plain-text and piped-text support interpolation, - which comes in two forms, escapes and non-escaped. The - following will output the _user.name_ in the paragraph - but HTML within it will be escaped to prevent XSS attacks: - - p Welcome #{user.name} - - The following syntax is identical however it will _not_ escape - HTML, and should only be used with strings that you trust: - - p Welcome !{user.name} - -## Inline HTML - - Sometimes constructing small inline snippets of HTML - in Jade can be annoying, luckily we can add plain - HTML as well: - - p Welcome #{user.name} - -## Code - - To buffer output with Jade simply use _=_ at the beginning - of a line or after a tag. This method escapes any HTML - present in the string. - - p= user.description - - To buffer output unescaped use the _!=_ variant, but again - be careful of XSS. - - p!= user.description - - The final way to mess with JavaScript code in Jade is the unbuffered - _-_, which can be used for conditionals, defining variables etc: - - - var user = { description: 'foo bar baz' } - #user - - if (user.description) { - h2 Description - p.description= user.description - - } - - When compiled blocks are wrapped in anonymous functions, so the - following is also valid, without braces: - - - var user = { description: 'foo bar baz' } - #user - - if (user.description) - h2 Description - p.description= user.description - - If you really want you could even use `.forEach()` and others: - - - users.forEach(function(user){ - .user - h2= user.name - p User #{user.name} is #{user.age} years old - - }) - - Taking this further Jade provides some syntax for conditionals, - iteration, switch statements etc. Let's look at those next! - -## Assignment - - Jade's first-class assignment is simple, simply use the _=_ - operator and Jade will _var_ it for you. The following are equivalent: - - - var user = { name: 'tobi' } - user = { name: 'tobi' } - -## Conditionals - - Jade's first-class conditional syntax allows for optional - parenthesis, and you may now omit the leading _-_ otherwise - it's identical, still just regular javascript: - - user = { description: 'foo bar baz' } - #user - if user.description - h2 Description - p.description= user.description - - Jade provides the negated version, _unless_ as well, the following - are equivalent: - - - if (!(user.isAnonymous)) - p You're logged in as #{user.name} - - unless user.isAnonymous - p You're logged in as #{user.name} - -## Iteration - - JavaScript's _for_ loops don't look very declarative, so Jade - also provides its own _for_ loop construct, aliased as _each_: - - for user in users - .user - h2= user.name - p user #{user.name} is #{user.age} year old - - As mentioned _each_ is identical: - - each user in users - .user - h2= user.name - - If necessary the index is available as well: - - for user, i in users - .user(class='user-#{i}') - h2= user.name - - Remember, it's just JavaScript: - - ul#letters - for letter in ['a', 'b', 'c'] - li= letter diff --git a/node_modules/jade/jade.min.js b/node_modules/jade/jade.min.js deleted file mode 100644 index c711757..0000000 --- a/node_modules/jade/jade.min.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(){function require(p){var path=require.resolve(p),mod=require.modules[path];if(!mod)throw new Error('failed to require "'+p+'"');return mod.exports||(mod.exports={},mod.call(mod.exports,mod,mod.exports,require.relative(path))),mod.exports}require.modules={},require.resolve=function(path){var orig=path,reg=path+".js",index=path+"/index.js";return require.modules[reg]&®||require.modules[index]&&index||orig},require.register=function(path,fn){require.modules[path]=fn},require.relative=function(parent){return function(p){if("."!=p.charAt(0))return require(p);var path=parent.split("/"),segs=p.split("/");path.pop();for(var i=0;i",this.doctype=doctype,this.terse="5"==name||"html"==name,this.xml=0==this.doctype.indexOf(""):this.buffer("/>")):(tag.attrs.length?(this.buffer("<"+name),tag.attrs.length&&this.visitAttributes(tag.attrs),this.buffer(">")):this.buffer("<"+name+">"),tag.code&&this.visitCode(tag.code),tag.text&&this.buffer(utils.text(tag.text.nodes[0].trimLeft())),this.escape="pre"==tag.name,this.visit(tag.block),this.pp&&!~inlineTags.indexOf(name)&&!tag.textOnly&&this.buffer("\\n"+Array(this.indents).join(" ")),this.buffer("")),this.indents--},visitFilter:function(filter){var fn=filters[filter.name];if(!fn)throw filter.isASTFilter?new Error('unknown ast filter "'+filter.name+':"'):new Error('unknown filter ":'+filter.name+'"');if(filter.isASTFilter)this.buf.push(fn(filter.block,this,filter.attrs));else{var text=filter.block.nodes.join("");filter.attrs=filter.attrs||{},filter.attrs.filename=this.options.filename,this.buffer(utils.text(fn(text,filter.attrs)))}},visitText:function(text){text=utils.text(text.nodes.join("")),this.escape&&(text=escape(text)),this.buffer(text),this.buffer("\\n")},visitComment:function(comment){if(!comment.buffer)return;this.pp&&this.buffer("\\n"+Array(this.indents+1).join(" ")),this.buffer("")},visitBlockComment:function(comment){if(!comment.buffer)return;0==comment.val.trim().indexOf("if")?(this.buffer("")):(this.buffer(""))},visitCode:function(code){if(code.buffer){var val=code.val.trimLeft();this.buf.push("var __val__ = "+val),val='null == __val__ ? "" : __val__',code.escape&&(val="escape("+val+")"),this.buf.push("buf.push("+val+");")}else this.buf.push(code.val);code.block&&(code.buffer||this.buf.push("{"),this.visit(code.block),code.buffer||this.buf.push("}"))},visitEach:function(each){this.buf.push("// iterate "+each.obj+"\n"+"(function(){\n"+" if ('number' == typeof "+each.obj+".length) {\n"+" for (var "+each.key+" = 0, $$l = "+each.obj+".length; "+each.key+" < $$l; "+each.key+"++) {\n"+" var "+each.val+" = "+each.obj+"["+each.key+"];\n"),this.visit(each.block),this.buf.push(" }\n } else {\n for (var "+each.key+" in "+each.obj+") {\n"+" if ("+each.obj+".hasOwnProperty("+each.key+")){"+" var "+each.val+" = "+each.obj+"["+each.key+"];\n"),this.visit(each.block),this.buf.push(" }\n"),this.buf.push(" }\n }\n}).call(this);\n")},visitAttributes:function(attrs){var buf=[],classes=[],escaped={};this.terse&&buf.push("terse: true"),attrs.forEach(function(attr){escaped[attr.name]=attr.escaped;if(attr.name=="class")classes.push("("+attr.val+")");else{var pair="'"+attr.name+"':("+attr.val+")";buf.push(pair)}}),classes.length&&(classes=classes.join(" + ' ' + "),buf.push("class: "+classes)),buf=buf.join(", ").replace("class:",'"class":'),this.buf.push("buf.push(attrs({ "+buf+" }, "+JSON.stringify(escaped)+"));")}};function escape(html){return String(html).replace(/&(?!\w+;)/g,"&").replace(//g,">").replace(/"/g,""")}}),require.register("doctypes.js",function(module,exports,require){module.exports={5:"",xml:'',"default":'',transitional:'',strict:'',frameset:'',1.1:'',basic:'',mobile:''}}),require.register("filters.js",function(module,exports,require){module.exports={cdata:function(str){return""},sass:function(str){str=str.replace(/\\n/g,"\n");var sass=require("sass").render(str).replace(/\n/g,"\\n");return'"},stylus:function(str,options){var ret;str=str.replace(/\\n/g,"\n");var stylus=require("stylus");return stylus(str,options).render(function(err,css){if(err)throw err;ret=css.replace(/\n/g,"\\n")}),'"},less:function(str){var ret;return str=str.replace(/\\n/g,"\n"),require("less").render(str,function(err,css){if(err)throw err;ret='"}),ret},markdown:function(str){var md;try{md=require("markdown")}catch(err){try{md=require("discount")}catch(err){try{md=require("markdown-js")}catch(err){try{md=require("marked")}catch(err){throw new Error("Cannot find markdown library, install markdown, discount, or marked.")}}}}return str=str.replace(/\\n/g,"\n"),md.parse(str).replace(/\n/g,"\\n").replace(/'/g,"'")},coffeescript:function(str){str=str.replace(/\\n/g,"\n");var js=require("coffee-script").compile(str).replace(/\\/g,"\\\\").replace(/\n/g,"\\n");return'"}}}),require.register("inline-tags.js",function(module,exports,require){module.exports=["a","abbr","acronym","b","br","code","em","font","i","img","ins","kbd","map","samp","small","span","strong","sub","sup"]}),require.register("jade.js",function(module,exports,require){var Parser=require("./parser"),Lexer=require("./lexer"),Compiler=require("./compiler"),runtime=require("./runtime");exports.version="0.22.1",exports.selfClosing=require("./self-closing"),exports.doctypes=require("./doctypes"),exports.filters=require("./filters"),exports.utils=require("./utils"),exports.Compiler=Compiler,exports.Parser=Parser,exports.Lexer=Lexer,exports.nodes=require("./nodes"),exports.runtime=runtime,exports.cache={};function parse(str,options){try{var parser=new Parser(str,options.filename,options),compiler=new(options.compiler||Compiler)(parser.parse(),options),js=compiler.compile();return options.debug&&console.error("\nCompiled Function:\n\n%s",js.replace(/^/gm," ")),"var buf = [];\n"+(options.self?"var self = locals || {};\n"+js:"with (locals || {}) {\n"+js+"\n}\n")+'return buf.join("");'}catch(err){parser=parser.context(),runtime.rethrow(err,parser.filename,parser.lexer.lineno)}}exports.compile=function(str,options){var options=options||{},client=options.client,filename=options.filename?JSON.stringify(options.filename):"undefined",fn;return options.compileDebug!==!1?fn=["var __jade = [{ lineno: 1, filename: "+filename+" }];","try {",parse(String(str),options),"} catch (err) {"," rethrow(err, __jade[0].filename, __jade[0].lineno);","}"].join("\n"):fn=parse(String(str),options),client&&(fn="var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;\n"+fn),fn=new Function("locals, attrs, escape, rethrow",fn),client?fn:function(locals){return fn(locals,runtime.attrs,runtime.escape,runtime.rethrow)}},exports.render=function(str,options,fn){"function"==typeof options&&(fn=options,options={});if(options.cache&&!options.filename)return fn(new Error('the "filename" option is required for caching'));try{var path=options.filename,tmpl=options.cache?exports.cache[path]||(exports.cache[path]=exports.compile(str,options)):exports.compile(str,options);fn(null,tmpl(options))}catch(err){fn(err)}},exports.renderFile=function(path,options,fn){var key=path+":string";"function"==typeof options&&(fn=options,options={});try{options.filename=path;var str=options.cache?exports.cache[key]||(exports.cache[key]=fs.readFileSync(path,"utf8")):fs.readFileSync(path,"utf8");exports.render(str,options,fn)}catch(err){fn(err)}},exports.__express=exports.renderFile}),require.register("lexer.js",function(module,exports,require){var Lexer=module.exports=function Lexer(str,options){options=options||{},this.input=str.replace(/\r\n|\r/g,"\n"),this.colons=options.colons,this.deferredTokens=[],this.lastIndents=0,this.lineno=1,this.stash=[],this.indentStack=[],this.indentRe=null,this.pipeless=!1};Lexer.prototype={tok:function(type,val){return{type:type,line:this.lineno,val:val}},consume:function(len){this.input=this.input.substr(len)},scan:function(regexp,type){var captures;if(captures=regexp.exec(this.input))return this.consume(captures[0].length),this.tok(type,captures[1])},defer:function(tok){this.deferredTokens.push(tok)},lookahead:function(n){var fetch=n-this.stash.length;while(fetch-->0)this.stash.push(this.next());return this.stash[--n]},indexOfDelimiters:function(start,end){var str=this.input,nstart=0,nend=0,pos=0;for(var i=0,len=str.length;iindents)this.stash.push(this.tok("outdent")),this.indentStack.shift();tok=this.stash.pop()}else indents&&indents!=this.indentStack[0]?(this.indentStack.unshift(indents),tok=this.tok("indent",indents)):tok=this.tok("newline");return tok}},pipelessText:function(){if(this.pipeless){if("\n"==this.input[0])return;var i=this.input.indexOf("\n");-1==i&&(i=this.input.length);var str=this.input.substr(0,i);return this.consume(str.length),this.tok("text",str)}},colon:function(){return this.scan(/^: */,":")},advance:function(){return this.stashed()||this.next()},next:function(){return this.deferred()||this.blank()||this.eos()||this.pipelessText()||this.yield()||this.doctype()||this["case"]()||this.when()||this["default"]()||this["extends"]()||this.append()||this.prepend()||this.block()||this.include()||this.mixin()||this.conditional()||this.each()||this["while"]()||this.assignment()||this.tag()||this.filter()||this.code()||this.id()||this.className()||this.attrs()||this.indent()||this.comment()||this.colon()||this.text()}}}),require.register("nodes/block-comment.js",function(module,exports,require){var Node=require("./node"),BlockComment=module.exports=function BlockComment(val,block,buffer){this.block=block,this.val=val,this.buffer=buffer};BlockComment.prototype=new Node,BlockComment.prototype.constructor=BlockComment}),require.register("nodes/block.js",function(module,exports,require){var Node=require("./node"),Block=module.exports=function Block(node){this.nodes=[],node&&this.push(node)};Block.prototype=new Node,Block.prototype.constructor=Block,Block.prototype.replace=function(other){other.nodes=this.nodes},Block.prototype.push=function(node){return this.nodes.push(node)},Block.prototype.isEmpty=function(){return 0==this.nodes.length},Block.prototype.unshift=function(node){return this.nodes.unshift(node)},Block.prototype.includeBlock=function(){var ret=this,node;for(var i=0,len=this.nodes.length;i/g,">").replace(/"/g,""")},exports.rethrow=function rethrow(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err}}),require.register("self-closing.js",function(module,exports,require){module.exports=["meta","img","link","input","source","area","base","col","br","hr"]}),require.register("utils.js",function(module,exports,require){var interpolate=exports.interpolate=function(str){return str.replace(/(\\)?([#!]){(.*?)}/g,function(str,escape,flag,code){return escape?str:"' + "+("!"==flag?"":"escape")+"((interp = "+code.replace(/\\'/g,"'")+") == null ? '' : interp) + '"})},escape=exports.escape=function(str){return str.replace(/'/g,"\\'")};exports.text=function(str){return interpolate(escape(str))}}),window.jade=require("jade")})(); \ No newline at end of file diff --git a/node_modules/jade/lib/compiler.js b/node_modules/jade/lib/compiler.js deleted file mode 100644 index 1345ae3..0000000 --- a/node_modules/jade/lib/compiler.js +++ /dev/null @@ -1,504 +0,0 @@ - -/*! - * Jade - Compiler - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var nodes = require('./nodes') - , filters = require('./filters') - , doctypes = require('./doctypes') - , selfClosing = require('./self-closing') - , inlineTags = require('./inline-tags') - , utils = require('./utils'); - -// if browser -// -// if (!Object.keys) { -// Object.keys = function(obj){ -// var arr = []; -// for (var key in obj) { -// if (obj.hasOwnProperty(key)) { -// arr.push(key); -// } -// } -// return arr; -// } -// } -// -// if (!String.prototype.trimLeft) { -// String.prototype.trimLeft = function(){ -// return this.replace(/^\s+/, ''); -// } -// } -// -// end - - -/** - * Initialize `Compiler` with the given `node`. - * - * @param {Node} node - * @param {Object} options - * @api public - */ - -var Compiler = module.exports = function Compiler(node, options) { - this.options = options = options || {}; - this.node = node; - this.hasCompiledDoctype = false; - this.hasCompiledTag = false; - this.pp = options.pretty || false; - this.debug = false !== options.compileDebug; - this.indents = 0; - if (options.doctype) this.setDoctype(options.doctype); -}; - -/** - * Compiler prototype. - */ - -Compiler.prototype = { - - /** - * Compile parse tree to JavaScript. - * - * @api public - */ - - compile: function(){ - this.buf = ['var interp;']; - this.lastBufferedIdx = -1; - this.visit(this.node); - return this.buf.join('\n'); - }, - - /** - * Sets the default doctype `name`. Sets terse mode to `true` when - * html 5 is used, causing self-closing tags to end with ">" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {string} name - * @api public - */ - - setDoctype: function(name){ - var doctype = doctypes[(name || 'default').toLowerCase()]; - doctype = doctype || ''; - this.doctype = doctype; - this.terse = '5' == name || 'html' == name; - this.xml = 0 == this.doctype.indexOf('" vs "/>", - * and boolean attributes are not mirrored. - * - * @param {Doctype} doctype - * @api public - */ - - visitDoctype: function(doctype){ - if (doctype && (doctype.val || !this.doctype)) { - this.setDoctype(doctype.val || 'default'); - } - - if (this.doctype) this.buffer(this.doctype); - this.hasCompiledDoctype = true; - }, - - /** - * Visit `mixin`, generating a function that - * may be called within the template. - * - * @param {Mixin} mixin - * @api public - */ - - visitMixin: function(mixin){ - var name = mixin.name.replace(/-/g, '_') + '_mixin' - , args = mixin.args || ''; - - if (mixin.block) { - this.buf.push('var ' + name + ' = function(' + args + '){'); - this.visit(mixin.block); - this.buf.push('}'); - } else { - this.buf.push(name + '(' + args + ');'); - } - }, - - /** - * Visit `tag` buffering tag markup, generating - * attributes, visiting the `tag`'s code and block. - * - * @param {Tag} tag - * @api public - */ - - visitTag: function(tag){ - this.indents++; - var name = tag.name; - - if (!this.hasCompiledTag) { - if (!this.hasCompiledDoctype && 'html' == name) { - this.visitDoctype(); - } - this.hasCompiledTag = true; - } - - // pretty print - if (this.pp && inlineTags.indexOf(name) == -1) { - this.buffer('\\n' + Array(this.indents).join(' ')); - } - - if (~selfClosing.indexOf(name) && !this.xml) { - this.buffer('<' + name); - this.visitAttributes(tag.attrs); - this.terse - ? this.buffer('>') - : this.buffer('/>'); - } else { - // Optimize attributes buffering - if (tag.attrs.length) { - this.buffer('<' + name); - if (tag.attrs.length) this.visitAttributes(tag.attrs); - this.buffer('>'); - } else { - this.buffer('<' + name + '>'); - } - if (tag.code) this.visitCode(tag.code); - if (tag.text) this.buffer(utils.text(tag.text.nodes[0].trimLeft())); - this.escape = 'pre' == tag.name; - this.visit(tag.block); - - // pretty print - if (this.pp && !~inlineTags.indexOf(name) && !tag.textOnly && !tag.isText()) { - this.buffer('\\n' + Array(this.indents).join(' ')); - } - - this.buffer(''); - } - this.indents--; - }, - - /** - * Visit `filter`, throwing when the filter does not exist. - * - * @param {Filter} filter - * @api public - */ - - visitFilter: function(filter){ - var fn = filters[filter.name]; - - // unknown filter - if (!fn) { - if (filter.isASTFilter) { - throw new Error('unknown ast filter "' + filter.name + ':"'); - } else { - throw new Error('unknown filter ":' + filter.name + '"'); - } - } - if (filter.isASTFilter) { - this.buf.push(fn(filter.block, this, filter.attrs)); - } else { - var text = filter.block.nodes.join(''); - filter.attrs = filter.attrs || {}; - filter.attrs.filename = this.options.filename; - this.buffer(utils.text(fn(text, filter.attrs))); - } - }, - - /** - * Visit `text` node. - * - * @param {Text} text - * @api public - */ - - visitText: function(text){ - text = utils.text(text.nodes.join('')); - if (this.escape) text = escape(text); - this.buffer(text); - this.buffer('\\n'); - }, - - /** - * Visit a `comment`, only buffering when the buffer flag is set. - * - * @param {Comment} comment - * @api public - */ - - visitComment: function(comment){ - if (!comment.buffer) return; - if (this.pp) this.buffer('\\n' + Array(this.indents + 1).join(' ')); - this.buffer(''); - }, - - /** - * Visit a `BlockComment`. - * - * @param {Comment} comment - * @api public - */ - - visitBlockComment: function(comment){ - if (!comment.buffer) return; - if (0 == comment.val.trim().indexOf('if')) { - this.buffer(''); - } else { - this.buffer(''); - } - }, - - /** - * Visit `code`, respecting buffer / escape flags. - * If the code is followed by a block, wrap it in - * a self-calling function. - * - * @param {Code} code - * @api public - */ - - visitCode: function(code){ - // Wrap code blocks with {}. - // we only wrap unbuffered code blocks ATM - // since they are usually flow control - - // Buffer code - if (code.buffer) { - var val = code.val.trimLeft(); - this.buf.push('var __val__ = ' + val); - val = 'null == __val__ ? "" : __val__'; - if (code.escape) val = 'escape(' + val + ')'; - this.buf.push("buf.push(" + val + ");"); - } else { - this.buf.push(code.val); - } - - // Block support - if (code.block) { - if (!code.buffer) this.buf.push('{'); - this.visit(code.block); - if (!code.buffer) this.buf.push('}'); - } - }, - - /** - * Visit `each` block. - * - * @param {Each} each - * @api public - */ - - visitEach: function(each){ - this.buf.push('' - + '// iterate ' + each.obj + '\n' - + '(function(){\n' - + ' if (\'number\' == typeof ' + each.obj + '.length) {\n' - + ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n' - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - this.buf.push('' - + ' }\n' - + ' } else {\n' - + ' for (var ' + each.key + ' in ' + each.obj + ') {\n' - // if browser - // + ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){' - // end - + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n'); - - this.visit(each.block); - - // if browser - // this.buf.push(' }\n'); - // end - - this.buf.push(' }\n }\n}).call(this);\n'); - }, - - /** - * Visit `attrs`. - * - * @param {Array} attrs - * @api public - */ - - visitAttributes: function(attrs){ - var buf = [] - , classes = [] - , escaped = {}; - - if (this.terse) buf.push('terse: true'); - - attrs.forEach(function(attr){ - escaped[attr.name] = attr.escaped; - if (attr.name == 'class') { - classes.push('(' + attr.val + ')'); - } else { - var pair = "'" + attr.name + "':(" + attr.val + ')'; - buf.push(pair); - } - }); - - if (classes.length) { - classes = classes.join(" + ' ' + "); - buf.push("class: " + classes); - } - - buf = buf.join(', ').replace('class:', '"class":'); - this.buf.push("buf.push(attrs({ " + buf + " }, " + JSON.stringify(escaped) + "));"); - } -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -} diff --git a/node_modules/jade/lib/doctypes.js b/node_modules/jade/lib/doctypes.js deleted file mode 100644 index feeb560..0000000 --- a/node_modules/jade/lib/doctypes.js +++ /dev/null @@ -1,18 +0,0 @@ - -/*! - * Jade - doctypes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - '5': '' - , 'xml': '' - , 'default': '' - , 'transitional': '' - , 'strict': '' - , 'frameset': '' - , '1.1': '' - , 'basic': '' - , 'mobile': '' -}; \ No newline at end of file diff --git a/node_modules/jade/lib/filters.js b/node_modules/jade/lib/filters.js deleted file mode 100644 index fdb634c..0000000 --- a/node_modules/jade/lib/filters.js +++ /dev/null @@ -1,97 +0,0 @@ - -/*! - * Jade - filters - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = { - - /** - * Wrap text with CDATA block. - */ - - cdata: function(str){ - return ''; - }, - - /** - * Transform sass to css, wrapped in style tags. - */ - - sass: function(str){ - str = str.replace(/\\n/g, '\n'); - var sass = require('sass').render(str).replace(/\n/g, '\\n'); - return ''; - }, - - /** - * Transform stylus to css, wrapped in style tags. - */ - - stylus: function(str, options){ - var ret; - str = str.replace(/\\n/g, '\n'); - var stylus = require('stylus'); - stylus(str, options).render(function(err, css){ - if (err) throw err; - ret = css.replace(/\n/g, '\\n'); - }); - return ''; - }, - - /** - * Transform less to css, wrapped in style tags. - */ - - less: function(str){ - var ret; - str = str.replace(/\\n/g, '\n'); - require('less').render(str, function(err, css){ - if (err) throw err; - ret = ''; - }); - return ret; - }, - - /** - * Transform markdown to html. - */ - - markdown: function(str){ - var md; - - // support markdown / discount - try { - md = require('markdown'); - } catch (err){ - try { - md = require('discount'); - } catch (err) { - try { - md = require('markdown-js'); - } catch (err) { - try { - md = require('marked'); - } catch (err) { - throw new - Error('Cannot find markdown library, install markdown, discount, or marked.'); - } - } - } - } - - str = str.replace(/\\n/g, '\n'); - return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,'''); - }, - - /** - * Transform coffeescript to javascript. - */ - - coffeescript: function(str){ - str = str.replace(/\\n/g, '\n'); - var js = require('coffee-script').compile(str).replace(/\\/g, '\\\\').replace(/\n/g, '\\n'); - return ''; - } -}; diff --git a/node_modules/jade/lib/inline-tags.js b/node_modules/jade/lib/inline-tags.js deleted file mode 100644 index 491de0b..0000000 --- a/node_modules/jade/lib/inline-tags.js +++ /dev/null @@ -1,28 +0,0 @@ - -/*! - * Jade - inline tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'a' - , 'abbr' - , 'acronym' - , 'b' - , 'br' - , 'code' - , 'em' - , 'font' - , 'i' - , 'img' - , 'ins' - , 'kbd' - , 'map' - , 'samp' - , 'small' - , 'span' - , 'strong' - , 'sub' - , 'sup' -]; \ No newline at end of file diff --git a/node_modules/jade/lib/jade.js b/node_modules/jade/lib/jade.js deleted file mode 100644 index 0bcf3a4..0000000 --- a/node_modules/jade/lib/jade.js +++ /dev/null @@ -1,237 +0,0 @@ -/*! - * Jade - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Parser = require('./parser') - , Lexer = require('./lexer') - , Compiler = require('./compiler') - , runtime = require('./runtime') -// if node - , fs = require('fs'); -// end - -/** - * Library version. - */ - -exports.version = '0.24.0'; - -/** - * Expose self closing tags. - */ - -exports.selfClosing = require('./self-closing'); - -/** - * Default supported doctypes. - */ - -exports.doctypes = require('./doctypes'); - -/** - * Text filters. - */ - -exports.filters = require('./filters'); - -/** - * Utilities. - */ - -exports.utils = require('./utils'); - -/** - * Expose `Compiler`. - */ - -exports.Compiler = Compiler; - -/** - * Expose `Parser`. - */ - -exports.Parser = Parser; - -/** - * Expose `Lexer`. - */ - -exports.Lexer = Lexer; - -/** - * Nodes. - */ - -exports.nodes = require('./nodes'); - -/** - * Jade runtime helpers. - */ - -exports.runtime = runtime; - -/** - * Template function cache. - */ - -exports.cache = {}; - -/** - * Parse the given `str` of jade and return a function body. - * - * @param {String} str - * @param {Object} options - * @return {String} - * @api private - */ - -function parse(str, options){ - try { - // Parse - var parser = new Parser(str, options.filename, options); - - // Compile - var compiler = new (options.compiler || Compiler)(parser.parse(), options) - , js = compiler.compile(); - - // Debug compiler - if (options.debug) { - console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' ')); - } - - return '' - + 'var buf = [];\n' - + (options.self - ? 'var self = locals || {};\n' + js - : 'with (locals || {}) {\n' + js + '\n}\n') - + 'return buf.join("");'; - } catch (err) { - parser = parser.context(); - runtime.rethrow(err, parser.filename, parser.lexer.lineno); - } -} - -/** - * Compile a `Function` representation of the given jade `str`. - * - * Options: - * - * - `compileDebug` when `false` debugging code is stripped from the compiled template - * - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()` - * for use with the Jade client-side runtime.js - * - * @param {String} str - * @param {Options} options - * @return {Function} - * @api public - */ - -exports.compile = function(str, options){ - var options = options || {} - , client = options.client - , filename = options.filename - ? JSON.stringify(options.filename) - : 'undefined' - , fn; - - if (options.compileDebug !== false) { - fn = [ - 'var __jade = [{ lineno: 1, filename: ' + filename + ' }];' - , 'try {' - , parse(String(str), options) - , '} catch (err) {' - , ' rethrow(err, __jade[0].filename, __jade[0].lineno);' - , '}' - ].join('\n'); - } else { - fn = parse(String(str), options); - } - - if (client) { - fn = 'var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;\n' + fn; - } - - fn = new Function('locals, attrs, escape, rethrow', fn); - - if (client) return fn; - - return function(locals){ - return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow); - }; -}; - -/** - * Render the given `str` of jade and invoke - * the callback `fn(err, str)`. - * - * Options: - * - * - `cache` enable template caching - * - `filename` filename required for `include` / `extends` and caching - * - * @param {String} str - * @param {Object|Function} options or fn - * @param {Function} fn - * @api public - */ - -exports.render = function(str, options, fn){ - // swap args - if ('function' == typeof options) { - fn = options, options = {}; - } - - // cache requires .filename - if (options.cache && !options.filename) { - return fn(new Error('the "filename" option is required for caching')); - } - - try { - var path = options.filename; - var tmpl = options.cache - ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) - : exports.compile(str, options); - fn(null, tmpl(options)); - } catch (err) { - fn(err); - } -}; - -/** - * Render a Jade file at the given `path` and callback `fn(err, str)`. - * - * @param {String} path - * @param {Object|Function} options or callback - * @param {Function} fn - * @api public - */ - -exports.renderFile = function(path, options, fn){ - var key = path + ':string'; - - if ('function' == typeof options) { - fn = options, options = {}; - } - - try { - options.filename = path; - var str = options.cache - ? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) - : fs.readFileSync(path, 'utf8'); - exports.render(str, options, fn); - } catch (err) { - fn(err); - } -}; - -/** - * Express support. - */ - -exports.__express = exports.renderFile; diff --git a/node_modules/jade/lib/lexer.js b/node_modules/jade/lib/lexer.js deleted file mode 100644 index 1dc52a2..0000000 --- a/node_modules/jade/lib/lexer.js +++ /dev/null @@ -1,728 +0,0 @@ - -/*! - * Jade - Lexer - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize `Lexer` with the given `str`. - * - * Options: - * - * - `colons` allow colons for attr delimiters - * - * @param {String} str - * @param {Object} options - * @api private - */ - -var Lexer = module.exports = function Lexer(str, options) { - options = options || {}; - this.input = str.replace(/\r\n|\r/g, '\n'); - this.colons = options.colons; - this.deferredTokens = []; - this.lastIndents = 0; - this.lineno = 1; - this.stash = []; - this.indentStack = []; - this.indentRe = null; - this.pipeless = false; -}; - -/** - * Lexer prototype. - */ - -Lexer.prototype = { - - /** - * Construct a token with the given `type` and `val`. - * - * @param {String} type - * @param {String} val - * @return {Object} - * @api private - */ - - tok: function(type, val){ - return { - type: type - , line: this.lineno - , val: val - } - }, - - /** - * Consume the given `len` of input. - * - * @param {Number} len - * @api private - */ - - consume: function(len){ - this.input = this.input.substr(len); - }, - - /** - * Scan for `type` with the given `regexp`. - * - * @param {String} type - * @param {RegExp} regexp - * @return {Object} - * @api private - */ - - scan: function(regexp, type){ - var captures; - if (captures = regexp.exec(this.input)) { - this.consume(captures[0].length); - return this.tok(type, captures[1]); - } - }, - - /** - * Defer the given `tok`. - * - * @param {Object} tok - * @api private - */ - - defer: function(tok){ - this.deferredTokens.push(tok); - }, - - /** - * Lookahead `n` tokens. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - var fetch = n - this.stash.length; - while (fetch-- > 0) this.stash.push(this.next()); - return this.stash[--n]; - }, - - /** - * Return the indexOf `start` / `end` delimiters. - * - * @param {String} start - * @param {String} end - * @return {Number} - * @api private - */ - - indexOfDelimiters: function(start, end){ - var str = this.input - , nstart = 0 - , nend = 0 - , pos = 0; - for (var i = 0, len = str.length; i < len; ++i) { - if (start == str.charAt(i)) { - ++nstart; - } else if (end == str.charAt(i)) { - if (++nend == nstart) { - pos = i; - break; - } - } - } - return pos; - }, - - /** - * Stashed token. - */ - - stashed: function() { - return this.stash.length - && this.stash.shift(); - }, - - /** - * Deferred token. - */ - - deferred: function() { - return this.deferredTokens.length - && this.deferredTokens.shift(); - }, - - /** - * end-of-source. - */ - - eos: function() { - if (this.input.length) return; - if (this.indentStack.length) { - this.indentStack.shift(); - return this.tok('outdent'); - } else { - return this.tok('eos'); - } - }, - - /** - * Blank line. - */ - - blank: function() { - var captures; - if (this.pipeless) return; - if (captures = /^\n *\n/.exec(this.input)) { - this.consume(captures[0].length - 1); - return this.next(); - } - }, - - /** - * Comment. - */ - - comment: function() { - var captures; - if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('comment', captures[2]); - tok.buffer = '-' != captures[1]; - return tok; - } - }, - - /** - * Tag. - */ - - tag: function() { - var captures; - if (captures = /^(\w[-:\w]*)/.exec(this.input)) { - this.consume(captures[0].length); - var tok, name = captures[1]; - if (':' == name[name.length - 1]) { - name = name.slice(0, -1); - tok = this.tok('tag', name); - this.defer(this.tok(':')); - while (' ' == this.input[0]) this.input = this.input.substr(1); - } else { - tok = this.tok('tag', name); - } - return tok; - } - }, - - /** - * Filter. - */ - - filter: function() { - return this.scan(/^:(\w+)/, 'filter'); - }, - - /** - * Doctype. - */ - - doctype: function() { - return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype'); - }, - - /** - * Id. - */ - - id: function() { - return this.scan(/^#([\w-]+)/, 'id'); - }, - - /** - * Class. - */ - - className: function() { - return this.scan(/^\.([\w-]+)/, 'class'); - }, - - /** - * Text. - */ - - text: function() { - return this.scan(/^(?:\| ?)?([^\n]+)/, 'text'); - }, - - /** - * Extends. - */ - - "extends": function() { - return this.scan(/^extends? +([^\n]+)/, 'extends'); - }, - - /** - * Block prepend. - */ - - prepend: function() { - var captures; - if (captures = /^prepend +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'prepend' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block append. - */ - - append: function() { - var captures; - if (captures = /^append +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = 'append' - , name = captures[1] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Block. - */ - - block: function() { - var captures; - if (captures = /^block +(?:(prepend|append) +)?([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var mode = captures[1] || 'replace' - , name = captures[2] - , tok = this.tok('block', name); - tok.mode = mode; - return tok; - } - }, - - /** - * Yield. - */ - - yield: function() { - return this.scan(/^yield */, 'yield'); - }, - - /** - * Include. - */ - - include: function() { - return this.scan(/^include +([^\n]+)/, 'include'); - }, - - /** - * Case. - */ - - "case": function() { - return this.scan(/^case +([^\n]+)/, 'case'); - }, - - /** - * When. - */ - - when: function() { - return this.scan(/^when +([^:\n]+)/, 'when'); - }, - - /** - * Default. - */ - - "default": function() { - return this.scan(/^default */, 'default'); - }, - - /** - * Assignment. - */ - - assignment: function() { - var captures; - if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) { - this.consume(captures[0].length); - var name = captures[1] - , val = captures[2]; - return this.tok('code', 'var ' + name + ' = (' + val + ');'); - } - }, - - /** - * Mixin. - */ - - mixin: function(){ - var captures; - if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('mixin', captures[1]); - tok.args = captures[2]; - return tok; - } - }, - - /** - * Conditional. - */ - - conditional: function() { - var captures; - if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) { - this.consume(captures[0].length); - var type = captures[1] - , js = captures[2]; - - switch (type) { - case 'if': js = 'if (' + js + ')'; break; - case 'unless': js = 'if (!(' + js + '))'; break; - case 'else if': js = 'else if (' + js + ')'; break; - case 'else': js = 'else'; break; - } - - return this.tok('code', js); - } - }, - - /** - * While. - */ - - "while": function() { - var captures; - if (captures = /^while +([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - return this.tok('code', 'while (' + captures[1] + ')'); - } - }, - - /** - * Each. - */ - - each: function() { - var captures; - if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var tok = this.tok('each', captures[1]); - tok.key = captures[2] || '$index'; - tok.code = captures[3]; - return tok; - } - }, - - /** - * Code. - */ - - code: function() { - var captures; - if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) { - this.consume(captures[0].length); - var flags = captures[1]; - captures[1] = captures[2]; - var tok = this.tok('code', captures[1]); - tok.escape = flags[0] === '='; - tok.buffer = flags[0] === '=' || flags[1] === '='; - return tok; - } - }, - - /** - * Attributes. - */ - - attrs: function() { - if ('(' == this.input.charAt(0)) { - var index = this.indexOfDelimiters('(', ')') - , str = this.input.substr(1, index-1) - , tok = this.tok('attrs') - , len = str.length - , colons = this.colons - , states = ['key'] - , escapedAttr - , key = '' - , val = '' - , quote - , c - , p; - - function state(){ - return states[states.length - 1]; - } - - function interpolate(attr) { - return attr.replace(/#\{([^}]+)\}/g, function(_, expr){ - return quote + " + (" + expr + ") + " + quote; - }); - } - - this.consume(index + 1); - tok.attrs = {}; - tok.escaped = {}; - - function parse(c) { - var real = c; - // TODO: remove when people fix ":" - if (colons && ':' == c) c = '='; - switch (c) { - case ',': - case '\n': - switch (state()) { - case 'expr': - case 'array': - case 'string': - case 'object': - val += c; - break; - default: - states.push('key'); - val = val.trim(); - key = key.trim(); - if ('' == key) return; - key = key.replace(/^['"]|['"]$/g, '').replace('!', ''); - tok.escaped[key] = escapedAttr; - tok.attrs[key] = '' == val - ? true - : interpolate(val); - key = val = ''; - } - break; - case '=': - switch (state()) { - case 'key char': - key += real; - break; - case 'val': - case 'expr': - case 'array': - case 'string': - case 'object': - val += real; - break; - default: - escapedAttr = '!' != p; - states.push('val'); - } - break; - case '(': - if ('val' == state() - || 'expr' == state()) states.push('expr'); - val += c; - break; - case ')': - if ('expr' == state() - || 'val' == state()) states.pop(); - val += c; - break; - case '{': - if ('val' == state()) states.push('object'); - val += c; - break; - case '}': - if ('object' == state()) states.pop(); - val += c; - break; - case '[': - if ('val' == state()) states.push('array'); - val += c; - break; - case ']': - if ('array' == state()) states.pop(); - val += c; - break; - case '"': - case "'": - switch (state()) { - case 'key': - states.push('key char'); - break; - case 'key char': - states.pop(); - break; - case 'string': - if (c == quote) states.pop(); - val += c; - break; - default: - states.push('string'); - val += c; - quote = c; - } - break; - case '': - break; - default: - switch (state()) { - case 'key': - case 'key char': - key += c; - break; - default: - val += c; - } - } - p = c; - } - - for (var i = 0; i < len; ++i) { - parse(str.charAt(i)); - } - - parse(','); - - return tok; - } - }, - - /** - * Indent | Outdent | Newline. - */ - - indent: function() { - var captures, re; - - // established regexp - if (this.indentRe) { - captures = this.indentRe.exec(this.input); - // determine regexp - } else { - // tabs - re = /^\n(\t*) */; - captures = re.exec(this.input); - - // spaces - if (captures && !captures[1].length) { - re = /^\n( *)/; - captures = re.exec(this.input); - } - - // established - if (captures && captures[1].length) this.indentRe = re; - } - - if (captures) { - var tok - , indents = captures[1].length; - - ++this.lineno; - this.consume(indents + 1); - - if (' ' == this.input[0] || '\t' == this.input[0]) { - throw new Error('Invalid indentation, you can use tabs or spaces but not both'); - } - - // blank line - if ('\n' == this.input[0]) return this.tok('newline'); - - // outdent - if (this.indentStack.length && indents < this.indentStack[0]) { - while (this.indentStack.length && this.indentStack[0] > indents) { - this.stash.push(this.tok('outdent')); - this.indentStack.shift(); - } - tok = this.stash.pop(); - // indent - } else if (indents && indents != this.indentStack[0]) { - this.indentStack.unshift(indents); - tok = this.tok('indent', indents); - // newline - } else { - tok = this.tok('newline'); - } - - return tok; - } - }, - - /** - * Pipe-less text consumed only when - * pipeless is true; - */ - - pipelessText: function() { - if (this.pipeless) { - if ('\n' == this.input[0]) return; - var i = this.input.indexOf('\n'); - if (-1 == i) i = this.input.length; - var str = this.input.substr(0, i); - this.consume(str.length); - return this.tok('text', str); - } - }, - - /** - * ':' - */ - - colon: function() { - return this.scan(/^: */, ':'); - }, - - /** - * Return the next token object, or those - * previously stashed by lookahead. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.stashed() - || this.next(); - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - next: function() { - return this.deferred() - || this.blank() - || this.eos() - || this.pipelessText() - || this.yield() - || this.doctype() - || this["case"]() - || this.when() - || this["default"]() - || this["extends"]() - || this.append() - || this.prepend() - || this.block() - || this.include() - || this.mixin() - || this.conditional() - || this.each() - || this["while"]() - || this.assignment() - || this.tag() - || this.filter() - || this.code() - || this.id() - || this.className() - || this.attrs() - || this.indent() - || this.comment() - || this.colon() - || this.text(); - } -}; diff --git a/node_modules/jade/lib/nodes/block-comment.js b/node_modules/jade/lib/nodes/block-comment.js deleted file mode 100644 index 4f41e4a..0000000 --- a/node_modules/jade/lib/nodes/block-comment.js +++ /dev/null @@ -1,33 +0,0 @@ - -/*! - * Jade - nodes - BlockComment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `BlockComment` with the given `block`. - * - * @param {String} val - * @param {Block} block - * @param {Boolean} buffer - * @api public - */ - -var BlockComment = module.exports = function BlockComment(val, block, buffer) { - this.block = block; - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -BlockComment.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/jade/lib/nodes/block.js b/node_modules/jade/lib/nodes/block.js deleted file mode 100644 index db63c77..0000000 --- a/node_modules/jade/lib/nodes/block.js +++ /dev/null @@ -1,100 +0,0 @@ - -/*! - * Jade - nodes - Block - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Block` with an optional `node`. - * - * @param {Node} node - * @api public - */ - -var Block = module.exports = function Block(node){ - this.nodes = []; - if (node) this.push(node); -}; - -/** - * Inherit from `Node`. - */ - -Block.prototype.__proto__ = Node.prototype; - -/** - * Replace the nodes in `other` with the nodes - * in `this` block. - * - * @param {Block} other - * @api private - */ - -Block.prototype.replace = function(other){ - other.nodes = this.nodes; -}; - -/** - * Pust the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.push = function(node){ - return this.nodes.push(node); -}; - -/** - * Check if this block is empty. - * - * @return {Boolean} - * @api public - */ - -Block.prototype.isEmpty = function(){ - return 0 == this.nodes.length; -}; - -/** - * Unshift the given `node`. - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Block.prototype.unshift = function(node){ - return this.nodes.unshift(node); -}; - -/** - * Return the "last" block, or the first `yield` node. - * - * @return {Block} - * @api private - */ - -Block.prototype.includeBlock = function(){ - var ret = this - , node; - - for (var i = 0, len = this.nodes.length; i < len; ++i) { - node = this.nodes[i]; - if (node.yield) return node; - else if (node.textOnly) continue; - else if (node.includeBlock) ret = node.includeBlock(); - else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock(); - } - - return ret; -}; - diff --git a/node_modules/jade/lib/nodes/case.js b/node_modules/jade/lib/nodes/case.js deleted file mode 100644 index 08ff033..0000000 --- a/node_modules/jade/lib/nodes/case.js +++ /dev/null @@ -1,43 +0,0 @@ - -/*! - * Jade - nodes - Case - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Case` with `expr`. - * - * @param {String} expr - * @api public - */ - -var Case = exports = module.exports = function Case(expr, block){ - this.expr = expr; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Case.prototype.__proto__ = Node.prototype; - -var When = exports.When = function When(expr, block){ - this.expr = expr; - this.block = block; - this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -When.prototype.__proto__ = Node.prototype; - diff --git a/node_modules/jade/lib/nodes/code.js b/node_modules/jade/lib/nodes/code.js deleted file mode 100644 index babc675..0000000 --- a/node_modules/jade/lib/nodes/code.js +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * Jade - nodes - Code - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Code` node with the given code `val`. - * Code may also be optionally buffered and escaped. - * - * @param {String} val - * @param {Boolean} buffer - * @param {Boolean} escape - * @api public - */ - -var Code = module.exports = function Code(val, buffer, escape) { - this.val = val; - this.buffer = buffer; - this.escape = escape; - if (val.match(/^ *else/)) this.debug = false; -}; - -/** - * Inherit from `Node`. - */ - -Code.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/jade/lib/nodes/comment.js b/node_modules/jade/lib/nodes/comment.js deleted file mode 100644 index 2e1469e..0000000 --- a/node_modules/jade/lib/nodes/comment.js +++ /dev/null @@ -1,32 +0,0 @@ - -/*! - * Jade - nodes - Comment - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Comment` with the given `val`, optionally `buffer`, - * otherwise the comment may render in the output. - * - * @param {String} val - * @param {Boolean} buffer - * @api public - */ - -var Comment = module.exports = function Comment(val, buffer) { - this.val = val; - this.buffer = buffer; -}; - -/** - * Inherit from `Node`. - */ - -Comment.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/jade/lib/nodes/doctype.js b/node_modules/jade/lib/nodes/doctype.js deleted file mode 100644 index b8f33e5..0000000 --- a/node_modules/jade/lib/nodes/doctype.js +++ /dev/null @@ -1,29 +0,0 @@ - -/*! - * Jade - nodes - Doctype - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Doctype` with the given `val`. - * - * @param {String} val - * @api public - */ - -var Doctype = module.exports = function Doctype(val) { - this.val = val; -}; - -/** - * Inherit from `Node`. - */ - -Doctype.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/jade/lib/nodes/each.js b/node_modules/jade/lib/nodes/each.js deleted file mode 100644 index f54101f..0000000 --- a/node_modules/jade/lib/nodes/each.js +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * Jade - nodes - Each - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize an `Each` node, representing iteration - * - * @param {String} obj - * @param {String} val - * @param {String} key - * @param {Block} block - * @api public - */ - -var Each = module.exports = function Each(obj, val, key, block) { - this.obj = obj; - this.val = val; - this.key = key; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Each.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/jade/lib/nodes/filter.js b/node_modules/jade/lib/nodes/filter.js deleted file mode 100644 index 5a0a237..0000000 --- a/node_modules/jade/lib/nodes/filter.js +++ /dev/null @@ -1,35 +0,0 @@ - -/*! - * Jade - nodes - Filter - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node') - , Block = require('./block'); - -/** - * Initialize a `Filter` node with the given - * filter `name` and `block`. - * - * @param {String} name - * @param {Block|Node} block - * @api public - */ - -var Filter = module.exports = function Filter(name, block, attrs) { - this.name = name; - this.block = block; - this.attrs = attrs; - this.isASTFilter = block instanceof Block; -}; - -/** - * Inherit from `Node`. - */ - -Filter.prototype.__proto__ = Node.prototype; \ No newline at end of file diff --git a/node_modules/jade/lib/nodes/index.js b/node_modules/jade/lib/nodes/index.js deleted file mode 100644 index 386ad2f..0000000 --- a/node_modules/jade/lib/nodes/index.js +++ /dev/null @@ -1,20 +0,0 @@ - -/*! - * Jade - nodes - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -exports.Node = require('./node'); -exports.Tag = require('./tag'); -exports.Code = require('./code'); -exports.Each = require('./each'); -exports.Case = require('./case'); -exports.Text = require('./text'); -exports.Block = require('./block'); -exports.Mixin = require('./mixin'); -exports.Filter = require('./filter'); -exports.Comment = require('./comment'); -exports.Literal = require('./literal'); -exports.BlockComment = require('./block-comment'); -exports.Doctype = require('./doctype'); diff --git a/node_modules/jade/lib/nodes/literal.js b/node_modules/jade/lib/nodes/literal.js deleted file mode 100644 index fde586b..0000000 --- a/node_modules/jade/lib/nodes/literal.js +++ /dev/null @@ -1,32 +0,0 @@ - -/*! - * Jade - nodes - Literal - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Literal` node with the given `str. - * - * @param {String} str - * @api public - */ - -var Literal = module.exports = function Literal(str) { - this.str = str - .replace(/\\/g, "\\\\") - .replace(/\n|\r\n/g, "\\n") - .replace(/'/g, "\\'"); -}; - -/** - * Inherit from `Node`. - */ - -Literal.prototype.__proto__ = Node.prototype; diff --git a/node_modules/jade/lib/nodes/mixin.js b/node_modules/jade/lib/nodes/mixin.js deleted file mode 100644 index f007c84..0000000 --- a/node_modules/jade/lib/nodes/mixin.js +++ /dev/null @@ -1,34 +0,0 @@ - -/*! - * Jade - nodes - Mixin - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a new `Mixin` with `name` and `block`. - * - * @param {String} name - * @param {String} args - * @param {Block} block - * @api public - */ - -var Mixin = module.exports = function Mixin(name, args, block){ - this.name = name; - this.args = args; - this.block = block; -}; - -/** - * Inherit from `Node`. - */ - -Mixin.prototype.__proto__ = Node.prototype; - diff --git a/node_modules/jade/lib/nodes/node.js b/node_modules/jade/lib/nodes/node.js deleted file mode 100644 index 0669e67..0000000 --- a/node_modules/jade/lib/nodes/node.js +++ /dev/null @@ -1,14 +0,0 @@ - -/*! - * Jade - nodes - Node - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Initialize a `Node`. - * - * @api public - */ - -var Node = module.exports = function Node(){}; \ No newline at end of file diff --git a/node_modules/jade/lib/nodes/tag.js b/node_modules/jade/lib/nodes/tag.js deleted file mode 100644 index 468705a..0000000 --- a/node_modules/jade/lib/nodes/tag.js +++ /dev/null @@ -1,92 +0,0 @@ - -/*! - * Jade - nodes - Tag - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'), - Block = require('./block'); - -/** - * Initialize a `Tag` node with the given tag `name` and optional `block`. - * - * @param {String} name - * @param {Block} block - * @api public - */ - -var Tag = module.exports = function Tag(name, block) { - this.name = name; - this.attrs = []; - this.block = block || new Block; -}; - -/** - * Inherit from `Node`. - */ - -Tag.prototype.__proto__ = Node.prototype; - -/** - * Set attribute `name` to `val`, keep in mind these become - * part of a raw js object literal, so to quote a value you must - * '"quote me"', otherwise or example 'user.name' is literal JavaScript. - * - * @param {String} name - * @param {String} val - * @param {Boolean} escaped - * @return {Tag} for chaining - * @api public - */ - -Tag.prototype.setAttribute = function(name, val, escaped){ - this.attrs.push({ name: name, val: val, escaped: escaped }); - return this; -}; - -/** - * Remove attribute `name` when present. - * - * @param {String} name - * @api public - */ - -Tag.prototype.removeAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - delete this.attrs[i]; - } - } -}; - -/** - * Get attribute value by `name`. - * - * @param {String} name - * @return {String} - * @api public - */ - -Tag.prototype.getAttribute = function(name){ - for (var i = 0, len = this.attrs.length; i < len; ++i) { - if (this.attrs[i] && this.attrs[i].name == name) { - return this.attrs[i].val; - } - } -}; - -/** - * Check if this tag's block contains only text nodes. Used for pretty printing. - * - * @return {Boolean} - * @api private - */ - -Tag.prototype.isText = function(){ - return !this.block.nodes.length; -}; \ No newline at end of file diff --git a/node_modules/jade/lib/nodes/text.js b/node_modules/jade/lib/nodes/text.js deleted file mode 100644 index 3baff4b..0000000 --- a/node_modules/jade/lib/nodes/text.js +++ /dev/null @@ -1,42 +0,0 @@ - -/*! - * Jade - nodes - Text - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Node = require('./node'); - -/** - * Initialize a `Text` node with optional `line`. - * - * @param {String} line - * @api public - */ - -var Text = module.exports = function Text(line) { - this.nodes = []; - if ('string' == typeof line) this.push(line); -}; - -/** - * Inherit from `Node`. - */ - -Text.prototype.__proto__ = Node.prototype; - -/** - * Push the given `node.` - * - * @param {Node} node - * @return {Number} - * @api public - */ - -Text.prototype.push = function(node){ - return this.nodes.push(node); -}; diff --git a/node_modules/jade/lib/parser.js b/node_modules/jade/lib/parser.js deleted file mode 100644 index da672f3..0000000 --- a/node_modules/jade/lib/parser.js +++ /dev/null @@ -1,654 +0,0 @@ - -/*! - * Jade - Parser - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var Lexer = require('./lexer') - , nodes = require('./nodes'); - -/** - * Initialize `Parser` with the given input `str` and `filename`. - * - * @param {String} str - * @param {String} filename - * @param {Object} options - * @api public - */ - -var Parser = exports = module.exports = function Parser(str, filename, options){ - this.input = str; - this.lexer = new Lexer(str, options); - this.filename = filename; - this.blocks = {}; - this.options = options; - this.contexts = [this]; -}; - -/** - * Tags that may not contain tags. - */ - -var textOnly = exports.textOnly = ['script', 'style']; - -/** - * Parser prototype. - */ - -Parser.prototype = { - - /** - * Push `parser` onto the context stack, - * or pop and return a `Parser`. - */ - - context: function(parser){ - if (parser) { - this.contexts.push(parser); - } else { - return this.contexts.pop(); - } - }, - - /** - * Return the next token object. - * - * @return {Object} - * @api private - */ - - advance: function(){ - return this.lexer.advance(); - }, - - /** - * Skip `n` tokens. - * - * @param {Number} n - * @api private - */ - - skip: function(n){ - while (n--) this.advance(); - }, - - /** - * Single token lookahead. - * - * @return {Object} - * @api private - */ - - peek: function() { - return this.lookahead(1); - }, - - /** - * Return lexer lineno. - * - * @return {Number} - * @api private - */ - - line: function() { - return this.lexer.lineno; - }, - - /** - * `n` token lookahead. - * - * @param {Number} n - * @return {Object} - * @api private - */ - - lookahead: function(n){ - return this.lexer.lookahead(n); - }, - - /** - * Parse input returning a string of js for evaluation. - * - * @return {String} - * @api public - */ - - parse: function(){ - var block = new nodes.Block, parser; - block.line = this.line(); - - while ('eos' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - - if (parser = this.extending) { - this.context(parser); - var ast = parser.parse(); - this.context(); - return ast; - } - - return block; - }, - - /** - * Expect the given type, or throw an exception. - * - * @param {String} type - * @api private - */ - - expect: function(type){ - if (this.peek().type === type) { - return this.advance(); - } else { - throw new Error('expected "' + type + '", but got "' + this.peek().type + '"'); - } - }, - - /** - * Accept the given `type`. - * - * @param {String} type - * @api private - */ - - accept: function(type){ - if (this.peek().type === type) { - return this.advance(); - } - }, - - /** - * tag - * | doctype - * | mixin - * | include - * | filter - * | comment - * | text - * | each - * | code - * | yield - * | id - * | class - */ - - parseExpr: function(){ - switch (this.peek().type) { - case 'tag': - return this.parseTag(); - case 'mixin': - return this.parseMixin(); - case 'block': - return this.parseBlock(); - case 'case': - return this.parseCase(); - case 'when': - return this.parseWhen(); - case 'default': - return this.parseDefault(); - case 'extends': - return this.parseExtends(); - case 'include': - return this.parseInclude(); - case 'doctype': - return this.parseDoctype(); - case 'filter': - return this.parseFilter(); - case 'comment': - return this.parseComment(); - case 'text': - return this.parseText(); - case 'each': - return this.parseEach(); - case 'code': - return this.parseCode(); - case 'yield': - this.advance(); - var block = new nodes.Block; - block.yield = true; - return block; - case 'id': - case 'class': - var tok = this.advance(); - this.lexer.defer(this.lexer.tok('tag', 'div')); - this.lexer.defer(tok); - return this.parseExpr(); - default: - throw new Error('unexpected token "' + this.peek().type + '"'); - } - }, - - /** - * Text - */ - - parseText: function(){ - var tok = this.expect('text') - , node = new nodes.Text(tok.val); - node.line = this.line(); - return node; - }, - - /** - * ':' expr - * | block - */ - - parseBlockExpansion: function(){ - if (':' == this.peek().type) { - this.advance(); - return new nodes.Block(this.parseExpr()); - } else { - return this.block(); - } - }, - - /** - * case - */ - - parseCase: function(){ - var val = this.expect('case').val - , node = new nodes.Case(val); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * when - */ - - parseWhen: function(){ - var val = this.expect('when').val - return new nodes.Case.When(val, this.parseBlockExpansion()); - }, - - /** - * default - */ - - parseDefault: function(){ - this.expect('default'); - return new nodes.Case.When('default', this.parseBlockExpansion()); - }, - - /** - * code - */ - - parseCode: function(){ - var tok = this.expect('code') - , node = new nodes.Code(tok.val, tok.buffer, tok.escape) - , block - , i = 1; - node.line = this.line(); - while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i; - block = 'indent' == this.lookahead(i).type; - if (block) { - this.skip(i-1); - node.block = this.block(); - } - return node; - }, - - /** - * comment - */ - - parseComment: function(){ - var tok = this.expect('comment') - , node; - - if ('indent' == this.peek().type) { - node = new nodes.BlockComment(tok.val, this.block(), tok.buffer); - } else { - node = new nodes.Comment(tok.val, tok.buffer); - } - - node.line = this.line(); - return node; - }, - - /** - * doctype - */ - - parseDoctype: function(){ - var tok = this.expect('doctype') - , node = new nodes.Doctype(tok.val); - node.line = this.line(); - return node; - }, - - /** - * filter attrs? text-block - */ - - parseFilter: function(){ - var block - , tok = this.expect('filter') - , attrs = this.accept('attrs'); - - this.lexer.pipeless = true; - block = this.parseTextBlock(); - this.lexer.pipeless = false; - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * tag ':' attrs? block - */ - - parseASTFilter: function(){ - var block - , tok = this.expect('tag') - , attrs = this.accept('attrs'); - - this.expect(':'); - block = this.block(); - - var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs); - node.line = this.line(); - return node; - }, - - /** - * each block - */ - - parseEach: function(){ - var tok = this.expect('each') - , node = new nodes.Each(tok.code, tok.val, tok.key); - node.line = this.line(); - node.block = this.block(); - return node; - }, - - /** - * 'extends' name - */ - - parseExtends: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - if (!this.filename) - throw new Error('the "filename" option is required to extend templates'); - - var path = this.expect('extends').val.trim() - , dir = dirname(this.filename); - - var path = join(dir, path + '.jade') - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - - parser.blocks = this.blocks; - parser.contexts = this.contexts; - this.extending = parser; - - // TODO: null node - return new nodes.Literal(''); - }, - - /** - * 'block' name block - */ - - parseBlock: function(){ - var block = this.expect('block') - , mode = block.mode - , name = block.val.trim(); - - block = 'indent' == this.peek().type - ? this.block() - : new nodes.Block(new nodes.Literal('')); - - var prev = this.blocks[name]; - - if (prev) { - switch (prev.mode) { - case 'append': - block.nodes = block.nodes.concat(prev.nodes); - prev = block; - break; - case 'prepend': - block.nodes = prev.nodes.concat(block.nodes); - prev = block; - break; - } - } - - block.mode = mode; - return this.blocks[name] = prev || block; - }, - - /** - * include block? - */ - - parseInclude: function(){ - var path = require('path') - , fs = require('fs') - , dirname = path.dirname - , basename = path.basename - , join = path.join; - - var path = this.expect('include').val.trim() - , dir = dirname(this.filename); - - if (!this.filename) - throw new Error('the "filename" option is required to use includes'); - - // no extension - if (!~basename(path).indexOf('.')) { - path += '.jade'; - } - - // non-jade - if ('.jade' != path.substr(-5)) { - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8'); - return new nodes.Literal(str); - } - - var path = join(dir, path) - , str = fs.readFileSync(path, 'utf8') - , parser = new Parser(str, path, this.options); - - this.context(parser); - var ast = parser.parse(); - this.context(); - ast.filename = path; - - if ('indent' == this.peek().type) { - ast.includeBlock().push(this.block()); - } - - return ast; - }, - - /** - * mixin block - */ - - parseMixin: function(){ - var tok = this.expect('mixin') - , name = tok.val - , args = tok.args; - var block = 'indent' == this.peek().type - ? this.block() - : null; - return new nodes.Mixin(name, args, block); - }, - - /** - * indent (text | newline)* outdent - */ - - parseTextBlock: function(){ - var text = new nodes.Text; - text.line = this.line(); - var spaces = this.expect('indent').val; - if (null == this._spaces) this._spaces = spaces; - var indent = Array(spaces - this._spaces + 1).join(' '); - while ('outdent' != this.peek().type) { - switch (this.peek().type) { - case 'newline': - text.push('\\n'); - this.advance(); - break; - case 'indent': - text.push('\\n'); - this.parseTextBlock().nodes.forEach(function(node){ - text.push(node); - }); - text.push('\\n'); - break; - default: - text.push(indent + this.advance().val); - } - } - - if (spaces == this._spaces) this._spaces = null; - this.expect('outdent'); - return text; - }, - - /** - * indent expr* outdent - */ - - block: function(){ - var block = new nodes.Block; - block.line = this.line(); - this.expect('indent'); - while ('outdent' != this.peek().type) { - if ('newline' == this.peek().type) { - this.advance(); - } else { - block.push(this.parseExpr()); - } - } - this.expect('outdent'); - return block; - }, - - /** - * tag (attrs | class | id)* (text | code | ':')? newline* block? - */ - - parseTag: function(){ - // ast-filter look-ahead - var i = 2; - if ('attrs' == this.lookahead(i).type) ++i; - if (':' == this.lookahead(i).type) { - if ('indent' == this.lookahead(++i).type) { - return this.parseASTFilter(); - } - } - - var name = this.advance().val - , tag = new nodes.Tag(name) - , dot; - - tag.line = this.line(); - - // (attrs | class | id)* - out: - while (true) { - switch (this.peek().type) { - case 'id': - case 'class': - var tok = this.advance(); - tag.setAttribute(tok.type, "'" + tok.val + "'"); - continue; - case 'attrs': - var tok = this.advance() - , obj = tok.attrs - , escaped = tok.escaped - , names = Object.keys(obj); - - for (var i = 0, len = names.length; i < len; ++i) { - var name = names[i] - , val = obj[name]; - tag.setAttribute(name, val, escaped[name]); - } - continue; - default: - break out; - } - } - - // check immediate '.' - if ('.' == this.peek().val) { - dot = tag.textOnly = true; - this.advance(); - } - - // (text | code | ':')? - switch (this.peek().type) { - case 'text': - tag.text = this.parseText(); - break; - case 'code': - tag.code = this.parseCode(); - break; - case ':': - this.advance(); - tag.block = new nodes.Block; - tag.block.push(this.parseExpr()); - break; - } - - // newline* - while ('newline' == this.peek().type) this.advance(); - - tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name); - - // script special-case - if ('script' == tag.name) { - var type = tag.getAttribute('type'); - if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) { - tag.textOnly = false; - } - } - - // block? - if ('indent' == this.peek().type) { - if (tag.textOnly) { - this.lexer.pipeless = true; - tag.block = this.parseTextBlock(); - this.lexer.pipeless = false; - } else { - var block = this.block(); - if (tag.block) { - for (var i = 0, len = block.nodes.length; i < len; ++i) { - tag.block.push(block.nodes[i]); - } - } else { - tag.block = block; - } - } - } - - return tag; - } -}; diff --git a/node_modules/jade/lib/runtime.js b/node_modules/jade/lib/runtime.js deleted file mode 100644 index bd40428..0000000 --- a/node_modules/jade/lib/runtime.js +++ /dev/null @@ -1,127 +0,0 @@ - -/*! - * Jade - runtime - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Lame Array.isArray() polyfill for now. - */ - -if (!Array.isArray) { - Array.isArray = function(arr){ - return '[object Array]' == Object.prototype.toString.call(arr); - }; -} - -/** - * Lame Object.keys() polyfill for now. - */ - -if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } -} - -/** - * Render the given attributes object. - * - * @param {Object} obj - * @param {Object} escaped - * @return {String} - * @api private - */ - -exports.attrs = function attrs(obj, escaped){ - var buf = [] - , terse = obj.terse; - - delete obj.terse; - var keys = Object.keys(obj) - , len = keys.length; - - if (len) { - buf.push(''); - for (var i = 0; i < len; ++i) { - var key = keys[i] - , val = obj[key]; - - if ('boolean' == typeof val || null == val) { - if (val) { - terse - ? buf.push(key) - : buf.push(key + '="' + key + '"'); - } - } else if (0 == key.indexOf('data') && 'string' != typeof val) { - buf.push(key + "='" + JSON.stringify(val) + "'"); - } else if ('class' == key && Array.isArray(val)) { - buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); - } else if (escaped[key]) { - buf.push(key + '="' + exports.escape(val) + '"'); - } else { - buf.push(key + '="' + val + '"'); - } - } - } - - return buf.join(' '); -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - -/** - * Re-throw the given `err` in context to the - * the jade in `filename` at the given `lineno`. - * - * @param {Error} err - * @param {String} filename - * @param {String} lineno - * @api private - */ - -exports.rethrow = function rethrow(err, filename, lineno){ - if (!filename) throw err; - - var context = 3 - , str = require('fs').readFileSync(filename, 'utf8') - , lines = str.split('\n') - , start = Math.max(lineno - context, 0) - , end = Math.min(lines.length, lineno + context); - - // Error context - var context = lines.slice(start, end).map(function(line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' > ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'Jade') + ':' + lineno - + '\n' + context + '\n\n' + err.message; - throw err; -}; diff --git a/node_modules/jade/lib/self-closing.js b/node_modules/jade/lib/self-closing.js deleted file mode 100644 index 0548771..0000000 --- a/node_modules/jade/lib/self-closing.js +++ /dev/null @@ -1,19 +0,0 @@ - -/*! - * Jade - self closing tags - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -module.exports = [ - 'meta' - , 'img' - , 'link' - , 'input' - , 'source' - , 'area' - , 'base' - , 'col' - , 'br' - , 'hr' -]; \ No newline at end of file diff --git a/node_modules/jade/lib/utils.js b/node_modules/jade/lib/utils.js deleted file mode 100644 index ff46d02..0000000 --- a/node_modules/jade/lib/utils.js +++ /dev/null @@ -1,49 +0,0 @@ - -/*! - * Jade - utils - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Convert interpolation in the given string to JavaScript. - * - * @param {String} str - * @return {String} - * @api private - */ - -var interpolate = exports.interpolate = function(str){ - return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ - return escape - ? str - : "' + " - + ('!' == flag ? '' : 'escape') - + "((interp = " + code.replace(/\\'/g, "'") - + ") == null ? '' : interp) + '"; - }); -}; - -/** - * Escape single quotes in `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -var escape = exports.escape = function(str) { - return str.replace(/'/g, "\\'"); -}; - -/** - * Interpolate, and escape the given `str`. - * - * @param {String} str - * @return {String} - * @api private - */ - -exports.text = function(str){ - return interpolate(escape(str)); -}; \ No newline at end of file diff --git a/node_modules/jade/node_modules/commander/.npmignore b/node_modules/jade/node_modules/commander/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/node_modules/jade/node_modules/commander/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/node_modules/jade/node_modules/commander/.travis.yml b/node_modules/jade/node_modules/commander/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/node_modules/jade/node_modules/commander/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/node_modules/jade/node_modules/commander/History.md b/node_modules/jade/node_modules/commander/History.md deleted file mode 100644 index 66c6894..0000000 --- a/node_modules/jade/node_modules/commander/History.md +++ /dev/null @@ -1,99 +0,0 @@ - -0.5.2 / 2012-01-17 -================== - - * Added support for 0.7.x - -0.5.1 / 2011-12-20 -================== - - * Fixed `password()` for recent nodes. Closes #36 - -0.5.0 / 2011-12-04 -================== - - * Added sub-command option support [itay] - -0.4.3 / 2011-12-04 -================== - - * Fixed custom help ordering. Closes #32 - -0.4.2 / 2011-11-24 -================== - - * Added travis support - * Fixed: line-buffered input automatically trimmed. Closes #31 - -0.4.1 / 2011-11-18 -================== - - * Removed listening for "close" on --help - -0.4.0 / 2011-11-15 -================== - - * Added support for `--`. Closes #24 - -0.3.3 / 2011-11-14 -================== - - * Fixed: wait for close event when writing help info [Jerry Hamlet] - -0.3.2 / 2011-11-01 -================== - - * Fixed long flag definitions with values [felixge] - -0.3.1 / 2011-10-31 -================== - - * Changed `--version` short flag to `-V` from `-v` - * Changed `.version()` so it's configurable [felixge] - -0.3.0 / 2011-10-31 -================== - - * Added support for long flags only. Closes #18 - -0.2.1 / 2011-10-24 -================== - - * "node": ">= 0.4.x < 0.7.0". Closes #20 - -0.2.0 / 2011-09-26 -================== - - * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs] - -0.1.0 / 2011-08-24 -================== - - * Added support for custom `--help` output - -0.0.5 / 2011-08-18 -================== - - * Changed: when the user enters nothing prompt for password again - * Fixed issue with passwords beginning with numbers [NuckChorris] - -0.0.4 / 2011-08-15 -================== - - * Fixed `Commander#args` - -0.0.3 / 2011-08-15 -================== - - * Added default option value support - -0.0.2 / 2011-08-15 -================== - - * Added mask support to `Command#password(str[, mask], fn)` - * Added `Command#password(str, fn)` - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/node_modules/jade/node_modules/commander/Makefile b/node_modules/jade/node_modules/commander/Makefile deleted file mode 100644 index 0074625..0000000 --- a/node_modules/jade/node_modules/commander/Makefile +++ /dev/null @@ -1,7 +0,0 @@ - -TESTS = $(shell find test/test.*.js) - -test: - @./test/run $(TESTS) - -.PHONY: test \ No newline at end of file diff --git a/node_modules/jade/node_modules/commander/Readme.md b/node_modules/jade/node_modules/commander/Readme.md deleted file mode 100644 index 2efbe7a..0000000 --- a/node_modules/jade/node_modules/commander/Readme.md +++ /dev/null @@ -1,263 +0,0 @@ - -# Commander.js - - The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander). - - [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js) - -## Installation - - $ npm install commander - -## Option parsing - - Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('commander'); - -program - .version('0.0.1') - .option('-p, --peppers', 'Add peppers') - .option('-P, --pineapple', 'Add pineapple') - .option('-b, --bbq', 'Add bbq sauce') - .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') - .parse(process.argv); - -console.log('you ordered a pizza with:'); -if (program.peppers) console.log(' - peppers'); -if (program.pineapple) console.log(' - pineappe'); -if (program.bbq) console.log(' - bbq'); -console.log(' - %s cheese', program.cheese); -``` - - Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. - -## Automated --help - - The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: - -``` - $ ./examples/pizza --help - - Usage: pizza [options] - - Options: - - -v, --version output the version number - -p, --peppers Add peppers - -P, --pineapple Add pineappe - -b, --bbq Add bbq sauce - -c, --cheese Add the specified type of cheese [marble] - -h, --help output usage information - -``` - -## Coercion - -```js -function range(val) { - return val.split('..').map(Number); -} - -function list(val) { - return val.split(','); -} - -program - .version('0.0.1') - .usage('[options] ') - .option('-i, --integer ', 'An integer argument', parseInt) - .option('-f, --float ', 'A float argument', parseFloat) - .option('-r, --range ..', 'A range', range) - .option('-l, --list ', 'A list', list) - .option('-o, --optional [value]', 'An optional value') - .parse(process.argv); - -console.log(' int: %j', program.integer); -console.log(' float: %j', program.float); -console.log(' optional: %j', program.optional); -program.range = program.range || []; -console.log(' range: %j..%j', program.range[0], program.range[1]); -console.log(' list: %j', program.list); -console.log(' args: %j', program.args); -``` - -## Custom help - - You can display arbitrary `-h, --help` information - by listening for "--help". Commander will automatically - exit once you are done so that the remainder of your program - does not execute causing undesired behaviours, for example - in the following executable "stuff" will not output when - `--help` is used. - -```js -#!/usr/bin/env node - -/** - * Module dependencies. - */ - -var program = require('../'); - -function list(val) { - return val.split(',').map(Number); -} - -program - .version('0.0.1') - .option('-f, --foo', 'enable some foo') - .option('-b, --bar', 'enable some bar') - .option('-B, --baz', 'enable some baz'); - -// must be before .parse() since -// node's emit() is immediate - -program.on('--help', function(){ - console.log(' Examples:'); - console.log(''); - console.log(' $ custom-help --help'); - console.log(' $ custom-help -h'); - console.log(''); -}); - -program.parse(process.argv); - -console.log('stuff'); -``` - -yielding the following help output: - -``` - -Usage: custom-help [options] - -Options: - - -h, --help output usage information - -v, --version output the version number - -f, --foo enable some foo - -b, --bar enable some bar - -B, --baz enable some baz - -Examples: - - $ custom-help --help - $ custom-help -h - -``` - -## .prompt(msg, fn) - - Single-line prompt: - -```js -program.prompt('name: ', function(name){ - console.log('hi %s', name); -}); -``` - - Multi-line prompt: - -```js -program.prompt('description:', function(name){ - console.log('hi %s', name); -}); -``` - - Coercion: - -```js -program.prompt('Age: ', Number, function(age){ - console.log('age: %j', age); -}); -``` - -```js -program.prompt('Birthdate: ', Date, function(date){ - console.log('date: %s', date); -}); -``` - -## .password(msg[, mask], fn) - -Prompt for password without echoing: - -```js -program.password('Password: ', function(pass){ - console.log('got "%s"', pass); - process.stdin.destroy(); -}); -``` - -Prompt for password with mask char "*": - -```js -program.password('Password: ', '*', function(pass){ - console.log('got "%s"', pass); - process.stdin.destroy(); -}); -``` - -## .confirm(msg, fn) - - Confirm with the given `msg`: - -```js -program.confirm('continue? ', function(ok){ - console.log(' got %j', ok); -}); -``` - -## .choose(list, fn) - - Let the user choose from a `list`: - -```js -var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; - -console.log('Choose the coolest pet:'); -program.choose(list, function(i){ - console.log('you chose %d "%s"', i, list[i]); -}); -``` - -## Links - - - [API documentation](http://visionmedia.github.com/commander.js/) - - [ascii tables](https://github.com/LearnBoost/cli-table) - - [progress bars](https://github.com/visionmedia/node-progress) - - [more progress bars](https://github.com/substack/node-multimeter) - - [examples](https://github.com/visionmedia/commander.js/tree/master/examples) - -## License - -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca> - -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/jade/node_modules/commander/index.js b/node_modules/jade/node_modules/commander/index.js deleted file mode 100644 index 06ec1e4..0000000 --- a/node_modules/jade/node_modules/commander/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/commander'); \ No newline at end of file diff --git a/node_modules/jade/node_modules/commander/lib/commander.js b/node_modules/jade/node_modules/commander/lib/commander.js deleted file mode 100644 index b9cbd5d..0000000 --- a/node_modules/jade/node_modules/commander/lib/commander.js +++ /dev/null @@ -1,992 +0,0 @@ - -/*! - * commander - * Copyright(c) 2011 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter - , path = require('path') - , tty = require('tty') - , basename = path.basename; - -/** - * Expose the root command. - */ - -exports = module.exports = new Command; - -/** - * Expose `Command`. - */ - -exports.Command = Command; - -/** - * Expose `Option`. - */ - -exports.Option = Option; - -/** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {String} flags - * @param {String} description - * @api public - */ - -function Option(flags, description) { - this.flags = flags; - this.required = ~flags.indexOf('<'); - this.optional = ~flags.indexOf('['); - this.bool = !~flags.indexOf('-no-'); - flags = flags.split(/[ ,|]+/); - if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); - this.long = flags.shift(); - this.description = description; -} - -/** - * Return option name. - * - * @return {String} - * @api private - */ - -Option.prototype.name = function(){ - return this.long - .replace('--', '') - .replace('no-', ''); -}; - -/** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - -Option.prototype.is = function(arg){ - return arg == this.short - || arg == this.long; -}; - -/** - * Initialize a new `Command`. - * - * @param {String} name - * @api public - */ - -function Command(name) { - this.commands = []; - this.options = []; - this.args = []; - this.name = name; -} - -/** - * Inherit from `EventEmitter.prototype`. - */ - -Command.prototype.__proto__ = EventEmitter.prototype; - -/** - * Add command `name`. - * - * The `.action()` callback is invoked when the - * command `name` is specified via __ARGV__, - * and the remaining arguments are applied to the - * function for access. - * - * When the `name` is "*" an un-matched command - * will be passed as the first arg, followed by - * the rest of __ARGV__ remaining. - * - * Examples: - * - * program - * .version('0.0.1') - * .option('-C, --chdir ', 'change the working directory') - * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - * .option('-T, --no-tests', 'ignore test hook') - * - * program - * .command('setup') - * .description('run remote setup commands') - * .action(function(){ - * console.log('setup'); - * }); - * - * program - * .command('exec ') - * .description('run the given remote command') - * .action(function(cmd){ - * console.log('exec "%s"', cmd); - * }); - * - * program - * .command('*') - * .description('deploy the given env') - * .action(function(env){ - * console.log('deploying "%s"', env); - * }); - * - * program.parse(process.argv); - * - * @param {String} name - * @return {Command} the new command - * @api public - */ - -Command.prototype.command = function(name){ - var args = name.split(/ +/); - var cmd = new Command(args.shift()); - this.commands.push(cmd); - cmd.parseExpectedArgs(args); - cmd.parent = this; - return cmd; -}; - -/** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parseExpectedArgs = function(args){ - if (!args.length) return; - var self = this; - args.forEach(function(arg){ - switch (arg[0]) { - case '<': - self.args.push({ required: true, name: arg.slice(1, -1) }); - break; - case '[': - self.args.push({ required: false, name: arg.slice(1, -1) }); - break; - } - }); - return this; -}; - -/** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function(){ - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} for chaining - * @api public - */ - -Command.prototype.action = function(fn){ - var self = this; - this.parent.on(this.name, function(args, unknown){ - // Parse any so-far unknown options - unknown = unknown || []; - var parsed = self.parseOptions(unknown); - - // Output help if necessary - outputHelpIfNecessary(self, parsed.unknown); - - // If there are still any unknown options, then we simply - // die, unless someone asked for help, in which case we give it - // to them, and then we die. - if (parsed.unknown.length > 0) { - self.unknownOption(parsed.unknown[0]); - } - - self.args.forEach(function(arg, i){ - if (arg.required && null == args[i]) { - self.missingArgument(arg.name); - } - }); - - // Always append ourselves to the end of the arguments, - // to make sure we match the number of arguments the user - // expects - if (self.args.length) { - args[self.args.length] = self; - } else { - args.push(self); - } - - fn.apply(this, args); - }); - return this; -}; - -/** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to false - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => true - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {String} flags - * @param {String} description - * @param {Function|Mixed} fn or default - * @param {Mixed} defaultValue - * @return {Command} for chaining - * @api public - */ - -Command.prototype.option = function(flags, description, fn, defaultValue){ - var self = this - , option = new Option(flags, description) - , oname = option.name() - , name = camelcase(oname); - - // default as 3rd arg - if ('function' != typeof fn) defaultValue = fn, fn = null; - - // preassign default value only for --no-*, [optional], or - if (false == option.bool || option.optional || option.required) { - // when --no-* we make sure default is true - if (false == option.bool) defaultValue = true; - // preassign only if we have a default - if (undefined !== defaultValue) self[name] = defaultValue; - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on(oname, function(val){ - // coercion - if (null != val && fn) val = fn(val); - - // unassigned or bool - if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { - // if no value, bool true, and we have a default, then use it! - if (null == val) { - self[name] = option.bool - ? defaultValue || true - : false; - } else { - self[name] = val; - } - } else if (null !== val) { - // reassign - self[name] = val; - } - }); - - return this; -}; - -/** - * Parse `argv`, settings options and invoking commands when defined. - * - * @param {Array} argv - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parse = function(argv){ - // store raw args - this.rawArgs = argv; - - // guess name - if (!this.name) this.name = basename(argv[1]); - - // process argv - var parsed = this.parseOptions(this.normalize(argv.slice(2))); - this.args = parsed.args; - return this.parseArgs(this.args, parsed.unknown); -}; - -/** - * Normalize `args`, splitting joined short flags. For example - * the arg "-abc" is equivalent to "-a -b -c". - * - * @param {Array} args - * @return {Array} - * @api private - */ - -Command.prototype.normalize = function(args){ - var ret = [] - , arg; - - for (var i = 0, len = args.length; i < len; ++i) { - arg = args[i]; - if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { - arg.slice(1).split('').forEach(function(c){ - ret.push('-' + c); - }); - } else { - ret.push(arg); - } - } - - return ret; -}; - -/** - * Parse command `args`. - * - * When listener(s) are available those - * callbacks are invoked, otherwise the "*" - * event is emitted and those actions are invoked. - * - * @param {Array} args - * @return {Command} for chaining - * @api private - */ - -Command.prototype.parseArgs = function(args, unknown){ - var cmds = this.commands - , len = cmds.length - , name; - - if (args.length) { - name = args[0]; - if (this.listeners(name).length) { - this.emit(args.shift(), args, unknown); - } else { - this.emit('*', args); - } - } else { - outputHelpIfNecessary(this, unknown); - - // If there were no args and we have unknown options, - // then they are extraneous and we need to error. - if (unknown.length > 0) { - this.unknownOption(unknown[0]); - } - } - - return this; -}; - -/** - * Return an option matching `arg` if any. - * - * @param {String} arg - * @return {Option} - * @api private - */ - -Command.prototype.optionFor = function(arg){ - for (var i = 0, len = this.options.length; i < len; ++i) { - if (this.options[i].is(arg)) { - return this.options[i]; - } - } -}; - -/** - * Parse options from `argv` returning `argv` - * void of these options. - * - * @param {Array} argv - * @return {Array} - * @api public - */ - -Command.prototype.parseOptions = function(argv){ - var args = [] - , len = argv.length - , literal - , option - , arg; - - var unknownOptions = []; - - // parse options - for (var i = 0; i < len; ++i) { - arg = argv[i]; - - // literal args after -- - if ('--' == arg) { - literal = true; - continue; - } - - if (literal) { - args.push(arg); - continue; - } - - // find matching Option - option = this.optionFor(arg); - - // option is defined - if (option) { - // requires arg - if (option.required) { - arg = argv[++i]; - if (null == arg) return this.optionMissingArgument(option); - if ('-' == arg[0]) return this.optionMissingArgument(option, arg); - this.emit(option.name(), arg); - // optional arg - } else if (option.optional) { - arg = argv[i+1]; - if (null == arg || '-' == arg[0]) { - arg = null; - } else { - ++i; - } - this.emit(option.name(), arg); - // bool - } else { - this.emit(option.name()); - } - continue; - } - - // looks like an option - if (arg.length > 1 && '-' == arg[0]) { - unknownOptions.push(arg); - - // If the next argument looks like it might be - // an argument for this option, we pass it on. - // If it isn't, then it'll simply be ignored - if (argv[i+1] && '-' != argv[i+1][0]) { - unknownOptions.push(argv[++i]); - } - continue; - } - - // arg - args.push(arg); - } - - return { args: args, unknown: unknownOptions }; -}; - -/** - * Argument `name` is missing. - * - * @param {String} name - * @api private - */ - -Command.prototype.missingArgument = function(name){ - console.error(); - console.error(" error: missing required argument `%s'", name); - console.error(); - process.exit(1); -}; - -/** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {String} option - * @param {String} flag - * @api private - */ - -Command.prototype.optionMissingArgument = function(option, flag){ - console.error(); - if (flag) { - console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); - } else { - console.error(" error: option `%s' argument missing", option.flags); - } - console.error(); - process.exit(1); -}; - -/** - * Unknown option `flag`. - * - * @param {String} flag - * @api private - */ - -Command.prototype.unknownOption = function(flag){ - console.error(); - console.error(" error: unknown option `%s'", flag); - console.error(); - process.exit(1); -}; - -/** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * @param {String} str - * @param {String} flags - * @return {Command} for chaining - * @api public - */ - -Command.prototype.version = function(str, flags){ - if (0 == arguments.length) return this._version; - this._version = str; - flags = flags || '-V, --version'; - this.option(flags, 'output the version number'); - this.on('version', function(){ - console.log(str); - process.exit(0); - }); - return this; -}; - -/** - * Set the description `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.description = function(str){ - if (0 == arguments.length) return this._description; - this._description = str; - return this; -}; - -/** - * Set / get the command usage `str`. - * - * @param {String} str - * @return {String|Command} - * @api public - */ - -Command.prototype.usage = function(str){ - var args = this.args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }); - - var usage = '[options' - + (this.commands.length ? '] [command' : '') - + ']' - + (this.args.length ? ' ' + args : ''); - if (0 == arguments.length) return this._usage || usage; - this._usage = str; - - return this; -}; - -/** - * Return the largest option length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestOptionLength = function(){ - return this.options.reduce(function(max, option){ - return Math.max(max, option.flags.length); - }, 0); -}; - -/** - * Return help for options. - * - * @return {String} - * @api private - */ - -Command.prototype.optionHelp = function(){ - var width = this.largestOptionLength(); - - // Prepend the help information - return [pad('-h, --help', width) + ' ' + 'output usage information'] - .concat(this.options.map(function(option){ - return pad(option.flags, width) - + ' ' + option.description; - })) - .join('\n'); -}; - -/** - * Return command help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.commandHelp = function(){ - if (!this.commands.length) return ''; - return [ - '' - , ' Commands:' - , '' - , this.commands.map(function(cmd){ - var args = cmd.args.map(function(arg){ - return arg.required - ? '<' + arg.name + '>' - : '[' + arg.name + ']'; - }).join(' '); - - return cmd.name - + (cmd.options.length - ? ' [options]' - : '') + ' ' + args - + (cmd.description() - ? '\n' + cmd.description() - : ''); - }).join('\n\n').replace(/^/gm, ' ') - , '' - ].join('\n'); -}; - -/** - * Return program help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.helpInformation = function(){ - return [ - '' - , ' Usage: ' + this.name + ' ' + this.usage() - , '' + this.commandHelp() - , ' Options:' - , '' - , '' + this.optionHelp().replace(/^/gm, ' ') - , '' - , '' - ].join('\n'); -}; - -/** - * Prompt for a `Number`. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptForNumber = function(str, fn){ - var self = this; - this.promptSingleLine(str, function parseNumber(val){ - val = Number(val); - if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber); - fn(val); - }); -}; - -/** - * Prompt for a `Date`. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptForDate = function(str, fn){ - var self = this; - this.promptSingleLine(str, function parseDate(val){ - val = new Date(val); - if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate); - fn(val); - }); -}; - -/** - * Single-line prompt. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptSingleLine = function(str, fn){ - if ('function' == typeof arguments[2]) { - return this['promptFor' + (fn.name || fn)](str, arguments[2]); - } - - process.stdout.write(str); - process.stdin.setEncoding('utf8'); - process.stdin.once('data', function(val){ - fn(val.trim()); - }).resume(); -}; - -/** - * Multi-line prompt. - * - * @param {String} str - * @param {Function} fn - * @api private - */ - -Command.prototype.promptMultiLine = function(str, fn){ - var buf = []; - console.log(str); - process.stdin.setEncoding('utf8'); - process.stdin.on('data', function(val){ - if ('\n' == val || '\r\n' == val) { - process.stdin.removeAllListeners('data'); - fn(buf.join('\n')); - } else { - buf.push(val.trimRight()); - } - }).resume(); -}; - -/** - * Prompt `str` and callback `fn(val)` - * - * Commander supports single-line and multi-line prompts. - * To issue a single-line prompt simply add white-space - * to the end of `str`, something like "name: ", whereas - * for a multi-line prompt omit this "description:". - * - * - * Examples: - * - * program.prompt('Username: ', function(name){ - * console.log('hi %s', name); - * }); - * - * program.prompt('Description:', function(desc){ - * console.log('description was "%s"', desc.trim()); - * }); - * - * @param {String} str - * @param {Function} fn - * @api public - */ - -Command.prototype.prompt = function(str, fn){ - if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments); - this.promptMultiLine(str, fn); -}; - -/** - * Prompt for password with `str`, `mask` char and callback `fn(val)`. - * - * The mask string defaults to '', aka no output is - * written while typing, you may want to use "*" etc. - * - * Examples: - * - * program.password('Password: ', function(pass){ - * console.log('got "%s"', pass); - * process.stdin.destroy(); - * }); - * - * program.password('Password: ', '*', function(pass){ - * console.log('got "%s"', pass); - * process.stdin.destroy(); - * }); - * - * @param {String} str - * @param {String} mask - * @param {Function} fn - * @api public - */ - -Command.prototype.password = function(str, mask, fn){ - var self = this - , buf = ''; - - // default mask - if ('function' == typeof mask) { - fn = mask; - mask = ''; - } - - process.stdin.resume(); - tty.setRawMode(true); - process.stdout.write(str); - - // keypress - process.stdin.on('keypress', function(c, key){ - if (key && 'enter' == key.name) { - console.log(); - process.stdin.removeAllListeners('keypress'); - tty.setRawMode(false); - if (!buf.trim().length) return self.password(str, mask, fn); - fn(buf); - return; - } - - if (key && key.ctrl && 'c' == key.name) { - console.log('%s', buf); - process.exit(); - } - - process.stdout.write(mask); - buf += c; - }).resume(); -}; - -/** - * Confirmation prompt with `str` and callback `fn(bool)` - * - * Examples: - * - * program.confirm('continue? ', function(ok){ - * console.log(' got %j', ok); - * process.stdin.destroy(); - * }); - * - * @param {String} str - * @param {Function} fn - * @api public - */ - - -Command.prototype.confirm = function(str, fn){ - var self = this; - this.prompt(str, function(ok){ - if (!ok.trim()) { - return self.confirm(str, fn); - } - fn(parseBool(ok)); - }); -}; - -/** - * Choice prompt with `list` of items and callback `fn(index, item)` - * - * Examples: - * - * var list = ['tobi', 'loki', 'jane', 'manny', 'luna']; - * - * console.log('Choose the coolest pet:'); - * program.choose(list, function(i){ - * console.log('you chose %d "%s"', i, list[i]); - * process.stdin.destroy(); - * }); - * - * @param {Array} list - * @param {Function} fn - * @api public - */ - -Command.prototype.choose = function(list, fn){ - var self = this; - - list.forEach(function(item, i){ - console.log(' %d) %s', i + 1, item); - }); - - function again() { - self.prompt(' : ', function(val){ - val = parseInt(val, 10) - 1; - if (null == list[val]) { - again(); - } else { - fn(val, list[val]); - } - }); - } - - again(); -}; - -/** - * Camel-case the given `flag` - * - * @param {String} flag - * @return {String} - * @api private - */ - -function camelcase(flag) { - return flag.split('-').reduce(function(str, word){ - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -/** - * Parse a boolean `str`. - * - * @param {String} str - * @return {Boolean} - * @api private - */ - -function parseBool(str) { - return /^y|yes|ok|true$/i.test(str); -} - -/** - * Pad `str` to `width`. - * - * @param {String} str - * @param {Number} width - * @return {String} - * @api private - */ - -function pad(str, width) { - var len = Math.max(0, width - str.length); - return str + Array(len + 1).join(' '); -} - -/** - * Output help information if necessary - * - * @param {Command} command to output help for - * @param {Array} array of options to search for -h or --help - * @api private - */ - -function outputHelpIfNecessary(cmd, options) { - options = options || []; - for (var i = 0; i < options.length; i++) { - if (options[i] == '--help' || options[i] == '-h') { - process.stdout.write(cmd.helpInformation()); - cmd.emit('--help'); - process.exit(0); - } - } -} diff --git a/node_modules/jade/node_modules/commander/package.json b/node_modules/jade/node_modules/commander/package.json deleted file mode 100644 index d50d124..0000000 --- a/node_modules/jade/node_modules/commander/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "commander", - "version": "0.5.2", - "description": "the complete solution for node.js command-line programs", - "keywords": [ - "command", - "option", - "parser", - "prompt", - "stdin" - ], - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/commander.js.git" - }, - "dependencies": {}, - "devDependencies": { - "should": ">= 0.0.1" - }, - "scripts": { - "test": "make test" - }, - "main": "index", - "engines": { - "node": ">= 0.4.x < 0.8.0" - }, - "_id": "commander@0.5.2", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "commander@0.5.2" -} diff --git a/node_modules/jade/node_modules/mkdirp/.gitignore.orig b/node_modules/jade/node_modules/mkdirp/.gitignore.orig deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/jade/node_modules/mkdirp/.gitignore.orig +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/jade/node_modules/mkdirp/.gitignore.rej b/node_modules/jade/node_modules/mkdirp/.gitignore.rej deleted file mode 100644 index 69244ff..0000000 --- a/node_modules/jade/node_modules/mkdirp/.gitignore.rej +++ /dev/null @@ -1,5 +0,0 @@ ---- /dev/null -+++ .gitignore -@@ -0,0 +1,2 @@ -+node_modules/ -+npm-debug.log \ No newline at end of file diff --git a/node_modules/jade/node_modules/mkdirp/.npmignore b/node_modules/jade/node_modules/mkdirp/.npmignore deleted file mode 100644 index 9303c34..0000000 --- a/node_modules/jade/node_modules/mkdirp/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log \ No newline at end of file diff --git a/node_modules/jade/node_modules/mkdirp/LICENSE b/node_modules/jade/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/jade/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/jade/node_modules/mkdirp/README.markdown b/node_modules/jade/node_modules/mkdirp/README.markdown deleted file mode 100644 index b4dd75f..0000000 --- a/node_modules/jade/node_modules/mkdirp/README.markdown +++ /dev/null @@ -1,54 +0,0 @@ -mkdirp -====== - -Like `mkdir -p`, but in node.js! - -example -======= - -pow.js ------- - var mkdirp = require('mkdirp'); - - mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') - }); - -Output - pow! - -And now /tmp/foo/bar/baz exists, huzzah! - -methods -======= - -var mkdirp = require('mkdirp'); - -mkdirp(dir, mode, cb) ---------------------- - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -mkdirp.sync(dir, mode) ----------------------- - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `mode`. - -If `mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -install -======= - -With [npm](http://npmjs.org) do: - - npm install mkdirp - -license -======= - -MIT/X11 diff --git a/node_modules/jade/node_modules/mkdirp/examples/pow.js b/node_modules/jade/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/node_modules/jade/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig b/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig deleted file mode 100644 index 7741462..0000000 --- a/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', 0755, function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej b/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej deleted file mode 100644 index 81e7f43..0000000 --- a/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej +++ /dev/null @@ -1,19 +0,0 @@ ---- examples/pow.js -+++ examples/pow.js -@@ -1,6 +1,15 @@ --var mkdirp = require('mkdirp').mkdirp; -+var mkdirp = require('../').mkdirp, -+ mkdirpSync = require('../').mkdirpSync; - - mkdirp('/tmp/foo/bar/baz', 0755, function (err) { - if (err) console.error(err) - else console.log('pow!') - }); -+ -+try { -+ mkdirpSync('/tmp/bar/foo/baz', 0755); -+ console.log('double pow!'); -+} -+catch (ex) { -+ console.log(ex); -+} \ No newline at end of file diff --git a/node_modules/jade/node_modules/mkdirp/index.js b/node_modules/jade/node_modules/mkdirp/index.js deleted file mode 100644 index 25f43ad..0000000 --- a/node_modules/jade/node_modules/mkdirp/index.js +++ /dev/null @@ -1,79 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, mode, f) { - if (typeof mode === 'function' || mode === undefined) { - f = mode; - mode = 0777 & (~process.umask()); - } - - var cb = f || function () {}; - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - fs.mkdir(p, mode, function (er) { - if (!er) return cb(); - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), mode, function (er) { - if (er) cb(er); - else mkdirP(p, mode, cb); - }); - break; - - case 'EEXIST': - fs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original EEXIST be the failure reason. - if (er2 || !stat.isDirectory()) cb(er) - else cb(); - }); - break; - - default: - cb(er); - break; - } - }); -} - -mkdirP.sync = function sync (p, mode) { - if (mode === undefined) { - mode = 0777 & (~process.umask()); - } - - if (typeof mode === 'string') mode = parseInt(mode, 8); - p = path.resolve(p); - - try { - fs.mkdirSync(p, mode) - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - var err1 = sync(path.dirname(p), mode) - if (err1) throw err1; - else return sync(p, mode); - break; - - case 'EEXIST' : - var stat; - try { - stat = fs.statSync(p); - } - catch (err1) { - throw err0 - } - if (!stat.isDirectory()) throw err0; - else return null; - break; - default : - throw err0 - break; - } - } - - return null; -}; diff --git a/node_modules/jade/node_modules/mkdirp/package.json b/node_modules/jade/node_modules/mkdirp/package.json deleted file mode 100644 index a1cca29..0000000 --- a/node_modules/jade/node_modules/mkdirp/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.3.0", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "./index", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "git://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "0.0.x" - }, - "license": "MIT/X11", - "engines": { - "node": "*" - }, - "_id": "mkdirp@0.3.0", - "dependencies": {}, - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "547f4175cbaef0dcd9a3f54d0006d634b2ec1d90" - }, - "_from": "mkdirp@0.3.0" -} diff --git a/node_modules/jade/node_modules/mkdirp/test/chmod.js b/node_modules/jade/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 520dcb8..0000000 --- a/node_modules/jade/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = 0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = 0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/jade/node_modules/mkdirp/test/clobber.js b/node_modules/jade/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 0eb7099..0000000 --- a/node_modules/jade/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, 0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/jade/node_modules/mkdirp/test/mkdirp.js b/node_modules/jade/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index b07cd70..0000000 --- a/node_modules/jade/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('woo', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/jade/node_modules/mkdirp/test/perm.js b/node_modules/jade/node_modules/mkdirp/test/perm.js deleted file mode 100644 index 23a7abb..0000000 --- a/node_modules/jade/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('async perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', 0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/jade/node_modules/mkdirp/test/perm_sync.js b/node_modules/jade/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index f685f60..0000000 --- a/node_modules/jade/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,39 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync perm', function (t) { - t.plan(2); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); - -test('sync root perm', function (t) { - t.plan(1); - - var file = '/tmp'; - mkdirp.sync(file, 0755); - path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }); -}); diff --git a/node_modules/jade/node_modules/mkdirp/test/race.js b/node_modules/jade/node_modules/mkdirp/test/race.js deleted file mode 100644 index 96a0447..0000000 --- a/node_modules/jade/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('race', function (t) { - t.plan(4); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file, function () { - if (--res === 0) t.end(); - }); - - mk(file, function () { - if (--res === 0) t.end(); - }); - - function mk (file, cb) { - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - if (cb) cb(); - } - }) - }) - }); - } -}); diff --git a/node_modules/jade/node_modules/mkdirp/test/rel.js b/node_modules/jade/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 7985824..0000000 --- a/node_modules/jade/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('rel', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, 0755, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - process.chdir(cwd); - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/jade/node_modules/mkdirp/test/sync.js b/node_modules/jade/node_modules/mkdirp/test/sync.js deleted file mode 100644 index e0e389d..0000000 --- a/node_modules/jade/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('sync', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - var err = mkdirp.sync(file, 0755); - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0755); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) -}); diff --git a/node_modules/jade/node_modules/mkdirp/test/umask.js b/node_modules/jade/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 64ccafe..0000000 --- a/node_modules/jade/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('implicit mode from umask', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, 0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) - }); -}); diff --git a/node_modules/jade/node_modules/mkdirp/test/umask_sync.js b/node_modules/jade/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 83cba56..0000000 --- a/node_modules/jade/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('umask sync modes', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - var err = mkdirp.sync(file); - if (err) t.fail(err); - else path.exists(file, function (ex) { - if (!ex) t.fail('file not created') - else fs.stat(file, function (err, stat) { - if (err) t.fail(err) - else { - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - t.end(); - } - }) - }) -}); diff --git a/node_modules/jade/package.json b/node_modules/jade/package.json deleted file mode 100644 index c4b03bd..0000000 --- a/node_modules/jade/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "jade", - "description": "Jade template engine", - "version": "0.24.0", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/jade.git" - }, - "main": "./index.js", - "bin": { - "jade": "./bin/jade" - }, - "man": [ - "./jade.1" - ], - "dependencies": { - "commander": "0.5.2", - "mkdirp": "0.3.0" - }, - "devDependencies": { - "mocha": "*", - "coffee-script": "*", - "markdown": "*", - "stylus": "*", - "uubench": "*", - "should": "*", - "less": "*", - "uglify-js": "*" - }, - "scripts": { - "prepublish": "npm prune" - }, - "engines": { - "node": ">= 0.1.98" - }, - "_id": "jade@0.24.0", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "b33cd6fc6b85e75080f18707a3f4ab23c5261cdb" - }, - "_from": "jade" -} diff --git a/node_modules/jade/runtime.js b/node_modules/jade/runtime.js deleted file mode 100644 index 6e41b5d..0000000 --- a/node_modules/jade/runtime.js +++ /dev/null @@ -1,132 +0,0 @@ - -var jade = (function(exports){ -/*! - * Jade - runtime - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Lame Array.isArray() polyfill for now. - */ - -if (!Array.isArray) { - Array.isArray = function(arr){ - return '[object Array]' == Object.prototype.toString.call(arr); - }; -} - -/** - * Lame Object.keys() polyfill for now. - */ - -if (!Object.keys) { - Object.keys = function(obj){ - var arr = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - arr.push(key); - } - } - return arr; - } -} - -/** - * Render the given attributes object. - * - * @param {Object} obj - * @param {Object} escaped - * @return {String} - * @api private - */ - -exports.attrs = function attrs(obj, escaped){ - var buf = [] - , terse = obj.terse; - - delete obj.terse; - var keys = Object.keys(obj) - , len = keys.length; - - if (len) { - buf.push(''); - for (var i = 0; i < len; ++i) { - var key = keys[i] - , val = obj[key]; - - if ('boolean' == typeof val || null == val) { - if (val) { - terse - ? buf.push(key) - : buf.push(key + '="' + key + '"'); - } - } else if (0 == key.indexOf('data') && 'string' != typeof val) { - buf.push(key + "='" + JSON.stringify(val) + "'"); - } else if ('class' == key && Array.isArray(val)) { - buf.push(key + '="' + exports.escape(val.join(' ')) + '"'); - } else if (escaped[key]) { - buf.push(key + '="' + exports.escape(val) + '"'); - } else { - buf.push(key + '="' + val + '"'); - } - } - } - - return buf.join(' '); -}; - -/** - * Escape the given string of `html`. - * - * @param {String} html - * @return {String} - * @api private - */ - -exports.escape = function escape(html){ - return String(html) - .replace(/&(?!\w+;)/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); -}; - -/** - * Re-throw the given `err` in context to the - * the jade in `filename` at the given `lineno`. - * - * @param {Error} err - * @param {String} filename - * @param {String} lineno - * @api private - */ - -exports.rethrow = function rethrow(err, filename, lineno){ - if (!filename) throw err; - - var context = 3 - , str = require('fs').readFileSync(filename, 'utf8') - , lines = str.split('\n') - , start = Math.max(lineno - context, 0) - , end = Math.min(lines.length, lineno + context); - - // Error context - var context = lines.slice(start, end).map(function(line, i){ - var curr = i + start + 1; - return (curr == lineno ? ' > ' : ' ') - + curr - + '| ' - + line; - }).join('\n'); - - // Alter exception message - err.path = filename; - err.message = (filename || 'Jade') + ':' + lineno - + '\n' + context + '\n\n' + err.message; - throw err; -}; - - return exports; - -})({}); \ No newline at end of file diff --git a/node_modules/jade/runtime.min.js b/node_modules/jade/runtime.min.js deleted file mode 100644 index bc815e0..0000000 --- a/node_modules/jade/runtime.min.js +++ /dev/null @@ -1 +0,0 @@ -var jade=function(exports){return Array.isArray||(Array.isArray=function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}),Object.keys||(Object.keys=function(obj){var arr=[];for(var key in obj)obj.hasOwnProperty(key)&&arr.push(key);return arr}),exports.attrs=function attrs(obj,escaped){var buf=[],terse=obj.terse;delete obj.terse;var keys=Object.keys(obj),len=keys.length;if(len){buf.push("");for(var i=0;i/g,">").replace(/"/g,""")},exports.rethrow=function rethrow(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err},exports}({}); \ No newline at end of file diff --git a/node_modules/jade/test.jade b/node_modules/jade/test.jade deleted file mode 100644 index b3a8988..0000000 --- a/node_modules/jade/test.jade +++ /dev/null @@ -1,7 +0,0 @@ -p. - This is a large - body of text for - this tag. - - Nothing too - exciting. \ No newline at end of file diff --git a/node_modules/jade/testing/head.jade b/node_modules/jade/testing/head.jade deleted file mode 100644 index 8515406..0000000 --- a/node_modules/jade/testing/head.jade +++ /dev/null @@ -1,5 +0,0 @@ -head - script(src='/jquery.js') - yield - if false - script(src='/jquery.ui.js') diff --git a/node_modules/jade/testing/index.jade b/node_modules/jade/testing/index.jade deleted file mode 100644 index 79cd819..0000000 --- a/node_modules/jade/testing/index.jade +++ /dev/null @@ -1,10 +0,0 @@ -list = [1,2,3,4,5,6] - -table - each val, i in list - row = i % 3 == 0 - if row - - td= val - if row - \ No newline at end of file diff --git a/node_modules/jade/testing/index.js b/node_modules/jade/testing/index.js deleted file mode 100644 index 776fa0f..0000000 --- a/node_modules/jade/testing/index.js +++ /dev/null @@ -1,11 +0,0 @@ - -/** - * Module dependencies. - */ - -var jade = require('../'); - -jade.renderFile('testing/index.jade', { pretty: true }, function(err, str){ - if (err) throw err; - console.log(str); -}); \ No newline at end of file diff --git a/node_modules/jade/testing/layout.jade b/node_modules/jade/testing/layout.jade deleted file mode 100644 index 6923cf1..0000000 --- a/node_modules/jade/testing/layout.jade +++ /dev/null @@ -1,6 +0,0 @@ -html - include head - script(src='/caustic.js') - script(src='/app.js') - body - block content \ No newline at end of file diff --git a/node_modules/jade/testing/user.jade b/node_modules/jade/testing/user.jade deleted file mode 100644 index 3c636b7..0000000 --- a/node_modules/jade/testing/user.jade +++ /dev/null @@ -1,7 +0,0 @@ -h1 Tobi -p Is a ferret - -ul - li: a foo - li: a bar - li: a baz \ No newline at end of file diff --git a/node_modules/jade/testing/user.js b/node_modules/jade/testing/user.js deleted file mode 100644 index 2ecc45e..0000000 --- a/node_modules/jade/testing/user.js +++ /dev/null @@ -1,27 +0,0 @@ -function anonymous(locals, attrs, escape, rethrow) { -var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow; -var __jade = [{ lineno: 1, filename: "testing/user.jade" }]; -try { -var buf = []; -with (locals || {}) { -var interp; -__jade.unshift({ lineno: 1, filename: __jade[0].filename }); -__jade.unshift({ lineno: 1, filename: __jade[0].filename }); -buf.push('

    Tobi'); -__jade.unshift({ lineno: undefined, filename: __jade[0].filename }); -__jade.shift(); -buf.push('

    '); -__jade.shift(); -__jade.unshift({ lineno: 2, filename: __jade[0].filename }); -buf.push('

    Is a ferret'); -__jade.unshift({ lineno: undefined, filename: __jade[0].filename }); -__jade.shift(); -buf.push('

    '); -__jade.shift(); -__jade.shift(); -} -return buf.join(""); -} catch (err) { - rethrow(err, __jade[0].filename, __jade[0].lineno); -} -} \ No newline at end of file diff --git a/node_modules/nopt/.npmignore b/node_modules/nopt/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/nopt/LICENSE b/node_modules/nopt/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/nopt/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/nopt/README.md b/node_modules/nopt/README.md deleted file mode 100644 index eeddfd4..0000000 --- a/node_modules/nopt/README.md +++ /dev/null @@ -1,208 +0,0 @@ -If you want to write an option parser, and have it be good, there are -two ways to do it. The Right Way, and the Wrong Way. - -The Wrong Way is to sit down and write an option parser. We've all done -that. - -The Right Way is to write some complex configurable program with so many -options that you go half-insane just trying to manage them all, and put -it off with duct-tape solutions until you see exactly to the core of the -problem, and finally snap and write an awesome option parser. - -If you want to write an option parser, don't write an option parser. -Write a package manager, or a source control system, or a service -restarter, or an operating system. You probably won't end up with a -good one of those, but if you don't give up, and you are relentless and -diligent enough in your procrastination, you may just end up with a very -nice option parser. - -## USAGE - - // my-program.js - var nopt = require("nopt") - , Stream = require("stream").Stream - , path = require("path") - , knownOpts = { "foo" : [String, null] - , "bar" : [Stream, Number] - , "baz" : path - , "bloo" : [ "big", "medium", "small" ] - , "flag" : Boolean - , "pick" : Boolean - , "many" : [String, Array] - } - , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] - , "b7" : ["--bar", "7"] - , "m" : ["--bloo", "medium"] - , "p" : ["--pick"] - , "f" : ["--flag"] - } - // everything is optional. - // knownOpts and shorthands default to {} - // arg list defaults to process.argv - // slice defaults to 2 - , parsed = nopt(knownOpts, shortHands, process.argv, 2) - console.log(parsed) - -This would give you support for any of the following: - -```bash -$ node my-program.js --foo "blerp" --no-flag -{ "foo" : "blerp", "flag" : false } - -$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag -{ bar: 7, foo: "Mr. Hand", flag: true } - -$ node my-program.js --foo "blerp" -f -----p -{ foo: "blerp", flag: true, pick: true } - -$ node my-program.js -fp --foofoo -{ foo: "Mr. Foo", flag: true, pick: true } - -$ node my-program.js --foofoo -- -fp # -- stops the flag parsing. -{ foo: "Mr. Foo", argv: { remain: ["-fp"] } } - -$ node my-program.js --blatzk 1000 -fp # unknown opts are ok. -{ blatzk: 1000, flag: true, pick: true } - -$ node my-program.js --blatzk true -fp # but they need a value -{ blatzk: true, flag: true, pick: true } - -$ node my-program.js --no-blatzk -fp # unless they start with "no-" -{ blatzk: false, flag: true, pick: true } - -$ node my-program.js --baz b/a/z # known paths are resolved. -{ baz: "/Users/isaacs/b/a/z" } - -# if Array is one of the types, then it can take many -# values, and will always be an array. The other types provided -# specify what types are allowed in the list. - -$ node my-program.js --many 1 --many null --many foo -{ many: ["1", "null", "foo"] } - -$ node my-program.js --many foo -{ many: ["foo"] } -``` - -Read the tests at the bottom of `lib/nopt.js` for more examples of -what this puppy can do. - -## Types - -The following types are supported, and defined on `nopt.typeDefs` - -* String: A normal string. No parsing is done. -* path: A file system path. Gets resolved against cwd if not absolute. -* url: A url. If it doesn't parse, it isn't accepted. -* Number: Must be numeric. -* Date: Must parse as a date. If it does, and `Date` is one of the options, - then it will return a Date object, not a string. -* Boolean: Must be either `true` or `false`. If an option is a boolean, - then it does not need a value, and its presence will imply `true` as - the value. To negate boolean flags, do `--no-whatever` or `--whatever - false` -* NaN: Means that the option is strictly not allowed. Any value will - fail. -* Stream: An object matching the "Stream" class in node. Valuable - for use when validating programmatically. (npm uses this to let you - supply any WriteStream on the `outfd` and `logfd` config options.) -* Array: If `Array` is specified as one of the types, then the value - will be parsed as a list of options. This means that multiple values - can be specified, and that the value will always be an array. - -If a type is an array of values not on this list, then those are -considered valid values. For instance, in the example above, the -`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`, -and any other value will be rejected. - -When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be -interpreted as their JavaScript equivalents, and numeric values will be -interpreted as a number. - -You can also mix types and values, or multiple types, in a list. For -instance `{ blah: [Number, null] }` would allow a value to be set to -either a Number or null. - -To define a new type, add it to `nopt.typeDefs`. Each item in that -hash is an object with a `type` member and a `validate` method. The -`type` member is an object that matches what goes in the type list. The -`validate` method is a function that gets called with `validate(data, -key, val)`. Validate methods should assign `data[key]` to the valid -value of `val` if it can be handled properly, or return boolean -`false` if it cannot. - -You can also call `nopt.clean(data, types, typeDefs)` to clean up a -config object and remove its invalid properties. - -## Error Handling - -By default, nopt outputs a warning to standard error when invalid -options are found. You can change this behavior by assigning a method -to `nopt.invalidHandler`. This method will be called with -the offending `nopt.invalidHandler(key, val, types)`. - -If no `nopt.invalidHandler` is assigned, then it will console.error -its whining. If it is assigned to boolean `false` then the warning is -suppressed. - -## Abbreviations - -Yes, they are supported. If you define options like this: - -```javascript -{ "foolhardyelephants" : Boolean -, "pileofmonkeys" : Boolean } -``` - -Then this will work: - -```bash -node program.js --foolhar --pil -node program.js --no-f --pileofmon -# etc. -``` - -## Shorthands - -Shorthands are a hash of shorter option names to a snippet of args that -they expand to. - -If multiple one-character shorthands are all combined, and the -combination does not unambiguously match any other option or shorthand, -then they will be broken up into their constituent parts. For example: - -```json -{ "s" : ["--loglevel", "silent"] -, "g" : "--global" -, "f" : "--force" -, "p" : "--parseable" -, "l" : "--long" -} -``` - -```bash -npm ls -sgflp -# just like doing this: -npm ls --loglevel silent --global --force --long --parseable -``` - -## The Rest of the args - -The config object returned by nopt is given a special member called -`argv`, which is an object with the following fields: - -* `remain`: The remaining args after all the parsing has occurred. -* `original`: The args as they originally appeared. -* `cooked`: The args after flags and shorthands are expanded. - -## Slicing - -Node programs are called with more or less the exact argv as it appears -in C land, after the v8 and node-specific options have been plucked off. -As such, `argv[0]` is always `node` and `argv[1]` is always the -JavaScript program being run. - -That's usually not very useful to you. So they're sliced off by -default. If you want them, then you can pass in `0` as the last -argument, or any other number that you'd like to slice off the start of -the list. diff --git a/node_modules/nopt/bin/nopt.js b/node_modules/nopt/bin/nopt.js deleted file mode 100755 index df90c72..0000000 --- a/node_modules/nopt/bin/nopt.js +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env node -var nopt = require("../lib/nopt") - , types = { num: Number - , bool: Boolean - , help: Boolean - , list: Array - , "num-list": [Number, Array] - , "str-list": [String, Array] - , "bool-list": [Boolean, Array] - , str: String } - , shorthands = { s: [ "--str", "astring" ] - , b: [ "--bool" ] - , nb: [ "--no-bool" ] - , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] - , "?": ["--help"] - , h: ["--help"] - , H: ["--help"] - , n: [ "--num", "125" ] } - , parsed = nopt( types - , shorthands - , process.argv - , 2 ) - -console.log("parsed", parsed) - -if (parsed.help) { - console.log("") - console.log("nopt cli tester") - console.log("") - console.log("types") - console.log(Object.keys(types).map(function M (t) { - var type = types[t] - if (Array.isArray(type)) { - return [t, type.map(function (type) { return type.name })] - } - return [t, type && type.name] - }).reduce(function (s, i) { - s[i[0]] = i[1] - return s - }, {})) - console.log("") - console.log("shorthands") - console.log(shorthands) -} diff --git a/node_modules/nopt/examples/my-program.js b/node_modules/nopt/examples/my-program.js deleted file mode 100755 index 142447e..0000000 --- a/node_modules/nopt/examples/my-program.js +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env node - -//process.env.DEBUG_NOPT = 1 - -// my-program.js -var nopt = require("../lib/nopt") - , Stream = require("stream").Stream - , path = require("path") - , knownOpts = { "foo" : [String, null] - , "bar" : [Stream, Number] - , "baz" : path - , "bloo" : [ "big", "medium", "small" ] - , "flag" : Boolean - , "pick" : Boolean - } - , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] - , "b7" : ["--bar", "7"] - , "m" : ["--bloo", "medium"] - , "p" : ["--pick"] - , "f" : ["--flag", "true"] - , "g" : ["--flag"] - , "s" : "--flag" - } - // everything is optional. - // knownOpts and shorthands default to {} - // arg list defaults to process.argv - // slice defaults to 2 - , parsed = nopt(knownOpts, shortHands, process.argv, 2) - -console.log("parsed =\n"+ require("util").inspect(parsed)) diff --git a/node_modules/nopt/lib/nopt.js b/node_modules/nopt/lib/nopt.js deleted file mode 100644 index ff802da..0000000 --- a/node_modules/nopt/lib/nopt.js +++ /dev/null @@ -1,552 +0,0 @@ -// info about each config option. - -var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG - ? function () { console.error.apply(console, arguments) } - : function () {} - -var url = require("url") - , path = require("path") - , Stream = require("stream").Stream - , abbrev = require("abbrev") - -module.exports = exports = nopt -exports.clean = clean - -exports.typeDefs = - { String : { type: String, validate: validateString } - , Boolean : { type: Boolean, validate: validateBoolean } - , url : { type: url, validate: validateUrl } - , Number : { type: Number, validate: validateNumber } - , path : { type: path, validate: validatePath } - , Stream : { type: Stream, validate: validateStream } - , Date : { type: Date, validate: validateDate } - } - -function nopt (types, shorthands, args, slice) { - args = args || process.argv - types = types || {} - shorthands = shorthands || {} - if (typeof slice !== "number") slice = 2 - - debug(types, shorthands, args, slice) - - args = args.slice(slice) - var data = {} - , key - , remain = [] - , cooked = args - , original = args.slice(0) - - parse(args, data, remain, types, shorthands) - // now data is full - clean(data, types, exports.typeDefs) - data.argv = {remain:remain,cooked:cooked,original:original} - data.argv.toString = function () { - return this.original.map(JSON.stringify).join(" ") - } - return data -} - -function clean (data, types, typeDefs) { - typeDefs = typeDefs || exports.typeDefs - var remove = {} - , typeDefault = [false, true, null, String, Number] - - Object.keys(data).forEach(function (k) { - if (k === "argv") return - var val = data[k] - , isArray = Array.isArray(val) - , type = types[k] - if (!isArray) val = [val] - if (!type) type = typeDefault - if (type === Array) type = typeDefault.concat(Array) - if (!Array.isArray(type)) type = [type] - - debug("val=%j", val) - debug("types=", type) - val = val.map(function (val) { - // if it's an unknown value, then parse false/true/null/numbers/dates - if (typeof val === "string") { - debug("string %j", val) - val = val.trim() - if ((val === "null" && ~type.indexOf(null)) - || (val === "true" && - (~type.indexOf(true) || ~type.indexOf(Boolean))) - || (val === "false" && - (~type.indexOf(false) || ~type.indexOf(Boolean)))) { - val = JSON.parse(val) - debug("jsonable %j", val) - } else if (~type.indexOf(Number) && !isNaN(val)) { - debug("convert to number", val) - val = +val - } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { - debug("convert to date", val) - val = new Date(val) - } - } - - if (!types.hasOwnProperty(k)) { - return val - } - - // allow `--no-blah` to set 'blah' to null if null is allowed - if (val === false && ~type.indexOf(null) && - !(~type.indexOf(false) || ~type.indexOf(Boolean))) { - val = null - } - - var d = {} - d[k] = val - debug("prevalidated val", d, val, types[k]) - if (!validate(d, k, val, types[k], typeDefs)) { - if (exports.invalidHandler) { - exports.invalidHandler(k, val, types[k], data) - } else if (exports.invalidHandler !== false) { - debug("invalid: "+k+"="+val, types[k]) - } - return remove - } - debug("validated val", d, val, types[k]) - return d[k] - }).filter(function (val) { return val !== remove }) - - if (!val.length) delete data[k] - else if (isArray) { - debug(isArray, data[k], val) - data[k] = val - } else data[k] = val[0] - - debug("k=%s val=%j", k, val, data[k]) - }) -} - -function validateString (data, k, val) { - data[k] = String(val) -} - -function validatePath (data, k, val) { - data[k] = path.resolve(String(val)) - return true -} - -function validateNumber (data, k, val) { - debug("validate Number %j %j %j", k, val, isNaN(val)) - if (isNaN(val)) return false - data[k] = +val -} - -function validateDate (data, k, val) { - debug("validate Date %j %j %j", k, val, Date.parse(val)) - var s = Date.parse(val) - if (isNaN(s)) return false - data[k] = new Date(val) -} - -function validateBoolean (data, k, val) { - if (val instanceof Boolean) val = val.valueOf() - else if (typeof val === "string") { - if (!isNaN(val)) val = !!(+val) - else if (val === "null" || val === "false") val = false - else val = true - } else val = !!val - data[k] = val -} - -function validateUrl (data, k, val) { - val = url.parse(String(val)) - if (!val.host) return false - data[k] = val.href -} - -function validateStream (data, k, val) { - if (!(val instanceof Stream)) return false - data[k] = val -} - -function validate (data, k, val, type, typeDefs) { - // arrays are lists of types. - if (Array.isArray(type)) { - for (var i = 0, l = type.length; i < l; i ++) { - if (type[i] === Array) continue - if (validate(data, k, val, type[i], typeDefs)) return true - } - delete data[k] - return false - } - - // an array of anything? - if (type === Array) return true - - // NaN is poisonous. Means that something is not allowed. - if (type !== type) { - debug("Poison NaN", k, val, type) - delete data[k] - return false - } - - // explicit list of values - if (val === type) { - debug("Explicitly allowed %j", val) - // if (isArray) (data[k] = data[k] || []).push(val) - // else data[k] = val - data[k] = val - return true - } - - // now go through the list of typeDefs, validate against each one. - var ok = false - , types = Object.keys(typeDefs) - for (var i = 0, l = types.length; i < l; i ++) { - debug("test type %j %j %j", k, val, types[i]) - var t = typeDefs[types[i]] - if (t && type === t.type) { - var d = {} - ok = false !== t.validate(d, k, val) - val = d[k] - if (ok) { - // if (isArray) (data[k] = data[k] || []).push(val) - // else data[k] = val - data[k] = val - break - } - } - } - debug("OK? %j (%j %j %j)", ok, k, val, types[i]) - - if (!ok) delete data[k] - return ok -} - -function parse (args, data, remain, types, shorthands) { - debug("parse", args, data, remain) - - var key = null - , abbrevs = abbrev(Object.keys(types)) - , shortAbbr = abbrev(Object.keys(shorthands)) - - for (var i = 0; i < args.length; i ++) { - var arg = args[i] - debug("arg", arg) - - if (arg.match(/^-{2,}$/)) { - // done with keys. - // the rest are args. - remain.push.apply(remain, args.slice(i + 1)) - args[i] = "--" - break - } - if (arg.charAt(0) === "-") { - if (arg.indexOf("=") !== -1) { - var v = arg.split("=") - arg = v.shift() - v = v.join("=") - args.splice.apply(args, [i, 1].concat([arg, v])) - } - // see if it's a shorthand - // if so, splice and back up to re-parse it. - var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) - debug("arg=%j shRes=%j", arg, shRes) - if (shRes) { - debug(arg, shRes) - args.splice.apply(args, [i, 1].concat(shRes)) - if (arg !== shRes[0]) { - i -- - continue - } - } - arg = arg.replace(/^-+/, "") - var no = false - while (arg.toLowerCase().indexOf("no-") === 0) { - no = !no - arg = arg.substr(3) - } - - if (abbrevs[arg]) arg = abbrevs[arg] - - var isArray = types[arg] === Array || - Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1 - - var val - , la = args[i + 1] - - var isBool = no || - types[arg] === Boolean || - Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 || - (la === "false" && - (types[arg] === null || - Array.isArray(types[arg]) && ~types[arg].indexOf(null))) - - if (isBool) { - // just set and move along - val = !no - // however, also support --bool true or --bool false - if (la === "true" || la === "false") { - val = JSON.parse(la) - la = null - if (no) val = !val - i ++ - } - - // also support "foo":[Boolean, "bar"] and "--foo bar" - if (Array.isArray(types[arg]) && la) { - if (~types[arg].indexOf(la)) { - // an explicit type - val = la - i ++ - } else if ( la === "null" && ~types[arg].indexOf(null) ) { - // null allowed - val = null - i ++ - } else if ( !la.match(/^-{2,}[^-]/) && - !isNaN(la) && - ~types[arg].indexOf(Number) ) { - // number - val = +la - i ++ - } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) { - // string - val = la - i ++ - } - } - - if (isArray) (data[arg] = data[arg] || []).push(val) - else data[arg] = val - - continue - } - - if (la && la.match(/^-{2,}$/)) { - la = undefined - i -- - } - - val = la === undefined ? true : la - if (isArray) (data[arg] = data[arg] || []).push(val) - else data[arg] = val - - i ++ - continue - } - remain.push(arg) - } -} - -function resolveShort (arg, shorthands, shortAbbr, abbrevs) { - // handle single-char shorthands glommed together, like - // npm ls -glp, but only if there is one dash, and only if - // all of the chars are single-char shorthands, and it's - // not a match to some other abbrev. - arg = arg.replace(/^-+/, '') - if (abbrevs[arg] && !shorthands[arg]) { - return null - } - if (shortAbbr[arg]) { - arg = shortAbbr[arg] - } else { - var singles = shorthands.___singles - if (!singles) { - singles = Object.keys(shorthands).filter(function (s) { - return s.length === 1 - }).reduce(function (l,r) { l[r] = true ; return l }, {}) - shorthands.___singles = singles - } - var chrs = arg.split("").filter(function (c) { - return singles[c] - }) - if (chrs.join("") === arg) return chrs.map(function (c) { - return shorthands[c] - }).reduce(function (l, r) { - return l.concat(r) - }, []) - } - - if (shorthands[arg] && !Array.isArray(shorthands[arg])) { - shorthands[arg] = shorthands[arg].split(/\s+/) - } - return shorthands[arg] -} - -if (module === require.main) { -var assert = require("assert") - , util = require("util") - - , shorthands = - { s : ["--loglevel", "silent"] - , d : ["--loglevel", "info"] - , dd : ["--loglevel", "verbose"] - , ddd : ["--loglevel", "silly"] - , noreg : ["--no-registry"] - , reg : ["--registry"] - , "no-reg" : ["--no-registry"] - , silent : ["--loglevel", "silent"] - , verbose : ["--loglevel", "verbose"] - , h : ["--usage"] - , H : ["--usage"] - , "?" : ["--usage"] - , help : ["--usage"] - , v : ["--version"] - , f : ["--force"] - , desc : ["--description"] - , "no-desc" : ["--no-description"] - , "local" : ["--no-global"] - , l : ["--long"] - , p : ["--parseable"] - , porcelain : ["--parseable"] - , g : ["--global"] - } - - , types = - { aoa: Array - , nullstream: [null, Stream] - , date: Date - , str: String - , browser : String - , cache : path - , color : ["always", Boolean] - , depth : Number - , description : Boolean - , dev : Boolean - , editor : path - , force : Boolean - , global : Boolean - , globalconfig : path - , group : [String, Number] - , gzipbin : String - , logfd : [Number, Stream] - , loglevel : ["silent","win","error","warn","info","verbose","silly"] - , long : Boolean - , "node-version" : [false, String] - , npaturl : url - , npat : Boolean - , "onload-script" : [false, String] - , outfd : [Number, Stream] - , parseable : Boolean - , pre: Boolean - , prefix: path - , proxy : url - , "rebuild-bundle" : Boolean - , registry : url - , searchopts : String - , searchexclude: [null, String] - , shell : path - , t: [Array, String] - , tag : String - , tar : String - , tmp : path - , "unsafe-perm" : Boolean - , usage : Boolean - , user : String - , username : String - , userconfig : path - , version : Boolean - , viewer: path - , _exit : Boolean - } - -; [["-v", {version:true}, []] - ,["---v", {version:true}, []] - ,["ls -s --no-reg connect -d", - {loglevel:"info",registry:null},["ls","connect"]] - ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]] - ,["ls --registry blargle", {}, ["ls"]] - ,["--no-registry", {registry:null}, []] - ,["--no-color true", {color:false}, []] - ,["--no-color false", {color:true}, []] - ,["--no-color", {color:false}, []] - ,["--color false", {color:false}, []] - ,["--color --logfd 7", {logfd:7,color:true}, []] - ,["--color=true", {color:true}, []] - ,["--logfd=10", {logfd:10}, []] - ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]] - ,["--tmp=tmp -tar=gtar", - {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]] - ,["--logfd x", {}, []] - ,["a -true -- -no-false", {true:true},["a","-no-false"]] - ,["a -no-false", {false:false},["a"]] - ,["a -no-no-true", {true:true}, ["a"]] - ,["a -no-no-no-false", {false:false}, ["a"]] - ,["---NO-no-No-no-no-no-nO-no-no"+ - "-No-no-no-no-no-no-no-no-no"+ - "-no-no-no-no-NO-NO-no-no-no-no-no-no"+ - "-no-body-can-do-the-boogaloo-like-I-do" - ,{"body-can-do-the-boogaloo-like-I-do":false}, []] - ,["we are -no-strangers-to-love "+ - "--you-know the-rules --and so-do-i "+ - "---im-thinking-of=a-full-commitment "+ - "--no-you-would-get-this-from-any-other-guy "+ - "--no-gonna-give-you-up "+ - "-no-gonna-let-you-down=true "+ - "--no-no-gonna-run-around false "+ - "--desert-you=false "+ - "--make-you-cry false "+ - "--no-tell-a-lie "+ - "--no-no-and-hurt-you false" - ,{"strangers-to-love":false - ,"you-know":"the-rules" - ,"and":"so-do-i" - ,"you-would-get-this-from-any-other-guy":false - ,"gonna-give-you-up":false - ,"gonna-let-you-down":false - ,"gonna-run-around":false - ,"desert-you":false - ,"make-you-cry":false - ,"tell-a-lie":false - ,"and-hurt-you":false - },["we", "are"]] - ,["-t one -t two -t three" - ,{t: ["one", "two", "three"]} - ,[]] - ,["-t one -t null -t three four five null" - ,{t: ["one", "null", "three"]} - ,["four", "five", "null"]] - ,["-t foo" - ,{t:["foo"]} - ,[]] - ,["--no-t" - ,{t:["false"]} - ,[]] - ,["-no-no-t" - ,{t:["true"]} - ,[]] - ,["-aoa one -aoa null -aoa 100" - ,{aoa:["one", null, 100]} - ,[]] - ,["-str 100" - ,{str:"100"} - ,[]] - ,["--color always" - ,{color:"always"} - ,[]] - ,["--no-nullstream" - ,{nullstream:null} - ,[]] - ,["--nullstream false" - ,{nullstream:null} - ,[]] - ,["--notadate 2011-01-25" - ,{notadate: "2011-01-25"} - ,[]] - ,["--date 2011-01-25" - ,{date: new Date("2011-01-25")} - ,[]] - ].forEach(function (test) { - var argv = test[0].split(/\s+/) - , opts = test[1] - , rem = test[2] - , actual = nopt(types, shorthands, argv, 0) - , parsed = actual.argv - delete actual.argv - console.log(util.inspect(actual, false, 2, true), parsed.remain) - for (var i in opts) { - var e = JSON.stringify(opts[i]) - , a = JSON.stringify(actual[i] === undefined ? null : actual[i]) - if (e && typeof e === "object") { - assert.deepEqual(e, a) - } else { - assert.equal(e, a) - } - } - assert.deepEqual(rem, parsed.remain) - }) -} diff --git a/node_modules/nopt/node_modules/abbrev/README.md b/node_modules/nopt/node_modules/abbrev/README.md deleted file mode 100644 index 99746fe..0000000 --- a/node_modules/nopt/node_modules/abbrev/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# abbrev-js - -Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). - -Usage: - - var abbrev = require("abbrev"); - abbrev("foo", "fool", "folding", "flop"); - - // returns: - { fl: 'flop' - , flo: 'flop' - , flop: 'flop' - , fol: 'folding' - , fold: 'folding' - , foldi: 'folding' - , foldin: 'folding' - , folding: 'folding' - , foo: 'foo' - , fool: 'fool' - } - -This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/node_modules/nopt/node_modules/abbrev/lib/abbrev.js b/node_modules/nopt/node_modules/abbrev/lib/abbrev.js deleted file mode 100644 index 037de2d..0000000 --- a/node_modules/nopt/node_modules/abbrev/lib/abbrev.js +++ /dev/null @@ -1,106 +0,0 @@ - -module.exports = exports = abbrev.abbrev = abbrev - -abbrev.monkeyPatch = monkeyPatch - -function monkeyPatch () { - Array.prototype.abbrev = function () { return abbrev(this) } - Object.prototype.abbrev = function () { return abbrev(Object.keys(this)) } -} - -function abbrev (list) { - if (arguments.length !== 1 || !Array.isArray(list)) { - list = Array.prototype.slice.call(arguments, 0) - } - for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { - args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) - } - - // sort them lexicographically, so that they're next to their nearest kin - args = args.sort(lexSort) - - // walk through each, seeing how much it has in common with the next and previous - var abbrevs = {} - , prev = "" - for (var i = 0, l = args.length ; i < l ; i ++) { - var current = args[i] - , next = args[i + 1] || "" - , nextMatches = true - , prevMatches = true - if (current === next) continue - for (var j = 0, cl = current.length ; j < cl ; j ++) { - var curChar = current.charAt(j) - nextMatches = nextMatches && curChar === next.charAt(j) - prevMatches = prevMatches && curChar === prev.charAt(j) - if (nextMatches || prevMatches) continue - else { - j ++ - break - } - } - prev = current - if (j === cl) { - abbrevs[current] = current - continue - } - for (var a = current.substr(0, j) ; j <= cl ; j ++) { - abbrevs[a] = current - a += current.charAt(j) - } - } - return abbrevs -} - -function lexSort (a, b) { - return a === b ? 0 : a > b ? 1 : -1 -} - - -// tests -if (module === require.main) { - -var assert = require("assert") - , sys -sys = require("util") - -console.log("running tests") -function test (list, expect) { - var actual = abbrev(list) - assert.deepEqual(actual, expect, - "abbrev("+sys.inspect(list)+") === " + sys.inspect(expect) + "\n"+ - "actual: "+sys.inspect(actual)) - actual = abbrev.apply(exports, list) - assert.deepEqual(abbrev.apply(exports, list), expect, - "abbrev("+list.map(JSON.stringify).join(",")+") === " + sys.inspect(expect) + "\n"+ - "actual: "+sys.inspect(actual)) -} - -test([ "ruby", "ruby", "rules", "rules", "rules" ], -{ rub: 'ruby' -, ruby: 'ruby' -, rul: 'rules' -, rule: 'rules' -, rules: 'rules' -}) -test(["fool", "foom", "pool", "pope"], -{ fool: 'fool' -, foom: 'foom' -, poo: 'pool' -, pool: 'pool' -, pop: 'pope' -, pope: 'pope' -}) -test(["a", "ab", "abc", "abcd", "abcde", "acde"], -{ a: 'a' -, ab: 'ab' -, abc: 'abc' -, abcd: 'abcd' -, abcde: 'abcde' -, ac: 'acde' -, acd: 'acde' -, acde: 'acde' -}) - -console.log("pass") - -} diff --git a/node_modules/nopt/node_modules/abbrev/package.json b/node_modules/nopt/node_modules/abbrev/package.json deleted file mode 100644 index 817cd3b..0000000 --- a/node_modules/nopt/node_modules/abbrev/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "abbrev", - "version": "1.0.3", - "description": "Like ruby's abbrev module, but in js", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "main": "./lib/abbrev.js", - "scripts": { - "test": "node lib/abbrev.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/abbrev-js.git" - }, - "_id": "abbrev@1.0.3", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "4ef097ec909b6f6b315b6898b47b3162fc60c325" - }, - "_from": "abbrev@1" -} diff --git a/node_modules/nopt/package.json b/node_modules/nopt/package.json deleted file mode 100644 index 6a87f8e..0000000 --- a/node_modules/nopt/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "nopt", - "version": "1.0.10", - "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "main": "lib/nopt.js", - "scripts": { - "test": "node lib/nopt.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/nopt.git" - }, - "bin": { - "nopt": "./bin/nopt.js" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/nopt/raw/master/LICENSE" - }, - "dependencies": { - "abbrev": "1" - }, - "_id": "nopt@1.0.10", - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "82a43cbb79f29795a93f031ffa093819515ed248" - }, - "_from": "nopt" -} diff --git a/node_modules/should/.gitmodules b/node_modules/should/.gitmodules deleted file mode 100644 index ffe0dcb..0000000 --- a/node_modules/should/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "support/expresso"] - path = support/expresso - url = git://github.com/visionmedia/expresso.git diff --git a/node_modules/should/.npmignore b/node_modules/should/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/should/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/should/History.md b/node_modules/should/History.md deleted file mode 100644 index e189657..0000000 --- a/node_modules/should/History.md +++ /dev/null @@ -1,106 +0,0 @@ - -0.6.1 / 2012-04-10 -================== - - * package: add "repository" section [TooTallNate] - * use valueOf() to get the reference the object [TooTallNate] - -0.6.0 / 2012-03-01 -================== - - * Added `err.actual` and `err.expected` for .{eql,equal}() - * Added 'return this;' to 'get json' and 'get html' in order to provide chaining for should.be.json and should.be.html - -0.5.1 / 2012-01-13 -================== - - * Added better `.json` - * Added better `.html` - -0.5.0 / 2012-01-12 -================== - - * Added string matching to `.throw()` [serby] - * Added regexp matching to `.throw()` [serby] - * Added `.includeEql()` [RubenVerborgh] - * Added `.should.be.html` - * Added `.should.be.json` - * Added optional description args to most matchers [Mike Swift] - -0.4.2 / 2011-12-17 -================== - - * Fixed .header() for realzzz - -0.4.1 / 2011-12-16 -================== - - * Fixed: chain .header() to retain negation - -0.4.0 / 2011-12-16 -================== - - * Added `.should.throw()` - * Added `.include()` support for strings - * Added `.include()` support for arrays - * Removed `keys()` `.include` modifier support - * Removed `.object()` - * Removed `.string()` - * Removed `.contain()` - * Removed `.respondTo()` rubyism - * expresso -> mocha - -0.3.2 / 2011-10-24 -================== - - * Fixed tests for 0.5.x - * Fixed sys warning - -0.3.1 / 2011-08-22 -================== - - * configurable - -0.3.0 / 2011-08-20 -================== - - * Added assertion for inclusion of an object: `foo.should.include.object({ foo: 'bar' })` - -0.2.1 / 2011-05-13 -================== - - * Fixed .status(code). Closes #18 - -0.2.0 / 2011-04-17 -================== - - * Added `res.should.have.status(code)` method - * Added `res.should.have.header(field, val)` method - -0.1.0 / 2011-04-06 -================== - - * Added `should.exist(obj)` [aseemk] - * Added `should.not.exist(obj)` [aseemk] - -0.0.4 / 2010-11-24 -================== - - * Added `.ok` to assert truthfulness - * Added `.arguments` - * Fixed double required bug. [thanks dominictarr] - -0.0.3 / 2010-11-19 -================== - - * Added `true` / `false` assertions - -0.0.2 / 2010-11-19 -================== - - * Added chaining support - -0.0.1 / 2010-11-19 -================== - - * Initial release diff --git a/node_modules/should/Makefile b/node_modules/should/Makefile deleted file mode 100644 index 19e8868..0000000 --- a/node_modules/should/Makefile +++ /dev/null @@ -1,6 +0,0 @@ - -test: - @./node_modules/.bin/mocha \ - --ui exports - -.PHONY: test \ No newline at end of file diff --git a/node_modules/should/Readme.md b/node_modules/should/Readme.md deleted file mode 100644 index 62b0bd0..0000000 --- a/node_modules/should/Readme.md +++ /dev/null @@ -1,367 +0,0 @@ -_should_ is an expressive, readable, test framework agnostic, assertion library for [node](http://nodejs.org). - -It extends the Object prototype with a single non-enumerable getter that allows you to express how that object should behave. - -_should_ literally extends node's _assert_ module, in fact, it is node's assert module, for example `should.equal(str, 'foo')` will work, just as `assert.equal(str, 'foo')` would, and `should.AssertionError` **is** `assert.AssertionError`, meaning any test framework supporting this constructor will function properly with _should_. - -## Example - - var user = { - name: 'tj' - , pets: ['tobi', 'loki', 'jane', 'bandit'] - }; - - user.should.have.property('name', 'tj'); - user.should.have.property('pets').with.lengthOf(4); - - someAsyncTask(foo, function(err, result){ - should.not.exist(err); - should.exist(result); - result.bar.should.equal(foo); - }); - -## Installation - - $ npm install should - -## assert extras - -As mentioned above, _should_ extends node's _assert_. The returned object from `require('should')` is thus similar to the returned object from `require('assert')`, but it has one extra convenience method: - - should.exist('hello') - should.exist([]) - should.exist(null) // will throw - -This is equivalent to `should.ok`, which is equivalent to `assert.ok`, but reads a bit better. It gets better, though: - - should.not.exist(false) - should.not.exist('') - should.not.exist({}) // will throw - -We may add more _assert_ extras in the future... ;) - -## chaining assertions - -Some assertions can be chained, for example if a property is volatile we can first assert property existence: - - user.should.have.property('pets').with.lengthOf(4) - -which is essentially equivalent to below, however the property may not exist: - - user.pets.should.have.lengthOf(4) - -our dummy getters such as _and_ also help express chaining: - - user.should.be.a('object').and.have.property('name', 'tj') - -## exist (static) - -The returned object from `require('should')` is the same object as `require('assert')`. So you can use `should` just like `assert`: - - should.fail('expected an error!') - should.strictEqual(foo, bar) - -In general, using the Object prototype's _should_ is nicer than using these `assert` equivalents, because _should_ gives you access to the expressive and readable language described above: - - foo.should.equal(bar) // same as should.strictEqual(foo, bar) above - -The only exception, though, is when you can't be sure that a particular object exists. In that case, attempting to access the _should_ property may throw a TypeError: - - foo.should.equal(bar) // throws if foo is null or undefined! - -For this case, `require('should')` extends `require('assert')` with an extra convenience method to check whether an object exists: - - should.exist({}) - should.exist([]) - should.exist('') - should.exist(0) - should.exist(null) // will throw - should.exist(undefined) // will throw - -You can also check the negation: - - should.not.exist(undefined) - should.not.exist(null) - should.not.exist('') // will throw - should.not.exist({}) // will throw - -Once you know an object exists, you can safely use the _should_ property on it. - -## ok - -Assert truthfulness: - - true.should.be.ok - 'yay'.should.be.ok - (1).should.be.ok - -or negated: - - false.should.not.be.ok - ''.should.not.be.ok - (0).should.not.be.ok - -## true - -Assert === true: - - true.should.be.true - '1'.should.not.be.true - -## false - -Assert === false: - - false.should.be.false - (0).should.not.be.false - -## arguments - -Assert `Arguments`: - - var args = (function(){ return arguments; })(1,2,3); - args.should.be.arguments; - [].should.not.be.arguments; - -## empty - -Asserts that length is 0: - - [].should.be.empty - ''.should.be.empty - ({ length: 0 }).should.be.empty - -## eql - -equality: - - ({ foo: 'bar' }).should.eql({ foo: 'bar' }) - [1,2,3].should.eql([1,2,3]) - -## equal - -strict equality: - - should.strictEqual(undefined, value) - should.strictEqual(false, value) - (4).should.equal(4) - 'test'.should.equal('test') - [1,2,3].should.not.equal([1,2,3]) - -## within - -Assert inclusive numeric range: - - user.age.should.be.within(5, 50) - -## a - -Assert __typeof__: - - user.should.be.a('object') - 'test'.should.be.a('string') - -## instanceof - -Assert __instanceof__: - - user.should.be.an.instanceof(User) - [].should.be.an.instanceof(Array) - -## above - -Assert numeric value above the given value: - - user.age.should.be.above(5) - user.age.should.not.be.above(100) - -## below - -Assert numeric value below the given value: - - user.age.should.be.below(100) - user.age.should.not.be.below(5) - -## match - -Assert regexp match: - - username.should.match(/^\w+$/) - -## length - -Assert _length_ property exists and has a value of the given number: - - user.pets.should.have.length(5) - user.pets.should.have.a.lengthOf(5) - -Aliases: _lengthOf_ - -## property - -Assert property exists and has optional value: - - user.should.have.property('name') - user.should.have.property('age', 15) - user.should.not.have.property('rawr') - user.should.not.have.property('age', 0) - -## ownProperty - -Assert own property (on the immediate object): - - ({ foo: 'bar' }).should.have.ownProperty('foo') - -## status(code) - - Asserts that `.statusCode` is `code`: - - res.should.have.status(200); - -## header(field[, value]) - - Asserts that a `.headers` object with `field` and optional `value` are present: - - res.should.have.header('content-length'); - res.should.have.header('Content-Length', '123'); - res.should.have.header('content-length', '123'); - -## json - - Assert that Content-Type is "application/json; charset=utf-8" - - res.should.be.json - -## html - - Assert that Content-Type is "text/html; charset=utf-8" - - res.should.be.html - -## include(obj) - -Assert that the given `obj` is present via `indexOf()`, so this works for strings, arrays, or custom objects implementing indexOf: - -Assert array value: - - [1,2,3].should.include(3) - [1,2,3].should.include(2) - [1,2,3].should.not.include(4) - -Assert substring: - - 'foo bar baz'.should.include('foo') - 'foo bar baz'.should.include('bar') - 'foo bar baz'.should.include('baz') - 'foo bar baz'.should.not.include('FOO') - -## includeEql(obj) - -Assert that an object equal to the given `obj` is present in an Array: - - [[1],[2],[3]].should.includeEql([3]) - [[1],[2],[3]].should.includeEql([2]) - [[1],[2],[3]].should.not.includeEql([4]) - -## throw() - -Assert an exception is thrown: - -```js -(function(){ - throw new Error('fail'); -}).should.throw(); -``` - -Assert an exception is not thrown: - -```js -(function(){ - -}).should.not.throw(); -``` -Assert exepection message matches string: - -```js -(function(){ - throw new Error('fail'); -}).should.throw('fail'); -``` - -Assert exepection message matches regexp: - -```js -(function(){ - throw new Error('failed to foo'); -}).should.throw(/^fail/); -``` - -## keys - -Assert own object keys, which must match _exactly_, -and will fail if you omit a key or two: - - var obj = { foo: 'bar', baz: 'raz' }; - obj.should.have.keys('foo', 'bar'); - obj.should.have.keys(['foo', 'bar']); - -## Optional Error description - -As it can often be difficult to ascertain exactly where failed assertions are coming from in your tests, an optional description parameter can be passed to several should matchers. The description will follow the failed assertion in the error: - - (1).should.eql(0, 'some useful description') - - AssertionError: expected 1 to equal 0 | some useful description - at Object.eql (/Users/swift/code/should.js/node_modules/should/lib/should.js:280:10) - ... - -The methods that support this optional description are: `eql`, `equal`, `within`, `a`, `instanceof`, `above`, `below`, `match`, `length`, `property`, `ownProperty`, `include`, and `includeEql`. - -## Express example - -For example you can use should with the [Expresso TDD Framework](http://github.com/visionmedia/expresso) by simply including it: - - var lib = require('mylib') - , should = require('should'); - - module.exports = { - 'test .version': function(){ - lib.version.should.match(/^\d+\.\d+\.\d+$/); - } - }; - -## Running tests - -To run the tests for _should_ simply update your git submodules and run: - - $ make test - -## OMG IT EXTENDS OBJECT???!?!@ - -Yes, yes it does, with a single getter _should_, and no it won't break your code, because it does this **properly** with a non-enumerable property. - -## License - -(The MIT License) - -Copyright (c) 2010-2011 TJ Holowaychuk <tj@vision-media.ca> -Copyright (c) 2011 Aseem Kishore <aseem.kishore@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/should/examples/runner.js b/node_modules/should/examples/runner.js deleted file mode 100644 index 9355955..0000000 --- a/node_modules/should/examples/runner.js +++ /dev/null @@ -1,53 +0,0 @@ - -/** - * Module dependencies. - */ - -var should = require('../'); - -function test(name, fn){ - try { - fn(); - } catch (err) { - console.log(' \x1b[31m%s', name); - console.log(' %s\x1b[0m', err.stack); - return; - } - console.log(' √ \x1b[32m%s\x1b[0m', name); -} - -function Point(x, y) { - this.x = x; - this.y = y; - this.sub = function(other){ - return new Point( - this.x - other.x - , this.y - other.y); - } -} - -console.log(); - -test('new Point(x, y)', function(){ - var point = new Point(50, 100); - point.should.be.an.instanceof(Point); - point.should.have.property('x', 50); - point.should.have.property('y', 100); -}); - -test('Point#sub()', function(){ - var a = new Point(50, 100) - , b = new Point(20, 50); - a.sub(b).should.be.an.instanceof(Point); - a.sub(b).should.not.equal(a); - a.sub(b).should.not.equal(b); - a.sub(b).should.have.property('x', 30); - a.sub(b).should.have.property('y', 50); -}); - -test('Point#add()', function(){ - var point = new Point(50, 100); - point.should.respondTo('add'); -}); - -console.log(); \ No newline at end of file diff --git a/node_modules/should/index.js b/node_modules/should/index.js deleted file mode 100644 index 6dbdbde..0000000 --- a/node_modules/should/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/should'); \ No newline at end of file diff --git a/node_modules/should/lib/eql.js b/node_modules/should/lib/eql.js deleted file mode 100644 index ef21923..0000000 --- a/node_modules/should/lib/eql.js +++ /dev/null @@ -1,91 +0,0 @@ - -// Taken from node's assert module, because it sucks -// and exposes next to nothing useful. - -module.exports = _deepEqual; - -function _deepEqual(actual, expected) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { - if (actual.length != expected.length) return false; - - for (var i = 0; i < actual.length; i++) { - if (actual[i] !== expected[i]) return false; - } - - return true; - - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == "object", - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual === expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical "prototype" property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } -} - -function isUndefinedOrNull (value) { - return value === null || value === undefined; -} - -function isArguments (object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function objEquiv (a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical "prototype" property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b); - } - try{ - var ka = Object.keys(a), - kb = Object.keys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key] )) - return false; - } - return true; -} diff --git a/node_modules/should/lib/should.js b/node_modules/should/lib/should.js deleted file mode 100644 index 26305c4..0000000 --- a/node_modules/should/lib/should.js +++ /dev/null @@ -1,701 +0,0 @@ -/*! - * Should - * Copyright(c) 2010 TJ Holowaychuk - * MIT Licensed - */ - -/** - * Module dependencies. - */ - -var util = require('util') - , http = require('http') - , assert = require('assert') - , AssertionError = assert.AssertionError - , statusCodes = http.STATUS_CODES - , eql = require('./eql') - , i = util.inspect; - -/** - * Expose assert as should. - * - * This allows you to do things like below - * without require()ing the assert module. - * - * should.equal(foo.bar, undefined); - * - */ - -exports = module.exports = assert; - -/** - * Library version. - */ - -exports.version = '0.6.1'; - -/** - * Assert _obj_ exists, with optional message. - * - * @param {Mixed} obj - * @param {String} msg - * @api public - */ - -exports.exist = function(obj, msg){ - if (null == obj) { - throw new AssertionError({ - message: msg || ('expected ' + i(obj) + ' to exist') - , stackStartFunction: should.exist - }); - } -}; - -/** - * Asserts _obj_ does not exist, with optional message. - * - * @param {Mixed} obj - * @param {String} msg - * @api public - */ - -exports.not = {}; -exports.not.exist = function(obj, msg){ - if (null != obj) { - throw new AssertionError({ - message: msg || ('expected ' + i(obj) + ' to not exist') - , stackStartFunction: should.not.exist - }); - } -}; - -/** - * Expose api via `Object#should`. - * - * @api public - */ - -Object.defineProperty(Object.prototype, 'should', { - set: function(){}, - get: function(){ - return new Assertion(Object(this).valueOf()); - }, - configurable: true -}); - -/** - * Initialize a new `Assertion` with the given _obj_. - * - * @param {Mixed} obj - * @api private - */ - -var Assertion = exports.Assertion = function Assertion(obj) { - this.obj = obj; -}; - -/** - * Prototype. - */ - -Assertion.prototype = { - - /** - * HACK: prevents double require() from failing. - */ - - exports: exports, - - /** - * Assert _expr_ with the given _msg_ and _negatedMsg_. - * - * @param {Boolean} expr - * @param {String} msg - * @param {String} negatedMsg - * @param {Object} expected - * @api private - */ - - assert: function(expr, msg, negatedMsg, expected){ - var msg = this.negate ? negatedMsg : msg - , ok = this.negate ? !expr : expr; - - if (!ok) { - throw new AssertionError({ - message: msg - , actual: this.obj - , expected: expected - , stackStartFunction: this.assert - }); - } - }, - - /** - * Dummy getter. - * - * @api public - */ - - get an() { - return this; - }, - - /** - * Dummy getter. - * - * @api public - */ - - get and() { - return this; - }, - - /** - * Dummy getter. - * - * @api public - */ - - get be() { - return this; - }, - - /** - * Dummy getter. - * - * @api public - */ - - get have() { - return this; - }, - - /** - * Dummy getter. - * - * @api public - */ - - get with() { - return this; - }, - - /** - * Negation modifier. - * - * @api public - */ - - get not() { - this.negate = true; - return this; - }, - - /** - * Get object inspection string. - * - * @return {String} - * @api private - */ - - get inspect() { - return i(this.obj); - }, - - /** - * Assert instanceof `Arguments`. - * - * @api public - */ - - get arguments() { - this.assert( - '[object Arguments]' == Object.prototype.toString.call(this.obj) - , 'expected ' + this.inspect + ' to be arguments' - , 'expected ' + this.inspect + ' to not be arguments'); - return this; - }, - - /** - * Assert that an object is empty aka length of 0. - * - * @api public - */ - - get empty() { - this.obj.should.have.property('length'); - this.assert( - 0 === this.obj.length - , 'expected ' + this.inspect + ' to be empty' - , 'expected ' + this.inspect + ' not to be empty'); - return this; - }, - - /** - * Assert ok. - * - * @api public - */ - - get ok() { - this.assert( - this.obj - , 'expected ' + this.inspect + ' to be truthy' - , 'expected ' + this.inspect + ' to be falsey'); - return this; - }, - - /** - * Assert true. - * - * @api public - */ - - get true() { - this.assert( - true === this.obj - , 'expected ' + this.inspect + ' to be true' - , 'expected ' + this.inspect + ' not to be true'); - return this; - }, - - /** - * Assert false. - * - * @api public - */ - - get false() { - this.assert( - false === this.obj - , 'expected ' + this.inspect + ' to be false' - , 'expected ' + this.inspect + ' not to be false'); - return this; - }, - - /** - * Assert equal. - * - * @param {Mixed} val - * @param {String} description - * @api public - */ - - eql: function(val, desc){ - this.assert( - eql(val, this.obj) - , 'expected ' + this.inspect + ' to equal ' + i(val) + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' to not equal ' + i(val) + (desc ? " | " + desc : "") - , val); - return this; - }, - - /** - * Assert strict equal. - * - * @param {Mixed} val - * @param {String} description - * @api public - */ - - equal: function(val, desc){ - this.assert( - val === this.obj - , 'expected ' + this.inspect + ' to equal ' + i(val) + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' to not equal ' + i(val) + (desc ? " | " + desc : "") - , val); - return this; - }, - - /** - * Assert within start to finish (inclusive). - * - * @param {Number} start - * @param {Number} finish - * @param {String} description - * @api public - */ - - within: function(start, finish, desc){ - var range = start + '..' + finish; - this.assert( - this.obj >= start && this.obj <= finish - , 'expected ' + this.inspect + ' to be within ' + range + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' to not be within ' + range + (desc ? " | " + desc : "")); - return this; - }, - - /** - * Assert typeof. - * - * @param {Mixed} type - * @param {String} description - * @api public - */ - - a: function(type, desc){ - this.assert( - type == typeof this.obj - , 'expected ' + this.inspect + ' to be a ' + type + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' not to be a ' + type + (desc ? " | " + desc : "")); - return this; - }, - - /** - * Assert instanceof. - * - * @param {Function} constructor - * @param {String} description - * @api public - */ - - instanceof: function(constructor, desc){ - var name = constructor.name; - this.assert( - this.obj instanceof constructor - , 'expected ' + this.inspect + ' to be an instance of ' + name + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' not to be an instance of ' + name + (desc ? " | " + desc : "")); - return this; - }, - - /** - * Assert numeric value above _n_. - * - * @param {Number} n - * @param {String} description - * @api public - */ - - above: function(n, desc){ - this.assert( - this.obj > n - , 'expected ' + this.inspect + ' to be above ' + n + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' to be below ' + n + (desc ? " | " + desc : "")); - return this; - }, - - /** - * Assert numeric value below _n_. - * - * @param {Number} n - * @param {String} description - * @api public - */ - - below: function(n, desc){ - this.assert( - this.obj < n - , 'expected ' + this.inspect + ' to be below ' + n + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' to be above ' + n + (desc ? " | " + desc : "")); - return this; - }, - - /** - * Assert string value matches _regexp_. - * - * @param {RegExp} regexp - * @param {String} description - * @api public - */ - - match: function(regexp, desc){ - this.assert( - regexp.exec(this.obj) - , 'expected ' + this.inspect + ' to match ' + regexp + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' not to match ' + regexp + (desc ? " | " + desc : "")); - return this; - }, - - /** - * Assert property "length" exists and has value of _n_. - * - * @param {Number} n - * @param {String} description - * @api public - */ - - length: function(n, desc){ - this.obj.should.have.property('length'); - var len = this.obj.length; - this.assert( - n == len - , 'expected ' + this.inspect + ' to have a length of ' + n + ' but got ' + len + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' to not have a length of ' + len + (desc ? " | " + desc : "")); - return this; - }, - - /** - * Assert property _name_ exists, with optional _val_. - * - * @param {String} name - * @param {Mixed} val - * @param {String} description - * @api public - */ - - property: function(name, val, desc){ - if (this.negate && undefined !== val) { - if (undefined === this.obj[name]) { - throw new Error(this.inspect + ' has no property ' + i(name) + (desc ? " | " + desc : "")); - } - } else { - this.assert( - undefined !== this.obj[name] - , 'expected ' + this.inspect + ' to have a property ' + i(name) + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' to not have a property ' + i(name) + (desc ? " | " + desc : "")); - } - - if (undefined !== val) { - this.assert( - val === this.obj[name] - , 'expected ' + this.inspect + ' to have a property ' + i(name) - + ' of ' + i(val) + ', but got ' + i(this.obj[name]) + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' to not have a property ' + i(name) + ' of ' + i(val) + (desc ? " | " + desc : "")); - } - - this.obj = this.obj[name]; - return this; - }, - - /** - * Assert own property _name_ exists. - * - * @param {String} name - * @param {String} description - * @api public - */ - - ownProperty: function(name, desc){ - this.assert( - this.obj.hasOwnProperty(name) - , 'expected ' + this.inspect + ' to have own property ' + i(name) + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' to not have own property ' + i(name) + (desc ? " | " + desc : "")); - return this; - }, - - /** - * Assert that `obj` is present via `.indexOf()`. - * - * @param {Mixed} obj - * @param {String} description - * @api public - */ - - include: function(obj, desc){ - this.assert( - ~this.obj.indexOf(obj) - , 'expected ' + this.inspect + ' to include ' + i(obj) + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' to not include ' + i(obj) + (desc ? " | " + desc : "")); - - return this; - }, - - /** - * Assert that an object equal to `obj` is present. - * - * @param {Array} obj - * @param {String} description - * @api public - */ - - includeEql: function(obj, desc){ - this.assert( - this.obj.some(function(item) { return eql(obj, item); }) - , 'expected ' + this.inspect + ' to include an object equal to ' + i(obj) + (desc ? " | " + desc : "") - , 'expected ' + this.inspect + ' to not include an object equal to ' + i(obj) + (desc ? " | " + desc : "")); - return this; - }, - - /** - * Assert that the array contains _obj_. - * - * @param {Mixed} obj - * @api public - */ - - contain: function(obj){ - console.warn('should.contain() is deprecated, use should.include()'); - this.obj.should.be.an.instanceof(Array); - this.assert( - ~this.obj.indexOf(obj) - , 'expected ' + this.inspect + ' to contain ' + i(obj) - , 'expected ' + this.inspect + ' to not contain ' + i(obj)); - return this; - }, - - /** - * Assert exact keys or inclusion of keys by using - * the `.include` modifier. - * - * @param {Array|String ...} keys - * @api public - */ - - keys: function(keys){ - var str - , ok = true; - - keys = keys instanceof Array - ? keys - : Array.prototype.slice.call(arguments); - - if (!keys.length) throw new Error('keys required'); - - var actual = Object.keys(this.obj) - , len = keys.length; - - // make sure they're all present - ok = keys.every(function(key){ - return ~actual.indexOf(key); - }); - - // matching length - ok = ok && keys.length == actual.length; - - // key string - if (len > 1) { - keys = keys.map(function(key){ - return i(key); - }); - var last = keys.pop(); - str = keys.join(', ') + ', and ' + last; - } else { - str = i(keys[0]); - } - - // message - str = 'have ' + (len > 1 ? 'keys ' : 'key ') + str; - - this.assert( - ok - , 'expected ' + this.inspect + ' to ' + str - , 'expected ' + this.inspect + ' to not ' + str); - - return this; - }, - - /** - * Assert that header `field` has the given `val`. - * - * @param {String} field - * @param {String} val - * @return {Assertion} for chaining - * @api public - */ - - header: function(field, val){ - this.obj.should - .have.property('headers').and - .have.property(field.toLowerCase(), val); - return this; - }, - - /** - * Assert `.statusCode` of `code`. - * - * @param {Number} code - * @return {Assertion} for chaining - * @api public - */ - - status: function(code){ - this.obj.should.have.property('statusCode'); - var status = this.obj.statusCode; - - this.assert( - code == status - , 'expected response code of ' + code + ' ' + i(statusCodes[code]) - + ', but got ' + status + ' ' + i(statusCodes[status]) - , 'expected to not respond with ' + code + ' ' + i(statusCodes[code])); - - return this; - }, - - /** - * Assert that this response has content-type: application/json. - * - * @return {Assertion} for chaining - * @api public - */ - - get json() { - this.obj.should.have.property('headers'); - this.obj.headers.should.have.property('content-type'); - this.obj.headers['content-type'].should.include('application/json'); - return this; - }, - - /** - * Assert that this response has content-type: text/html. - * - * @return {Assertion} for chaining - * @api public - */ - - get html() { - this.obj.should.have.property('headers'); - this.obj.headers.should.have.property('content-type'); - this.obj.headers['content-type'].should.include('text/html'); - return this; - }, - - /** - * Assert that this function will or will not - * throw an exception. - * - * @return {Assertion} for chaining - * @api public - */ - - throw: function(message){ - var fn = this.obj - , err = {} - , errorInfo = '' - , ok = true; - - try { - fn(); - ok = false; - } catch (e) { - err = e; - } - - if (ok) { - if ('string' == typeof message) { - ok = message == err.message; - } else if (message instanceof RegExp) { - ok = message.test(err.message); - } - - if (message && !ok) { - if ('string' == typeof message) { - errorInfo = " with a message matching '" + message + "', but got '" + err.message + "'"; - } else { - errorInfo = " with a message matching " + message + ", but got '" + err.message + "'"; - } - } - } - - this.assert( - ok - , 'expected an exception to be thrown' + errorInfo - , 'expected no exception to be thrown, got "' + err.message + '"'); - - return this; - } -}; -Assertion.prototype.instanceOf = Assertion.prototype.instanceof; -/** - * Aliases. - */ - -(function alias(name, as){ - Assertion.prototype[as] = Assertion.prototype[name]; - return alias; -}) -('length', 'lengthOf') -('keys', 'key') -('ownProperty', 'haveOwnProperty') -('above', 'greaterThan') -('below', 'lessThan'); - diff --git a/node_modules/should/package.json b/node_modules/should/package.json deleted file mode 100644 index 0d17a0d..0000000 --- a/node_modules/should/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "should", - "description": "test framework agnostic BDD-style assertions", - "version": "0.6.1", - "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" - }, - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/should.js.git" - }, - "contributors": [ - { - "name": "Aseem Kishore", - "email": "aseem.kishore@gmail.com" - } - ], - "devDependencies": { - "mocha": "*" - }, - "keywords": [ - "test", - "bdd", - "assert" - ], - "main": "./lib/should.js", - "engines": { - "node": ">= 0.2.0" - }, - "_id": "should@0.6.1", - "dependencies": {}, - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "70072db8fb46a6d5a784f935e6b4e76ff5576fa1" - }, - "_from": "should" -} diff --git a/node_modules/should/test/exist.test.js b/node_modules/should/test/exist.test.js deleted file mode 100644 index 7aa1082..0000000 --- a/node_modules/should/test/exist.test.js +++ /dev/null @@ -1,96 +0,0 @@ - -/** - * Module dependencies. - */ - -var should = require('../'); -var util = require('util'); - -function err(fn, msg) { - try { - fn(); - should.fail('expected an error'); - } catch (err) { - should.equal(msg, err.message); - } -} - -function err_should_exist(obj) { - err(function () { - should.exist(obj); - }, 'expected ' + util.inspect(obj) + ' to exist'); -} - -function err_should_not_exist(obj) { - err(function () { - should.not.exist(obj); - }, 'expected ' + util.inspect(obj) + ' to not exist'); -} - -module.exports = { - - // static should.exist() pass: - - 'test static should.exist() pass w/ bool': function () { - should.exist(false); - }, - - 'test static should.exist() pass w/ number': function () { - should.exist(0); - }, - - 'test static should.exist() pass w/ string': function () { - should.exist(''); - }, - - 'test static should.exist() pass w/ object': function () { - should.exist({}); - }, - - 'test static should.exist() pass w/ array': function () { - should.exist([]); - }, - - // static should.exist() fail: - - 'test static should.exist() fail w/ null': function () { - err_should_exist(null); - }, - - 'test static should.exist() fail w/ undefined': function () { - err_should_exist(undefined); - }, - - // static should.not.exist() pass: - - 'test static should.not.exist() pass w/ null': function () { - should.not.exist(null); - }, - - 'test static should.not.exist() pass w/ undefined': function () { - should.not.exist(undefined); - }, - - // static should.not.exist() fail: - - 'test static should.not.exist() fail w/ bool': function () { - err_should_not_exist(false); - }, - - 'test static should.not.exist() fail w/ number': function () { - err_should_not_exist(0); - }, - - 'test static should.not.exist() fail w/ string': function () { - err_should_not_exist(''); - }, - - 'test static should.not.exist() fail w/ object': function () { - err_should_not_exist({}); - }, - - 'test static should.not.exist() fail w/ array': function () { - err_should_not_exist([]); - }, - -}; diff --git a/node_modules/should/test/should.test.js b/node_modules/should/test/should.test.js deleted file mode 100644 index 4afc21d..0000000 --- a/node_modules/should/test/should.test.js +++ /dev/null @@ -1,557 +0,0 @@ - -/** - * Module dependencies. - */ - -var should = require('../') - , assert = require('assert'); - -function err(fn, msg) { - try { - fn(); - should.fail('expected an error'); - } catch (err) { - should.equal(msg, err.message); - } -} - -module.exports = { - 'test .version': function(){ - should.version.should.match(/^\d+\.\d+\.\d+$/); - }, - - 'test double require': function(){ - require('../').should.equal(should); - }, - - 'test assertion': function(){ - 'test'.should.be.a.string; - should.equal('foo', 'foo'); - }, - - 'test true': function(){ - true.should.be.true; - false.should.not.be.true; - (1).should.not.be.true; - - err(function(){ - 'test'.should.be.true; - }, "expected 'test' to be true") - }, - - 'test ok': function(){ - true.should.be.ok; - false.should.not.be.ok; - (1).should.be.ok; - (0).should.not.be.ok; - - err(function(){ - ''.should.be.ok; - }, "expected '' to be truthy"); - - err(function(){ - 'test'.should.not.be.ok; - }, "expected 'test' to be falsey"); - }, - - 'test false': function(){ - false.should.be.false; - true.should.not.be.false; - (0).should.not.be.false; - - err(function(){ - ''.should.be.false; - }, "expected '' to be false") - }, - - 'test .expected and .actual': function(){ - try { - 'foo'.should.equal('bar'); - } catch (err) { - assert('foo' == err.actual, 'err.actual'); - assert('bar' == err.expected, 'err.expected'); - } - }, - - 'test arguments': function(){ - var args = (function(){ return arguments; })(1,2,3); - args.should.be.arguments; - [].should.not.be.arguments; - }, - - 'test .equal()': function(){ - var foo; - should.equal(undefined, foo); - }, - - 'test typeof': function(){ - 'test'.should.be.a('string'); - - err(function(){ - 'test'.should.not.be.a('string'); - }, "expected 'test' not to be a string"); - - err(function(){ - 'test'.should.not.be.a('string', 'foo'); - }, "expected 'test' not to be a string | foo"); - - (5).should.be.a('number'); - - err(function(){ - (5).should.not.be.a('number'); - }, "expected 5 not to be a number"); - - err(function(){ - (5).should.not.be.a('number', 'foo'); - }, "expected 5 not to be a number | foo"); - }, - - 'test instanceof': function(){ - function Foo(){} - new Foo().should.be.an.instanceof(Foo); - - err(function(){ - (3).should.an.instanceof(Foo); - }, "expected 3 to be an instance of Foo"); - - err(function(){ - (3).should.an.instanceof(Foo, 'foo'); - }, "expected 3 to be an instance of Foo | foo"); - }, - - 'test instanceOf (non-reserved)': function(){ - function Foo(){} - new Foo().should.be.an.instanceOf(Foo); - - err(function(){ - (9).should.an.instanceOf(Foo); - }, "expected 9 to be an instance of Foo"); - - err(function(){ - (9).should.an.instanceOf(Foo, 'foo'); - }, "expected 9 to be an instance of Foo | foo"); - }, - - 'test within(start, finish)': function(){ - (5).should.be.within(5, 10); - (5).should.be.within(3,6); - (5).should.be.within(3,5); - (5).should.not.be.within(1,3); - - err(function(){ - (5).should.not.be.within(4,6); - }, "expected 5 to not be within 4..6"); - - err(function(){ - (10).should.be.within(50,100); - }, "expected 10 to be within 50..100"); - - err(function(){ - (5).should.not.be.within(4,6, 'foo'); - }, "expected 5 to not be within 4..6 | foo"); - - err(function(){ - (10).should.be.within(50,100, 'foo'); - }, "expected 10 to be within 50..100 | foo"); - }, - - 'test above(n)': function(){ - (5).should.be.above(2); - (5).should.be.greaterThan(2); - (5).should.not.be.above(5); - (5).should.not.be.above(6); - - err(function(){ - (5).should.be.above(6); - }, "expected 5 to be above 6"); - - err(function(){ - (10).should.not.be.above(6); - }, "expected 10 to be below 6"); - - err(function(){ - (5).should.be.above(6, 'foo'); - }, "expected 5 to be above 6 | foo"); - - err(function(){ - (10).should.not.be.above(6, 'foo'); - }, "expected 10 to be below 6 | foo"); - }, - - 'test below(n)': function(){ - (2).should.be.below(5); - (2).should.be.lessThan(5); - (5).should.not.be.below(5); - (6).should.not.be.below(5); - - err(function(){ - (6).should.be.below(5); - }, "expected 6 to be below 5"); - - err(function(){ - (6).should.not.be.below(10); - }, "expected 6 to be above 10"); - - err(function(){ - (6).should.be.below(5, 'foo'); - }, "expected 6 to be below 5 | foo"); - - err(function(){ - (6).should.not.be.below(10, 'foo'); - }, "expected 6 to be above 10 | foo"); - }, - - 'test match(regexp)': function(){ - 'foobar'.should.match(/^foo/) - 'foobar'.should.not.match(/^bar/) - - err(function(){ - 'foobar'.should.match(/^bar/i) - }, "expected 'foobar' to match /^bar/i"); - - err(function(){ - 'foobar'.should.not.match(/^foo/i) - }, "expected 'foobar' not to match /^foo/i"); - - err(function(){ - 'foobar'.should.match(/^bar/i, 'foo') - }, "expected 'foobar' to match /^bar/i | foo"); - - err(function(){ - 'foobar'.should.not.match(/^foo/i, 'foo') - }, "expected 'foobar' not to match /^foo/i | foo"); - }, - - 'test length(n)': function(){ - 'test'.should.have.length(4); - 'test'.should.not.have.length(3); - [1,2,3].should.have.length(3); - - err(function(){ - (4).should.have.length(3); - }, 'expected 4 to have a property \'length\''); - - err(function(){ - 'asd'.should.not.have.length(3); - }, "expected 'asd' to not have a length of 3"); - - err(function(){ - 'asd'.should.have.length(4, 'foo'); - }, "expected 'asd' to have a length of 4 but got 3 | foo"); - - err(function(){ - 'asd'.should.not.have.length(3, 'foo'); - }, "expected 'asd' to not have a length of 3 | foo"); - - }, - - 'test eql(val)': function(){ - 'test'.should.eql('test'); - ({ foo: 'bar' }).should.eql({ foo: 'bar' }); - (1).should.eql(1); - '4'.should.not.eql(4); - - err(function(){ - (4).should.eql(3); - }, 'expected 4 to equal 3'); - - err(function(){ - (4).should.eql(3, "foo"); - }, 'expected 4 to equal 3 | foo'); - - err(function(){ - (3).should.not.eql(3, "foo"); - }, 'expected 3 to not equal 3 | foo'); - }, - - 'test .json': function(){ - var req = { - headers: { - 'content-type': 'application/json' - } - }; - - req.should.be.json; - - var req = { - headers: { - 'content-type': 'application/json; charset=utf-8' - } - }; - - req.should.be.json; - }, - - 'test equal(val)': function(){ - 'test'.should.equal('test'); - (1).should.equal(1); - - err(function(){ - (4).should.equal(3); - }, 'expected 4 to equal 3'); - - err(function(){ - '4'.should.equal(4); - }, "expected '4' to equal 4"); - - err(function(){ - (3).should.equal(4, "foo"); - }, "expected 3 to equal 4 | foo"); - - err(function(){ - (4).should.not.equal(4, "foo"); - }, "expected 4 to not equal 4 | foo"); - }, - - 'test empty': function(){ - ''.should.be.empty; - [].should.be.empty; - ({ length: 0 }).should.be.empty; - - err(function(){ - ({}).should.be.empty; - }, 'expected {} to have a property \'length\''); - - err(function(){ - 'asd'.should.be.empty; - }, "expected 'asd' to be empty"); - - err(function(){ - ''.should.not.be.empty; - }, "expected '' not to be empty"); - }, - - 'test property(name)': function(){ - 'test'.should.have.property('length'); - (4).should.not.have.property('length'); - - err(function(){ - 'asd'.should.have.property('foo'); - }, "expected 'asd' to have a property 'foo'"); - - err(function(){ - 'asd'.should.have.property('foo', undefined, 'foo'); - }, "expected 'asd' to have a property 'foo' | foo"); - - err(function(){ - 'asd'.should.not.have.property('length', undefined, 'foo'); - }, "expected 'asd' to not have a property 'length' | foo"); - }, - - 'test property(name, val)': function(){ - 'test'.should.have.property('length', 4); - 'asd'.should.have.property('constructor', String); - - err(function(){ - 'asd'.should.have.property('length', 4); - }, "expected 'asd' to have a property 'length' of 4, but got 3"); - - err(function(){ - 'asd'.should.not.have.property('length', 3); - }, "expected 'asd' to not have a property 'length' of 3"); - - err(function(){ - 'asd'.should.not.have.property('foo', 3); - }, "'asd' has no property 'foo'"); - - err(function(){ - 'asd'.should.have.property('constructor', Number); - }, "expected 'asd' to have a property 'constructor' of [Function: Number], but got [Function: String]"); - - err(function(){ - 'asd'.should.have.property('length', 4, 'foo'); - }, "expected 'asd' to have a property 'length' of 4, but got 3 | foo"); - - err(function(){ - 'asd'.should.not.have.property('length', 3, 'foo'); - }, "expected 'asd' to not have a property 'length' of 3 | foo"); - - err(function(){ - 'asd'.should.not.have.property('foo', 3, 'foo'); - }, "'asd' has no property 'foo' | foo"); - - err(function(){ - 'asd'.should.have.property('constructor', Number, 'foo'); - }, "expected 'asd' to have a property 'constructor' of [Function: Number], but got [Function: String] | foo"); - }, - - 'test ownProperty(name)': function(){ - 'test'.should.have.ownProperty('length'); - 'test'.should.haveOwnProperty('length'); - ({ length: 12 }).should.have.ownProperty('length'); - - err(function(){ - ({ length: 12 }).should.not.have.ownProperty('length'); - }, "expected { length: 12 } to not have own property 'length'"); - - err(function(){ - ({ length: 12 }).should.not.have.ownProperty('length', 'foo'); - }, "expected { length: 12 } to not have own property 'length' | foo"); - - err(function(){ - ({ length: 12 }).should.have.ownProperty('foo', 'foo'); - }, "expected { length: 12 } to have own property 'foo' | foo"); - }, - - 'test include() with string': function(){ - 'foobar'.should.include('bar'); - 'foobar'.should.include('foo'); - 'foobar'.should.not.include('baz'); - - err(function(){ - 'foobar'.should.include('baz'); - }, "expected 'foobar' to include 'baz'"); - - err(function(){ - 'foobar'.should.not.include('bar'); - }, "expected 'foobar' to not include 'bar'"); - - err(function(){ - 'foobar'.should.include('baz', 'foo'); - }, "expected 'foobar' to include 'baz' | foo"); - - err(function(){ - 'foobar'.should.not.include('bar', 'foo'); - }, "expected 'foobar' to not include 'bar' | foo"); - }, - - 'test include() with array': function(){ - ['foo', 'bar'].should.include('foo'); - ['foo', 'bar'].should.include('foo'); - ['foo', 'bar'].should.include('bar'); - [1,2].should.include(1); - ['foo', 'bar'].should.not.include('baz'); - ['foo', 'bar'].should.not.include(1); - - err(function(){ - ['foo'].should.include('bar'); - }, "expected [ 'foo' ] to include 'bar'"); - - err(function(){ - ['bar', 'foo'].should.not.include('foo'); - }, "expected [ 'bar', 'foo' ] to not include 'foo'"); - - err(function(){ - ['foo'].should.include('bar', 'foo'); - }, "expected [ 'foo' ] to include 'bar' | foo"); - - err(function(){ - ['bar', 'foo'].should.not.include('foo', 'foo'); - }, "expected [ 'bar', 'foo' ] to not include 'foo' | foo"); - }, - - 'test includeEql() with array': function(){ - [['foo'], ['bar']].should.includeEql(['foo']); - [['foo'], ['bar']].should.includeEql(['bar']); - [['foo'], ['bar']].should.not.includeEql(['baz']); - [].should.not.includeEql(['baz']); - - err(function(){ - [['foo']].should.includeEql(['bar']); - }, "expected [ [ 'foo' ] ] to include an object equal to [ 'bar' ]"); - - err(function(){ - [['foo']].should.not.includeEql(['foo']); - }, "expected [ [ 'foo' ] ] to not include an object equal to [ 'foo' ]"); - - err(function(){ - [['foo']].should.includeEql(['bar'], 'foo'); - }, "expected [ [ 'foo' ] ] to include an object equal to [ 'bar' ] | foo"); - - err(function(){ - [['foo']].should.not.includeEql(['foo'], 'foo'); - }, "expected [ [ 'foo' ] ] to not include an object equal to [ 'foo' ] | foo"); - }, - - 'test keys(array)': function(){ - ({ foo: 1 }).should.have.keys(['foo']); - ({ foo: 1, bar: 2 }).should.have.keys(['foo', 'bar']); - ({ foo: 1, bar: 2 }).should.have.keys('foo', 'bar'); - - err(function(){ - ({ foo: 1 }).should.have.keys(); - }, "keys required"); - - err(function(){ - ({ foo: 1 }).should.have.keys([]); - }, "keys required"); - - err(function(){ - ({ foo: 1 }).should.not.have.keys([]); - }, "keys required"); - - err(function(){ - ({ foo: 1 }).should.have.keys(['bar']); - }, "expected { foo: 1 } to have key 'bar'"); - - err(function(){ - ({ foo: 1 }).should.have.keys(['bar', 'baz']); - }, "expected { foo: 1 } to have keys 'bar', and 'baz'"); - - err(function(){ - ({ foo: 1 }).should.have.keys(['foo', 'bar', 'baz']); - }, "expected { foo: 1 } to have keys 'foo', 'bar', and 'baz'"); - - err(function(){ - ({ foo: 1 }).should.not.have.keys(['foo']); - }, "expected { foo: 1 } to not have key 'foo'"); - - err(function(){ - ({ foo: 1 }).should.not.have.keys(['foo']); - }, "expected { foo: 1 } to not have key 'foo'"); - - err(function(){ - ({ foo: 1, bar: 2 }).should.not.have.keys(['foo', 'bar']); - }, "expected { foo: 1, bar: 2 } to not have keys 'foo', and 'bar'"); - }, - - 'test chaining': function(){ - var user = { name: 'tj', pets: ['tobi', 'loki', 'jane', 'bandit'] }; - user.should.have.property('pets').with.lengthOf(4); - - err(function(){ - user.should.have.property('pets').with.lengthOf(5); - }, "expected [ 'tobi', 'loki', 'jane', 'bandit' ] to have a length of 5 but got 4"); - - user.should.be.a('object').and.have.property('name', 'tj'); - }, - - 'test throw()': function(){ - (function(){}).should.not.throw(); - (function(){ throw new Error('fail') }).should.throw(); - - err(function(){ - (function(){}).should.throw(); - }, 'expected an exception to be thrown'); - - err(function(){ - (function(){ - throw new Error('fail'); - }).should.not.throw(); - }, 'expected no exception to be thrown, got "fail"'); - }, - - 'test throw() with regex message': function(){ - (function(){ throw new Error('fail'); }).should.throw(/fail/); - - err(function(){ - (function(){}).should.throw(/fail/); - }, 'expected an exception to be thrown'); - - err(function(){ - (function(){ throw new Error('error'); }).should.throw(/fail/); - }, "expected an exception to be thrown with a message matching /fail/, but got 'error'"); - }, - - 'test throw() with string message': function(){ - (function(){ throw new Error('fail'); }).should.throw('fail'); - - err(function(){ - (function(){}).should.throw('fail'); - }, 'expected an exception to be thrown'); - - err(function(){ - (function(){ throw new Error('error'); }).should.throw('fail'); - }, "expected an exception to be thrown with a message matching 'fail', but got 'error'"); - } -}; diff --git a/node_modules/underscore.string/.travis.yml b/node_modules/underscore.string/.travis.yml deleted file mode 100644 index ab27b29..0000000 --- a/node_modules/underscore.string/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: ruby -rvm: - - 1.9.3 - -before_script: - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - - sleep 2 \ No newline at end of file diff --git a/node_modules/underscore.string/Gemfile b/node_modules/underscore.string/Gemfile deleted file mode 100644 index f024827..0000000 --- a/node_modules/underscore.string/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source :rubygems - -gem 'serve' -gem 'uglifier' -gem 'rake' \ No newline at end of file diff --git a/node_modules/underscore.string/Gemfile.lock b/node_modules/underscore.string/Gemfile.lock deleted file mode 100644 index a6bb1e7..0000000 --- a/node_modules/underscore.string/Gemfile.lock +++ /dev/null @@ -1,34 +0,0 @@ -GEM - remote: http://rubygems.org/ - specs: - activesupport (3.2.3) - i18n (~> 0.6) - multi_json (~> 1.0) - execjs (1.3.0) - multi_json (~> 1.0) - i18n (0.6.0) - multi_json (1.2.0) - rack (1.4.1) - rack-test (0.6.1) - rack (>= 1.0) - rake (0.9.2.2) - serve (1.5.1) - activesupport (~> 3.0) - i18n - rack (~> 1.2) - rack-test (~> 0.5) - tilt (~> 1.3) - tzinfo - tilt (1.3.3) - tzinfo (0.3.33) - uglifier (1.2.4) - execjs (>= 0.3.0) - multi_json (>= 1.0.2) - -PLATFORMS - ruby - -DEPENDENCIES - rake - serve - uglifier diff --git a/node_modules/underscore.string/README.markdown b/node_modules/underscore.string/README.markdown deleted file mode 100644 index d2244b5..0000000 --- a/node_modules/underscore.string/README.markdown +++ /dev/null @@ -1,668 +0,0 @@ -# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) # - - - -Javascript lacks complete string manipulation operations. -This an attempt to fill that gap. List of build-in methods can be found -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 -independently from **_s**-global variable. But with Underscore.js you can -use Object-Oriented style and chaining: - -[u]: http://documentcloud.github.com/underscore/ - -```javascript -_(" epeli ").chain().trim().capitalize().value() -=> "Epeli" -``` - -## Download ## - - * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb* - * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb* - - -## Node.js installation ## - -**npm package** - - npm install underscore.string - -**Standalone usage**: - -```javascript -var _s = require('underscore.string'); -``` - -**Integrate with Underscore.js**: - -```javascript -var _ = require('underscore'); - -// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains) -_.str = require('underscore.string'); - -// Mix in non-conflict functions to Underscore namespace if you want -_.mixin(_.str.exports()); - -// All functions, include conflict, will be available through _.str object -_.str.include('Underscore.string', 'string'); // => true -``` - -## String Functions ## - -For availability of functions in this way you need to mix in Underscore.string functions: - -```javascript -_.mixin(_.string.exports()); -``` - -otherwise functions from examples will be available through _.string or _.str objects: - -```javascript -_.str.capitalize('epeli') -=> "Epeli" -``` - -**capitalize** _.capitalize(string) - -Converts first letter of the string to uppercase. - -```javascript -_.capitalize("foo Bar") -=> "Foo Bar" -``` - -**chop** _.chop(string, step) - -```javascript -_.chop('whitespace', 3) -=> ['whi','tes','pac','e'] -``` - -**clean** _.clean(str) - -Compress some whitespaces to one. - -```javascript -_.clean(" foo bar ") -=> 'foo bar' -``` - -**chars** _.chars(str) - -```javascript -_.chars('Hello') -=> ['H','e','l','l','o'] -``` - -**includes** _.includes(string, substring) - -Tests if string contains a substring. - -```javascript -_.includes("foobar", "ob") -=> true -``` - -**include** available only through _.str object, because Underscore has function with the same name. - -```javascript -_.str.include("foobar", "ob") -=> true -``` - -**includes** function was removed - -But you can create it in this way, for compatibility with previous versions: - -```javascript -_.includes = _.str.include -``` - -**count** _.count(string, substring) - -```javascript -_('Hello world').count('l') -=> 3 -``` - -**escapeHTML** _.escapeHTML(string) - -Converts HTML special characters to their entity equivalents. - -```javascript -_('
    Blah blah blah
    ').escapeHTML(); -=> '<div>Blah blah blah</div>' -``` - -**unescapeHTML** _.unescapeHTML(string) - -Converts entity characters to HTML equivalents. - -```javascript -_('<div>Blah blah blah</div>').unescapeHTML(); -=> '
    Blah blah blah
    ' -``` - -**insert** _.insert(string, index, substing) - -```javascript -_('Hello ').insert(6, 'world') -=> 'Hello world' -``` - -**isBlank** _.isBlank(string) - -```javascript -_('').isBlank(); // => true -_('\n').isBlank(); // => true -_(' ').isBlank(); // => true -_('a').isBlank(); // => false -``` - -**join** _.join(separator, *strings) - -Joins strings together with given separator - -```javascript -_.join(" ", "foo", "bar") -=> "foo bar" -``` - -**lines** _.lines(str) - -```javascript -_.lines("Hello\nWorld") -=> ["Hello", "World"] -``` - -**reverse** available only through _.str object, because Underscore has function with the same name. - -Return reversed string: - -```javascript -_.str.reverse("foobar") -=> 'raboof' -``` - -**splice** _.splice(string, index, howmany, substring) - -Like a array splice. - -```javascript -_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli') -=> 'https://edtsech@bitbucket.org/epeli/underscore.strings' -``` - -**startsWith** _.startsWith(string, starts) - -This method checks whether string starts with starts. - -```javascript -_("image.gif").startsWith("image") -=> true -``` - -**endsWith** _.endsWith(string, ends) - -This method checks whether string ends with ends. - -```javascript -_("image.gif").endsWith("gif") -=> true -``` - -**succ** _.succ(str) - -Returns the successor to str. - -```javascript -_('a').succ() -=> 'b' - -_('A').succ() -=> 'B' -``` - -**supplant** - -Supplant function was removed, use Underscore.js [template function][p]. - -[p]: http://documentcloud.github.com/underscore/#template - -**strip** alias for *trim* - -**lstrip** alias for *ltrim* - -**rstrip** alias for *rtrim* - -**titleize** _.titleize(string) - -```javascript -_('my name is epeli').titleize() -=> 'My Name Is Epeli' -``` - -**camelize** _.camelize(string) - -Converts underscored or dasherized string to a camelized one - -```javascript -_('-moz-transform').camelize() -=> 'MozTransform' -``` - -**classify** _.classify(string) - -Converts string to camelized class name - -```javascript -_('some_class_name').classify() -=> 'SomeClassName' -``` - -**underscored** _.underscored(string) - -Converts a camelized or dasherized string into an underscored one - -```javascript -_('MozTransform').underscored() -=> 'moz_transform' -``` - -**dasherize** _.dasherize(string) - -Converts a underscored or camelized string into an dasherized one - -```javascript -_('MozTransform').dasherize() -=> '-moz-transform' -``` - -**humanize** _.humanize(string) - -Converts an underscored, camelized, or dasherized string into a humanized one. -Also removes beginning and ending whitespace, and removes the postfix '_id'. - -```javascript -_(' capitalize dash-CamelCase_underscore trim ').humanize() -=> 'Capitalize dash camel case underscore trim' -``` - -**trim** _.trim(string, [characters]) - -trims defined characters from begining and ending of the string. -Defaults to whitespace characters. - -```javascript -_.trim(" foobar ") -=> "foobar" - -_.trim("_-foobar-_", "_-") -=> "foobar" -``` - - -**ltrim** _.ltrim(string, [characters]) - -Left trim. Similar to trim, but only for left side. - - -**rtrim** _.rtrim(string, [characters]) - -Right trim. Similar to trim, but only for right side. - -**truncate** _.truncate(string, length, truncateString) - -```javascript -_('Hello world').truncate(5) -=> 'Hello...' - -_('Hello').truncate(10) -=> 'Hello' -``` - -**prune** _.prune(string, length, pruneString) - -Elegant version of truncate. -Makes sure the pruned string does not exceed the original length. -Avoid half-chopped words when truncating. - -```javascript -_('Hello, world').prune(5) -=> 'Hello...' - -_('Hello, world').prune(8) -=> 'Hello...' - -_('Hello, world').prune(5, ' (read a lot more)') -=> 'Hello, world' (as adding "(read a lot more)" would be longer than the original string) - -_('Hello, cruel world').prune(15) -=> 'Hello, cruel...' - -_('Hello').prune(10) -=> 'Hello' -``` - -**words** _.words(str, delimiter=" ") - -Split string by delimiter (String or RegExp), ' ' by default. - -```javascript -_.words("I love you") -=> ["I","love","you"] - -_.words("I_love_you", "_") -=> ["I","love","you"] - -_.words("I-love-you", /-/) -=> ["I","love","you"] -``` - -**sprintf** _.sprintf(string format, *arguments) - -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 - -```javascript -_.sprintf("%.1f", 1.17) -"1.2" -``` - -**pad** _.pad(str, length, [padStr, type]) - -pads 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. - -```javascript -_.pad("1", 8) --> " 1"; - -_.pad("1", 8, '0') --> "00000001"; - -_.pad("1", 8, '0', 'right') --> "10000000"; - -_.pad("1", 8, '0', 'both') --> "00001000"; - -_.pad("1", 8, 'bleepblorp', 'both') --> "bbbb1bbb"; -``` - -**lpad** _.lpad(str, length, [padStr]) - -left-pad a string. Alias for `pad(str, length, padStr, 'left')` - -```javascript -_.lpad("1", 8, '0') --> "00000001"; -``` - -**rpad** _.rpad(str, length, [padStr]) - -right-pad a string. Alias for `pad(str, length, padStr, 'right')` - -```javascript -_.rpad("1", 8, '0') --> "10000000"; -``` - -**lrpad** _.lrpad(str, length, [padStr]) - -left/right-pad a string. Alias for `pad(str, length, padStr, 'both')` - -```javascript -_.lrpad("1", 8, '0') --> "00001000"; -``` - -**center** alias for **lrpad** - -**ljust** alias for *rpad* - -**rjust** alias for *lpad* - -**toNumber** _.toNumber(string, [decimals]) - -Parse string to number. Returns NaN if string can't be parsed to number. - -```javascript -_('2.556').toNumber() -=> 3 - -_('2.556').toNumber(1) -=> 2.6 -``` - -**strRight** _.strRight(string, pattern) - -Searches 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. - -```javascript -_('This_is_a_test_string').strRight('_') -=> "is_a_test_string"; -``` - -**strRightBack** _.strRightBack(string, pattern) - -Searches 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. - -```javascript -_('This_is_a_test_string').strRightBack('_') -=> "string"; -``` - -**strLeft** _.strLeft(string, pattern) - -Searches 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. - -```javascript -_('This_is_a_test_string').strLeft('_') -=> "This"; -``` - -**strLeftBack** _.strLeftBack(string, pattern) - -Searches 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. - -```javascript -_('This_is_a_test_string').strLeftBack('_') -=> "This_is_a_test"; -``` - -**stripTags** - -Removes all html tags from string. - -```javascript -_('a
    link').stripTags() -=> 'a link' - -_('a link').stripTags() -=> 'a linkalert("hello world!")' -``` - -**toSentence** _.toSentence(array, [delimiter, lastDelimiter]) - -Join an array into a human readable sentence. - -```javascript -_.toSentence(['jQuery', 'Mootools', 'Prototype']) -=> 'jQuery, Mootools and Prototype'; - -_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ') -=> 'jQuery, Mootools unt Prototype'; -``` - -**repeat** _.repeat(string, count, [separator]) - -Repeats a string count times. - -```javascript -_.repeat("foo", 3) -=> 'foofoofoo'; - -_.repeat("foo", 3, "bar") -=> 'foobarfoobarfoo' -``` - -**slugify** _.slugify(string) - -Transform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash. - -```javascript -_.slugify("Un éléphant à l'orée du bois") -=> 'un-elephant-a-loree-du-bois'; -``` - -***Caution: this function is charset dependent*** - -## Roadmap ## - -Any suggestions or bug reports are welcome. Just email me or more preferably open an issue. - -## Changelog ## - -### 2.0.0 ### - -* Added prune, humanize functions -* Added _.string (_.str) namespace for Underscore.string library -* Removed includes function - -#### Problems - -We lose two things for `include` and `reverse` methods from `_.string`: - -* Calls like `_('foobar').include('bar')` aren't available; -* Chaining isn't available too. - -But if you need this functionality you can create aliases for conflict functions which will be convenient for you: - -```javascript -_.mixin({ - includeString: _.str.include, - reverseString: _.str.reverse -}) - -// Now wrapper calls and chaining are available. -_('foobar').chain().reverseString().includeString('rab').value() -``` - -#### Standalone Usage - -If you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias -But of course you can just reassign `_` variable with `_.string` - -```javascript -_ = _.string -``` -### 2.2.0 ### - -* Capitalize method behavior changed -* Various perfomance tweaks - -### 2.1.1### - -* Fixed words method bug -* Added classify method - -### 2.1.0 ### - -* AMD support -* Added toSentence method -* Added slugify method -* Lots of speed optimizations - -### 2.0.0 ### - -For upgrading to this version you need to mix in Underscore.string library to Underscore object: - -```javascript -_.mixin(_.string.exports()); -``` - -and all non-conflict Underscore.string functions will be available through Underscore object. -Also function `includes` has been removed, you should replace this function by `_.str.include` -or create alias `_.includes = _.str.include` and all your code will work fine. - -### 1.1.6 ### - -* Fixed reverse and truncate -* Added isBlank, stripTags, inlude(alias for includes) -* Added uglifier compression - -### 1.1.5 ### - -* Added strRight, strRightBack, strLeft, strLeftBack - -### 1.1.4 ### - -* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust -* Integration with Underscore 1.1.6 - -### 1.1.3 ### - -* Added methods: underscored, camelize, dasherize -* Support newer version of npm - -### 1.1.2 ### - -* Created functions: lines, chars, words functions - -### 1.0.2 ### - -* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible) -* Removed 'reverse' function, because this function override underscore.js 'reverse' - -## Contribute ## - -* Fork & pull request. Don't forget about tests. -* If you planning add some feature please create issue before. - -Otherwise changes will be rejected. - -## Contributors list ## - -* Esa-Matti Suuronen (), -* Edward Tsech , -* Sasha Koss (), -* Vladimir Dronnikov , -* Pete Kruckenberg (), -* Paul Chavard (), -* Ed Finkler () -* Pavel Pravosud -* Anton Lindqvist () - -## Licence ## - -The MIT License - -Copyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org - -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/underscore.string/Rakefile b/node_modules/underscore.string/Rakefile deleted file mode 100644 index baa164c..0000000 --- a/node_modules/underscore.string/Rakefile +++ /dev/null @@ -1,28 +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') - 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 - pid = spawn('bundle exec serve', err: '/dev/null') - sleep 2 - - puts "Running underscore.string test suite." - result1 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test.html"} - - puts "Running Underscore test suite." - result2 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test_underscore/test.html"} - - Process.kill 'INT', pid - - exit(result1 && result2 ? 0 : 1) -end \ No newline at end of file diff --git a/node_modules/underscore.string/dist/underscore.string.min.js b/node_modules/underscore.string/dist/underscore.string.min.js deleted file mode 100644 index cd436e1..0000000 --- a/node_modules/underscore.string/dist/underscore.string.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){"use strict";var b=String.prototype.trim,c=String.prototype.trimRight,d=String.prototype.trimLeft,e=function(a){return a*1||0},f=function(a,b,c){a+="",b=~~b;for(var d=[];b>0;d[--b]=a);return d.join(c==null?"":c)},g=function(a){return Array.prototype.slice.call(a)},h=function(a){return a!=null?"["+m.escapeRegExp(""+a)+"]":"\\s"},i={lt:"<",gt:">",quot:'"',apos:"'",amp:"&"},j={};for(var k in i)j[i[k]]=k;var l=function(){function a(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}var b=f,c=function(){return c.cache.hasOwnProperty(arguments[0])||(c.cache[arguments[0]]=c.parse(arguments[0])),c.format.call(null,c.cache[arguments[0]],arguments)};return c.format=function(c,d){var e=1,f=c.length,g="",h,i=[],j,k,m,n,o,p;for(j=0;j=0?"+"+h:h,o=m[4]?m[4]=="0"?"0":m[4].charAt(1):" ",p=m[6]-String(h).length,n=m[6]?b(o,p):"",i.push(m[5]?h+n:n+h)}}return i.join("")},c.cache={},c.parse=function(a){var b=a,c=[],d=[],e=0;while(b){if((c=/^[^\x25]+/.exec(b))!==null)d.push(c[0]);else if((c=/^\x25{2}/.exec(b))!==null)d.push("%");else{if((c=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(b))===null)throw new Error("[_.sprintf] huh?");if(c[2]){e|=1;var f=[],g=c[2],h=[];if((h=/^([a-z_][a-z_\d]*)/i.exec(g))===null)throw new Error("[_.sprintf] huh?");f.push(h[1]);while((g=g.substring(h[0].length))!=="")if((h=/^\.([a-z_][a-z_\d]*)/i.exec(g))!==null)f.push(h[1]);else{if((h=/^\[(\d+)\]/.exec(g))===null)throw new Error("[_.sprintf] huh?");f.push(h[1])}c[2]=f}else e|=2;if(e===3)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");d.push(c)}b=b.substring(c[0].length)}return d},c}(),m={VERSION:"2.1.1",isBlank:function(a){return/^\s*$/.test(a)},stripTags:function(a){return(""+a).replace(/<\/?[^>]+>/g,"")},capitalize:function(a){return a+="",a.charAt(0).toUpperCase()+a.substring(1)},chop:function(a,b){a+="",b=~~b||a.length;var c=[];for(var d=0;d"']/g,function(a){return"&"+j[a]+";"})},unescapeHTML:function(a){return(""+a).replace(/\&([^;]+);/g,function(a,b){var c;return b in i?i[b]:(c=b.match(/^#x([\da-fA-F]+)$/))?String.fromCharCode(parseInt(c[1],16)):(c=b.match(/^#(\d+)$/))?String.fromCharCode(~~c[1]):a})},escapeRegExp:function(a){return a.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},insert:function(a,b,c){var d=m.chars(a);return d.splice(~~b,0,""+c),d.join("")},include:function(a,b){return!!~(""+a).indexOf(b)},join:function(){var a=g(arguments);return a.join(a.shift())},lines:function(a){return(""+a).split("\n")},reverse:function(a){return m.chars(a).reverse().join("")},splice:function(a,b,c,d){var e=m.chars(a);return e.splice(~~b,~~c,d),e.join("")},startsWith:function(a,b){return a+="",b+="",a.length>=b.length&&a.substring(0,b.length)===b},endsWith:function(a,b){return a+="",b+="",a.length>=b.length&&a.substring(a.length-b.length)===b},succ:function(a){a+="";var b=m.chars(a);return b.splice(a.length-1,1,String.fromCharCode(a.charCodeAt(a.length-1)+1)),b.join("")},titleize:function(a){return(""+a).replace(/\b./g,function(a){return a.toUpperCase()})},camelize:function(a){return m.trim(a).replace(/[-_\s]+(.)?/g,function(a,b){return b&&b.toUpperCase()})},underscored:function(a){return m.trim(a).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(a){return m.trim(a).replace(/[_\s]+/g,"-").replace(/([A-Z])/g,"-$1").replace(/-+/g,"-").toLowerCase()},classify:function(a){return a+="",m.titleize(a.replace(/_/g," ")).replace(/\s/g,"")},humanize:function(a){return m.capitalize(this.underscored(a).replace(/_id$/,"").replace(/_/g," "))},trim:function(a,c){return a+="",!c&&b?b.call(a):(c=h(c),a.replace(new RegExp("^"+c+"+|"+c+"+$","g"),""))},ltrim:function(a,b){return a+="",!b&&d?d.call(a):(b=h(b),a.replace(new RegExp("^"+b+"+"),""))},rtrim:function(a,b){return a+="",!b&&c?c.call(a):(b=h(b),a.replace(new RegExp(b+"+$"),""))},truncate:function(a,b,c){return a+="",c=c||"...",b=~~b,a.length>b?a.slice(0,b)+c:a},prune:function(a,b,c){a+="",b=~~b,c=c!=null?""+c:"...";var d,e,f=a.replace(/\W/g,function(a){return a.toUpperCase()!==a.toLowerCase()?"A":" "});return e=f.charAt(b),d=f.slice(0,b),e&&e.match(/\S/)&&(d=d.replace(/\s\S+$/,"")),d=m.rtrim(d),(d+c).length>a.length?a:a.substring(0,d.length)+c},words:function(a,b){return m.trim(a,b).split(b||/\s+/)},pad:function(a,b,c,d){a+="";var e=0;b=~~b,c?c.length>1&&(c=c.charAt(0)):c=" ";switch(d){case"right":return e=b-a.length,a+f(c,e);case"both":return e=b-a.length,f(c,Math.ceil(e/2))+a+f(c,Math.floor(e/2));default:return e=b-a.length,f(c,e)+a}},lpad:function(a,b,c){return m.pad(a,b,c)},rpad:function(a,b,c){return m.pad(a,b,c,"right")},lrpad:function(a,b,c){return m.pad(a,b,c,"both")},sprintf:l,vsprintf:function(a,b){return b.unshift(a),l.apply(null,b)},toNumber:function(a,b){a+="";var c=e(e(a).toFixed(~~b));return c===0&&!a.match(/^0+$/)?Number.NaN:c},strRight:function(a,b){a+="",b=b!=null?""+b:b;var c=b?a.indexOf(b):-1;return~c?a.slice(c+b.length,a.length):a},strRightBack:function(a,b){a+="",b=b!=null?""+b:b;var c=b?a.lastIndexOf(b):-1;return~c?a.slice(c+b.length,a.length):a},strLeft:function(a,b){a+="",b=b!=null?""+b:b;var c=b?a.indexOf(b):-1;return~c?a.slice(0,c):a},strLeftBack:function(a,b){a+="",b=b!=null?""+b:b;var c=a.lastIndexOf(b);return~c?a.slice(0,c):a},toSentence:function(a,b,c){b||(b=", "),c||(c=" and ");var d=a.length,e="";for(var f=0;f -// Underscore.strings 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.2.0rc - -(function(root){ - 'use strict'; - - // Defining helper functions. - - var nativeTrim = String.prototype.trim; - var nativeTrimRight = String.prototype.trimRight; - var nativeTrimLeft = String.prototype.trimLeft; - - var parseNumber = function(source) { return source * 1 || 0; }; - - var strRepeat = function(str, qty, separator){ - // ~~var — is the fastest available way to convert anything to Integer in javascript. - // We'll use it extensively in this lib. - str += ''; qty = ~~qty; - for (var repeat = []; qty > 0; repeat[--qty] = str) {} - return repeat.join(separator == null ? '' : separator); - }; - - var slice = function(a){ - return Array.prototype.slice.call(a); - }; - - var defaultToWhiteSpace = function(characters){ - if (characters != null) { - return '[' + _s.escapeRegExp(''+characters) + ']'; - } - return '\\s'; - }; - - var escapeChars = { - lt: '<', - gt: '>', - quot: '"', - apos: "'", - amp: '&' - }; - - var reversedEscapeChars = {}; - for(var key in escapeChars){ reversedEscapeChars[escapeChars[key]] = key; } - - // sprintf() for JavaScript 0.7-beta1 - // http://www.diveintojavascript.com/projects/javascript-sprintf - // - // Copyright (c) Alexandru Marasteanu - // All rights reserved. - - var sprintf = (function() { - function get_type(variable) { - return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase(); - } - - var str_repeat = strRepeat; - - var str_format = function() { - if (!str_format.cache.hasOwnProperty(arguments[0])) { - str_format.cache[arguments[0]] = str_format.parse(arguments[0]); - } - return str_format.format.call(null, str_format.cache[arguments[0]], arguments); - }; - - str_format.format = function(parse_tree, argv) { - var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length; - for (i = 0; i < tree_length; i++) { - node_type = get_type(parse_tree[i]); - if (node_type === 'string') { - output.push(parse_tree[i]); - } - else if (node_type === 'array') { - match = parse_tree[i]; // convenience purposes only - if (match[2]) { // keyword argument - arg = argv[cursor]; - for (k = 0; k < match[2].length; k++) { - if (!arg.hasOwnProperty(match[2][k])) { - throw new Error(sprintf('[_.sprintf] property "%s" does not exist', match[2][k])); - } - arg = arg[match[2][k]]; - } - } else if (match[1]) { // positional argument (explicit) - arg = argv[match[1]]; - } - else { // positional argument (implicit) - arg = argv[cursor++]; - } - - if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) { - throw new Error(sprintf('[_.sprintf] expecting number but found %s', get_type(arg))); - } - switch (match[8]) { - case 'b': arg = arg.toString(2); break; - case 'c': arg = String.fromCharCode(arg); break; - case 'd': arg = parseInt(arg, 10); break; - case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break; - case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break; - case 'o': arg = arg.toString(8); break; - case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break; - case 'u': arg = Math.abs(arg); break; - case 'x': arg = arg.toString(16); break; - case 'X': arg = arg.toString(16).toUpperCase(); break; - } - arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg); - pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' '; - pad_length = match[6] - String(arg).length; - pad = match[6] ? str_repeat(pad_character, pad_length) : ''; - output.push(match[5] ? arg + pad : pad + arg); - } - } - return output.join(''); - }; - - str_format.cache = {}; - - str_format.parse = function(fmt) { - var _fmt = fmt, match = [], parse_tree = [], arg_names = 0; - while (_fmt) { - if ((match = /^[^\x25]+/.exec(_fmt)) !== null) { - parse_tree.push(match[0]); - } - else if ((match = /^\x25{2}/.exec(_fmt)) !== null) { - parse_tree.push('%'); - } - else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) { - if (match[2]) { - arg_names |= 1; - var field_list = [], replacement_field = match[2], field_match = []; - if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) { - field_list.push(field_match[1]); - while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { - if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) { - field_list.push(field_match[1]); - } - else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) { - field_list.push(field_match[1]); - } - else { - throw new Error('[_.sprintf] huh?'); - } - } - } - else { - throw new Error('[_.sprintf] huh?'); - } - match[2] = field_list; - } - else { - arg_names |= 2; - } - if (arg_names === 3) { - throw new Error('[_.sprintf] mixing positional and named placeholders is not (yet) supported'); - } - parse_tree.push(match); - } - else { - throw new Error('[_.sprintf] huh?'); - } - _fmt = _fmt.substring(match[0].length); - } - return parse_tree; - }; - - return str_format; - })(); - - - - // Defining underscore.string - - var _s = { - - VERSION: '2.2.0rc', - - isBlank: function(str){ - return (/^\s*$/).test(str); - }, - - stripTags: function(str){ - return (''+str).replace(/<\/?[^>]+>/g, ''); - }, - - capitalize : function(str) { - str += ''; - return str.charAt(0).toUpperCase() + str.substring(1); - }, - - chop: function(str, step){ - str = str+''; - step = ~~step || str.length; - var arr = []; - for (var i = 0; i < str.length; i += step) - arr.push(str.slice(i,i + step)); - return arr; - }, - - clean: function(str){ - return _s.strip(str).replace(/\s+/g, ' '); - }, - - count: function(str, substr){ - str += ''; substr += ''; - return str.split(substr).length - 1; - }, - - chars: function(str) { - return (''+str).split(''); - }, - - escapeHTML: function(str) { - return (''+str).replace(/[&<>"']/g, function(match){ return '&' + reversedEscapeChars[match] + ';'; }); - }, - - unescapeHTML: function(str) { - return (''+str).replace(/\&([^;]+);/g, function(entity, entityCode){ - var match; - - if (entityCode in escapeChars) { - return escapeChars[entityCode]; - } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) { - return String.fromCharCode(parseInt(match[1], 16)); - } else if (match = entityCode.match(/^#(\d+)$/)) { - return String.fromCharCode(~~match[1]); - } else { - return entity; - } - }); - }, - - escapeRegExp: function(str){ - // From MooTools core 1.2.4 - return str.replace(/([-.*+?^${}()|[\]\/\\])/g, '\\$1'); - }, - - insert: function(str, i, substr){ - var arr = _s.chars(str); - arr.splice(~~i, 0, ''+substr); - return arr.join(''); - }, - - include: function(str, needle){ - return !!~(''+str).indexOf(needle); - }, - - join: function() { - var args = slice(arguments); - return args.join(args.shift()); - }, - - lines: function(str) { - return (''+str).split("\n"); - }, - - reverse: function(str){ - return _s.chars(str).reverse().join(''); - }, - - splice: function(str, i, howmany, substr){ - var arr = _s.chars(str); - arr.splice(~~i, ~~howmany, substr); - return arr.join(''); - }, - - startsWith: function(str, starts){ - str += ''; starts += ''; - return str.length >= starts.length && str.substring(0, starts.length) === starts; - }, - - endsWith: function(str, ends){ - str += ''; ends += ''; - return str.length >= ends.length && str.substring(str.length - ends.length) === ends; - }, - - succ: function(str){ - str += ''; - var arr = _s.chars(str); - arr.splice(str.length-1, 1, String.fromCharCode(str.charCodeAt(str.length-1) + 1)); - return arr.join(''); - }, - - titleize: function(str){ - return (''+str).replace(/\b./g, function(ch){ return ch.toUpperCase(); }); - }, - - camelize: function(str){ - return _s.trim(str).replace(/[-_\s]+(.)?/g, function(match, chr){ - return chr && chr.toUpperCase(); - }); - }, - - underscored: function(str){ - return _s.trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase(); - }, - - dasherize: function(str){ - return _s.trim(str).replace(/[_\s]+/g, '-').replace(/([A-Z])/g, '-$1').replace(/-+/g, '-').toLowerCase(); - }, - - classify: function(str){ - str += ''; - return _s.titleize(str.replace(/_/g, ' ')).replace(/\s/g, '') - }, - - humanize: function(str){ - return _s.capitalize(this.underscored(str).replace(/_id$/,'').replace(/_/g, ' ')); - }, - - trim: function(str, characters){ - str += ''; - if (!characters && nativeTrim) { return nativeTrim.call(str); } - characters = defaultToWhiteSpace(characters); - return str.replace(new RegExp('\^' + characters + '+|' + characters + '+$', 'g'), ''); - }, - - ltrim: function(str, characters){ - str+=''; - if (!characters && nativeTrimLeft) { - return nativeTrimLeft.call(str); - } - characters = defaultToWhiteSpace(characters); - return str.replace(new RegExp('^' + characters + '+'), ''); - }, - - rtrim: function(str, characters){ - str+=''; - if (!characters && nativeTrimRight) { - return nativeTrimRight.call(str); - } - characters = defaultToWhiteSpace(characters); - return str.replace(new RegExp(characters + '+$'), ''); - }, - - truncate: function(str, length, truncateStr){ - str += ''; truncateStr = truncateStr || '...'; - length = ~~length; - return str.length > length ? str.slice(0, length) + truncateStr : str; - }, - - /** - * _s.prune: a more elegant version of truncate - * prune extra chars, never leaving a half-chopped word. - * @author github.com/sergiokas - */ - prune: function(str, length, pruneStr){ - str += ''; length = ~~length; - pruneStr = pruneStr != null ? ''+pruneStr : '...'; - - var pruned, borderChar, template = str.replace(/\W/g, function(ch){ - return (ch.toUpperCase() !== ch.toLowerCase()) ? 'A' : ' '; - }); - - borderChar = template.charAt(length); - - pruned = template.slice(0, length); - - // Check if we're in the middle of a word - if (borderChar && borderChar.match(/\S/)) - pruned = pruned.replace(/\s\S+$/, ''); - - pruned = _s.rtrim(pruned); - - return (pruned+pruneStr).length > str.length ? str : str.substring(0, pruned.length)+pruneStr; - }, - - words: function(str, delimiter) { - return _s.trim(str, delimiter).split(delimiter || /\s+/); - }, - - pad: function(str, length, padStr, type) { - str += ''; - - var padlen = 0; - - length = ~~length; - - if (!padStr) { - padStr = ' '; - } else if (padStr.length > 1) { - padStr = padStr.charAt(0); - } - - switch(type) { - case 'right': - padlen = (length - str.length); - return str + strRepeat(padStr, padlen); - case 'both': - padlen = (length - str.length); - return strRepeat(padStr, Math.ceil(padlen/2)) + - str + - strRepeat(padStr, Math.floor(padlen/2)); - default: // 'left' - padlen = (length - str.length); - return strRepeat(padStr, padlen) + str; - } - }, - - lpad: function(str, length, padStr) { - return _s.pad(str, length, padStr); - }, - - rpad: function(str, length, padStr) { - return _s.pad(str, length, padStr, 'right'); - }, - - lrpad: function(str, length, padStr) { - return _s.pad(str, length, padStr, 'both'); - }, - - sprintf: sprintf, - - vsprintf: function(fmt, argv){ - argv.unshift(fmt); - return sprintf.apply(null, argv); - }, - - toNumber: function(str, decimals) { - str += ''; - var num = parseNumber(parseNumber(str).toFixed(~~decimals)); - return num === 0 && !str.match(/^0+$/) ? Number.NaN : num; - }, - - strRight: function(str, sep){ - str += ''; sep = sep != null ? ''+sep : sep; - var pos = !sep ? -1 : str.indexOf(sep); - return ~pos ? str.slice(pos+sep.length, str.length) : str; - }, - - strRightBack: function(str, sep){ - str += ''; sep = sep != null ? ''+sep : sep; - var pos = !sep ? -1 : str.lastIndexOf(sep); - return ~pos ? str.slice(pos+sep.length, str.length) : str; - }, - - strLeft: function(str, sep){ - str += ''; sep = sep != null ? ''+sep : sep; - var pos = !sep ? -1 : str.indexOf(sep); - return ~pos ? str.slice(0, pos) : str; - }, - - strLeftBack: function(str, sep){ - str += ''; sep = sep != null ? ''+sep : sep; - var pos = str.lastIndexOf(sep); - return ~pos ? str.slice(0, pos) : str; - }, - - toSentence: function(array, separator, lastSeparator) { - separator || (separator = ', '); - lastSeparator || (lastSeparator = ' and '); - var length = array.length, str = ''; - - for (var i = 0; i < length; i++) { - str += array[i]; - if (i === (length - 2)) { str += lastSeparator; } - else if (i < (length - 1)) { str += separator; } - } - - return str; - }, - - slugify: function(str) { - var from = "ąàáäâãćęèéëêìíïîłńòóöôõùúüûñçżź", - to = "aaaaaaceeeeeiiiilnooooouuuunczz", - regex = new RegExp(defaultToWhiteSpace(from), 'g'); - - str = (''+str).toLowerCase(); - - str = str.replace(regex, function(ch){ - var index = from.indexOf(ch); - return to.charAt(index) || '-'; - }); - - return _s.trim(str.replace(/[^\w\s-]/g, '').replace(/[-\s]+/g, '-'), '-'); - }, - - exports: function() { - var result = {}; - - for (var prop in this) { - if (!this.hasOwnProperty(prop) || ~_s.words('include contains reverse').indexOf(prop)) continue; - result[prop] = this[prop]; - } - - return result; - }, - - repeat: strRepeat - }; - - // Aliases - - _s.strip = _s.trim; - _s.lstrip = _s.ltrim; - _s.rstrip = _s.rtrim; - _s.center = _s.lrpad; - _s.rjust = _s.lpad; - _s.ljust = _s.rpad; - _s.contains = _s.include; - - // CommonJS module is defined - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - // Export module - module.exports = _s; - } - exports._s = _s; - - } else if (typeof define === 'function' && define.amd) { - // Register as a named module with AMD. - define('underscore.string', function() { - return _s; - }); - - } else { - // Integrate with Underscore.js if defined - // or create our own underscore object. - root._ = root._ || {}; - root._.string = root._.str = _s; - } - -}(this || window)); diff --git a/node_modules/underscore.string/package.json b/node_modules/underscore.string/package.json deleted file mode 100644 index 960b6f1..0000000 --- a/node_modules/underscore.string/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "underscore.string", - "version": "2.2.0rc", - "description": "String manipulation extensions for Underscore.js javascript library.", - "homepage": "http://epeli.github.com/underscore.string/", - "contributors": [ - { - "name": "Esa-Matti Suuronen", - "email": "esa-matti@suuronen.org", - "url": "http://esa-matti.suuronen.org/" - }, - { - "name": "Edward Tsech", - "email": "edtsech@gmail.com" - }, - { - "name": "Sasha Koss", - "email": "kossnocorp@gmail.com", - "url": "http://koss.nocorp.me/" - }, - { - "name": "Vladimir Dronnikov", - "email": "dronnikov@gmail.com" - }, - { - "name": "Pete Kruckenberg", - "email": "https://github.com/kruckenb", - "url": "" - }, - { - "name": "Paul Chavard", - "email": "paul@chavard.net", - "url": "" - }, - { - "name": "Ed Finkler", - "email": "coj@funkatron.com", - "url": "" - }, - { - "name": "Pavel Pravosud", - "email": "rwz@duckroll.ru" - } - ], - "keywords": [ - "underscore", - "string" - ], - "main": "./lib/underscore.string", - "directories": { - "lib": "./lib" - }, - "engines": { - "node": "*" - }, - "repository": { - "type": "git", - "url": "git://github.com/epeli/underscore.string.git" - }, - "bugs": { - "url": "https://github.com/epeli/underscore.string/issues" - }, - "licenses": [ - { - "type": "MIT" - } - ], - "_id": "underscore.string@2.2.0rc", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "28e7f390c98f3df5a4f560da3bff289d3f360671" - }, - "_from": "underscore.string" -} diff --git a/node_modules/underscore.string/test/run-qunit.js b/node_modules/underscore.string/test/run-qunit.js deleted file mode 100644 index 326658e..0000000 --- a/node_modules/underscore.string/test/run-qunit.js +++ /dev/null @@ -1,44 +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 page = new WebPage() - -page.onConsoleMessage = function(msg) { - console.log(msg) -} - -page.open(phantom.args[0], 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/underscore.string/test/speed.js b/node_modules/underscore.string/test/speed.js deleted file mode 100644 index 4346414..0000000 --- a/node_modules/underscore.string/test/speed.js +++ /dev/null @@ -1,138 +0,0 @@ -(function() { - - 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/underscore.string/test/strings.js b/node_modules/underscore.string/test/strings.js deleted file mode 100644 index f700abf..0000000 --- a/node_modules/underscore.string/test/strings.js +++ /dev/null @@ -1,438 +0,0 @@ -$(document).ready(function() { - - // Include Underscore.string methods to Underscore namespace - _.mixin(_.str.exports()); - - module("String extensions"); - - test("Strings: trim", function() { - equals(_.trim(123), "123", "Non string"); - equals(_(" foo").trim(), "foo"); - equals(_("foo ").trim(), "foo"); - equals(_(" foo ").trim(), "foo"); - equals(_(" foo ").trim(), "foo"); - equals(_(" foo ", " ").trim(), "foo", "Manually set whitespace"); - - equals(_("ffoo").trim("f"), "oo"); - equals(_("ooff").trim("f"), "oo"); - equals(_("ffooff").trim("f"), "oo"); - - - equals(_("_-foobar-_").trim("_-"), "foobar"); - - equals(_("http://foo/").trim("/"), "http://foo"); - equals(_("c:\\").trim('\\'), "c:"); - - equals(_(123).trim(), '123'); - equals(_(123).trim(3), '12'); - }); - - test("Strings: ltrim", function() { - equals(_(" foo").ltrim(), "foo"); - equals(_(" foo").ltrim(), "foo"); - equals(_("foo ").ltrim(), "foo "); - equals(_(" foo ").ltrim(), "foo "); - - - equals(_("ffoo").ltrim("f"), "oo"); - equals(_("ooff").ltrim("f"), "ooff"); - equals(_("ffooff").ltrim("f"), "ooff"); - - equals(_("_-foobar-_").ltrim("_-"), "foobar-_"); - - equals(_(123).ltrim(1), '23'); - }); - - test("Strings: rtrim", function() { - equals(_("http://foo/").rtrim("/"), "http://foo", 'clean trailing slash'); - equals(_(" foo").rtrim(), " foo"); - equals(_("foo ").rtrim(), "foo"); - equals(_("foo ").rtrim(), "foo"); - equals(_("foo bar ").rtrim(), "foo bar"); - equals(_(" foo ").rtrim(), " foo"); - - equals(_("ffoo").rtrim("f"), "ffoo"); - equals(_("ooff").rtrim("f"), "oo"); - equals(_("ffooff").rtrim("f"), "ffoo"); - - equals(_("_-foobar-_").rtrim("_-"), "_-foobar"); - - equals(_(123).rtrim(3), '12'); - }); - - test("Strings: capitalize", function() { - equals(_("fabio").capitalize(), "Fabio", 'First letter is upper case'); - equals(_.capitalize("fabio"), "Fabio", 'First letter is upper case'); - equals(_.capitalize('FOO'), 'FOO', 'Other letters unchanged'); - equals(_(123).capitalize(), "123", "Non string"); - }); - - test("Strings: join", function() { - equals(_.join("", "foo", "bar"), "foobar", 'basic join'); - equals(_.join("", 1, "foo", 2), "1foo2", 'join numbers and strings'); - equals(_.join(" ","foo", "bar"), "foo bar", 'join with spaces'); - equals(_.join("1", "2", "2"), "212", 'join number strings'); - equals(_.join(1, 2, 2), "212", 'join numbers'); - equals(_(" ").join("foo", "bar"), "foo bar", 'join object oriented'); - }); - - test("Strings: reverse", function() { - equals(_.str.reverse("foo"), "oof" ); - equals(_.str.reverse("foobar"), "raboof" ); - equals(_.str.reverse("foo bar"), "rab oof" ); - equals(_.str.reverse("saippuakauppias"), "saippuakauppias" ); - equals(_.str.reverse(123), "321", "Non string"); - equals(_.str.reverse(123.45), "54.321", "Non string"); - }); - - test("Strings: clean", function() { - equals(_(" foo bar ").clean(), "foo bar"); - equals(_(123).clean(), "123"); - }); - - test("Strings: sprintf", function() { - // Should be very tested function already. Thanks to - // http://www.diveintojavascript.com/projects/sprintf-for-javascript - equals(_.sprintf("Hello %s", "me"), "Hello me", 'basic'); - equals(_("Hello %s").sprintf("me"), "Hello me", 'object'); - equals(_("hello %s").chain().sprintf("me").capitalize().value(), "Hello me", 'Chaining works'); - equals(_.sprintf("%.1f", 1.22222), "1.2", 'round'); - equals(_.sprintf("%.1f", 1.17), "1.2", 'round 2'); - equals(_.sprintf("%(id)d - %(name)s", {id: 824, name: "Hello World"}), "824 - Hello World", 'Named replacements work'); - equals(_.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() { - equals(_.vsprintf("Hello %s", ["me"]), "Hello me", 'basic'); - equals(_("Hello %s").vsprintf(["me"]), "Hello me", 'object'); - equals(_("hello %s").chain().vsprintf(["me"]).capitalize().value(), "Hello me", 'Chaining works'); - equals(_.vsprintf("%.1f", [1.22222]), "1.2", 'round'); - equals(_.vsprintf("%.1f", [1.17]), "1.2", 'round 2'); - equals(_.vsprintf("%(id)d - %(name)s", [{id: 824, name: "Hello World"}]), "824 - Hello World", 'Named replacement works'); - equals(_.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'); - }); - - 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'); - }); - - 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'); - }); - - 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(){ - equals(_.clean(' foo bar '), 'foo bar'); - equals(_.clean(1), '1'); - }); - - test('String: count', function(){ - equals(_('Hello world').count('l'), 3); - equals(_('Hello world').count('Hello'), 1); - equals(_('Hello world').count('foo'), 0); - equals(_('x.xx....x.x').count('x'), 5); - equals(_(12345).count(1), 1); - equals(_(11345).count(1), 2); - }); - - test('String: insert', function(){ - equals(_('Hello ').insert(6, 'Jessy'), 'Hello Jessy'); - equals(_('Hello ').insert(100, 'Jessy'), 'Hello Jessy'); - equals(_(12345).insert(6, 'Jessy'), '12345Jessy'); - }); - - test('String: splice', function(){ - equals(_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'), - 'https://edtsech@bitbucket.org/epeli/underscore.strings'); - equals(_.splice(12345, 1, 2, 321), '132145', 'Non strings'); - }); - - test('String: succ', function(){ - equals(_('a').succ(), 'b'); - equals(_('A').succ(), 'B'); - equals(_('+').succ(), ','); - equals(_(1).succ(), '2'); - }); - - test('String: titleize', function(){ - equals(_('the titleize string method').titleize(), 'The Titleize String Method'); - equals(_('the titleize string method').titleize(), 'The Titleize String Method'); - equals(_(123).titleize(), '123'); - }); - - test('String: camelize', function(){ - equals(_('the_camelize_string_method').camelize(), 'theCamelizeStringMethod'); - equals(_('-the-camelize-string-method').camelize(), 'TheCamelizeStringMethod'); - equals(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); - equals(_(' the camelize string method').camelize(), 'theCamelizeStringMethod'); - equals(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); - equals(_(123).camelize(), '123'); - }); - - test('String: underscored', function(){ - equals(_('the-underscored-string-method').underscored(), 'the_underscored_string_method'); - equals(_('theUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); - equals(_('TheUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); - equals(_(' the underscored string method').underscored(), 'the_underscored_string_method'); - equals(_(123).underscored(), '123'); - }); - - test('String: dasherize', function(){ - equals(_('the_dasherize_string_method').dasherize(), 'the-dasherize-string-method'); - equals(_('TheDasherizeStringMethod').dasherize(), '-the-dasherize-string-method'); - equals(_('thisIsATest').dasherize(), 'this-is-a-test'); - equals(_('this Is A Test').dasherize(), 'this-is-a-test'); - equals(_('thisIsATest123').dasherize(), 'this-is-a-test123'); - equals(_('123thisIsATest').dasherize(), '123this-is-a-test'); - equals(_('the dasherize string method').dasherize(), 'the-dasherize-string-method'); - equals(_('the dasherize string method ').dasherize(), 'the-dasherize-string-method'); - equals(_('téléphone').dasherize(), 'téléphone'); - equals(_('foo$bar').dasherize(), 'foo$bar'); - equals(_(123).dasherize(), '123'); - }); - - test('String: camelize', function(){ - equals(_.camelize('-moz-transform'), 'MozTransform'); - equals(_.camelize('webkit-transform'), 'webkitTransform'); - equals(_.camelize('under_scored'), 'underScored'); - equals(_.camelize(' with spaces'), 'withSpaces'); - }); - - test('String: join', function(){ - equals(_.join(1, 2, 3, 4), '21314'); - equals(_.join('|', 'foo', 'bar', 'baz'), 'foo|bar|baz'); - }); - - test('String: classify', function(){ - equals(_.classify(1), '1'); - equals(_('some_class_name').classify(), 'SomeClassName'); - }); - - test('String: humanize', function(){ - equals(_('the_humanize_string_method').humanize(), 'The humanize string method'); - equals(_('ThehumanizeStringMethod').humanize(), 'Thehumanize string method'); - equals(_('the humanize string method').humanize(), 'The humanize string method'); - equals(_('the humanize_id string method_id').humanize(), 'The humanize id string method'); - equals(_('the humanize string method ').humanize(), 'The humanize string method'); - equals(_(' capitalize dash-CamelCase_underscore trim ').humanize(), 'Capitalize dash camel case underscore trim'); - equals(_(123).humanize(), '123'); - }); - - test('String: truncate', function(){ - equals(_('Hello world').truncate(6, 'read more'), 'Hello read more'); - equals(_('Hello world').truncate(5), 'Hello...'); - equals(_('Hello').truncate(10), 'Hello'); - equals(_(1234567890).truncate(5), '12345...'); - }); - - test('String: prune', function(){ - equals(_('Hello, cruel world').prune(6, ' read more'), 'Hello read more'); - equals(_('Hello, world').prune(5, 'read a lot more'), 'Hello, world'); - equals(_('Hello, world').prune(5), 'Hello...'); - equals(_('Hello, world').prune(8), 'Hello...'); - equals(_('Hello, cruel world').prune(15), 'Hello, cruel...'); - equals(_('Hello world').prune(22), 'Hello world'); - equals(_('Привет, жестокий мир').prune(6, ' read more'), 'Привет read more'); - equals(_('Привет, мир').prune(6, 'read a lot more'), 'Привет, мир'); - equals(_('Привет, мир').prune(6), 'Привет...'); - equals(_('Привет, мир').prune(8), 'Привет...'); - equals(_('Привет, жестокий мир').prune(16), 'Привет, жестокий...'); - equals(_('Привет, мир').prune(22), 'Привет, мир'); - equals(_(123).prune(10), '123'); - equals(_(123).prune(1,1), '11'); - }); - - test('String: isBlank', function(){ - ok(_('').isBlank()); - ok(_(' ').isBlank()); - ok(_('\n').isBlank()); - ok(!_('a').isBlank()); - ok(!_('0').isBlank()); - ok(!_(0).isBlank()); - }); - - test('String: escapeHTML', function(){ - equals(_('
    Blah & "blah" & \'blah\'
    ').escapeHTML(), - '<div>Blah & "blah" & 'blah'</div>'); - equals(_('<').escapeHTML(), '&lt;'); - equals(_(5).escapeHTML(), '5'); - // equals(_(undefined).escapeHTML(), ''); - }); - - test('String: unescapeHTML', function(){ - equals(_('<div>Blah & "blah" & 'blah'</div>').unescapeHTML(), - '
    Blah & "blah" & \'blah\'
    '); - equals(_('&lt;').unescapeHTML(), '<'); - equals(_(''').unescapeHTML(), "'"); - equals(_(''').unescapeHTML(), "'"); - equals(_('J').unescapeHTML(), "J"); - equals(_('J').unescapeHTML(), "J"); - equals(_('J').unescapeHTML(), "J"); - equals(_('&_#39;').unescapeHTML(), "&_#39;"); - equals(_(''_;').unescapeHTML(), "'_;"); - equals(_('&#38;').unescapeHTML(), "&"); - equals(_('&amp;').unescapeHTML(), "&"); - equals(_(5).unescapeHTML(), '5'); - // equals(_(undefined).unescapeHTML(), ''); - }); - - test('String: words', function() { - equals(_("I love you!").words().length, 3); - equals(_(" I love you! ").words().length, 3); - equals(_("I_love_you!").words('_').length, 3); - equals(_("I-love-you!").words(/-/).length, 3); - equals(_(123).words().length, 1); - }); - - test('String: chars', function() { - equals(_("Hello").chars().length, 5); - equals(_(123).chars().length, 3); - }); - - test('String: lines', function() { - equals(_("Hello\nWorld").lines().length, 2); - equals(_("Hello World").lines().length, 1); - equals(_(123).lines().length, 1); - }); - - test('String: pad', function() { - equals(_("1").pad(8), ' 1'); - equals(_(1).pad(8), ' 1'); - equals(_("1").pad(8, '0'), '00000001'); - equals(_("1").pad(8, '0', 'left'), '00000001'); - equals(_("1").pad(8, '0', 'right'), '10000000'); - equals(_("1").pad(8, '0', 'both'), '00001000'); - equals(_("foo").pad(8, '0', 'both'), '000foo00'); - equals(_("foo").pad(7, '0', 'both'), '00foo00'); - equals(_("foo").pad(7, '!@$%dofjrofj', 'both'), '!!foo!!'); - }); - - test('String: lpad', function() { - equals(_("1").lpad(8), ' 1'); - equals(_(1).lpad(8), ' 1'); - equals(_("1").lpad(8, '0'), '00000001'); - equals(_("1").lpad(8, '0', 'left'), '00000001'); - }); - - test('String: rpad', function() { - equals(_("1").rpad(8), '1 '); - equals(_(1).lpad(8), ' 1'); - equals(_("1").rpad(8, '0'), '10000000'); - equals(_("foo").rpad(8, '0'), 'foo00000'); - equals(_("foo").rpad(7, '0'), 'foo0000'); - }); - - test('String: lrpad', function() { - equals(_("1").lrpad(8), ' 1 '); - equals(_(1).lrpad(8), ' 1 '); - equals(_("1").lrpad(8, '0'), '00001000'); - equals(_("foo").lrpad(8, '0'), '000foo00'); - equals(_("foo").lrpad(7, '0'), '00foo00'); - equals(_("foo").lrpad(7, '!@$%dofjrofj'), '!!foo!!'); - }); - - test('String: toNumber', function() { - deepEqual(_("not a number").toNumber(), Number.NaN); - equals(_(0).toNumber(), 0); - equals(_("0").toNumber(), 0); - equals(_("0000").toNumber(), 0); - equals(_("2.345").toNumber(), 2); - equals(_("2.345").toNumber(NaN), 2); - equals(_("2.345").toNumber(2), 2.35); - equals(_("2.344").toNumber(2), 2.34); - equals(_("2").toNumber(2), 2.00); - equals(_(2).toNumber(2), 2.00); - equals(_(-2).toNumber(), -2); - equals(_("-2").toNumber(), -2); - }); - - test('String: strRight', function() { - equals(_("This_is_a_test_string").strRight("_"), "is_a_test_string"); - equals(_("This_is_a_test_string").strRight("string"), ""); - equals(_("This_is_a_test_string").strRight(), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strRight(""), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strRight("-"), "This_is_a_test_string"); - equals(_(12345).strRight(2), "345"); - }); - - test('String: strRightBack', function() { - equals(_("This_is_a_test_string").strRightBack("_"), "string"); - equals(_("This_is_a_test_string").strRightBack("string"), ""); - equals(_("This_is_a_test_string").strRightBack(), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strRightBack(""), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strRightBack("-"), "This_is_a_test_string"); - equals(_(12345).strRightBack(2), "345"); - }); - - test('String: strLeft', function() { - equals(_("This_is_a_test_string").strLeft("_"), "This"); - equals(_("This_is_a_test_string").strLeft("This"), ""); - equals(_("This_is_a_test_string").strLeft(), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strLeft(""), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strLeft("-"), "This_is_a_test_string"); - equals(_(123454321).strLeft(3), "12"); - }); - - test('String: strLeftBack', function() { - equals(_("This_is_a_test_string").strLeftBack("_"), "This_is_a_test"); - equals(_("This_is_a_test_string").strLeftBack("This"), ""); - equals(_("This_is_a_test_string").strLeftBack(), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strLeftBack(""), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strLeftBack("-"), "This_is_a_test_string"); - equals(_(123454321).strLeftBack(3), "123454"); - }); - - test('Strings: stripTags', function() { - equals(_('a link').stripTags(), 'a link'); - equals(_('a link - - - - - - - - -

    Underscore.string Test Suite

    -

    -

    -
      -
      -

      Underscore.string Speed Suite

      - -
      - - diff --git a/node_modules/underscore.string/test/test_standalone.html b/node_modules/underscore.string/test/test_standalone.html deleted file mode 100644 index 9854c17..0000000 --- a/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/underscore.string/test/test_underscore/arrays.js b/node_modules/underscore.string/test/test_underscore/arrays.js deleted file mode 100644 index b3b1ce1..0000000 --- a/node_modules/underscore.string/test/test_underscore/arrays.js +++ /dev/null @@ -1,166 +0,0 @@ -$(document).ready(function() { - - module("Arrays"); - - test("arrays: first", function() { - equals(_.first([1,2,3]), 1, 'can pull out the first element of an array'); - equals(_([1, 2, 3]).first(), 1, 'can perform OO-style "first()"'); - equals(_.first([1,2,3], 0).join(', '), "", 'can pass an index to first'); - equals(_.first([1,2,3], 2).join(', '), '1, 2', 'can pass an index to first'); - equals(_.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); - equals(result, 4, 'works on an arguments object.'); - result = _.map([[1,2,3],[1,2,3]], _.first); - equals(result.join(','), '1,1', 'works well with _.map'); - }); - - test("arrays: rest", function() { - var numbers = [1, 2, 3, 4]; - equals(_.rest(numbers).join(", "), "2, 3, 4", 'working rest()'); - equals(_.rest(numbers, 0).join(", "), "1, 2, 3, 4", 'working rest(0)'); - equals(_.rest(numbers, 2).join(', '), '3, 4', 'rest can take an index'); - var result = (function(){ return _(arguments).tail(); })(1, 2, 3, 4); - equals(result.join(', '), '2, 3, 4', 'aliased as tail and works on arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.rest); - equals(_.flatten(result).join(','), '2,3,2,3', 'works well with _.map'); - }); - - test("arrays: initial", function() { - equals(_.initial([1,2,3,4,5]).join(", "), "1, 2, 3, 4", 'working initial()'); - equals(_.initial([1,2,3,4],2).join(", "), "1, 2", 'initial can take an index'); - var result = (function(){ return _(arguments).initial(); })(1, 2, 3, 4); - equals(result.join(", "), "1, 2, 3", 'initial works on arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.initial); - equals(_.flatten(result).join(','), '1,2,1,2', 'initial works with _.map'); - }); - - test("arrays: last", function() { - equals(_.last([1,2,3]), 3, 'can pull out the last element of an array'); - equals(_.last([1,2,3], 0).join(', '), "", 'can pass an index to last'); - equals(_.last([1,2,3], 2).join(', '), '2, 3', 'can pass an index to last'); - equals(_.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); - equals(result, 4, 'works on an arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.last); - equals(result.join(','), '3,3', 'works well with _.map'); - }); - - test("arrays: compact", function() { - equals(_.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); - equals(result, 3, 'works on an arguments object'); - }); - - test("arrays: flatten", function() { - if (window.JSON) { - var list = [1, [2], [3, [[[4]]]]]; - equals(JSON.stringify(_.flatten(list)), '[1,2,3,4]', 'can flatten nested arrays'); - equals(JSON.stringify(_.flatten(list, true)), '[1,2,3,[[[4]]]]', 'can shallowly flatten nested arrays'); - var result = (function(){ return _.flatten(arguments); })(1, [2], [3, [[[4]]]]); - equals(JSON.stringify(result), '[1,2,3,4]', 'works on an arguments object'); - } - }); - - test("arrays: without", function() { - var list = [1, 2, 1, 0, 3, 1, 4]; - equals(_.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); - equals(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("arrays: uniq", function() { - var list = [1, 2, 1, 3, 1, 4]; - equals(_.uniq(list).join(', '), '1, 2, 3, 4', 'can find the unique values of an unsorted array'); - - var list = [1, 1, 1, 2, 2, 3]; - equals(_.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; }; - equals(_.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]; - equals(_.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); - equals(result.join(', '), '1, 2, 3, 4', 'works on an arguments object'); - }); - - test("arrays: intersection", function() { - var stooges = ['moe', 'curly', 'larry'], leaders = ['moe', 'groucho']; - equals(_.intersection(stooges, leaders).join(''), 'moe', 'can take the set intersection of two arrays'); - equals(_(stooges).intersection(leaders).join(''), 'moe', 'can perform an OO-style intersection'); - var result = (function(){ return _.intersection(arguments, leaders); })('moe', 'curly', 'larry'); - equals(result.join(''), 'moe', 'works on an arguments object'); - }); - - test("arrays: union", function() { - var result = _.union([1, 2, 3], [2, 30, 1], [1, 40]); - equals(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]]); - equals(result.join(' '), '1 2 3 30 40 1', 'takes the union of a list of nested arrays'); - }); - - test("arrays: difference", function() { - var result = _.difference([1, 2, 3], [2, 30, 40]); - equals(result.join(' '), '1 3', 'takes the difference of two arrays'); - - var result = _.difference([1, 2, 3, 4], [2, 30, 40], [1, 11, 111]); - equals(result.join(' '), '3 4', 'takes the difference of three arrays'); - }); - - test('arrays: zip', function() { - var names = ['moe', 'larry', 'curly'], ages = [30, 40, 50], leaders = [true]; - var stooges = _.zip(names, ages, leaders); - equals(String(stooges), 'moe,30,true,larry,40,,curly,50,', 'zipped together arrays of different lengths'); - }); - - test("arrays: indexOf", function() { - var numbers = [1, 2, 3]; - numbers.indexOf = null; - equals(_.indexOf(numbers, 2), 1, 'can compute indexOf, even without the native function'); - var result = (function(){ return _.indexOf(arguments, 2); })(1, 2, 3); - equals(result, 1, 'works on an arguments object'); - equals(_.indexOf(null, 2), -1, 'handles nulls properly'); - - var numbers = [10, 20, 30, 40, 50], num = 35; - var index = _.indexOf(numbers, num, true); - equals(index, -1, '35 is not in the list'); - - numbers = [10, 20, 30, 40, 50]; num = 40; - index = _.indexOf(numbers, num, true); - equals(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); - equals(index, 1, '40 is in the list'); - }); - - test("arrays: lastIndexOf", function() { - var numbers = [1, 0, 1, 0, 0, 1, 0, 0, 0]; - numbers.lastIndexOf = null; - equals(_.lastIndexOf(numbers, 1), 5, 'can compute lastIndexOf, even without the native function'); - equals(_.lastIndexOf(numbers, 0), 8, 'lastIndexOf the other element'); - var result = (function(){ return _.lastIndexOf(arguments, 1); })(1, 0, 1, 0, 0, 1, 0, 0, 0); - equals(result, 5, 'works on an arguments object'); - equals(_.indexOf(null, 2), -1, 'handles nulls properly'); - }); - - test("arrays: range", function() { - equals(_.range(0).join(''), '', 'range with 0 as a first argument generates an empty array'); - equals(_.range(4).join(' '), '0 1 2 3', 'range with a single positive argument generates an array of elements 0,1,2,...,n-1'); - equals(_.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'); - equals(_.range(8, 5).join(''), '', 'range with two arguments a & b, b<a generates an empty array'); - equals(_.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'); - equals(_.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'); - equals(_.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'); - equals(_.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/underscore.string/test/test_underscore/chaining.js b/node_modules/underscore.string/test/test_underscore/chaining.js deleted file mode 100644 index 0e3d5f3..0000000 --- a/node_modules/underscore.string/test/test_underscore/chaining.js +++ /dev/null @@ -1,59 +0,0 @@ -$(document).ready(function() { - - module("Chaining"); - - test("chaining: 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("chaining: 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(); - equals(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("chaining: 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(); - equals(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("chaining: 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(); - equals(numbers.join(', '), "34, 10, 8, 6, 4, 2, 10, 10", 'can chain together array functions.'); - }); - -}); diff --git a/node_modules/underscore.string/test/test_underscore/collections.js b/node_modules/underscore.string/test/test_underscore/collections.js deleted file mode 100644 index cff9763..0000000 --- a/node_modules/underscore.string/test/test_underscore/collections.js +++ /dev/null @@ -1,270 +0,0 @@ -$(document).ready(function() { - - module("Collections"); - - test("collections: each", function() { - _.each([1, 2, 3], function(num, i) { - equals(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}); - equals(answers.join(', '), '5, 10, 15', 'context object property accessed'); - - answers = []; - _.forEach([1, 2, 3], function(num){ answers.push(num); }); - equals(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); }); - equals(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; }); - equals(answers, 0, 'handles a null properly'); - }); - - test('collections: map', function() { - var doubled = _.map([1, 2, 3], function(num){ return num * 2; }); - equals(doubled.join(', '), '2, 4, 6', 'doubled numbers'); - - doubled = _.collect([1, 2, 3], function(num){ return num * 2; }); - equals(doubled.join(', '), '2, 4, 6', 'aliased as "collect"'); - - var tripled = _.map([1, 2, 3], function(num){ return num * this.multiplier; }, {multiplier : 3}); - equals(tripled.join(', '), '3, 6, 9', 'tripled numbers with context'); - - var doubled = _([1, 2, 3]).map(function(num){ return num * 2; }); - equals(doubled.join(', '), '2, 4, 6', 'OO-style doubled numbers'); - - var ids = _.map($('div.underscore-test').children(), function(n){ return n.id; }); - ok(_.include(ids, 'qunit-header'), 'can use collection methods on NodeLists'); - - 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'); - - var length = _.map(Array(2), function(v) { return v; }).length; - equals(length, 2, "can preserve a sparse array's length"); - }); - - test('collections: reduce', function() { - var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }, 0); - equals(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); - equals(sum, 18, 'can reduce with a context object'); - - sum = _.inject([1, 2, 3], function(sum, num){ return sum + num; }, 0); - equals(sum, 6, 'aliased as "inject"'); - - sum = _([1, 2, 3]).reduce(function(sum, num){ return sum + num; }, 0); - equals(sum, 6, 'OO-style reduce'); - - var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }); - equals(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'); - equals(_.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'); - - var sparseArray = []; - sparseArray[0] = 20; - sparseArray[2] = -5; - equals(_.reduce(sparseArray, function(a, b){ return a - b; }), 25, 'initially-sparse arrays with no memo'); - }); - - test('collections: reduceRight', function() { - var list = _.reduceRight(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); - equals(list, 'bazbarfoo', 'can perform right folds'); - - var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); - equals(list, 'bazbarfoo', 'aliased as "foldr"'); - - var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }); - equals(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'); - - ok(_.reduceRight(null, function(){}, 138) === 138, 'handles a null (with initial value) properly'); - - equals(_.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'); - - var sparseArray = []; - sparseArray[0] = 20; - sparseArray[2] = -5; - equals(_.reduceRight(sparseArray, function(a, b){ return a - b; }), -25, 'initially-sparse arrays with no memo'); - }); - - test('collections: detect', function() { - var result = _.detect([1, 2, 3], function(num){ return num * 2 == 4; }); - equals(result, 2, 'found the first "2" and broke the loop'); - }); - - test('collections: select', function() { - var evens = _.select([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equals(evens.join(', '), '2, 4, 6', 'selected each even number'); - - evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equals(evens.join(', '), '2, 4, 6', 'aliased as "filter"'); - }); - - test('collections: reject', function() { - var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equals(odds.join(', '), '1, 3, 5', 'rejected each even number'); - }); - - test('collections: 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(_.every([true, true, true], _.identity), 'aliased as "every"'); - }); - - test('collections: 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(_.some([false, false, true]), 'aliased as "some"'); - Array.prototype.some = nativeSome; - }); - - test('collections: 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('collections: invoke', function() { - var list = [[5, 1, 7], [3, 2, 1]]; - var result = _.invoke(list, 'sort'); - equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); - }); - - test('collections: invoke w/ function reference', function() { - var list = [[5, 1, 7], [3, 2, 1]]; - var result = _.invoke(list, Array.prototype.sort); - equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); - }); - - // Relevant when using ClojureScript - test('collections: 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"; - equals(s.call(), 42, "call function exists"); - var result = _.invoke(list, 'sort'); - equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); - delete String.prototype.call; - equals(s.call, undefined, "call function removed"); - }); - - test('collections: pluck', function() { - var people = [{name : 'moe', age : 30}, {name : 'curly', age : 50}]; - equals(_.pluck(people, 'name').join(', '), 'moe, curly', 'pulls names out of objects'); - }); - - test('collections: max', function() { - equals(3, _.max([1, 2, 3]), 'can perform a regular Math.max'); - - var neg = _.max([1, 2, 3], function(num){ return -num; }); - equals(neg, 1, 'can perform a computation-based max'); - - equals(-Infinity, _.max({}), 'Maximum value of an empty object'); - equals(-Infinity, _.max([]), 'Maximum value of an empty array'); - }); - - test('collections: min', function() { - equals(1, _.min([1, 2, 3]), 'can perform a regular Math.min'); - - var neg = _.min([1, 2, 3], function(num){ return -num; }); - equals(neg, 3, 'can perform a computation-based min'); - - equals(Infinity, _.min({}), 'Minimum value of an empty object'); - equals(Infinity, _.min([]), 'Minimum value of an empty array'); - }); - - test('collections: sortBy', function() { - var people = [{name : 'curly', age : 50}, {name : 'moe', age : 30}]; - people = _.sortBy(people, function(person){ return person.age; }); - equals(_.pluck(people, 'name').join(', '), 'moe, curly', 'stooges sorted by age'); - }); - - test('collections: 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'); - equals(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'); - equals(grouped['3'].join(' '), 'one two six ten'); - equals(grouped['4'].join(' '), 'four five nine'); - equals(grouped['5'].join(' '), 'three seven eight'); - }); - - test('collections: sortedIndex', function() { - var numbers = [10, 20, 30, 40, 50], num = 35; - var index = _.sortedIndex(numbers, num); - equals(index, 3, '35 should be inserted at index 3'); - }); - - test('collections: shuffle', function() { - var numbers = _.range(10); - var shuffled = _.shuffle(numbers).sort(); - notStrictEqual(numbers, shuffled, 'original object is unmodified'); - equals(shuffled.join(','), numbers.join(','), 'contains the same members before and after shuffle'); - }); - - test('collections: 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'); - equals(_.toArray(a).join(', '), '1, 2, 3', 'cloned array contains same elements'); - - var numbers = _.toArray({one : 1, two : 2, three : 3}); - equals(numbers.join(', '), '1, 2, 3', 'object flattened into array'); - }); - - test('collections: size', function() { - equals(_.size({one : 1, two : 2, three : 3}), 3, 'can compute the size of an object'); - }); - -}); diff --git a/node_modules/underscore.string/test/test_underscore/functions.js b/node_modules/underscore.string/test/test_underscore/functions.js deleted file mode 100644 index 78721af..0000000 --- a/node_modules/underscore.string/test/test_underscore/functions.js +++ /dev/null @@ -1,198 +0,0 @@ -$(document).ready(function() { - - module("Functions"); - - test("functions: bind", function() { - var context = {name : 'moe'}; - var func = function(arg) { return "name: " + (this.name || arg); }; - var bound = _.bind(func, context); - equals(bound(), 'name: moe', 'can bind a function to a context'); - - bound = _(func).bind(context); - equals(bound(), 'name: moe', 'can do OO-style binding'); - - bound = _.bind(func, null, 'curly'); - equals(bound(), 'name: curly', 'can bind without specifying a context'); - - func = function(salutation, name) { return salutation + ': ' + name; }; - func = _.bind(func, this, 'hello'); - equals(func('moe'), 'hello: moe', 'the function was partially applied in advance'); - - var func = _.bind(func, this, 'curly'); - equals(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'); - equals(func(), 'hello: moe curly', 'the function was partially applied in advance and can accept multiple arguments'); - - func = function(context, message) { equals(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("functions: 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; - equals(curly.getName(), 'name: curly', 'unbound function is bound to current object'); - equals(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; - equals(curly.sayHi(), 'hi: moe', 'calling bindAll with no arguments binds all functions to the object'); - }); - - test("functions: memoize", function() { - var fib = function(n) { - return n < 2 ? n : fib(n - 1) + fib(n - 2); - }; - var fastFib = _.memoize(fib); - equals(fib(10), 55, 'a memoized version of fibonacci produces identical results'); - equals(fastFib(10), 55, 'a memoized version of fibonacci produces identical results'); - - var o = function(str) { - return str; - }; - var fastO = _.memoize(o); - equals(o('toString'), 'toString', 'checks hasOwnProperty'); - equals(fastO('toString'), 'toString', 'checks hasOwnProperty'); - }); - - asyncTest("functions: 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("functions: defer", 1, function() { - var deferred = false; - _.defer(function(bool){ deferred = bool; }, true); - _.delay(function(){ ok(deferred, "deferred the function"); start(); }, 50); - }); - - asyncTest("functions: 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(){ ok(counter == 1, "incr was called immediately"); }, 30); - _.delay(function(){ ok(counter == 4, "incr was throttled"); start(); }, 400); - }); - - asyncTest("functions: 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(){ equals(value, 1, "updated to latest value"); }, 40); - _.delay(function(){ equals(value, 6, "updated to latest value"); start(); }, 400); - }); - - asyncTest("functions: throttle once", 1, function() { - var counter = 0; - var incr = function(){ counter++; }; - var throttledIncr = _.throttle(incr, 100); - throttledIncr(); - _.delay(function(){ ok(counter == 1, "incr was called once"); start(); }, 220); - }); - - asyncTest("functions: throttle twice", 1, function() { - var counter = 0; - var incr = function(){ counter++; }; - var throttledIncr = _.throttle(incr, 100); - throttledIncr(); throttledIncr(); - _.delay(function(){ ok(counter == 2, "incr was called twice"); start(); }, 220); - }); - - asyncTest("functions: 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(){ ok(counter == 1, "incr was debounced"); start(); }, 220); - }); - - test("functions: once", function() { - var num = 0; - var increment = _.once(function(){ num++; }); - increment(); - increment(); - equals(num, 1); - }); - - test("functions: wrap", function() { - var greet = function(name){ return "hi: " + name; }; - var backwards = _.wrap(greet, function(func, name){ return func(name) + ' ' + name.split('').reverse().join(''); }); - equals(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; }); - equals(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'); - same(ret, [noop, ['whats', 'your'], 'vector', 'victor']); - }); - - test("functions: compose", function() { - var greet = function(name){ return "hi: " + name; }; - var exclaim = function(sentence){ return sentence + '!'; }; - var composed = _.compose(exclaim, greet); - equals(composed('moe'), 'hi: moe!', 'can compose a function that takes another'); - - composed = _.compose(greet, exclaim); - equals(composed('moe'), 'hi: moe!', 'in this case, the functions are also commutative'); - }); - - test("functions: after", function() { - var testAfter = function(afterAmount, timesCalled) { - var afterCalled = 0; - var after = _.after(afterAmount, function() { - afterCalled++; - }); - while (timesCalled--) after(); - return afterCalled; - }; - - equals(testAfter(5, 5), 1, "after(N) should fire after being called N times"); - equals(testAfter(5, 4), 0, "after(N) should not fire unless called N times"); - equals(testAfter(0, 0), 1, "after(0) should fire immediately"); - }); - -}); diff --git a/node_modules/underscore.string/test/test_underscore/objects.js b/node_modules/underscore.string/test/test_underscore/objects.js deleted file mode 100644 index 0105d60..0000000 --- a/node_modules/underscore.string/test/test_underscore/objects.js +++ /dev/null @@ -1,535 +0,0 @@ -$(document).ready(function() { - - module("Objects"); - - test("objects: keys", function() { - var exception = /object/; - equals(_.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; - equals(_.keys(a).join(', '), '1', 'is not fooled by sparse arrays; see issue #95'); - raises(function() { _.keys(null); }, exception, 'throws an error for `null` values'); - raises(function() { _.keys(void 0); }, exception, 'throws an error for `undefined` values'); - raises(function() { _.keys(1); }, exception, 'throws an error for number primitives'); - raises(function() { _.keys('a'); }, exception, 'throws an error for string primitives'); - raises(function() { _.keys(true); }, exception, 'throws an error for boolean primitives'); - }); - - test("objects: values", function() { - equals(_.values({one : 1, two : 2}).join(', '), '1, 2', 'can extract the values from an object'); - }); - - test("objects: 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(){}; - equals(_.functions(new Animal).join(''), 'run', 'also looks up functions on the prototype'); - }); - - test("objects: extend", function() { - var result; - equals(_.extend({}, {a:'b'}).a, 'b', 'can extend an object with the attributes of another'); - equals(_.extend({a:'x'}, {a:'b'}).a, 'b', 'properties in source override destination'); - equals(_.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}); - equals(_.keys(result).join(''), 'ab', 'extend does not copy undefined values'); - }); - - test("objects: defaults", function() { - var result; - var options = {zero: 0, one: 1, empty: "", nan: NaN, string: "string"}; - - _.defaults(options, {zero: 1, one: 10, twenty: 20}); - equals(options.zero, 0, 'value exists'); - equals(options.one, 1, 'value exists'); - equals(options.twenty, 20, 'default applied'); - - _.defaults(options, {empty: "full"}, {nan: "nan"}, {word: "word"}, {word: "dog"}); - equals(options.empty, "", 'value exists'); - ok(_.isNaN(options.nan), "NaN isn't overridden"); - equals(options.word, "word", 'new value is added, first one wins'); - }); - - test("objects: clone", function() { - var moe = {name : 'moe', lucky : [13, 27, 34]}; - var clone = _.clone(moe); - equals(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); - equals(_.last(moe.lucky), 101, 'changes to deep attributes are shared with the original'); - - equals(_.clone(undefined), void 0, 'non objects should not be changed by clone'); - equals(_.clone(1), 1, 'non objects should not be changed by clone'); - equals(_.clone(null), null, 'non objects should not be changed by clone'); - }); - - test("objects: 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"); - - // According to the Microsoft deviations spec, section 2.1.26, JScript 5.x treats `undefined` - // elements in arrays as elisions. Thus, sparse arrays and dense arrays containing `undefined` - // values are equivalent. - if (0 in [undefined]) { - ok(!_.isEqual(Array(3), [undefined, undefined, undefined]), "Sparse and dense arrays are not equal"); - ok(!_.isEqual([undefined, undefined, undefined], Array(3)), "Commutative equality is implemented for sparse and dense arrays"); - } - - // 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"); - - // 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"); - - // 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'); - equals(_({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'); - - // Custom `isEqual` methods - comparing different types - LocalizedString = (function() { - function LocalizedString(id) { this.id = id; this.string = (this.id===10)? 'Bonjour': ''; } - LocalizedString.prototype.isEqual = function(that) { - if (_.isString(that)) return this.string == that; - else if (that instanceof LocalizedString) return this.id == that.id; - return false; - }; - return LocalizedString; - })(); - var localized_string1 = new LocalizedString(10), localized_string2 = new LocalizedString(10), localized_string3 = new LocalizedString(11); - ok(_.isEqual(localized_string1, localized_string2), 'comparing same typed instances with same ids'); - ok(!_.isEqual(localized_string1, localized_string3), 'comparing same typed instances with different ids'); - ok(_.isEqual(localized_string1, 'Bonjour'), 'comparing different typed instances with same values'); - ok(_.isEqual('Bonjour', localized_string1), 'comparing different typed instances with same values'); - ok(!_.isEqual('Bonjour', localized_string3), 'comparing two localized strings with different ids'); - ok(!_.isEqual(localized_string1, 'Au revoir'), 'comparing different typed instances with different values'); - ok(!_.isEqual('Au revoir', localized_string1), 'comparing different typed instances with different values'); - - // Custom `isEqual` methods - comparing with serialized data - Date.prototype.toJSON = function() { - return { - _type:'Date', - year:this.getUTCFullYear(), - month:this.getUTCMonth(), - day:this.getUTCDate(), - hours:this.getUTCHours(), - minutes:this.getUTCMinutes(), - seconds:this.getUTCSeconds() - }; - }; - Date.prototype.isEqual = function(that) { - var this_date_components = this.toJSON(); - var that_date_components = (that instanceof Date) ? that.toJSON() : that; - delete this_date_components['_type']; delete that_date_components['_type'] - return _.isEqual(this_date_components, that_date_components); - }; - - var date = new Date(); - var date_json = { - _type:'Date', - year:date.getUTCFullYear(), - month:date.getUTCMonth(), - day:date.getUTCDate(), - hours:date.getUTCHours(), - minutes:date.getUTCMinutes(), - seconds:date.getUTCSeconds() - }; - - ok(_.isEqual(date_json, date), 'serialized date matches date'); - ok(_.isEqual(date, date_json), 'date matches serialized date'); - }); - - test("objects: 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("objects: 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("objects: 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("objects: 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("objects: 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("objects: 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("objects: 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("objects: 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("objects: 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("objects: 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("objects: isRegExp", function() { - ok(!_.isRegExp(_.identity), 'functions are not RegExps'); - ok(_.isRegExp(/identity/), 'but RegExps are'); - ok(_.isRegExp(iRegExp), 'even from another frame'); - }); - - test("objects: 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'); - }); - - test("objects: 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("objects: 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("objects: 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("objects: tap", function() { - var intercepted = null; - var interceptor = function(obj) { intercepted = obj; }; - var returned = _.tap(1, interceptor); - equals(intercepted, 1, "passes tapped object to interceptor"); - equals(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/underscore.string/test/test_underscore/speed.js b/node_modules/underscore.string/test/test_underscore/speed.js deleted file mode 100644 index 86663a2..0000000 --- a/node_modules/underscore.string/test/test_underscore/speed.js +++ /dev/null @@ -1,70 +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(); }); - - 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('_.intersect()', function() { - return _.intersect(numbers, randomized); - }); - - JSLitmus.test('_.range()', function() { - return _.range(1000); - }); - -})(); \ No newline at end of file diff --git a/node_modules/underscore.string/test/test_underscore/temp.js b/node_modules/underscore.string/test/test_underscore/temp.js deleted file mode 100644 index 68c39dc..0000000 --- a/node_modules/underscore.string/test/test_underscore/temp.js +++ /dev/null @@ -1,27 +0,0 @@ -(function() { - - var func = function(){}; - var date = new Date(); - var str = "a string"; - 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(); }); - - JSLitmus.test('_.isNumber', function() { - return _.isNumber(1000) - }); - - JSLitmus.test('_.newIsNumber', function() { - return _.newIsNumber(1000) - }); - - JSLitmus.test('_.isNumber(NaN)', function() { - return _.isNumber(NaN) - }); - - JSLitmus.test('_.newIsNumber(NaN)', function() { - return _.newIsNumber(NaN) - }); - -})(); \ No newline at end of file diff --git a/node_modules/underscore.string/test/test_underscore/temp_tests.html b/node_modules/underscore.string/test/test_underscore/temp_tests.html deleted file mode 100644 index bd34f9d..0000000 --- a/node_modules/underscore.string/test/test_underscore/temp_tests.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - Underscore Temporary Tests - - - - - - - -

        Underscore Temporary Tests

        -

        - A page for temporary speed tests, used for developing faster implementations - of existing Underscore methods. -

        -
        - - diff --git a/node_modules/underscore.string/test/test_underscore/test.html b/node_modules/underscore.string/test/test_underscore/test.html deleted file mode 100644 index 77f2f3a..0000000 --- a/node_modules/underscore.string/test/test_underscore/test.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - Underscore Test Suite - - - - - - - - - - - - - - - -
        -

        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 'intersect' test measures the number of times you can - find the intersection of two thousand-element arrays in one second. -

          -
          - - -
          - - diff --git a/node_modules/underscore.string/test/test_underscore/utility.js b/node_modules/underscore.string/test/test_underscore/utility.js deleted file mode 100644 index 7bc5cb4..0000000 --- a/node_modules/underscore.string/test/test_underscore/utility.js +++ /dev/null @@ -1,155 +0,0 @@ -$(document).ready(function() { - - module("Utility"); - - test("utility: noConflict", function() { - var underscore = _.noConflict(); - ok(underscore.isUndefined(_), "The '_' variable has been returned to its previous state."); - var intersection = underscore.intersect([-1, 0, 1, 2], [1, 2, 3, 4]); - equals(intersection.join(', '), '1, 2', 'but the intersection function still works'); - window._ = underscore; - }); - - test("utility: identity", function() { - var moe = {name : 'moe'}; - equals(_.identity(moe), moe, 'moe is the same as his identity'); - }); - - test("utility: uniqueId", function() { - var ids = [], i = 0; - while(i++ < 100) ids.push(_.uniqueId()); - equals(_.uniq(ids).length, ids.length, 'can generate a globally-unique stream of ids'); - }); - - test("utility: 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("utility: mixin", function() { - _.mixin({ - myReverse: function(string) { - return string.split('').reverse().join(''); - } - }); - equals(_.myReverse('panacea'), 'aecanap', 'mixed in a function to _'); - equals(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper'); - }); - - test("utility: _.escape", function() { - equals(_.escape("Curly & Moe"), "Curly & Moe"); - equals(_.escape("Curly & Moe"), "Curly &amp; Moe"); - }); - - test("utility: template", function() { - var basicTemplate = _.template("<%= thing %> is gettin' on my noives!"); - var result = basicTemplate({thing : 'This'}); - equals(result, "This is gettin' on my noives!", 'can do basic attribute interpolation'); - - var sansSemicolonTemplate = _.template("A <% this %> B"); - equals(sansSemicolonTemplate(), "A B"); - - var backslashTemplate = _.template("<%= thing %> is \\ridanculous"); - equals(backslashTemplate({thing: 'This'}), "This is \\ridanculous"); - - var escapeTemplate = _.template('<%= a ? "checked=\\"checked\\"" : "" %>'); - equals(escapeTemplate({a: true}), 'checked="checked"', 'can handle slash escapes in interpolations.'); - - var fancyTemplate = _.template("
            <% \ - for (key in people) { \ - %>
          • <%= people[key] %>
          • <% } %>
          "); - result = fancyTemplate({people : {moe : "Moe", larry : "Larry", curly : "Curly"}}); - equals(result, "
          • Moe
          • Larry
          • Curly
          ", 'can run arbitrary javascript in templates'); - - var escapedCharsInJavascriptTemplate = _.template("
            <% _.each(numbers.split('\\n'), function(item) { %>
          • <%= item %>
          • <% }) %>
          "); - result = escapedCharsInJavascriptTemplate({numbers: "one\ntwo\nthree\nfour"}); - equals(result, "
          • one
          • two
          • three
          • four
          ", '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" - } - }); - equals(result, "3 p3-thumbnail.gif
          "); - - var noInterpolateTemplate = _.template("

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

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

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

          "); - - var quoteTemplate = _.template("It's its, not it's"); - equals(quoteTemplate({}), "It's its, not it's"); - - var quoteInStatementAndBody = _.template("<%\ - if(foo == 'bar'){ \ - %>Statement quotes and 'quotes'.<% } %>"); - equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'."); - - var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.'); - equals(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.'); - - var template = _.template("<%- value %>"); - var result = template({value: " - - - diff --git a/node_modules/underscore/index.js b/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5..0000000 --- a/node_modules/underscore/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./underscore'); diff --git a/node_modules/underscore/package.json b/node_modules/underscore/package.json deleted file mode 100644 index e113582..0000000 --- a/node_modules/underscore/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "underscore", - "description": "JavaScript's functional programming helper library.", - "homepage": "http://documentcloud.github.com/underscore/", - "keywords": [ - "util", - "functional", - "server", - "client", - "browser" - ], - "author": { - "name": "Jeremy Ashkenas", - "email": "jeremy@documentcloud.org" - }, - "repository": { - "type": "git", - "url": "git://github.com/documentcloud/underscore.git" - }, - "main": "underscore.js", - "version": "1.3.3", - "_id": "underscore@1.3.3", - "dependencies": {}, - "devDependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "8932e6126a146bfccc3023821bec3aa643d83167" - }, - "_from": "underscore" -} diff --git a/node_modules/underscore/raw/underscore.psd b/node_modules/underscore/raw/underscore.psd deleted file mode 100644 index 73ad2d7c8eebce69b4f46f31c0a1a8c2d523bc0d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 215540 zcmeEv2Vfk<)&EFxuQDY-0^vdu0*UQgow{+6EV+SY3(H`@6rZKFbog|4xjVVQ-v~lN zk}nBP`4W;)6d<%vOec^Kk@AIn3E(fGLx@tS24kAst^NPrY@NN`y=GIAm3_CjGxKKN zym{}TM~>t?sMu@a{KmEkgnv664HQH*}$uj9zN*$Y~ReU{&p^KZ)+&-)A|%>Lf= zS?dzv_SJGauu|@f#AY0`?HB#W1R@gL zs-}jfhNiSjHI;$t%Bhvrp_)+DVi^juu_^*Q8!Jho>o;6(Eg5@IR?L`Cp%V6 zThcsNYY=xcj_FFL6VrmhwQJW-U0XRdp6m=()YsPsrBE;wnt~EjQtM;s@VY6n)Th-- z^m>}*RC_X#NJrwa0M#2_8ShEYIOZ5?$oSKG)}1gKilwIVUQTU~cL&#n6Tyn9QqZUw zfYU*hX-!EvoQ@}##^ceMYTsMC;^}y*E1n26wN(XL!tIe5-A@nNi<|A6HObB4v^+B; zRfMKU6;q_Dr4_Z)K%!9n6i`W$ES0DwZFRI@G&;iRu)UU03UNF-+NZ6G zC%ePxnc+kt8fg#HkO$YqI<$dI=p!>dXcpbySYwo1S`5S;nW(!v=)`=f^qe)|OO4MR zAyZ4&C*d?tR9jP1Db;h%5H)PT zg5e`LE!<9gH?y5IgWNGaD5RQb*})D#J7Sg6v=9s_)p+tpY=4YcR!gD?t!Ot? zKjI^%&TgW8p<7xudt|?v&FRQ0bG0N`k(86UilNkLFrYA@bAx$i#q?lCnmGwf=Xs}* zAr$T5h7K%B`~@rMTLZOb+d)tF2DN6}K~2b0Vv+RBkk*^#cV5(~- zhpKDwsl%s!G8UwhL$y`-Ag!)ya&@JIPX&G>y{>X{sJ>=$rBpGwvZ4;3`pMNHd@4go zLp`+;J}6sD_tnV9r?RRtbV5yIZH-h@U0Yi}x4Jqsx30daR%#AaG}q6muWqiag0;=5 zC}5_cz2EpiUKerU1Io$d14^CN8d)btPiv0A%ukUKTUlQ-J?NNYp|Y8Ox(Qi>PC91T z0h{8{c(M(C33+Bsb#-O624+dNLkMK6tf{N1np`E-*GT*uLseT5QolnyMg6WsdUb_b zrfM=l)$(r)D~1dy_(n=qUA4r&F{Jp70mV01ptceWLfFi}-S6>{kt*y3AFspY@x=(`?x;+vPLug34%5T)0G;qVQ%tg5I-o%Btx z^>qYWUq@x?>!?h9Jug#V!GBY2^}M$FdTOzr*I7@Pz`am28LT@Q>^`|>a_!{0$@P;# znu?0a6`{!$m6I!~CWDnxsG@c<_&$WPkOl|?e{)rbF{$}Mr?mGy0NTxUOOAvnJjN)P2=3w67P^_R!$E(C3_;R z$}Id0`_F$z>ym_pMJZZ~EABeRA0d;(hCr%bPy7T%TMvf_UHhyyiyKDJz+TsDGu-}>b8rjISxCzp*N z-nTxvyy;`h^~q%;i1)2eE^qqSa(!~y2;zO~lgpbvwp^cFHiCHH`sDJak1f|HmyICa zw?4VN>0`_F$z>ym_pK+n#+c_%$T1u`u@&WPx4yd<@clcH@-?Z)aTR_GR7DuYLxJ@gS^yy7F@Lo zIZ=F%;3*|q%GE#mv5^wum7Rfay-YPvnPR5!I(Oopu>@m^<6qgUlD}&(wO>0{iO3pCh?M^cnVPwX{8P7M;nnEq%w9RK3YEA z#(JVrTsYjR$y6*Fk9FdnpJ*b-!Yfze>nC|d8F_p%R&5p)ev{EB^e<~@pl(;Ap=P{IL!+G?oWVl;y zOUsGHE6;65zIHT=)=eTc^+Zn6xgc6ghahomha8IoQ!}~rG%CxhTS7+##CujY%tVs< zH!O{(uySvLfLxjw)zJfF@Hkh_wH=mluWiiQcyjfE*wX!l-B_w`aZft03cV0y3!7qT z3%gA0jK)`nqf3)G`eq>xfjBj~Fr|{1jqVDkTH-_+&V-yFs(9X9d}s0lmm?cL9Fppi zWsZF`5|bD6b7oR{8@$F(@*0W5RGIoX{VLs#FOrGOR_I)xQ7gkKc@Y?G>73J+;(j`cac5<=35I6vY;hFAb*+?+P5T|Kh{ z_v6Do>G(W3MiL`;Ac4_Y8(QHpYGF#DoCV#T0bCAr|I2XRj7E5ibc-o1sZM=x)G{N& z(e%=Ar%-A_yBv)!mDi;gq~-zFpVgU%%CoU_ z&K1${C-@wRpMPhp>O!QCW{0y9ZB$Tae96y@roTe65s=Uc2 z@H^H4C_p^VzRbpr8Z~P4sBxo5kDD}h%-BhXP8>IG;-QBheDI+MAAI@d4j~NSdNz5!^rDb|%IV%}fQdT;wboj^-qlTA_t3>9c zvSFV(sA72I$>D>K`Qk;P5r=%|>N{qC`ZI?v`Sr@ms^pjc+%)pD-)(#AA8)s(sy}wk zofjY5{Jo_ebAEGey5_LIobpfkox8sL+sAwU_3qry{r6A5a`*Rt_r#0uU3bs_Jo(b# zsjJpp@`LN|{ryufZ?B!VtaI&GFT3Hsho63B$0Sx-3T%gQoJNiqUd>VXRK-EVfWa4! zIe2*JqVF6+82oz4pWmwd%*uZxzx3UvwnN)fRd0WG1R*f;*y`W>1xQ?bSjU`GYSQvQ z4HVol_?(G?@*Epi#@n34X0bPab$$I~yYKtjD|Pq(?)lID?t6Q;_FwVhll24dK7ah> zm;U+jimydqJ9h8Dnt|`$I(Ys~@BMA#m(HtQ`o|k4R*w18MYrv^_nO_`y7$?Q-(UQ* zQuPLl*V|x6>mkpk9opJgP7EL_$7oSM?`(Gcr?ZuY|1~=Zg?1>}pI^p242Os^J zjn}sSD0cp{mn|Ist4q(SS@xZ~h92MZ_AUE9d;C#uc<_x<~({b|95 zC-3;pmiYgySupcfg{^w<`=@X0?!V={^`HFy51xJXy1};B4{P}KtKAPjvSr;5cRc-_ zAD+{4-%}6Yo4oVv7oME4XWt{qOIDxt#M`@HdFt4wcHc2^!Cez?xV-F#dycsGjVr#{ zKl}HgKmP2VH?R3+yltTK>eqX#yXOxsn|oC4(Ra~T>t5(T@6TI)e)xuYudn&!)Si|*p+a z_HpU?HN6YFZ@K0tZ@qrUuP2O)&)oLt;wN{<7jNlX{?;82d}Z7puY2%>V}JkjifSI#^5sV((CKjP3OV{g9utkduK^7%J>?74Hc|9I2( zJr_K>JAKGyKihZped&RlADpqh{mK9S)A(Ie&cCvI-OnGr=?9_9-$>oMXVIMd>z>$f z!$5b>?j61J-@9c_{K=zlj*hGT`yH2^`uFWG-hTi6pSb9S`*%H>c;v2K7hI>XpY9#} z#>Ta$J@ncOV>b<+_~u=2^qjNti65SJ&bJ>q^Wx<W+P9-~Z&DSKaj0_S+J-U4PdxHyrlh!>d={Qa!Ze{(&Dp@!kL1^M&(v zoW6O}^iNFdT-dYj$?%&qzklDf2kzSRhev)oV)xMHp^8_p`No51%<8-E@xd9h=AYGh z!#_5h^_#nHeJ{G^A6JC_6nguPhi^FLnXPHL=8Opvwwaj@xYFg zUt3o*^RXYzt^U~V_}$OH+VRZm&+R?;%Jy3xxc>BwryOzgs)0KJO@0{0W zEPws%-mR0*xO3mQ$-$GJjBWkJty`9FSJ?9QlV{%c^f~kI`rMYMe*aWO;~yS6|BR=` zela>@d))(nz2Xb~r~K(24A6ap3vcdS@ZaA(a?w}L+4;-6ev*Er^M%JRcxvy7iTtykT5>jRJe?S`9v@x)($@v~?C_yXVwxd++R{&OZCo|9I)qr(<&$ov`oBzMbdZdCPrI zC~U%IO^^NNq1Wo`k9hj&Z!~O~(RlsyS3UR4=tuwf-1r}S?5@Awwfk4|p4{>BzvTD6 za7W+Zm)`jC;ZKKuKJ8DD4fkxgZ|m0Iy|CpU_f5F@>^;f;d5dq@{kh#k-#xKc`M>uj zUv=GJZ0D*|Pd)TkKl<~%&$iwB^Yt_S_Vh6qyzpv!;}aFVTem3eoz;&dXTALNb5mc~ zzV&a{zC3gD!T101=TdT0`XPx%dx^73hy9C!5F zPb%!izwEpJ|6cCxTKT`*USFoL@11>?!rG7C(W@}|FABS3u! z<$GUL*#9g$ta>PR^uK0azNc-=vkJRs-8tJ|I%n5s7C(RGgwE}kOy0ShuzLEk-e(@( zH=wX*(?(Ti9(muc|5ez3-8Oag-oMWJ{f5RD*8ZgA!F}_}N1T7(CvJZH-fh?4JmH?f zx^uRFr|aDd~f&ak6*HE!<1;>i+B8EUH`s|dtZKDVI83L?eV?O z_rCGtQzpE0_OE^oG#(v1w{!b#hg_wwuA3Eh;;{<5qW{zd6J{(MG55lK*WC2y1w+tY%=(v6mV3+_?7m!R-_8{^Wy$^WS~qy!BW0wk#fMS+?cq)6Q$ZIsDp&&g1{PZq`{qUE)Mo)U5sU7O>-`?{1uO>I1vtsv-`CEEV zePHdP*ijG0Crr?*l;EvXTCC~qD?-iHNIChpC-SG73cW!#CXK3T!ZuwWwrk^c6 z=#hm(eJ9`j_3mX$UU+QgQ?EXJ{uRG$*K6;3ruW@XZ~ft(S?6vWT>bnn-uTW5&)>IZ z;HA&DzIn>)Zyc>WtJ>3_;^yKh_~uKLiL8-zusBsGbxl_j4rexF-%oK^-VdPxPm zRE*IYIaw0ozsc_Z_E#f(B};h!6rcZNWA`VY4&0a6YA z$EShM1OJ&kU{M|=q|8kpWfhI^86A0mrCEI-T4TCXXFy zFL>4iy3dhosCmhlaKEHO%wL*}rF4hbm{pOeJeMEdtULbZ8Y!rIc0~&T!pXgItbKiRB;6$^8>5}@L#DfMwi)+BPP8Rc zA2i?B;SSKunY^O04xO$7E%ox4 zY1qMLS>B)7(H?y}got{GEqh)Pj#AC}O8E!b@|VaRmRvh@8&3SwYp40f()fbzaHrfF zPIn0&%0o^`$vmeqWj3Ufd>nPvvxBq&b!cOBZFqgEv7@6gnr=*|laZA@X<6rk@kUA$ z{NEbt#9iZ>qVbg62xn@zlXDHy*r++NcAP&RgM*)MDN))%#5Zl>HAwZug|>DkG{qC^ z#f}gej%e;tj}MorE^@-pmb*}+v7JMOJ~lty9o6%j;@t^&O>ru@=J+3>VN|MJ56^NX z${fTg+t#ykRXo}uCoRtZku1WxS(tUgZd11|CQ&Z6ihZ4xktlY)965?8H{L9Y!|3(F znqa1$vS`6+I{hv6E{nuE;%g0B9}Mqqq9@$~-*Y4ZSp{W`yu(#`yHaDc*839edWd$_ zsdKP)uT#y9T12J8_~wCYQ+gFlt5UD}NbNqOYE(H%=W2uY204(k5WF>KU0OX5(dcsd zy!b+#Dya`alyflZV&!}kTf&KjarFRttzj~9$LV?GgV)jtX5xZad$gy6YU4-S>&+je zrJo@uq2iJ_C7riV>^EXT4Eu>(A8Cf(*oD}BniC^&NNIJ`@Q+o;?KFM+f!aIh}p&Fakr-)Yhi+FKMEM7#Zr8F*-WkKBm9h zK<&Gy9vFq@#zGr4_278;?gdNq21X)n&S?wg>h~jXkJno0w+E}YZTuj9;>J^!EYS1D za?RZu$1az?A&o}Z1Rbl4oQcaYFUc*DSfo1~wKVcEo{og2@wP~Z+#XH}VmA_`rc*i% zit<_M8fuG;>P}Uy#kG``{`7Z@ed9(pmZz&f=v=N=T;K z5kN8ZTuc*G-_rGMU5w3rh?VI3Y+9|xMNfZ-dX2w^X7$Q|t%VY7>AHnPN3v1yI~~yM zf(h7{j=`xwJJTuF4rf9Vzo)WuwTWt68k?W5g=mvF2CDjF~=t z%;=z&5ou448BGaD>4+d!1Hbs~=pfY>IBrPs=-c??QGDi1f^H2b!=1@+qH9S{%&enX z-KRwwp@4L)a!dI(3LKyuJ!^DOgW~#>T7QNe}gL5OvRGOwXb;2VYRkTM3VZJ8QnaP*~GZXpbq(&DBRnWP^Jif@9 z+K7OJ`RfySVFv8uKswnY>rEP|9n0d$j<(2oa-dGnYfZ{(cA(Noil@@{w5E70CAZ_~ z>@`~PR3N06KLbW&pt8p7B5#F4n_`_9qp5X#+$yG4R_cQ{I=B!^HJKlvtQOJ-(i}|i z=)5SpLo`s!(CF(QjSEHxsn-kTFbOI$4V<(jGFi+~nU9x6P`Op%Xv!eYY=jx5!kyt{ zL`**kc1wJ9&*CK1lUW7cUXxr;14}j(Z2P1YNaa6`0fE~7=W5<iAbn;nxz`S1 zg3)G<0NrsGuC6vYZf>||-E1sCtfK)yq%MHH7ikyMtvq9u6P=H0LuSpU)z}8}5M(v8 zbel0Fg9mL9qZvX^EuJJNW0YuZQBN}p&ZY$<*sHB8vI?Cx8>4PFg%cLBqZGZk*%F^l zsRpsjZCJA66>42r&v$l-Sqmeb;dD<@P6?Pbo5`ZMXb3h(k}`i~5N9-+4uVTl2q3iL ztTP@D_aW_W>WqaD#U3oyO~e<)XXD*Nt3}*kIYzl%s_7b?AE`AGZDMl%7d$l#pM!O- zm@3s)RfhsoaXPsaG8B&{qJRfQ;;SLXILAG|%5@b)S6vO6)e^>YqhWEF)wX!DKulhk zrV6pwr<;SQcQA-W0gWnOc@Ps;*Hl$&cn6!hFqyYQpPGYWFx31A7FUaUx>v%;5?eVb zoa%~ngbf-7n#sc z&&}i&^yg;F+Uk8Xw5L?~b8}QCmj?yn`*X8DH~Vw5x-RtB%|r)(ZuaNq56THPrP809 z{ka)RNOQUQbMr@fZuU)W+6wVaZC{*CtIBtSk$U${ZQs=Px2QhI{pKkZ#-5GW5;e9+5B}l=!3u3F{NKk#7YD#Kx z%nWh~wspnVQb9`+-SX(MiaIs6io@xFUm-2j5O*9w;c$vabq4X+!CZWU|{$SETS zi&^TS6+bGDSV|sZml0`9Qc1CQT0KTLxwK~1glIK-un(sMcJn$VOH8vKLWUZ}LKRx8 z23OJQ!d@ukgqltTJu*|jYU#X1{+qt&gYi%CXF{4S@#R_oES^K*W2w?ANKat#DD%t* z@lV17Uok|`$JuJugXa{&h^p_Pi1X3GMR6YXOn_2}RH}?qCP;gfk1L;0j#f&fy@5jm zM+A;iMoWh(GnBKW(b8CHyfjgoB<+)iq${PXq~TJd)FjQ3=1B{rcIjg2E7Dh`OQox& zYo+U?8>E}0-%9_IUXoss-joKV?b7Aa6*x8NQ|!#+*;#A@n~cc*Y3zhgm3?Y7yG9uv zkaV07b4?fp4i6lujFJvfPEeLhqogs?IB9}Z&dxlJEobK|FDb*=wMu~9ARVNXsgNhh za)JXM8u+Z5qDK~M{X>J3DT5O^U&6J4fU8(qN793E*@&iB;n`2MP<~w^4hpu!&yAea z(;cxf$O3xQ6>7$VQEFHV`gktbjlH?D1X{36XN>@+K)uF!t0t8zcqRb|x0iMX^& zUPKQNN6lzTt__1mhVh_=`DBIdDF)jB7=&NMpKGB@+)H)ekQ}B3d1kc!a=@vs9V)zr<^D>+f&1FllZG8-9N+80Y z&oPeHNedozO`^sy9*=CruQ*y*f)+b5Q%A|9Q>PH;Rye!o(u#Sa(*pEj4cbewxo9iq z-3!L_A;)dp%c z^SL?Rjz?c&Y2A#*8iosnu7}+Q)3>1&nEt*E?c30JY&laH+|~)c4Xw^Zz71{qMg+4^ ze-K!=3Vj<|df6v{Ul(sf&z#ARsxc3- z8MZdekEWrcSVz-uzFyVNQZW;dJBo7k*FVs2{wO#db%RX(Zz5&1VtJ6Dr`Ff-lW_Dr zTo18jFQ%jSY*mb*GE3rg`ka2G3myGJwdlvaSZbu7be4^Fl28D*<2_DhQOjzl3Ss-C zgTtDq3Js_G5B;e^Gp32B3Vl&Mp68*nE=2bo{`gr=bdC`IN;w1I!QA|%Q6xZ*mM>Y&UNbKOWhtUu4i(}>*qVAE^_5d4RpzZma##65T0yJK<1t+BH3X$GZMgX`?^$E~LizUr%SW)93|u#-qGYW302`Y`qA2mrBP};C0akGnqB5?$#<@ z$I;ibRz`c0M)^bZR5}7ICF@9-sp_#``nh@xC&spkG-&He5DmEAThtxUPbH(1=4c01 zCO4Z}T~l&RKs%hXRIH;Z*-9hM>!9h!PM=eg>2_;ccIbxq-_=I(twUSV#`9C;uyN8Z zreU3+(|jeb*QU=S+Ok?Nph{h$VbFwN-nM+f4ms-NGgCF3|> zsicImEQt{}aJ?#CmKy5ri3V6nzYeU`*%_tQ>8N+Jb$&eguO3uOzy%m%fTBYw^|Xiz z^@VIu=%N*DrM!k%XAuXZeh`lM5O&mzfhC6$Pem{7@8^>s)hFg~==dr+lkga-neJ(R zRL?a;ih3|Q&N)>7DBtxALud=0ug`IrXBhJLFMjB?apOCpHa_>JSI+vz|C{{Kyqg~G z3jOF0IxUQA4%(Pra#u1=gUDGM4@=>kO8{A@PIU}}Q#(SZ4Dxi-mK)3ORSSa3@zG3# zQza@k1=tR;4KA9E-pXUpo%Nv@N*EJmZdFwPUHMBMaFGM1>y{0?0 z8b2Sxhua0}d7Ze+{2P^-WTXs(^5mErDe8|>_V{^m77yH!aaD5^c?!?5UQ5}|$G^ZR z#eP+Ds5Z*6UU^?MtxM;ij>9Hh7v^%>u%nY>1N@}X1Y6I!QPaLDM2qozQ$I|g`wzYL zZBpOXVw@mblQ`thp)Zem==5W2&S;mvWg7!%Lq4Oa6TZt@k8|^vHOQQ~d8Ee8M70CT z#b-8r`a%sk-6CyR^^?&JNTasj7cOQ$Zsojcy{cUN#iPE)bF5dDS1E;f)p}KPs20kx zUaeeArtU}^7pwX1+&lgw!M)Aj;{7nVcjXhur4QeIjD>sawV{TkuAe&1F6C*fxR$w; z8?TpAZ&gnP7?uqu{Yig0b8oq>i;u(0mpkQ-;{i-{Mn8nBx|V2~_pk7ofYV0%(q+h+ zCami8Go4W&?^T_CKr~gJ)2hybg}yV!r?2E_$sE^jCF6 zg;Zgyy3c@+zy zp?`z?+rRpBaN`F|Hy;v?Wux41^wWJ=w(2mSXMKJ4QPT-N&-y(35#-tb$1Y;uX1`)r zvv0BgVwbS5u&=T&u`lCu3I2Tz|NaY~Z?W&O3$P{m4W54qyBPm2L8(jF*Lm*cY!iDD zd6%&TYyz98{hP!NW0TmSN&}O&u(I-ohQJOs)Ubt7!VWCZ-fLjxuQMiXZ`g^HT}T;3 z%B!rjp|@{ee_3B|Yv46jDkXaN_Lpt!Z7AQ$$^t9;`q{R9N?CtjBCw6aGU-jm0&g_D z!RvjS05$@8Q|}6C4|Wk*KiY0klwP!rDC*aF5?XI~M=9Ifx1#(l#`?D_J5de@G`y>n z_HS(6#!Ab3w{2HS2m0uDL*KSRrF3&|;2l=d(7z9bOE#}~8*uL_WdoZMfp;0}eM3R} zsN`K%vSMJjvQHVlZPN;D71$6c*;cNWBMjbDN;WmTBeegPQo60T9F-){Np!S-x55T^ zvwIY_ncr?4WF-=?DB0G}HV*ZcZtO?VlFbsZ=zmKo>2Dacpo6jv1ACQyAle>OEs6M` ziA_2>M5Df)4P`5OHvyoeKkyza?N^kY+Sq8>rM(+BqqPAEjr0wHSStd1*og9m-pz{A z{~jwT-?$Hn328SQfuY)_D6QMss1>+w>ysGUjltQt4a1PoE2rkDryIAkvR*|=Y@=ZW z8MiaG0@V*Bq`la?9odlBgeuBK?Dt|gxALSN>IkFKKw@ABlvy#TBG0y|IfFo_m#_fe z4cmxoE0yhS1$hFS0nmprELowoTC%BpAKOWN0j7OwP3T%{Ki#4!;Mwq;)-G#BV(%`t zmkldl(Q6xSMH$A?e$$HN+h~YLumW$0Bl_wnzRQM}Z&s9n@?C6L17Z3S8y+B(8(!kH zU@P{p?Z`q>LInlqfJQ8_(~8ngAc7(*cCsD3RfG8zhyW01^z9Y_cISjD{W^Debqg2(Umit-t~hD_&A*0Fuyv2MCK{XoLoVpir17W=Ep| zQtp5TG>JOYZ!-%q-ry|_WTJugdsQ?VURDR_U;F~`c!!ns8K`fA&UL_`*9n9EA+QwT z|Bi?P?_L8`2Rda)3wmeb&%P zKmZLqfUBq`FfX9m&C)I>YM^t-#B5=a4YYusLKsWYg29)-164y4(8N$Ou;O))?4KMu zz>xq^wPA$H3=o9{YV5!~wGFAgpt1u!c59=u-G)dn7e@gRXz&$O{SH>rfawM^X*uRX zYW|-(M*lY~c;O#FQq+(rp_9`_XTbeXMmSZ_+ZoQh!yUQM0rO1tl!Q z)4QveVQ%K#-`QKTiHxbu64{%H&17}KDsUvtPR-6^y@R~IzPEZ+`d|iMu?h51Fu*o* zS0f2p-{gT2><`xPHZ{G4tg`{K?iw@z zg3i$B>~b8P(tcHL$P#Cm&0t``5bOhIHGl`irr(7X45l#~rey=`BjS}0Ikl?}#BN)| zeOz7Y4O2VB^(!D0|ALtGqZ^w+MA9UX5>g=LTxiP`GC&9nV~W&P%yGR24L~*)0I!t6 zx@H+9P={-i9TU`LS7E3dsfm9=aJON|cB`6$3fj~cR8<2o!YV<)Vu+291}Hrf35*$4 zt@4M-muLpvrG6Ru3w1+BY%BjK=u0vSYM@TiqkW(qM`Q&i8I>9s-c4M-1w8h#;oNp4 zG&Za3pvfnUHE6eO0hLoUJTSMRMUB1&9;kXF+W80X;wE5$hG zXs6m|XnOz^sF-N-xrG6RUW`#$A5cXTo46@V%|h+-!BE9V8w?nH4QRk-@M-LWW(f(@ zh<0c&HlkvV1n9C+M?&RIj31iKzybvmud~ttvV8~%$TX5*`B?}79MDW}1`aA?qFD_I z0>oVa1mH*jDa_ub$koho7aRbvS?y<^io{!N6o3*8Na%yH)mYC^ea2{@V)S_vTE$RF zWO!{;DM9dj8L$F%sLKGd#*r(5vb`cDP(@-GLk$gBY;3~CK!Xnma&$DXCL$@sTw_B+ zzQJpqKfPyrf0p$U*4H|&DYT;~SBZ;`I-#}!W zy727FSSAv84ge3-j7f%@P*|MN5_@y`ZmiCTP*?#H`WWj0PzwsziiR$x3Ln?Lx6lV* z4qJgZ;!QRJfC&?iw-`%sEp0;tb)#VKE1K5YsV<#qov5O;2kX_cJ}$N@DqJ^+w$~PB zYA!aMu;_z|<>>UP7AVl65gIVa0z0A=RuUWrw#7V*y9OGH*Hn1eNxZ@VtmV~}G<4t& zAPMSh)?i_wqYDrtP9Cf$TKoITbt411ooqDd_93k%=;D&{UNA?Wx>DE*%3%7`IR{>g z2AazmP^TUnER1GA2WZriK6s3H6`1tM+<}$I(`eEwDW`7rVs71qmdSHMWvC*IKme^m z?QuL`Wt>Ab17jDAHF#Fwuvq~Rnh*D>6_*WcY?ZLKYJg7&&>PkD)fM>p+S!YVupzOr zpSY-`9L7=UrbGiYIHU!BBoyC-WewF2rtei~Q9zfzZN0lyLv@=<^<8Wv%JlcHXh4l6 zQfmo$uHg9^Vz@2udk4)nsH^2SR8dDiSOXk*0~-V69MqkP+{{2z5UGK^Y#W(M+ZddL zZ((``+T@!3I9+#ZUwio5-sPyZQ}Q+S&(iCw!SJ%87HyZ?~IQ{1(UQ zP1WB~zE{JEE4Ga~mCDLj^bG)7frFG*Ev12m#J=8=2I;@qBSi9s#NOVL72y1mK*OG1 z_<4_xy5h= z^xG>{V!Woo_F>3KS{n3(>se{<=1oJrC7XyLSG=l~yB=NKg&|t;ijhz%^+6aoab89u zdtdg`srMIYDEL=({69!KyicQk@J0BygMa(i51tP1)2JVN5&rGq-~RQ3rvoeWuLRGu zWd57@B_5-IH^i#|X2`SEZtj1T&7u3rwFLP!9pc z;nMWmI5-c-SzGV<4GzVW!`(~6odG)5J4%N+@xw%e3p#M-USw4SQMm+U9DM6_Mq)ra zSTZnkruM)1_OhRusI@BX&sM$8P|R%aENa>~v$-kWAuo+LMe)!nolR&ZLCR?ebkZJ= zD&+2!I7fxU@CsVOi3H9~HQ?xE?4jzRYLsolGlpoESI?7chiaXY>xb%{l1~^q!6|vh z&-DY;xKcS=4)I>aG)sAi~!Cx^t*sT-k%Zu}-DOOXHoA zCrT5Yk|#-%oRSZf4s}RYCMs$rmBQ#KXDes((qb|W##i~_oRYsPebp)XQt48sztBrkZy2FzDc^tDfze3Z=I6=CH>1O`6cNkr{q_pSDcdHl-_ho#;XpTlJ`nO zPRYZi;SR}4iBiIot3+lyS~=P&8EX^*tWAvsVUP?eHcTA84zDy&AVq*N;9 zm59lBRfMVsYsJzfl8U#OjMHRQk*X6)2R<7(me(yNE5npwJh@&d&8}rCpNPqL6NEZw zw&dZ8O4tfMyBl*IyM|rEE4QcL&Te-~58#w+$MjI3$|+sK{-ByJ&au*LNmZ#8qB@kC zB~_=|)8|Ta)p~5@=S%Y)(@&IEI;M9>Uv^BtM7qQ={cF;<9Md;S-*ZY=$`w^_SJ+hA zHIhbWk%gt7N=j_KQ^cb(Eh zfl!lU`h_8lf5d);{x77;eTA4_$tssQ)l>P!$~BJZ7goODl)i}dUFVbzHq?waQOxoF zl?&AJqCg`MS8+-Y92q#$G5x5(QI>RW$EvpbSy)*_QVE<(v@nvwOKJo&7UG0bqSd=J zyfP~1W$)&7D6!2pHcf2c!cSaPPv9pF!GGBd=h-se44q2m`0qvL# ztJEtS)~QD}S*c#x7!HqYGG@K9VbpqML#caZV}|g`#=PQ{4Wn1fR$nF}(iC={NA3*I z+_SuL$*^>{Ov?ykI0NP|MA4pL`@_{UPY;3ZTPn)7(n2=K| z^yx^OH2CsERDs|`Q8aP`w@qeMj$B?<1eaG8#jI6DF)Q%SPEwGTGrI##0iT_w4)8Xj z!jN(>KB{d*&2PS}cC`_7vxTm_V-B-zwN3Tp+qS3r*Lc;vZE;L&ZJYYv5pQukOxWCd zEo#1ep+(JSLg%7&s{^9?%NN?F1M>#=vNUwsxsRB)rIB^O;Z8!`hMAo=^2M>6O$X%N zx*N;oHtZF-@tm94QRApPYP@xaDMJo+V~w}$Yp@1By3tV+@EiqqFi&Z(1spzZoL6I0 z|Kixu0C?FdH8xvCgw|ID4n6f0Rrj8H%cuvOr*L|}iPlZd-SZYlkM;`W0B-@*+QZ7% zVFm`Hdx~E+U{~SefSv|_t)t}C<|=s(wsUPxk_SRK!sbGJH&{;@%%Z+)i;}_GoMg}q z?_31Y4K^ofbOp{uv|NEbr#q8n9f#Srd~gqbUPfv=b*^} zTp%d{=|zxii(Y_>Q<{i1DRM7m4sg+3kO}U>uz)O3odXj8tt;((8nvzQ^8zh=hzezQ z>Z{lA(%5+DbOPTG4DYh7=)SMW(aK_QV^^ps&a22y8G~~jraLsBl{8N9wh0gH1qhWl;v9f|Wt2IAstjZb(7}D}zwM$^e8eR2cxYz?lzlg-(40THxGAprSG`mrc3s zoe;dJ4RV9Gv%K>jAqY~${8#WUA(|CwVw1FNTBx{vLbP7!{8w2p%Y)E`vOGWwWqE)W zI{yK*P?iU%IJ_pyl6K}34KLuhrXikm<9H8nJHtC~7otx^Fnm?PI=;BAMqpjkv|Cj$ z!&eo|@E~-d3=hyk86Kd8GCV*FWq5$PF?>!s9`J4)?*(sXdFRbspjHIS+qYv)O>JTZ zbgW$ zAYC@Y#fu$lvg&eg=t9{M16~w60^UtAn}eRo&USWm-ZaA=xEniy8tQ*ulPYHRN}cxy zD%>{+Tr1TZ3AQHX4tZ51CU?*?&o(yDpOoeyyZU3fc|4|2iDxN+yb)q|1m*{8Gb{207AJ2JSm?9E1`b?nqG2L}XX~_W zrI{zNXwu{fEE=JC0=q3WiCkIxEczjwTZZmZ|J$r3XCEZoJsulF-Ut=!fh^7eS)Bi| zVE1Fe-bau)+fveH#}AOAh-9u<+#w6}#Gp-4IPz&zlnfKnYo(yak)mNyHgW^Eak;bO z5iXvBxx6^%VR6304A+(uO*~fI8Lq7y;cY~P_2WOMz$bKi3bWd_ed4T!F@LKd!8~c`KWz}eSbB<>Hkb|rVzW_l9+8|Zc&GL}rO5+NPZltl)nOwA z#PJlOY{13X?arQ4yW`ZE>X?LVE=-!h{KpOK>vPLG$B|xQ++BXO_MZ4m&T(uwC)siv z<(ve}6*w0ua|O;()SUaAqo_Fp7b9xU`w8yb3E9`|{__SnUluAycLupES3%+em&kw= zO*?ailf6yRs>=sb6pnl#Majs7ger2|&PQKG(Z~tfX36=_8$f9-$7XD{&0H5&^`AG$ zB3J(N2Acm>U$Q{8c?rG$yn(*mMsf*a6{^q)v_OqcparUQ0`(eR%|>w3=>%T9QpeKG z$wP-^FVwPfp8vc7oxA3+cLf$Ll+*m@4T70wi_2UKG8e2209yDE6|4-hS}~VB z5bCg~4RV9G*?8!=qdLGAOTpV9sIyRd7PsAphQ&2qCi{?%b=z78c!8E4AjNfmX2WiL z3qlvTo2!{8cH^`mgLFhsm z9-sxT;AwaZWq5!VYVZNnjp1|B@ql;ZcrSQ6%R6t%0<|Jo-hbWz(}-~#Stk2?DKh_g z1BVy^aC#B!Xx}3=2gDQTwhg^vqxeI96hHK!5id<|&;rfuie{NcZBz<48oigHpr-EJT#Hnr+U<6GUd;s}uR z(8tY4w|mt@Xx(0Q2s`%_IL*v;0P~hK4>(T|^MLb|Ee|+Pq4I$9lqL^2PchQq5Pe~D z-cgKDLDBd&5%Qzz)mIAohxmIeS)C)ya}gBR!1!FG#T7V5k#R=bbKWuK%>rx_89zE6 z1G5~_B%tDz=e4LiT~CWOkSX( zeV-R-;X_oY7n1twHM~S751mfnqTQ0&Uk7lT;o?WfTc%4pZJaj_DG=F%MfGJe3?heZ z9RL@~X?}FPA04l{ZY(To=z2doKEuI;jisXIzk)a5&~TyiAGW3no&Nw@===xJLbVb= z#dUk;EaW!V1GJd=58&ebC%P+Lrcb+$cix6WpNi1&esp~9OaMX`%J2X!l;HtdD8mD^ zP=*Jn8^h^m z!x|lLU0d07ByF%9$nf~AO^e34`dZd_c%WrBO7F0SM9g)WL)Y^%9^+jd*a>4WXiZ`)F? zkVtu|-JxdPjPgU}b2^m|&Zh$17Jw8P-ZXRdfp>A30a9f4d>}69WL+H*PM)X2O4>bn^%LL=hu4zdWo1PpqFrY0(yy+C!iN67=Q@NaM(W25;pGw zZ4;+L;^wV2Tf&QV`^oz_`mDe?k+VKIZ2mW zuX7VISLmF?#T7aynQ?_KYP54+%Q}+WX65HJU^eL~B!u2701mzd|AhIR*0O#K{f9b+ zJ`0oA7aCAlUsP~$eNnMheh|Ip4t8<%{09cnXJK>9%i`>4dXfl|J}$Hbq-e^Bkl9Qb zfQz<_2(CBownzZDA4PBISN9=u-MiNb>;dXEyacXWiw=fAhR0^RWDc(bxXpI)qv$Q9 zwbQ1cD0=I#Iaqdn7`-JrCYyvHG+cDkWwN-NZ~;_Y(c}eMsKQ38;#wxJRz+=KE=6+L zuRw2Y>L53GJI_0B%whXRba-a=OV>3{JYVqE9NHC$BDR}#2K3|T;TqSEZ6j%O6PLnw z=!i86<#~XL!)x-at{QZd}8ZXS$6KbxEGNx zbXJYd=k<(@LK<;5g>DWSC#&Ob7{R-#W-oZIANf~iD81!)W*QskQ2NtZn5||#teeGI z44?V9k0FJp`oZ%UZ9jNkJx;%IRoV}pH(oB_Kn*{5-VdJ72MUlB-PPs-oZ;`WyV!DvD~61I@Vstv zID6qToN&1hi_KKY15mV7@&NSW1S{J*xH-{LFL`o-wuzG;JkM8t^!WUNJa^tY7><$L zUQ=3DV4GR*!hWs+?4oI(FSKah=L?;a;J9L*tMoXMJZI^#K-;9p51vD|!d|(IATUD0D6{Ih*{owhW0-F$yUZBGUkfK)4 zWE&TT1Ei?Y^MNdo$7dmKd_Qo!%d4L&isQVB;yAA&J7tJEd}qdqG=R@W z8Yg(WHt>Vz)%|{27hxtT^ii6S%~hAFnO$Zfv=JI`a|sZgE=XrVk0(87nP;299DiZh_QpPV3$^(G>c;W8>`D_?y0N?$yq)L$ z;Q7o+%KqByOa?Y=MvE^{cV=K%v)M-u>rV@Gw)w&vI;#Y6aHmeY3Xm5+S@3oh1uu9z zKRWN{fz^xA!S)?Jb3jeh{NQ=FAoODR5#yFkqr329#=f1?pm7cAhIiro$e9u%VmpUE zr{MW{Y&}BeyAdp(W+?>G`@!^B&!Ji@cU&I9#bhvJnIIQ{) zpX$Ic!a2C*v*byVlzPVY+GEz zVb8vzPvyxf0yZGoURzG|m z)`F82VSfXmO_gSu_^R>V8S6%k3GHQr=!0TEcEN<^1DdsMk;U_c7TMeeZ7On$?PTKZ z>WtHHcCx%oXmNAGY&kcYiT)-NIyahmnhRMeZqtGJHtu;Ow%&WY#cI;crbqK`T~wxd zgBQnc-iAYV%Db_g*Rb2vs-LHRn5WFv0#$t6 z_~$^z&U>KjDR3Hb9eV05X&!Lm9GUZgc*~YYd!9n&0p}@A9&ny4pur(#*kR)kjP5B! zj=(k%DkNlHXAZYW=3FS~2Ac~N-C#W_nMENT$awi|^vXq|-1?l8Sh)hb89O%n(_x>e z)^5r>3#Mz!#f-D}%wuxBGuk}ax3ZYR(J*_}YWhF3GV+;lpDi*`#UsT{<`X1Mq#%v+{QJ8hgd4xv)T^`}Vp zEXp8Murdf0rwr`-cOurrY@W)%kCD&eiJAY<82KzLU-0f5l(LtC%sT%SxBrIL3!VQ8 z-ho4#(CdZGe}(VCQLBZTC;%;V{sXAj@MfF;04~mdqPxKb+^*xDx8cyIB6PeTA)h(9 zxS5I|bfF9n&_WG9fELQ|04iuKs!2_OVMi%qPKbGDS)L@&pvy)C#t9gTqYBe`-n_6}D(%GGK zwyHf%A-j*x8P+gn^jX60n#&o?lZJj=eE?%A&XGA&)@GyR4kubDxx(ZlHSGIw*4lUB=#z z<2SahJ$T%Y<*N@|OI0OO|ymemiHg6sFew+@%L9*!L5viGl<^4E*kz6EaZo&dW7r5m|V^rXt zAAuIi@&GMxNkgr=vAn(-^04;^+>PTs!0in0yzPfR6~XX+9DnW%4?-8p@Bl58;Q?AG z!vnNXh6kt{!+Ysyeceh->BjM1@OGB>b&W_GI zgy8fdG_ZY-(5YwGJ$3V!q4DfJ^M)4%-E5zxrmVKQAIDz+JAz@d4_fA!b9UrkaGluB zxwq}fImhwa&$ajC_PM9kkK6a-_E)9t=lJ_^`}~L!^&ERra{jsYi02knl(<=epgUCPI5VRO~O0%n#PK+{zPJw8=zZq0f$E zWm~U_;MqEDTe0N{TnwAIuG(_pPuC?|PQaoY-R!eUEbbmLBHe6;wX-V^UXy|YnhSR1 z6?Yy-amR7^Vf)@O357fGGW>VuD#vU6r>`F~{CBy5+qm4>e+N%V!CdZ#?fYT-e%QVr zwqH!#y{EO2#ju21tr)u$;BHQ0ZgFI9-PPvMK*@cjJ4|4F*c7s}JJ0UTGcB3yW{};P z=L~C@LHhh+_u=IX=1F}&;NK7UH(v2(^AFNfqF{7S@iSMm&cLq1#{oSJem~ydkN4M) zzjao2u1DzS=zwv4Sip0#Gx^;a*i+eN1I|&>oLeqJ()@6LKipqGSA^^rmuMb8++SEn z`N#JA$M(ZY*X?rz?2F3Z^#71dY3l;FEqXuPKO>065BJA@S`KO%J0P~bgiOwJ(dYy! znmc)c7Qye-vS{vPw#-)t;-kd2#kqfMzh%{Br;UGXzoDD4QCHw$M}YLh{g)dLthwnC zKir?5$W;I91_6|^mx9b1HCNm|AzCk#}I8wUZj(CBA?iVOa{S}k<` zL#yKOiav@g_8yT+od0qHx9fQ4?LvyIE_lBXz=cw?xUEJsEc!4qhmnZt7J>rsLK(iQ zU>y%a`{Dk}1G(&v6H~fzycfKk<^6E~jETk%_oq46R2N?CWX#TfxWAh(0%9u8Y$j#- ztd?cV72rkbasSwUzHTvz?#0e_?dZH|hQol|41ydY?<$=42aue1r5s(D$+ia*EIS%t z%H~Ka5e=_j7)hnE14#mFJgFe*2cH-z{BeDu46jT`;lZ0i3STx0Db*P@*JPyBQVQ=v z@T5pA6<^)cCZ`1iQ+9-@jYZ*Ze&jt{#Nv1bf_%Is6k}1mEgep#=|p@aFN)8Jb!fj& zlI4WodHe}bKzmoMQFH{b)o4rJ}Ley!A@ckpprt$ zYSzQ%voK4t4j07Or`Vatv&n2Ko5oIHv)EZ|1G^@0NZ^RTQ32^wWuF=?l}M%1aA~wO zRvIr&lqN}sN{v#JG)I~zEs)x!i>0qfUzIMEE|;#5u9U8lu9mKqu9I$%Zjyd0{Y!dD zdPRCu8kDw6d!)V6K50lPQHCp{m2t`h<>SgHl%tgy%2`(0urrTi%h~ztT6RO=@W7GM zC~1r|PMRQFrv1B zxT{zil^bvIw2U@U&w*}4pFJ8CJZNC+_#x;rI$UUXE#fE0gup{Sj}*WoA4wi~A62lb zOxx1yqjFo9ET{9=r%BcgxahL-_r z$l%;?&$`+1Xh&dGIGU2x`vvK6G}5l8H1?$93*~SJ>D_d)2W9j-vVns0`r{pN~c3W3uRhqlhf=yjv6u@IeOXBHpIuehm z$<+8sax$i4-V{!xs0QkVUW4RVWd+dpxSRt$L&d(8VDybDeIXU<(hz!ye{1nj%H*vM$xfYI4x)7ERJ^Y zG1rMbmxzD{QhLJTBnXe8(eK;VhErYo&C*C39qH6>fk8~>;B({2ZW9Dd1q&k5ZlGag zEe2NIax85m%#Cz{V^owt=GJ695yw!X$I%uU6m2(3o)nIS^@df3F|wBQtX!{W>4Vf9 zNvf#fsi5G}R1XXRPGjEGlAc&&G}0L(R49KTrum+5CyE4uCx#Q@n4FRgPu?Li21zF&H38Qpr)9I%qn&WF@jUDGAk9QgPAbFv@D!nAq z*_9S^D7kTUBrt_bmRi8LJu%V@`J)akiqB5U;ng}7=0>8?rg$`-BsU!GfyP+Q<(NiD{}=`<>WZ%hX%9r*v!gQ1J{pD$jCmHG zI;4T1&drUYH>zB!81V#Mi&23{5@xenf&dn;k&~@S>b6!$1#EH1(mt<>as0QppIOGeynKkD`dc#0kA;r7$4%~8VX)cql*L*Pe4 zrVP;~vZvd-Ira`vE6 zTY&ihOrdEbEJ3UZScO<`@la>GtUUm&0#HIDe;k(IH$!3aISQg=oj5C|l3G(|Q7&r0 zfb!?BPjtyNGiZ!z+;=RCCp-8&jks&rTWSU=M+|@3yo1h9$?ZMq$QrE(XQ4CVF*#6K z!{=wc1)vq7iTyme!`2woJ6c#JC*@eXOfj%Q-Z;8OlM9@hSl^{AHGmdgZGIP zYPPN+=!)T<7e$L^t_n%eJhu%nP}%65I3nn!z8=xUlgI*cyQBv47pSE$Mqo~K%Q=~nv*q(5=q0J%R%kp}1m<3+b%3qERlzmZ zboxLL*%l`w5Gu`(gW3Zwi({?fbl1`)nA>Gk&Zjf}1)f4B! zR^65`Z3RM?D}7#P6ndP` z3sYfCo|2N=x-n&)+!F`CX{ymo0r%>DIIBs$I3dTH<2}%J9FDjva3m|<}w+V2#4q(qPUuS8w3F&ldld8_EO;oJ{AL!0^cGavb^{{Y%VxPVhf4=iyhOwxh62e?sZRdj$Gb=F1nI^hGSa}n9_0g%^4 z8y(mg%~>5CVDf$t`iS;C9Yp59Dx``JLL-G-G|~Z`N<%Ih>A*JXqLB`4qb?fBwbA`y zd4^mxQr?Zannw=iF2X|gkI3X>tAt!M(g9V2p$|eMg`72#yUFXuNO>(MoHdf8xO+aV~SRgav&@9s5gP=X!5$PYvAZM7LevtD=C&+oKR9jUY!qeMT^%5Pvpy@7E zQ5GHQEQUa8b@O;;t^q0LHf#;f=2?h^BlVd_sIwNKxW8kat82&`Ak3YiP<0*j69xMD zG0#REx;n5lXxf}-K7VQPK752HwJGFZ)Ppedcy`C1*3@UKgg|_MTJxXXIndAU_|qDn zqZ}XM@u#(XALY@fHS?f>e~)R+pVa6XVa-Z_Wl}kZ_VFV`}cqK zl)kUVUwW&aJVLJ$%zi?gY{u_eZPS@^473ay4JKQ$t+<&XaJ_w(ql=vX4B;yp>c zfr-DvhTe*Um!aXMOdZC_b+mcna;Tm9t|EHf9p6UO`)F)xq;V&DT(=uPCHy8%ggLj&>yQ+$*we|Hl`&H#K zFhXOholXgwQdK*(qOyVxz%{a(Wi_v&3P81VOl|%gVAe}-gfeP!U`WpqXp=kn`x%4! z%bVyJB11gXw@cDH54b{5Z^5w3mf$6d5&ey-B=7vxNCS?u(}I{@`GH_@&t7qC_0cSb zwpCIEMz3DNJJt2E0)=_?qzjKsMH&XB>cAP6hiN;Ig z%%!*X60UGMtZE4mkw`xquaKP^S%(+cO$p(JdTMHB-qdRS9p;&N6;o^UOlx&sAXDpb zpu5o)>E)i7dcp_wG6aQ7AM+n|2*si0Q+OGypdC%Vbf%rI@$&*&5L-k1roL=VeQTSg zolx!6>dHDC*J2%`wyrSVVakspN$C?ApJmk3QVoTtAE>3i23372sP-a1+Z*0=tze!T z28E(0TFwfg8CZW&+??)}atFN#bD_Kj$Gy_rfVb^MWs*6(VV4@$G0_H6y+zF*PQ-As z>W33C=+_S?V$kj%PQ)--eK--r!M-0(#BkvGhZ8XhL;H|ohI#tKgjw!$8{UhXS`cem zqQ7#GuO9NX>ss&h<%+sRx+AB%{H>{u&Y>_ zm9s-o|0wo(c067H)5k7l&$D;f%j{9S9A+&$&C=50>@fB%b|rh3ZD9lKUG@}9SaNg4 z>E9lcixm1d$iF}8*S*RO#9HiTbqf)W3T>swk6DVNg!g3nfb?0Nf?VVrmO zDMQTq+0EflD_WrRA*F=jLTs)U+lM40nX)K(r=`_>yau)PA*GB!?H9)O@Iqpyija=D z9mdSn8`yHt5*bvYB@VfGr@~QnIxAB9 ze^71!Y5(RxE`9V!qgY3L56bIW#v~`{n7tY=5TxEWb>Q}KKG55y{D=8;em5}KtUQPB zoA~|D@rxj>Y4@S@V|?PbPXFKJ`jwbz5anr}colfkZ~8pLXAkPa1FfrYI{(EV_9wVL%oqiHrKV9``ROR0p9? zSNhz>uN+;b4C4w;r={AQHmV-_O`EDjFtxuXc3L&6jwN9y)bO9vpIS1}qiIk@jWiF@ z+!ZfXf}9vnMV?qmtxU&mmx76k|0AX%1a{)XEf*^`WD4mZI=OdS=P^<>`Y7l{IUAx@ zU9L5iiHax(STYXuOI&xm_KPah`PsQ+TB_PAP2Gg3*)J7sUMNe~?A7n#Ln2hK>Qk|x zc1HuF;$Zey$BAgJ4zHf~V3tmM>Np1uBhFI0r;jg3%dy9Q&KPsSXj74U6(!yYTfwxye+uM9|BgE~WQGkz|1}8CAbRznILn(f%q; zr1n_Q?N&ZhFuvar6YmM?Y71&E5#{L6X45XqH!Ef}4l;9V{z;UxN5+)I+hGzKBjbRc zU5=~eyS4ae9(|rIX4si<$Z03LH&)0}&Mk<%YaO&$g&6bg7IEagENvzF zpiZe;R4L3w^(_gmTB^ptXBGiMk%}3Flco037W3Mgoo$`5SwNsmkO-DY+*wRNSA=!< zzAxHBX>V8m>9@DbZrtk~V{X?dv!f>Nmsod5M@p08xGgmCY|0f3F8}9doo)jup#Tdx zB)D5uFHT=Zbu2Y*XBoyPm&WY|sk#b$Z6No?&o^L=qxfoBeM+D^VCI_J_ovh8#wr2Q zhv3&wvR;N2t5l(Zgu zZe1a<^weF=WRVYHrG@yGYUT&!quGb$z5V6b_W0QH?=z^yjM}CaGujcQdGrZlnJxX0)lCl3vdiiy1|!_UOlLS`^CZxsz*G zF{4TaKs$)W$q+owc7(zi@TdQNTd&YTw zQi_nLsWG+Cy)zy|y0M`WsZ0JhM=NI3fYI4lr(K}&({C}OjR7rYv>7>uZdd>5x5bPa zDl5J)$gN^VO<736@xJoTfR%Uh-*Dn+Rp3_4s9_;&aK*)pj;bMKiW&VI3~Vu@W`4zt zc5gJK{CbU6%&5QRDrU4Phh9^5Jt1)U%iBHLt~Jw9qxXo8YuXN<4=G&VjDi;^3pf4h z1?L{b)X&%+LR`#fF{ApwjbcX4zBrTMb;h$wep~4;?RROWqz@TJFLCOdQBHVqz)RN9 z{g|J3bW#+{;C0uw569f$13s?484WFNzJFI`iy5`=uuwr)x$)ylsbn6F{5Zq jeKQ(9y?Gb6AAh4z%&7dzj8cCpX4DTS_08!2@XhEQ>0aBj diff --git a/node_modules/underscore/underscore-min.js b/node_modules/underscore/underscore-min.js deleted file mode 100644 index 5a0cb3b..0000000 --- a/node_modules/underscore/underscore-min.js +++ /dev/null @@ -1,32 +0,0 @@ -// Underscore.js 1.3.3 -// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the MIT license. -// Portions of Underscore are inspired or borrowed from Prototype, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore -(function(){function r(a,c,d){if(a===c)return 0!==a||1/a==1/c;if(null==a||null==c)return a===c;a._chain&&(a=a._wrapped);c._chain&&(c=c._wrapped);if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return!1;switch(e){case "[object String]":return a==""+c;case "[object Number]":return a!=+a?c!=+c:0==a?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== -c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if("object"!=typeof a||"object"!=typeof c)return!1;for(var f=d.length;f--;)if(d[f]==a)return!0;d.push(a);var f=0,g=!0;if("[object Array]"==e){if(f=a.length,g=f==c.length)for(;f--&&(g=f in a==f in c&&r(a[f],c[f],d)););}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return!1;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&r(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c,h)&&!f--)break; -g=!f}}d.pop();return g}var s=this,I=s._,o={},k=Array.prototype,p=Object.prototype,i=k.slice,J=k.unshift,l=p.toString,K=p.hasOwnProperty,y=k.forEach,z=k.map,A=k.reduce,B=k.reduceRight,C=k.filter,D=k.every,E=k.some,q=k.indexOf,F=k.lastIndexOf,p=Array.isArray,L=Object.keys,t=Function.prototype.bind,b=function(a){return new m(a)};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=b),exports._=b):s._=b;b.VERSION="1.3.3";var j=b.each=b.forEach=function(a, -c,d){if(a!=null)if(y&&a.forEach===y)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a==null&&(a=[]);if(A&& -a.reduce===A){e&&(c=b.bind(c,e));return f?a.reduce(c,d):a.reduce(c)}j(a,function(a,b,i){if(f)d=c.call(e,d,a,b,i);else{d=a;f=true}});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(B&&a.reduceRight===B){e&&(c=b.bind(c,e));return f?a.reduceRight(c,d):a.reduceRight(c)}var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect=function(a, -c,b){var e;G(a,function(a,g,h){if(c.call(b,a,g,h)){e=a;return true}});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(C&&a.filter===C)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(D&&a.every===D)return a.every(c,b);j(a,function(a,g,h){if(!(e=e&&c.call(b, -a,g,h)))return o});return!!e};var G=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(E&&a.some===E)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return o});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;if(q&&a.indexOf===q)return a.indexOf(c)!=-1;return b=G(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= -function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a)&&a[0]===+a[0])return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a)&&a[0]===+a[0])return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]}; -j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a,c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1),true);return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a= -i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}};b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=L||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&& -c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.pick=function(a){var c={};j(b.flatten(i.call(arguments,1)),function(b){b in a&&(c[b]=a[b])});return c};b.defaults=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return r(a,b,[])};b.isEmpty= -function(a){if(a==null)return true;if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=p||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)};b.isArguments=function(a){return l.call(a)=="[object Arguments]"};b.isArguments(arguments)||(b.isArguments=function(a){return!(!a||!b.has(a,"callee"))});b.isFunction=function(a){return l.call(a)=="[object Function]"}; -b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isFinite=function(a){return b.isNumber(a)&&isFinite(a)};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"};b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a, -b){return K.call(a,b)};b.noConflict=function(){s._=I;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.result=function(a,c){if(a==null)return null;var d=a[c];return b.isFunction(d)?d.call(a):d};b.mixin=function(a){j(b.functions(a),function(c){M(c,b[c]=a[c])})};var N=0;b.uniqueId= -function(a){var b=N++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var u=/.^/,n={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"},v;for(v in n)n[n[v]]=v;var O=/\\|'|\r|\n|\t|\u2028|\u2029/g,P=/\\(\\|'|r|n|t|u2028|u2029)/g,w=function(a){return a.replace(P,function(a,b){return n[b]})};b.template=function(a,c,d){d=b.defaults(d||{},b.templateSettings);a="__p+='"+a.replace(O,function(a){return"\\"+n[a]}).replace(d.escape|| -u,function(a,b){return"'+\n_.escape("+w(b)+")+\n'"}).replace(d.interpolate||u,function(a,b){return"'+\n("+w(b)+")+\n'"}).replace(d.evaluate||u,function(a,b){return"';\n"+w(b)+"\n;__p+='"})+"';\n";d.variable||(a="with(obj||{}){\n"+a+"}\n");var a="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+a+"return __p;\n",e=new Function(d.variable||"obj","_",a);if(c)return e(c,b);c=function(a){return e.call(this,a,b)};c.source="function("+(d.variable||"obj")+"){\n"+a+"}";return c}; -b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var x=function(a,c){return c?b(a).chain():a},M=function(a,c){m.prototype[a]=function(){var a=i.call(arguments);J.call(a,this._wrapped);return x(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return x(d, -this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return x(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); diff --git a/node_modules/underscore/underscore.js b/node_modules/underscore/underscore.js deleted file mode 100644 index f6f7e2f..0000000 --- a/node_modules/underscore/underscore.js +++ /dev/null @@ -1,1059 +0,0 @@ -// Underscore.js 1.3.3 -// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the MIT license. -// Portions of Underscore are inspired or borrowed from Prototype, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `global` 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 slice = ArrayProto.slice, - unshift = ArrayProto.unshift, - 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) { return new wrapper(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.3.3'; - - // 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 (i in obj && 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; - } - } - } - }; - - // 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); - }); - if (obj.length === +obj.length) results.length = obj.length; - return results; - }; - - // **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('Reduce of empty array with no initial value'); - 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 reversed = _.toArray(obj).reverse(); - if (context && !initial) iterator = _.bind(iterator, context); - return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator); - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.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, iterator, 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; - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - each(obj, function(value, index, list) { - if (!iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // 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) { - 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; - }; - - // 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; - }; - - // Determine if a given value is included in the array or object using `===`. - // Aliased as `contains`. - _.include = _.contains = function(obj, target) { - var found = false; - if (obj == null) return found; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - found = 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); - return _.map(obj, function(value) { - return (_.isFunction(method) ? method || value : 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 the maximum element or (element-based computation). - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0]) return Math.max.apply(Math, obj); - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -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 the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0]) return Math.min.apply(Math, obj); - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : 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; - }; - - // Shuffle an array. - _.shuffle = function(obj) { - var shuffled = [], rand; - each(obj, function(value, index, list) { - rand = Math.floor(Math.random() * (index + 1)); - shuffled[index] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, val, context) { - var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; }; - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - if (a === void 0) return 1; - if (b === void 0) return -1; - return a < b ? -1 : a > b ? 1 : 0; - }), 'value'); - }; - - // 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, val) { - var result = {}; - var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; }; - each(obj, function(value, index) { - var key = iterator(value, index); - (result[key] || (result[key] = [])).push(value); - }); - return result; - }; - - // Use a comparator function to figure out at what index an object should - // be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator) { - iterator || (iterator = _.identity); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >> 1; - iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely convert anything iterable into a real, live array. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (_.isArguments(obj)) return slice.call(obj); - if (obj.toArray && _.isFunction(obj.toArray)) return obj.toArray(); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - return _.isArray(obj) ? 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) { - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the last entry of the array. Especcialy 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 ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail`. - // Especially useful on the arguments object. Passing an **index** will return - // the rest of the values in the array from that index onward. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = function(array, index, guard) { - return slice.call(array, (index == null) || guard ? 1 : index); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, function(value){ return !!value; }); - }; - - // Return a completely flattened version of an array. - _.flatten = function(array, shallow) { - return _.reduce(array, function(memo, value) { - if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value)); - memo[memo.length] = value; - return memo; - }, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // 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) { - var initial = iterator ? _.map(array, iterator) : array; - var results = []; - // The `isSorted` flag is irrelevant if the array only contains two elements. - if (array.length < 3) isSorted = true; - _.reduce(initial, function (memo, value, index) { - if (isSorted ? _.last(memo) !== value || !memo.length : !_.include(memo, value)) { - memo.push(value); - results.push(array[index]); - } - return memo; - }, []); - 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. (Aliased as "intersect" for back-compat.) - _.intersection = _.intersect = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // 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 = _.flatten(slice.call(arguments, 1), true); - return _.filter(array, function(value){ return !_.include(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); - for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i); - return results; - }; - - // 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, l; - if (isSorted) { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item); - for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item) { - if (array == null) return -1; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item); - var i = array.length; - while (i--) if (i in array && 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 len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); - - while(idx < len) { - 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). 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)); - 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; - 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. - _.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); }); - 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. - _.throttle = function(func, wait) { - var context, args, timeout, throttling, more, result; - var whenDone = _.debounce(function(){ more = throttling = false; }, wait); - return function() { - context = this; args = arguments; - var later = function() { - timeout = null; - if (more) func.apply(context, args); - whenDone(); - }; - if (!timeout) timeout = setTimeout(later, wait); - if (throttling) { - more = true; - } else { - result = func.apply(context, args); - } - whenDone(); - throttling = true; - 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; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) func.apply(context, args); - }; - if (immediate && !timeout) func.apply(context, args); - clearTimeout(timeout); - timeout = setTimeout(later, wait); - }; - }; - - // 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; - return memo = func.apply(this, arguments); - }; - }; - - // 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 function() { - var args = [func].concat(slice.call(arguments, 0)); - return wrapper.apply(this, args); - }; - }; - - // 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) { - if (times <= 0) return 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 = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - return _.map(obj, _.identity); - }; - - // 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) { - 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 result = {}; - each(_.flatten(slice.call(arguments, 1)), function(key) { - if (key in obj) result[key] = obj[key]; - }); - return result; - }; - - // 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]; - } - }); - 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. - function eq(a, b, stack) { - // 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._chain) a = a._wrapped; - if (b._chain) b = b._wrapped; - // Invoke a custom `isEqual` method if one is provided. - if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b); - if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a); - // 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 = stack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (stack[length] == a) return true; - } - // Add the first object to the stack of traversed objects. - stack.push(a); - 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--) { - // Ensure commutative equality for sparse arrays. - if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break; - } - } - } else { - // Objects with different constructors are not equivalent. - if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) 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. - if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) 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. - stack.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); - }; - - // Is a given variable an arguments object? - _.isArguments = function(obj) { - return toString.call(obj) == '[object Arguments]'; - }; - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Is a given value a function? - _.isFunction = function(obj) { - return toString.call(obj) == '[object Function]'; - }; - - // Is a given value a string? - _.isString = function(obj) { - return toString.call(obj) == '[object String]'; - }; - - // Is a given value a number? - _.isNumber = function(obj) { - return toString.call(obj) == '[object Number]'; - }; - - // Is a given object a finite number? - _.isFinite = function(obj) { - return _.isNumber(obj) && isFinite(obj); - }; - - // Is the given value `NaN`? - _.isNaN = function(obj) { - // `NaN` is the only value for which `===` is not reflexive. - return 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 a date? - _.isDate = function(obj) { - return toString.call(obj) == '[object Date]'; - }; - - // Is the given value a regular expression? - _.isRegExp = function(obj) { - return toString.call(obj) == '[object RegExp]'; - }; - - // 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; - }; - - // Has own property? - _.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; - }; - - // Run a function **n** times. - _.times = function (n, iterator, context) { - for (var i = 0; i < n; i++) iterator.call(context, i); - }; - - // Escape a string for HTML interpolation. - _.escape = function(string) { - return (''+string).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g,'/'); - }; - - // 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; - }; - - // Add your own custom functions to the Underscore object, ensuring that - // they're correctly added to the OOP wrapper as well. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - addToWrapper(name, _[name] = obj[name]); - }); - }; - - // 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' - }; - - for (var p in escapes) escapes[escapes[p]] = p; - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - var unescaper = /\\(\\|'|r|n|t|u2028|u2029)/g; - - // Within an interpolation, evaluation, or escaping, remove HTML escaping - // that had been previously added. - var unescape = function(code) { - return code.replace(unescaper, function(match, escape) { - return escapes[escape]; - }); - }; - - // 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) { - settings = _.defaults(settings || {}, _.templateSettings); - - // Compile the template source, taking care to escape characters that - // cannot be included in a string literal and then unescape them in code - // blocks. - var source = "__p+='" + text - .replace(escaper, function(match) { - return '\\' + escapes[match]; - }) - .replace(settings.escape || noMatch, function(match, code) { - return "'+\n_.escape(" + unescape(code) + ")+\n'"; - }) - .replace(settings.interpolate || noMatch, function(match, code) { - return "'+\n(" + unescape(code) + ")+\n'"; - }) - .replace(settings.evaluate || noMatch, function(match, code) { - return "';\n" + unescape(code) + "\n;__p+='"; - }) + "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __p='';" + - "var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n" + - source + "return __p;\n"; - - var render = new Function(settings.variable || 'obj', '_', source); - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for build time - // 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(); - }; - - // The OOP Wrapper - // --------------- - - // 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. - var wrapper = function(obj) { this._wrapped = obj; }; - - // Expose `wrapper.prototype` as `_.prototype` - _.prototype = wrapper.prototype; - - // Helper function to continue chaining intermediate results. - var result = function(obj, chain) { - return chain ? _(obj).chain() : obj; - }; - - // A method to easily add functions to the OOP wrapper. - var addToWrapper = function(name, func) { - wrapper.prototype[name] = function() { - var args = slice.call(arguments); - unshift.call(args, this._wrapped); - return result(func.apply(_, args), this._chain); - }; - }; - - // 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]; - wrapper.prototype[name] = function() { - var wrapped = this._wrapped; - method.apply(wrapped, arguments); - var length = wrapped.length; - if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0]; - return result(wrapped, this._chain); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - wrapper.prototype[name] = function() { - return result(method.apply(this._wrapped, arguments), this._chain); - }; - }); - - // Start chaining a wrapped Underscore object. - wrapper.prototype.chain = function() { - this._chain = true; - return this; - }; - - // Extracts the result from a wrapped and chained object. - wrapper.prototype.value = function() { - return this._wrapped; - }; - -}).call(this); diff --git a/node_modules/vows/.npmignore b/node_modules/vows/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/vows/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/vows/.travis.yml b/node_modules/vows/.travis.yml deleted file mode 100644 index aa1dc39..0000000 --- a/node_modules/vows/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js - -node_js: - - 0.4 - - 0.6 - diff --git a/node_modules/vows/LICENSE b/node_modules/vows/LICENSE deleted file mode 100644 index a1edd93..0000000 --- a/node_modules/vows/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009 cloudhead - -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/vows/Makefile b/node_modules/vows/Makefile deleted file mode 100644 index 6bf8991..0000000 --- a/node_modules/vows/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# -# Run all tests -# -test: - @@bin/vows test/* - -.PHONY: test install diff --git a/node_modules/vows/README.md b/node_modules/vows/README.md deleted file mode 100644 index bfa410e..0000000 --- a/node_modules/vows/README.md +++ /dev/null @@ -1,65 +0,0 @@ -Vows -==== - -> Asynchronous BDD & continuous integration for node.js - -#### # - -introduction ------------- -There are two reasons why we might want asynchronous testing. The first, and obvious reason is that node.js is asynchronous, and therefore our tests need to be. The second reason is to make test suites which target I/O libraries run much faster. - -_Vows_ is an experiment in making this possible, while adding a minimum of overhead. - -synopsis --------- - - var vows = require('vows'), - assert = require('assert'); - - vows.describe('Deep Thought').addBatch({ - 'An instance of DeepThought': { - topic: new DeepThought, - - 'should know the answer to the ultimate question of life': function (deepThought) { - assert.equal (deepThought.question('what is the answer to the universe?'), 42); - } - } - }); - -coverage reporting ------------------- -Code coverage reporting is available if _instrumented_ code is detected. Currently only _instrumentation_ via [node-jscoverage](https://github.com/visionmedia/node-jscoverage) is supported. When _instrumented_ code is detected and coverage reporting is enabled using any of the `--cover-plain`, `--cover-html`, or `--cover-json` options a code coverage map is generated. - -### downloading and installing [node-jscoverage](https://github.com/visionmedia/node-jscoverage) -[node-jscoverage](https://github.com/visionmedia/node-jscoverage) is a binary package that needs to be compiled from source: - - $ git clone https://github.com/visionmedia/node-jscoverage.git - $ cd node-jscoverage/ - $ ./configure - checking for a BSD-compatible install... /usr/bin/install -c - checking whether build environment is sane... yes - [...] - $ make && sudo make install - -### instrumenting with jscoverage - - $ jscoverage myfile.js myfile-instrumented.js - -installation ------------- - - $ npm install vows - -documentation -------------- - -Head over to - -authors -------- - -Alexis Sellier <>, Charlie Robbins, - -*...and many others* - diff --git a/node_modules/vows/bin/vows b/node_modules/vows/bin/vows deleted file mode 100755 index 0a0bcd1..0000000 --- a/node_modules/vows/bin/vows +++ /dev/null @@ -1,560 +0,0 @@ -#!/usr/bin/env node - -var path = require('path'), - fs = require('fs'), - util = require('util'), - events = require('events'); - -// -// Attempt to load Coffee-Script. If it's not available, continue on our -// merry way, if it is available, set it up so we can include `*.coffee` -// scripts and start searching for them. -// -var fileExt, specFileExt; - -try { - var coffee = require('coffee-script'); - if (require.extensions) { - require.extensions['.coffee'] = function (module, filename) { - var content = coffee.compile(fs.readFileSync(filename, 'utf8')); - return module._compile(content, filename); - }; - } else { - require.registerExtension('.coffee', function (content) { return coffee.compile(content) }); - } - fileExt = /\.(js|coffee)$/; - specFileExt = /[.(-|_)](test|spec)\.(js|coffee)$/; -} catch (_) { - fileExt = /\.js$/; - specFileExt = /[.(-|_)](test|spec)\.js$/; -} - -var inspect = require('eyes').inspector({ - stream: null, - styles: { string: 'grey', regexp: 'grey' } -}); - -var vows = require('../lib/vows'); -var cutils = require('../lib/vows/console'); -var stylize = require('../lib/vows/console').stylize; -var _reporter = require('../lib/vows/reporters/dot-matrix'), reporter = { - name: _reporter.name -}; -var _coverage; - -var help = [ - "usage: vows [FILE, ...] [options]", - "", - "options:", - " -v, --verbose Enable verbose output", - " -w, --watch Watch mode", - " -s, --silent Don't report", - " -i, --isolate Run each test in it's own vows process", - " -m PATTERN Only run tests matching the PATTERN string", - " -r PATTERN Only run tests matching the PATTERN regexp", - " --json Use JSON reporter", - " --spec Use Spec reporter", - " --dot-matrix Use Dot-Matrix reporter", - " --xunit Use xUnit reporter", - " --cover-plain Print plain coverage map if detected", - " --cover-html Write coverage map to \"coverage.html\"", - " --cover-json Write unified coverage map to \"coverage.json\"", - " --cover-xml Write coverage map to \"coverage.xml\" in Emma xml", - " --no-color Don't use terminal colors", - " --version Show version", - " -h, --help You're staring at it" -].join('\n'); - -var options = { - reporter: reporter, - matcher: /.*/, - watch: false, - coverage: false, - isolate: false, - nocolor: !process.stdout.isTTY -}; - -var files = []; - -// Get rid of process runner -// ('node' in most cases) -var arg, args = [], argv = process.argv.slice(2); - -// Current directory index, -// and path of test folder. -var root, testFolder; - -// -// Parse command-line parameters -// -while (arg = argv.shift()) { - if (arg === __filename) { continue } - - if (arg[0] !== '-') { - args.push(arg); - } else { - arg = arg.match(/^--?(.+)/)[1]; - - if (arg[0] === 'r') { - options.matcher = new(RegExp)(argv.shift()); - } else if (arg[0] === 'm') { - options.matcher = (function (str) { // Create an escaped RegExp - var specials = '. * + ? | ( ) [ ] { } \\ ^ ? ! = : $'.split(' ').join('|\\'), - regex = new(RegExp)('(\\' + specials + ')', 'g'); - return new(RegExp)(str.replace(regex, '\\$1')); - })(argv.shift()); - } else if (arg in options) { - options[arg] = true; - } else { - switch (arg) { - case 'json': - _reporter = require('../lib/vows/reporters/json'); - break; - case 'spec': - _reporter = require('../lib/vows/reporters/spec'); - break; - case 'dot-matrix': - _reporter = require('../lib/vows/reporters/dot-matrix'); - break; - case 'silent': - case 's': - _reporter = require('../lib/vows/reporters/silent'); - break; - case 'xunit': - _reporter = require('../lib/vows/reporters/xunit'); - break; - case 'cover-plain': - options.coverage = true; - _coverage = require('../lib/vows/coverage/report-plain'); - break; - case 'cover-html': - options.coverage = true; - _coverage = require('../lib/vows/coverage/report-html'); - break; - case 'cover-json': - options.coverage = true; - _coverage = require('../lib/vows/coverage/report-json'); - break; - case 'cover-xml': - options.coverage = true; - _coverage = require('../lib/vows/coverage/report-xml'); - break; - case 'verbose': - case 'v': - options.verbose = true; - break; - case 'watch': - case 'w': - options.watch = true; - break; - case 'supress-stdout': - options.supressStdout = true; - break; - case 'isolate': - case 'i': - options.isolate = true; - break; - case 'no-color': - options.nocolor = true; - break; - case 'color': - options.nocolor = false; - break; - case 'no-error': - options.error = false; - break; - case 'version': - console.log('vows ' + vows.version); - process.exit(0); - case 'help': - case 'h': - console.log(help); - process.exit(0); - break; - } - } - } -} - -if (options.nocolor) { - cutils.nocolor = true; - inspect = require('eyes').inspector({ stream: null, styles: false }); -} - -if (options.supressStdout) { - _reporter.setStream && _reporter.setStream(process.stdout); - var devNullStream = fs.createWriteStream('/dev/null'); - process.__defineGetter__('stdout', function () { - return devNullStream; - }); -} - -if (options.watch) { - options.reporter = reporter = require('../lib/vows/reporters/watch'); -} - -msg('bin', 'argv', args); -msg('bin', 'options', { reporter: options.reporter.name, matcher: options.matcher }); - -if (args.length === 0 || options.watch) { - msg('bin', 'discovering', 'folder structure'); - root = fs.readdirSync('.'); - - if (root.indexOf('test') !== -1) { - testFolder = 'test'; - } else if (root.indexOf('spec') !== -1) { - testFolder = 'spec'; - } else { - abort("runner", "couldn't find test folder"); - } - msg('bin', 'discovered', "./" + testFolder); - if (args.length === 0) { - args = paths(testFolder).filter(function (f) { - return specFileExt.test(f); - }); - - if (options.watch) { - args = args.concat(paths('lib'), paths('src')); - } - } -} - -if (! options.watch) { - reporter.report = function (data, filename) { - switch (data[0]) { - case 'subject': - case 'vow': - case 'context': - case 'error': - _reporter.report(data, filename); - break; - case 'end': - (options.verbose || _reporter.name === 'json') && - _reporter.report(data); - break; - case 'finish': - options.verbose ? - _reporter.print('\n') - : - _reporter.print(' '); - break; - } - }; - reporter.reset = function () { _reporter.reset && _reporter.reset() }; - reporter.print = _reporter.print; - - files = args.map(function (a) { - return (!a.match(/^\//)) - ? path.join(process.cwd(), a.replace(fileExt, '')) - : a.replace(fileExt, ''); - }); - - runSuites(importSuites(files), function (results) { - var status = results.errored ? 2 : (results.broken ? 1 : 0); - - !options.verbose && _reporter.print('\n'); - msg('runner', 'finish'); - _reporter.report(['finish', results], { - write: function (str) { - util.print(str.replace(/^\n\n/, '\n')); - } - }); - try { - if (options.coverage === true && _$jscoverage !== undefined) { - _coverage.report(_$jscoverage); - } - } catch (err) { - // ignore the undefined jscoverage - } - if (process.stdout.write('')) { // Check if stdout is drained - process.exit(status); - } else { - process.stdout.on('drain', function () { - process.exit(status); - }); - } - }); -} else { - // - // Watch mode - // - (function () { - var pendulum = [ - '. ', '.. ', '... ', ' ...', - ' ..', ' .', ' .', ' ..', - '... ', '.. ', '. ' - ]; - var strobe = ['.', ' ']; - var status, - cue, - current = 0, - running = 0, - lastRun, - colors = ['32m', '33m', '31m'], - timer = setInterval(tick, 100); - process.on('uncaughtException', exception); - process.on('exit', cleanup); - process.on('SIGINT', function () { - process.exit(0); - }); - process.on('SIGQUIT', function () { - changed(); - }); - - cursorHide(); - - // Run every 100ms - function tick() { - if (running && (cue !== strobe)) { - cue = strobe, current = 0; - } else if (!running && (cue !== pendulum)) { - cue = pendulum, current = 0; - } - - eraseLine(); - lastRun && !running && esc(colors[status.errored ? 2 : (status.broken ? 1 : 0)]); - print(cue[current]); - - if (current == cue.length - 1) { current = -1 } - - current ++; - esc('39m'); - cursorRestore(); - } - - // - // Utility functions - // - function print(str) { util.print(str) } - function esc(str) { print("\x1b[" + str) } - function eraseLine() { esc("0K") } - function cursorRestore() { esc("0G") } - function cursorHide() { esc("?25l") } - function cursorShow() { esc("?25h") } - function cleanup() { eraseLine(), cursorShow(), clearInterval(timer), print('\n') } - function exception(err) { print(err.stack || err.message || JSON.stringify(err)), running = 0} - - // - // Get a matching test for a given file - // - function getMatchingTest(file, join) { - join || (join = '-'); - var testFile; - if (specFileExt.test(file)) { - testFile = path.join(testFolder, file); - } - else { - var root, extension; - _s = file.split('.'), root = _s[0], extension = _s[1]; - testFile = path.join(testFolder, root + join + testFolder + "." + extension); - } - - try { - fs.statSync(testFile); - } catch (e) { - if (join == '-') { - return getMatchingTest(file, '_'); - } - else { - msg('watcher', 'no equivalence found, running all tests.'); - testFile = null; - } - } - return testFile; - } - - // - // Called when a file has been modified. - // Run the matching tests and change the status. - // - function changed(file) { - status = { honored: 0, broken: 0, errored: 0, pending: 0 }; - - msg('watcher', 'detected change in', file); - - file = getMatchingTest(file); - - var files = (specFileExt.test(file) ? [file] : paths(testFolder)).map(function (p) { - return path.join(process.cwd(), p); - }).filter(function (p) { - return specFileExt.test(p); - }).map(function (p) { - var cache = require.main.moduleCache || require.cache; - if (cache[p]) { delete(cache[p]) } - return p; - }).map(function (p) { - return p.replace(fileExt, ''); - }); - - running ++; - - runSuites(importSuites(files), function (results) { - delete(results.time); - print(cutils.result(results).join('') + '\n\n'); - lastRun = new(Date); - status = results; - running --; - }); - } - - msg('watcher', 'watching', args); - - // - // Watch all relevant files, - // and call `changed()` on change. - // - args.forEach(function (p) { - fs.watchFile(p, function (current, previous) { - if (new(Date)(current.mtime).valueOf() === - new(Date)(previous.mtime).valueOf()) { return } - else { - changed(p); - } - }); - }); - })(); -} - -function runSuites(suites, callback) { - var results = { - honored: 0, - broken: 0, - errored: 0, - pending: 0, - total: 0, - time: 0 - }; - reporter.reset(); - - (function run(suites, callback) { - var suite = suites.shift(); - if (suite) { - msg('runner', "running", suite.subject + ' ', options.watch ? false : true); - suite.run(options, function (result) { - Object.keys(result).forEach(function (k) { - results[k] += result[k]; - }); - run(suites, callback); - }); - } else { - callback(results); - } - })(suites, callback); -} - -function importSuites(files) { - msg(options.watcher ? 'watcher' : 'runner', 'loading', files); - - var spawn = require('child_process').spawn; - - function cwdname(f) { - return f.replace(process.cwd() + '/', '') + '.js'; - } - - function wrapSpawn(f) { - f = cwdname(f); - return function (options, callback) { - var args = [process.argv[1], '--json', '--supress-stdout', f], - p = spawn(process.execPath, args), - result; - - p.on('exit', function (code) { - callback( - !result ? - {errored: 1, total: 1} - : - result - ); - }); - - var buffer = []; - p.stdout.on('data', function (data) { - data = data.toString().split(/\n/g); - if (data.length == 1) { - buffer.push(data[0]); - } else { - data[0] = buffer.concat(data[0]).join(''); - buffer = [data.pop()]; - - data.forEach(function (data) { - if (data) { - data = JSON.parse(data); - if (data && data[0] === 'finish') { - result = data[1]; - } else { - reporter.report(data); - } - } - }); - } - }); - - p.stderr.pipe(process.stderr); - } - } - - return files.reduce(options.isolate ? function (suites, f) { - return suites.concat({ - run: wrapSpawn(f) - }); - } : function (suites, f) { - var obj = require(f); - return suites.concat(Object.keys(obj).map(function (s) { - obj[s]._filename = cwdname(f); - return obj[s]; - })); - }, []) -} - -// -// Recursively traverse a hierarchy, returning -// a list of all relevant .js files. -// -function paths(dir) { - var paths = []; - - try { fs.statSync(dir) } - catch (e) { return [] } - - (function traverse(dir, stack) { - stack.push(dir); - fs.readdirSync(stack.join('/')).forEach(function (file) { - // - // Skip dotfiles and `vendor` directory before `fs.stat()`ing them. - // Not doing so causes race conditions with Emacs buffer files - // (`.#filename.js`). - // - if (file[0] == '.' || file === 'vendor') { - return; - } - - var path = stack.concat([file]).join('/'), - stat = fs.statSync(path); - - if (stat.isFile() && fileExt.test(file)) { - paths.push(path); - } else if (stat.isDirectory()) { - traverse(file, stack); - } - }); - stack.pop(); - })(dir || '.', []); - - return paths; -} - -function msg(cmd, subject, str, p) { - if (options.verbose) { - util[p ? 'print' : 'puts']( stylize('vows ', 'green') - + stylize(cmd, 'bold') - + ' ' + subject + ' ' - + (str ? (typeof(str) === 'string' ? str : inspect(str)) : '') - ); - } -} - -function abort(cmd, str) { - console.log(stylize('vows ', 'red') + stylize(cmd, 'bold') + ' ' + str); - console.log(stylize('vows ', 'red') + stylize(cmd, 'bold') + ' exiting'); - process.exit(-1); -} diff --git a/node_modules/vows/lib/assert/error.js b/node_modules/vows/lib/assert/error.js deleted file mode 100644 index 3f52271..0000000 --- a/node_modules/vows/lib/assert/error.js +++ /dev/null @@ -1,42 +0,0 @@ -var stylize = require('../vows/console').stylize; -var inspect = require('../vows/console').inspect; - -require('assert').AssertionError.prototype.toString = function () { - var that = this, - source; - - if (this.stack) { - source = this.stack.match(/([a-zA-Z0-9._-]+\.(?:js|coffee))(:\d+):\d+/); - } - - function parse(str) { - var actual = inspect(that.actual, {showHidden: that.actual instanceof Error}), - expected; - - if (that.expected instanceof Function) { - expected = that.expected.name; - } - else { - expected = inspect(that.expected, {showHidden: that.actual instanceof Error}); - } - - return str.replace(/{actual}/g, actual). - replace(/{operator}/g, stylize(that.operator, 'bold')). - replace(/{expected}/g, expected); - } - - if (this.message) { - var msg = stylize(parse(this.message), 'yellow'); - if (source) { - msg += stylize(' // ' + source[1] + source[2], 'grey'); - } - return msg; - } else { - return stylize([ - this.expected, - this.operator, - this.actual - ].join(' '), 'yellow'); - } -}; - diff --git a/node_modules/vows/lib/assert/macros.js b/node_modules/vows/lib/assert/macros.js deleted file mode 100644 index 154aa14..0000000 --- a/node_modules/vows/lib/assert/macros.js +++ /dev/null @@ -1,215 +0,0 @@ -var assert = require('assert'), - utils = require('./utils'); - -var messages = { - 'equal' : "expected {expected},\n\tgot\t {actual} ({operator})", - 'notEqual' : "didn't expect {actual} ({operator})" -}; -messages['strictEqual'] = messages['deepEqual'] = messages['equal']; -messages['notStrictEqual'] = messages['notDeepEqual'] = messages['notEqual']; - -for (var key in messages) { - assert[key] = (function (key, callback) { - return function (actual, expected, message) { - callback(actual, expected, message || messages[key]); - }; - })(key, assert[key]); -} - -assert.ok = (function (callback) { - return function (actual, message) { - callback(actual, message || "expected expression to evaluate to {expected}, but was {actual}"); - }; -})(assert.ok); - -assert.match = function (actual, expected, message) { - if (! expected.test(actual)) { - assert.fail(actual, expected, message || "expected {actual} to match {expected}", "match", assert.match); - } -}; -assert.matches = assert.match; - -assert.isTrue = function (actual, message) { - if (actual !== true) { - assert.fail(actual, true, message || "expected {expected}, got {actual}", "===", assert.isTrue); - } -}; -assert.isFalse = function (actual, message) { - if (actual !== false) { - assert.fail(actual, false, message || "expected {expected}, got {actual}", "===", assert.isFalse); - } -}; -assert.isZero = function (actual, message) { - if (actual !== 0) { - assert.fail(actual, 0, message || "expected {expected}, got {actual}", "===", assert.isZero); - } -}; -assert.isNotZero = function (actual, message) { - if (actual === 0) { - assert.fail(actual, 0, message || "expected non-zero value, got {actual}", "===", assert.isNotZero); - } -}; - -assert.greater = function (actual, expected, message) { - if (actual <= expected) { - assert.fail(actual, expected, message || "expected {actual} to be greater than {expected}", ">", assert.greater); - } -}; -assert.lesser = function (actual, expected, message) { - if (actual >= expected) { - assert.fail(actual, expected, message || "expected {actual} to be lesser than {expected}", "<", assert.lesser); - } -}; - -assert.inDelta = function (actual, expected, delta, message) { - var lower = expected - delta; - var upper = expected + delta; - if (actual < lower || actual > upper) { - assert.fail(actual, expected, message || "expected {actual} to be in within *" + delta.toString() + "* of {expected}", null, assert.inDelta); - } -}; - -// -// Inclusion -// -assert.include = function (actual, expected, message) { - if ((function (obj) { - if (isArray(obj) || isString(obj)) { - return obj.indexOf(expected) === -1; - } else if (isObject(actual)) { - return ! obj.hasOwnProperty(expected); - } - return true; - })(actual)) { - assert.fail(actual, expected, message || "expected {actual} to include {expected}", "include", assert.include); - } -}; -assert.includes = assert.include; - -assert.deepInclude = function (actual, expected, message) { - if (!isArray(actual)) { - return assert.include(actual, expected, message); - } - if (!actual.some(function (item) { return utils.deepEqual(item, expected) })) { - assert.fail(actual, expected, message || "expected {actual} to include {expected}", "include", assert.deepInclude); - } -}; -assert.deepIncludes = assert.deepInclude; - -// -// Length -// -assert.isEmpty = function (actual, message) { - if ((isObject(actual) && Object.keys(actual).length > 0) || actual.length > 0) { - assert.fail(actual, 0, message || "expected {actual} to be empty", "length", assert.isEmpty); - } -}; -assert.isNotEmpty = function (actual, message) { - if ((isObject(actual) && Object.keys(actual).length === 0) || actual.length === 0) { - assert.fail(actual, 0, message || "expected {actual} to be not empty", "length", assert.isNotEmpty); - } -}; - -assert.lengthOf = function (actual, expected, message) { - if (actual.length !== expected) { - assert.fail(actual, expected, message || "expected {actual} to have {expected} element(s)", "length", assert.length); - } -}; - -// -// Type -// -assert.isArray = function (actual, message) { - assertTypeOf(actual, 'array', message || "expected {actual} to be an Array", assert.isArray); -}; -assert.isObject = function (actual, message) { - assertTypeOf(actual, 'object', message || "expected {actual} to be an Object", assert.isObject); -}; -assert.isNumber = function (actual, message) { - if (isNaN(actual)) { - assert.fail(actual, 'number', message || "expected {actual} to be of type {expected}", "isNaN", assert.isNumber); - } else { - assertTypeOf(actual, 'number', message || "expected {actual} to be a Number", assert.isNumber); - } -}; -assert.isBoolean = function (actual, message) { - if (actual !== true && actual !== false) { - assert.fail(actual, 'boolean', message || "expected {actual} to be a Boolean", "===", assert.isBoolean); - } -}; -assert.isNaN = function (actual, message) { - if (actual === actual) { - assert.fail(actual, 'NaN', message || "expected {actual} to be NaN", "===", assert.isNaN); - } -}; -assert.isNull = function (actual, message) { - if (actual !== null) { - assert.fail(actual, null, message || "expected {expected}, got {actual}", "===", assert.isNull); - } -}; -assert.isNotNull = function (actual, message) { - if (actual === null) { - assert.fail(actual, null, message || "expected non-null value, got {actual}", "===", assert.isNotNull); - } -}; -assert.isUndefined = function (actual, message) { - if (actual !== undefined) { - assert.fail(actual, undefined, message || "expected {actual} to be {expected}", "===", assert.isUndefined); - } -}; -assert.isDefined = function (actual, message) { - if(actual === undefined) { - assert.fail(actual, 0, message || "expected {actual} to be defined", "===", assert.isDefined); - } -}; -assert.isString = function (actual, message) { - assertTypeOf(actual, 'string', message || "expected {actual} to be a String", assert.isString); -}; -assert.isFunction = function (actual, message) { - assertTypeOf(actual, 'function', message || "expected {actual} to be a Function", assert.isFunction); -}; -assert.typeOf = function (actual, expected, message) { - assertTypeOf(actual, expected, message, assert.typeOf); -}; -assert.instanceOf = function (actual, expected, message) { - if (! (actual instanceof expected)) { - assert.fail(actual, expected, message || "expected {actual} to be an instance of {expected}", "instanceof", assert.instanceOf); - } -}; - -// -// Utility functions -// - -function assertTypeOf(actual, expected, message, caller) { - if (typeOf(actual) !== expected) { - assert.fail(actual, expected, message || "expected {actual} to be of type {expected}", "typeOf", caller); - } -}; - -function isArray (obj) { - return Array.isArray(obj); -} - -function isString (obj) { - return typeof(obj) === 'string' || obj instanceof String; -} - -function isObject (obj) { - return typeof(obj) === 'object' && obj && !isArray(obj); -} - -// A better `typeof` -function typeOf(value) { - var s = typeof(value), - types = [Object, Array, String, RegExp, Number, Function, Boolean, Date]; - - if (s === 'object' || s === 'function') { - if (value) { - types.forEach(function (t) { - if (value instanceof t) { s = t.name.toLowerCase() } - }); - } else { s = 'null' } - } - return s; -} diff --git a/node_modules/vows/lib/assert/utils.js b/node_modules/vows/lib/assert/utils.js deleted file mode 100644 index dccd0f6..0000000 --- a/node_modules/vows/lib/assert/utils.js +++ /dev/null @@ -1,77 +0,0 @@ - -// Taken from node/lib/assert.js -exports.deepEqual = function (actual, expected) { - if (actual === expected) { - return true; - - } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { - if (actual.length != expected.length) return false; - - for (var i = 0; i < actual.length; i++) { - if (actual[i] !== expected[i]) return false; - } - return true; - - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - } else { - return objEquiv(actual, expected); - } -} - -// Taken from node/lib/assert.js -exports.notDeepEqual = function (actual, expected, message) { - if (exports.deepEqual(actual, expected)) { - fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); - } -} - -// Taken from node/lib/assert.js -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -// Taken from node/lib/assert.js -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -// Taken from node/lib/assert.js -function objEquiv(a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - if (a.prototype !== b.prototype) return false; - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return exports.deepEqual(a, b); - } - try { - var ka = Object.keys(a), - kb = Object.keys(b), - key, i; - } catch (e) { - return false; - } - if (ka.length != kb.length) - return false; - ka.sort(); - kb.sort(); - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!exports.deepEqual(a[key], b[key])) return false; - } - return true; -} - diff --git a/node_modules/vows/lib/vows.js b/node_modules/vows/lib/vows.js deleted file mode 100644 index 363f96f..0000000 --- a/node_modules/vows/lib/vows.js +++ /dev/null @@ -1,255 +0,0 @@ -// -// Vows.js - asynchronous event-based BDD for node.js -// -// usage: -// -// var vows = require('vows'); -// -// vows.describe('Deep Thought').addBatch({ -// "An instance of DeepThought": { -// topic: new DeepThought, -// -// "should know the answer to the ultimate question of life": function (deepThought) { -// assert.equal (deepThought.question('what is the answer to the universe?'), 42); -// } -// } -// }).run(); -// -var util = require('util'), - path = require('path'), - events = require('events'), - vows = exports; - -// Options -vows.options = { - Emitter: events.EventEmitter, - reporter: require('./vows/reporters/dot-matrix'), - matcher: /.*/, - error: true // Handle "error" event -}; - -vows.__defineGetter__('reporter', function () { - return vows.options.reporter; -}); - -var stylize = require('./vows/console').stylize; -var console = vows.console = require('./vows/console'); - -vows.inspect = require('./vows/console').inspect; -vows.prepare = require('./vows/extras').prepare; -vows.tryEnd = require('./vows/suite').tryEnd; - -// -// Assertion Macros & Extensions -// -require('./assert/error'); -require('./assert/macros'); - -// -// Suite constructor -// -var Suite = require('./vows/suite').Suite; - -// -// This function gets added to events.EventEmitter.prototype, by default. -// It's essentially a wrapper around `on`, which adds all the specification -// goodness. -// -function addVow(vow) { - var batch = vow.batch, - event = vow.binding.context.event || 'success', - self = this; - - batch.total ++; - batch.vows.push(vow); - - // always set a listener on the event - this.on(event, function () { - var args = Array.prototype.slice.call(arguments); - // If the vow is a sub-event then we know it is an - // emitted event. So I don't muck with the arguments - // However the legacy behavior: - // If the callback is expecting two or more arguments, - // pass the error as the first (null) and the result after. - if (!(this.ctx && this.ctx.isEvent) && - vow.callback.length >= 2 && batch.suite.options.error) { - args.unshift(null); - } - runTest(args, this.ctx); - vows.tryEnd(batch); - }); - - if (event !== 'error') { - this.on("error", function (err) { - if (vow.callback.length >= 2 || !batch.suite.options.error) { - runTest(arguments, this.ctx); - } else { - output('errored', { type: 'promise', error: err.stack || - err.message || JSON.stringify(err) }); - } - vows.tryEnd(batch); - }); - } - - // in case an event fired before we could listen - if (this._vowsEmitedEvents && - this._vowsEmitedEvents.hasOwnProperty(event)) { - // make sure no one is messing with me - if (Array.isArray(this._vowsEmitedEvents[event])) { - // I don't think I need to optimize for one event, - // I think it is more important to make sure I check the vow n times - self._vowsEmitedEvents[event].forEach(function(args) { - runTest(args, self.ctx); - }); - } else { - // initial conditions problem - throw new Error('_vowsEmitedEvents[' + event + '] is not an Array') - } - vows.tryEnd(batch); - } - - return this; - - function runTest(args, ctx) { - if (vow.callback instanceof String) { - return output('pending'); - } - - if (vow.binding.context.isEvent && vow.binding.context.after) { - var after = vow.binding.context.after; - // only need to check order. I won't get here if the after event - // has never been emitted - if (self._vowsEmitedEventsOrder.indexOf(after) > - self._vowsEmitedEventsOrder.indexOf(event)) { - output('broken', event + ' emitted before ' + after); - return; - } - } - - // Run the test, and try to catch `AssertionError`s and other exceptions; - // increment counters accordingly. - try { - vow.callback.apply(ctx === global || !ctx ? vow.binding : ctx, args); - output('honored'); - } catch (e) { - if (e.name && e.name.match(/AssertionError/)) { - output('broken', e.toString().replace(/\`/g, '`')); - } else { - output('errored', e.stack || e.message || e); - } - } - } - - function output(status, exception) { - batch[status] ++; - vow.status = status; - - if (vow.context && batch.lastContext !== vow.context) { - batch.lastContext = vow.context; - batch.suite.report(['context', vow.context]); - } - batch.suite.report(['vow', { - title: vow.description, - context: vow.context, - status: status, - exception: exception || null - }]); - } -}; - -// -// On exit, check that all promises have been fired. -// If not, report an error message. -// -process.on('exit', function () { - var results = { honored: 0, broken: 0, errored: 0, pending: 0, total: 0 }, - failure; - - vows.suites.forEach(function (s) { - if ((s.results.total > 0) && (s.results.time === null)) { - s.reporter.print('\n\n'); - s.reporter.report(['error', { error: "Asynchronous Error", suite: s }]); - } - s.batches.forEach(function (b) { - var unFired = []; - - b.vows.forEach(function (vow) { - if (! vow.status) { - if (unFired.indexOf(vow.context) === -1) { - unFired.push(vow.context); - } - } - }); - - if (unFired.length > 0) { util.print('\n') } - - unFired.forEach(function (title) { - s.reporter.report(['error', { - error: "callback not fired", - context: title, - batch: b, - suite: s - }]); - }); - - if (b.status === 'begin') { - failure = true; - results.errored ++; - results.total ++; - } - Object.keys(results).forEach(function (k) { results[k] += b[k] }); - }); - }); - if (failure) { - util.puts(console.result(results)); - } -}); - -vows.suites = []; - -// We need the old emit function so we can hook it -// and do magic to deal with events that have fired -var oldEmit = vows.options.Emitter.prototype.emit; - -// -// Create a new test suite -// -vows.describe = function (subject) { - var suite = new(Suite)(subject); - - this.options.Emitter.prototype.addVow = addVow; - // just in case someone emit's before I get to it - this.options.Emitter.prototype.emit = function (event) { - this._vowsEmitedEvents = this._vowsEmitedEvents || {}; - this._vowsEmitedEventsOrder = this._vowsEmitedEventsOrder || []; - // slice off the event - var args = Array.prototype.slice.call(arguments, 1); - // if multiple events are fired, add or push - if (this._vowsEmitedEvents.hasOwnProperty(event)) { - this._vowsEmitedEvents[event].push(args); - } else { - this._vowsEmitedEvents[event] = [args]; - } - - // push the event onto a stack so I have an order - this._vowsEmitedEventsOrder.push(event); - return oldEmit.apply(this, arguments); - } - this.suites.push(suite); - - // - // Add any additional arguments as batches if they're present - // - if (arguments.length > 1) { - for (var i = 1, l = arguments.length; i < l; ++i) { - suite.addBatch(arguments[i]); - } - } - - return suite; -}; - - -vows.version = JSON.parse(require('fs') - .readFileSync(path.join(__dirname, '..', 'package.json'))) - .version diff --git a/node_modules/vows/lib/vows/console.js b/node_modules/vows/lib/vows/console.js deleted file mode 100644 index 900cef9..0000000 --- a/node_modules/vows/lib/vows/console.js +++ /dev/null @@ -1,140 +0,0 @@ -var eyes = require('eyes').inspector({ stream: null, styles: false }); - -// Stylize a string -this.stylize = function stylize(str, style) { - if (module.exports.nocolor) { - return str; - } - - var styles = { - 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'cyan' : [96, 39], - 'yellow' : [33, 39], - 'green' : [32, 39], - 'red' : [31, 39], - 'grey' : [90, 39], - 'green-hi' : [92, 32], - }; - return '\033[' + styles[style][0] + 'm' + str + - '\033[' + styles[style][1] + 'm'; -}; - -var $ = this.$ = function (str) { - str = new(String)(str); - - ['bold', 'grey', 'yellow', 'red', 'green', 'white', 'cyan', 'italic'].forEach(function (style) { - Object.defineProperty(str, style, { - get: function () { - return exports.$(exports.stylize(this, style)); - } - }); - }); - return str; -}; - -this.puts = function (options) { - var stylize = exports.stylize; - options.stream || (options.stream = process.stdout); - options.tail = options.tail || ''; - - return function (args) { - args = Array.prototype.slice.call(arguments); - if (!options.raw) { - args = args.map(function (a) { - return a.replace(/`([^`]+)`/g, function (_, capture) { return stylize(capture, 'italic') }) - .replace(/\*([^*]+)\*/g, function (_, capture) { return stylize(capture, 'bold') }) - .replace(/\n/g, function (_, capture) { return ' \n ' } ); - }); - } - return options.stream.write(args.join('\n') + options.tail); - }; -}; - -this.result = function (event) { - var result = [], buffer = [], time = '', header; - var complete = event.honored + event.pending + event.errored + event.broken; - var status = (event.errored && 'errored') || (event.broken && 'broken') || - (event.honored && 'honored') || (event.pending && 'pending'); - - if (event.total === 0) { - return [$("Could not find any tests to run.").bold.red]; - } - - event.honored && result.push($(event.honored).bold + " honored"); - event.broken && result.push($(event.broken).bold + " broken"); - event.errored && result.push($(event.errored).bold + " errored"); - event.pending && result.push($(event.pending).bold + " pending"); - - if (complete < event.total) { - result.push($(event.total - complete).bold + " dropped"); - } - - result = result.join(' ∙ '); - - header = { - honored: '✓ ' + $('OK').bold.green, - broken: '✗ ' + $('Broken').bold.yellow, - errored: '✗ ' + $('Errored').bold.red, - pending: '- ' + $('Pending').bold.cyan - }[status] + ' » '; - - if (typeof(event.time) === 'number') { - time = ' (' + event.time.toFixed(3) + 's)'; - time = this.stylize(time, 'grey'); - } - buffer.push(header + result + time + '\n'); - - return buffer; -}; - -this.inspect = function inspect(val) { - if (module.exports.nocolor) { - return eyes(val); - } - - return '\033[1m' + eyes(val) + '\033[22m'; -}; - -this.error = function (obj) { - var string = '✗ ' + $('Errored ').red + '» '; - string += $(obj.error).red.bold + '\n'; - string += (obj.context ? ' in ' + $(obj.context).red + '\n': ''); - string += ' in ' + $(obj.suite.subject).red + '\n'; - string += ' in ' + $(obj.suite._filename).red; - - return string; -}; - -this.contextText = function (event) { - return ' ' + event; -}; - -this.vowText = function (event) { - var buffer = []; - - buffer.push(' ' + { - honored: ' ✓ ', - broken: ' ✗ ', - errored: ' ✗ ', - pending: ' - ' - }[event.status] + this.stylize(event.title, ({ - honored: 'green', - broken: 'yellow', - errored: 'red', - pending: 'cyan' - })[event.status])); - - if (event.status === 'broken') { - buffer.push(' » ' + event.exception); - } else if (event.status === 'errored') { - if (event.exception.type === 'promise') { - buffer.push(' » ' + this.stylize("An unexpected error was caught: " + - this.stylize(event.exception.error, 'bold'), 'red')); - } else { - buffer.push(' ' + this.stylize(event.exception, 'red')); - } - } - return buffer.join('\n'); -}; diff --git a/node_modules/vows/lib/vows/context.js b/node_modules/vows/lib/vows/context.js deleted file mode 100644 index b11d676..0000000 --- a/node_modules/vows/lib/vows/context.js +++ /dev/null @@ -1,76 +0,0 @@ - -this.Context = function (vow, ctx, env) { - var that = this; - - this.tests = vow.callback; - this.topics = (ctx.topics || []).slice(0); - this.emitter = null; - this.env = env || {}; - this.env.context = this; - - this.env.callback = function (/* arguments */) { - var ctx = this; - var args = Array.prototype.slice.call(arguments); - - var emit = (function (args) { - // - // Convert callback-style results into events. - // - if (vow.batch.suite.options.error) { - return function () { - var e = args.shift(); - that.emitter.ctx = ctx; - // We handle a special case, where the first argument is a - // boolean, in which case we treat it as a result, and not - // an error. This is useful for `path.exists` and other - // functions like it, which only pass a single boolean - // parameter instead of the more common (error, result) pair. - if (typeof(e) === 'boolean' && args.length === 0) { - that.emitter.emit.call(that.emitter, 'success', e); - } else { - if (e) { that.emitter.emit.apply(that.emitter, ['error', e].concat(args)) } - else { that.emitter.emit.apply(that.emitter, ['success'].concat(args)) } - } - }; - } else { - return function () { - that.emitter.ctx = ctx; - that.emitter.emit.apply(that.emitter, ['success'].concat(args)); - }; - } - })(args.slice(0)); - // If `this.callback` is called synchronously, - // the emitter will not have been set yet, - // so we defer the emition, that way it'll behave - // asynchronously. - if (that.emitter) { emit() } - else { process.nextTick(emit) } - }; - this.name = vow.description; - // events is an alias for on - if (this.name === 'events') { - this.name = vow.description = 'on'; - } - - // if this is a sub-event context AND it's context was an event, - // then I must enforce event order. - // this will not do a good job of handling pin-pong events - if (this.name === 'on' && ctx.isEvent) { - this.after = ctx.name; - } - - if (ctx.name === 'on') { - this.isEvent = true; - this.event = this.name; - this.after = ctx.after; - } else { - this.isEvent = false; - this.event = 'success'; - } - - this.title = [ - ctx.title || '', - vow.description || '' - ].join(/^[#.:]/.test(vow.description) ? '' : ' ').trim(); -}; - diff --git a/node_modules/vows/lib/vows/coverage/file.js b/node_modules/vows/lib/vows/coverage/file.js deleted file mode 100644 index 5bdef90..0000000 --- a/node_modules/vows/lib/vows/coverage/file.js +++ /dev/null @@ -1,29 +0,0 @@ - -exports.coverage = function (filename, data) { - var ret = { - filename: filename, - coverage: 0, - hits: 0, - misses: 0, - sloc : 0 - }; - - var source = data.source; - ret.source = source.map(function (line, num) { - num++; - - if (data[num] === 0) { - ret.misses++; - ret.sloc++; - } else if (data[num] !== undefined) { - ret.hits++; - ret.sloc++; - } - - return { line: line, coverage: (data[num] === undefined ? '' : data[num]) }; - }); - - ret.coverage = (ret.hits / ret.sloc) * 100; - - return ret; -}; \ No newline at end of file diff --git a/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html b/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html deleted file mode 100644 index 691287b..0000000 --- a/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html b/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html deleted file mode 100644 index aa2f107..0000000 --- a/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - diff --git a/node_modules/vows/lib/vows/coverage/report-html.js b/node_modules/vows/lib/vows/coverage/report-html.js deleted file mode 100644 index f7e5b72..0000000 --- a/node_modules/vows/lib/vows/coverage/report-html.js +++ /dev/null @@ -1,54 +0,0 @@ -var util = require('util'), - fs = require('fs'), - file = require('./file'); - -this.name = 'coverage-report-html'; - -function getCoverageClass( data ) { - var fullCoverage= (data.coverage == 100); - var okCoverage= (!fullCoverage && data.coverage >=60); - var coverageClass= ''; - if( fullCoverage ) coverageClass= 'fullCoverage'; - else if( okCoverage) coverageClass= 'okCoverage'; - else coverageClass= 'poorCoverage'; - return coverageClass; -} -this.report = function (coverageMap) { - var out, head, foot; - - try { - out = fs.openSync("coverage.html", "w"); - head = fs.readFileSync(__dirname + "/fragments/coverage-head.html", "utf8"); - foot = fs.readFileSync(__dirname + "/fragments/coverage-foot.html", "utf8"); - } catch (error) { - util.print("Error: Unable to write to file coverage.html\n"); - return; - } - - fs.writeSync(out, head); - - for (var filename in coverageMap) { - if (coverageMap.hasOwnProperty(filename)) { - var data = file.coverage(filename, coverageMap[filename]); - var coverageClass= getCoverageClass( data ); - fs.writeSync(out, "

          " + filename + "

          \n"); - fs.writeSync(out, '' + "[ hits: " + data.hits); - fs.writeSync(out, ", misses: " + data.misses + ", sloc: " + data.sloc); - fs.writeSync(out, ", coverage: " + data.coverage.toFixed(2) + "% ]" + " [+]\n"); - fs.writeSync(out, "\n"); - fs.writeSync(out, "
          \n"); - } - } - - fs.writeSync(out, foot); - fs.close(out); -}; diff --git a/node_modules/vows/lib/vows/coverage/report-json.js b/node_modules/vows/lib/vows/coverage/report-json.js deleted file mode 100644 index bcbab25..0000000 --- a/node_modules/vows/lib/vows/coverage/report-json.js +++ /dev/null @@ -1,54 +0,0 @@ -var util = require('util'), - fs = require('fs'), - file = require('./file'); - -this.name = 'coverage-report-json'; - -this.report = function (coverageMap) { - var output = { - meta: { - "generator": "vowsjs", - "generated": new Date().toString(), - "instrumentation": "node-jscoverage", - "file-version": "1.0" - }, - files: [ ], - coverage: [ ] - }; - - - for (var filename in coverageMap) { - if (coverageMap.hasOwnProperty(filename)) { - var data = file.coverage(filename, coverageMap[filename]); - - var coverage = { - file: filename, - coverage: data.coverage.toFixed(2), - hits: data.hits, - misses: data.misses, - sloc: data.sloc, - source: { } - }; - - for (var i = 0; i < data.source.length; i++) { - coverage.source[i + 1] = { - line: data.source[i].line, - coverage: data.source[i].coverage - }; - } - - output.coverage.push(coverage); - - output.files.push(filename); - } - } - - try { - out = fs.openSync("coverage.json", "w"); - fs.writeSync(out, JSON.stringify(output)); - fs.close(out); - } catch (error) { - util.print("Error: Unable to write to file coverage.json\n"); - return; - } -}; diff --git a/node_modules/vows/lib/vows/coverage/report-plain.js b/node_modules/vows/lib/vows/coverage/report-plain.js deleted file mode 100644 index 9de7005..0000000 --- a/node_modules/vows/lib/vows/coverage/report-plain.js +++ /dev/null @@ -1,38 +0,0 @@ -var util = require('util'), - file = require('./file'); - -this.name = 'coverage-report-plain'; - -function lpad(str, width) { - str = String(str); - var n = width - str.length; - - if (n < 1) { - return str; - } - - while (n--) { - str = ' ' + str; - } - - return str; -} - - -this.report = function (coverageMap) { - for (var filename in coverageMap) { - if (coverageMap.hasOwnProperty(filename)) { - var data = file.coverage(filename, coverageMap[filename]); - - util.print(filename + ":\n"); - util.print("[ hits: " + data.hits + ", misses: " + data.misses); - util.print(", sloc: " + data.sloc + ", coverage: " + data.coverage.toFixed(2) + "% ]\n"); - - for (var i = 0; i < data.source.length; i++) { - util.print(lpad(data.source[i].coverage, 5) + " | " + data.source[i].line + "\n"); - } - - util.print("\n"); - } - } -}; diff --git a/node_modules/vows/lib/vows/coverage/report-xml.js b/node_modules/vows/lib/vows/coverage/report-xml.js deleted file mode 100644 index b9ff95b..0000000 --- a/node_modules/vows/lib/vows/coverage/report-xml.js +++ /dev/null @@ -1,81 +0,0 @@ -var fs = require('fs'), - file = require('./file'); - -this.name = 'coverage-report-xml'; - -this.report = function (coverageMap) { - var all = { - xml: '', - packages: 0, - files: 0, - lines: 0, - hits: 0 - }, - data = {}; - - // group data by path - for (var filename in coverageMap) { - if (coverageMap.hasOwnProperty(filename)) { - var pkg = (filename.indexOf('/') > 0) - ? filename.substr(0, filename.lastIndexOf('/')) - : filename; - if (!data[pkg]) { - data[pkg] = {}; - } - data[pkg][ (filename.indexOf('/')) - ? filename.substr(filename.lastIndexOf('/') + 1, filename.length) - : filename ] - = file.coverage(filename, coverageMap[filename]); - } - } - - // generate groups xml-fragment - for (var pkg in data) { - if (data.hasOwnProperty(pkg)) { - var pkgStat = { - xml: '', - files: 0, - lines: 0, - hits: 0 - }; - - all.xml += '\t\n'; - - for (var filename in data[pkg]) { - if (data[pkg].hasOwnProperty(filename)) { - pkgStat.files += 1; - pkgStat.lines += data[pkg][filename].sloc; - pkgStat.hits += data[pkg][filename].hits; - - pkgStat.xml += '\t\t\n' - + '\t\t\t\n' - + '\t\t\n'; - } - } - - all.packages += 1; - all.files += pkgStat.files; - all.lines += pkgStat.lines; - all.hits += pkgStat.hits; - - all.xml += '\t\t\n' - + pkgStat.xml - + '\t\n'; - } - } - - all.xml = '\n' - + '\n\n' - + '\t\n' - + '\t\n' - + '\t\n' - + '\t\n' - + '\t\n' - + '\n\n' - + '\n' - + '\t\n' - + all.xml - + '\n\n\n'; - - fs.writeFileSync('coverage.xml', all.xml); -}; diff --git a/node_modules/vows/lib/vows/extras.js b/node_modules/vows/lib/vows/extras.js deleted file mode 100644 index a90d7a5..0000000 --- a/node_modules/vows/lib/vows/extras.js +++ /dev/null @@ -1,28 +0,0 @@ -var events = require('events'); -// -// Wrap a Node.js style async function into an EventEmmitter -// -this.prepare = function (obj, targets) { - targets.forEach(function (target) { - if (target in obj) { - obj[target] = (function (fun) { - return function () { - var args = Array.prototype.slice.call(arguments); - var ee = new(events.EventEmitter); - - args.push(function (err /* [, data] */) { - var args = Array.prototype.slice.call(arguments, 1); - - if (err) { ee.emit.apply(ee, ['error', err].concat(args)) } - else { ee.emit.apply(ee, ['success'].concat(args)) } - }); - fun.apply(obj, args); - - return ee; - }; - })(obj[target]); - } - }); - return obj; -}; - diff --git a/node_modules/vows/lib/vows/reporters/dot-matrix.js b/node_modules/vows/lib/vows/reporters/dot-matrix.js deleted file mode 100644 index 0ecf590..0000000 --- a/node_modules/vows/lib/vows/reporters/dot-matrix.js +++ /dev/null @@ -1,67 +0,0 @@ -var options = { tail: '' }, - console = require('../../vows/console'), - stylize = console.stylize, - puts = console.puts(options); -// -// Console reporter -// -var messages = [], lastContext; - -this.name = 'dot-matrix'; -this.setStream = function (s) { - options.stream = s; -}; - -this.reset = function () { - messages = []; - lastContext = null; -}; -this.report = function (data) { - var event = data[1]; - - switch (data[0]) { - case 'subject': - // messages.push(stylize(event, 'underline') + '\n'); - break; - case 'context': - break; - case 'vow': - if (event.status === 'honored') { - puts(stylize('·', 'green')); - } else if (event.status === 'pending') { - puts(stylize('-', 'cyan')); - } else { - if (lastContext !== event.context) { - lastContext = event.context; - messages.push(' ' + event.context); - } - if (event.status === 'broken') { - puts(stylize('✗', 'yellow')); - messages.push(console.vowText(event)); - } else if (event.status === 'errored') { - puts(stylize('✗', 'red')); - messages.push(console.vowText(event)); - } - messages.push(''); - } - break; - case 'end': - puts(' '); - break; - case 'finish': - if (messages.length) { - puts('\n\n' + messages.join('\n')); - } else { - puts(''); - } - puts(console.result(event).join('\n')); - break; - case 'error': - puts(console.error(event)); - break; - } -}; - -this.print = function (str) { - puts(str); -}; diff --git a/node_modules/vows/lib/vows/reporters/json.js b/node_modules/vows/lib/vows/reporters/json.js deleted file mode 100644 index 20c1366..0000000 --- a/node_modules/vows/lib/vows/reporters/json.js +++ /dev/null @@ -1,33 +0,0 @@ -var options = { tail: '\n', raw: true }; -var console = require('../../vows/console'); -var puts = console.puts(options); - -// -// Console JSON reporter -// -this.name = 'json'; -this.setStream = function (s) { - options.stream = s; -}; - -function removeCircularSuite(obj, suite) { - var result = {}; - - if (typeof obj !== 'object' || obj === null) return obj; - - Object.keys(obj).forEach(function(key) { - if (obj[key] === suite) { - result[key] = {}; - } else { - result[key] = removeCircularSuite(obj[key], suite || obj.suite); - } - }); - - return result; -}; - -this.report = function (obj) { - puts(JSON.stringify(removeCircularSuite(obj))); -}; - -this.print = function (str) {}; diff --git a/node_modules/vows/lib/vows/reporters/silent.js b/node_modules/vows/lib/vows/reporters/silent.js deleted file mode 100644 index fe90a33..0000000 --- a/node_modules/vows/lib/vows/reporters/silent.js +++ /dev/null @@ -1,8 +0,0 @@ -// -// Silent reporter - "Shhh" -// -this.name = 'silent'; -this.reset = function () {}; -this.report = function () {}; -this.print = function () {}; - diff --git a/node_modules/vows/lib/vows/reporters/spec.js b/node_modules/vows/lib/vows/reporters/spec.js deleted file mode 100644 index d1c6dd8..0000000 --- a/node_modules/vows/lib/vows/reporters/spec.js +++ /dev/null @@ -1,42 +0,0 @@ -var util = require('util'); - -var options = { tail: '\n' }; -var console = require('../../vows/console'); -var stylize = console.stylize, - puts = console.puts(options); -// -// Console reporter -// - -this.name = 'spec'; -this.setStream = function (s) { - options.stream = s; -}; -this.report = function (data) { - var event = data[1]; - - switch (data[0]) { - case 'subject': - puts('\n♢ ' + stylize(event, 'bold') + '\n'); - break; - case 'context': - puts(console.contextText(event)); - break; - case 'vow': - puts(console.vowText(event)); - break; - case 'end': - util.print('\n'); - break; - case 'finish': - puts(console.result(event).join('\n')); - break; - case 'error': - puts(console.error(event)); - break; - } -}; - -this.print = function (str) { - util.print(str); -}; diff --git a/node_modules/vows/lib/vows/reporters/watch.js b/node_modules/vows/lib/vows/reporters/watch.js deleted file mode 100644 index 58f6e3c..0000000 --- a/node_modules/vows/lib/vows/reporters/watch.js +++ /dev/null @@ -1,37 +0,0 @@ -var options = {}; -var console = require('../../vows/console'); -var spec = require('../../vows/reporters/spec'); -var stylize = console.stylize, - puts = console.puts(options); -// -// Console reporter -// -var lastContext; - -this.name = 'watch'; -this.setStream = function (s) { - options.stream = s; -}; -this.reset = function () { - lastContext = null; -}; -this.report = function (data) { - var event = data[1]; - - switch (data[0]) { - case 'vow': - if (['honored', 'pending'].indexOf(event.status) === -1) { - if (lastContext !== event.context) { - lastContext = event.context; - puts(console.contextText(event.context)); - } - puts(console.vowText(event)); - puts(''); - } - break; - case 'error': - puts(console.error(event)); - break; - } -}; -this.print = function (str) {}; diff --git a/node_modules/vows/lib/vows/reporters/xunit.js b/node_modules/vows/lib/vows/reporters/xunit.js deleted file mode 100644 index 411a948..0000000 --- a/node_modules/vows/lib/vows/reporters/xunit.js +++ /dev/null @@ -1,90 +0,0 @@ -// xunit outoput for vows, so we can run things under hudson -// -// The translation to xunit is simple. Most likely more tags/attributes can be -// added, see: http://ant.1045680.n5.nabble.com/schema-for-junit-xml-output-td1375274.html -// - -var puts = require('util').puts; - -var buffer = [], - curSubject = null; - -function xmlEnc(value) { - return !value ? value : String(value).replace(/&/g, "&") - .replace(/>/g, ">") - .replace(/'; -} - -function cdata(data) { - return ''; -} - -this.name = 'xunit'; -this.report = function (data) { - var event = data[1]; - - switch (data[0]) { - case 'subject': - curSubject = event; - break; - case 'context': - break; - case 'vow': - switch (event.status) { - case 'honored': - buffer.push(tag('testcase', {classname: curSubject, name: event.context + ': ' + event.title}, true)); - break; - case 'broken': - var err = tag('error', {type: 'vows.event.broken', message: 'Broken test'}, false, cdata(event.exception)); - buffer.push(tag('testcase', {classname: curSubject, name: event.context + ': ' + event.title}, false, err)); - break; - case 'errored': - var skip = tag('skipped', {type: 'vows.event.errored', message: 'Errored test'}, false, cdata(event.exception)); - buffer.push(tag('testcase', {classname: curSubject, name: event.context + ': ' + event.title}, false, skip)); - break; - case 'pending': - // nop - break; - } - break; - case 'end': - buffer.push(end('testcase')); - break; - case 'finish': - buffer.unshift(tag('testsuite', {name: 'Vows test', tests: event.total, timestamp: (new Date()).toUTCString(), errors: event.errored, failures: event.broken, skip: event.pending, time: event.time})); - buffer.push(end('testsuite')); - puts(buffer.join('\n')); - break; - case 'error': - break; - } -}; - -this.print = function (str) { }; diff --git a/node_modules/vows/lib/vows/suite.js b/node_modules/vows/lib/vows/suite.js deleted file mode 100644 index 737b295..0000000 --- a/node_modules/vows/lib/vows/suite.js +++ /dev/null @@ -1,380 +0,0 @@ -var events = require('events'), - path = require('path'); - -var vows = require('../vows'); -var Context = require('../vows/context').Context; - -this.Suite = function (subject) { - this.subject = subject; - this.matcher = /.*/; - this.reporter = require('./reporters/dot-matrix'); - this.batches = []; - this.options = { error: true }; - this.reset(); -}; - -this.Suite.prototype = new(function () { - this.reset = function () { - this.results = { - honored: 0, - broken: 0, - errored: 0, - pending: 0, - total: 0, - time: null - }; - this.batches.forEach(function (b) { - b.lastContext = null; - b.remaining = b._remaining; - b.honored = b.broken = b.errored = b.total = b.pending = 0; - b.vows.forEach(function (vow) { vow.status = null }); - b.teardowns = []; - }); - }; - - this.addBatch = function (tests) { - this.batches.push({ - tests: tests, - suite: this, - vows: [], - remaining: 0, - _remaining: 0, - honored: 0, - broken: 0, - errored: 0, - pending: 0, - total: 0, - teardowns: [] - }); - return this; - }; - this.addVows = this.addBatch; - - this.parseBatch = function (batch, matcher) { - var tests = batch.tests; - - if ('topic' in tests) { - throw new(Error)("missing top-level context."); - } - // Count the number of vows/promises expected to fire, - // so we know when the tests are over. - // We match the keys against `matcher`, to decide - // whether or not they should be included in the test. - // Any key, including assertion function keys can be matched. - // If a child matches, then the n parent topics must not be skipped. - (function count(tests, _match) { - var match = false; - - var keys = Object.keys(tests).filter(function (k) { - return k !== 'topic' && k !== 'teardown'; - }); - - for (var i = 0, key; i < keys.length; i++) { - key = keys[i]; - - // If the parent node, or this one matches. - match = _match || matcher.test(key); - - if (typeof(tests[key]) === 'object') { - match = count(tests[key], match); - } else { - if (typeof(tests[key]) === 'string') { - tests[key] = new(String)(tests[key]); - } - if (! match) { - tests[key]._skip = true; - } - } - } - - // If any of the children matched, - // don't skip this node. - for (var i = 0; i < keys.length; i++) { - if (! tests[keys[i]]._skip) { match = true } - } - - if (match) { batch.remaining ++ } - else { tests._skip = true } - - return match; - })(tests, false); - - batch._remaining = batch.remaining; - }; - - this.runBatch = function (batch) { - var topic, - tests = batch.tests, - promise = batch.promise = new(events.EventEmitter); - - var that = this; - - batch.status = 'begin'; - - // The test runner, it calls itself recursively, passing the - // previous context to the inner contexts. This is so the `topic` - // functions have access to all the previous context topics in their - // arguments list. - // It is defined and invoked at the same time. - // If it encounters a `topic` function, it waits for the returned - // promise to emit (the topic), at which point it runs the functions under it, - // passing the topic as an argument. - (function run(ctx, lastTopic) { - var old = false; - topic = ctx.tests.topic; - - if (typeof(topic) === 'function') { - if (ctx.isEvent || ctx.name === 'on') { - throw new Error('Event context cannot contain a topic'); - } - - // Run the topic, passing the previous context topics - // If topic `throw`s an exception, pass it down as a value - try { - topic = topic.apply(ctx.env, ctx.topics); - } - catch (ex) { - topic = ex; - } - - if (typeof(topic) === 'undefined') { ctx._callback = true } - } - - // If this context has a topic, store it in `lastTopic`, - // if not, use the last topic, passed down by a parent - // context. - if (typeof(topic) !== 'undefined' || ctx._callback) { - lastTopic = topic; - } else { - old = true; - topic = lastTopic; - } - - // If the topic doesn't return an event emitter (such as a promise), - // we create it ourselves, and emit the value on the next tick. - if (! (topic && - topic.constructor === events.EventEmitter)) { - // If the context is a traditional vow, then a topic can ONLY - // be an EventEmitter. However if the context is a sub-event - // then the topic may be an instanceof EventEmitter - if (!ctx.isEvent || - (ctx.isEvent && !(topic instanceof events.EventEmitter))) { - - ctx.emitter = new(events.EventEmitter); - - if (! ctx._callback) { - process.nextTick(function (val) { - return function () { - ctx.emitter.emit("success", val) - }; - }(topic)); - } - // if I have a callback, push the new topic back up to - // lastTopic - if (ctx._callback) { - lastTopic = topic = ctx.emitter; - } else { - topic = ctx.emitter; - } - } - } - - topic.on(ctx.event, function (val) { - // Once the topic fires, add the return value - // to the beginning of the topics list, so it - // becomes the first argument for the next topic. - // If we're using the parent topic, no need to - // prepend it to the topics list, or we'll get - // duplicates. - if (!old || ctx.isEvent) { - Array.prototype.unshift.apply(ctx.topics, arguments) - }; - }); - if (topic.setMaxListeners) { topic.setMaxListeners(Infinity) } - // Now run the tests, or sub-contexts - Object.keys(ctx.tests).filter(function (k) { - return ctx.tests[k] && k !== 'topic' && - k !== 'teardown' && !ctx.tests[k]._skip; - }).forEach(function (item) { - // Create a new evaluation context, - // inheriting from the parent one. - var env = Object.create(ctx.env); - env.suite = that; - - // Holds the current test or context - var vow = Object.create({ - callback: ctx.tests[item], - context: ctx.title, - description: item, - binding: ctx.env, - status: null, - batch: batch - }); - - // If we encounter a function, add it to the callbacks - // of the `topic` function, so it'll get called once the - // topic fires. - // If we encounter an object literal, we recurse, sending it - // our current context. - if ((typeof(vow.callback) === 'function') || - (vow.callback instanceof String)) { - topic.addVow(vow); - } else if (typeof(vow.callback) === 'object') { - // If there's a setup stage, we have to wait for it to fire, - // before calling the inner context. - // If the event has already fired, the context is 'on' or - // there is no setup stage, just run the inner context - // synchronously. - if (topic && - ctx.name !== 'on' && - !topic._vowsEmitedEvents.hasOwnProperty(ctx.event)) { - topic.on(ctx.event, function (ctx) { - return function (val) { - return run(new(Context)(vow, ctx, env), lastTopic); - }; - }(ctx)); - } else { - run(new(Context)(vow, ctx, env), lastTopic); - } - } - }); - // Teardown - if (ctx.tests.teardown) { - batch.teardowns.push(ctx); - } - if (! ctx.tests._skip) { - batch.remaining --; - } - // Check if we're done running the tests - exports.tryEnd(batch); - // This is our initial, empty context - })(new(Context)({ callback: tests, context: null, description: null }, {})); - return promise; - }; - - this.report = function () { - return this.reporter.report.apply(this.reporter, arguments); - }; - - this.run = function (options, callback) { - var that = this, start; - - options = options || {}; - - for (var k in options) { this.options[k] = options[k] } - - this.matcher = this.options.matcher || this.matcher; - this.reporter = this.options.reporter || this.reporter; - - this.batches.forEach(function (batch) { - that.parseBatch(batch, that.matcher); - }); - - this.reset(); - - start = new(Date); - - if (this.batches.filter(function (b) { return b.remaining > 0 }).length) { - this.report(['subject', this.subject]); - } - - return (function run(batches) { - var batch = batches.shift(); - - if (batch) { - // If the batch has no vows to run, - // go to the next one. - if (batch.remaining === 0) { - run(batches); - } else { - that.runBatch(batch).on('end', function () { - run(batches); - }); - } - } else { - that.results.time = (new(Date) - start) / 1000; - that.report(['finish', that.results]); - - if (callback) { callback(that.results) } - - if (that.results.honored + that.results.pending === that.results.total) { - return 0; - } else { - return 1; - } - } - })(this.batches.slice(0)); - }; - - this.runParallel = function () {}; - - this.export = function (module, options) { - for (var k in (options || {})) { this.options[k] = options[k] } - - if (require.main === module) { - return this.run(); - } else { - return module.exports[this.subject] = this; - } - }; - this.exportTo = function (module, options) { // Alias, for JSLint - return this.export(module, options); - }; -}); - -// -// Checks if all the tests in the batch have been run, -// and triggers the next batch (if any), by emitting the 'end' event. -// -this.tryEnd = function (batch) { - var result, style, time; - - if (batch.honored + batch.broken + batch.errored + batch.pending === batch.total && - batch.remaining === 0) { - - Object.keys(batch).forEach(function (k) { - (k in batch.suite.results) && (batch.suite.results[k] += batch[k]); - }); - - if (batch.teardowns) { - for (var i = batch.teardowns.length - 1, ctx; i >= 0; i--) { - runTeardown(batch.teardowns[i]); - } - - maybeFinish(); - } - - function runTeardown(teardown) { - var env = Object.create(teardown.env); - - Object.defineProperty(env, "callback", { - get: function () { - teardown.awaitingCallback = true; - - return function () { - teardown.awaitingCallback = false; - maybeFinish(); - }; - } - }); - - teardown.tests.teardown.apply(env, teardown.topics); - } - - function maybeFinish() { - var pending = batch.teardowns.filter(function (teardown) { - return teardown.awaitingCallback; - }); - - if (pending.length === 0) { - finish(); - } - } - - function finish() { - batch.status = 'end'; - batch.suite.report(['end']); - batch.promise.emit('end', batch.honored, batch.broken, batch.errored, batch.pending); - } - } -}; diff --git a/node_modules/vows/node_modules/eyes/LICENSE b/node_modules/vows/node_modules/eyes/LICENSE deleted file mode 100644 index a1edd93..0000000 --- a/node_modules/vows/node_modules/eyes/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2009 cloudhead - -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/vows/node_modules/eyes/Makefile b/node_modules/vows/node_modules/eyes/Makefile deleted file mode 100644 index a121dea..0000000 --- a/node_modules/vows/node_modules/eyes/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -test: - @@node test/eyes-test.js - -.PHONY: test diff --git a/node_modules/vows/node_modules/eyes/README.md b/node_modules/vows/node_modules/eyes/README.md deleted file mode 100644 index 7a92158..0000000 --- a/node_modules/vows/node_modules/eyes/README.md +++ /dev/null @@ -1,72 +0,0 @@ -eyes -==== - -a customizable value inspector for Node.js - -synopsis --------- - -I was tired of looking at cluttered output in the console -- something needed to be done, -`sys.inspect()` didn't display regexps correctly, and was too verbose, and I had an hour or two to spare. -So I decided to have some fun. _eyes_ were born. - -![eyes-ss](http://dl.dropbox.com/u/251849/eyes-js-ss.gif) - -_example of the output of a user-customized eyes.js inspector_ - -*eyes* also deals with circular objects in an intelligent way, and can pretty-print object literals. - -usage ------ - - var inspect = require('eyes').inspector({styles: {all: 'magenta'}}); - - inspect(something); // inspect with the settings passed to `inspector` - -or - - var eyes = require('eyes'); - - eyes.inspect(something); // inspect with the default settings - -you can pass a _label_ to `inspect()`, to keep track of your inspections: - - eyes.inspect(something, "a random value"); - -If you want to return the output of eyes without printing it, you can set it up this way: - - var inspect = require('eyes').inspector({ stream: null }); - - sys.puts(inspect({ something: 42 })); - -customization -------------- - -These are the default styles and settings used by _eyes_. - styles: { // Styles applied to stdout - all: 'cyan', // Overall style applied to everything - label: 'underline', // Inspection labels, like 'array' in `array: [1, 2, 3]` - other: 'inverted', // Objects which don't have a literal representation, such as functions - key: 'bold', // The keys in object literals, like 'a' in `{a: 1}` - - special: 'grey', // null, undefined... - string: 'green', - number: 'magenta', - bool: 'blue', // true false - regexp: 'green', // /\d+/ - }, - pretty: true, // Indent object literals - hideFunctions: false, // Don't output functions at all - stream: process.stdout, // Stream to write to, or null - maxLength: 2048 // Truncate output if longer - -You can overwrite them with your own, by passing a similar object to `inspector()` or `inspect()`. - - var inspect = require('eyes').inspector({ - styles: { - all: 'magenta', - special: 'bold' - }, - maxLength: 512 - }); - diff --git a/node_modules/vows/node_modules/eyes/lib/eyes.js b/node_modules/vows/node_modules/eyes/lib/eyes.js deleted file mode 100644 index 10d964b..0000000 --- a/node_modules/vows/node_modules/eyes/lib/eyes.js +++ /dev/null @@ -1,236 +0,0 @@ -// -// Eyes.js - a customizable value inspector for Node.js -// -// usage: -// -// var inspect = require('eyes').inspector({styles: {all: 'magenta'}}); -// inspect(something); // inspect with the settings passed to `inspector` -// -// or -// -// var eyes = require('eyes'); -// eyes.inspect(something); // inspect with the default settings -// -var eyes = exports, - stack = []; - -eyes.defaults = { - styles: { // Styles applied to stdout - all: 'cyan', // Overall style applied to everything - label: 'underline', // Inspection labels, like 'array' in `array: [1, 2, 3]` - other: 'inverted', // Objects which don't have a literal representation, such as functions - key: 'bold', // The keys in object literals, like 'a' in `{a: 1}` - special: 'grey', // null, undefined... - string: 'green', - number: 'magenta', - bool: 'blue', // true false - regexp: 'green', // /\d+/ - }, - pretty: true, // Indent object literals - hideFunctions: false, - showHidden: false, - stream: process.stdout, - maxLength: 2048 // Truncate output if longer -}; - -// Return a curried inspect() function, with the `options` argument filled in. -eyes.inspector = function (options) { - var that = this; - return function (obj, label, opts) { - return that.inspect.call(that, obj, label, - merge(options || {}, opts || {})); - }; -}; - -// If we have a `stream` defined, use it to print a styled string, -// if not, we just return the stringified object. -eyes.inspect = function (obj, label, options) { - options = merge(this.defaults, options || {}); - - if (options.stream) { - return this.print(stringify(obj, options), label, options); - } else { - return stringify(obj, options) + (options.styles ? '\033[39m' : ''); - } -}; - -// Output using the 'stream', and an optional label -// Loop through `str`, and truncate it after `options.maxLength` has been reached. -// Because escape sequences are, at this point embeded within -// the output string, we can't measure the length of the string -// in a useful way, without separating what is an escape sequence, -// versus a printable character (`c`). So we resort to counting the -// length manually. -eyes.print = function (str, label, options) { - for (var c = 0, i = 0; i < str.length; i++) { - if (str.charAt(i) === '\033') { i += 4 } // `4` because '\033[25m'.length + 1 == 5 - else if (c === options.maxLength) { - str = str.slice(0, i - 1) + '…'; - break; - } else { c++ } - } - return options.stream.write.call(options.stream, (label ? - this.stylize(label, options.styles.label, options.styles) + ': ' : '') + - this.stylize(str, options.styles.all, options.styles) + '\033[0m' + "\n"); -}; - -// Apply a style to a string, eventually, -// I'd like this to support passing multiple -// styles. -eyes.stylize = function (str, style, styles) { - var codes = { - 'bold' : [1, 22], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'cyan' : [36, 39], - 'magenta' : [35, 39], - 'blue' : [34, 39], - 'yellow' : [33, 39], - 'green' : [32, 39], - 'red' : [31, 39], - 'grey' : [90, 39] - }, endCode; - - if (style && codes[style]) { - endCode = (codes[style][1] === 39 && styles.all) ? codes[styles.all][0] - : codes[style][1]; - return '\033[' + codes[style][0] + 'm' + str + - '\033[' + endCode + 'm'; - } else { return str } -}; - -// Convert any object to a string, ready for output. -// When an 'array' or an 'object' are encountered, they are -// passed to specialized functions, which can then recursively call -// stringify(). -function stringify(obj, options) { - var that = this, stylize = function (str, style) { - return eyes.stylize(str, options.styles[style], options.styles) - }, index, result; - - if ((index = stack.indexOf(obj)) !== -1) { - return stylize(new(Array)(stack.length - index + 1).join('.'), 'special'); - } - stack.push(obj); - - result = (function (obj) { - switch (typeOf(obj)) { - case "string" : obj = stringifyString(obj.indexOf("'") === -1 ? "'" + obj + "'" - : '"' + obj + '"'); - return stylize(obj, 'string'); - case "regexp" : return stylize('/' + obj.source + '/', 'regexp'); - case "number" : return stylize(obj + '', 'number'); - case "function" : return options.stream ? stylize("Function", 'other') : '[Function]'; - case "null" : return stylize("null", 'special'); - case "undefined": return stylize("undefined", 'special'); - case "boolean" : return stylize(obj + '', 'bool'); - case "date" : return stylize(obj.toUTCString()); - case "array" : return stringifyArray(obj, options, stack.length); - case "object" : return stringifyObject(obj, options, stack.length); - } - })(obj); - - stack.pop(); - return result; -}; - -// Escape invisible characters in a string -function stringifyString (str, options) { - return str.replace(/\\/g, '\\\\') - .replace(/\n/g, '\\n') - .replace(/[\u0001-\u001F]/g, function (match) { - return '\\0' + match[0].charCodeAt(0).toString(8); - }); -} - -// Convert an array to a string, such as [1, 2, 3]. -// This function calls stringify() for each of the elements -// in the array. -function stringifyArray(ary, options, level) { - var out = []; - var pretty = options.pretty && (ary.length > 4 || ary.some(function (o) { - return (o !== null && typeof(o) === 'object' && Object.keys(o).length > 0) || - (Array.isArray(o) && o.length > 0); - })); - var ws = pretty ? '\n' + new(Array)(level * 4 + 1).join(' ') : ' '; - - for (var i = 0; i < ary.length; i++) { - out.push(stringify(ary[i], options)); - } - - if (out.length === 0) { - return '[]'; - } else { - return '[' + ws - + out.join(',' + (pretty ? ws : ' ')) - + (pretty ? ws.slice(0, -4) : ws) + - ']'; - } -}; - -// Convert an object to a string, such as {a: 1}. -// This function calls stringify() for each of its values, -// and does not output functions or prototype values. -function stringifyObject(obj, options, level) { - var out = []; - var pretty = options.pretty && (Object.keys(obj).length > 2 || - Object.keys(obj).some(function (k) { return typeof(obj[k]) === 'object' })); - var ws = pretty ? '\n' + new(Array)(level * 4 + 1).join(' ') : ' '; - - var keys = options.showHidden ? Object.keys(obj) : Object.getOwnPropertyNames(obj); - keys.forEach(function (k) { - if (Object.prototype.hasOwnProperty.call(obj, k) - && !(obj[k] instanceof Function && options.hideFunctions)) { - out.push(eyes.stylize(k, options.styles.key, options.styles) + ': ' + - stringify(obj[k], options)); - } - }); - - if (out.length === 0) { - return '{}'; - } else { - return "{" + ws - + out.join(',' + (pretty ? ws : ' ')) - + (pretty ? ws.slice(0, -4) : ws) + - "}"; - } -}; - -// A better `typeof` -function typeOf(value) { - var s = typeof(value), - types = [Object, Array, String, RegExp, Number, Function, Boolean, Date]; - - if (s === 'object' || s === 'function') { - if (value) { - types.forEach(function (t) { - if (value instanceof t) { s = t.name.toLowerCase() } - }); - } else { s = 'null' } - } - return s; -} - -function merge(/* variable args */) { - var objs = Array.prototype.slice.call(arguments); - var target = {}; - - objs.forEach(function (o) { - Object.keys(o).forEach(function (k) { - if (k === 'styles') { - if (! o.styles) { - target.styles = false; - } else { - target.styles = {} - for (var s in o.styles) { - target.styles[s] = o.styles[s]; - } - } - } else { - target[k] = o[k]; - } - }); - }); - return target; -} - diff --git a/node_modules/vows/node_modules/eyes/package.json b/node_modules/vows/node_modules/eyes/package.json deleted file mode 100644 index 793b0a9..0000000 --- a/node_modules/vows/node_modules/eyes/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "eyes", - "description": "a customizable value inspector", - "url": "http://github.com/cloudhead/eyes.js", - "keywords": [ - "inspector", - "debug", - "inspect", - "print" - ], - "author": { - "name": "Alexis Sellier", - "email": "self@cloudhead.net" - }, - "contributors": [ - { - "name": "Charlie Robbins", - "email": "charlie@nodejitsu.com" - } - ], - "licenses": [ - "MIT" - ], - "dependencies": {}, - "main": "./lib/eyes", - "version": "0.1.7", - "scripts": { - "test": "node test/*-test.js" - }, - "directories": { - "lib": "./lib", - "test": "./test" - }, - "engines": { - "node": "> 0.1.90" - }, - "_id": "eyes@0.1.7", - "devDependencies": {}, - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "ffa74e2ea5b14eb3082d694f9496f994e5d0bc9b" - }, - "_from": "eyes@>=0.1.6" -} diff --git a/node_modules/vows/node_modules/eyes/test/eyes-test.js b/node_modules/vows/node_modules/eyes/test/eyes-test.js deleted file mode 100644 index 1f9606a..0000000 --- a/node_modules/vows/node_modules/eyes/test/eyes-test.js +++ /dev/null @@ -1,56 +0,0 @@ -var util = require('util'); -var eyes = require('../lib/eyes'); - -eyes.inspect({ - number: 42, - string: "John Galt", - regexp: /[a-z]+/, - array: [99, 168, 'x', {}], - func: function () {}, - bool: false, - nil: null, - undef: undefined, - object: {attr: []} -}, "native types"); - -eyes.inspect({ - number: new(Number)(42), - string: new(String)("John Galt"), - regexp: new(RegExp)(/[a-z]+/), - array: new(Array)(99, 168, 'x', {}), - bool: new(Boolean)(false), - object: new(Object)({attr: []}), - date: new(Date) -}, "wrapped types"); - -var obj = {}; -obj.that = { self: obj }; -obj.self = obj; - -eyes.inspect(obj, "circular object"); -eyes.inspect({hello: 'moto'}, "small object"); -eyes.inspect({hello: new(Array)(6) }, "big object"); -eyes.inspect(["hello 'world'", 'hello "world"'], "quotes"); -eyes.inspect({ - recommendations: [{ - id: 'a7a6576c2c822c8e2bd81a27e41437d8', - key: [ 'spree', 3.764316258020699 ], - value: { - _id: 'a7a6576c2c822c8e2bd81a27e41437d8', - _rev: '1-2e2d2f7fd858c4a5984bcf809d22ed98', - type: 'domain', - domain: 'spree', - weight: 3.764316258020699, - product_id: 30 - } - }] -}, 'complex'); - -eyes.inspect([null], "null in array"); - -var inspect = eyes.inspector({ stream: null }); - -util.puts(inspect('something', "something")); -util.puts(inspect("something else")); - -util.puts(inspect(["no color"], null, { styles: false })); diff --git a/node_modules/vows/package.json b/node_modules/vows/package.json deleted file mode 100644 index 20b296e..0000000 --- a/node_modules/vows/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "vows", - "description": "Asynchronous BDD & continuous integration for node.js", - "url": "http://vowsjs.org", - "keywords": [ - "testing", - "spec", - "test", - "BDD" - ], - "author": { - "name": "Alexis Sellier", - "email": "self@cloudhead.net" - }, - "contributors": [ - { - "name": "Charlie Robbins", - "email": "charlie.robbins@gmail.com" - } - ], - "dependencies": { - "eyes": ">=0.1.6" - }, - "main": "./lib/vows", - "bin": { - "vows": "./bin/vows" - }, - "directories": { - "test": "./test", - "bin": "./bin" - }, - "version": "0.6.2", - "scripts": { - "test": "./bin/vows --spec" - }, - "engines": { - "node": ">=0.2.6" - }, - "_id": "vows@0.6.2", - "devDependencies": {}, - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "dist": { - "shasum": "36342c90755f7d8e2145dadcd2fcbfecb786f9e9" - }, - "_from": "vows" -} diff --git a/node_modules/vows/test/assert-test.js b/node_modules/vows/test/assert-test.js deleted file mode 100644 index c191588..0000000 --- a/node_modules/vows/test/assert-test.js +++ /dev/null @@ -1,133 +0,0 @@ -var vows = require('../lib/vows'); -var assert = require('assert'); - -vows.describe('vows/assert').addBatch({ - "The Assertion module": { - "`equal`": function () { - assert.equal("hello world", "hello world"); - assert.equal(1, true); - }, - "`match`": function () { - assert.match("hello world", /^[a-z]+ [a-z]+$/); - }, - "`lengthOf`": function () { - assert.lengthOf("hello world", 11); - assert.lengthOf([1, 2, 3], 3); - }, - "`isDefined`": function () { - assert.isDefined(null); - assertError(assert.isDefined, undefined); - }, - "`include`": function () { - assert.include("hello world", "world"); - assert.include([0, 42, 0], 42); - assert.include({goo:true}, 'goo'); - }, - "`deepInclude`": function () { - assert.deepInclude([{a:'b'},{c:'d'}], {a:'b'}); - assert.deepInclude("hello world", "world"); - assert.deepInclude({goo:true}, 'goo'); - }, - "`typeOf`": function () { - assert.typeOf('goo', 'string'); - assert.typeOf(42, 'number'); - assert.typeOf([], 'array'); - assert.typeOf({}, 'object'); - assert.typeOf(false, 'boolean'); - }, - "`instanceOf`": function () { - assert.instanceOf([], Array); - assert.instanceOf(function () {}, Function); - }, - "`isArray`": function () { - assert.isArray([]); - assertError(assert.isArray, {}); - }, - "`isString`": function () { - assert.isString(""); - }, - "`isObject`": function () { - assert.isObject({}); - assertError(assert.isObject, []); - }, - "`isNumber`": function () { - assert.isNumber(0); - }, - "`isBoolean`": function (){ - assert.isBoolean(true); - assert.isBoolean(false); - assertError(assert.isBoolean, 0); - }, - "`isNan`": function () { - assert.isNaN(0/0); - }, - "`isTrue`": function () { - assert.isTrue(true); - assertError(assert.isTrue, 1); - }, - "`isFalse`": function () { - assert.isFalse(false); - assertError(assert.isFalse, 0); - }, - "`isZero`": function () { - assert.isZero(0); - assertError(assert.isZero, null); - }, - "`isNotZero`": function () { - assert.isNotZero(1); - }, - "`isUndefined`": function () { - assert.isUndefined(undefined); - assertError(assert.isUndefined, null); - }, - "`isDefined`": function () { - assert.isDefined(null); - assertError(assert.isDefined, undefined); - }, - "`isNull`": function () { - assert.isNull(null); - assertError(assert.isNull, 0); - assertError(assert.isNull, undefined); - }, - "`isNotNull`": function () { - assert.isNotNull(0); - }, - "`greater` and `lesser`": function () { - assert.greater(5, 4); - assert.lesser(4, 5); - }, - "`inDelta`": function () { - assert.inDelta(42, 40, 5); - assert.inDelta(42, 40, 2); - assert.inDelta(42, 42, 0); - assert.inDelta(3.1, 3.0, 0.2); - assertError(assert.inDelta, [42, 40, 1]); - }, - "`isEmpty`": function () { - assert.isEmpty({}); - assert.isEmpty([]); - assert.isEmpty(""); - }, - "`isNotEmpty`": function () { - assert.isNotEmpty({goo:true}); - assert.isNotEmpty([1]); - assert.isNotEmpty(" "); - assertError(assert.isNotEmpty, {}); - assertError(assert.isNotEmpty, []); - assertError(assert.isNotEmpty, ""); - } - } -}).export(module); - -function assertError(assertion, args, fail) { - if (!Array.isArray(args)) { args = [args]; } - try { - assertion.apply(null, args); - fail = true; - } catch (e) {/* Success */} - - fail && assert.fail(args.join(' '), assert.AssertionError, - "expected an AssertionError for {actual}", - "assertError", assertError); -} - diff --git a/node_modules/vows/test/fixtures/isolate/failing.js b/node_modules/vows/test/fixtures/isolate/failing.js deleted file mode 100644 index 7a1865e..0000000 --- a/node_modules/vows/test/fixtures/isolate/failing.js +++ /dev/null @@ -1,18 +0,0 @@ -var vows = require('../../../lib/vows'), - assert = require('assert'); - -var obvious; -vows.describe('failing').addBatch({ - 'Obvious test': obvious = { - topic: function () { - this.callback(null, false); - }, - 'should work': function (result) { - assert.ok(result); - } - // but it won't - }, - 'Obvious test #2': obvious, - 'Obvious test #3': obvious, - 'Obvious test #4': obvious -}).export(module); diff --git a/node_modules/vows/test/fixtures/isolate/log.js b/node_modules/vows/test/fixtures/isolate/log.js deleted file mode 100644 index 9828045..0000000 --- a/node_modules/vows/test/fixtures/isolate/log.js +++ /dev/null @@ -1,18 +0,0 @@ -var vows = require('../../../lib/vows'), - assert = require('assert'); - -var obvious; -vows.describe('stderr').addBatch({ - 'Obvious test': obvious = { - topic: function () { - this.callback(null, true); - }, - 'should work': function (result) { - console.log('oh no!'); - assert.ok(result); - } - }, - 'Obvious test #2': obvious, - 'Obvious test #3': obvious, - 'Obvious test #4': obvious -}).export(module); diff --git a/node_modules/vows/test/fixtures/isolate/passing.js b/node_modules/vows/test/fixtures/isolate/passing.js deleted file mode 100644 index 7f95730..0000000 --- a/node_modules/vows/test/fixtures/isolate/passing.js +++ /dev/null @@ -1,17 +0,0 @@ -var vows = require('../../../lib/vows'), - assert = require('assert'); - -var obvious; -vows.describe('passing').addBatch({ - 'Obvious test': obvious = { - topic: function () { - this.callback(null, true); - }, - 'should work': function (result) { - assert.ok(result); - } - }, - 'Obvious test #2': obvious, - 'Obvious test #3': obvious, - 'Obvious test #4': obvious -}).export(module); diff --git a/node_modules/vows/test/fixtures/isolate/stderr.js b/node_modules/vows/test/fixtures/isolate/stderr.js deleted file mode 100644 index 545ad20..0000000 --- a/node_modules/vows/test/fixtures/isolate/stderr.js +++ /dev/null @@ -1,18 +0,0 @@ -var vows = require('../../../lib/vows'), - assert = require('assert'); - -var obvious; -vows.describe('stderr').addBatch({ - 'Obvious test': obvious = { - topic: function () { - this.callback(null, true); - }, - 'should work': function (result) { - console.error('oh no!'); - assert.ok(result); - } - }, - 'Obvious test #2': obvious, - 'Obvious test #3': obvious, - 'Obvious test #4': obvious -}).export(module); diff --git a/node_modules/vows/test/fixtures/supress-stdout/output.js b/node_modules/vows/test/fixtures/supress-stdout/output.js deleted file mode 100644 index e5c1635..0000000 --- a/node_modules/vows/test/fixtures/supress-stdout/output.js +++ /dev/null @@ -1,16 +0,0 @@ -var vows = require('../../../lib/vows'), - assert = require('assert'); - -vows.describe('output').addBatch({ - 'outputting': { - topic: function () { - console.log('goo'); - this.callback(null, true); - }, - 'should work': function (result) { - console.log('goo'); - assert.ok(result); - } - }, -}).export(module); - diff --git a/node_modules/vows/test/isolate-test.js b/node_modules/vows/test/isolate-test.js deleted file mode 100644 index 40f993b..0000000 --- a/node_modules/vows/test/isolate-test.js +++ /dev/null @@ -1,140 +0,0 @@ -var vows = require('../lib/vows'), - assert = require('assert'), - path = require('path'), - exec = require('child_process').exec; - -function generateTopic(args, file) { - return function () { - var cmd = './bin/vows' + ' -i ' + (args || '') + - ' ./test/fixtures/isolate/' + file, - options = {cwd: path.resolve(__dirname + '/../')}, - callback = this.callback; - - exec(cmd, options, function (err, stdout, stderr) { - callback(null, { - err: err, - stdout: stdout, - stderr: stderr - }); - }); - } -}; - -function assertExecOk(r) { - assert.isNull(r.err); -} - -function assertExecNotOk(r) { - assert.isNotNull(r.err); -} - -function parseResults(stdout) { - return stdout.split(/\n/g).map(function (s) { - if (!s) return; - return JSON.parse(s); - }).filter(function (s) {return s}); -} - -function assertResultTypePresent(results, type) { - assert.ok(results.some(function (result) { - return result[0] == type; - })); -} - -function assertResultsFinish(results, expected) { - var finish = results[results.length - 1]; - assert.equal(finish[0], 'finish'); - - finish = finish[1]; - - Object.keys(expected).forEach(function (key) { - assert.equal(finish[key], expected[key]); - }); -} - -vows.describe('vows/isolate').addBatch({ - 'Running vows with -i flag for test/fixtures/isolate/': { - 'passing.js': { - 'with default reporter': { - topic: generateTopic(null, 'passing.js'), - 'should be ok': assertExecOk - }, - 'with json reporter': { - topic: generateTopic('--json', 'passing.js'), - 'should be ok': assertExecOk, - 'should have correct output': function (r) { - var results = parseResults(r.stdout) - - assertResultTypePresent(results, 'subject'); - assertResultTypePresent(results, 'end'); - - assertResultsFinish(results, { - total: 4, - honored: 4 - }); - } - } - }, - 'failing.js': { - 'with json reporter': { - topic: generateTopic('--json', 'failing.js'), - 'should be not ok': assertExecNotOk, - 'should have correct output though': function (r) { - var results = parseResults(r.stdout); - - assertResultsFinish(results, { - total: 4, - broken: 4 - }); - } - } - }, - 'stderr.js': { - 'with json reporter': { - topic: generateTopic('--json', 'stderr.js'), - 'should be ok': assertExecOk, - 'should have stderr': function (r) { - assert.equal(r.stderr, - ['oh no!', 'oh no!', 'oh no!', 'oh no!', ''].join('\n')); - }, - 'should have correct output': function (r) { - var results= parseResults(r.stdout); - - assertResultsFinish(results, { - total: 4, - honored: 4 - }); - } - } - }, - 'log.js': { - 'with json reporter': { - topic: generateTopic('--json', 'log.js'), - 'should be ok': assertExecOk, - 'should have correct output': function (r) { - var results= parseResults(r.stdout); - - assertResultsFinish(results, { - total: 4, - honored: 4 - }); - } - } - }, - 'all tests (*)': { - 'with json reporter': { - topic: generateTopic('--json', '*'), - 'should be not ok': assertExecNotOk, - 'should have correct output': function (r) { - var results= parseResults(r.stdout); - - assertResultsFinish(results, { - total: 16, - broken: 4, - honored: 12 - }); - } - } - } - } -}).export(module); diff --git a/node_modules/vows/test/supress-stdout-test.js b/node_modules/vows/test/supress-stdout-test.js deleted file mode 100644 index 2321e4d..0000000 --- a/node_modules/vows/test/supress-stdout-test.js +++ /dev/null @@ -1,43 +0,0 @@ -var assert = require('assert'), - path = require('path'), - vows = require('../lib/vows'), - exec = require('child_process').exec; - -function generateTopic(supress) { - return function () { - var cmd = './bin/vows ' + (supress ? '--supress-stdout ' : '') + - './test/fixtures/supress-stdout/output.js', - options = {cwd: path.resolve(__dirname + '/../')}, - callback = this.callback; - - exec(cmd, options, function (err, stdout) { - callback(null, {err: err, stdout: stdout}); - }); - }; -} - -vows.describe('vows/supress-stdout').addBatch({ - 'Running vows for test/fixtures/supress-stdout/output.js': { - 'with --supress-stdout flag': { - topic: generateTopic(true), - 'should be ok': function (result) { - assert.isNull(result.err); - }, - 'should not contain output from stdout': function (result) { - assert.equal(result.stdout.toString().indexOf('goo'), -1); - // console.log output? - // nope, just Chuck Testa! - } - }, - 'without --supress-stdout flag': { - topic: generateTopic(), - 'should be ok': function (result) { - assert.isNull(result.err); - }, - 'should contain output from stdout': function (result) { - assert.notEqual(result.stdout.toString().indexOf('goo'), -1); - } - } - } -}).export(module); - diff --git a/node_modules/vows/test/vows-error-test.js b/node_modules/vows/test/vows-error-test.js deleted file mode 100644 index 79afaba..0000000 --- a/node_modules/vows/test/vows-error-test.js +++ /dev/null @@ -1,51 +0,0 @@ -var path = require('path'), - events = require('events'), - assert = require('assert'), - fs = require('fs'), - vows = require('../lib/vows'); - -function doSomethingAsync(callback) { - var err = null; - var testValue = 'a'; - - process.nextTick(function() { - callback(err, testValue); - }); -} - -function doSomethingAsyncWithError(callback) { - var err = true; - var testValue = 'a'; - - process.nextTick(function() { - callback(err, testValue); - }); -} - - -vows.describe('vows/error').addBatch({ - 'Generate success response to async function': { - topic: function() { - doSomethingAsync(this.callback) - }, - 'Validate success': function(err, testValue) { - assert.ok(!err); - }, - 'Validate testValue': function(err, testValue) { - assert.equal(testValue, 'a'); - } - }, - - 'Generate error response to async function': { - topic: function() { - doSomethingAsyncWithError(this.callback) - }, - 'Validate error': function(err, testValue) { - assert.ok(err); - }, - 'Validate testValue': function(err, testValue) { - // This assertion fails. It shouldn't. - assert.equal(testValue, 'a'); - } - } -}).export(module) \ No newline at end of file diff --git a/node_modules/vows/test/vows-test.js b/node_modules/vows/test/vows-test.js deleted file mode 100644 index d539a54..0000000 --- a/node_modules/vows/test/vows-test.js +++ /dev/null @@ -1,522 +0,0 @@ -var path = require('path'), - events = require('events'), - assert = require('assert'), - fs = require('fs'), - vows = require('../lib/vows'); - -var api = vows.prepare({ - get: function (id, callback) { - process.nextTick(function () { callback(null, id) }); - }, - version: function () { return '1.0' } -}, ['get']); - -var promiser = function (val) { - return function () { - var promise = new(events.EventEmitter); - process.nextTick(function () { promise.emit('success', val) }); - return promise; - } -}; - -vows.describe("Vows").addBatch({ - "A context": { - topic: promiser("hello world"), - - "with a nested context": { - topic: function (parent) { - this.state = 42; - return promiser(parent)(); - }, - "has access to the environment": function () { - assert.equal(this.state, 42); - }, - "and a sub nested context": { - topic: function () { - return this.state; - }, - "has access to the parent environment": function (r) { - assert.equal(r, 42); - assert.equal(this.state, 42); - }, - "has access to the parent context object": function (r) { - assert.ok(Array.isArray(this.context.topics)); - assert.include(this.context.topics, "hello world"); - } - } - } - }, - "A nested context": { - topic: promiser(1), - - ".": { - topic: function (a) { return promiser(2)() }, - - ".": { - topic: function (b, a) { return promiser(3)() }, - - ".": { - topic: function (c, b, a) { return promiser([4, c, b, a])() }, - - "should have access to the parent topics": function (topics) { - assert.equal(topics.join(), [4, 3, 2, 1].join()); - } - }, - - "from": { - topic: function (c, b, a) { return promiser([4, c, b, a])() }, - - "the parent topics": function(topics) { - assert.equal(topics.join(), [4, 3, 2, 1].join()); - } - } - } - } - }, - "Nested contexts with callback-style async": { - topic: function () { - fs.stat(__dirname + '/vows-test.js', this.callback); - }, - 'after a successful `fs.stat`': { - topic: function (stat) { - fs.open(__dirname + '/vows-test.js', "r", stat.mode, this.callback); - }, - 'after a successful `fs.open`': { - topic: function (fd, stat) { - fs.read(fd, stat.size, 0, "utf8", this.callback); - }, - 'after a successful `fs.read`': function (data) { - assert.match (data, /after a successful `fs.read`/); - } - } - } - }, - "A nested context with no topics": { - topic: 45, - ".": { - ".": { - "should pass the value down": function (topic) { - assert.equal(topic, 45); - } - } - } - }, - "A Nested context with topic gaps": { - topic: 45, - ".": { - ".": { - topic: 101, - ".": { - ".": { - topic: function (prev, prev2) { - return this.context.topics.slice(0); - }, - "should pass the topics down": function (topics) { - assert.lengthOf(topics, 2); - assert.equal(topics[0], 101); - assert.equal(topics[1], 45); - } - } - } - } - } - }, - "A non-promise return value": { - topic: function () { return 1 }, - "should be converted to a promise": function (val) { - assert.equal(val, 1); - } - }, - "A 'prepared' interface": { - "with a wrapped function": { - topic: function () { return api.get(42) }, - "should work as expected": function (val) { - assert.equal(val, 42); - } - }, - "with a non-wrapped function": { - topic: function () { return api.version() }, - "should work as expected": function (val) { - assert.equal(val, '1.0'); - } - } - }, - "A non-function topic": { - topic: 45, - - "should work as expected": function (topic) { - assert.equal(topic, 45); - } - }, - "A non-function topic with a falsy value": { - topic: 0, - - "should work as expected": function (topic) { - assert.equal(topic, 0); - } - }, - "A topic returning a function": { - topic: function () { - return function () { return 42 }; - }, - - "should work as expected": function (topic) { - assert.isFunction(topic); - assert.equal(topic(), 42); - }, - "in a sub-context": { - "should work as expected": function (topic) { - assert.isFunction(topic); - assert.equal(topic(), 42); - }, - } - }, - "A topic with a function that errors": { - topic: function() { - throw("Something wrong here"); - }, - "should error out": function(topic) { - assert.equal(topic, "Something wrong here"); - } - }, - "A topic emitting an error": { - topic: function () { - var promise = new(events.EventEmitter); - process.nextTick(function () { - promise.emit("error", 404); - }); - return promise; - }, - "shouldn't raise an exception if the test expects it": function (e, res) { - assert.equal(e, 404); - assert.ok(! res); - } - }, - "A topic not emitting an error": { - topic: function () { - var promise = new(events.EventEmitter); - process.nextTick(function () { - promise.emit("success", true); - }); - return promise; - }, - "should pass `null` as first argument, if the test is expecting an error": function (e, res) { - assert.strictEqual(e, null); - assert.equal(res, true); - }, - "should pass the result as first argument if the test isn't expecting an error": function (res) { - assert.equal(res, true); - } - }, - "A topic with callback-style async": { - "when successful": { - topic: function () { - var that = this; - process.nextTick(function () { - that.callback(null, "OK"); - }); - }, - "should work like an event-emitter": function (res) { - assert.equal(res, "OK"); - }, - "should assign `null` to the error argument": function (e, res) { - assert.strictEqual(e, null); - assert.equal(res, "OK"); - } - }, - "when unsuccessful": { - topic: function () { - function async(callback) { - process.nextTick(function () { - callback("ERROR"); - }); - } - async(this.callback); - }, - "should have a non-null error value": function (e, res) { - assert.equal(e, "ERROR"); - }, - "should work like an event-emitter": function (e, res) { - assert.equal(res, undefined); - } - }, - "using this.callback synchronously": { - topic: function () { - this.callback(null, 'hello'); - }, - "should work the same as returning a value": function (res) { - assert.equal(res, 'hello'); - } - }, - "using this.callback with a user context": { - topic: function () { - this.callback.call({ boo: true }, null, 'hello'); - }, - "should give access to the user context": function (res) { - assert.isTrue(this.boo); - } - }, - "passing this.callback to a function": { - topic: function () { - this.boo = true; - var async = function (callback) { - callback(null); - }; - async(this.callback); - }, - "should give access to the topic context": function () { - assert.isTrue(this.boo); - } - }, - "with multiple arguments": { - topic: function () { - this.callback(null, 1, 2, 3); - }, - "should pass them to the vow": function (e, a, b, c) { - assert.strictEqual(e, null); - assert.strictEqual(a, 1); - assert.strictEqual(b, 2); - assert.strictEqual(c, 3); - }, - "and a sub-topic": { - topic: function (a, b, c) { - return [a, b, c]; - }, - "should receive them too": function (val) { - assert.deepEqual(val, [1, 2, 3]); - } - } - } - } -}).addBatch({ - "A Sibling context": { - "'A', with `this.foo = true`": { - topic: function () { - this.foo = true; - return this; - }, - "should have `this.foo` set to true": function (res) { - assert.equal(res.foo, true); - } - }, - "'B', with nothing set": { - topic: function () { - return this; - }, - "shouldn't have access to `this.foo`": function (e, res) { - assert.isUndefined(res.foo); - } - } - } -}).addBatch({ - "A 2nd batch": { - topic: function () { - var p = new(events.EventEmitter); - setTimeout(function () { - p.emit("success"); - }, 100); - return p; - }, - "should run after the first": function () {} - } -}).addBatch({ - "A 3rd batch": { - topic: true, "should run last": function () {} - } -}).addBatch({}).export(module); - -vows.describe("Vows with a single batch", { - "This is a batch that's added as the optional parameter to describe()": { - topic: true, - "And a vow": function () {} - } -}).export(module); - -vows.describe("Vows with multiple batches added as optional parameters", { - "First batch": { - topic: true, - "should be run first": function () {} - } -}, { - "Second batch": { - topic: true, - "should be run second": function () {} - } -}).export(module); - -vows.describe("Vows with teardowns").addBatch({ - "A context": { - topic: function () { - return { flag: true }; - }, - "And a vow": function (topic) { - assert.isTrue(topic.flag); - }, - "And another vow": function (topic) { - assert.isTrue(topic.flag); - }, - "And a final vow": function (topic) { - assert.isTrue(topic.flag); - }, - 'subcontext': { - 'nested': function (_, topic) { - assert.isTrue(topic.flag); - } - }, - teardown: function (topic) { - topic.flag = false; - }, - "with a subcontext" : { - topic: function (topic) { - var that = this; - process.nextTick(function () { - that.callback(null, topic); - }); - }, - "Waits for the subcontext before teardown" : function(topic) { - assert.isTrue(topic.flag); - } - } - } -}).export(module); - -vows.describe("Vows with sub events").addBatch({ - "A context with sub-events": { - topic: function () { - var topic = new(events.EventEmitter); - topic.emit('before', 'before'); - - process.nextTick(function () { - topic.emit('request', 'request_data'); - }); - - process.nextTick(function () { - topic.emit('end', 'end_data'); - }); - - process.nextTick(function () { - topic.emit('nested', 'empty_nest'); - }); - - process.nextTick(function () { - topic.emit('success', 'legacey_data'); - }); - - return topic; - }, - on: { - "before": { - "will catch events emited before the topic returns" : function (ret) { - assert.strictEqual(ret, 'before'); - } - }, - "request": { - "will catch request": function (ret) { - assert.strictEqual(ret, 'request_data'); - }, - on: { - on: { - "end": { - "will require that 'end' is emitted after 'request'": function (ret) { - assert.strictEqual(ret, 'end_data'); - // TODO need a test that fails to prove this works - } - } - } - } - }, - on: { - on: { - "nested": { - "will catch nested, even if it is in empty nested 'on'": function (ret) { - assert.strictEqual(ret, 'empty_nest') - } - } - } - } - }, - "will catch the legacy success event": function (err, ret) { - assert.strictEqual(ret, 'legacey_data'); - } - }, - "Sub-events emitted by children of EventEmitter": { - topic: function() { - var MyEmitter = function () { - events.EventEmitter.call(this); - }; - require('util').inherits(MyEmitter, events.EventEmitter); - - var topic = new(MyEmitter); - process.nextTick(function () { - topic.emit('success', 'Legacy Does not Catch'); - }); - - return topic; - }, - "will return the emitter for traditional vows" : function (err, ret) { - assert.ok(ret instanceof events.EventEmitter); - }, - // events is an alias for on - events: { - "success" : { - "will catch the event" : function (ret) { - assert.strictEqual(ret, 'Legacy Does not Catch'); - }, - "will change events to on in the title" : function() { - assert.strictEqual(this.context.title, - 'Sub-events emitted by children of EventEmitter on success'); - } - } - } - } -}).export(module); - -var tornDown = false - -vows.describe("Vows with asynchonous teardowns").addBatch({ - "Context with long-running teardown": { - "is run first": function () {}, - teardown: function () { - var callback = this.callback; - - setTimeout(function () { - tornDown = true; - callback(); - }, 100); - } - } -}).addBatch({ - "The next batch": { - "is not run until the teardown is complete": function () { - assert.ok(tornDown); - } - } -}).export(module); - -vows.describe('Async topic is passed to vows with topic-less subcontext').addBatch({ - 'Async 42': { - topic: function () { - var callback = this.callback; - process.nextTick(function () { - callback(null, 42); - }); - }, - 'equals 42': function (topic) { - assert.equal(topic, 42); - }, - 'has the property that': { - 'it is equal to 42': function (topic) { - // <-- This vow fails, topic is undefined!? - assert.equal(topic, 42); - } - }, - 'plus 1': { - topic: function (parentTopic) { - return parentTopic + 1; - }, - 'equals 43': function (topic) { - assert.equal(topic, 43); - } - } - } -})['export'](module); diff --git a/node_modules/vows/test/vows_underscore_test.js b/node_modules/vows/test/vows_underscore_test.js deleted file mode 100644 index 1f3ce5c..0000000 --- a/node_modules/vows/test/vows_underscore_test.js +++ /dev/null @@ -1,14 +0,0 @@ -var vows = require('../lib/vows'), - assert = require('assert'); - -vows.describe("Vows test file with underscore").addBatch({ - - "The test file": { - topic: function () { - return { flag: true }; - }, - "is run": function (topic) { - assert.isTrue(topic.flag); - } - } -}).export(module); diff --git a/node_modules/wd/.npmignore b/node_modules/wd/.npmignore deleted file mode 100644 index fd4f2b0..0000000 --- a/node_modules/wd/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -.DS_Store diff --git a/node_modules/wd/LICENSE.APACHE2 b/node_modules/wd/LICENSE.APACHE2 deleted file mode 100644 index a321f9c..0000000 --- a/node_modules/wd/LICENSE.APACHE2 +++ /dev/null @@ -1,15 +0,0 @@ -Apache License, Version 2.0 - -Copyright (c) 2012 Sauce Labs - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/node_modules/wd/Makefile b/node_modules/wd/Makefile deleted file mode 100644 index a067513..0000000 --- a/node_modules/wd/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -TEST_DIR = test/common test/unit test/saucelabs -TEST_COFFEE_FILES = $(shell find test/common/*.coffee test/unit/*.coffee test/saucelabs/*.coffee) - -DEFAULT: - @echo - @echo ' make test -> run the unit tests (start selenium with chromedriver first).' - @echo ' make test_saucelabs -> run the saucelabs tests (configure username/access_key first).' - @echo ' make compile2js -> compile coffee files to js.' - @echo ' make compile2js_watch -> compile coffee files to js, watch for changes.' - @echo ' make cleanGenJs -> clean js files generated from coffeescript.' - @echo - - -# run test, start selenium server first -test: - ./node_modules/.bin/nodeunit test/unit/*-test.coffee - -# run saucelabs test, configure username/key first -test_saucelabs: - ./node_modules/.bin/nodeunit test/saucelabs/*-test.coffee - -# remove all the generated js -cleanGenJs: - @rm -f test/common/*.js test/unit/*.js test/saucelabs/*.js - -# compile once -compile2js: - @./node_modules/.bin/coffee --compile $(TEST_DIR) -# compile, and then watch for changes -compile2js_watch: - ./node_modules/.bin/coffee --compile --watch $(TEST_DIR) - -.PHONY: test compile2js compile2js_watch cleanGenJs DEFAULT diff --git a/node_modules/wd/README.md b/node_modules/wd/README.md deleted file mode 100644 index d3c2993..0000000 --- a/node_modules/wd/README.md +++ /dev/null @@ -1,613 +0,0 @@ -# WD.js -- A light weight WebDriver/Se2 client for node.js - -## Update node to latest - -http://nodejs.org/#download - -## Install - -
          -npm install wd
          -
          - -## Authors - - - Adam Christian ([admc](http://github.com/admc)) - - Ruben Daniels ([javruben](https://github.com/javruben)) - - Peter Braden ([peterbraden](https://github.com/peterbraden)) - - Seb Vincent ([sebv](https://github.com/sebv)) - - Peter 'Pita' Martischka ([pita](https://github.com/Pita)) - -## License - - * License - Apache 2: http://www.apache.org/licenses/LICENSE-2.0 - -## Usage - -
          -): wd shell
          -> x = wd.remote() or wd.remote("ondemand.saucelabs.com", 80, "username", "apikey")
          -
          -> x.init() or x.init({desired capabilities ovveride})
          -> x.get("http://www.url.com")
          -> x.eval("window.location.href", function(e, o) { console.log(o) })
          -> x.quit()
          -
          - - -## Writing a test! - -
          -var webdriver = require('wd')
          -  , assert = require('assert');
          -
          -var browser = webdriver.remote();
          -
          -browser.on('status', function(info){
          -  console.log('\x1b[36m%s\x1b[0m', info);
          -});
          -browser.on('command', function(meth, path){
          -  console.log(' > \x1b[33m%s\x1b[0m: %s', meth, path);
          -});
          -
          -desired = {
          -  browserName:'chrome'
          -  , tags: ["examples"]
          -  , name: "This is an example test"
          -}
          -
          -browser.init(desired, function() {
          -  browser.get("http://saucelabs.com/test/guinea-pig", function() {
          -    browser.title(function(err, title) {
          -      assert.ok(~title.indexOf('I am a page title - Sauce Labs'), 'Wrong title!');
          -      browser.elementById('submit', function(err, el) {
          -        browser.clickElement(el, function() {
          -          browser.eval("window.location.href", function(err, title) {
          -            assert.ok(~title.indexOf('#'), 'Wrong title!');
          -            browser.quit()
          -          })
          -        })
          -      })
          -    })
          -  })
          -})
          -
          - -## Supported Methods - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - JsonWireProtocol - - wd -
          - GET /status
          - Query the server's current status. -
          - status(cb) -> cb(err, status) -
          - POST /session
          - Create a new session. -
          - init(desired, cb) -> cb(err, sessionID) -
          - GET /sessions
          - Returns a list of the currently active sessions. -
          -
            -
          • all sessions: sessions(cb) -> cb(err, sessions)
          • -
          • - current session:
            - altSessionCapabilities(cb) -> cb(err, capabilities) -
          • -
          -
          - GET /session/:sessionId
          - Retrieve the capabilities of the specified session. -
          - sessionCapabilities(cb) -> cb(err, capabilities) -
          - DELETE /session/:sessionId
          - Delete the session. -
          - quit(cb) -> cb(err) -
          - POST /session/:sessionId/timeouts
          - Configure the amount of time that a particular type of operation can execute for before they are aborted and a |Timeout| error is returned to the client. -
          -
            -
          • - configurable type: NA (but setImplicitWaitTimeout and - setAsyncScriptTimeout do the same) -
          • -
          • - page load timeout:
            - setPageLoadTimeout(ms, cb) -> cb(err) -
          • -
          -
          - POST /session/:sessionId/timeouts/async_script
          - Set the amount of time, in milliseconds, that asynchronous scripts executed by /session/:sessionId/execute_async are permitted to run before they are aborted and a |Timeout| error is returned to the client. -
          - setAsyncScriptTimeout(ms, cb) -> cb(err) -
          - POST /session/:sessionId/timeouts/implicit_wait
          - Set the amount of time the driver should wait when searching for elements. -
          - setImplicitWaitTimeout(ms, cb) -> cb(err) -
          - GET /session/:sessionId/url
          - Retrieve the URL of the current page. -
          - url(cb) -> cb(err, url) -
          - POST /session/:sessionId/url
          - Navigate to a new URL. -
          - get(url,cb) -> cb(err) -
          - POST /session/:sessionId/forward
          - Navigate forwards in the browser history, if possible. -
          - forward(cb) -> cb(err) -
          - POST /session/:sessionId/back
          - Navigate backwards in the browser history, if possible. -
          - back(cb) -> cb(err) -
          - POST /session/:sessionId/refresh
          - Refresh the current page. -
          - refresh(cb) -> cb(err) -
          - POST /session/:sessionId/execute
          - Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. -
          -
            -
          • - execute script:
            - execute(code, args, cb) -> cb(err, value returned) -
              -
            • args is an optional Array
            • -
            -
          • -
          • - execute script using eval(code):
            - safeExecute(code, args, cb) -> cb(err, value returned) -
              -
            • args is an optional Array
            • -
            -
          • -
          • - evaluate expression (using execute):
            - eval(code, cb) -> cb(err, value) -
          • -
          • - evaluate expression (using safeExecute):
            - safeEval(code, cb) -> cb(err, value) -
          • -
          -
          - POST /session/:sessionId/execute_async
          - Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. -
          -
            -
          • - execute async script:
            - executeAsync(code, args, cb) -> cb(err, value returned) -
              -
            • args is an optional Array
            • -
            -
          • -
          • - execute async script using eval(code):
            - safeExecuteAsync(code, args, cb) -> cb(err, value returned) -
              -
            • args is an optional Array
            • -
            -
          • -
          -
          - DELETE /session/:sessionId/window
          - Close the current window. -
          - close(cb) -> cb(err) -
          - GET /session/:sessionId/cookie
          - Retrieve all cookies visible to the current page. -
          - allCookies() -> cb(err, cookies) -
          - POST /session/:sessionId/cookie
          - Set a cookie. -
          - setCookie(cookie, cb) -> cb(err) -
          - DELETE /session/:sessionId/cookie
          - Delete all cookies visible to the current page. -
          - deleteAllCookies(cb) -> cb(err) -
          - DELETE /session/:sessionId/cookie/:name
          - Delete the cookie with the given name. -
          - deleteCookie(name, cb) -> cb(err) -
          - GET /session/:sessionId/title
          - Get the current page title. -
          - title(cb) -> cb(err, title) -
          - POST /session/:sessionId/element
          - Search for an element on the page, starting from the document root. -
          -
            -
          • - element(using, value, cb) -> cb(err, element)
            -
          • -
          • - elementsuffix(value, cb) -> cb(err, element)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
          • - see also hasElement, hasElementsuffix, elementOrNull, elementsuffixOrNull, - elementIfExists, elementsuffixIfExists, in the elements section. -
          • -
              -
          - POST /session/:sessionId/elements
          - Search for multiple elements on the page, starting from the document root. -
          -
            -
          • - elements(using, value, cb) -> cb(err, elements)
            -
          • -
          • - elementssuffix(value, cb) -> cb(err, elements)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
          • - hasElement(using, value, cb) -> cb(err, boolean)
            -
          • -
          • - hasElementsuffix(value, cb) -> cb(err, boolean)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
          • - elementOrNull(using, value, cb) -> cb(err, element)
            - (avoids not found error throw and returns null instead) -
          • -
          • - elementsuffixOrNull(value, cb) -> cb(err, element)
            - (avoids not found error throw and returns null instead)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
          • - elementIfExists(using, value, cb) -> cb(err, element)
            - (avoids not found error throw and returns undefined instead) -
          • -
          • - elementsuffixIfExists(value, cb) -> cb(err, element)
            - (avoids not found error throw and returns undefined instead)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
              -
          - POST /session/:sessionId/element/active
          - Get the element on the page that currently has focus. -
          - active(cb) -> cb(err, element) -
          - POST /session/:sessionId/element/:id/click
          - Click on an element. -
          - clickElement(element, cb) -> cb(err) -
          - GET /session/:sessionId/element/:id/text
          - Returns the visible text for the element. -
          -
            -
          • - text(element, cb) -> (err, text) -
          • -
          • - textPresent(searchText, element, cb) -> (err, boolean) -
          • -
          -
          - POST /session/:sessionId/element/:id/value
          - Send a sequence of key strokes to an element. -
          -
            -
          • - type(element, keys, cb) -> cb(err) -
          • -
          • - special key map: wd.SPECIAL_KEYS (see lib/special-keys.js) -
          • -
          -
          - POST /session/:sessionId/keys
          - Send a sequence of key strokes to the active element. -
          -
            -
          • - keys(keys, cb) -> cb(err) -
          • -
          • - special key map: wd.SPECIAL_KEYS (see lib/special-keys.js) -
          • -
          -
          - POST /session/:sessionId/element/:id/clear
          - Clear a TEXTAREA or text INPUT element's value. -
          - clear(element, cb) -> cb(err) -
          - GET /session/:sessionId/element/:id/attribute/:name
          - Get the value of an element's attribute. -
          -
            -
          • - getAttribute(element, attrName, cb) -> cb(err, value) -
          • -
          • - getValue(element, cb) -> cb(err, value) -
          • -
          -
          - POST /session/:sessionId/accept_alert
          - Accepts the currently displayed alert dialog. -
          - acceptAlert(cb) -> cb(err) -
          - POST /session/:sessionId/dismiss_alert
          - Dismisses the currently displayed alert dialog. -
          - dismissAlert(cb) -> cb(err) -
          - POST /session/:sessionId/moveto
          - Move the mouse by an offset of the specificed element. -
          - moveTo(element, xoffset, yoffset, cb) -> cb(err) -
          - POST /session/:sessionId/click
          - Click any mouse button (at the coordinates set by the last moveto command). -
          - click(button, cb) -> cb(err)
          - buttons: {left: 0, middle: 1 , right: 2} -
          - POST /session/:sessionId/buttondown
          - Click and hold the left mouse button (at the coordinates set by the last moveto command). -
          - buttonDown(cb) -> cb(err) -
          - POST /session/:sessionId/buttonup
          - Releases the mouse button previously held (where the mouse is currently at). -
          - buttonUp(cb) -> cb(err) -
          - POST /session/:sessionId/doubleclick
          - Double-clicks at the current mouse coordinates (set by moveto). -
          - doubleclick(cb) -> cb(err)
          -
          - EXTRA: waitForCondition
          - Waits for JavaScript condition to be true (polling within wd client). -
          - waitForCondition(conditionExpr, timeout, pollFreq, cb) -> cb(err, boolean) -
            -
          • conditionExpr should return a boolean
          • -
          • timeout and pollFreq are optional (default: 1000, 100).
          • -
          • return true if condition satisfied, error otherwise.
          • -
          -
          - EXTRA: waitForConditionInBrowser
          - Waits for JavaScript condition to be true. (async script polling within browser) -
          - waitForConditionInBrowser(conditionExpr, timeout, pollFreq, cb) -> cb(err, boolean) -
            -
          • setAsyncScriptTimeout must be set to value higher than timeout
          • -
          • conditionExpr should return a boolean
          • -
          • timeout and pollFreq are optional (default: 1000, 100).
          • -
          • return true if condition satisfied, error otherwise.
          • -
          -
          - -### Full JsonWireProtocol mapping: - -[full mapping](https://github.com/sebv/wd/blob/master/doc/jsonwiremap-all.md) - -## More docs! -
          -WD is simply implementing the Selenium JsonWireProtocol, for more details see the official docs:
          - - http://code.google.com/p/selenium/wiki/JsonWireProtocol
          -
          - -## Run the tests! -
          -  - Run the selenium server with chromedriver: 
          -      java -jar selenium-server-standalone-2.21.0.jar -Dwebdriver.chrome.driver=<PATH>/chromedriver
          -  - cd wd
          -  - npm install .
          -  - make test
          -  - look at the results!
          -
          diff --git a/node_modules/wd/doc/jsonwiremap-all.md b/node_modules/wd/doc/jsonwiremap-all.md deleted file mode 100644 index 30afe58..0000000 --- a/node_modules/wd/doc/jsonwiremap-all.md +++ /dev/null @@ -1,1049 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            -
          • - getComputedCSS(element, styleName, cb) -> cb(err, value) -
          • -
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - JsonWireProtocol - - wd -
          - GET /status
          - Query the server's current status. -
          - status(cb) -> cb(err, status) -
          - POST /session
          - Create a new session. -
          - init(desired, cb) -> cb(err, sessionID) -
          - GET /sessions
          - Returns a list of the currently active sessions. -
          -
            -
          • all sessions: sessions(cb) -> cb(err, sessions)
          • -
          • - current session:
            - altSessionCapabilities(cb) -> cb(err, capabilities) -
          • -
          -
          - GET /session/:sessionId
          - Retrieve the capabilities of the specified session. -
          - sessionCapabilities(cb) -> cb(err, capabilities) -
          - DELETE /session/:sessionId
          - Delete the session. -
          - quit(cb) -> cb(err) -
          - POST /session/:sessionId/timeouts
          - Configure the amount of time that a particular type of operation can execute for before they are aborted and a |Timeout| error is returned to the client. -
          -
            -
          • - configurable type: NA (but setImplicitWaitTimeout and - setAsyncScriptTimeout do the same) -
          • -
          • - page load timeout:
            - setPageLoadTimeout(ms, cb) -> cb(err) -
          • -
          -
          - POST /session/:sessionId/timeouts/async_script
          - Set the amount of time, in milliseconds, that asynchronous scripts executed by /session/:sessionId/execute_async are permitted to run before they are aborted and a |Timeout| error is returned to the client. -
          - setAsyncScriptTimeout(ms, cb) -> cb(err) -
          - POST /session/:sessionId/timeouts/implicit_wait
          - Set the amount of time the driver should wait when searching for elements. -
          - setImplicitWaitTimeout(ms, cb) -> cb(err) -
          - GET /session/:sessionId/window_handle
          - Retrieve the current window handle. -
          - NA -
          - GET /session/:sessionId/window_handles
          - Retrieve the list of all window handles available to the session. -
          - NA -
          - GET /session/:sessionId/url
          - Retrieve the URL of the current page. -
          - url(cb) -> cb(err, url) -
          - POST /session/:sessionId/url
          - Navigate to a new URL. -
          - get(url,cb) -> cb(err) -
          - POST /session/:sessionId/forward
          - Navigate forwards in the browser history, if possible. -
          - forward(cb) -> cb(err) -
          - POST /session/:sessionId/back
          - Navigate backwards in the browser history, if possible. -
          - back(cb) -> cb(err) -
          - POST /session/:sessionId/refresh
          - Refresh the current page. -
          - refresh(cb) -> cb(err) -
          - POST /session/:sessionId/execute
          - Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. -
          -
            -
          • - execute script:
            - execute(code, args, cb) -> cb(err, value returned) -
              -
            • args is an optional Array
            • -
            -
          • -
          • - execute script using eval(code):
            - safeExecute(code, args, cb) -> cb(err, value returned) -
              -
            • args is an optional Array
            • -
            -
          • -
          • - evaluate expression (using execute):
            - eval(code, cb) -> cb(err, value) -
          • -
          • - evaluate expression (using safeExecute):
            - safeEval(code, cb) -> cb(err, value) -
          • -
          -
          - POST /session/:sessionId/execute_async
          - Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. -
          -
            -
          • - execute async script:
            - executeAsync(code, args, cb) -> cb(err, value returned) -
              -
            • args is an optional Array
            • -
            -
          • -
          • - execute async script using eval(code):
            - safeExecuteAsync(code, args, cb) -> cb(err, value returned) -
              -
            • args is an optional Array
            • -
            -
          • -
          -
          - GET /session/:sessionId/screenshot
          - Take a screenshot of the current page. -
          - NA -
          - GET /session/:sessionId/ime/available_engines
          - List all available engines on the machine. -
          - NA -
          - GET /session/:sessionId/ime/active_engine
          - Get the name of the active IME engine. -
          - NA -
          - GET /session/:sessionId/ime/activated
          - Indicates whether IME input is active at the moment (not if it's available. -
          - NA -
          - POST /session/:sessionId/ime/deactivate
          - De-activates the currently-active IME engine. -
          - NA -
          - POST /session/:sessionId/ime/activate
          - Make an engines that is available (appears on the listreturned by getAvailableEngines) active. -
          - NA -
          - POST /session/:sessionId/frame
          - Change focus to another frame on the page. -
          - NA -
          - POST /session/:sessionId/window
          - Change focus to another window. -
          - NA -
          - DELETE /session/:sessionId/window
          - Close the current window. -
          - close(cb) -> cb(err) -
          - POST /session/:sessionId/window/:windowHandle/size
          - Change the size of the specified window. -
          - NA -
          - GET /session/:sessionId/window/:windowHandle/size
          - Get the size of the specified window. -
          - NA -
          - POST /session/:sessionId/window/:windowHandle/position
          - Change the position of the specified window. -
          - NA -
          - GET /session/:sessionId/window/:windowHandle/position
          - Get the position of the specified window. -
          - NA -
          - POST /session/:sessionId/window/:windowHandle/maximize
          - Maximize the specified window if not already maximized. -
          - NA -
          - GET /session/:sessionId/cookie
          - Retrieve all cookies visible to the current page. -
          - allCookies() -> cb(err, cookies) -
          - POST /session/:sessionId/cookie
          - Set a cookie. -
          - setCookie(cookie, cb) -> cb(err) -
          - DELETE /session/:sessionId/cookie
          - Delete all cookies visible to the current page. -
          - deleteAllCookies(cb) -> cb(err) -
          - DELETE /session/:sessionId/cookie/:name
          - Delete the cookie with the given name. -
          - deleteCookie(name, cb) -> cb(err) -
          - GET /session/:sessionId/source
          - Get the current page source. -
          - NA -
          - GET /session/:sessionId/title
          - Get the current page title. -
          - title(cb) -> cb(err, title) -
          - POST /session/:sessionId/element
          - Search for an element on the page, starting from the document root. -
          -
            -
          • - element(using, value, cb) -> cb(err, element)
            -
          • -
          • - elementsuffix(value, cb) -> cb(err, element)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
          • - see also hasElement, hasElementsuffix, elementOrNull, elementsuffixOrNull, - elementIfExists, elementsuffixIfExists, in the elements section. -
          • -
              -
          - POST /session/:sessionId/elements
          - Search for multiple elements on the page, starting from the document root. -
          -
            -
          • - elements(using, value, cb) -> cb(err, elements)
            -
          • -
          • - elementssuffix(value, cb) -> cb(err, elements)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
          • - hasElement(using, value, cb) -> cb(err, boolean)
            -
          • -
          • - hasElementsuffix(value, cb) -> cb(err, boolean)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
          • - elementOrNull(using, value, cb) -> cb(err, element)
            - (avoids not found error throw and returns null instead) -
          • -
          • - elementsuffixOrNull(value, cb) -> cb(err, element)
            - (avoids not found error throw and returns null instead)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
          • - elementIfExists(using, value, cb) -> cb(err, element)
            - (avoids not found error throw and returns undefined instead) -
          • -
          • - elementsuffixIfExists(value, cb) -> cb(err, element)
            - (avoids not found error throw and returns undefined instead)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
              -
          - POST /session/:sessionId/element/active
          - Get the element on the page that currently has focus. -
          - active(cb) -> cb(err, element) -
          - GET /session/:sessionId/element/:id
          - Describe the identified element. -
          - NA -
          - POST /session/:sessionId/element/:id/element
          - Search for an element on the page, starting from the identified element. -
          - NA -
          - POST /session/:sessionId/element/:id/elements
          - Search for multiple elements on the page, starting from the identified element. -
          - NA -
          - POST /session/:sessionId/element/:id/click
          - Click on an element. -
          - clickElement(element, cb) -> cb(err) -
          - POST /session/:sessionId/element/:id/submit
          - Submit a FORM element. -
          - NA -
          - GET /session/:sessionId/element/:id/text
          - Returns the visible text for the element. -
          -
            -
          • - text(element, cb) -> (err, text) -
          • -
          • - textPresent(searchText, element, cb) -> (err, boolean) -
          • -
          -
          - POST /session/:sessionId/element/:id/value
          - Send a sequence of key strokes to an element. -
          -
            -
          • - type(element, keys, cb) -> cb(err) -
          • -
          • - special key map: wd.SPECIAL_KEYS (see lib/special-keys.js) -
          • -
          -
          - POST /session/:sessionId/keys
          - Send a sequence of key strokes to the active element. -
          -
            -
          • - keys(keys, cb) -> cb(err) -
          • -
          • - special key map: wd.SPECIAL_KEYS (see lib/special-keys.js) -
          • -
          -
          - GET /session/:sessionId/element/:id/name
          - Query for an element's tag name. -
          - NA -
          - POST /session/:sessionId/element/:id/clear
          - Clear a TEXTAREA or text INPUT element's value. -
          - clear(element, cb) -> cb(err) -
          - GET /session/:sessionId/element/:id/selected - Determine if an OPTION element, or an INPUT element of type checkbox or radiobutton is currently selected.
          -
          - NA -
          - GET /session/:sessionId/element/:id/enabled
          - Determine if an element is currently enabled. -
          - NA -
          - GET /session/:sessionId/element/:id/attribute/:name
          - Get the value of an element's attribute. -
          -
            -
          • - getAttribute(element, attrName, cb) -> cb(err, value) -
          • -
          • - getValue(element, cb) -> cb(err, value) -
          • -
          -
          - GET /session/:sessionId/element/:id/equals/:other
          - Test if two element IDs refer to the same DOM element. -
          - NA -
          - GET /session/:sessionId/element/:id/displayed
          - Determine if an element is currently displayed. -
          - NA -
          - GET /session/:sessionId/element/:id/location
          - Determine an element's location on the page. -
          - NA -
          - GET /session/:sessionId/element/:id/location_in_view
          - Determine an element's location on the screen once it has been scrolled into view. -
          - NA -
          - GET /session/:sessionId/element/:id/size
          - Determine an element's size in pixels. -
          - NA -
          - GET /session/:sessionId/element/:id/css/:propertyName
          - Query the value of an element's computed CSS property. -
          - GET /session/:sessionId/orientation
          - Get the current browser orientation. -
          - NA -
          - POST /session/:sessionId/orientation
          - Set the browser orientation. -
          - NA -
          - GET /session/:sessionId/alert_text
          - Gets the text of the currently displayed JavaScript alert(), confirm(), or prompt() dialog. -
          - NA -
          - POST /session/:sessionId/alert_text
          - Sends keystrokes to a JavaScript prompt() dialog. -
          - NA -
          - POST /session/:sessionId/accept_alert
          - Accepts the currently displayed alert dialog. -
          - acceptAlert(cb) -> cb(err) -
          - POST /session/:sessionId/dismiss_alert
          - Dismisses the currently displayed alert dialog. -
          - dismissAlert(cb) -> cb(err) -
          - POST /session/:sessionId/moveto
          - Move the mouse by an offset of the specificed element. -
          - moveTo(element, xoffset, yoffset, cb) -> cb(err) -
          - POST /session/:sessionId/click
          - Click any mouse button (at the coordinates set by the last moveto command). -
          - click(button, cb) -> cb(err)
          - buttons: {left: 0, middle: 1 , right: 2} -
          - POST /session/:sessionId/buttondown
          - Click and hold the left mouse button (at the coordinates set by the last moveto command). -
          - buttonDown(cb) -> cb(err) -
          - POST /session/:sessionId/buttonup
          - Releases the mouse button previously held (where the mouse is currently at). -
          - buttonUp(cb) -> cb(err) -
          - POST /session/:sessionId/doubleclick
          - Double-clicks at the current mouse coordinates (set by moveto). -
          - doubleclick(cb) -> cb(err)
          -
          - POST /session/:sessionId/touch/click
          - Single tap on the touch enabled device. -
          - NA -
          - POST /session/:sessionId/touch/down
          - Finger down on the screen. -
          - NA -
          - POST /session/:sessionId/touch/up
          - Finger up on the screen. -
          - NA -
          - POST session/:sessionId/touch/move
          - Finger move on the screen. -
          - NA -
          - POST session/:sessionId/touch/scroll
          - Scroll on the touch screen using finger based motion events. -
          - NA -
          - POST session/:sessionId/touch/scroll
          - Scroll on the touch screen using finger based motion events. -
          - NA -
          - POST session/:sessionId/touch/doubleclick
          - Double tap on the touch screen using finger motion events. -
          - NA -
          - POST session/:sessionId/touch/longclick
          - Long press on the touch screen using finger motion events. -
          - NA -
          - POST session/:sessionId/touch/flick
          - Flick on the touch screen using finger motion events. -
          - NA -
          - POST session/:sessionId/touch/flick
          - Flick on the touch screen using finger motion events. -
          - NA -
          - GET /session/:sessionId/location
          - Get the current geo location. -
          - NA -
          - POST /session/:sessionId/location
          - Set the current geo location. -
          - NA -
          - GET /session/:sessionId/local_storage
          - Get all keys of the storage. -
          - NA -
          - POST /session/:sessionId/local_storage
          - Set the storage item for the given key. -
          - NA -
          - DELETE /session/:sessionId/local_storage
          - Clear the storage. -
          - NA -
          - GET /session/:sessionId/local_storage/key/:key
          - Get the storage item for the given key. -
          - NA -
          - DELETE /session/:sessionId/local_storage/key/:key
          - Remove the storage item for the given key. -
          - NA -
          - GET /session/:sessionId/local_storage/size
          - Get the number of items in the storage. -
          - NA -
          - GET /session/:sessionId/session_storage
          - Get all keys of the storage. -
          - NA -
          - POST /session/:sessionId/session_storage
          - Set the storage item for the given key. -
          - NA -
          - DELETE /session/:sessionId/session_storage
          - Clear the storage. -
          - NA -
          - GET /session/:sessionId/session_storage/key/:key
          - Get the storage item for the given key. -
          - NA -
          - DELETE /session/:sessionId/session_storage/key/:key
          - Remove the storage item for the given key. -
          - NA -
          - GET /session/:sessionId/session_storage/size
          - Get the number of items in the storage. -
          - NA -
          - EXTRA: waitForElement
          - Waits for an element to be in the DOM. -
          - waitForElement(using, value, cb) -> cb(err) -
          - EXTRA: isVisible
          - Checks if a element is in the dom and it's not display:none. -
          - isVisible(using, value, cb) -> cb(err, boolean) -
          - EXTRA: waitForCondition
          - Waits for JavaScript condition to be true (polling within wd client). -
          - waitForCondition(conditionExpr, timeout, pollFreq, cb) -> cb(err, boolean) -
            -
          • conditionExpr should return a boolean
          • -
          • timeout and pollFreq are optional (default: 1000, 100).
          • -
          • return true if condition satisfied, error otherwise.
          • -
          -
          - EXTRA: waitForConditionInBrowser
          - Waits for JavaScript condition to be true. (async script polling within browser) -
          - waitForConditionInBrowser(conditionExpr, timeout, pollFreq, cb) -> cb(err, boolean) -
            -
          • setAsyncScriptTimeout must be set to value higher than timeout
          • -
          • conditionExpr should return a boolean
          • -
          • timeout and pollFreq are optional (default: 1000, 100).
          • -
          • return true if condition satisfied, error otherwise.
          • -
          -
          diff --git a/node_modules/wd/doc/jsonwiremap-supported.md b/node_modules/wd/doc/jsonwiremap-supported.md deleted file mode 100644 index abe1d5b..0000000 --- a/node_modules/wd/doc/jsonwiremap-supported.md +++ /dev/null @@ -1,543 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          - JsonWireProtocol - - wd -
          - GET /status
          - Query the server's current status. -
          - status(cb) -> cb(err, status) -
          - POST /session
          - Create a new session. -
          - init(desired, cb) -> cb(err, sessionID) -
          - GET /sessions
          - Returns a list of the currently active sessions. -
          -
            -
          • all sessions: sessions(cb) -> cb(err, sessions)
          • -
          • - current session:
            - altSessionCapabilities(cb) -> cb(err, capabilities) -
          • -
          -
          - GET /session/:sessionId
          - Retrieve the capabilities of the specified session. -
          - sessionCapabilities(cb) -> cb(err, capabilities) -
          - DELETE /session/:sessionId
          - Delete the session. -
          - quit(cb) -> cb(err) -
          - POST /session/:sessionId/timeouts
          - Configure the amount of time that a particular type of operation can execute for before they are aborted and a |Timeout| error is returned to the client. -
          -
            -
          • - configurable type: NA (but setImplicitWaitTimeout and - setAsyncScriptTimeout do the same) -
          • -
          • - page load timeout:
            - setPageLoadTimeout(ms, cb) -> cb(err) -
          • -
          -
          - POST /session/:sessionId/timeouts/async_script
          - Set the amount of time, in milliseconds, that asynchronous scripts executed by /session/:sessionId/execute_async are permitted to run before they are aborted and a |Timeout| error is returned to the client. -
          - setAsyncScriptTimeout(ms, cb) -> cb(err) -
          - POST /session/:sessionId/timeouts/implicit_wait
          - Set the amount of time the driver should wait when searching for elements. -
          - setImplicitWaitTimeout(ms, cb) -> cb(err) -
          - GET /session/:sessionId/url
          - Retrieve the URL of the current page. -
          - url(cb) -> cb(err, url) -
          - POST /session/:sessionId/url
          - Navigate to a new URL. -
          - get(url,cb) -> cb(err) -
          - POST /session/:sessionId/forward
          - Navigate forwards in the browser history, if possible. -
          - forward(cb) -> cb(err) -
          - POST /session/:sessionId/back
          - Navigate backwards in the browser history, if possible. -
          - back(cb) -> cb(err) -
          - POST /session/:sessionId/refresh
          - Refresh the current page. -
          - refresh(cb) -> cb(err) -
          - POST /session/:sessionId/execute
          - Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. -
          -
            -
          • - execute script:
            - execute(code, args, cb) -> cb(err, value returned) -
              -
            • args is an optional Array
            • -
            -
          • -
          • - execute script using eval(code):
            - safeExecute(code, args, cb) -> cb(err, value returned) -
              -
            • args is an optional Array
            • -
            -
          • -
          • - evaluate expression (using execute):
            - eval(code, cb) -> cb(err, value) -
          • -
          • - evaluate expression (using safeExecute):
            - safeEval(code, cb) -> cb(err, value) -
          • -
          -
          - POST /session/:sessionId/execute_async
          - Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. -
          -
            -
          • - execute async script:
            - executeAsync(code, args, cb) -> cb(err, value returned) -
              -
            • args is an optional Array
            • -
            -
          • -
          • - execute async script using eval(code):
            - safeExecuteAsync(code, args, cb) -> cb(err, value returned) -
              -
            • args is an optional Array
            • -
            -
          • -
          -
          - DELETE /session/:sessionId/window
          - Close the current window. -
          - close(cb) -> cb(err) -
          - GET /session/:sessionId/cookie
          - Retrieve all cookies visible to the current page. -
          - allCookies() -> cb(err, cookies) -
          - POST /session/:sessionId/cookie
          - Set a cookie. -
          - setCookie(cookie, cb) -> cb(err) -
          - DELETE /session/:sessionId/cookie
          - Delete all cookies visible to the current page. -
          - deleteAllCookies(cb) -> cb(err) -
          - DELETE /session/:sessionId/cookie/:name
          - Delete the cookie with the given name. -
          - deleteCookie(name, cb) -> cb(err) -
          - GET /session/:sessionId/title
          - Get the current page title. -
          - title(cb) -> cb(err, title) -
          - POST /session/:sessionId/element
          - Search for an element on the page, starting from the document root. -
          -
            -
          • - element(using, value, cb) -> cb(err, element)
            -
          • -
          • - elementsuffix(value, cb) -> cb(err, element)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
          • - see also hasElement, hasElementsuffix, elementOrNull, elementsuffixOrNull, - elementIfExists, elementsuffixIfExists, in the elements section. -
          • -
              -
          - POST /session/:sessionId/elements
          - Search for multiple elements on the page, starting from the document root. -
          -
            -
          • - elements(using, value, cb) -> cb(err, elements)
            -
          • -
          • - elementssuffix(value, cb) -> cb(err, elements)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
          • - hasElement(using, value, cb) -> cb(err, boolean)
            -
          • -
          • - hasElementsuffix(value, cb) -> cb(err, boolean)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
          • - elementOrNull(using, value, cb) -> cb(err, element)
            - (avoids not found error throw and returns null instead) -
          • -
          • - elementsuffixOrNull(value, cb) -> cb(err, element)
            - (avoids not found error throw and returns null instead)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
          • - elementIfExists(using, value, cb) -> cb(err, element)
            - (avoids not found error throw and returns undefined instead) -
          • -
          • - elementsuffixIfExists(value, cb) -> cb(err, element)
            - (avoids not found error throw and returns undefined instead)
            - suffix: - ByClassName, ByCssSelector, ById, - ByName, ByLinkText, ByPartialLinkText, - ByTagName, ByXPath, ByCss -
          • -
              -
          - POST /session/:sessionId/element/active
          - Get the element on the page that currently has focus. -
          - active(cb) -> cb(err, element) -
          - POST /session/:sessionId/element/:id/click
          - Click on an element. -
          - clickElement(element, cb) -> cb(err) -
          - GET /session/:sessionId/element/:id/text
          - Returns the visible text for the element. -
          -
            -
          • - text(element, cb) -> (err, text) -
          • -
          • - textPresent(searchText, element, cb) -> (err, boolean) -
          • -
          -
          - POST /session/:sessionId/element/:id/value
          - Send a sequence of key strokes to an element. -
          -
            -
          • - type(element, keys, cb) -> cb(err) -
          • -
          • - special key map: wd.SPECIAL_KEYS (see lib/special-keys.js) -
          • -
          -
          - POST /session/:sessionId/keys
          - Send a sequence of key strokes to the active element. -
          -
            -
          • - keys(keys, cb) -> cb(err) -
          • -
          • - special key map: wd.SPECIAL_KEYS (see lib/special-keys.js) -
          • -
          -
          - POST /session/:sessionId/element/:id/clear
          - Clear a TEXTAREA or text INPUT element's value. -
          - clear(element, cb) -> cb(err) -
          - GET /session/:sessionId/element/:id/attribute/:name
          - Get the value of an element's attribute. -
          -
            -
          • - getAttribute(element, attrName, cb) -> cb(err, value) -
          • -
          • - getValue(element, cb) -> cb(err, value) -
          • -
          -
          - POST /session/:sessionId/accept_alert
          - Accepts the currently displayed alert dialog. -
          - acceptAlert(cb) -> cb(err) -
          - POST /session/:sessionId/dismiss_alert
          - Dismisses the currently displayed alert dialog. -
          - dismissAlert(cb) -> cb(err) -
          - POST /session/:sessionId/moveto
          - Move the mouse by an offset of the specificed element. -
          - moveTo(element, xoffset, yoffset, cb) -> cb(err) -
          - POST /session/:sessionId/click
          - Click any mouse button (at the coordinates set by the last moveto command). -
          - click(button, cb) -> cb(err)
          - buttons: {left: 0, middle: 1 , right: 2} -
          - POST /session/:sessionId/buttondown
          - Click and hold the left mouse button (at the coordinates set by the last moveto command). -
          - buttonDown(cb) -> cb(err) -
          - POST /session/:sessionId/buttonup
          - Releases the mouse button previously held (where the mouse is currently at). -
          - buttonUp(cb) -> cb(err) -
          - POST /session/:sessionId/doubleclick
          - Double-clicks at the current mouse coordinates (set by moveto). -
          - doubleclick(cb) -> cb(err)
          -
          - EXTRA: waitForElement
          - Waits for an element to be in the DOM. -
          - waitForElement(using, value, cb) -> cb(err) -
          - GET /session/:sessionId/element/:id/css/:propertyName
          - Query the value of an element's computed CSS property. -
          - getComputedCSS(element, styleName, cb) -> cb(err, value) -
          - EXTRA: isVisible
          - Checks if a element is in the dom and it's not display:none. -
          - isVisible(using, value, cb) -> cb(err, boolean) -
          - EXTRA: waitForCondition
          - Waits for JavaScript condition to be true (polling within wd client). -
          - waitForCondition(conditionExpr, timeout, pollFreq, cb) -> cb(err, boolean) -
            -
          • conditionExpr should return a boolean
          • -
          • timeout and pollFreq are optional (default: 1000, 100).
          • -
          • return true if condition satisfied, error otherwise.
          • -
          -
          - EXTRA: waitForConditionInBrowser
          - Waits for JavaScript condition to be true. (async script polling within browser) -
          - waitForConditionInBrowser(conditionExpr, timeout, pollFreq, cb) -> cb(err, boolean) -
            -
          • setAsyncScriptTimeout must be set to value higher than timeout
          • -
          • conditionExpr should return a boolean
          • -
          • timeout and pollFreq are optional (default: 1000, 100).
          • -
          • return true if condition satisfied, error otherwise.
          • -
          -
          diff --git a/node_modules/wd/doc/supported-methods-old.md b/node_modules/wd/doc/supported-methods-old.md deleted file mode 100644 index 097376c..0000000 --- a/node_modules/wd/doc/supported-methods-old.md +++ /dev/null @@ -1,24 +0,0 @@ -From previous version of README - -## Supported Methods - -
          -  - 'close': Close the browser
          -  - 'quit': Quit the session
          -  - 'eval': Eval JS and return the value (takes a code string)
          -  - 'execute': Eval JS (takes a code string)
          -  - 'executeAsync': Execute JS in an async way (takes a code string)
          -  - 'get': Navigate the browser to the provided url (takes a URL)
          -  - 'setWaitTimeout': Set the implicit wait timeout in milliseonds (takes wait time in ms)
          -  - 'element': Access an element in the page (takes 'using' and 'value' so ex: 'id', 'idofelement')
          -  - 'moveTo': Move an element on the page (takes element, xoffset and yoffset'
          -  - 'scroll': Scroll on an element (takes element, xoffset, yoffset)
          -  - 'buttonDown': Click and hold the left mouse button down, at the coords of the last moveTo
          -  - 'buttonUp': Release the left mouse button
          -  - 'click': Click a mouse button, at the coords of the last moveTo (takes a button param for {LEFT = 0, MIDDLE = 1 , RIGHT = 2})
          -  - 'doubleClick': Double click a mouse button, same coords as click
          -  - 'type': Type! (takes an element, a key character, or an array of char keys)
          -  - 'active': Get the element on the page currently with focus
          -  - 'keyToggle': Press a keyboard key (takes an element and a key character'
          -  - 'setCookie': Sets a cookie
          -
          diff --git a/node_modules/wd/examples/example.chrome.js b/node_modules/wd/examples/example.chrome.js deleted file mode 100644 index 55b78a1..0000000 --- a/node_modules/wd/examples/example.chrome.js +++ /dev/null @@ -1,37 +0,0 @@ -var webdriver; -try { - webdriver = require('wd'); -} catch( err ) { - webdriver = require('../lib/main'); -} -var assert = require('assert'); -var browser = webdriver.remote(); - -browser.on('status', function(info){ - console.log('\x1b[36m%s\x1b[0m', info); -}); - -browser.on('command', function(meth, path){ - console.log(' > \x1b[33m%s\x1b[0m: %s', meth, path); -}); - -browser.init({ - browserName:'chrome' - , tags : ["examples"] - , name: "This is an example test" - }, function() { - - browser.get("http://saucelabs.com/test/guinea-pig", function() { - browser.title(function(err, title) { - assert.ok(~title.indexOf('I am a page title - Sauce Labs'), 'Wrong title!'); - browser.elementById('submit', function(err, el) { - browser.clickElement(el, function() { - browser.eval("window.location.href", function(err, title) { - assert.ok(~title.indexOf('#'), 'Wrong title!'); - browser.quit() - }) - }) - }) - }) - }) -}) diff --git a/node_modules/wd/examples/example.firefox.js b/node_modules/wd/examples/example.firefox.js deleted file mode 100644 index 8137a88..0000000 --- a/node_modules/wd/examples/example.firefox.js +++ /dev/null @@ -1,46 +0,0 @@ -var webdriver; -webdriver = require('../lib/main'); - -var assert = require('assert'); -var browser = webdriver.remote(); - -browser.on('status', function(info){ - console.log('\x1b[36m%s\x1b[0m', info); -}); - -browser.on('command', function(meth, path){ - console.log(' > \x1b[33m%s\x1b[0m: %s', meth, path); -}); - -browser.init({ - browserName:'firefox' - , tags : ["examples"] - , name: "This is an example test" - }, function() { - - browser.get("http://saucelabs.com/test/guinea-pig", function() { - browser.title(function(err, title) { - assert.ok(~title.indexOf('I am a page title - Sauce Labs'), 'Wrong title!'); - browser.elementById('comments', function(err, el) { - el.sendKeys("this is not a comment", function(err) { - browser.elementById('submit', function(err, el) { - el.click(function() { - browser.eval("window.location.href", function(err, title) { - assert.ok(~title.indexOf('#'), 'Wrong title!'); - browser.elementById("your_comments", function(err, el) { - el.textPresent("this is not a comment", function(err, present) { - assert.ok(present, "Comments not correct"); - el.text(function(err, text) { - console.log(text); - browser.quit(); - }) - }) - }) - }) - }) - }) - }) - }) - }) - }) -}); diff --git a/node_modules/wd/examples/example.ondemand.ie.js b/node_modules/wd/examples/example.ondemand.ie.js deleted file mode 100644 index f89e394..0000000 --- a/node_modules/wd/examples/example.ondemand.ie.js +++ /dev/null @@ -1,44 +0,0 @@ -// CONFIGURE SAUCE CREDENTIALS HERE -var username = "", -accessKey = ""; - -var webdriver; -try { - webdriver = require('wd'); -} catch( err ) { - webdriver = require('../lib/main'); -} -var assert = require('assert'); -var browser = webdriver.remote("ondemand.saucelabs.com", 80, username, accessKey); - -browser.on('status', function(info){ - console.log('\x1b[36m%s\x1b[0m', info); -}); - -browser.on('command', function(meth, path){ - console.log(' > \x1b[33m%s\x1b[0m: %s', meth, path); -}); - -var desired = { - browserName:'iexplore' - , version:'9' - , platform:'Windows 2008' - , tags: ["examples"] - , name: "This is an example test" -} - -browser.init( desired, function() { - browser.get("http://saucelabs.com/test/guinea-pig", function() { - browser.title(function(err, title) { - assert.ok(~title.indexOf('I am a page title - Sauce Labs'), 'Wrong title!'); - browser.elementById('submit', function(err, el) { - browser.clickElement(el, function() { - browser.eval("window.location.href", function(err, title) { - assert.ok(~title.indexOf('#'), 'Wrong title!'); - browser.quit() - }) - }) - }) - }) - }) -}) diff --git a/node_modules/wd/examples/example.ondemand.js b/node_modules/wd/examples/example.ondemand.js deleted file mode 100644 index 3bd3c4f..0000000 --- a/node_modules/wd/examples/example.ondemand.js +++ /dev/null @@ -1,42 +0,0 @@ -// CONFIGURE SAUCE CREDENTIALS HERE -var username = "", -accessKey = ""; - -var webdriver; -try { - webdriver = require('wd'); -} catch( err ) { - webdriver = require('../lib/main'); -} -var assert = require('assert'); - -var browser = webdriver.remote("ondemand.saucelabs.com", 80, username, accessKey); - -browser.on('status', function(info){ - console.log('\x1b[36m%s\x1b[0m', info); -}); - -browser.on('command', function(meth, path){ - console.log(' > \x1b[33m%s\x1b[0m: %s', meth, path); -}); - -var desired = { - tags: ["examples"] - , name: "This is an example test" -} - -browser.init(desired, function() { - browser.get("http://saucelabs.com/test/guinea-pig", function() { - browser.title(function(err, title) { - assert.ok(~title.indexOf('I am a page title - Sauce Labs'), 'Wrong title!'); - browser.elementById('submit', function(err, el) { - browser.clickElement(el, function() { - browser.eval("window.location.href", function(err, title) { - assert.ok(~title.indexOf('#'), 'Wrong title!'); - browser.quit() - }) - }) - }) - }) - }) -}) diff --git a/node_modules/wd/lib/bin.js b/node_modules/wd/lib/bin.js deleted file mode 100755 index 03090d9..0000000 --- a/node_modules/wd/lib/bin.js +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env node - -var net = require('net') - , repl = require('repl') - , assert = require('assert') - , wd = require('./main') - ; - -var startRepl = function() { - var r = repl.start('(wd): '); - r.context.assert = assert; - r.context.wd = wd; - r.context.help = function() { - console.log("WD - Shell."); - console.log("Access the webdriver object via the object: 'wd'"); - }; - - net.createServer(function (socket) { - connections += 1; - repl.start("(wd): ", socket); - }).listen("/tmp/node-repl-sock"); -}; - -if (process.argv[2] == "shell") { - startRepl() -} \ No newline at end of file diff --git a/node_modules/wd/lib/browser-scripts/safe-execute-async.js b/node_modules/wd/lib/browser-scripts/safe-execute-async.js deleted file mode 100644 index 3b312f7..0000000 --- a/node_modules/wd/lib/browser-scripts/safe-execute-async.js +++ /dev/null @@ -1,7 +0,0 @@ -var code = arguments[0], args = arguments[1], done = arguments[2]; -var wrap = function() { - return eval(code); -}; - -args.push(done); -return wrap.apply(this, args); diff --git a/node_modules/wd/lib/browser-scripts/safe-execute.js b/node_modules/wd/lib/browser-scripts/safe-execute.js deleted file mode 100644 index adb46c2..0000000 --- a/node_modules/wd/lib/browser-scripts/safe-execute.js +++ /dev/null @@ -1,7 +0,0 @@ -var code = arguments[0], args = arguments[1]; - -var wrap = function() { - return eval(code); -} - -return wrap.apply(this, args); diff --git a/node_modules/wd/lib/browser-scripts/wait-for-cond-in-browser.js b/node_modules/wd/lib/browser-scripts/wait-for-cond-in-browser.js deleted file mode 100644 index 6ce7eea..0000000 --- a/node_modules/wd/lib/browser-scripts/wait-for-cond-in-browser.js +++ /dev/null @@ -1,32 +0,0 @@ -// run in the browser - -//parse arguments -var condExpr = arguments[0], timeout = arguments[1], -poll = arguments[2], cb = arguments[3]; - -// recursive implementation -var waitForConditionImpl = function(conditionExpr, limit, poll, cb) { - - // timeout check - if (Date.now() < limit) { - // condition check - var res = eval(conditionExpr); - if (res == true ) { - // condition ok - return cb(res); - } else { - // wait for poll and try again - setTimeout(function() { - waitForConditionImpl(conditionExpr, limit, poll, cb); - }, poll); - } - } else { - // try one last time - res = eval(conditionExpr); - return cb(res); - } -}; - -// calling impl -var limit = Date.now() + timeout; -waitForConditionImpl(condExpr, limit, poll, cb); diff --git a/node_modules/wd/lib/builder.js b/node_modules/wd/lib/builder.js deleted file mode 100644 index f2883e0..0000000 --- a/node_modules/wd/lib/builder.js +++ /dev/null @@ -1,341 +0,0 @@ -var http = require('http') -, __slice = Array.prototype.slice -,JSONWIRE_ERRORS = require('./jsonwire-errors.js') -,element = require('./element').element; - -var strip = function strip(str) { - var x = []; - for (var i = 0; i < str.length; i++) { - if (str.charCodeAt(i)) { - x.push(str.charAt(i)); - } - } - return x.join(''); -}; - -var getJsonwireError = function(status) { - var jsonwireError = JSONWIRE_ERRORS.filter(function(err) { - return err.status = status; - }); - return ((jsonwireError.length>0) ? jsonwireError[0] : null); -}; - -var newError = function(opts) -{ - var err = new Error(); - for (var k in opts) { - err[k] = opts[k] - } - // nicer error output - err.inspect = function() { - var res = ""; - var browserError = null; - for (var k in this) { - var _this = this; - (function() { - var v = _this[k]; - if (typeof v === 'object') { - if ((v["class"] != null) && v["class"].match(/org.openqa.selenium.remote.Response/)) { - // for selenium classes, hidding long fields or field with - // duplicate information - var vAsStr = JSON.stringify(v, function(key, value) { - if (key === 'screen' || key === 'stackTrace' || key === 'buildInformation' || key === 'localizedMessage') { - return '[hidden]'; - } else if (key === 'message') { - // trying to extract browser error message - var messageMatch = value.match(/([^\n]+)\nCommand duration/); - if((messageMatch!=null) && (messageMatch.length >= 1)) { browserError = messageMatch[1].trim(); } - return value; - } else { - return value; - } - }, " "); - res += k + ": " + vAsStr + "\n"; - } else { - // for other objects making sure output is not too long - var vAsStr = JSON.stringify(v, undefined, " "); - var maxLength = 1000; - if (vAsStr.length > maxLength) { - vAsStr = vAsStr.substr(0, maxLength) + "\n..."; - } - res += k + ": " + vAsStr + "\n"; - } - } else if (typeof v != 'function') - { - // printing non object types without modif - res += k + ": " + v + "\n"; - } - })(); - }; - if(browserError != null){ - res += "browser-error: " + browserError + "\n"; - } - return res; - }; - return err; -}; - -var isWebDriverException = function(res) { - var _ref; - if ((typeof res !== "undefined" && res !== null ? - (_ref = res["class"]) != null ? _ref.indexOf('WebDriverException') : - void 0 : void 0) > 0) { - return true; - } - return false; -} - -// just calls the callback when there is no result -var simpleCallback = function(cb) { - return function(res) { - if(res==null) { - // expected behaviour for quit - if(cb!=null){ return cb();} - }else{ - res.setEncoding('utf8'); - var data = ''; - res.on('data', function(chunk) { data += chunk.toString(); }); - res.on('end', function() { - if(data == '') { - // expected behaviour - return cb() - } else { - // something wrong - if(cb!=null){ - return cb(new Error( - {message:'Unexpected data in simpleCallback.', data:data}) ); - } - } - }); - } - }; -}; - -// base for all callback handling data -var callbackWithDataBase = function(cb) { - return function(res) { - res.setEncoding('utf8'); - var data = ''; - res.on('data', function(chunk) { data += chunk.toString(); }); - res.on('end', function() { - var obj; - try { - obj = JSON.parse(strip(data)); - } catch (e) { - return cb(newError({message:'Not JSON response', data:data})); - } - if (obj.status > 0) { - var err = newError( - {message:'Error response status.',status:obj.status,cause:obj}); - var jsonwireError = getJsonwireError(obj.status); - if(jsonwireError != null){ err['jsonwire-error'] = jsonwireError; } - cb(err); - } else { - cb(null, obj); - } - }); - } -}; - -// retrieves field value from result -var callbackWithData = function(cb) { - return callbackWithDataBase(function(err,obj) { - if(err != null) {return cb(err);} - if(isWebDriverException(obj.value)) {return cb(newError( - {message:obj.value.message,cause:obj.value}));} - cb(null, obj.value); - }); -}; - -// retrieves ONE element -var elementCallback = function(cb) { - return callbackWithDataBase(function(err, obj) { - _this = this; - if(err != null) {return cb(err);} - if(isWebDriverException(obj.value)) {return cb(newError( - {message:obj.value.message,cause:obj.value}));} - if (!obj.value.ELEMENT) { - cb(newError( - {message:"no ELEMENT in response value field.",cause:obj})); - } else { - var el = new element(obj.value.ELEMENT, _this); - cb(null, el); - } - }); -}; - -// retrieves SEVERAL elements -var elementsCallback = function(cb) { - return callbackWithDataBase(function(err, obj) { - _this = this; - if(err != null) {return cb(err);} - if(isWebDriverException(obj.value)) {return cb(newError( - {message:obj.value.message,cause:obj.value}));} - if (!(obj.value instanceof Array)) {return cb(newError( - {message:"Response value field is not an Array.", cause:obj.value}));} - var i, elements = []; - for (i = 0; i < obj.value.length; i++) { - var el = new element(obj.value[i].ELEMENT, _this); - elements.push(el); - } - cb(null, elements); - }); -}; - -var newHttpOpts = function(method) { - var opts = new Object(); - opts.method = method; - for (var o in this.options) { - opts[o] = this.options[o]; - } - opts.headers = {}; - opts.headers['Connection'] = 'keep-alive'; - if (opts.method === 'POST' || opts.method === 'GET') - opts.headers['Accept'] = 'application/json'; - if (opts.method == 'POST') - opts.headers['Content-Type'] = 'application/json; charset=UTF-8'; - return opts; -}; - -// session initialization -var init = function(desired, cb) { - var _this = this; - - //allow desired ovveride to be left out - if (typeof desired == 'function') { - cb = desired; - desired = {}; - } - - // making copy - var _desired = {}; - for (var k in desired) { - _desired[k] = desired[k]; - } - - // defaulting capabilities when necessary - for (var k in this.defaultCapabilities) { - _desired[k] = _desired[k] || this.defaultCapabilities[k]; - } - - // http options - var httpOpts = newHttpOpts.apply(this, ['POST']); - - // authentication (for saucelabs) - if ((_this.username != null) && (_this.accessKey != null)) { - var authString = _this.username + ':' + _this.accessKey; - var buf = new Buffer(authString); - httpOpts['headers'] = { - 'Authorization': 'Basic ' + buf.toString('base64') - }; - } - - // building request - var req = http.request(httpOpts, function(res) { - var data = ''; - res.on('data', function(chunk) { - data += chunk; - }); - res.on('end', function() { - if (res.headers.location == undefined) { - console.log('\x1b[31mError\x1b[0m: The environment you requested was unavailable.\n'); - console.log('\x1b[33mReason\x1b[0m:\n'); - console.log(data); - console.log('\nFor the available values please consult the WebDriver JSONWireProtocol,'); - console.log('located at: \x1b[33mhttp://code.google.com/p/selenium/wiki/JsonWireProtocol#/session\x1b[0m'); - if (cb) - cb({ message: 'The environment you requested was unavailable.' }); - return; - } - var locationArr = res.headers.location.split('/'); - _this.sessionID = locationArr[locationArr.length - 1]; - _this.emit('status', '\nDriving the web on session: ' + _this.sessionID + '\n'); - - if (cb) { cb(null, _this.sessionID) } - }); - }); - req.on('error', function(e) { cb(e); }); - - // writting data - req.write(JSON.stringify({desiredCapabilities: _desired})); - - // sending - req.end(); -}; - -// used to build all the methods except init -var methodBuilder = function(builderOpt) { - // by default we call simpleCallBack(cb) assuming cb is the last argument - var defaultCb = function() { - var args, cb, _i; - args = 2 <= arguments.length ? __slice.call(arguments, 0, - _i = arguments.length - 1) : (_i = 0, []), cb = arguments[_i++]; - return simpleCallback(cb); - }; - - return function(cb) { - var _this = this; - - // parsing arguments - var args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - - // http options init - var httpOpts = newHttpOpts.apply(this, [builderOpt.method]); - - // retrieving path information - var relPath = builderOpt.relPath; - if (typeof relPath === 'function') { relPath = relPath.apply(this, args) } - var absPath = builderOpt.absPath; - if (typeof absPath === 'function') { absPath = absPath.apply(this, args) } - - // setting path in http options - if (this.sessionID != null) { httpOpts['path'] += '/' + this.sessionID; } - if (relPath) { httpOpts['path'] += relPath; } - if (absPath) { httpOpts['path'] = absPath;} - - // building callback - cb = (builderOpt.cb || defaultCb).apply(this, args); - - // wrapping cb if we need to emit a message - if (builderOpt.emit != null) { - var _cb = cb; - cb = function(res) { - if (builderOpt.emit != null) { - _this.emit(builderOpt.emit.event, builderOpt.emit.message); - } - if (_cb) { _cb(); } - }; - } - - // logging - _this.emit('command', httpOpts['method'], - httpOpts['path'].replace(this.sessionID, ':sessionID') - .replace(this.basePath, '') - ); - - // building request - var req = http.request(httpOpts, cb); - req.on('error', function(e) { cb(e); }); - - // writting data - var data = ''; - if (builderOpt.data != null) { - data = builderOpt.data.apply(this, args); - } - if (typeof data === 'object') { - data = JSON.stringify(data); - } - req.write(data); - - //sending - req.end(); - }; -}; - -exports.simpleCallback = simpleCallback; -exports.callbackWithData = callbackWithData; -exports.elementCallback = elementCallback; -exports.elementsCallback = elementsCallback; -exports.init = init; -exports.methodBuilder = methodBuilder; - diff --git a/node_modules/wd/lib/element.js b/node_modules/wd/lib/element.js deleted file mode 100644 index a00a3f9..0000000 --- a/node_modules/wd/lib/element.js +++ /dev/null @@ -1,52 +0,0 @@ -//Element object -//Wrapper around browser methods - -var element = function(value, browser) { - this.value = value; -}; - -element.prototype.toString = function () { - return String(this.value); -}; - -element.prototype.sendKeys = function (keys, cb) { - _this = this; - this.wd.type(this, keys, cb); -}; - -element.prototype.click = function (cb) { - _this = this; - _this.wd.clickElement(_this, cb); -}; - -element.prototype.text = function (cb) { - _this = this; - _this.wd.text(_this, cb); -}; - -element.prototype.textPresent = function(searchText, cb) { - _this = this; - _this.wd.textPresent(searchText, _this, cb); -}; - -element.prototype.getAttribute = function(name, cb) { - _this = this; - _this.wd.getAttribute(_this, name, cb); -}; - -element.prototype.getValue = function(cb) { - _this = this; - _this.wd.getValue(_this, cb); -}; - -element.prototype.getComputedCSS = function(styleName, cb) { - _this = this; - _this.wd.getComputedCSS(_this, styleName, cb); -}; - -element.prototype.clear = function(cb) { - _this = this; - _this.wd.clear(_this, cb); -}; - -exports.element = element \ No newline at end of file diff --git a/node_modules/wd/lib/jsonwire-errors.js b/node_modules/wd/lib/jsonwire-errors.js deleted file mode 100644 index 145430b..0000000 --- a/node_modules/wd/lib/jsonwire-errors.js +++ /dev/null @@ -1,92 +0,0 @@ -var JSONWIRE_ERRORS = [ -{ - status: 0, - summary:'Success', - detail:'The command executed successfully.'} -, { - status: 7, - summary:'NoSuchElement', - detail:'An element could not be located on the page using the given search parameters.'} -, { - status: 8, - summary:'NoSuchFrame', - detail:'A request to switch to a frame could not be satisfied because the frame could not be found.'} -, { - status: 9, - summary:'UnknownCommand', - detail:'The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource.'} -, { - status: 10, - summary:'StaleElementReference', - detail:'An element command failed because the referenced element is no longer attached to the DOM.'} -, { - status: 11, - summary:'ElementNotVisible', - detail:'An element command could not be completed because the element is not visible on the page.'} -, { - status: 12, - summary:'InvalidElementState', - detail:'An element command could not be completed because the element is in an invalid state (e.g. attempting to click a disabled element).'} -, { - status: 13, - summary:'UnknownError', - detail:'An unknown server-side error occurred while processing the command.'} -, { - status: 15, - summary:'ElementIsNotSelectable', - detail:'An attempt was made to select an element that cannot be selected.'} -, { - status: 17, - summary:'JavaScriptError', - detail:'An error occurred while executing user supplied JavaScript.'} -, { - status: 19, - summary:'XPathLookupError', - detail:'An error occurred while searching for an element by XPath.'} -, { - status: 21, - summary:'Timeout', - detail:'An operation did not complete before its timeout expired.'} -, { - status: 23, - summary:'NoSuchWindow', - detail:'A request to switch to a different window could not be satisfied because the window could not be found.'} -, { - status: 24, - summary:'InvalidCookieDomain', - detail:'An illegal attempt was made to set a cookie under a different domain than the current page.'} -, { - status: 25, - summary:'UnableToSetCookie', - detail:'A request to set a cookie\'s value could not be satisfied.'} -, { - status: 26, - summary:'UnexpectedAlertOpen', - detail:'A modal dialog was open, blocking this operation'} -, { - status: 27, - summary:'NoAlertOpenError', - detail:'An attempt was made to operate on a modal dialog when one was not open.'} -, { - status: 28, - summary:'ScriptTimeout', - detail:'A script did not complete before its timeout expired.'} -, { - status: 29, - summary:'InvalidElementCoordinates', - detail:'The coordinates provided to an interactions operation are invalid.'} -, { - status: 30, - summary:'IMENotAvailable', - detail:'IME was not available.'} -, { - status: 31, - summary:'IMEEngineActivationFailed', - detail:'An IME engine could not be started.'} -, { - status: 32, - summary:'InvalidSelector', - detail:'Argument was an invalid selector (e.g. XPath/CSS).'} -] - -module.exports = JSONWIRE_ERRORS; diff --git a/node_modules/wd/lib/main.js b/node_modules/wd/lib/main.js deleted file mode 100644 index 39c5f43..0000000 --- a/node_modules/wd/lib/main.js +++ /dev/null @@ -1,87 +0,0 @@ -var EventEmitter = require('events').EventEmitter -, __slice = Array.prototype.slice -, protocol = require('./protocol') -, SPECIAL_KEYS = require('./special-keys') -, element = require('./element').element; - -// webdriver client main class -// remoteWdConfig is an option object containing the following fields: -// host,port, username, accessKey -var webdriver = function(remoteWdConfig) { - this.sessionID = null; - this.username = remoteWdConfig.username; - this.accessKey = remoteWdConfig.accessKey; - this.basePath = (remoteWdConfig.path || '/wd/hub'); - // default - this.options = { - host: remoteWdConfig.host || '127.0.0.1' - , port: remoteWdConfig.port || 4444 - , path: (this.basePath + '/session').replace('//', '/') - }; - this.defaultCapabilities = { - browserName: 'firefox' - , version: '' - , javascriptEnabled: true - , platform: 'ANY' - }; - // saucelabs default - if ((this.username != null) && (this.accessKey != null)) { - this.defaultCapabilities.platform = 'VISTA'; - } - - EventEmitter.call(this); -}; - -// wraps protocol methods to hide implementation -var wrap = function(f) { - return function() { - var args; - args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - return f.apply(this, args); - }; -}; - -// adding protocol methods -var k, v; -for (k in protocol) { - v = protocol[k]; - if (typeof v === 'function') { - webdriver.prototype[k] = wrap(v); - } -} - -webdriver.prototype.__proto__ = EventEmitter.prototype; - -// parses server parameters -var parseRemoteWdConfig = function(args) { - var accessKey, host, path, port, username, _ref; - if (typeof (args != null ? args[0] : void 0) === 'object') { - return args[0]; - } else { - host = args[0], port = args[1], username = args[2], accessKey = args[3]; - return { - host: host, - port: port, - username: username, - accessKey: accessKey - }; - - } -}; - -// creates the webdriver object -// server parameters can be passed in 2 ways -// - as a list of arguments host,port, username, accessKey -// - as an option object containing the fields above -exports.remote = function() { - var args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - var rwc = parseRemoteWdConfig(args); - - var wd = new webdriver(rwc); - - element.prototype.wd = wd; - - return wd; -}; - -exports.SPECIAL_KEYS = SPECIAL_KEYS diff --git a/node_modules/wd/lib/protocol.js b/node_modules/wd/lib/protocol.js deleted file mode 100644 index 5dfded8..0000000 --- a/node_modules/wd/lib/protocol.js +++ /dev/null @@ -1,701 +0,0 @@ -var fs = require('fs'); -var builder = require('./builder'); -var element = require('./element').element; -var async = require("async"); - -var methodBuilder = builder.methodBuilder -, callbackWithData = builder.callbackWithData -, elementCallback = builder.elementCallback -, elementsCallback = builder.elementsCallback -, __slice = Array.prototype.slice; - -var protocol = {}; - -protocol.init = builder.init; - -protocol.status = methodBuilder({ - method: 'GET' - , absPath: function() { return this.basePath + '/status' } - , cb: function(cb) { return callbackWithData(cb); } -}); - -protocol.sessions = methodBuilder({ - method: 'GET' - , absPath: function() { return this.basePath + '/sessions' } - , cb: function(cb) { return callbackWithData(cb); } -}); - -protocol.chain = function(){ - var _this = this; - - //add queue if not already here - if(!_this._queue){ - _this._queue = async.queue(function (task, callback) { - if(task.args.length > 0 && typeof task.args[task.args.length-1] === "function"){ - //wrap the existing callback - var func = task.args[task.args.length-1]; - task.args[task.args.length-1] = function(){ - func.apply(null, arguments); - callback(); - } - } else { - //add a callback - task.args.push(callback); - } - - //call the function - _this[task.name].apply(_this, task.args); - }, 1); - } - - var chain = {}; - - //builds a placeHolder functions - var buildPlaceholder = function(name){ - return function(){ - _this._queue.push({name: name, args: Array.prototype.slice.apply(arguments)}); - return chain; - } - } - - //fill the chain with placeholders - for(var name in _this){ - if(typeof _this[name] === "function" && name !== "chain"){ - chain[name] = buildPlaceholder(name); - } - } - - return chain; -} - -// alternate strategy to get session capabilities -// extract session capabilities from session list -protocol.altSessionCapabilities = function(cb) { - var _this = this; - // looking for the current session - protocol.sessions.apply(this, [function(err, sessions) { - if (err == null) { - sessions = sessions.filter(function(session) { - return session.id === _this.sessionID; - }); - var _ref; - return cb(null, (_ref = sessions[0]) != null ? _ref.capabilities : void 0); - } else { - return cb(err, sessions); - } - }]); -}; - -protocol.sessionCapabilities = methodBuilder({ - method: 'GET' - // default url - , cb: function(cb) { return callbackWithData(cb); } -}); - -protocol.close = methodBuilder({ - method: 'DELETE' - , relPath: '/window' -}); - -protocol.quit = methodBuilder({ - method: 'DELETE' - // default url - , emit: {event: 'status', message: '\nEnding your web drivage..\n'} -}); - -protocol.eval = function(code, cb) { - code = "return " + code + ";" - protocol.execute.apply( this, [code, function(err, res) { - if(err!=null) {return cb(err);} - cb(null, res); - }]); -}; - -protocol.safeEval = function(code, cb) { - protocol.safeExecute.apply( this, [code, function(err, res) { - if(err!=null) {return cb(err);} - cb(null, res); - }]); -}; - -protocol.execute = methodBuilder({ - method: 'POST' - , relPath: '/execute' - , cb: function() { - // parsing args, cb at the end - var cb, _args, _i; - _args = 2 <= arguments.length ? __slice.call(arguments, 0, - _i = arguments.length - 1) : (_i = 0, []), cb = arguments[_i++]; - - return callbackWithData(cb); - } - , data: function() { - // parsing arguments (code,args,cb) with optional args - var args, cb, code, _args, _i; - _args = 2 <= arguments.length ? __slice.call(arguments, 0, - _i = arguments.length - 1) : (_i = 0, []), cb = arguments[_i++]; - code = _args[0], args = _args[1]; - - //args default - if (typeof args === "undefined" || args === null) { - args = []; - } - - return {script: code, args: args}; - } -}); - -// script to be executed in browser -var safeExecuteJsScript = fs.readFileSync( __dirname + "/browser-scripts/safe-execute.js", 'utf8'); - -protocol.safeExecute = methodBuilder({ - method: 'POST' - , relPath: '/execute' - , cb: function() { - // parsing args, cb at the end - var cb, _args, _i; - _args = 2 <= arguments.length ? __slice.call(arguments, 0, - _i = arguments.length - 1) : (_i = 0, []), cb = arguments[_i++]; - return callbackWithData(cb); - } - , data: function() { - // parsing arguments (code,args,cb) with optional args - var args, cb, code, _args, _i; - _args = 2 <= arguments.length ? __slice.call(arguments, 0, - _i = arguments.length - 1) : (_i = 0, []), cb = arguments[_i++]; - code = _args[0], args = _args[1]; - - //args default - if (typeof args === "undefined" || args === null) { - args = []; - } - - return {script: safeExecuteJsScript, args: [code, args]}; - } -}); - -protocol.executeAsync = methodBuilder({ - method: 'POST' - , relPath: '/execute_async' - , cb: function() { - // parsing args, cb at the end - var cb, _args, _i; - _args = 2 <= arguments.length ? __slice.call(arguments, 0, - _i = arguments.length - 1) : (_i = 0, []), cb = arguments[_i++]; - - return callbackWithData(cb); - } - , data: function(code) { - // parsing arguments (code,args,cb) with optional args - var args, cb, code, _args, _i; - _args = 2 <= arguments.length ? __slice.call(arguments, 0, - _i = arguments.length - 1) : (_i = 0, []), cb = arguments[_i++]; - code = _args[0], args = _args[1]; - - //args default - if (typeof args === "undefined" || args === null) { - args = []; - } - - return {script: code, args: args}; - } -}); - -// script to be executed in browser -var safeExecuteAsyncJsScript = fs.readFileSync( __dirname + "/browser-scripts/safe-execute-async.js", 'utf8'); - -protocol.safeExecuteAsync = methodBuilder({ - method: 'POST' - , relPath: '/execute_async' - , cb: function() { - // parsing args, cb at the end - var cb, _args, _i; - _args = 2 <= arguments.length ? __slice.call(arguments, 0, - _i = arguments.length - 1) : (_i = 0, []), cb = arguments[_i++]; - - return callbackWithData(cb); - } - , data: function(code) { - // parsing arguments (code,args,cb) with optional args - var args, cb, code, _args, _i; - _args = 2 <= arguments.length ? __slice.call(arguments, 0, - _i = arguments.length - 1) : (_i = 0, []), cb = arguments[_i++]; - code = _args[0], args = _args[1]; - - //args default - if (typeof args === "undefined" || args === null) { - args = []; - } - - return {script: safeExecuteAsyncJsScript , args: [code, args]}; - } -}); - -protocol.get = methodBuilder({ - method: 'POST' - , relPath: '/url' - , data: function(url) { return {'url': url}; } -}); - -protocol.refresh = methodBuilder({ - method: 'POST' - , relPath: '/refresh' -}); - -protocol.forward = methodBuilder({ - method: 'POST' - , relPath: '/forward' -}); - -protocol.back = methodBuilder({ - method: 'POST' - , relPath: '/back' -}); - -protocol.setImplicitWaitTimeout = methodBuilder({ - method: 'POST' - , relPath: '/timeouts/implicit_wait' - , data: function(ms) { return {ms: ms}; } -}); - -// for backward compatibility -protocol.setWaitTimeout = protocol.setImplicitWaitTimeout; - -protocol.setAsyncScriptTimeout = methodBuilder({ - method: 'POST' - , relPath: '/timeouts/async_script' - , data: function(ms) { return {ms: ms}; } -}); - -protocol.setPageLoadTimeout = methodBuilder({ - method: 'POST' - , relPath: '/timeouts/timeouts' - , data: function(ms) { return {type: 'page load', ms: ms}; } -}); - -protocol.element = methodBuilder({ - method: 'POST' - , relPath: '/element' - , cb: function(using, value, cb) { return elementCallback(cb); } - , data: function(using, value) { return {using: using, value: value}; } -}); - -// avoid not found exception and return null instead -protocol.elementOrNull = function(using, value, cb) { - protocol.elements.apply(this, [using, value, - function(err, elements) { - if(err == null) - if(elements.length>0) {cb(null,elements[0]);} else {cb(null,null);} - else - cb(err); - } - ]); -}; - -// avoid not found exception and return undefined instead -protocol.elementIfExists = function(using, value, cb) { - protocol.elements.apply(this, [using, value, - function(err, elements) { - if(err == null) - if(elements.length>0) {cb(null,elements[0]);} else {cb(null,undefined);} - else - cb(err); - } - ]); -}; - -protocol.elements = methodBuilder({ - method: 'POST' - , relPath: '/elements' - , cb: function(using, value, cb) { return elementsCallback(cb); } - , data: function(using, value) { return {using: using, value: value}; } -}); - -protocol.hasElement = function(using, value, cb){ - protocol.elements.apply( this, [using, value, function(err, elements){ - if(err==null) - cb(null, elements.length > 0 ) - else - cb(err); - }]); -} - -// convert to type to something like ById, ByCssSelector, etc... -var elFuncSuffix = function(type){ - var res = (' by ' + type).replace(/(\s[a-z])/g, - function($1){return $1.toUpperCase().replace(' ','');}); - return res.replace('Xpath', 'XPath'); -}; - -// return correct jsonwire type -var elFuncFullType = function(type){ - if(type == 'css') {return 'css selector'} // shortcut for css - return type; -}; - -// from JsonWire spec + shortcuts -var elementFuncTypes = ['class name', 'css selector','id','name','link text', - 'partial link text','tag name', 'xpath', 'css' ]; - -// adding all elementBy... , elementsBy... function - -for (var i = 0; i < elementFuncTypes.length; i++) { - - (function() { - var type = elementFuncTypes[i]; - - protocol['element' + elFuncSuffix(type)] = function(value, cb) { - protocol.element.apply(this, [elFuncFullType(type), value, cb]); - }; - - // avoid not found exception and return null instead - protocol['element' + elFuncSuffix(type)+ 'OrNull'] = function(value, cb) { - protocol.elements.apply(this, [elFuncFullType(type), value, - function(err, elements) { - if(err == null) - if(elements.length>0) {cb(null,elements[0]);} else {cb(null,null);} - else - cb(err); - } - ]); - }; - - // avoid not found exception and return undefined instead - protocol['element' + elFuncSuffix(type)+ 'IfExists'] = function(value, cb) { - protocol.elements.apply(this, [elFuncFullType(type), value, - function(err, elements) { - if(err == null) - if(elements.length>0) {cb(null,elements[0]);} else {cb(null,undefined);} - else - cb(err); - } - ]); - }; - - protocol['hasElement' + elFuncSuffix(type)] = function(value, cb) { - protocol.hasElement.apply(this, [elFuncFullType(type), value, cb]); - }; - - protocol['elements' + elFuncSuffix(type)] = function(value, cb) { - protocol.elements.apply(this, [elFuncFullType(type), value, cb]); - }; - - })(); - -} - -protocol.getAttribute = methodBuilder({ - method: 'GET' - , relPath: function(element, attrName) { - return '/element/' + element + '/attribute/' + attrName; } - , cb: function(element, attrName, cb) { return callbackWithData(cb); } -}); - -protocol.getValue = function(element, cb) { - protocol.getAttribute.apply(this, [element, 'value', cb]); -}; - -protocol.clickElement = methodBuilder({ - method: 'POST' - , relPath: function(element, attrName) { - return '/element/' + element + '/click'; } -}); - -protocol.getComputedCSS = methodBuilder({ - method: 'GET' - , relPath: function(element, styleName) { - return '/element/' + element + '/css/' + styleName; } - , cb: function(element, styleName, cb) { return callbackWithData(cb); } -}); - -protocol.moveTo = methodBuilder({ - method: 'POST' - , relPath: '/moveto' - , data: function(element, xoffset, yoffset) { - return { element: element.toString(), xoffset: xoffset, yoffset: yoffset }; } -}); - -//@todo simulate the scroll event using dispatchEvent and browser.execute -/* it's not implemented so taking it out -protocol.scroll = methodBuilder({ - method: 'POST' - , relPath:'/moveto' - , data: function(element, xoffset, yoffset) { - return { element : element, xoffset : xoffset, yoffset : yoffset }; } -}); -*/ - -protocol.buttonDown = methodBuilder({ - method: 'POST' - , relPath: '/buttondown' -}); - -protocol.buttonUp = methodBuilder({ - method: 'POST' - , relPath: '/buttonup' -}); - -//{LEFT = 0, MIDDLE = 1 , RIGHT = 2} -protocol.click = methodBuilder({ - method: 'POST' - , relPath: '/click' - , data: function(button) { return {button: button}; } -}); - - -protocol.doubleclick = methodBuilder({ - method: 'POST' - , relPath: '/doubleclick' -}); - -//All keys are up at end of command -protocol.type = methodBuilder({ - method: 'POST' - , relPath: function(element, keys) { - return '/element/' + element + '/value'; } - , data: function(element, keys) { - if (!(keys instanceof Array)) {keys = [keys];} - return {value: keys}; - } -}); - -protocol.keys = methodBuilder({ - method: 'POST' - , relPath: '/keys' - , data: function(keys) { - if (!(keys instanceof Array)) {keys = [keys];} - return {value: keys}; - } -}); - -protocol.clear = methodBuilder({ - method: 'POST' - , relPath: function(element) { return '/element/' + element + '/clear'; } -}); - -protocol.title = methodBuilder({ - method: 'GET' - , relPath: '/title' - , cb: function(cb) { return callbackWithData(cb); } -}); - -// element must be specified -var _rawText = methodBuilder({ - method: 'GET' - , relPath: function(element) { return '/element/' + element + '/text'; } - , cb: function(element, cb) { return callbackWithData(cb); } -}); - -// element is specific element, 'body', or undefined -protocol.text = function(element, cb) { - var _this = this; - if (typeof element === 'undefined' || element == 'body' || element === null) { - protocol.element.apply(this, ['tag name', 'body', function(err, bodyEl) { - if (err == null) {_rawText.apply(_this, [bodyEl, cb]);} else {cb(err);} - }]); - }else { - _rawText.apply(_this, [element, cb]); - } -}; - -// element is specific element, 'body', or undefined -protocol.textPresent = function(searchText, element, cb) { - protocol.text.apply(this, [element, function(err, text) { - if (err) { - cb(err, null); - } else { - cb(err, text.indexOf(searchText) >= 0); - } - }]); -}; - -protocol.acceptAlert = methodBuilder({ - method: 'POST' - , relPath: '/accept_alert' -}); - -protocol.dismissAlert = methodBuilder({ - method: 'POST' - , relPath: '/dismiss_alert' -}); - -protocol.active = methodBuilder({ - method: 'POST' - , relPath: '/element/active' - , cb: function(cb) { - return callbackWithData(function(e, o) { - var el = new element(o['ELEMENT'], this); - cb(null, el)}); - } -}); - -protocol.url = methodBuilder({ - method: 'GET' - , relPath: '/url' - , cb: function(cb) { return callbackWithData(cb); } -}); - - -protocol.allCookies = methodBuilder({ - method: 'GET' - , relPath: '/cookie' - , cb: function(cb) { return callbackWithData(cb); } -}); - -/* -cookie like the following: - {name:'fruit', value:'apple'} -optional fields: path, domain, secure, expiry -check the JsonWire doc for details -*/ -protocol.setCookie = methodBuilder({ - method: 'POST' - , relPath: '/cookie' - , data: function(cookie) { - // setting secure otherwise selenium server throws - if ((typeof cookie !== 'undefined' && cookie !== null) && - !((typeof cookie !== 'undefined' && - cookie !== null ? cookie.secure : void 0) != null)) { - cookie.secure = false; - } - return { cookie: cookie }; - } -}); - -protocol.deleteAllCookies = methodBuilder({ - method: 'DELETE' - , relPath: '/cookie' -}); - -protocol.deleteCookie = methodBuilder({ - method: 'DELETE' - , relPath: function(name) { - return '/cookie/' + encodeURIComponent(name); } -}); - -protocol.isVisible = function(queryType, querySelector, callback){ - this.elementIfExists(queryType, querySelector, function(err, element){ - if(err){ - return callback(err); - } - - if(element == null){ - return callback(null, false); - } - - element.getComputedCSS("display", function(err, display){ - if(err){ - return callback(err); - } - - callback(null, display !== "none"); - }); - }); -} - -protocol.waitForElement = function(queryType, querySelector, timeout, callback){ - var _this = this; - var endTime = Date.now() + timeout; - - var poll = function(){ - _this.hasElement(queryType, querySelector, function(err, isHere){ - if(err){ - return callback(err); - } - - if(isHere){ - callback(); - } else { - if(Date.now() > endTime){ - callback(new Error("Element didn't appear")); - } else { - setTimeout(poll, 200); - } - } - }); - } - - poll(); -} - -// waitForCondition recursive implementation -var waitForConditionImpl = function(conditionExpr, limit, poll, cb) { - var _this = this; - - // timeout check - if (Date.now() < limit) { - // condition check - protocol.safeEval.apply( _this , [conditionExpr, function(err, res) { - if(err != null) {return cb(err);} - if (res == true) { - // condition ok - return cb(null, true); - } else { - // wait for poll and try again - setTimeout(function() { - waitForConditionImpl.apply(_this, [conditionExpr, limit, poll, cb]); - }, poll); - } - }]); - } else { - // try one last time - protocol.safeEval.apply( _this, [conditionExpr, function(err, res) { - if(err != null) {return cb(err);} - if (res == true) { - return cb(null, true); - } else { - // condition nok within timeout - return cb("waitForCondition failure for: " + conditionExpr); - } - }]); - } -}; - -// args: (conditionExpr, timeout, poll, cb) -// timeout and poll are optional -protocol.waitForCondition = function() { - // parsing args - var args, cb, conditionExpr, limit, poll, timeout, _i; - args = 2 <= arguments.length ? __slice.call(arguments, 0, - _i = arguments.length - 1) : (_i = 0, []), - cb = arguments[_i++]; - conditionExpr = args[0], timeout = args[1], poll = args[2]; - - //defaults - timeout = timeout || 1000; - poll = poll || 100; - - // calling implementation - limit = Date.now() + timeout; - waitForConditionImpl.apply(this, [conditionExpr, limit, poll, cb]); -}; - -// script to be executed in browser -var waitForConditionInBrowserJsScript = fs.readFileSync( __dirname + "/browser-scripts/wait-for-cond-in-browser.js", 'utf8'); - -// args: (conditionExpr, timeout, poll, cb) -// timeout and poll are optional -protocol.waitForConditionInBrowser = function() { - var _this = this; - // parsing args - var args, cb, conditionExpr, limit, poll, timeout, _i; - args = 2 <= arguments.length ? __slice.call(arguments, 0, - _i = arguments.length - 1) : (_i = 0, []), - cb = arguments[_i++]; - conditionExpr = args[0], timeout = args[1], poll = args[2]; - - //defaults - timeout = timeout || 1000; - poll = poll || 100; - - // calling script - protocol.safeExecuteAsync.apply( _this, [waitForConditionInBrowserJsScript, - [conditionExpr,timeout,poll], function(err,res) { - if(err != null) {return cb(err);} - if(res != true) {return cb("waitForConditionInBrowser failure for: " + conditionExpr);} - cb(null, res); - } - ]); -}; - -module.exports = protocol; diff --git a/node_modules/wd/lib/special-keys.js b/node_modules/wd/lib/special-keys.js deleted file mode 100644 index 42e3d3f..0000000 --- a/node_modules/wd/lib/special-keys.js +++ /dev/null @@ -1,61 +0,0 @@ -var SPECIAL_KEYS = { - 'NULL': '\uE000', - 'Cancel': '\uE001', - 'Help': '\uE002', - 'Back space': '\uE003', - 'Tab': '\uE004', - 'Clear': '\uE005', - 'Return': '\uE006', - 'Enter': '\uE007', - 'Shift': '\uE008', - 'Control': '\uE009', - 'Alt': '\uE00A', - 'Pause': '\uE00B', - 'Escape': '\uE00C', - 'Key': 'Code', - 'Space': '\uE00D', - 'Pageup': '\uE00E', - 'Pagedown': '\uE00F', - 'End': '\uE010', - 'Home': '\uE011', - 'Left arrow': '\uE012', - 'Up arrow': '\uE013', - 'Right arrow': '\uE014', - 'Down arrow': '\uE015', - 'Insert': '\uE016', - 'Delete': '\uE017', - 'Semicolon': '\uE018', - 'Equals': '\uE019', - 'Numpad 0': '\uE01A', - 'Numpad 1': '\uE01B', - 'Numpad 2': '\uE01C', - 'Numpad 3': '\uE01D', - 'Numpad 4': '\uE01E', - 'Numpad 5': '\uE01F', - 'Numpad 6': '\uE020', - 'Numpad 7': '\uE021', - 'Numpad 8': '\uE022', - 'Numpad 9': '\uE023', - 'Multiply': '\uE024', - 'Add': '\uE025', - 'Separator': '\uE026', - 'Subtract': '\uE027', - 'Decimal': '\uE028', - 'Divide': '\uE029', - 'F1': '\uE031', - 'F2': '\uE032', - 'F3': '\uE033', - 'F4': '\uE034', - 'F5': '\uE035', - 'F6': '\uE036', - 'F7': '\uE037', - 'F8': '\uE038', - 'F9': '\uE039', - 'F10': '\uE03A', - 'F11': '\uE03B', - 'F12': '\uE03C', - 'Command': '\uE03D', - 'Meta': '\uE03D' -}; - -module.exports = SPECIAL_KEYS; diff --git a/node_modules/wd/node_modules/async/.gitmodules b/node_modules/wd/node_modules/async/.gitmodules deleted file mode 100644 index a9aae98..0000000 --- a/node_modules/wd/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/wd/node_modules/async/.npmignore b/node_modules/wd/node_modules/async/.npmignore deleted file mode 100644 index 9bdfc97..0000000 --- a/node_modules/wd/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/wd/node_modules/async/LICENSE b/node_modules/wd/node_modules/async/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/node_modules/wd/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Caolan McMahon - -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/wd/node_modules/async/Makefile b/node_modules/wd/node_modules/async/Makefile deleted file mode 100644 index bad647c..0000000 --- a/node_modules/wd/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/wd/node_modules/async/README.md b/node_modules/wd/node_modules/async/README.md deleted file mode 100644 index 1bbbc47..0000000 --- a/node_modules/wd/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/wd/node_modules/async/index.js b/node_modules/wd/node_modules/async/index.js deleted file mode 100644 index 8e23845..0000000 --- a/node_modules/wd/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/wd/node_modules/async/lib/async.js b/node_modules/wd/node_modules/async/lib/async.js deleted file mode 100644 index 7cc4f5e..0000000 --- a/node_modules/wd/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/wd/node_modules/async/package.json b/node_modules/wd/node_modules/async/package.json deleted file mode 100644 index baddd9c..0000000 --- a/node_modules/wd/node_modules/async/package.json +++ /dev/null @@ -1,38 +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": "git://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" - }, - "_id": "async@0.1.22", - "dependencies": {}, - "optionalDependencies": {}, - "engines": { - "node": "*" - }, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "async@0.1.22" -} diff --git a/node_modules/wd/package.json b/node_modules/wd/package.json deleted file mode 100644 index 5db18ad..0000000 --- a/node_modules/wd/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "wd", - "description": "WebDriver/Selenium 2 node.js client", - "tags": [ - "web", - "automation", - "browser", - "javascript" - ], - "version": "0.0.19", - "author": { - "name": "Adam Christian", - "email": "adam.christian@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/admc/wd.git" - }, - "bugs": { - "url": "https://github.com/admc/wd/issues" - }, - "engines": [ - "node" - ], - "main": "./lib/main", - "bin": { - "wd": "./lib/bin.js" - }, - "directories": { - "lib": "./lib" - }, - "dependencies": { - "async": "0.1.22" - }, - "devDependencies": { - "nodeunit": "latest", - "should": "latest", - "coffee-script": "latest", - "express": "latest", - "gleak": "latest" - }, - "_id": "wd@0.0.19", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.16", - "_nodeVersion": "v0.6.15", - "_defaultsLoaded": true, - "_from": "wd" -} diff --git a/node_modules/wd/test/common/basic-test-base.coffee b/node_modules/wd/test/common/basic-test-base.coffee deleted file mode 100644 index ec3a9e7..0000000 --- a/node_modules/wd/test/common/basic-test-base.coffee +++ /dev/null @@ -1,48 +0,0 @@ -# nodeunit test - -wd = require '../../lib/main' -should = require 'should' -assert = require 'assert' - -runTestWith = (remoteWdConfig, desired) -> - remoteWdConfig = remoteWdConfig() if typeof remoteWdConfig is 'function' - - browser = null - { - remote: (test) -> - browser = wd.remote remoteWdConfig - should.exist browser - browser.on "status", (info) -> - console.log "\u001b[36m%s\u001b[0m", info - browser.on "command", (meth, path) -> - console.log " > \u001b[33m%s\u001b[0m: %s", meth, path - test.done() - - init: (test) -> - browser.init desired, -> - test.done() - - browsing: - 'getting page': (test) -> - browser.get "http://saucelabs.com/test/guinea-pig", -> - browser.title (err, title) -> - assert.ok ~title.indexOf("I am a page title - Sauce Labs"), "Wrong title!" - test.done() - - clicking: (test) -> - browser.elementById "submit", (err, el) -> - browser.clickElement el, -> - browser.eval "window.location.href", (err, title) -> - assert.ok ~title.indexOf("#"), "Wrong title!" - test.done() - - leaving: (test) -> - browser.quit -> - test.done() - } - - - -exports.runTestWith = runTestWith - - \ No newline at end of file diff --git a/node_modules/wd/test/common/basic-test-base.js b/node_modules/wd/test/common/basic-test-base.js deleted file mode 100644 index 2b53843..0000000 --- a/node_modules/wd/test/common/basic-test-base.js +++ /dev/null @@ -1,64 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var assert, runTestWith, should, wd; - - wd = require('../../lib/main'); - - should = require('should'); - - assert = require('assert'); - - runTestWith = function(remoteWdConfig, desired) { - var browser; - if (typeof remoteWdConfig === 'function') { - remoteWdConfig = remoteWdConfig(); - } - browser = null; - return { - remote: function(test) { - browser = wd.remote(remoteWdConfig); - should.exist(browser); - browser.on("status", function(info) { - return console.log("\u001b[36m%s\u001b[0m", info); - }); - browser.on("command", function(meth, path) { - return console.log(" > \u001b[33m%s\u001b[0m: %s", meth, path); - }); - return test.done(); - }, - init: function(test) { - return browser.init(desired, function() { - return test.done(); - }); - }, - browsing: { - 'getting page': function(test) { - return browser.get("http://saucelabs.com/test/guinea-pig", function() { - return browser.title(function(err, title) { - assert.ok(~title.indexOf("I am a page title - Sauce Labs"), "Wrong title!"); - return test.done(); - }); - }); - }, - clicking: function(test) { - return browser.elementById("submit", function(err, el) { - return browser.clickElement(el, function() { - return browser["eval"]("window.location.href", function(err, title) { - assert.ok(~title.indexOf("#"), "Wrong title!"); - return test.done(); - }); - }); - }); - } - }, - leaving: function(test) { - return browser.quit(function() { - return test.done(); - }); - } - }; - }; - - exports.runTestWith = runTestWith; - -}).call(this); diff --git a/node_modules/wd/test/common/leak-detector.coffee b/node_modules/wd/test/common/leak-detector.coffee deleted file mode 100644 index edb1859..0000000 --- a/node_modules/wd/test/common/leak-detector.coffee +++ /dev/null @@ -1,13 +0,0 @@ -detector = -> - _detector = require('gleak')() - _detector.detectNew() - - _detector.lookForLeaks = (test) -> - leaks = _detector.detectNew(); - leaks.forEach (name) -> - console.warn 'found global leak: %s', name - leaks.should.have.length 0, 'leak detected' - test.done() - - _detector -module.exports = detector diff --git a/node_modules/wd/test/common/leak-detector.js b/node_modules/wd/test/common/leak-detector.js deleted file mode 100644 index 6764556..0000000 --- a/node_modules/wd/test/common/leak-detector.js +++ /dev/null @@ -1,23 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var detector; - - detector = function() { - var _detector; - _detector = require('gleak')(); - _detector.detectNew(); - _detector.lookForLeaks = function(test) { - var leaks; - leaks = _detector.detectNew(); - leaks.forEach(function(name) { - return console.warn('found global leak: %s', name); - }); - leaks.should.have.length(0, 'leak detected'); - return test.done(); - }; - return _detector; - }; - - module.exports = detector; - -}).call(this); diff --git a/node_modules/wd/test/saucelabs/.npmignore b/node_modules/wd/test/saucelabs/.npmignore deleted file mode 100644 index ced135d..0000000 --- a/node_modules/wd/test/saucelabs/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -config.coffee -config.js - diff --git a/node_modules/wd/test/saucelabs/README b/node_modules/wd/test/saucelabs/README deleted file mode 100644 index d07ef94..0000000 --- a/node_modules/wd/test/saucelabs/README +++ /dev/null @@ -1,5 +0,0 @@ -In order to run the saucelabs tests, first copy config-sample.coffee -to config.coffee, and then configure your sauce username and access-key in -config.coffee. - -config.coffee and config.js are in .gitignore. diff --git a/node_modules/wd/test/saucelabs/basic-test.coffee b/node_modules/wd/test/saucelabs/basic-test.coffee deleted file mode 100644 index 5882671..0000000 --- a/node_modules/wd/test/saucelabs/basic-test.coffee +++ /dev/null @@ -1,31 +0,0 @@ -# nodeunit test - -{runTestWith} = require '../common/basic-test-base' -configHelper = require './config-helper' - -remoteWdConfig= configHelper.getRemoteWdConfig() - -nameBase = "saucelabs basic test - "; - -chromeDesired = - name: nameBase + 'chrome' - browserName:'chrome' - -firefoxDesired = - name: nameBase + 'firefox' - browserName:'firefox' - -explorerDesired = - name: nameBase + 'explorer' - browserName:'iexplore' - version:'9' - platform:'Windows 2008' - -exports.wd = - - chrome: runTestWith( remoteWdConfig , chromeDesired) - - firefox: runTestWith(remoteWdConfig, firefoxDesired) - - explorer: runTestWith(remoteWdConfig, explorerDesired) - diff --git a/node_modules/wd/test/saucelabs/basic-test.js b/node_modules/wd/test/saucelabs/basic-test.js deleted file mode 100644 index 795cffb..0000000 --- a/node_modules/wd/test/saucelabs/basic-test.js +++ /dev/null @@ -1,36 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var chromeDesired, configHelper, explorerDesired, firefoxDesired, nameBase, remoteWdConfig, runTestWith; - - runTestWith = require('../common/basic-test-base').runTestWith; - - configHelper = require('./config-helper'); - - remoteWdConfig = configHelper.getRemoteWdConfig(); - - nameBase = "saucelabs basic test - "; - - chromeDesired = { - name: nameBase + 'chrome', - browserName: 'chrome' - }; - - firefoxDesired = { - name: nameBase + 'firefox', - browserName: 'firefox' - }; - - explorerDesired = { - name: nameBase + 'explorer', - browserName: 'iexplore', - version: '9', - platform: 'Windows 2008' - }; - - exports.wd = { - chrome: runTestWith(remoteWdConfig, chromeDesired), - firefox: runTestWith(remoteWdConfig, firefoxDesired), - explorer: runTestWith(remoteWdConfig, explorerDesired) - }; - -}).call(this); diff --git a/node_modules/wd/test/saucelabs/browser-init-test.coffee b/node_modules/wd/test/saucelabs/browser-init-test.coffee deleted file mode 100644 index e242565..0000000 --- a/node_modules/wd/test/saucelabs/browser-init-test.coffee +++ /dev/null @@ -1,99 +0,0 @@ -# nodeunit test - -wd = require '../../lib/main' -should = require 'should' -configHelper = require './config-helper' - -remoteWdConfig= configHelper.getRemoteWdConfig() - -exports.wd = - 'browser init test': - default: (test) -> - browser = wd.remote remoteWdConfig - browser.defaultCapabilities.should.eql { - browserName: 'firefox', - version: '', - javascriptEnabled: true, - platform: 'VISTA' } - browser.init (err) -> - should.not.exist err - browser.sessionCapabilities (err, capabilities) -> - should.not.exist err - capabilities.browserName.should.equal 'firefox' - browser.quit (err) -> - should.not.exist err - test.done() - - 'using browser.defaultCapabilities': (test) -> - browser = wd.remote remoteWdConfig - browser.defaultCapabilities.browserName = 'chrome' - browser.defaultCapabilities.platform = 'LINUX' - browser.defaultCapabilities.javascriptEnabled = false - browser.defaultCapabilities.name = 'browser init using defaultCapabilities' - browser.defaultCapabilities.tags = ['wd','test'] - browser.defaultCapabilities.should.eql { - browserName: 'chrome', - version: '', - javascriptEnabled: false, - platform: 'LINUX', - name: 'browser init using defaultCapabilities' - tags: ['wd','test'] - } - browser.init (err) -> - should.not.exist err - browser.sessionCapabilities (err, capabilities) -> - should.not.exist err - capabilities.browserName.should.equal 'chrome' - capabilities.platform.should.equal 'LINUX' - browser.quit (err) -> - should.not.exist err - test.done() - - 'desired only': (test) -> - browser = wd.remote remoteWdConfig - browser.defaultCapabilities.should.eql { - browserName: 'firefox', - version: '', - javascriptEnabled: true, - platform: 'VISTA' } - desired = - browserName:'iexplore' - platform: 'Windows 2008' - name: 'browser init using desired' - tags: ['wd','test'] - - browser.init desired, (err) -> - should.not.exist err - browser.sessionCapabilities (err, capabilities) -> - should.not.exist err - capabilities.browserName.should.include 'explorer' - capabilities.platform.should.equal 'WINDOWS' - browser.quit (err) -> - should.not.exist err - test.done() - - 'desired overiding defaultCapabilities': (test) -> - browser = wd.remote remoteWdConfig - browser.defaultCapabilities.browserName = 'chrome' - browser.defaultCapabilities.name = 'browser init overide' - browser.defaultCapabilities.tags = ['wd','test'] - browser.defaultCapabilities.should.eql { - browserName: 'chrome', - version: '', - javascriptEnabled: true, - platform: 'VISTA', - name: 'browser init overide' - tags: ['wd','test'] - } - browser.init {browserName: 'firefox'}, (err) -> - should.not.exist err - browser.sessionCapabilities (err, capabilities) -> - should.not.exist err - capabilities.browserName.should.equal 'firefox' - browser.quit (err) -> - should.not.exist err - test.done() - - - - diff --git a/node_modules/wd/test/saucelabs/browser-init-test.js b/node_modules/wd/test/saucelabs/browser-init-test.js deleted file mode 100644 index 4b2c89a..0000000 --- a/node_modules/wd/test/saucelabs/browser-init-test.js +++ /dev/null @@ -1,124 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var configHelper, remoteWdConfig, should, wd; - - wd = require('../../lib/main'); - - should = require('should'); - - configHelper = require('./config-helper'); - - remoteWdConfig = configHelper.getRemoteWdConfig(); - - exports.wd = { - 'browser init test': { - "default": function(test) { - var browser; - browser = wd.remote(remoteWdConfig); - browser.defaultCapabilities.should.eql({ - browserName: 'firefox', - version: '', - javascriptEnabled: true, - platform: 'VISTA' - }); - return browser.init(function(err) { - should.not.exist(err); - return browser.sessionCapabilities(function(err, capabilities) { - should.not.exist(err); - capabilities.browserName.should.equal('firefox'); - return browser.quit(function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }); - }, - 'using browser.defaultCapabilities': function(test) { - var browser; - browser = wd.remote(remoteWdConfig); - browser.defaultCapabilities.browserName = 'chrome'; - browser.defaultCapabilities.platform = 'LINUX'; - browser.defaultCapabilities.javascriptEnabled = false; - browser.defaultCapabilities.name = 'browser init using defaultCapabilities'; - browser.defaultCapabilities.tags = ['wd', 'test']; - browser.defaultCapabilities.should.eql({ - browserName: 'chrome', - version: '', - javascriptEnabled: false, - platform: 'LINUX', - name: 'browser init using defaultCapabilities', - tags: ['wd', 'test'] - }); - return browser.init(function(err) { - should.not.exist(err); - return browser.sessionCapabilities(function(err, capabilities) { - should.not.exist(err); - capabilities.browserName.should.equal('chrome'); - capabilities.platform.should.equal('LINUX'); - return browser.quit(function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }); - }, - 'desired only': function(test) { - var browser, desired; - browser = wd.remote(remoteWdConfig); - browser.defaultCapabilities.should.eql({ - browserName: 'firefox', - version: '', - javascriptEnabled: true, - platform: 'VISTA' - }); - desired = { - browserName: 'iexplore', - platform: 'Windows 2008', - name: 'browser init using desired', - tags: ['wd', 'test'] - }; - return browser.init(desired, function(err) { - should.not.exist(err); - return browser.sessionCapabilities(function(err, capabilities) { - should.not.exist(err); - capabilities.browserName.should.include('explorer'); - capabilities.platform.should.equal('WINDOWS'); - return browser.quit(function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }); - }, - 'desired overiding defaultCapabilities': function(test) { - var browser; - browser = wd.remote(remoteWdConfig); - browser.defaultCapabilities.browserName = 'chrome'; - browser.defaultCapabilities.name = 'browser init overide'; - browser.defaultCapabilities.tags = ['wd', 'test']; - browser.defaultCapabilities.should.eql({ - browserName: 'chrome', - version: '', - javascriptEnabled: true, - platform: 'VISTA', - name: 'browser init overide', - tags: ['wd', 'test'] - }); - return browser.init({ - browserName: 'firefox' - }, function(err) { - should.not.exist(err); - return browser.sessionCapabilities(function(err, capabilities) { - should.not.exist(err); - capabilities.browserName.should.equal('firefox'); - return browser.quit(function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }); - } - } - }; - -}).call(this); diff --git a/node_modules/wd/test/saucelabs/config-helper.coffee b/node_modules/wd/test/saucelabs/config-helper.coffee deleted file mode 100644 index 95028c2..0000000 --- a/node_modules/wd/test/saucelabs/config-helper.coffee +++ /dev/null @@ -1,17 +0,0 @@ -should = require 'should' -try config = require './config' catch err - -exports.getRemoteWdConfig = -> - should.exist config, \ - """ - Missing config! - You need to copy config-sample.coffee to config.coffee, - and then configure your sauce username and access-key in - config.coffee - """ - { - host: "ondemand.saucelabs.com" - port: 80 - username: config.saucelabs?.username - accessKey: config.saucelabs?.accessKey - } diff --git a/node_modules/wd/test/saucelabs/config-helper.js b/node_modules/wd/test/saucelabs/config-helper.js deleted file mode 100644 index 0495f33..0000000 --- a/node_modules/wd/test/saucelabs/config-helper.js +++ /dev/null @@ -1,24 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var config, should; - - should = require('should'); - - try { - config = require('./config'); - } catch (err) { - - } - - exports.getRemoteWdConfig = function() { - var _ref, _ref1; - should.exist(config, "Missing config!\nYou need to copy config-sample.coffee to config.coffee,\nand then configure your sauce username and access-key in\nconfig.coffee"); - return { - host: "ondemand.saucelabs.com", - port: 80, - username: (_ref = config.saucelabs) != null ? _ref.username : void 0, - accessKey: (_ref1 = config.saucelabs) != null ? _ref1.accessKey : void 0 - }; - }; - -}).call(this); diff --git a/node_modules/wd/test/saucelabs/config.sample.coffee b/node_modules/wd/test/saucelabs/config.sample.coffee deleted file mode 100644 index 3bd3850..0000000 --- a/node_modules/wd/test/saucelabs/config.sample.coffee +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = - saucelabs: - username: '' - accessKey: '' - \ No newline at end of file diff --git a/node_modules/wd/test/saucelabs/config.sample.js b/node_modules/wd/test/saucelabs/config.sample.js deleted file mode 100644 index f52d342..0000000 --- a/node_modules/wd/test/saucelabs/config.sample.js +++ /dev/null @@ -1,11 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - - module.exports = { - saucelabs: { - username: '', - accessKey: '' - } - }; - -}).call(this); diff --git a/node_modules/wd/test/unit/assets/element-test-page.html b/node_modules/wd/test/unit/assets/element-test-page.html deleted file mode 100644 index c329de8..0000000 --- a/node_modules/wd/test/unit/assets/element-test-page.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - Test Page - - -

          This is a test page

          - -
          Click me
          -
          I am some text
          -
          Attribute
          -
          Value
          - - - diff --git a/node_modules/wd/test/unit/assets/test-page.html b/node_modules/wd/test/unit/assets/test-page.html deleted file mode 100644 index fcb0003..0000000 --- a/node_modules/wd/test/unit/assets/test-page.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - TEST PAGE - - - - - -
          Hello World!
          -
          Hello World!
          -
          Hello World!
          -
          Hello World!
          -
          - -
          Hello World!
          -
          -
          Hello World!
          - -
          -
          Hello World!
          -
          Hello World!
          -
          Hello World!
          -
          -
          -
          Hello World!
          -
          Hello World!
          -
          Hello World!
          -
          -
          -
          Hello World!
          -
          Hello World!
          -
          Hello World!
          -
          -
          -
          Hello World!
          -
          Hello World!
          -
          Hello World!
          -
          - - -
          - Hello World! - Hello World! - Hello World! -
          -
          - - - -
          -
          -
          Hello World!
          -
          Hello World!
          -
          Hello World!
          -
          - -
          Hi
          -
          - - -
          -
          text content
          -
          -
          -
          • line 1
          • line 2
          -
          - -
          - a1
          - a2
          -
          -
          - - -
          -
          weather is sunny
          - - -
          - - -
          - -
          -
          - - diff --git a/node_modules/wd/test/unit/basic-test.coffee b/node_modules/wd/test/unit/basic-test.coffee deleted file mode 100644 index 6ceb0e7..0000000 --- a/node_modules/wd/test/unit/basic-test.coffee +++ /dev/null @@ -1,13 +0,0 @@ -# nodeunit test -leakDetector = (require '../common/leak-detector')() - -{runTestWith} = require '../common/basic-test-base' - -exports.wd = - 'basic test': - chrome: (runTestWith {}, {browserName:'chrome'}) - - firefox: (runTestWith {}, {browserName:'firefox'}) - - 'checking leaks': leakDetector.lookForLeaks - diff --git a/node_modules/wd/test/unit/basic-test.js b/node_modules/wd/test/unit/basic-test.js deleted file mode 100644 index 7f71fcb..0000000 --- a/node_modules/wd/test/unit/basic-test.js +++ /dev/null @@ -1,21 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var leakDetector, runTestWith; - - leakDetector = (require('../common/leak-detector'))(); - - runTestWith = require('../common/basic-test-base').runTestWith; - - exports.wd = { - 'basic test': { - chrome: runTestWith({}, { - browserName: 'chrome' - }), - firefox: runTestWith({}, { - browserName: 'firefox' - }), - 'checking leaks': leakDetector.lookForLeaks - } - }; - -}).call(this); diff --git a/node_modules/wd/test/unit/browser-init-test.coffee b/node_modules/wd/test/unit/browser-init-test.coffee deleted file mode 100644 index 753ebfa..0000000 --- a/node_modules/wd/test/unit/browser-init-test.coffee +++ /dev/null @@ -1,83 +0,0 @@ -# nodeunit test -should = require 'should' - -leakDetector = (require '../common/leak-detector')() - -wd = require '../../lib/main' - -exports.wd = - 'browser init test': - default: (test) -> - browser = wd.remote() - browser.defaultCapabilities.should.eql { - browserName: 'firefox', - version: '', - javascriptEnabled: true, - platform: 'ANY' } - browser.init (err) -> - should.not.exist err - browser.sessionCapabilities (err, capabilities) -> - should.not.exist err - capabilities.browserName.should.equal 'firefox' - browser.quit (err) -> - should.not.exist err - test.done() - - 'using browser.defaultCapabilities': (test) -> - browser = wd.remote() - browser.defaultCapabilities.browserName = 'chrome' - browser.defaultCapabilities.javascriptEnabled = false - browser.defaultCapabilities.should.eql { - browserName: 'chrome', - version: '', - javascriptEnabled: false, - platform: 'ANY', - } - browser.init (err) -> - should.not.exist err - browser.sessionCapabilities (err, capabilities) -> - should.not.exist err - capabilities.browserName.should.equal 'chrome' - browser.quit (err) -> - should.not.exist err - test.done() - - - 'desired only': (test) -> - browser = wd.remote() - browser.defaultCapabilities.should.eql { - browserName: 'firefox', - version: '', - javascriptEnabled: true, - platform: 'ANY' } - browser.init {browserName: 'chrome'}, (err) -> - should.not.exist err - browser.sessionCapabilities (err, capabilities) -> - should.not.exist err - capabilities.browserName.should.equal 'chrome' - browser.quit (err) -> - should.not.exist err - test.done() - - 'desired overiding defaultCapabilities': (test) -> - browser = wd.remote() - browser.defaultCapabilities.browserName = 'chrome' - browser.defaultCapabilities.should.eql { - browserName: 'chrome', - version: '', - javascriptEnabled: true, - platform: 'ANY' } - browser.init {browserName: 'firefox'}, (err) -> - should.not.exist err - browser.sessionCapabilities (err, capabilities) -> - should.not.exist err - capabilities.browserName.should.equal 'firefox' - browser.quit (err) -> - should.not.exist err - test.done() - - 'checking leaks': leakDetector.lookForLeaks - - - - diff --git a/node_modules/wd/test/unit/browser-init-test.js b/node_modules/wd/test/unit/browser-init-test.js deleted file mode 100644 index 52bfe8b..0000000 --- a/node_modules/wd/test/unit/browser-init-test.js +++ /dev/null @@ -1,108 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var leakDetector, should, wd; - - should = require('should'); - - leakDetector = (require('../common/leak-detector'))(); - - wd = require('../../lib/main'); - - exports.wd = { - 'browser init test': { - "default": function(test) { - var browser; - browser = wd.remote(); - browser.defaultCapabilities.should.eql({ - browserName: 'firefox', - version: '', - javascriptEnabled: true, - platform: 'ANY' - }); - return browser.init(function(err) { - should.not.exist(err); - return browser.sessionCapabilities(function(err, capabilities) { - should.not.exist(err); - capabilities.browserName.should.equal('firefox'); - return browser.quit(function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }); - }, - 'using browser.defaultCapabilities': function(test) { - var browser; - browser = wd.remote(); - browser.defaultCapabilities.browserName = 'chrome'; - browser.defaultCapabilities.javascriptEnabled = false; - browser.defaultCapabilities.should.eql({ - browserName: 'chrome', - version: '', - javascriptEnabled: false, - platform: 'ANY' - }); - return browser.init(function(err) { - should.not.exist(err); - return browser.sessionCapabilities(function(err, capabilities) { - should.not.exist(err); - capabilities.browserName.should.equal('chrome'); - return browser.quit(function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }); - }, - 'desired only': function(test) { - var browser; - browser = wd.remote(); - browser.defaultCapabilities.should.eql({ - browserName: 'firefox', - version: '', - javascriptEnabled: true, - platform: 'ANY' - }); - return browser.init({ - browserName: 'chrome' - }, function(err) { - should.not.exist(err); - return browser.sessionCapabilities(function(err, capabilities) { - should.not.exist(err); - capabilities.browserName.should.equal('chrome'); - return browser.quit(function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }); - }, - 'desired overiding defaultCapabilities': function(test) { - var browser; - browser = wd.remote(); - browser.defaultCapabilities.browserName = 'chrome'; - browser.defaultCapabilities.should.eql({ - browserName: 'chrome', - version: '', - javascriptEnabled: true, - platform: 'ANY' - }); - return browser.init({ - browserName: 'firefox' - }, function(err) { - should.not.exist(err); - return browser.sessionCapabilities(function(err, capabilities) { - should.not.exist(err); - capabilities.browserName.should.equal('firefox'); - return browser.quit(function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }); - }, - 'checking leaks': leakDetector.lookForLeaks - } - }; - -}).call(this); diff --git a/node_modules/wd/test/unit/element-test.coffee b/node_modules/wd/test/unit/element-test.coffee deleted file mode 100644 index 829fb2a..0000000 --- a/node_modules/wd/test/unit/element-test.coffee +++ /dev/null @@ -1,113 +0,0 @@ -should = require 'should' -wd = require '../../lib/main' -express = require 'express' - -app = null - -runTestWith = (remoteWdConfig, desired) -> - browser = null - { - "wd.remote": (test) -> - browser = wd.remote remoteWdConfig - browser.on "status", (info) -> - console.log "\u001b[36m%s\u001b[0m", info - browser.on "command", (meth, path) -> - console.log " > \u001b[33m%s\u001b[0m: %s", meth, path - test.done() - - "init": (test) -> - browser.init desired, (err) -> - should.not.exist err - test.done() - - "get": (test) -> - browser.get "http://127.0.0.1:8181/element-test-page.html", (err) -> - should.not.exist err - test.done() - - "element.text": (test) -> - browser.element "id", "text", (err, el) -> - should.not.exist err - el.should.have.property "text" - el.text (err, res) -> - res.should.include "I am some text" - test.done() - - "element.textPresent": (test) -> - browser.element "id", "text", (err, el) -> - should.not.exist err - el.should.have.property "textPresent" - el.textPresent "some text", (err, present) -> - should.not.exist err - present.should.be.true - test.done() - - "element.getAttribute": (test) -> - browser.element "id", "getAttribute", (err, el) -> - should.not.exist err - el.should.have.property "getAttribute" - el.getAttribute "att", (err, value) -> - should.not.exist err - value.should.equal "42" - test.done() - - "element.getValue": (test) -> - browser.element "id", "getValue", (err, el) -> - should.not.exist err - el.should.have.property "getValue" - el.getValue (err, value) -> - should.not.exist err - value.should.equal "value" - test.done() - - "element.sendKeys": (test) -> - text = "keys" - browser.element "id", "sendKeys", (err, el) -> - should.not.exist err - el.should.have.property "sendKeys" - el.sendKeys text, (err) -> - should.not.exist err - el.getValue (err, textReceived) -> - should.not.exist err - textReceived.should.equal text - test.done() - - "element.clear": (test) -> - browser.element "id", "clear", (err, el) -> - should.not.exist err - el.should.have.property "clear" - el.clear (err) -> - should.not.exist err - el.getValue (err, textReceived) -> - should.not.exist err - textReceived.should.equal "" - test.done() - - "close": (test) -> - browser.close (err) -> - should.not.exist err - test.done() - - "quit": (test) -> - browser.quit (err) -> - should.not.exist err - test.done() - } - - -exports.wd = - "per element method test": - 'starting express': (test) -> - app = express.createServer() - app.use(express.static(__dirname + '/assets')); - app.listen 8181 - test.done() - - chrome: (runTestWith {}, {browserName: 'chrome'}) - - firefox: (runTestWith {}, {browserName: 'firefox'}) - - 'stopping express': (test) -> - app.close() - test.done() - diff --git a/node_modules/wd/test/unit/element-test.js b/node_modules/wd/test/unit/element-test.js deleted file mode 100644 index 2bae6a1..0000000 --- a/node_modules/wd/test/unit/element-test.js +++ /dev/null @@ -1,148 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var app, express, runTestWith, should, wd; - - should = require('should'); - - wd = require('../../lib/main'); - - express = require('express'); - - app = null; - - runTestWith = function(remoteWdConfig, desired) { - var browser; - browser = null; - return { - "wd.remote": function(test) { - browser = wd.remote(remoteWdConfig); - browser.on("status", function(info) { - return console.log("\u001b[36m%s\u001b[0m", info); - }); - browser.on("command", function(meth, path) { - return console.log(" > \u001b[33m%s\u001b[0m: %s", meth, path); - }); - return test.done(); - }, - "init": function(test) { - return browser.init(desired, function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "get": function(test) { - return browser.get("http://127.0.0.1:8181/element-test-page.html", function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "element.text": function(test) { - return browser.element("id", "text", function(err, el) { - should.not.exist(err); - el.should.have.property("text"); - return el.text(function(err, res) { - res.should.include("I am some text"); - return test.done(); - }); - }); - }, - "element.textPresent": function(test) { - return browser.element("id", "text", function(err, el) { - should.not.exist(err); - el.should.have.property("textPresent"); - return el.textPresent("some text", function(err, present) { - should.not.exist(err); - present.should.be["true"]; - return test.done(); - }); - }); - }, - "element.getAttribute": function(test) { - return browser.element("id", "getAttribute", function(err, el) { - should.not.exist(err); - el.should.have.property("getAttribute"); - return el.getAttribute("att", function(err, value) { - should.not.exist(err); - value.should.equal("42"); - return test.done(); - }); - }); - }, - "element.getValue": function(test) { - return browser.element("id", "getValue", function(err, el) { - should.not.exist(err); - el.should.have.property("getValue"); - return el.getValue(function(err, value) { - should.not.exist(err); - value.should.equal("value"); - return test.done(); - }); - }); - }, - "element.sendKeys": function(test) { - var text; - text = "keys"; - return browser.element("id", "sendKeys", function(err, el) { - should.not.exist(err); - el.should.have.property("sendKeys"); - return el.sendKeys(text, function(err) { - should.not.exist(err); - return el.getValue(function(err, textReceived) { - should.not.exist(err); - textReceived.should.equal(text); - return test.done(); - }); - }); - }); - }, - "element.clear": function(test) { - return browser.element("id", "clear", function(err, el) { - should.not.exist(err); - el.should.have.property("clear"); - return el.clear(function(err) { - should.not.exist(err); - return el.getValue(function(err, textReceived) { - should.not.exist(err); - textReceived.should.equal(""); - return test.done(); - }); - }); - }); - }, - "close": function(test) { - return browser.close(function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "quit": function(test) { - return browser.quit(function(err) { - should.not.exist(err); - return test.done(); - }); - } - }; - }; - - exports.wd = { - "per element method test": { - 'starting express': function(test) { - app = express.createServer(); - app.use(express["static"](__dirname + '/assets')); - app.listen(8181); - return test.done(); - } - }, - chrome: runTestWith({}, { - browserName: 'chrome' - }), - firefox: runTestWith({}, { - browserName: 'firefox' - }), - 'stopping express': function(test) { - app.close(); - return test.done(); - } - }; - -}).call(this); diff --git a/node_modules/wd/test/unit/per-method-test.coffee b/node_modules/wd/test/unit/per-method-test.coffee deleted file mode 100644 index e055069..0000000 --- a/node_modules/wd/test/unit/per-method-test.coffee +++ /dev/null @@ -1,1184 +0,0 @@ -# nodeunit test - -should = require 'should' -express = require 'express' -CoffeeScript = require 'coffee-script' -async = require 'async' - -leakDetector = (require '../common/leak-detector')() - -wd = require '../../lib/main' - -evalShouldEqual = (browser,formula,expected) -> - (done) -> browser.eval formula, (err,res) -> - should.not.exist err - res.should.equal expected - done(null) - -safeEvalShouldEqual = (browser,formula,expected) -> - (done) -> browser.safeEval formula, (err,res) -> - should.not.exist err - res.should.equal expected - done(null) - -executeCoffee = (browser, script) -> - scriptAsJs = CoffeeScript.compile script, bare:'on' - (done) -> browser.execute scriptAsJs, (err) -> - should.not.exist err - done(null) - -elementByCss = (browser,env,css,name) -> - (done) -> browser.elementByCss css, (err, res) -> - should.not.exist err - env[name] = res - done null - -textShouldEqual = (browser,element,expected, done) -> - browser.text element, (err,res) -> - should.not.exist err - res.should.equal expected - done null - -valueShouldEqual = (browser,element,expected, done) -> - browser.getValue element, (err,res) -> - should.not.exist err - res.should.equal expected - done null - -runTestWith = (remoteWdConfig, desired) -> - browser = null; - elementFunctionTests = () -> - tests = {} - tests.element = (test) -> - async.series [ - (done) -> - browser.element "name", "elementByName", (err,res) -> - should.not.exist err - should.exist res - done null - (done) -> - browser.element "name", "elementByName2", (err,res) -> - should.exist err - err.status.should.equal 7 - done null - ], (err) -> - should.not.exist err - test.done() - - tests.elementOrNull = (test) -> - async.series [ - (done) -> - browser.elementOrNull "name", "elementByName", (err,res) -> - should.not.exist err - should.exist res - done null - (done) -> - browser.elementOrNull "name", "elementByName2", (err,res) -> - should.not.exist err - (res is null).should.be.true - done null - ], (err) -> - should.not.exist err - test.done() - - tests.elementIfExists = (test) -> - async.series [ - (done) -> - browser.elementIfExists "name", "elementByName", (err,res) -> - should.not.exist err - should.exist res - done null - (done) -> - browser.elementIfExists "name", "elementByName2", (err,res) -> - should.not.exist err - (res is undefined).should.be.true - done null - ], (err) -> - should.not.exist err - test.done() - - tests.hasElement = (test) -> - async.series [ - (done) -> - browser.hasElement "name", "elementByName", (err,res) -> - should.not.exist err - res.should.be.true - done null - (done) -> - browser.hasElement "name", "elementByName2", (err,res) -> - should.not.exist err - res.should.be.false - done null - ], (err) -> - should.not.exist err - test.done() - - tests.elements = (test) -> - async.series [ - (done) -> - browser.elements "name", "elementsByName", (err,res) -> - should.not.exist err - res.should.have.length 3 - done null - (done) -> - browser.elements "name", "elementsByName2", (err,res) -> - should.not.exist err - res.should.eql [] - done null - ], (err) -> - should.not.exist err - test.done() - - for funcSuffix in [ - 'ByClassName' - , 'ByCssSelector' - , 'ById' - , 'ByName' - , 'ByLinkText' - , 'ByPartialLinkText' - , 'ByTagName' - , 'ByXPath' - , 'ByCss' - ] - do -> - elementFuncName = 'element' + funcSuffix - hasElementFuncName = 'hasElement' + funcSuffix - elementsFuncName = 'elements' + funcSuffix - - searchText = elementFuncName; - searchText = "click #{searchText}" if searchText.match /ByLinkText/ - searchText = "##{searchText}" if searchText.match /ByCss/ - searchText = "//div[@id='elementByXPath']/input" if searchText.match /ByXPath/ - searchText = "span" if searchText.match /ByTagName/ - - searchText2 = elementFuncName + '2'; - searchText2 = "//div[@id='elementByXPath2']/input" if searchText.match /ByXPath/ - searchText2 = "span2" if searchText.match /ByTagName/ - - searchSeveralText = searchText.replace('element','elements') - searchSeveralText2 = searchText2.replace('element','elements') - - tests[elementFuncName] = (test) -> - async.series [ - (done) -> - browser[elementFuncName] searchText, (err,res) -> - should.not.exist err - should.exist res - done null - (done) -> - browser[elementFuncName] searchText2 , (err,res) -> - should.exist err - err.status.should.equal 7 - done null - ], (err) -> - should.not.exist err - test.done() - - tests[elementFuncName + 'OrNull'] = (test) -> - async.series [ - (done) -> - browser[elementFuncName + 'OrNull'] searchText, (err,res) -> - should.not.exist err - should.exist res - done null - (done) -> - browser[elementFuncName + 'OrNull'] searchText2 , (err,res) -> - should.not.exist err - (res is null).should.be.true - done null - ], (err) -> - should.not.exist err - test.done() - - tests[elementFuncName + 'IfExists'] = (test) -> - async.series [ - (done) -> - browser[elementFuncName + 'IfExists'] searchText, (err,res) -> - should.not.exist err - should.exist res - done null - (done) -> - browser[elementFuncName + 'IfExists'] searchText2 , (err,res) -> - should.not.exist err - (res is undefined).should.be.true - done null - ], (err) -> - should.not.exist err - test.done() - - tests[hasElementFuncName] = (test) -> - async.series [ - (done) -> - browser[hasElementFuncName] searchText, (err,res) -> - should.not.exist err - res.should.be.true - done null - (done) -> - browser[hasElementFuncName] searchText2 , (err,res) -> - should.not.exist err - res.should.be.false - done null - ], (err) -> - should.not.exist err - test.done() - - tests[elementsFuncName] = (test) -> - async.series [ - (done) -> - browser[elementsFuncName] searchSeveralText, (err,res) -> - should.not.exist err - unless(elementsFuncName.match /ByTagName/) - res.should.have.length 3 - else - (res.length > 1).should.be.true - done null - (done) -> - browser[elementsFuncName] searchSeveralText2, (err,res) -> - should.not.exist err - res.should.eql [] - done null - ], (err) -> - should.not.exist err - test.done() - - tests - - { - "wd.remote": (test) -> - browser = wd.remote remoteWdConfig - browser.on "status", (info) -> - console.log "\u001b[36m%s\u001b[0m", info - browser.on "command", (meth, path) -> - console.log " > \u001b[33m%s\u001b[0m: %s", meth, path - test.done() - - "status": (test) -> - browser.status (err,status) -> - should.not.exist err - should.exist status - test.done() - - "sessions": (test) -> - browser.sessions (err,sessions) -> - should.not.exist err - should.exist sessions - test.done() - - "init": (test) -> - browser.init desired, (err) -> - should.not.exist err - test.done() - - "sessionCapabilities": (test) -> - browser.sessionCapabilities (err,capabilities) -> - should.not.exist err - should.exist capabilities - should.exist capabilities.browserName - should.exist capabilities.platform - test.done() - - - "altSessionCapabilities": (test) -> - browser.altSessionCapabilities (err,capabilities) -> - should.not.exist err - should.exist capabilities - should.exist capabilities.browserName - should.exist capabilities.platform - test.done() - - # would do with better test, but can't be bothered - "setPageLoadTimeout": (test) -> - browser.setPageLoadTimeout 500, (err) -> - should.not.exist err - test.done() - - "get": (test) -> - browser.get "http://127.0.0.1:8181/test-page.html", (err) -> - should.not.exist err - test.done() - - "refresh": (test) -> - browser.refresh (err) -> - should.not.exist err - test.done() - - "back / forward": (test) -> - async.series [ - (done) -> - browser.get "http://127.0.0.1:8181/test-page.html?p=2", (err) -> - should.not.exist err - done null - (done) -> - browser.url (err, url) -> - should.not.exist err - url.should.include "?p=2" - done null - (done) -> - browser.back (err) -> - should.not.exist err - done null - (done) -> - browser.url (err, url) -> - should.not.exist err - url.should.not.include "?p=2" - done null - (done) -> - browser.forward (err) -> - should.not.exist err - done null - (done) -> - browser.url (err, url) -> - should.not.exist err - url.should.include "?p=2" - done null - (done) -> - browser.get "http://127.0.0.1:8181/test-page.html", (err) -> - should.not.exist err - done null - ], (err) -> - should.not.exist err - test.done() - - "eval": (test) -> - async.series [ - evalShouldEqual browser, "1+2", 3 - evalShouldEqual browser, "document.title", "TEST PAGE" - evalShouldEqual browser, "$('#eval').length", 1 - evalShouldEqual browser, "$('#eval li').length", 2 - ], (err) -> - should.not.exist err - test.done() - - "safeEval": (test) -> - async.series [ - safeEvalShouldEqual browser, "1+2", 3 - safeEvalShouldEqual browser, "document.title", "TEST PAGE" - safeEvalShouldEqual browser, "$('#eval').length", 1 - safeEvalShouldEqual browser, "$('#eval li').length", 2 - (done) -> browser.safeEval 'wrong formula +', (err,res) -> - should.exist err - (err instanceof Error).should.be.true - done(null) - ], (err) -> - should.not.exist err - test.done() - - "execute (no args)": (test) -> - async.series [ - (done) -> browser.execute "window.wd_sync_execute_test = 'It worked!'", (err) -> - should.not.exist err - done(null) - evalShouldEqual browser, "window.wd_sync_execute_test", 'It worked!' - ], (err) -> - should.not.exist err - test.done() - - "execute (with args)": (test) -> - jsScript = - ''' - var a = arguments[0], b = arguments[1]; - window.wd_sync_execute_test = 'It worked! ' + (a+b) - ''' - async.series [ - (done) -> browser.execute jsScript, [6,4], (err) -> - should.not.exist err - done(null) - evalShouldEqual browser, "window.wd_sync_execute_test", 'It worked! 10' - ], (err) -> - should.not.exist err - test.done() - - "safeExecute (no args)": (test) -> - async.series [ - (done) -> browser.safeExecute "window.wd_sync_execute_test = 'It worked!'", (err) -> - should.not.exist err - done(null) - evalShouldEqual browser, "window.wd_sync_execute_test", 'It worked!' - (done) -> browser.safeExecute "invalid-code> here", (err) -> - should.exist err - (err instanceof Error).should.be.true - done(null) - ], (err) -> - should.not.exist err - test.done() - - "safeExecute (with args)": (test) -> - jsScript = - ''' - var a = arguments[0], b = arguments[1]; - window.wd_sync_execute_test = 'It worked! ' + (a+b) - ''' - async.series [ - (done) -> browser.safeExecute jsScript, [6,4], (err) -> - should.not.exist err - done(null) - evalShouldEqual browser, "window.wd_sync_execute_test", 'It worked! 10' - (done) -> browser.safeExecute "invalid-code> here", [6,4], (err) -> - should.exist err - (err instanceof Error).should.be.true - done(null) - ], (err) -> - should.not.exist err - test.done() - - "executeAsync (no args)": (test) -> - scriptAsCoffee = - """ - [args...,done] = arguments - done "OK" - """ - scriptAsJs = CoffeeScript.compile scriptAsCoffee, bare:'on' - browser.executeAsync scriptAsJs, (err,res) -> - should.not.exist err - res.should.equal "OK" - test.done() - - "executeAsync (with args)": (test) -> - scriptAsCoffee = - """ - [a,b,done] = arguments - done("OK " + (a+b)) - """ - scriptAsJs = CoffeeScript.compile scriptAsCoffee, bare:'on' - browser.executeAsync scriptAsJs, [10, 5], (err,res) -> - should.not.exist err - res.should.equal "OK 15" - test.done() - - "safeExecuteAsync (no args)": (test) -> - async.series [ - (done) -> - scriptAsCoffee = - """ - [args...,done] = arguments - done "OK" - """ - scriptAsJs = CoffeeScript.compile scriptAsCoffee, bare:'on' - browser.safeExecuteAsync scriptAsJs, (err,res) -> - should.not.exist err - res.should.equal "OK" - done(null) - (done) -> - browser.safeExecuteAsync "123 invalid - should.exist err - (err instanceof Error).should.be.true - done(null) - ], (err) -> - should.not.exist err - test.done() - - "safeExecuteAsync (with args)": (test) -> - async.series [ - (done) -> - scriptAsCoffee = - """ - [a,b,done] = arguments - done("OK " + (a+b)) - """ - scriptAsJs = CoffeeScript.compile scriptAsCoffee, bare:'on' - browser.safeExecuteAsync scriptAsJs, [10, 5], (err,res) -> - should.not.exist err - res.should.equal "OK 15" - done(null) - (done) -> - browser.safeExecuteAsync "123 invalid - should.exist err - (err instanceof Error).should.be.true - done(null) - ], (err) -> - should.not.exist err - test.done() - - "setWaitTimeout / setImplicitWaitTimeout": (test) -> - async.series [ - # using old name - (done) -> browser.setWaitTimeout 0, (err) -> - should.not.exist err - done null - executeCoffee browser, - """ - setTimeout -> - $('#setWaitTimeout').html '
          a child
          ' - , 1000 - """ - (done) -> - browser.elementByCss "#setWaitTimeout .child", (err,res) -> - should.exist err - err.status.should.equal 7 - done(null) - (done) -> browser.setImplicitWaitTimeout 2000, (err) -> - should.not.exist err - done null - (done) -> - browser.elementByCss "#setWaitTimeout .child", (err,res) -> - # now it works - should.not.exist err - should.exist res - done(null) - (done) -> browser.setImplicitWaitTimeout 0, (err) -> - should.not.exist err - done null - ], (err) -> - should.not.exist err - test.done() - - "setAsyncScriptTimeout": (test) -> - async.series [ - (done) -> browser.setAsyncScriptTimeout 2000, (err) -> - should.not.exist err - done null - (done) -> - scriptAsCoffee = - """ - [args...,done] = arguments - setTimeout -> - done "OK" - , 1000 - """ - scriptAsJs = CoffeeScript.compile scriptAsCoffee, bare:'on' - browser.executeAsync scriptAsJs, (err,res) -> - should.not.exist err - res.should.equal "OK" - done null - ], (err) -> - should.not.exist err - test.done() - - "element function tests": elementFunctionTests() - - "getAttribute": (test) -> - browser.elementById "getAttribute", (err,testDiv) -> - should.not.exist err - should.exist testDiv - async.series [ - (done) -> - browser.getAttribute testDiv, "weather", (err,res) -> - should.not.exist err - res.should.equal "sunny" - done null - (done) -> - browser.getAttribute testDiv, "timezone", (err,res) -> - should.not.exist err - should.not.exist res - done null - ], (err) -> - should.not.exist err - test.done() - - "getValue (input)": (test) -> - browser.elementByCss "#getValue input", (err,inputField) -> - should.not.exist err - should.exist inputField - browser.getValue inputField, (err,res) -> - should.not.exist err - res.should.equal "Hello getValueTest!" - test.done() - - "getValue (textarea)": (test) -> - browser.elementByCss "#getValue textarea", (err,inputField) -> - should.not.exist err - should.exist inputField - browser.getValue inputField, (err,res) -> - should.not.exist err - res.should.equal "Hello getValueTest2!" - test.done() - - "clickElement": (test) -> - browser.elementByCss "#clickElement a", (err,anchor) -> - should.not.exist err - should.exist anchor - async.series [ - executeCoffee browser, - ''' - jQuery -> - a = $('#clickElement a') - a.click -> - a.html 'clicked' - ''' - (done) -> textShouldEqual browser, anchor, "not clicked", done - (done) -> - browser.clickElement anchor, (err) -> - should.not.exist err - done null - (done) -> textShouldEqual browser, anchor, "clicked", done - ], (err) -> - should.not.exist err - test.done() - - "moveTo": (test) -> - env = {} - async.series [ - elementByCss browser, env, "#moveTo .a1", 'a1' - elementByCss browser, env, "#moveTo .a2", 'a2' - elementByCss browser, env, "#moveTo .current", 'current' - (done) -> textShouldEqual browser, env.current, '', done - executeCoffee browser, - ''' - jQuery -> - a1 = $('#moveTo .a1') - a2 = $('#moveTo .a2') - current = $('#moveTo .current') - a1.hover -> - current.html 'a1' - a2.hover -> - current.html 'a2' - ''' - (done) -> textShouldEqual browser, env.current, '', done - (done) -> - browser.moveTo env.a1, 5, 5, (err) -> - should.not.exist err - done null - (done) -> textShouldEqual browser, env.current, 'a1', done - (done) -> - browser.moveTo env.a2, undefined, undefined, (err) -> - should.not.exist err - done null - (done) -> textShouldEqual browser, env.current, 'a2', done - (done) -> - browser.moveTo env.a1, (err) -> - should.not.exist err - done null - (done) -> textShouldEqual browser, env.current, 'a1', done - ], (err) -> - should.not.exist err - test.done() - - # @todo waiting for implementation - # it "scroll", (test) -> - - "buttonDown / buttonUp": (test) -> - env = {} - async.series [ - elementByCss browser, env, "#mouseButton a", 'a' - elementByCss browser, env, "#mouseButton div", 'resDiv' - executeCoffee browser, - ''' - jQuery -> - a = $('#mouseButton a') - resDiv = $('#mouseButton div') - a.mousedown -> - resDiv.html 'button down' - a.mouseup -> - resDiv.html 'button up' - ''' - (done) -> textShouldEqual browser, env.resDiv, '', done - (done) -> - browser.moveTo env.a, undefined, undefined, (err) -> - should.not.exist err - done null - (done) -> - browser.buttonDown (err) -> - should.not.exist err - done null - (done) -> textShouldEqual browser, env.resDiv, 'button down', done - (done) -> - browser.buttonUp (err) -> - should.not.exist err - done null - (done) -> textShouldEqual browser, env.resDiv, 'button up', done - ], (err) -> - should.not.exist err - test.done() - - "click": (test) -> - browser.elementByCss "#click a", (err,anchor) -> - should.not.exist err - should.exist anchor - async.series [ - executeCoffee browser, - ''' - jQuery -> - window.numOfClick = 0 - a = $('#click a') - a.click -> - window.numOfClick = window.numOfClick + 1 - a.html "clicked #{window.numOfClick}" - ''' - (done) -> textShouldEqual browser, anchor, "not clicked", done - (done) -> - browser.moveTo anchor, undefined, undefined, (err) -> - should.not.exist err - done null - (done) -> - browser.click 0, (err) -> - should.not.exist err - done null - (done) -> textShouldEqual browser, anchor, "clicked 1", done - (done) -> - browser.moveTo anchor, undefined, undefined, (err) -> - should.not.exist err - done null - (done) -> - browser.click (err) -> - should.not.exist err - done null - (done) -> textShouldEqual browser, anchor, "clicked 2", done - ], (err) -> - should.not.exist err - test.done() - - "doubleclick": (test) -> - browser.elementByCss "#doubleclick a", (err,anchor) -> - should.not.exist err - should.exist anchor - async.series [ - executeCoffee browser, - ''' - jQuery -> - a = $('#doubleclick a') - a.click -> - a.html 'doubleclicked' - ''' - (done) -> textShouldEqual browser, anchor, "not clicked", done - (done) -> - browser.moveTo anchor, undefined, undefined, (err) -> - should.not.exist err - done null - (done) -> - browser.doubleclick 0, (err) -> - should.not.exist err - done null - (done) -> textShouldEqual browser, anchor, "doubleclicked", done - ], (err) -> - should.not.exist err - test.done() - - "type": (test) -> - altKey = wd.SPECIAL_KEYS['Alt'] - nullKey = wd.SPECIAL_KEYS['NULL'] - browser.elementByCss "#type input", (err,inputField) -> - should.not.exist err - should.exist inputField - async.series [ - (done) -> valueShouldEqual browser, inputField, "", done - (done) -> - browser.type inputField, "Hello" , (err) -> - should.not.exist err - done null - (done) -> valueShouldEqual browser, inputField, "Hello", done - (done) -> - browser.type inputField, [altKey, nullKey, " World"] , (err) -> - should.not.exist err - done null - (done) -> valueShouldEqual browser, inputField, "Hello World", done - (done) -> - browser.type inputField, "\n" , (err) -> # no effect - should.not.exist err - done null - (done) -> valueShouldEqual browser, inputField, "Hello World", done - ], (err) -> - should.not.exist err - test.done() - - "keys": (test) -> - altKey = wd.SPECIAL_KEYS['Alt'] - nullKey = wd.SPECIAL_KEYS['NULL'] - browser.elementByCss "#keys input", (err,inputField) -> - should.not.exist err - should.exist inputField - async.series [ - (done) -> valueShouldEqual browser, inputField, "", done - (done) -> - browser.clickElement inputField, (err) -> - should.not.exist err - done null - (done) -> - browser.keys "Hello" , (err) -> - should.not.exist err - done null - (done) -> valueShouldEqual browser, inputField, "Hello", done - (done) -> - browser.keys [altKey, nullKey, " World"] , (err) -> - should.not.exist err - done null - (done) -> valueShouldEqual browser, inputField, "Hello World", done - (done) -> - browser.keys "\n" , (err) -> # no effect - should.not.exist err - done null - (done) -> valueShouldEqual browser, inputField, "Hello World", done - ], (err) -> - should.not.exist err - test.done() - - "clear": (test) -> - browser.elementByCss "#clear input", (err,inputField) -> - should.not.exist err - should.exist inputField - async.series [ - (done) -> valueShouldEqual browser, inputField, "not cleared", done - (done) -> - browser.clear inputField , (err) -> - should.not.exist err - done null - (done) -> valueShouldEqual browser, inputField, "", done - ], (err) -> - should.not.exist err - test.done() - - "title": (test) -> - browser.title (err,title) -> - should.not.exist err - title.should.equal "TEST PAGE" - test.done() - - "text (passing element)": (test) -> - browser.elementByCss "#text", (err,textDiv) -> - should.not.exist err - should.exist textDiv - browser.text textDiv, (err, res) -> - should.not.exist err - res.should.include "text content" - res.should.not.include "div" - test.done() - - "text (passing undefined)": (test) -> - browser.text undefined, (err, res) -> - should.not.exist err - # the whole page text is returned - res.should.include "text content" - res.should.include "sunny" - res.should.include "click elementsByLinkText" - res.should.not.include "div" - test.done() - - "text (passing body)": (test) -> - browser.text 'body', (err, res) -> - should.not.exist err - # the whole page text is returned - res.should.include "text content" - res.should.include "sunny" - res.should.include "click elementsByLinkText" - res.should.not.include "div" - test.done() - - "text (passing null)": (test) -> - browser.text null, (err, res) -> - should.not.exist err - # the whole page text is returned - res.should.include "text content" - res.should.include "sunny" - res.should.include "click elementsByLinkText" - res.should.not.include "div" - test.done() - - "textPresent": (test) -> - browser.elementByCss "#textPresent", (err,textDiv) -> - should.not.exist err - should.exist textDiv - async.series [ - (done) -> - browser.textPresent 'sunny', textDiv , (err, res) -> - should.not.exist err - res.should.be.true - done null - (done) -> - browser.textPresent 'raining', textDiv , (err, res) -> - should.not.exist err - res.should.be.false - done null - ], (err) -> - should.not.exist err - test.done() - - "acceptAlert": (test) -> - browser.elementByCss "#acceptAlert a", (err,a) -> - should.not.exist err - should.exist a - async.series [ - executeCoffee browser, - """ - jQuery -> - a = $('#acceptAlert a') - a.click -> - alert "coffee is running out" - """ - (done) -> - browser.clickElement a, (err) -> - should.not.exist err - done null - (done) -> - browser.acceptAlert (err) -> - should.not.exist err - done null - ], (err) -> - should.not.exist err - test.done() - - "dismissAlert": (test) -> - browser.elementByCss "#dismissAlert a", (err,a) -> - should.not.exist err - should.exist a - capabilities = null; - async.series [ - (done) -> - browser.sessionCapabilities (err,res) -> - should.not.exist err - capabilities = res - done null - executeCoffee browser, - """ - jQuery -> - a = $('#dismissAlert a') - a.click -> - alert "coffee is running out" - """ - (done) -> - browser.clickElement a, (err) -> - should.not.exist err - done null - (done) -> - # known bug on chrome/mac, need to use acceptAlert instead - unless (capabilities.platform is 'MAC' and capabilities.browserName is 'chrome') - browser.dismissAlert (err) -> - should.not.exist err - done null - else - browser.acceptAlert (err) -> - should.not.exist err - done null - ], (err) -> - should.not.exist err - test.done() - - "active": (test) -> - env = {} - async.series [ - elementByCss browser, env, "#active .i1", 'i1' - elementByCss browser, env, "#active .i2", 'i2' - (done) -> - browser.clickElement env.i1, (err) -> - should.not.exist err - done null - (done) -> - browser.active (err,res) -> - should.not.exist err - (res.should.equal env.i1[k]; env.i1.should.have.property k) for k in res - done null - (done) -> - browser.clickElement env.i2, (err) -> - should.not.exist err - done null - (done) -> - browser.active (err,res) -> - should.not.exist err - (res.should.equal env.i2[k]; env.i2.should.have.property k) for k in res - done null - ], (err) -> - should.not.exist err - test.done() - - "url": (test) -> - browser.url (err,res) -> - res.should.include "test-page.html" - res.should.include "http://" - test.done(); - - "allCookies / setCookies / deleteAllCookies / deleteCookie": (test) -> - async.series [ - (done) -> - browser.deleteAllCookies (err) -> - should.not.exist err - done null - (done) -> - browser.allCookies (err, res) -> - should.not.exist err - res.should.eql [] - done null - (done) -> - browser.setCookie \ - name: 'fruit1' - , value: 'apple' - , (err) -> - should.not.exist err - done null - (done) -> - browser.allCookies (err, res) -> - should.not.exist err - res.should.have.length 1 - (res.filter (c) -> c.name is 'fruit1' and c.value is 'apple')\ - .should.have.length 1 - done null - (done) -> - browser.setCookie \ - name: 'fruit2' - , value: 'pear' - , (err) -> - should.not.exist err - done null - (done) -> - browser.allCookies (err, res) -> - should.not.exist err - res.should.have.length 2 - (res.filter (c) -> c.name is 'fruit2' and c.value is 'pear')\ - .should.have.length 1 - done null - (done) -> - browser.setCookie \ - name: 'fruit3' - , value: 'orange' - , (err) -> - should.not.exist err - done null - (done) -> - browser.allCookies (err, res) -> - should.not.exist err - res.should.have.length 3 - done null - (done) -> - browser.deleteCookie 'fruit2', (err) -> - should.not.exist err - done null - (done) -> - browser.allCookies (err, res) -> - should.not.exist err - res.should.have.length 2 - (res.filter (c) -> c.name is 'fruit2' and c.value is 'pear')\ - .should.have.length 0 - done null - (done) -> - browser.deleteAllCookies (err) -> - should.not.exist err - done null - (done) -> - browser.allCookies (err, res) -> - should.not.exist err - res.should.eql [] - done null - (done) -> - # not too sure how to test this case this one, so just making sure - # that it does not throw - browser.setCookie \ - name: 'fruit3' - , value: 'orange' - , secure: true - , (err) -> - should.not.exist err - done null - ], (err) -> - should.not.exist err - test.done() - - "waitForCondition": (test) -> - exprCond = "$('#waitForCondition .child').length > 0" - async.series [ - executeCoffee browser, - """ - setTimeout -> - $('#waitForCondition').html '
          a waitForCondition child
          ' - , 1500 - """ - (done) -> - browser.elementByCss "#waitForCondition .child", (err,res) -> - should.exist err - err.status.should.equal 7 - done(null) - (done) -> - browser.waitForCondition exprCond, 2000, 200, (err,res) -> - should.not.exist err - res.should.be.true - done(err) - (done) -> - browser.waitForCondition exprCond, 2000, (err,res) -> - should.not.exist err - res.should.be.true - done(err) - (done) -> - browser.waitForCondition exprCond, (err,res) -> - should.not.exist err - res.should.be.true - done(err) - (done) -> - browser.waitForCondition '$wrong expr!!!', (err,res) -> - should.exist err - done(null) - ], (err) -> - should.not.exist err - test.done() - - "waitForConditionInBrowser": (test) -> - exprCond = "$('#waitForConditionInBrowser .child').length > 0" - async.series [ - executeCoffee browser, - """ - setTimeout -> - $('#waitForConditionInBrowser').html '
          a waitForCondition child
          ' - , 1500 - """ - (done) -> - browser.elementByCss "#waitForConditionInBrowser .child", (err,res) -> - should.exist err - err.status.should.equal 7 - done(null) - (done) -> - browser.setAsyncScriptTimeout 5000, (err,res) -> - should.not.exist err - done(null) - (done) -> - browser.waitForConditionInBrowser exprCond, 2000, 200, (err,res) -> - should.not.exist err - res.should.be.true - done(err) - (done) -> - browser.waitForConditionInBrowser exprCond, 2000, (err,res) -> - should.not.exist err - res.should.be.true - done(err) - (done) -> - browser.waitForConditionInBrowser exprCond, (err,res) -> - should.not.exist err - res.should.be.true - done(err) - (done) -> - browser.waitForConditionInBrowser "totally #} wrong == expr", (err,res) -> - should.exist err - done(null) - (done) -> - browser.setAsyncScriptTimeout 0, (err,res) -> - should.not.exist err - done(null) - ], (err) -> - should.not.exist err - test.done() - - "err.inspect": (test) -> - browser.safeExecute "invalid-code> here", (err) -> - should.exist err - (err instanceof Error).should.be.true - should.exist err['jsonwire-error'] - err.inspect().should.include '"screen": "[hidden]"' - err.inspect().should.include 'browser-error:' - test.done() - - "close": (test) -> - browser.close (err) -> - should.not.exist err - test.done() - - "quit": (test) -> - browser.quit (err) -> - should.not.exist err - test.done() - - } - -app = null - -exports.wd = - "per method test": - - 'starting express': (test) -> - app = express.createServer() - app.use(express.static(__dirname + '/assets')); - app.listen 8181 - test.done() - - chrome: (runTestWith {}, {browserName: 'chrome'}) - - firefox: (runTestWith {}, {browserName: 'firefox'}) - - 'stopping express': (test) -> - app.close() - test.done() - - 'checking leaks': leakDetector.lookForLeaks diff --git a/node_modules/wd/test/unit/per-method-test.js b/node_modules/wd/test/unit/per-method-test.js deleted file mode 100644 index b9a99d0..0000000 --- a/node_modules/wd/test/unit/per-method-test.js +++ /dev/null @@ -1,1374 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var CoffeeScript, app, async, elementByCss, evalShouldEqual, executeCoffee, express, leakDetector, runTestWith, safeEvalShouldEqual, should, textShouldEqual, valueShouldEqual, wd; - - should = require('should'); - - express = require('express'); - - CoffeeScript = require('coffee-script'); - - async = require('async'); - - leakDetector = (require('../common/leak-detector'))(); - - wd = require('../../lib/main'); - - evalShouldEqual = function(browser, formula, expected) { - return function(done) { - return browser["eval"](formula, function(err, res) { - should.not.exist(err); - res.should.equal(expected); - return done(null); - }); - }; - }; - - safeEvalShouldEqual = function(browser, formula, expected) { - return function(done) { - return browser.safeEval(formula, function(err, res) { - should.not.exist(err); - res.should.equal(expected); - return done(null); - }); - }; - }; - - executeCoffee = function(browser, script) { - var scriptAsJs; - scriptAsJs = CoffeeScript.compile(script, { - bare: 'on' - }); - return function(done) { - return browser.execute(scriptAsJs, function(err) { - should.not.exist(err); - return done(null); - }); - }; - }; - - elementByCss = function(browser, env, css, name) { - return function(done) { - return browser.elementByCss(css, function(err, res) { - should.not.exist(err); - env[name] = res; - return done(null); - }); - }; - }; - - textShouldEqual = function(browser, element, expected, done) { - return browser.text(element, function(err, res) { - should.not.exist(err); - res.should.equal(expected); - return done(null); - }); - }; - - valueShouldEqual = function(browser, element, expected, done) { - return browser.getValue(element, function(err, res) { - should.not.exist(err); - res.should.equal(expected); - return done(null); - }); - }; - - runTestWith = function(remoteWdConfig, desired) { - var browser, elementFunctionTests; - browser = null; - elementFunctionTests = function() { - var funcSuffix, tests, _fn, _i, _len, _ref; - tests = {}; - tests.element = function(test) { - return async.series([ - function(done) { - return browser.element("name", "elementByName", function(err, res) { - should.not.exist(err); - should.exist(res); - return done(null); - }); - }, function(done) { - return browser.element("name", "elementByName2", function(err, res) { - should.exist(err); - err.status.should.equal(7); - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }; - tests.elementOrNull = function(test) { - return async.series([ - function(done) { - return browser.elementOrNull("name", "elementByName", function(err, res) { - should.not.exist(err); - should.exist(res); - return done(null); - }); - }, function(done) { - return browser.elementOrNull("name", "elementByName2", function(err, res) { - should.not.exist(err); - (res === null).should.be["true"]; - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }; - tests.elementIfExists = function(test) { - return async.series([ - function(done) { - return browser.elementIfExists("name", "elementByName", function(err, res) { - should.not.exist(err); - should.exist(res); - return done(null); - }); - }, function(done) { - return browser.elementIfExists("name", "elementByName2", function(err, res) { - should.not.exist(err); - (res === void 0).should.be["true"]; - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }; - tests.hasElement = function(test) { - return async.series([ - function(done) { - return browser.hasElement("name", "elementByName", function(err, res) { - should.not.exist(err); - res.should.be["true"]; - return done(null); - }); - }, function(done) { - return browser.hasElement("name", "elementByName2", function(err, res) { - should.not.exist(err); - res.should.be["false"]; - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }; - tests.elements = function(test) { - return async.series([ - function(done) { - return browser.elements("name", "elementsByName", function(err, res) { - should.not.exist(err); - res.should.have.length(3); - return done(null); - }); - }, function(done) { - return browser.elements("name", "elementsByName2", function(err, res) { - should.not.exist(err); - res.should.eql([]); - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }; - _ref = ['ByClassName', 'ByCssSelector', 'ById', 'ByName', 'ByLinkText', 'ByPartialLinkText', 'ByTagName', 'ByXPath', 'ByCss']; - _fn = function() { - var elementFuncName, elementsFuncName, hasElementFuncName, searchSeveralText, searchSeveralText2, searchText, searchText2; - elementFuncName = 'element' + funcSuffix; - hasElementFuncName = 'hasElement' + funcSuffix; - elementsFuncName = 'elements' + funcSuffix; - searchText = elementFuncName; - if (searchText.match(/ByLinkText/)) { - searchText = "click " + searchText; - } - if (searchText.match(/ByCss/)) { - searchText = "#" + searchText; - } - if (searchText.match(/ByXPath/)) { - searchText = "//div[@id='elementByXPath']/input"; - } - if (searchText.match(/ByTagName/)) { - searchText = "span"; - } - searchText2 = elementFuncName + '2'; - if (searchText.match(/ByXPath/)) { - searchText2 = "//div[@id='elementByXPath2']/input"; - } - if (searchText.match(/ByTagName/)) { - searchText2 = "span2"; - } - searchSeveralText = searchText.replace('element', 'elements'); - searchSeveralText2 = searchText2.replace('element', 'elements'); - tests[elementFuncName] = function(test) { - return async.series([ - function(done) { - return browser[elementFuncName](searchText, function(err, res) { - should.not.exist(err); - should.exist(res); - return done(null); - }); - }, function(done) { - return browser[elementFuncName](searchText2, function(err, res) { - should.exist(err); - err.status.should.equal(7); - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }; - tests[elementFuncName + 'OrNull'] = function(test) { - return async.series([ - function(done) { - return browser[elementFuncName + 'OrNull'](searchText, function(err, res) { - should.not.exist(err); - should.exist(res); - return done(null); - }); - }, function(done) { - return browser[elementFuncName + 'OrNull'](searchText2, function(err, res) { - should.not.exist(err); - (res === null).should.be["true"]; - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }; - tests[elementFuncName + 'IfExists'] = function(test) { - return async.series([ - function(done) { - return browser[elementFuncName + 'IfExists'](searchText, function(err, res) { - should.not.exist(err); - should.exist(res); - return done(null); - }); - }, function(done) { - return browser[elementFuncName + 'IfExists'](searchText2, function(err, res) { - should.not.exist(err); - (res === void 0).should.be["true"]; - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }; - tests[hasElementFuncName] = function(test) { - return async.series([ - function(done) { - return browser[hasElementFuncName](searchText, function(err, res) { - should.not.exist(err); - res.should.be["true"]; - return done(null); - }); - }, function(done) { - return browser[hasElementFuncName](searchText2, function(err, res) { - should.not.exist(err); - res.should.be["false"]; - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }; - return tests[elementsFuncName] = function(test) { - return async.series([ - function(done) { - return browser[elementsFuncName](searchSeveralText, function(err, res) { - should.not.exist(err); - if (!(elementsFuncName.match(/ByTagName/))) { - res.should.have.length(3); - } else { - (res.length > 1).should.be["true"]; - } - return done(null); - }); - }, function(done) { - return browser[elementsFuncName](searchSeveralText2, function(err, res) { - should.not.exist(err); - res.should.eql([]); - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }; - }; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - funcSuffix = _ref[_i]; - _fn(); - } - return tests; - }; - return { - "wd.remote": function(test) { - browser = wd.remote(remoteWdConfig); - browser.on("status", function(info) { - return console.log("\u001b[36m%s\u001b[0m", info); - }); - browser.on("command", function(meth, path) { - return console.log(" > \u001b[33m%s\u001b[0m: %s", meth, path); - }); - return test.done(); - }, - "status": function(test) { - return browser.status(function(err, status) { - should.not.exist(err); - should.exist(status); - return test.done(); - }); - }, - "sessions": function(test) { - return browser.sessions(function(err, sessions) { - should.not.exist(err); - should.exist(sessions); - return test.done(); - }); - }, - "init": function(test) { - return browser.init(desired, function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "sessionCapabilities": function(test) { - return browser.sessionCapabilities(function(err, capabilities) { - should.not.exist(err); - should.exist(capabilities); - should.exist(capabilities.browserName); - should.exist(capabilities.platform); - return test.done(); - }); - }, - "altSessionCapabilities": function(test) { - return browser.altSessionCapabilities(function(err, capabilities) { - should.not.exist(err); - should.exist(capabilities); - should.exist(capabilities.browserName); - should.exist(capabilities.platform); - return test.done(); - }); - }, - "setPageLoadTimeout": function(test) { - return browser.setPageLoadTimeout(500, function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "get": function(test) { - return browser.get("http://127.0.0.1:8181/test-page.html", function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "refresh": function(test) { - return browser.refresh(function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "back / forward": function(test) { - return async.series([ - function(done) { - return browser.get("http://127.0.0.1:8181/test-page.html?p=2", function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.url(function(err, url) { - should.not.exist(err); - url.should.include("?p=2"); - return done(null); - }); - }, function(done) { - return browser.back(function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.url(function(err, url) { - should.not.exist(err); - url.should.not.include("?p=2"); - return done(null); - }); - }, function(done) { - return browser.forward(function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.url(function(err, url) { - should.not.exist(err); - url.should.include("?p=2"); - return done(null); - }); - }, function(done) { - return browser.get("http://127.0.0.1:8181/test-page.html", function(err) { - should.not.exist(err); - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "eval": function(test) { - return async.series([evalShouldEqual(browser, "1+2", 3), evalShouldEqual(browser, "document.title", "TEST PAGE"), evalShouldEqual(browser, "$('#eval').length", 1), evalShouldEqual(browser, "$('#eval li').length", 2)], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "safeEval": function(test) { - return async.series([ - safeEvalShouldEqual(browser, "1+2", 3), safeEvalShouldEqual(browser, "document.title", "TEST PAGE"), safeEvalShouldEqual(browser, "$('#eval').length", 1), safeEvalShouldEqual(browser, "$('#eval li').length", 2), function(done) { - return browser.safeEval('wrong formula +', function(err, res) { - should.exist(err); - (err instanceof Error).should.be["true"]; - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "execute (no args)": function(test) { - return async.series([ - function(done) { - return browser.execute("window.wd_sync_execute_test = 'It worked!'", function(err) { - should.not.exist(err); - return done(null); - }); - }, evalShouldEqual(browser, "window.wd_sync_execute_test", 'It worked!') - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "execute (with args)": function(test) { - var jsScript; - jsScript = 'var a = arguments[0], b = arguments[1];\nwindow.wd_sync_execute_test = \'It worked! \' + (a+b)'; - return async.series([ - function(done) { - return browser.execute(jsScript, [6, 4], function(err) { - should.not.exist(err); - return done(null); - }); - }, evalShouldEqual(browser, "window.wd_sync_execute_test", 'It worked! 10') - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "safeExecute (no args)": function(test) { - return async.series([ - function(done) { - return browser.safeExecute("window.wd_sync_execute_test = 'It worked!'", function(err) { - should.not.exist(err); - return done(null); - }); - }, evalShouldEqual(browser, "window.wd_sync_execute_test", 'It worked!'), function(done) { - return browser.safeExecute("invalid-code> here", function(err) { - should.exist(err); - (err instanceof Error).should.be["true"]; - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "safeExecute (with args)": function(test) { - var jsScript; - jsScript = 'var a = arguments[0], b = arguments[1];\nwindow.wd_sync_execute_test = \'It worked! \' + (a+b)'; - return async.series([ - function(done) { - return browser.safeExecute(jsScript, [6, 4], function(err) { - should.not.exist(err); - return done(null); - }); - }, evalShouldEqual(browser, "window.wd_sync_execute_test", 'It worked! 10'), function(done) { - return browser.safeExecute("invalid-code> here", [6, 4], function(err) { - should.exist(err); - (err instanceof Error).should.be["true"]; - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "executeAsync (no args)": function(test) { - var scriptAsCoffee, scriptAsJs; - scriptAsCoffee = "[args...,done] = arguments\ndone \"OK\" "; - scriptAsJs = CoffeeScript.compile(scriptAsCoffee, { - bare: 'on' - }); - return browser.executeAsync(scriptAsJs, function(err, res) { - should.not.exist(err); - res.should.equal("OK"); - return test.done(); - }); - }, - "executeAsync (with args)": function(test) { - var scriptAsCoffee, scriptAsJs; - scriptAsCoffee = "[a,b,done] = arguments\ndone(\"OK \" + (a+b)) "; - scriptAsJs = CoffeeScript.compile(scriptAsCoffee, { - bare: 'on' - }); - return browser.executeAsync(scriptAsJs, [10, 5], function(err, res) { - should.not.exist(err); - res.should.equal("OK 15"); - return test.done(); - }); - }, - "safeExecuteAsync (no args)": function(test) { - return async.series([ - function(done) { - var scriptAsCoffee, scriptAsJs; - scriptAsCoffee = "[args...,done] = arguments\ndone \"OK\" "; - scriptAsJs = CoffeeScript.compile(scriptAsCoffee, { - bare: 'on' - }); - return browser.safeExecuteAsync(scriptAsJs, function(err, res) { - should.not.exist(err); - res.should.equal("OK"); - return done(null); - }); - }, function(done) { - return browser.safeExecuteAsync("123 invalid\n $('#setWaitTimeout').html '
          a child
          '\n, 1000"), function(done) { - return browser.elementByCss("#setWaitTimeout .child", function(err, res) { - should.exist(err); - err.status.should.equal(7); - return done(null); - }); - }, function(done) { - return browser.setImplicitWaitTimeout(2000, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.elementByCss("#setWaitTimeout .child", function(err, res) { - should.not.exist(err); - should.exist(res); - return done(null); - }); - }, function(done) { - return browser.setImplicitWaitTimeout(0, function(err) { - should.not.exist(err); - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "setAsyncScriptTimeout": function(test) { - return async.series([ - function(done) { - return browser.setAsyncScriptTimeout(2000, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - var scriptAsCoffee, scriptAsJs; - scriptAsCoffee = "[args...,done] = arguments\nsetTimeout ->\n done \"OK\"\n, 1000"; - scriptAsJs = CoffeeScript.compile(scriptAsCoffee, { - bare: 'on' - }); - return browser.executeAsync(scriptAsJs, function(err, res) { - should.not.exist(err); - res.should.equal("OK"); - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "element function tests": elementFunctionTests(), - "getAttribute": function(test) { - return browser.elementById("getAttribute", function(err, testDiv) { - should.not.exist(err); - should.exist(testDiv); - return async.series([ - function(done) { - return browser.getAttribute(testDiv, "weather", function(err, res) { - should.not.exist(err); - res.should.equal("sunny"); - return done(null); - }); - }, function(done) { - return browser.getAttribute(testDiv, "timezone", function(err, res) { - should.not.exist(err); - should.not.exist(res); - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }, - "getValue (input)": function(test) { - return browser.elementByCss("#getValue input", function(err, inputField) { - should.not.exist(err); - should.exist(inputField); - return browser.getValue(inputField, function(err, res) { - should.not.exist(err); - res.should.equal("Hello getValueTest!"); - return test.done(); - }); - }); - }, - "getValue (textarea)": function(test) { - return browser.elementByCss("#getValue textarea", function(err, inputField) { - should.not.exist(err); - should.exist(inputField); - return browser.getValue(inputField, function(err, res) { - should.not.exist(err); - res.should.equal("Hello getValueTest2!"); - return test.done(); - }); - }); - }, - "clickElement": function(test) { - return browser.elementByCss("#clickElement a", function(err, anchor) { - should.not.exist(err); - should.exist(anchor); - return async.series([ - executeCoffee(browser, 'jQuery ->\n a = $(\'#clickElement a\')\n a.click ->\n a.html \'clicked\' '), function(done) { - return textShouldEqual(browser, anchor, "not clicked", done); - }, function(done) { - return browser.clickElement(anchor, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return textShouldEqual(browser, anchor, "clicked", done); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }, - "moveTo": function(test) { - var env; - env = {}; - return async.series([ - elementByCss(browser, env, "#moveTo .a1", 'a1'), elementByCss(browser, env, "#moveTo .a2", 'a2'), elementByCss(browser, env, "#moveTo .current", 'current'), function(done) { - return textShouldEqual(browser, env.current, '', done); - }, executeCoffee(browser, 'jQuery ->\n a1 = $(\'#moveTo .a1\')\n a2 = $(\'#moveTo .a2\')\n current = $(\'#moveTo .current\')\n a1.hover ->\n current.html \'a1\'\n a2.hover ->\n current.html \'a2\''), function(done) { - return textShouldEqual(browser, env.current, '', done); - }, function(done) { - return browser.moveTo(env.a1, 5, 5, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return textShouldEqual(browser, env.current, 'a1', done); - }, function(done) { - return browser.moveTo(env.a2, void 0, void 0, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return textShouldEqual(browser, env.current, 'a2', done); - }, function(done) { - return browser.moveTo(env.a1, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return textShouldEqual(browser, env.current, 'a1', done); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "buttonDown / buttonUp": function(test) { - var env; - env = {}; - return async.series([ - elementByCss(browser, env, "#mouseButton a", 'a'), elementByCss(browser, env, "#mouseButton div", 'resDiv'), executeCoffee(browser, 'jQuery ->\n a = $(\'#mouseButton a\')\n resDiv = $(\'#mouseButton div\')\n a.mousedown ->\n resDiv.html \'button down\'\n a.mouseup ->\n resDiv.html \'button up\''), function(done) { - return textShouldEqual(browser, env.resDiv, '', done); - }, function(done) { - return browser.moveTo(env.a, void 0, void 0, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.buttonDown(function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return textShouldEqual(browser, env.resDiv, 'button down', done); - }, function(done) { - return browser.buttonUp(function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return textShouldEqual(browser, env.resDiv, 'button up', done); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "click": function(test) { - return browser.elementByCss("#click a", function(err, anchor) { - should.not.exist(err); - should.exist(anchor); - return async.series([ - executeCoffee(browser, 'jQuery ->\n window.numOfClick = 0\n a = $(\'#click a\')\n a.click ->\n window.numOfClick = window.numOfClick + 1\n a.html "clicked #{window.numOfClick}" '), function(done) { - return textShouldEqual(browser, anchor, "not clicked", done); - }, function(done) { - return browser.moveTo(anchor, void 0, void 0, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.click(0, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return textShouldEqual(browser, anchor, "clicked 1", done); - }, function(done) { - return browser.moveTo(anchor, void 0, void 0, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.click(function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return textShouldEqual(browser, anchor, "clicked 2", done); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }, - "doubleclick": function(test) { - return browser.elementByCss("#doubleclick a", function(err, anchor) { - should.not.exist(err); - should.exist(anchor); - return async.series([ - executeCoffee(browser, 'jQuery ->\n a = $(\'#doubleclick a\')\n a.click ->\n a.html \'doubleclicked\' '), function(done) { - return textShouldEqual(browser, anchor, "not clicked", done); - }, function(done) { - return browser.moveTo(anchor, void 0, void 0, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.doubleclick(0, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return textShouldEqual(browser, anchor, "doubleclicked", done); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }, - "type": function(test) { - var altKey, nullKey; - altKey = wd.SPECIAL_KEYS['Alt']; - nullKey = wd.SPECIAL_KEYS['NULL']; - return browser.elementByCss("#type input", function(err, inputField) { - should.not.exist(err); - should.exist(inputField); - return async.series([ - function(done) { - return valueShouldEqual(browser, inputField, "", done); - }, function(done) { - return browser.type(inputField, "Hello", function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return valueShouldEqual(browser, inputField, "Hello", done); - }, function(done) { - return browser.type(inputField, [altKey, nullKey, " World"], function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return valueShouldEqual(browser, inputField, "Hello World", done); - }, function(done) { - return browser.type(inputField, "\n", function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return valueShouldEqual(browser, inputField, "Hello World", done); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }, - "keys": function(test) { - var altKey, nullKey; - altKey = wd.SPECIAL_KEYS['Alt']; - nullKey = wd.SPECIAL_KEYS['NULL']; - return browser.elementByCss("#keys input", function(err, inputField) { - should.not.exist(err); - should.exist(inputField); - return async.series([ - function(done) { - return valueShouldEqual(browser, inputField, "", done); - }, function(done) { - return browser.clickElement(inputField, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.keys("Hello", function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return valueShouldEqual(browser, inputField, "Hello", done); - }, function(done) { - return browser.keys([altKey, nullKey, " World"], function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return valueShouldEqual(browser, inputField, "Hello World", done); - }, function(done) { - return browser.keys("\n", function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return valueShouldEqual(browser, inputField, "Hello World", done); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }, - "clear": function(test) { - return browser.elementByCss("#clear input", function(err, inputField) { - should.not.exist(err); - should.exist(inputField); - return async.series([ - function(done) { - return valueShouldEqual(browser, inputField, "not cleared", done); - }, function(done) { - return browser.clear(inputField, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return valueShouldEqual(browser, inputField, "", done); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }, - "title": function(test) { - return browser.title(function(err, title) { - should.not.exist(err); - title.should.equal("TEST PAGE"); - return test.done(); - }); - }, - "text (passing element)": function(test) { - return browser.elementByCss("#text", function(err, textDiv) { - should.not.exist(err); - should.exist(textDiv); - return browser.text(textDiv, function(err, res) { - should.not.exist(err); - res.should.include("text content"); - res.should.not.include("div"); - return test.done(); - }); - }); - }, - "text (passing undefined)": function(test) { - return browser.text(void 0, function(err, res) { - should.not.exist(err); - res.should.include("text content"); - res.should.include("sunny"); - res.should.include("click elementsByLinkText"); - res.should.not.include("div"); - return test.done(); - }); - }, - "text (passing body)": function(test) { - return browser.text('body', function(err, res) { - should.not.exist(err); - res.should.include("text content"); - res.should.include("sunny"); - res.should.include("click elementsByLinkText"); - res.should.not.include("div"); - return test.done(); - }); - }, - "text (passing null)": function(test) { - return browser.text(null, function(err, res) { - should.not.exist(err); - res.should.include("text content"); - res.should.include("sunny"); - res.should.include("click elementsByLinkText"); - res.should.not.include("div"); - return test.done(); - }); - }, - "textPresent": function(test) { - return browser.elementByCss("#textPresent", function(err, textDiv) { - should.not.exist(err); - should.exist(textDiv); - return async.series([ - function(done) { - return browser.textPresent('sunny', textDiv, function(err, res) { - should.not.exist(err); - res.should.be["true"]; - return done(null); - }); - }, function(done) { - return browser.textPresent('raining', textDiv, function(err, res) { - should.not.exist(err); - res.should.be["false"]; - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }, - "acceptAlert": function(test) { - return browser.elementByCss("#acceptAlert a", function(err, a) { - should.not.exist(err); - should.exist(a); - return async.series([ - executeCoffee(browser, "jQuery -> \n a = $('#acceptAlert a')\n a.click ->\n alert \"coffee is running out\""), function(done) { - return browser.clickElement(a, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.acceptAlert(function(err) { - should.not.exist(err); - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }, - "dismissAlert": function(test) { - return browser.elementByCss("#dismissAlert a", function(err, a) { - var capabilities; - should.not.exist(err); - should.exist(a); - capabilities = null; - return async.series([ - function(done) { - return browser.sessionCapabilities(function(err, res) { - should.not.exist(err); - capabilities = res; - return done(null); - }); - }, executeCoffee(browser, "jQuery -> \n a = $('#dismissAlert a')\n a.click ->\n alert \"coffee is running out\""), function(done) { - return browser.clickElement(a, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - if (!(capabilities.platform === 'MAC' && capabilities.browserName === 'chrome')) { - return browser.dismissAlert(function(err) { - should.not.exist(err); - return done(null); - }); - } else { - return browser.acceptAlert(function(err) { - should.not.exist(err); - return done(null); - }); - } - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }); - }, - "active": function(test) { - var env; - env = {}; - return async.series([ - elementByCss(browser, env, "#active .i1", 'i1'), elementByCss(browser, env, "#active .i2", 'i2'), function(done) { - return browser.clickElement(env.i1, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.active(function(err, res) { - var k, _i, _len; - should.not.exist(err); - for (_i = 0, _len = res.length; _i < _len; _i++) { - k = res[_i]; - res.should.equal(env.i1[k]); - env.i1.should.have.property(k); - } - return done(null); - }); - }, function(done) { - return browser.clickElement(env.i2, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.active(function(err, res) { - var k, _i, _len; - should.not.exist(err); - for (_i = 0, _len = res.length; _i < _len; _i++) { - k = res[_i]; - res.should.equal(env.i2[k]); - env.i2.should.have.property(k); - } - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "url": function(test) { - return browser.url(function(err, res) { - res.should.include("test-page.html"); - res.should.include("http://"); - return test.done(); - }); - }, - "allCookies / setCookies / deleteAllCookies / deleteCookie": function(test) { - return async.series([ - function(done) { - return browser.deleteAllCookies(function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.allCookies(function(err, res) { - should.not.exist(err); - res.should.eql([]); - return done(null); - }); - }, function(done) { - return browser.setCookie({ - name: 'fruit1', - value: 'apple' - }, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.allCookies(function(err, res) { - should.not.exist(err); - res.should.have.length(1); - (res.filter(function(c) { - return c.name === 'fruit1' && c.value === 'apple'; - })).should.have.length(1); - return done(null); - }); - }, function(done) { - return browser.setCookie({ - name: 'fruit2', - value: 'pear' - }, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.allCookies(function(err, res) { - should.not.exist(err); - res.should.have.length(2); - (res.filter(function(c) { - return c.name === 'fruit2' && c.value === 'pear'; - })).should.have.length(1); - return done(null); - }); - }, function(done) { - return browser.setCookie({ - name: 'fruit3', - value: 'orange' - }, function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.allCookies(function(err, res) { - should.not.exist(err); - res.should.have.length(3); - return done(null); - }); - }, function(done) { - return browser.deleteCookie('fruit2', function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.allCookies(function(err, res) { - should.not.exist(err); - res.should.have.length(2); - (res.filter(function(c) { - return c.name === 'fruit2' && c.value === 'pear'; - })).should.have.length(0); - return done(null); - }); - }, function(done) { - return browser.deleteAllCookies(function(err) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.allCookies(function(err, res) { - should.not.exist(err); - res.should.eql([]); - return done(null); - }); - }, function(done) { - return browser.setCookie({ - name: 'fruit3', - value: 'orange', - secure: true - }, function(err) { - should.not.exist(err); - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "waitForCondition": function(test) { - var exprCond; - exprCond = "$('#waitForCondition .child').length > 0"; - return async.series([ - executeCoffee(browser, "setTimeout ->\n $('#waitForCondition').html '
          a waitForCondition child
          '\n, 1500"), function(done) { - return browser.elementByCss("#waitForCondition .child", function(err, res) { - should.exist(err); - err.status.should.equal(7); - return done(null); - }); - }, function(done) { - return browser.waitForCondition(exprCond, 2000, 200, function(err, res) { - should.not.exist(err); - res.should.be["true"]; - return done(err); - }); - }, function(done) { - return browser.waitForCondition(exprCond, 2000, function(err, res) { - should.not.exist(err); - res.should.be["true"]; - return done(err); - }); - }, function(done) { - return browser.waitForCondition(exprCond, function(err, res) { - should.not.exist(err); - res.should.be["true"]; - return done(err); - }); - }, function(done) { - return browser.waitForCondition('$wrong expr!!!', function(err, res) { - should.exist(err); - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "waitForConditionInBrowser": function(test) { - var exprCond; - exprCond = "$('#waitForConditionInBrowser .child').length > 0"; - return async.series([ - executeCoffee(browser, "setTimeout ->\n $('#waitForConditionInBrowser').html '
          a waitForCondition child
          '\n, 1500"), function(done) { - return browser.elementByCss("#waitForConditionInBrowser .child", function(err, res) { - should.exist(err); - err.status.should.equal(7); - return done(null); - }); - }, function(done) { - return browser.setAsyncScriptTimeout(5000, function(err, res) { - should.not.exist(err); - return done(null); - }); - }, function(done) { - return browser.waitForConditionInBrowser(exprCond, 2000, 200, function(err, res) { - should.not.exist(err); - res.should.be["true"]; - return done(err); - }); - }, function(done) { - return browser.waitForConditionInBrowser(exprCond, 2000, function(err, res) { - should.not.exist(err); - res.should.be["true"]; - return done(err); - }); - }, function(done) { - return browser.waitForConditionInBrowser(exprCond, function(err, res) { - should.not.exist(err); - res.should.be["true"]; - return done(err); - }); - }, function(done) { - return browser.waitForConditionInBrowser("totally #} wrong == expr", function(err, res) { - should.exist(err); - return done(null); - }); - }, function(done) { - return browser.setAsyncScriptTimeout(0, function(err, res) { - should.not.exist(err); - return done(null); - }); - } - ], function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "err.inspect": function(test) { - return browser.safeExecute("invalid-code> here", function(err) { - should.exist(err); - (err instanceof Error).should.be["true"]; - should.exist(err['jsonwire-error']); - err.inspect().should.include('"screen": "[hidden]"'); - err.inspect().should.include('browser-error:'); - return test.done(); - }); - }, - "close": function(test) { - return browser.close(function(err) { - should.not.exist(err); - return test.done(); - }); - }, - "quit": function(test) { - return browser.quit(function(err) { - should.not.exist(err); - return test.done(); - }); - } - }; - }; - - app = null; - - exports.wd = { - "per method test": { - 'starting express': function(test) { - app = express.createServer(); - app.use(express["static"](__dirname + '/assets')); - app.listen(8181); - return test.done(); - }, - chrome: runTestWith({}, { - browserName: 'chrome' - }), - firefox: runTestWith({}, { - browserName: 'firefox' - }), - 'stopping express': function(test) { - app.close(); - return test.done(); - }, - 'checking leaks': leakDetector.lookForLeaks - } - }; - -}).call(this); diff --git a/node_modules/wd/test/unit/wd-remote-init-test.coffee b/node_modules/wd/test/unit/wd-remote-init-test.coffee deleted file mode 100644 index 95c20cc..0000000 --- a/node_modules/wd/test/unit/wd-remote-init-test.coffee +++ /dev/null @@ -1,115 +0,0 @@ -# nodeunit test - -should = require 'should' - -leakDetector = (require '../common/leak-detector')() - -wd = require '../../lib/main' - -exports.wd = - 'remote init test': - default: (test) -> - browser = wd.remote() - browser.options.host.should.equal '127.0.0.1' - browser.options.port.should.equal 4444 - browser.options.path.should.equal '/wd/hub/session' - browser.basePath.should.equal '/wd/hub' - should.not.exist browser.username - should.not.exist browser.accessKey - test.done() - - params: - 'host, port': (test) -> - browser = wd.remote('localhost', 8888) - browser.options.host.should.equal 'localhost' - browser.options.port.should.equal 8888 - browser.options.path.should.equal '/wd/hub/session' - browser.basePath.should.equal '/wd/hub' - should.not.exist browser.username - should.not.exist browser.accessKey - test.done() - - 'host, port, username, accesskey': (test) -> - browser = wd.remote('localhost', 8888 , 'mickey', 'mouse' ) - browser.options.host.should.equal 'localhost' - browser.options.port.should.equal 8888 - browser.options.path.should.equal '/wd/hub/session' - browser.basePath.should.equal '/wd/hub' - browser.username.should.equal 'mickey' - browser.accessKey.should.equal 'mouse' - test.done() - - options: - empty: (test) -> - browser = wd.remote( {} ) - browser.options.host.should.equal '127.0.0.1' - browser.options.port.should.equal 4444 - browser.options.path.should.equal '/wd/hub/session' - browser.basePath.should.equal '/wd/hub' - should.not.exist browser.username - should.not.exist browser.accessKey - test.done() - 'host, port': (test) -> - browser = wd.remote({host:'localhost', port:8888}) - browser.options.host.should.equal 'localhost' - browser.options.port.should.equal 8888 - browser.options.path.should.equal '/wd/hub/session' - browser.basePath.should.equal '/wd/hub' - should.not.exist browser.username - should.not.exist browser.accessKey - test.done() - 'host, port, username, accesskey': (test) -> - browser = wd.remote({ - host:'localhost' - port:8888 - username:'mickey' - accessKey:'mouse' - }) - browser.options.host.should.equal 'localhost' - browser.options.port.should.equal 8888 - browser.options.path.should.equal '/wd/hub/session' - browser.basePath.should.equal '/wd/hub' - browser.username.should.equal 'mickey' - browser.accessKey.should.equal 'mouse' - test.done() - 'path': (test) -> - browser = wd.remote( {path:'/taiwan'} ) - browser.options.host.should.equal '127.0.0.1' - browser.options.port.should.equal 4444 - browser.options.path.should.equal '/taiwan/session' - browser.basePath.should.equal '/taiwan' - should.not.exist browser.username - should.not.exist browser.accessKey - test.done() - 'host, port, path': (test) -> - browser = wd.remote({host:'localhost', port:8888, path:'/'}) - browser.options.host.should.equal 'localhost' - browser.options.port.should.equal 8888 - browser.options.path.should.equal '/session' - browser.basePath.should.equal '/' - should.not.exist browser.username - should.not.exist browser.accessKey - test.done() - 'host, port, username, accesskey, path': (test) -> - browser = wd.remote({ - host:'localhost' - port:8888 - username:'mickey' - accessKey:'mouse' - path:'/asia/taiwan' - }) - browser.options.host.should.equal 'localhost' - browser.options.port.should.equal 8888 - browser.options.path.should.equal '/asia/taiwan/session' - browser.basePath.should.equal '/asia/taiwan' - browser.username.should.equal 'mickey' - browser.accessKey.should.equal 'mouse' - test.done() - - 'checking leaks': leakDetector.lookForLeaks - - - - - - \ No newline at end of file diff --git a/node_modules/wd/test/unit/wd-remote-init-test.js b/node_modules/wd/test/unit/wd-remote-init-test.js deleted file mode 100644 index 1f0a41e..0000000 --- a/node_modules/wd/test/unit/wd-remote-init-test.js +++ /dev/null @@ -1,140 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var leakDetector, should, wd; - - should = require('should'); - - leakDetector = (require('../common/leak-detector'))(); - - wd = require('../../lib/main'); - - exports.wd = { - 'remote init test': { - "default": function(test) { - var browser; - browser = wd.remote(); - browser.options.host.should.equal('127.0.0.1'); - browser.options.port.should.equal(4444); - browser.options.path.should.equal('/wd/hub/session'); - browser.basePath.should.equal('/wd/hub'); - should.not.exist(browser.username); - should.not.exist(browser.accessKey); - return test.done(); - }, - params: { - 'host, port': function(test) { - var browser; - browser = wd.remote('localhost', 8888); - browser.options.host.should.equal('localhost'); - browser.options.port.should.equal(8888); - browser.options.path.should.equal('/wd/hub/session'); - browser.basePath.should.equal('/wd/hub'); - should.not.exist(browser.username); - should.not.exist(browser.accessKey); - return test.done(); - }, - 'host, port, username, accesskey': function(test) { - var browser; - browser = wd.remote('localhost', 8888, 'mickey', 'mouse'); - browser.options.host.should.equal('localhost'); - browser.options.port.should.equal(8888); - browser.options.path.should.equal('/wd/hub/session'); - browser.basePath.should.equal('/wd/hub'); - browser.username.should.equal('mickey'); - browser.accessKey.should.equal('mouse'); - return test.done(); - } - }, - options: { - empty: function(test) { - var browser; - browser = wd.remote({}); - browser.options.host.should.equal('127.0.0.1'); - browser.options.port.should.equal(4444); - browser.options.path.should.equal('/wd/hub/session'); - browser.basePath.should.equal('/wd/hub'); - should.not.exist(browser.username); - should.not.exist(browser.accessKey); - return test.done(); - }, - 'host, port': function(test) { - var browser; - browser = wd.remote({ - host: 'localhost', - port: 8888 - }); - browser.options.host.should.equal('localhost'); - browser.options.port.should.equal(8888); - browser.options.path.should.equal('/wd/hub/session'); - browser.basePath.should.equal('/wd/hub'); - should.not.exist(browser.username); - should.not.exist(browser.accessKey); - return test.done(); - }, - 'host, port, username, accesskey': function(test) { - var browser; - browser = wd.remote({ - host: 'localhost', - port: 8888, - username: 'mickey', - accessKey: 'mouse' - }); - browser.options.host.should.equal('localhost'); - browser.options.port.should.equal(8888); - browser.options.path.should.equal('/wd/hub/session'); - browser.basePath.should.equal('/wd/hub'); - browser.username.should.equal('mickey'); - browser.accessKey.should.equal('mouse'); - return test.done(); - }, - 'path': function(test) { - var browser; - browser = wd.remote({ - path: '/taiwan' - }); - browser.options.host.should.equal('127.0.0.1'); - browser.options.port.should.equal(4444); - browser.options.path.should.equal('/taiwan/session'); - browser.basePath.should.equal('/taiwan'); - should.not.exist(browser.username); - should.not.exist(browser.accessKey); - return test.done(); - }, - 'host, port, path': function(test) { - var browser; - browser = wd.remote({ - host: 'localhost', - port: 8888, - path: '/' - }); - browser.options.host.should.equal('localhost'); - browser.options.port.should.equal(8888); - browser.options.path.should.equal('/session'); - browser.basePath.should.equal('/'); - should.not.exist(browser.username); - should.not.exist(browser.accessKey); - return test.done(); - }, - 'host, port, username, accesskey, path': function(test) { - var browser; - browser = wd.remote({ - host: 'localhost', - port: 8888, - username: 'mickey', - accessKey: 'mouse', - path: '/asia/taiwan' - }); - browser.options.host.should.equal('localhost'); - browser.options.port.should.equal(8888); - browser.options.path.should.equal('/asia/taiwan/session'); - browser.basePath.should.equal('/asia/taiwan'); - browser.username.should.equal('mickey'); - browser.accessKey.should.equal('mouse'); - return test.done(); - } - }, - 'checking leaks': leakDetector.lookForLeaks - } - }; - -}).call(this); diff --git a/public/app.js b/public/app.js new file mode 100644 index 0000000..29af3f2 --- /dev/null +++ b/public/app.js @@ -0,0 +1,20 @@ +$(function() { + var modals = $('.fullExcerptModal'); + modals.show(); + modals.position({ + my: "center center", + at: "center center", + of: $(window) + }); + modals.hide(); + $('.seeFull').click(function() { + var postId = $(this).data('post-id'); + var postModal = $('.fullExcerptModal[data-post-id='+postId+']'); + postModal.show(); + }); + $('.excerptClose').click(function() { + var postId = $(this).data('post-id'); + var postModal = $('.fullExcerptModal[data-post-id='+postId+']'); + postModal.hide(); + }); +}); diff --git a/public/style.css b/public/style.css index 3e4668a..85ec8bc 100644 --- a/public/style.css +++ b/public/style.css @@ -53,4 +53,49 @@ p.error { p.message { color: #2EBBE6; background: #F7FBFD; -} \ No newline at end of file +} +.fullExcerptModal { + position: absolute; + width: 400px; + height: 300px; + padding: 10px; + border: 2px solid #ccc; + -webkit-border-top-left-radius: 5px; + -webkit-border-top-right-radius: 5px; + -moz-border-radius-topleft: 5px; + -moz-border-radius-topright: 5px; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + -webkit-border-bottom-left-radius: 5px; + -webkit-border-bottom-right-radius: 5px; + -moz-border-radius-bottomleft: 5px; + -moz-border-radius-bottomright: 5px; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; + -webkit-box-shadow: 4px 2px 5px rgba(60, 60, 60, 0.6); + -moz-box-shadow: 4px 2px 5px rgba(60, 60, 60, 0.6); + box-shadow: 4px 2px 5px rgba(60, 60, 60, 0.6); + overflow: scroll; + background: white; +} +.excerptTitleCont { + clear: both; + float: none; + height: 25px; + border-bottom: 1px solid #ccc; +} +.excerptTitle { + float: left; + width: 350px; + font-size: 15px; +} +a.excerptClose { + float: right; + display: inline-block; + font-size: 10px; +} +.excerpt { + padding-top: 10px; + font-size: 12px; + +} diff --git a/raw_tests.js b/raw_tests.js index 5fd7037..428a6b7 100644 --- a/raw_tests.js +++ b/raw_tests.js @@ -1,7 +1,7 @@ var assert = require('assert'), _s = require('underscore.string'), Post = require('./models/post'), - wd = require('wd'); + wd = require('../libs/wd'); var exports = module.exports = function RawTests() {}; @@ -30,8 +30,12 @@ exports.allTests = function(conf, cap, capText) { } clearUrl = 'http://' + site + '/clear_all'; driver.init(cap, function() { - driver.get(url, function() { - cb(driver); + driver.setImplicitWaitTimeout(30, function() { + //driver.get(clearUrl, function() { + driver.get(url, function() { + cb(driver); + }); + //}); }); }); }; @@ -262,7 +266,7 @@ exports.allTests = function(conf, cap, capText) { }); }); }); - }); + }, this.context.name); }, '': function(err, title) { assert.equal(title, postFixture.title); @@ -280,7 +284,7 @@ exports.allTests = function(conf, cap, capText) { }); }); }); - }); + }, this.context.name); }, '': function(err, body) { assert.equal(body, postFixture.body); @@ -307,7 +311,7 @@ exports.allTests = function(conf, cap, capText) { }); }); }); - }); + }, this.context.name); }, '': function(err, expected, value) { assert.equal(expected, value); @@ -334,11 +338,43 @@ exports.allTests = function(conf, cap, capText) { }); }); }); - }); + }, this.context.name); }, '': function(err, expected, value) { assert.equal(expected, value); } + }, + + 'clicking view full link shows post modal': { + topic: function() { + var cb = this.callback; + var title = postFixture.title + " " + Math.random().toString(); + var body = postFixture.body + " " + Math.random().toString(); + navAndWritePost(title, body, function(driver) { + driver.get('http://'+site, function() { + driver.waitForElement('link text', title, 10, function(err) { + driver.elementByLinkText(title, function(err, el) { + driver.getAttribute(el, 'data-post-id', function(err, postId) { + var seeFullSel = 'seeFull_'+postId; + driver.elementById(seeFullSel, function(err, el) { + driver.clickElement(el, function(err) { + var fumSel = 'fullExcerptModal_'+postId; + driver.waitForVisible('id', fumSel, 10000, function(err) { + driver.quit(function() { + cb(err, typeof err == 'undefined'); + }); + }); + }); + }); + }); + }); + }); + }); + }, this.context.name); + }, + '': function(err, present) { + assert.ok(present); + } } }; diff --git a/tests.js b/tests.js index cc8e9ee..d68b225 100644 --- a/tests.js +++ b/tests.js @@ -27,8 +27,8 @@ var allConfs = { maxTests: false, serviceName: 'sauce', caps: [ - {browserName: "internet explorer", version: '8', platform: "XP", proxy: {proxyType: 'direct'}, 'selenium-version': '2.21.0'}, - {browserName: "firefox", version: '10', platform: "Windows 2003", proxy: {proxyType: 'direct'}}, + //{browserName: "internet explorer", version: '8', platform: "XP", proxy: {proxyType: 'direct'}, 'selenium-version': '2.21.0'}, + //{browserName: "firefox", version: '10', platform: "Windows 2003", proxy: {proxyType: 'direct'}}, {browserName: "chrome", version: '', platform: "VISTA", proxy: {proxyType: 'direct'}} ] } diff --git a/views/layout.jade b/views/layout.jade index f153a99..14f268a 100644 --- a/views/layout.jade +++ b/views/layout.jade @@ -3,6 +3,9 @@ html head title Blog link(rel='stylesheet', href='/style.css') + script(type='text/javascript', src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js') + script(type='text/javascript', src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js') + script(type='text/javascript', src='/app.js'); body #container - block content \ No newline at end of file + block content diff --git a/views/post/index.jade b/views/post/index.jade index 14cf1b0..d83b18b 100644 --- a/views/post/index.jade +++ b/views/post/index.jade @@ -4,15 +4,25 @@ block content .post // title h2 - = post.title + a(href='/post/'+post.id, data-post-id=post.id)= post.title a.edit(href='/post/' + post.id + '/edit') Edit - + include ../messages - + // dates p.date.created Created at #{post.createdAt} if post.updatedAt p.date.updated Updated at #{post.updatedAt} - + // body - pre.body= post.body \ No newline at end of file + p + = post.excerpt() + - var seeFullId = "seeFull_" + post.id; + a.seeFull(id=seeFullId, href='javascript:void(0);', onclick='return false;', data-post-id=post.id) View full entry + + - var fumId = "fullExcerptModal_" + post.id; + .fullExcerptModal(id=fumId, style="display:none", data-post-id=post.id) + .excerptTitleCont + .excerptTitle= post.title + a.excerptClose(href='javascript:void(0);', onclick='return false;', data-post-id=post.id) Close + .excerpt!= post.body_nl2br()

          kGEBRg;p7e~3*Cp2CRIQB}e5o#&@4i)SC8x9e-qny)-q!c0Jt^&cIi@q!$A&*t1F?QL7`%* zS3?0{F4-UU#*|-32<3LcSmzc!ee4CQ%Wa*Vd3kxbnKp_f*SfR6zd2UK0%`qMpz)u4 zdJXUTmuNyj1>*$(vEQzR3J)GT2MeU)p05#Y)$-6Vu3!~KWonH@6;3d2WQ}_-nhWGx zi6FOh(dlVb1?8t3me?HsVZJ_(fF($U|T+e;;rRnk|BKo)njsWHi5g^!}O?ZEmWya&wA*(h`(jy z>u?~=Ud@N7H5#yMxvWFgjdqktto)vmZ+@Mnqn+f?{?Bls^Wo=4dp$06)~GoPs+4gq z6R%eX?t1+J0n8#)&mOi`vkb>mH|vRiqkSmp4gX_K;u^(neMPE=eRU_%6)Wg z(2jT}LVI?`B93B1xMUs9XdvlGz!6Ve@cHvNGasW1&4hOdy@djStvtBtkv)Q%XY~Cb zix%{YPwwnHPA>yUE7_bu%r2<2;EJ4P;Ft<*?uqfn&{9uKMT}SSiA^a?xWk@=2fKEW zjzwId14I9ilJKXRE`8+MmM&PTDv)zGi16)7i-Zdq!HQ|WKO3iWFDHxNYOC@*a|{yR zalujSNQ+~4v;3V&PJ(Wt6DP)4X!K*iN-_Dw=~Mi$;m6bjO530M6HHOGEVuHU<>8K> zbn$_A_P?=}lt2eYk+E=R-RWIAWXhztHWP??p}97N@mj9%>{qvYcSlmvYkfRo0b|Z- z2>TW;3rPR5?`!g1+;y+HqbQEaALxy@qYaS*VbN5E@DUboX$nP!BJbWl0aM81e-b?S z5_{8^z-Mx4Cw2@y?dd=P=eN+ns^p+=q|L_~$rR}o-F@Vcj=!cG5$vnbOA=}@ogr%zn9og>*=Hb! zssYRMT$g!52BB%Lg4mm$aLXHoP+t^EF5K|$;ymH6B!xo6Cfk)_fkfqSY;Z;a<$fjp zMbNeQpPfGOscCag+SC8U{Y6^;8ou#`{1OfR9S-Zvo0*%t2b-wW0Ly469uLT;#)Pof zqha{ZV)q;5HD}@J#HAj3;Qp?Wsyz-psU}K6zK4I>tYa(!--dUZEoHh3??kS|_wv_4U*ZGn@BjwOc=QX0+8h6U-c)<5$`_aop3bCm(#umE#FH;Hkw!m}Y z`~p)WoyXkA12HvGWG6G=o$NU(;J!&+z)<6(LI%)uPl*&ycB_tk$w$yL0VadG&w+y1 zbgxx@w|W|ubKz&bcId}My&Ps&t83dXx)e&D{~a4mlnE?QY+^al-vCErEB?dkFRLkS&#*(rLG+T%X6Ee<3KKA@{&aD37Qjcp+ z^>Y|bKGT4z4K!B$h2w-cA>8>Ku{KSK&YdK9V9>wm{r{lDZ~TQKEV#_DTm^Q9QJTQk(09e}J&iu_$Xwit5r7*KPz)grH-eENcOTMAMsPOkZH}?Of z=opV#Ci&IpqMTbEskg9iHKZumt~MPH3z$Zf&4Ls0nl+Q0!>5!T0@CrF0OX5D$z24vjcA8atQY(B+UxB9CSVGl4MXTn$PbVcf@`}JTwo_J zh6Y4&!PXG#jpSHdg{$r#z_82P0XhGaA6-(R*vu|#T6y9XV&Y=Dbj5)u_##U*Hd^k- z-sLuo8hT_H- z6ubDj8CweJ*&=&772f*IxGEU|4U0IZKMPFzbnx7Qch#kjFvF zNk}bcYHIa9AI}XPK<$NodbOfAvtaXT`98s%c&WWIEiQ+Q8z4LO>p`BRof(SPRGICR z%FStMQJpFZC47#Qp-c){KIZ3U_2P5S)pBKl?pupo7Yel>6UatR=h>6A7D_T+_om|A zUq1TLV$!aqwYnbUxa7xV-gd;vkq-48Z&QZH{*kk|2(RwF&4yqETt2P0Pl}XTk;YOq_Tk|^7^3|{N$z>+1eb`3Sb*6ZFK(R73ytOT50BF< zd>#~4>UMuFu`U|-_W6ex=t?L&;=dUKCBFx60%qP;Mt8ahR&Az97TbJG>enX3^p{W- zDUtsQ&dmAOojGV;wodJQNEcP{V|Qy|+E)m)v!apP98EtM7Z#wsXiUXq~R@oHmk6&0S`yFPEiL3aya!k)Rbs-OH?d+{$ z4UwEZxMTg}69&Wr`~QTX+A_vx$RKK50NE_wJM((ce=}*>m5x>wj@#1O z*R2^#@ScP8MwE?bC7OY&B==rCnHU(i2TAGchY2u zpG}7iC5`IdQ8S@FaCCL&svW1IP5b%gRWp1VG;9p*hA2KhAP>}4(g%>IwI_C>sm5<5 zk&d;u?_vrI$n7>Z#xy~Jk&>RO^sUGpp`$1|qgk$W&7NOY{J&^yU~FJ}(N1Z5ZaJ}` z{9BMGp2kNnLZB7kLXp{ir48S4t^}(hYl%940auumYr%M|?0+$RC~}|O`-Lv;$`8bX ze6g+ifmm<#x2QXk8BNF@ReSuj0bJ&rU1!RX&tm-7*dWC{t<=YgmESGE#Cr=wsbv@Onsr6-c&!3LwR{x7HXq8?J!-n9eyqlxX`?^7&mxn32r zctg`uYRQZVM;yF(*wQe*p0qVowzJ00U0na?dSG3E^8(~NVEC0<7viJta$fTDyrcdN zTQ|;5nFom9t=*5-9pC&tMt`+^(tAA9(<~2%Yf)hWjfF!SVSif3nu%&9Ik5lwJAuwP z3};%+mo+LPG+fiq>9cbkg8VVm6U!`@-T3W~wN_NnOl40HhjZ3Lv-^pC)`%CmmDODp z@_lEWRkcpU$-m{yDF~^q=WO@S{=EkN`MY|RA%BsfGjK`8Lz76>t748SrUmi3-D>}2 zm$|vak^6_7=IocZJ9GXjqUJYcM#*5e-zKDs?nwjtqaz9OcFsD>R}_(E9hwE_I$F`| zhI<(R8`fr8H+5{&W9o1}+-H`{qJDF>EACWdV}*(n0SD=hu}I(JOB=# -// -// 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 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. - - -var pSlice = Array.prototype.slice; - -// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. - -var assert = exports; - -// 2. The AssertionError is defined in assert. -// new assert.AssertionError({message: message, actual: actual, expected: expected}) - -assert.AssertionError = function AssertionError (options) { - this.name = "AssertionError"; - this.message = options.message; - this.actual = options.actual; - this.expected = options.expected; - this.operator = options.operator; - var stackStartFunction = options.stackStartFunction || fail; - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, stackStartFunction); - } -}; -// code from util.inherits in node -assert.AssertionError.super_ = Error; - - -// EDITED FOR BROWSER COMPATIBILITY: replaced Object.create call -// TODO: test what effect this may have -var ctor = function () { this.constructor = assert.AssertionError; }; -ctor.prototype = Error.prototype; -assert.AssertionError.prototype = new ctor(); - - -assert.AssertionError.prototype.toString = function() { - if (this.message) { - return [this.name+":", this.message].join(' '); - } else { - return [ this.name+":" - , JSON.stringify(this.expected ) - , this.operator - , JSON.stringify(this.actual) - ].join(" "); - } -}; - -// assert.AssertionError instanceof Error - -assert.AssertionError.__proto__ = Error.prototype; - -// At present only the three keys mentioned above are used and -// understood by the spec. Implementations or sub modules can pass -// other keys to the AssertionError's constructor - they will be -// ignored. - -// 3. All of the following functions must throw an AssertionError -// when a corresponding condition is not met, with a message that -// may be undefined if not provided. All assertion methods provide -// both the actual and expected values to the assertion error for -// display purposes. - -function fail(actual, expected, message, operator, stackStartFunction) { - throw new assert.AssertionError({ - message: message, - actual: actual, - expected: expected, - operator: operator, - stackStartFunction: stackStartFunction - }); -} - -// EXTENSION! allows for well behaved errors defined elsewhere. -assert.fail = fail; - -// 4. Pure assertion tests whether a value is truthy, as determined -// by !!guard. -// assert.ok(guard, message_opt); -// This statement is equivalent to assert.equal(true, guard, -// message_opt);. To test strictly for the value true, use -// assert.strictEqual(true, guard, message_opt);. - -assert.ok = function ok(value, message) { - if (!!!value) fail(value, true, message, "==", assert.ok); -}; - -// 5. The equality assertion tests shallow, coercive equality with -// ==. -// assert.equal(actual, expected, message_opt); - -assert.equal = function equal(actual, expected, message) { - if (actual != expected) fail(actual, expected, message, "==", assert.equal); -}; - -// 6. The non-equality assertion tests for whether two objects are not equal -// with != assert.notEqual(actual, expected, message_opt); - -assert.notEqual = function notEqual(actual, expected, message) { - if (actual == expected) { - fail(actual, expected, message, "!=", assert.notEqual); - } -}; - -// 7. The equivalence assertion tests a deep equality relation. -// assert.deepEqual(actual, expected, message_opt); - -assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected)) { - fail(actual, expected, message, "deepEqual", assert.deepEqual); - } -}; - -function _deepEqual(actual, expected) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == "object", - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical "prototype" property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } -} - -function isUndefinedOrNull (value) { - return value === null || value === undefined; -} - -function isArguments (object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function objEquiv (a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical "prototype" property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b); - } - try{ - var ka = _keys(a), - kb = _keys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key] )) - return false; - } - return true; -} - -// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); - -assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected)) { - fail(actual, expected, message, "notDeepEqual", assert.notDeepEqual); - } -}; - -// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); - -assert.strictEqual = function strictEqual(actual, expected, message) { - if (actual !== expected) { - fail(actual, expected, message, "===", assert.strictEqual); - } -}; - -// 10. The strict non-equality assertion tests for strict inequality, as determined by !==. -// assert.notStrictEqual(actual, expected, message_opt); - -assert.notStrictEqual = function notStrictEqual(actual, expected, message) { - if (actual === expected) { - fail(actual, expected, message, "!==", assert.notStrictEqual); - } -}; - -function _throws (shouldThrow, block, err, message) { - var exception = null, - threw = false, - typematters = true; - - message = message || ""; - - //handle optional arguments - if (arguments.length == 3) { - if (typeof(err) == "string") { - message = err; - typematters = false; - } - } else if (arguments.length == 2) { - typematters = false; - } - - try { - block(); - } catch (e) { - threw = true; - exception = e; - } - - if (shouldThrow && !threw) { - fail( "Missing expected exception" - + (err && err.name ? " ("+err.name+")." : '.') - + (message ? " " + message : "") - ); - } - if (!shouldThrow && threw && typematters && exception instanceof err) { - fail( "Got unwanted exception" - + (err && err.name ? " ("+err.name+")." : '.') - + (message ? " " + message : "") - ); - } - if ((shouldThrow && threw && typematters && !(exception instanceof err)) || - (!shouldThrow && threw)) { - throw exception; - } -}; - -// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); - -assert.throws = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [true].concat(pSlice.call(arguments))); -}; - -// EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [false].concat(pSlice.call(arguments))); -}; - -assert.ifError = function (err) { if (err) {throw err;}}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/core.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/core.js deleted file mode 100644 index 981d7c6..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/core.js +++ /dev/null @@ -1,236 +0,0 @@ -/*! - * Nodeunit - * Copyright (c) 2010 Caolan McMahon - * MIT Licensed - * - * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS! - * You can use @REMOVE_LINE_FOR_BROWSER to remove code from the browser build. - * Only code on that line will be removed, its mostly to avoid requiring code - * that is node specific - */ - -/** - * Module dependencies - */ - -var async = require('../deps/async'), //@REMOVE_LINE_FOR_BROWSER - types = require('./types'); //@REMOVE_LINE_FOR_BROWSER - - -/** - * Added for browser compatibility - */ - -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; -}; - - -/** - * Runs a test function (fn) from a loaded module. After the test function - * calls test.done(), the callback is executed with an assertionList as its - * second argument. - * - * @param {String} name - * @param {Function} fn - * @param {Object} opt - * @param {Function} callback - * @api public - */ - -exports.runTest = function (name, fn, opt, callback) { - var options = types.options(opt); - - options.testStart(name); - var start = new Date().getTime(); - var test = types.test(name, start, options, callback); - - try { - fn(test); - } - catch (e) { - test.done(e); - } -}; - -/** - * Takes an object containing test functions or other test suites as properties - * and runs each in series. After all tests have completed, the callback is - * called with a list of all assertions as the second argument. - * - * If a name is passed to this function it is prepended to all test and suite - * names that run within it. - * - * @param {String} name - * @param {Object} suite - * @param {Object} opt - * @param {Function} callback - * @api public - */ - -exports.runSuite = function (name, suite, opt, callback) { - var keys = _keys(suite); - - async.concatSeries(keys, function (k, cb) { - var prop = suite[k], _name; - - _name = name ? [].concat(name, k) : [k]; - - _name.toString = function () { - // fallback for old one - return this.join(' - '); - }; - - if (typeof prop === 'function') { - exports.runTest(_name, suite[k], opt, cb); - } - else { - exports.runSuite(_name, suite[k], opt, cb); - } - }, callback); -}; - -/** - * Run each exported test function or test suite from a loaded module. - * - * @param {String} name - * @param {Object} mod - * @param {Object} opt - * @param {Function} callback - * @api public - */ - -exports.runModule = function (name, mod, opt, callback) { - var options = types.options(opt); - - options.moduleStart(name); - var start = new Date().getTime(); - - exports.runSuite(null, mod, opt, function (err, a_list) { - var end = new Date().getTime(); - var assertion_list = types.assertionList(a_list, end - start); - options.moduleDone(name, assertion_list); - callback(null, a_list); - }); -}; - -/** - * Treats an object literal as a list of modules keyed by name. Runs each - * module and finished with calling 'done'. You can think of this as a browser - * safe alternative to runFiles in the nodeunit module. - * - * @param {Object} modules - * @param {Object} opt - * @api public - */ - -// TODO: add proper unit tests for this function -exports.runModules = function (modules, opt) { - var all_assertions = []; - var options = types.options(opt); - var start = new Date().getTime(); - - async.concatSeries(_keys(modules), function (k, cb) { - exports.runModule(k, modules[k], options, cb); - }, - function (err, all_assertions) { - var end = new Date().getTime(); - options.done(types.assertionList(all_assertions, end - start)); - }); -}; - - -/** - * Wraps a test function with setUp and tearDown functions. - * Used by testCase. - * - * @param {Function} setUp - * @param {Function} tearDown - * @param {Function} fn - * @api private - */ - -var wrapTest = function (setUp, tearDown, fn) { - return function (test) { - var context = {}; - if (tearDown) { - var done = test.done; - test.done = function (err) { - try { - tearDown.call(context, function (err2) { - if (err && err2) { - test._assertion_list.push( - types.assertion({error: err}) - ); - return done(err2); - } - done(err || err2); - }); - } - catch (e) { - done(e); - } - }; - } - if (setUp) { - setUp.call(context, function (err) { - if (err) { - return test.done(err); - } - fn.call(context, test); - }); - } - else { - fn.call(context, test); - } - } -}; - - -/** - * Wraps a group of tests with setUp and tearDown functions. - * Used by testCase. - * - * @param {Function} setUp - * @param {Function} tearDown - * @param {Object} group - * @api private - */ - -var wrapGroup = function (setUp, tearDown, group) { - var tests = {}; - var keys = _keys(group); - for (var i=0; i(' + - '' + assertions.failures() + ', ' + - '' + assertions.passes() + ', ' + - assertions.length + - ')'; - test.className = assertions.failures() ? 'fail': 'pass'; - test.appendChild(strong); - - var aList = document.createElement('ol'); - aList.style.display = 'none'; - test.onclick = function () { - var d = aList.style.display; - aList.style.display = (d == 'none') ? 'block': 'none'; - }; - for (var i=0; i' + (a.error.stack || a.error) + ''; - li.className = 'fail'; - } - else { - li.innerHTML = a.message || a.method || 'no message'; - li.className = 'pass'; - } - aList.appendChild(li); - } - test.appendChild(aList); - tests.appendChild(test); - }, - done: function (assertions) { - var end = new Date().getTime(); - var duration = end - start; - - var failures = assertions.failures(); - banner.className = failures ? 'fail': 'pass'; - - result.innerHTML = 'Tests completed in ' + duration + - ' milliseconds.
          ' + - assertions.passes() + ' assertions of ' + - '' + assertions.length + ' passed, ' + - assertions.failures() + ' failed.'; - } - }); -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/default.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/default.js deleted file mode 100644 index c3d725d..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/default.js +++ /dev/null @@ -1,110 +0,0 @@ -/*! - * Nodeunit - * Copyright (c) 2010 Caolan McMahon - * MIT Licensed - */ - -/** - * Module dependencies - */ - -var nodeunit = require('../nodeunit'), - utils = require('../utils'), - fs = require('fs'), - sys = require('sys'), - path = require('path'); - AssertionError = require('../assert').AssertionError; - -/** - * Reporter info string - */ - -exports.info = "Default tests reporter"; - - -/** - * Run all tests within each module, reporting the results to the command-line. - * - * @param {Array} files - * @api public - */ - -exports.run = function (files, options) { - - if (!options) { - // load default options - var content = fs.readFileSync( - __dirname + '/../../bin/nodeunit.json', 'utf8' - ); - options = JSON.parse(content); - } - - var error = function (str) { - return options.error_prefix + str + options.error_suffix; - }; - var ok = function (str) { - return options.ok_prefix + str + options.ok_suffix; - }; - var bold = function (str) { - return options.bold_prefix + str + options.bold_suffix; - }; - var assertion_message = function (str) { - return options.assertion_prefix + str + options.assertion_suffix; - }; - - var start = new Date().getTime(); - var paths = files.map(function (p) { - return path.join(process.cwd(), p); - }); - - nodeunit.runFiles(paths, { - moduleStart: function (name) { - sys.puts('\n' + bold(name)); - }, - testDone: function (name, assertions) { - if (!assertions.failures()) { - sys.puts('✔ ' + name); - } - else { - sys.puts(error('✖ ' + name) + '\n'); - assertions.forEach(function (a) { - if (a.failed()) { - a = utils.betterErrors(a); - if (a.error instanceof AssertionError && a.message) { - sys.puts( - 'Assertion Message: ' + - assertion_message(a.message) - ); - } - sys.puts(a.error.stack + '\n'); - } - }); - } - }, - done: function (assertions) { - var end = new Date().getTime(); - var duration = end - start; - if (assertions.failures()) { - sys.puts( - '\n' + bold(error('FAILURES: ')) + assertions.failures() + - '/' + assertions.length + ' assertions failed (' + - assertions.duration + 'ms)' - ); - } - else { - sys.puts( - '\n' + bold(ok('OK: ')) + assertions.length + - ' assertions (' + assertions.duration + 'ms)' - ); - } - // alexgorbatchev 2010-11-10 :: should be able to flush stdout - // here, but doesn't seem to work, instead delay the exit to give - // enough to time flush. - // process.stdout.flush() - // process.stdout.end() - setTimeout(function () { - process.reallyExit(assertions.failures()); - }, 10); - } - }); -}; diff --git a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/html.js b/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/html.js deleted file mode 100644 index a693c2d..0000000 --- a/node_modules/express/node_modules/connect/node_modules/crc/tests/nodeunit/lib/reporters/html.js +++ /dev/null @@ -1,112 +0,0 @@ -/*! - * Nodeunit - * Copyright (c) 2010 Caolan McMahon - * MIT Licensed - */ - -/** - * Module dependencies - */ - -var nodeunit = require('../nodeunit'), - utils = require('../utils'), - fs = require('fs'), - sys = require('sys'), - path = require('path'), - AssertionError = require('assert').AssertionError; - -/** - * Reporter info string - */ - -exports.info = "Report tests result as HTML"; - -/** - * Run all tests within each module, reporting the results to the command-line. - * - * @param {Array} files - * @api public - */ - -exports.run = function (files, options) { - - var start = new Date().getTime(); - var paths = files.map(function (p) { - return path.join(process.cwd(), p); - }); - - sys.puts(''); - sys.puts(''); - sys.puts(''); - sys.puts(''); - sys.puts(''); - sys.puts(''); - nodeunit.runFiles(paths, { - moduleStart: function (name) { - sys.puts('