freezerwatch 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +40 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/freezerwatch +9 -0
- data/bin/setup +7 -0
- data/freezerwatch.gemspec +23 -0
- data/lib/freezerwatch.rb +5 -0
- data/lib/freezerwatch/version.rb +3 -0
- data/node_modules/.bin/freezerwatch +139 -0
- data/node_modules/freezerwatch/.npmignore +3 -0
- data/node_modules/freezerwatch/.ruby-version +1 -0
- data/node_modules/freezerwatch/Gemfile +4 -0
- data/node_modules/freezerwatch/Gemfile.lock +79 -0
- data/node_modules/freezerwatch/LICENSE +23 -0
- data/node_modules/freezerwatch/README.md +41 -0
- data/node_modules/freezerwatch/Rakefile +13 -0
- data/node_modules/freezerwatch/freezerwatch.js +139 -0
- data/node_modules/freezerwatch/metrics/bigfiles_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/cane_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/flay_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/flog_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/punchlist_high_water_mark +2 -0
- data/node_modules/freezerwatch/metrics/reek_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/rubocop_high_water_mark +1 -0
- data/node_modules/freezerwatch/node_modules/async/.jshintrc +25 -0
- data/node_modules/freezerwatch/node_modules/async/.travis.yml +6 -0
- data/node_modules/freezerwatch/node_modules/async/CHANGELOG.md +65 -0
- data/node_modules/freezerwatch/node_modules/async/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/async/README.md +1803 -0
- data/node_modules/freezerwatch/node_modules/async/bower.json +43 -0
- data/node_modules/freezerwatch/node_modules/async/component.json +17 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/base.css +182 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/base.css +182 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/lib/async.js.html +3900 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/lib/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/prettify.css +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/prettify.js +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/sorter.js +156 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov.info +1452 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lib/async.js.html +3597 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lib/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/prettify.css +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/prettify.js +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/sort-arrow-sprite.png +0 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/sorter.js +156 -0
- data/node_modules/freezerwatch/node_modules/async/lib/async.js +1191 -0
- data/node_modules/freezerwatch/node_modules/async/nyc_output/5074.json +1 -0
- data/node_modules/freezerwatch/node_modules/async/package.json +96 -0
- data/node_modules/freezerwatch/node_modules/async/support/sync-package-managers.js +53 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/.npmignore +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/Client.js +60 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/Device.js +38 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/DeviceRawReadStream.js +36 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/DeviceSingleRawReadStream.js +29 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/DeviceStream.js +35 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/LICENSE +23 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/README.md +25 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/.travis.yml +12 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/README.md +364 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/index.js +156 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/copy.js +8 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/debug.js +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/getSafe.js +34 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/optional.js +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/.bin/uuid +26 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/index.js +202 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/package.json +46 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/index.js +119 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/package.json +45 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/License +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/Readme.md +175 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/lib/form_data.js +351 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/README.md +1647 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/bower.json +38 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/component.json +16 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +1123 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/package.json +84 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js +53 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +132 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +188 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +154 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +99 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +42 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +38 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +21 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +14 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +48 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +13 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +13 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +60 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/package.json +80 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/Makefile +10 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/README.md +627 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/example/usage.js +78 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/images/hawk.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/images/logo.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/browser.js +485 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/client.js +367 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/crypto.js +111 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/index.js +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/server.js +524 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/utils.js +183 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/Makefile +11 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/README.md +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js +207 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/package.json +64 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js +245 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile +11 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js +68 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +65 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js +101 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE +33 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile +10 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/README.md +436 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js +132 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js +585 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js +86 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js +1078 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile +11 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/README.md +68 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js +16 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js +25 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js +409 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +65 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js +359 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/browser.js +771 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/client.js +206 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/crypto.js +86 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/index.js +316 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/message.js +246 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/readme.js +98 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/server.js +686 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/uri.js +456 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/utils.js +120 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/.dir-locals.el +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/.npmignore +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/LICENSE +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/README.md +79 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/http_signing.md +296 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/index.js +26 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/parser.js +304 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/signer.js +178 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/util.js +304 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/verify.js +42 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md +50 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js +13 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js +27 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js +267 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js +36 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js +317 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js +20 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +63 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js +172 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js +296 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md +126 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js +245 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +45 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG +78 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/README +82 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old +298 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js +245 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js +1485 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js +944 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype +241 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +42 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf +129 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle +839 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/package.json +72 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/.npmignore +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md +14 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/LICENSE +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/Makefile +35 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/README.md +52 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/package.json +68 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/stringify.js +27 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js +246 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/README.md +66 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/mime.js +114 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/package.json +57 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/test.js +84 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/types/mime.types +1588 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/types/node.types +77 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/LICENSE.md +21 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/README.md +243 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/README.md +53 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +174 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +34 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +34 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +84 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/bin/uuid +26 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/bower.json +23 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/component.json +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/package.json +65 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/compare_v1.js +63 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/test.html +17 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/test.js +228 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/uuid.js +247 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/index.js +43 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/package.json +48 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/test.js +49 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/.gitmodules +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/.npmignore +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/Readme.md +58 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/index.js +366 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/package.json +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/.jshintrc +72 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/.npmignore +3 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/LICENSE +78 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/README.md +380 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +230 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/cookie.js +947 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/memstore.js +102 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +69 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt +20 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md +176 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json +81 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js +530 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/package.json +63 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/public-suffix.txt +5229 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/test.js +1340 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/index.js +227 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/package.json +45 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/package.json +74 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/request.js +1244 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/package.json +34 -0
- data/node_modules/freezerwatch/node_modules/optparse/README.md +163 -0
- data/node_modules/freezerwatch/node_modules/optparse/TODO +1 -0
- data/node_modules/freezerwatch/node_modules/optparse/examples/browser-test.html +75 -0
- data/node_modules/freezerwatch/node_modules/optparse/examples/nodejs-test.js +86 -0
- data/node_modules/freezerwatch/node_modules/optparse/lib/optparse.js +309 -0
- data/node_modules/freezerwatch/node_modules/optparse/package.json +46 -0
- data/node_modules/freezerwatch/node_modules/optparse/seed.yml +5 -0
- data/node_modules/freezerwatch/node_modules/osenv/.npmignore +13 -0
- data/node_modules/freezerwatch/node_modules/osenv/.travis.yml +9 -0
- data/node_modules/freezerwatch/node_modules/osenv/LICENSE +15 -0
- data/node_modules/freezerwatch/node_modules/osenv/README.md +63 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/index.js +24 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/license +21 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/readme.md +33 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/index.js +25 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/license +21 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/readme.md +36 -0
- data/node_modules/freezerwatch/node_modules/osenv/osenv.js +72 -0
- data/node_modules/freezerwatch/node_modules/osenv/package.json +76 -0
- data/node_modules/freezerwatch/node_modules/osenv/test/unix.js +71 -0
- data/node_modules/freezerwatch/node_modules/osenv/test/windows.js +74 -0
- data/node_modules/freezerwatch/node_modules/osenv/x.tap +39 -0
- data/node_modules/freezerwatch/package.json +37 -0
- metadata +384 -0
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
module.exports = require('./lib');
|
@@ -0,0 +1,132 @@
|
|
1
|
+
// Declare internals
|
2
|
+
|
3
|
+
var internals = {};
|
4
|
+
|
5
|
+
|
6
|
+
exports.escapeJavaScript = function (input) {
|
7
|
+
|
8
|
+
if (!input) {
|
9
|
+
return '';
|
10
|
+
}
|
11
|
+
|
12
|
+
var escaped = '';
|
13
|
+
|
14
|
+
for (var i = 0, il = input.length; i < il; ++i) {
|
15
|
+
|
16
|
+
var charCode = input.charCodeAt(i);
|
17
|
+
|
18
|
+
if (internals.isSafe(charCode)) {
|
19
|
+
escaped += input[i];
|
20
|
+
}
|
21
|
+
else {
|
22
|
+
escaped += internals.escapeJavaScriptChar(charCode);
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
return escaped;
|
27
|
+
};
|
28
|
+
|
29
|
+
|
30
|
+
exports.escapeHtml = function (input) {
|
31
|
+
|
32
|
+
if (!input) {
|
33
|
+
return '';
|
34
|
+
}
|
35
|
+
|
36
|
+
var escaped = '';
|
37
|
+
|
38
|
+
for (var i = 0, il = input.length; i < il; ++i) {
|
39
|
+
|
40
|
+
var charCode = input.charCodeAt(i);
|
41
|
+
|
42
|
+
if (internals.isSafe(charCode)) {
|
43
|
+
escaped += input[i];
|
44
|
+
}
|
45
|
+
else {
|
46
|
+
escaped += internals.escapeHtmlChar(charCode);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
return escaped;
|
51
|
+
};
|
52
|
+
|
53
|
+
|
54
|
+
internals.escapeJavaScriptChar = function (charCode) {
|
55
|
+
|
56
|
+
if (charCode >= 256) {
|
57
|
+
return '\\u' + internals.padLeft('' + charCode, 4);
|
58
|
+
}
|
59
|
+
|
60
|
+
var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
|
61
|
+
return '\\x' + internals.padLeft(hexValue, 2);
|
62
|
+
};
|
63
|
+
|
64
|
+
|
65
|
+
internals.escapeHtmlChar = function (charCode) {
|
66
|
+
|
67
|
+
var namedEscape = internals.namedHtml[charCode];
|
68
|
+
if (typeof namedEscape !== 'undefined') {
|
69
|
+
return namedEscape;
|
70
|
+
}
|
71
|
+
|
72
|
+
if (charCode >= 256) {
|
73
|
+
return '&#' + charCode + ';';
|
74
|
+
}
|
75
|
+
|
76
|
+
var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
|
77
|
+
return '&#x' + internals.padLeft(hexValue, 2) + ';';
|
78
|
+
};
|
79
|
+
|
80
|
+
|
81
|
+
internals.padLeft = function (str, len) {
|
82
|
+
|
83
|
+
while (str.length < len) {
|
84
|
+
str = '0' + str;
|
85
|
+
}
|
86
|
+
|
87
|
+
return str;
|
88
|
+
};
|
89
|
+
|
90
|
+
|
91
|
+
internals.isSafe = function (charCode) {
|
92
|
+
|
93
|
+
return (typeof internals.safeCharCodes[charCode] !== 'undefined');
|
94
|
+
};
|
95
|
+
|
96
|
+
|
97
|
+
internals.namedHtml = {
|
98
|
+
'38': '&',
|
99
|
+
'60': '<',
|
100
|
+
'62': '>',
|
101
|
+
'34': '"',
|
102
|
+
'160': ' ',
|
103
|
+
'162': '¢',
|
104
|
+
'163': '£',
|
105
|
+
'164': '¤',
|
106
|
+
'169': '©',
|
107
|
+
'174': '®'
|
108
|
+
};
|
109
|
+
|
110
|
+
|
111
|
+
internals.safeCharCodes = (function () {
|
112
|
+
|
113
|
+
var safe = {};
|
114
|
+
|
115
|
+
for (var i = 32; i < 123; ++i) {
|
116
|
+
|
117
|
+
if ((i >= 97 && i <= 122) || // a-z
|
118
|
+
(i >= 65 && i <= 90) || // A-Z
|
119
|
+
(i >= 48 && i <= 57) || // 0-9
|
120
|
+
i === 32 || // space
|
121
|
+
i === 46 || // .
|
122
|
+
i === 44 || // ,
|
123
|
+
i === 45 || // -
|
124
|
+
i === 58 || // :
|
125
|
+
i === 95) { // _
|
126
|
+
|
127
|
+
safe[i] = null;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
return safe;
|
132
|
+
}());
|
@@ -0,0 +1,585 @@
|
|
1
|
+
// Load modules
|
2
|
+
|
3
|
+
var Fs = require('fs');
|
4
|
+
var Escape = require('./escape');
|
5
|
+
|
6
|
+
|
7
|
+
// Declare internals
|
8
|
+
|
9
|
+
var internals = {};
|
10
|
+
|
11
|
+
|
12
|
+
// Clone object or array
|
13
|
+
|
14
|
+
exports.clone = function (obj, seen) {
|
15
|
+
|
16
|
+
if (typeof obj !== 'object' ||
|
17
|
+
obj === null) {
|
18
|
+
|
19
|
+
return obj;
|
20
|
+
}
|
21
|
+
|
22
|
+
seen = seen || { orig: [], copy: [] };
|
23
|
+
|
24
|
+
var lookup = seen.orig.indexOf(obj);
|
25
|
+
if (lookup !== -1) {
|
26
|
+
return seen.copy[lookup];
|
27
|
+
}
|
28
|
+
|
29
|
+
var newObj = (obj instanceof Array) ? [] : {};
|
30
|
+
|
31
|
+
seen.orig.push(obj);
|
32
|
+
seen.copy.push(newObj);
|
33
|
+
|
34
|
+
for (var i in obj) {
|
35
|
+
if (obj.hasOwnProperty(i)) {
|
36
|
+
if (obj[i] instanceof Buffer) {
|
37
|
+
newObj[i] = new Buffer(obj[i]);
|
38
|
+
}
|
39
|
+
else if (obj[i] instanceof Date) {
|
40
|
+
newObj[i] = new Date(obj[i].getTime());
|
41
|
+
}
|
42
|
+
else if (obj[i] instanceof RegExp) {
|
43
|
+
var flags = '' + (obj[i].global ? 'g' : '') + (obj[i].ignoreCase ? 'i' : '') + (obj[i].multiline ? 'm' : '');
|
44
|
+
newObj[i] = new RegExp(obj[i].source, flags);
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
newObj[i] = exports.clone(obj[i], seen);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
return newObj;
|
53
|
+
};
|
54
|
+
|
55
|
+
|
56
|
+
// Merge all the properties of source into target, source wins in conflic, and by default null and undefined from source are applied
|
57
|
+
|
58
|
+
exports.merge = function (target, source, isNullOverride /* = true */, isMergeArrays /* = true */) {
|
59
|
+
|
60
|
+
exports.assert(target && typeof target == 'object', 'Invalid target value: must be an object');
|
61
|
+
exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object');
|
62
|
+
|
63
|
+
if (!source) {
|
64
|
+
return target;
|
65
|
+
}
|
66
|
+
|
67
|
+
if (source instanceof Array) {
|
68
|
+
exports.assert(target instanceof Array, 'Cannot merge array onto an object');
|
69
|
+
if (isMergeArrays === false) { // isMergeArrays defaults to true
|
70
|
+
target.length = 0; // Must not change target assignment
|
71
|
+
}
|
72
|
+
|
73
|
+
for (var i = 0, il = source.length; i < il; ++i) {
|
74
|
+
target.push(source[i]);
|
75
|
+
}
|
76
|
+
|
77
|
+
return target;
|
78
|
+
}
|
79
|
+
|
80
|
+
var keys = Object.keys(source);
|
81
|
+
for (var k = 0, kl = keys.length; k < kl; ++k) {
|
82
|
+
var key = keys[k];
|
83
|
+
var value = source[key];
|
84
|
+
if (value &&
|
85
|
+
typeof value === 'object') {
|
86
|
+
|
87
|
+
if (!target[key] ||
|
88
|
+
typeof target[key] !== 'object') {
|
89
|
+
|
90
|
+
target[key] = exports.clone(value);
|
91
|
+
}
|
92
|
+
else {
|
93
|
+
exports.merge(target[key], source[key], isNullOverride, isMergeArrays);
|
94
|
+
}
|
95
|
+
}
|
96
|
+
else {
|
97
|
+
if (value !== null && value !== undefined) { // Explicit to preserve empty strings
|
98
|
+
target[key] = value;
|
99
|
+
}
|
100
|
+
else if (isNullOverride !== false) { // Defaults to true
|
101
|
+
target[key] = value;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
return target;
|
107
|
+
};
|
108
|
+
|
109
|
+
|
110
|
+
// Apply options to a copy of the defaults
|
111
|
+
|
112
|
+
exports.applyToDefaults = function (defaults, options) {
|
113
|
+
|
114
|
+
exports.assert(defaults && typeof defaults == 'object', 'Invalid defaults value: must be an object');
|
115
|
+
exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object');
|
116
|
+
|
117
|
+
if (!options) { // If no options, return null
|
118
|
+
return null;
|
119
|
+
}
|
120
|
+
|
121
|
+
var copy = exports.clone(defaults);
|
122
|
+
|
123
|
+
if (options === true) { // If options is set to true, use defaults
|
124
|
+
return copy;
|
125
|
+
}
|
126
|
+
|
127
|
+
return exports.merge(copy, options, false, false);
|
128
|
+
};
|
129
|
+
|
130
|
+
|
131
|
+
// Remove duplicate items from array
|
132
|
+
|
133
|
+
exports.unique = function (array, key) {
|
134
|
+
|
135
|
+
var index = {};
|
136
|
+
var result = [];
|
137
|
+
|
138
|
+
for (var i = 0, il = array.length; i < il; ++i) {
|
139
|
+
var id = (key ? array[i][key] : array[i]);
|
140
|
+
if (index[id] !== true) {
|
141
|
+
|
142
|
+
result.push(array[i]);
|
143
|
+
index[id] = true;
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
return result;
|
148
|
+
};
|
149
|
+
|
150
|
+
|
151
|
+
// Convert array into object
|
152
|
+
|
153
|
+
exports.mapToObject = function (array, key) {
|
154
|
+
|
155
|
+
if (!array) {
|
156
|
+
return null;
|
157
|
+
}
|
158
|
+
|
159
|
+
var obj = {};
|
160
|
+
for (var i = 0, il = array.length; i < il; ++i) {
|
161
|
+
if (key) {
|
162
|
+
if (array[i][key]) {
|
163
|
+
obj[array[i][key]] = true;
|
164
|
+
}
|
165
|
+
}
|
166
|
+
else {
|
167
|
+
obj[array[i]] = true;
|
168
|
+
}
|
169
|
+
}
|
170
|
+
|
171
|
+
return obj;
|
172
|
+
};
|
173
|
+
|
174
|
+
|
175
|
+
// Find the common unique items in two arrays
|
176
|
+
|
177
|
+
exports.intersect = function (array1, array2, justFirst) {
|
178
|
+
|
179
|
+
if (!array1 || !array2) {
|
180
|
+
return [];
|
181
|
+
}
|
182
|
+
|
183
|
+
var common = [];
|
184
|
+
var hash = (array1 instanceof Array ? exports.mapToObject(array1) : array1);
|
185
|
+
var found = {};
|
186
|
+
for (var i = 0, il = array2.length; i < il; ++i) {
|
187
|
+
if (hash[array2[i]] && !found[array2[i]]) {
|
188
|
+
if (justFirst) {
|
189
|
+
return array2[i];
|
190
|
+
}
|
191
|
+
|
192
|
+
common.push(array2[i]);
|
193
|
+
found[array2[i]] = true;
|
194
|
+
}
|
195
|
+
}
|
196
|
+
|
197
|
+
return (justFirst ? null : common);
|
198
|
+
};
|
199
|
+
|
200
|
+
|
201
|
+
// Find which keys are present
|
202
|
+
|
203
|
+
exports.matchKeys = function (obj, keys) {
|
204
|
+
|
205
|
+
var matched = [];
|
206
|
+
for (var i = 0, il = keys.length; i < il; ++i) {
|
207
|
+
if (obj.hasOwnProperty(keys[i])) {
|
208
|
+
matched.push(keys[i]);
|
209
|
+
}
|
210
|
+
}
|
211
|
+
return matched;
|
212
|
+
};
|
213
|
+
|
214
|
+
|
215
|
+
// Flatten array
|
216
|
+
|
217
|
+
exports.flatten = function (array, target) {
|
218
|
+
|
219
|
+
var result = target || [];
|
220
|
+
|
221
|
+
for (var i = 0, il = array.length; i < il; ++i) {
|
222
|
+
if (Array.isArray(array[i])) {
|
223
|
+
exports.flatten(array[i], result);
|
224
|
+
}
|
225
|
+
else {
|
226
|
+
result.push(array[i]);
|
227
|
+
}
|
228
|
+
}
|
229
|
+
|
230
|
+
return result;
|
231
|
+
};
|
232
|
+
|
233
|
+
|
234
|
+
// Remove keys
|
235
|
+
|
236
|
+
exports.removeKeys = function (object, keys) {
|
237
|
+
|
238
|
+
for (var i = 0, il = keys.length; i < il; i++) {
|
239
|
+
delete object[keys[i]];
|
240
|
+
}
|
241
|
+
};
|
242
|
+
|
243
|
+
|
244
|
+
// Convert an object key chain string ('a.b.c') to reference (object[a][b][c])
|
245
|
+
|
246
|
+
exports.reach = function (obj, chain) {
|
247
|
+
|
248
|
+
var path = chain.split('.');
|
249
|
+
var ref = obj;
|
250
|
+
for (var i = 0, il = path.length; i < il; ++i) {
|
251
|
+
if (ref) {
|
252
|
+
ref = ref[path[i]];
|
253
|
+
}
|
254
|
+
}
|
255
|
+
|
256
|
+
return ref;
|
257
|
+
};
|
258
|
+
|
259
|
+
|
260
|
+
// Inherits a selected set of methods from an object, wrapping functions in asynchronous syntax and catching errors
|
261
|
+
|
262
|
+
exports.inheritAsync = function (self, obj, keys) {
|
263
|
+
|
264
|
+
keys = keys || null;
|
265
|
+
|
266
|
+
for (var i in obj) {
|
267
|
+
if (obj.hasOwnProperty(i)) {
|
268
|
+
if (keys instanceof Array &&
|
269
|
+
keys.indexOf(i) < 0) {
|
270
|
+
|
271
|
+
continue;
|
272
|
+
}
|
273
|
+
|
274
|
+
self.prototype[i] = (function (fn) {
|
275
|
+
|
276
|
+
return function (next) {
|
277
|
+
|
278
|
+
var result = null;
|
279
|
+
try {
|
280
|
+
result = fn();
|
281
|
+
}
|
282
|
+
catch (err) {
|
283
|
+
return next(err);
|
284
|
+
}
|
285
|
+
|
286
|
+
return next(null, result);
|
287
|
+
};
|
288
|
+
})(obj[i]);
|
289
|
+
}
|
290
|
+
}
|
291
|
+
};
|
292
|
+
|
293
|
+
|
294
|
+
exports.formatStack = function (stack) {
|
295
|
+
|
296
|
+
var trace = [];
|
297
|
+
for (var i = 0, il = stack.length; i < il; ++i) {
|
298
|
+
var item = stack[i];
|
299
|
+
trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]);
|
300
|
+
}
|
301
|
+
|
302
|
+
return trace;
|
303
|
+
};
|
304
|
+
|
305
|
+
|
306
|
+
exports.formatTrace = function (trace) {
|
307
|
+
|
308
|
+
var display = [];
|
309
|
+
|
310
|
+
for (var i = 0, il = trace.length; i < il; ++i) {
|
311
|
+
var row = trace[i];
|
312
|
+
display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')');
|
313
|
+
}
|
314
|
+
|
315
|
+
return display;
|
316
|
+
};
|
317
|
+
|
318
|
+
|
319
|
+
exports.callStack = function (slice) {
|
320
|
+
|
321
|
+
// http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
|
322
|
+
|
323
|
+
var v8 = Error.prepareStackTrace;
|
324
|
+
Error.prepareStackTrace = function (err, stack) {
|
325
|
+
|
326
|
+
return stack;
|
327
|
+
};
|
328
|
+
|
329
|
+
var capture = {};
|
330
|
+
Error.captureStackTrace(capture, arguments.callee);
|
331
|
+
var stack = capture.stack;
|
332
|
+
|
333
|
+
Error.prepareStackTrace = v8;
|
334
|
+
|
335
|
+
var trace = exports.formatStack(stack);
|
336
|
+
|
337
|
+
if (slice) {
|
338
|
+
return trace.slice(slice);
|
339
|
+
}
|
340
|
+
|
341
|
+
return trace;
|
342
|
+
};
|
343
|
+
|
344
|
+
|
345
|
+
exports.displayStack = function (slice) {
|
346
|
+
|
347
|
+
var trace = exports.callStack(slice === undefined ? 1 : slice + 1);
|
348
|
+
|
349
|
+
return exports.formatTrace(trace);
|
350
|
+
};
|
351
|
+
|
352
|
+
|
353
|
+
exports.abortThrow = false;
|
354
|
+
|
355
|
+
|
356
|
+
exports.abort = function (message, hideStack) {
|
357
|
+
|
358
|
+
if (process.env.NODE_ENV === 'test' || exports.abortThrow === true) {
|
359
|
+
throw new Error(message || 'Unknown error');
|
360
|
+
}
|
361
|
+
|
362
|
+
var stack = '';
|
363
|
+
if (!hideStack) {
|
364
|
+
stack = exports.displayStack(1).join('\n\t');
|
365
|
+
}
|
366
|
+
console.log('ABORT: ' + message + '\n\t' + stack);
|
367
|
+
process.exit(1);
|
368
|
+
};
|
369
|
+
|
370
|
+
|
371
|
+
exports.assert = function (condition /*, msg1, msg2, msg3 */) {
|
372
|
+
|
373
|
+
if (condition) {
|
374
|
+
return;
|
375
|
+
}
|
376
|
+
|
377
|
+
var msgs = Array.prototype.slice.call(arguments, 1);
|
378
|
+
msgs = msgs.map(function (msg) {
|
379
|
+
|
380
|
+
return typeof msg === 'string' ? msg : msg instanceof Error ? msg.message : JSON.stringify(msg);
|
381
|
+
});
|
382
|
+
throw new Error(msgs.join(' ') || 'Unknown error');
|
383
|
+
};
|
384
|
+
|
385
|
+
|
386
|
+
exports.loadDirModules = function (path, excludeFiles, target) { // target(filename, name, capName)
|
387
|
+
|
388
|
+
var exclude = {};
|
389
|
+
for (var i = 0, il = excludeFiles.length; i < il; ++i) {
|
390
|
+
exclude[excludeFiles[i] + '.js'] = true;
|
391
|
+
}
|
392
|
+
|
393
|
+
var files = Fs.readdirSync(path);
|
394
|
+
for (i = 0, il = files.length; i < il; ++i) {
|
395
|
+
var filename = files[i];
|
396
|
+
if (/\.js$/.test(filename) &&
|
397
|
+
!exclude[filename]) {
|
398
|
+
|
399
|
+
var name = filename.substr(0, filename.lastIndexOf('.'));
|
400
|
+
var capName = name.charAt(0).toUpperCase() + name.substr(1).toLowerCase();
|
401
|
+
|
402
|
+
if (typeof target !== 'function') {
|
403
|
+
target[capName] = require(path + '/' + name);
|
404
|
+
}
|
405
|
+
else {
|
406
|
+
target(path + '/' + name, name, capName);
|
407
|
+
}
|
408
|
+
}
|
409
|
+
}
|
410
|
+
};
|
411
|
+
|
412
|
+
|
413
|
+
exports.rename = function (obj, from, to) {
|
414
|
+
|
415
|
+
obj[to] = obj[from];
|
416
|
+
delete obj[from];
|
417
|
+
};
|
418
|
+
|
419
|
+
|
420
|
+
exports.Timer = function () {
|
421
|
+
|
422
|
+
this.reset();
|
423
|
+
};
|
424
|
+
|
425
|
+
|
426
|
+
exports.Timer.prototype.reset = function () {
|
427
|
+
|
428
|
+
this.ts = Date.now();
|
429
|
+
};
|
430
|
+
|
431
|
+
|
432
|
+
exports.Timer.prototype.elapsed = function () {
|
433
|
+
|
434
|
+
return Date.now() - this.ts;
|
435
|
+
};
|
436
|
+
|
437
|
+
|
438
|
+
// Load and parse package.json process root or given directory
|
439
|
+
|
440
|
+
exports.loadPackage = function (dir) {
|
441
|
+
|
442
|
+
var result = {};
|
443
|
+
var filepath = (dir || process.env.PWD) + '/package.json';
|
444
|
+
if (Fs.existsSync(filepath)) {
|
445
|
+
try {
|
446
|
+
result = JSON.parse(Fs.readFileSync(filepath));
|
447
|
+
}
|
448
|
+
catch (e) { }
|
449
|
+
}
|
450
|
+
|
451
|
+
return result;
|
452
|
+
};
|
453
|
+
|
454
|
+
|
455
|
+
// Escape string for Regex construction
|
456
|
+
|
457
|
+
exports.escapeRegex = function (string) {
|
458
|
+
|
459
|
+
// Escape ^$.*+-?=!:|\/()[]{},
|
460
|
+
return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&');
|
461
|
+
};
|
462
|
+
|
463
|
+
|
464
|
+
// Return an error as first argument of a callback
|
465
|
+
|
466
|
+
exports.toss = function (condition /*, [message], next */) {
|
467
|
+
|
468
|
+
var message = (arguments.length === 3 ? arguments[1] : '');
|
469
|
+
var next = (arguments.length === 3 ? arguments[2] : arguments[1]);
|
470
|
+
|
471
|
+
var err = (message instanceof Error ? message : (message ? new Error(message) : (condition instanceof Error ? condition : new Error())));
|
472
|
+
|
473
|
+
if (condition instanceof Error ||
|
474
|
+
!condition) {
|
475
|
+
|
476
|
+
return next(err);
|
477
|
+
}
|
478
|
+
};
|
479
|
+
|
480
|
+
|
481
|
+
// Base64url (RFC 4648) encode
|
482
|
+
|
483
|
+
exports.base64urlEncode = function (value) {
|
484
|
+
|
485
|
+
return (new Buffer(value, 'binary')).toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
|
486
|
+
};
|
487
|
+
|
488
|
+
|
489
|
+
// Base64url (RFC 4648) decode
|
490
|
+
|
491
|
+
exports.base64urlDecode = function (encoded) {
|
492
|
+
|
493
|
+
if (encoded &&
|
494
|
+
!encoded.match(/^[\w\-]*$/)) {
|
495
|
+
|
496
|
+
return new Error('Invalid character');
|
497
|
+
}
|
498
|
+
|
499
|
+
try {
|
500
|
+
return (new Buffer(encoded.replace(/-/g, '+').replace(/:/g, '/'), 'base64')).toString('binary');
|
501
|
+
}
|
502
|
+
catch (err) {
|
503
|
+
return err;
|
504
|
+
}
|
505
|
+
};
|
506
|
+
|
507
|
+
|
508
|
+
// Escape attribute value for use in HTTP header
|
509
|
+
|
510
|
+
exports.escapeHeaderAttribute = function (attribute) {
|
511
|
+
|
512
|
+
// Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, "
|
513
|
+
|
514
|
+
exports.assert(attribute.match(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/), 'Bad attribute value (' + attribute + ')');
|
515
|
+
|
516
|
+
return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); // Escape quotes and slash
|
517
|
+
};
|
518
|
+
|
519
|
+
|
520
|
+
exports.escapeHtml = function (string) {
|
521
|
+
|
522
|
+
return Escape.escapeHtml(string);
|
523
|
+
};
|
524
|
+
|
525
|
+
|
526
|
+
exports.escapeJavaScript = function (string) {
|
527
|
+
|
528
|
+
return Escape.escapeJavaScript(string);
|
529
|
+
};
|
530
|
+
|
531
|
+
|
532
|
+
/*
|
533
|
+
var event = {
|
534
|
+
timestamp: now.getTime(),
|
535
|
+
tags: ['tag'],
|
536
|
+
data: { some: 'data' }
|
537
|
+
};
|
538
|
+
*/
|
539
|
+
|
540
|
+
exports.consoleFunc = console.log;
|
541
|
+
|
542
|
+
exports.printEvent = function (event) {
|
543
|
+
|
544
|
+
var pad = function (value) {
|
545
|
+
|
546
|
+
return (value < 10 ? '0' : '') + value;
|
547
|
+
};
|
548
|
+
|
549
|
+
var now = new Date(event.timestamp);
|
550
|
+
var timestring = (now.getYear() - 100).toString() +
|
551
|
+
pad(now.getMonth() + 1) +
|
552
|
+
pad(now.getDate()) +
|
553
|
+
'/' +
|
554
|
+
pad(now.getHours()) +
|
555
|
+
pad(now.getMinutes()) +
|
556
|
+
pad(now.getSeconds()) +
|
557
|
+
'.' +
|
558
|
+
now.getMilliseconds();
|
559
|
+
|
560
|
+
var data = event.data;
|
561
|
+
if (typeof event.data !== 'string') {
|
562
|
+
try {
|
563
|
+
data = JSON.stringify(event.data);
|
564
|
+
}
|
565
|
+
catch (e) {
|
566
|
+
data = 'JSON Error: ' + e.message;
|
567
|
+
}
|
568
|
+
}
|
569
|
+
|
570
|
+
var output = timestring + ', ' + event.tags[0] + ', ' + data;
|
571
|
+
exports.consoleFunc(output);
|
572
|
+
};
|
573
|
+
|
574
|
+
|
575
|
+
exports.nextTick = function (callback) {
|
576
|
+
|
577
|
+
return function () {
|
578
|
+
|
579
|
+
var args = arguments;
|
580
|
+
process.nextTick(function () {
|
581
|
+
|
582
|
+
callback.apply(null, args);
|
583
|
+
});
|
584
|
+
};
|
585
|
+
};
|