postdoc 0.1.2 → 0.2.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/pdf.js +27 -0
- data/lib/postdoc.rb +3 -7
- data/node_modules/agent-base/History.md +113 -0
- data/node_modules/agent-base/README.md +145 -0
- data/node_modules/agent-base/index.js +160 -0
- data/node_modules/agent-base/package.json +35 -0
- data/node_modules/agent-base/patch-core.js +37 -0
- data/node_modules/agent-base/test/ssl-cert-snakeoil.key +15 -0
- data/node_modules/agent-base/test/ssl-cert-snakeoil.pem +12 -0
- data/node_modules/agent-base/test/test.js +673 -0
- data/node_modules/async-limiter/LICENSE +8 -0
- data/node_modules/async-limiter/coverage/coverage.json +1 -0
- data/node_modules/async-limiter/coverage/lcov-report/async-throttle/index.html +73 -0
- data/node_modules/async-limiter/coverage/lcov-report/async-throttle/index.js.html +246 -0
- data/node_modules/async-limiter/coverage/lcov-report/base.css +182 -0
- data/node_modules/async-limiter/coverage/lcov-report/index.html +73 -0
- data/node_modules/async-limiter/coverage/lcov-report/prettify.css +1 -0
- data/node_modules/async-limiter/coverage/lcov-report/prettify.js +1 -0
- data/node_modules/async-limiter/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- data/node_modules/async-limiter/coverage/lcov-report/sorter.js +156 -0
- data/node_modules/async-limiter/coverage/lcov.info +74 -0
- data/node_modules/async-limiter/index.js +67 -0
- data/node_modules/async-limiter/package.json +35 -0
- data/node_modules/async-limiter/readme.md +132 -0
- data/node_modules/balanced-match/LICENSE.md +21 -0
- data/node_modules/balanced-match/README.md +91 -0
- data/node_modules/balanced-match/index.js +59 -0
- data/node_modules/balanced-match/package.json +49 -0
- data/node_modules/brace-expansion/LICENSE +21 -0
- data/node_modules/brace-expansion/README.md +129 -0
- data/node_modules/brace-expansion/index.js +201 -0
- data/node_modules/brace-expansion/package.json +47 -0
- data/node_modules/buffer-from/index.js +69 -0
- data/node_modules/buffer-from/package.json +16 -0
- data/node_modules/buffer-from/readme.md +69 -0
- data/node_modules/buffer-from/test.js +12 -0
- data/node_modules/concat-map/LICENSE +18 -0
- data/node_modules/concat-map/README.markdown +62 -0
- data/node_modules/concat-map/example/map.js +6 -0
- data/node_modules/concat-map/index.js +13 -0
- data/node_modules/concat-map/package.json +43 -0
- data/node_modules/concat-map/test/map.js +39 -0
- data/node_modules/concat-stream/LICENSE +24 -0
- data/node_modules/concat-stream/index.js +144 -0
- data/node_modules/concat-stream/package.json +55 -0
- data/node_modules/concat-stream/readme.md +102 -0
- data/node_modules/core-util-is/LICENSE +19 -0
- data/node_modules/core-util-is/README.md +3 -0
- data/node_modules/core-util-is/float.patch +604 -0
- data/node_modules/core-util-is/lib/util.js +107 -0
- data/node_modules/core-util-is/package.json +32 -0
- data/node_modules/core-util-is/test.js +68 -0
- data/node_modules/debug/CHANGELOG.md +395 -0
- data/node_modules/debug/LICENSE +19 -0
- data/node_modules/debug/Makefile +58 -0
- data/node_modules/debug/README.md +368 -0
- data/node_modules/debug/karma.conf.js +70 -0
- data/node_modules/debug/node.js +1 -0
- data/node_modules/debug/package.json +43 -0
- data/node_modules/debug/src/browser.js +195 -0
- data/node_modules/debug/src/debug.js +225 -0
- data/node_modules/debug/src/index.js +10 -0
- data/node_modules/debug/src/node.js +186 -0
- data/node_modules/es6-promise/CHANGELOG.md +151 -0
- data/node_modules/es6-promise/LICENSE +19 -0
- data/node_modules/es6-promise/README.md +97 -0
- data/node_modules/es6-promise/auto.js +4 -0
- data/node_modules/es6-promise/dist/es6-promise.auto.js +1181 -0
- data/node_modules/es6-promise/dist/es6-promise.auto.map +1 -0
- data/node_modules/es6-promise/dist/es6-promise.auto.min.js +1 -0
- data/node_modules/es6-promise/dist/es6-promise.auto.min.map +1 -0
- data/node_modules/es6-promise/dist/es6-promise.js +1179 -0
- data/node_modules/es6-promise/dist/es6-promise.map +1 -0
- data/node_modules/es6-promise/dist/es6-promise.min.js +1 -0
- data/node_modules/es6-promise/dist/es6-promise.min.map +1 -0
- data/node_modules/es6-promise/es6-promise.d.ts +81 -0
- data/node_modules/es6-promise/lib/es6-promise/-internal.js +266 -0
- data/node_modules/es6-promise/lib/es6-promise/asap.js +119 -0
- data/node_modules/es6-promise/lib/es6-promise/enumerator.js +113 -0
- data/node_modules/es6-promise/lib/es6-promise/polyfill.js +35 -0
- data/node_modules/es6-promise/lib/es6-promise/promise/all.js +52 -0
- data/node_modules/es6-promise/lib/es6-promise/promise/race.js +84 -0
- data/node_modules/es6-promise/lib/es6-promise/promise/reject.js +46 -0
- data/node_modules/es6-promise/lib/es6-promise/promise/resolve.js +48 -0
- data/node_modules/es6-promise/lib/es6-promise/promise.js +427 -0
- data/node_modules/es6-promise/lib/es6-promise/then.js +32 -0
- data/node_modules/es6-promise/lib/es6-promise/utils.js +21 -0
- data/node_modules/es6-promise/lib/es6-promise.auto.js +3 -0
- data/node_modules/es6-promise/lib/es6-promise.js +7 -0
- data/node_modules/es6-promise/package.json +75 -0
- data/node_modules/es6-promisify/README.md +89 -0
- data/node_modules/es6-promisify/dist/promise.js +73 -0
- data/node_modules/es6-promisify/dist/promisify.js +85 -0
- data/node_modules/es6-promisify/package.json +41 -0
- data/node_modules/extract-zip/CONTRIBUTING.md +1 -0
- data/node_modules/extract-zip/LICENSE +23 -0
- data/node_modules/extract-zip/cli.js +20 -0
- data/node_modules/extract-zip/index.js +205 -0
- data/node_modules/extract-zip/node_modules/debug/CHANGELOG.md +362 -0
- data/node_modules/extract-zip/node_modules/debug/LICENSE +19 -0
- data/node_modules/extract-zip/node_modules/debug/Makefile +50 -0
- data/node_modules/extract-zip/node_modules/debug/README.md +312 -0
- data/node_modules/extract-zip/node_modules/debug/component.json +19 -0
- data/node_modules/extract-zip/node_modules/debug/karma.conf.js +70 -0
- data/node_modules/extract-zip/node_modules/debug/node.js +1 -0
- data/node_modules/extract-zip/node_modules/debug/package.json +49 -0
- data/node_modules/extract-zip/node_modules/debug/src/browser.js +185 -0
- data/node_modules/extract-zip/node_modules/debug/src/debug.js +202 -0
- data/node_modules/extract-zip/node_modules/debug/src/index.js +10 -0
- data/node_modules/extract-zip/node_modules/debug/src/inspector-log.js +15 -0
- data/node_modules/extract-zip/node_modules/debug/src/node.js +248 -0
- data/node_modules/extract-zip/package.json +35 -0
- data/node_modules/extract-zip/readme.md +49 -0
- data/node_modules/fd-slicer/CHANGELOG.md +49 -0
- data/node_modules/fd-slicer/LICENSE +21 -0
- data/node_modules/fd-slicer/README.md +189 -0
- data/node_modules/fd-slicer/index.js +277 -0
- data/node_modules/fd-slicer/package.json +36 -0
- data/node_modules/fd-slicer/test/test.js +350 -0
- data/node_modules/fs.realpath/LICENSE +43 -0
- data/node_modules/fs.realpath/README.md +33 -0
- data/node_modules/fs.realpath/index.js +66 -0
- data/node_modules/fs.realpath/old.js +303 -0
- data/node_modules/fs.realpath/package.json +26 -0
- data/node_modules/glob/LICENSE +15 -0
- data/node_modules/glob/README.md +368 -0
- data/node_modules/glob/changelog.md +67 -0
- data/node_modules/glob/common.js +240 -0
- data/node_modules/glob/glob.js +790 -0
- data/node_modules/glob/package.json +43 -0
- data/node_modules/glob/sync.js +486 -0
- data/node_modules/https-proxy-agent/History.md +124 -0
- data/node_modules/https-proxy-agent/README.md +137 -0
- data/node_modules/https-proxy-agent/index.js +229 -0
- data/node_modules/https-proxy-agent/package.json +35 -0
- data/node_modules/https-proxy-agent/test/ssl-cert-snakeoil.key +15 -0
- data/node_modules/https-proxy-agent/test/ssl-cert-snakeoil.pem +12 -0
- data/node_modules/https-proxy-agent/test/test.js +342 -0
- data/node_modules/inflight/LICENSE +15 -0
- data/node_modules/inflight/README.md +37 -0
- data/node_modules/inflight/inflight.js +54 -0
- data/node_modules/inflight/package.json +29 -0
- data/node_modules/inherits/LICENSE +16 -0
- data/node_modules/inherits/README.md +42 -0
- data/node_modules/inherits/inherits.js +7 -0
- data/node_modules/inherits/inherits_browser.js +23 -0
- data/node_modules/inherits/package.json +29 -0
- data/node_modules/isarray/Makefile +6 -0
- data/node_modules/isarray/README.md +60 -0
- data/node_modules/isarray/component.json +19 -0
- data/node_modules/isarray/index.js +5 -0
- data/node_modules/isarray/package.json +45 -0
- data/node_modules/isarray/test.js +20 -0
- data/node_modules/mime/CHANGELOG.md +225 -0
- data/node_modules/mime/CONTRIBUTING.md +5 -0
- data/node_modules/mime/LICENSE +21 -0
- data/node_modules/mime/Mime.js +89 -0
- data/node_modules/mime/README.md +188 -0
- data/node_modules/mime/cli.js +10 -0
- data/node_modules/mime/index.js +4 -0
- data/node_modules/mime/lite.js +4 -0
- data/node_modules/mime/package.json +43 -0
- data/node_modules/mime/src/README_js.md +179 -0
- data/node_modules/mime/src/build.js +71 -0
- data/node_modules/mime/src/test.js +257 -0
- data/node_modules/mime/types/other.json +1 -0
- data/node_modules/mime/types/standard.json +1 -0
- data/node_modules/minimatch/LICENSE +15 -0
- data/node_modules/minimatch/README.md +209 -0
- data/node_modules/minimatch/minimatch.js +923 -0
- data/node_modules/minimatch/package.json +30 -0
- data/node_modules/minimist/LICENSE +18 -0
- data/node_modules/minimist/example/parse.js +2 -0
- data/node_modules/minimist/index.js +187 -0
- data/node_modules/minimist/package.json +40 -0
- data/node_modules/minimist/readme.markdown +73 -0
- data/node_modules/minimist/test/dash.js +24 -0
- data/node_modules/minimist/test/default_bool.js +20 -0
- data/node_modules/minimist/test/dotted.js +16 -0
- data/node_modules/minimist/test/long.js +31 -0
- data/node_modules/minimist/test/parse.js +318 -0
- data/node_modules/minimist/test/parse_modified.js +9 -0
- data/node_modules/minimist/test/short.js +67 -0
- data/node_modules/minimist/test/whitespace.js +8 -0
- data/node_modules/mkdirp/LICENSE +21 -0
- data/node_modules/mkdirp/bin/cmd.js +33 -0
- data/node_modules/mkdirp/bin/usage.txt +12 -0
- data/node_modules/mkdirp/examples/pow.js +6 -0
- data/node_modules/mkdirp/index.js +98 -0
- data/node_modules/mkdirp/package.json +27 -0
- data/node_modules/mkdirp/readme.markdown +100 -0
- data/node_modules/mkdirp/test/chmod.js +41 -0
- data/node_modules/mkdirp/test/clobber.js +38 -0
- data/node_modules/mkdirp/test/mkdirp.js +28 -0
- data/node_modules/mkdirp/test/opts_fs.js +29 -0
- data/node_modules/mkdirp/test/opts_fs_sync.js +27 -0
- data/node_modules/mkdirp/test/perm.js +32 -0
- data/node_modules/mkdirp/test/perm_sync.js +36 -0
- data/node_modules/mkdirp/test/race.js +37 -0
- data/node_modules/mkdirp/test/rel.js +32 -0
- data/node_modules/mkdirp/test/return.js +25 -0
- data/node_modules/mkdirp/test/return_sync.js +24 -0
- data/node_modules/mkdirp/test/root.js +19 -0
- data/node_modules/mkdirp/test/sync.js +32 -0
- data/node_modules/mkdirp/test/umask.js +28 -0
- data/node_modules/mkdirp/test/umask_sync.js +32 -0
- data/node_modules/ms/index.js +152 -0
- data/node_modules/ms/license.md +21 -0
- data/node_modules/ms/package.json +37 -0
- data/node_modules/ms/readme.md +51 -0
- data/node_modules/once/LICENSE +15 -0
- data/node_modules/once/README.md +79 -0
- data/node_modules/once/once.js +42 -0
- data/node_modules/once/package.json +33 -0
- data/node_modules/path-is-absolute/index.js +20 -0
- data/node_modules/path-is-absolute/license +21 -0
- data/node_modules/path-is-absolute/package.json +43 -0
- data/node_modules/path-is-absolute/readme.md +59 -0
- data/node_modules/pend/LICENSE +23 -0
- data/node_modules/pend/README.md +41 -0
- data/node_modules/pend/index.js +55 -0
- data/node_modules/pend/package.json +18 -0
- data/node_modules/pend/test.js +137 -0
- data/node_modules/process-nextick-args/index.js +44 -0
- data/node_modules/process-nextick-args/license.md +19 -0
- data/node_modules/process-nextick-args/package.json +25 -0
- data/node_modules/process-nextick-args/readme.md +18 -0
- data/node_modules/progress/CHANGELOG.md +115 -0
- data/node_modules/progress/LICENSE +22 -0
- data/node_modules/progress/Makefile +8 -0
- data/node_modules/progress/README.md +146 -0
- data/node_modules/progress/index.js +1 -0
- data/node_modules/progress/lib/node-progress.js +231 -0
- data/node_modules/progress/package.json +25 -0
- data/node_modules/proxy-from-env/README.md +131 -0
- data/node_modules/proxy-from-env/index.js +103 -0
- data/node_modules/proxy-from-env/package.json +35 -0
- data/node_modules/proxy-from-env/test.js +393 -0
- data/node_modules/puppeteer/CONTRIBUTING.md +206 -0
- data/node_modules/puppeteer/DeviceDescriptors.js +704 -0
- data/node_modules/puppeteer/LICENSE +202 -0
- data/node_modules/puppeteer/README.md +306 -0
- data/node_modules/puppeteer/index.js +28 -0
- data/node_modules/puppeteer/install.js +122 -0
- data/node_modules/puppeteer/lib/Browser.js +186 -0
- data/node_modules/puppeteer/lib/BrowserFetcher.js +279 -0
- data/node_modules/puppeteer/lib/Connection.js +246 -0
- data/node_modules/puppeteer/lib/Coverage.js +301 -0
- data/node_modules/puppeteer/lib/Dialog.js +84 -0
- data/node_modules/puppeteer/lib/ElementHandle.js +328 -0
- data/node_modules/puppeteer/lib/EmulationManager.js +89 -0
- data/node_modules/puppeteer/lib/ExecutionContext.js +232 -0
- data/node_modules/puppeteer/lib/FrameManager.js +997 -0
- data/node_modules/puppeteer/lib/Input.js +309 -0
- data/node_modules/puppeteer/lib/Launcher.js +310 -0
- data/node_modules/puppeteer/lib/Multimap.js +95 -0
- data/node_modules/puppeteer/lib/NavigatorWatcher.js +137 -0
- data/node_modules/puppeteer/lib/NetworkManager.js +796 -0
- data/node_modules/puppeteer/lib/Page.js +1098 -0
- data/node_modules/puppeteer/lib/Pipe.js +69 -0
- data/node_modules/puppeteer/lib/Puppeteer.js +60 -0
- data/node_modules/puppeteer/lib/Target.js +88 -0
- data/node_modules/puppeteer/lib/TaskQueue.js +17 -0
- data/node_modules/puppeteer/lib/Tracing.js +99 -0
- data/node_modules/puppeteer/lib/USKeyboardLayout.js +281 -0
- data/node_modules/puppeteer/lib/helper.js +248 -0
- data/node_modules/puppeteer/node6/lib/Browser.js +394 -0
- data/node_modules/puppeteer/node6/lib/BrowserFetcher.js +357 -0
- data/node_modules/puppeteer/node6/lib/Connection.js +350 -0
- data/node_modules/puppeteer/node6/lib/Coverage.js +561 -0
- data/node_modules/puppeteer/node6/lib/Dialog.js +136 -0
- data/node_modules/puppeteer/node6/lib/ElementHandle.js +796 -0
- data/node_modules/puppeteer/node6/lib/EmulationManager.js +115 -0
- data/node_modules/puppeteer/node6/lib/ExecutionContext.js +414 -0
- data/node_modules/puppeteer/node6/lib/FrameManager.js +1621 -0
- data/node_modules/puppeteer/node6/lib/Input.js +569 -0
- data/node_modules/puppeteer/node6/lib/Launcher.js +362 -0
- data/node_modules/puppeteer/node6/lib/Multimap.js +95 -0
- data/node_modules/puppeteer/node6/lib/NavigatorWatcher.js +163 -0
- data/node_modules/puppeteer/node6/lib/NetworkManager.js +1108 -0
- data/node_modules/puppeteer/node6/lib/Page.js +2242 -0
- data/node_modules/puppeteer/node6/lib/Pipe.js +69 -0
- data/node_modules/puppeteer/node6/lib/Puppeteer.js +60 -0
- data/node_modules/puppeteer/node6/lib/Target.js +114 -0
- data/node_modules/puppeteer/node6/lib/TaskQueue.js +17 -0
- data/node_modules/puppeteer/node6/lib/Tracing.js +177 -0
- data/node_modules/puppeteer/node6/lib/USKeyboardLayout.js +281 -0
- data/node_modules/puppeteer/node6/lib/helper.js +274 -0
- data/node_modules/puppeteer/package.json +61 -0
- data/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- data/node_modules/readable-stream/GOVERNANCE.md +136 -0
- data/node_modules/readable-stream/LICENSE +47 -0
- data/node_modules/readable-stream/README.md +58 -0
- data/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- data/node_modules/readable-stream/duplex-browser.js +1 -0
- data/node_modules/readable-stream/duplex.js +1 -0
- data/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- data/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- data/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- data/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- data/node_modules/readable-stream/lib/_stream_writable.js +687 -0
- data/node_modules/readable-stream/lib/internal/streams/BufferList.js +79 -0
- data/node_modules/readable-stream/lib/internal/streams/destroy.js +74 -0
- data/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- data/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- data/node_modules/readable-stream/package.json +52 -0
- data/node_modules/readable-stream/passthrough.js +1 -0
- data/node_modules/readable-stream/readable-browser.js +7 -0
- data/node_modules/readable-stream/readable.js +19 -0
- data/node_modules/readable-stream/transform.js +1 -0
- data/node_modules/readable-stream/writable-browser.js +1 -0
- data/node_modules/readable-stream/writable.js +8 -0
- data/node_modules/rimraf/LICENSE +15 -0
- data/node_modules/rimraf/README.md +101 -0
- data/node_modules/rimraf/bin.js +50 -0
- data/node_modules/rimraf/package.json +26 -0
- data/node_modules/rimraf/rimraf.js +364 -0
- data/node_modules/safe-buffer/LICENSE +21 -0
- data/node_modules/safe-buffer/README.md +584 -0
- data/node_modules/safe-buffer/index.d.ts +187 -0
- data/node_modules/safe-buffer/index.js +62 -0
- data/node_modules/safe-buffer/package.json +37 -0
- data/node_modules/string_decoder/LICENSE +48 -0
- data/node_modules/string_decoder/README.md +47 -0
- data/node_modules/string_decoder/lib/string_decoder.js +296 -0
- data/node_modules/string_decoder/package.json +31 -0
- data/node_modules/typedarray/LICENSE +35 -0
- data/node_modules/typedarray/example/tarray.js +4 -0
- data/node_modules/typedarray/index.js +630 -0
- data/node_modules/typedarray/package.json +55 -0
- data/node_modules/typedarray/readme.markdown +61 -0
- data/node_modules/typedarray/test/server/undef_globals.js +19 -0
- data/node_modules/typedarray/test/tarray.js +10 -0
- data/node_modules/ultron/LICENSE +22 -0
- data/node_modules/ultron/README.md +113 -0
- data/node_modules/ultron/index.js +136 -0
- data/node_modules/ultron/package.json +41 -0
- data/node_modules/util-deprecate/History.md +16 -0
- data/node_modules/util-deprecate/LICENSE +24 -0
- data/node_modules/util-deprecate/README.md +53 -0
- data/node_modules/util-deprecate/browser.js +67 -0
- data/node_modules/util-deprecate/node.js +6 -0
- data/node_modules/util-deprecate/package.json +27 -0
- data/node_modules/wrappy/LICENSE +15 -0
- data/node_modules/wrappy/README.md +36 -0
- data/node_modules/wrappy/package.json +29 -0
- data/node_modules/wrappy/wrappy.js +33 -0
- data/node_modules/ws/LICENSE +21 -0
- data/node_modules/ws/README.md +341 -0
- data/node_modules/ws/index.js +15 -0
- data/node_modules/ws/lib/BufferUtil.js +71 -0
- data/node_modules/ws/lib/Constants.js +10 -0
- data/node_modules/ws/lib/ErrorCodes.js +28 -0
- data/node_modules/ws/lib/EventTarget.js +151 -0
- data/node_modules/ws/lib/Extensions.js +203 -0
- data/node_modules/ws/lib/PerMessageDeflate.js +507 -0
- data/node_modules/ws/lib/Receiver.js +553 -0
- data/node_modules/ws/lib/Sender.js +412 -0
- data/node_modules/ws/lib/Validation.js +17 -0
- data/node_modules/ws/lib/WebSocket.js +717 -0
- data/node_modules/ws/lib/WebSocketServer.js +326 -0
- data/node_modules/ws/package.json +46 -0
- data/node_modules/yauzl/LICENSE +21 -0
- data/node_modules/yauzl/README.md +467 -0
- data/node_modules/yauzl/index.js +626 -0
- data/node_modules/yauzl/package.json +36 -0
- data/package.json +5 -0
- data/yarn.lock +240 -0
- metadata +372 -7
- data/app/assets/stylesheets/default.css +0 -4
- data/lib/postdoc/postdoc_view_helper.rb +0 -22
@@ -0,0 +1,55 @@
|
|
1
|
+
{
|
2
|
+
"name": "typedarray",
|
3
|
+
"version": "0.0.6",
|
4
|
+
"description": "TypedArray polyfill for old browsers",
|
5
|
+
"main": "index.js",
|
6
|
+
"devDependencies": {
|
7
|
+
"tape": "~2.3.2"
|
8
|
+
},
|
9
|
+
"scripts": {
|
10
|
+
"test": "tape test/*.js test/server/*.js"
|
11
|
+
},
|
12
|
+
"repository": {
|
13
|
+
"type": "git",
|
14
|
+
"url": "git://github.com/substack/typedarray.git"
|
15
|
+
},
|
16
|
+
"homepage": "https://github.com/substack/typedarray",
|
17
|
+
"keywords": [
|
18
|
+
"ArrayBuffer",
|
19
|
+
"DataView",
|
20
|
+
"Float32Array",
|
21
|
+
"Float64Array",
|
22
|
+
"Int8Array",
|
23
|
+
"Int16Array",
|
24
|
+
"Int32Array",
|
25
|
+
"Uint8Array",
|
26
|
+
"Uint8ClampedArray",
|
27
|
+
"Uint16Array",
|
28
|
+
"Uint32Array",
|
29
|
+
"typed",
|
30
|
+
"array",
|
31
|
+
"polyfill"
|
32
|
+
],
|
33
|
+
"author": {
|
34
|
+
"name": "James Halliday",
|
35
|
+
"email": "mail@substack.net",
|
36
|
+
"url": "http://substack.net"
|
37
|
+
},
|
38
|
+
"license": "MIT",
|
39
|
+
"testling": {
|
40
|
+
"files": "test/*.js",
|
41
|
+
"browsers": [
|
42
|
+
"ie/6..latest",
|
43
|
+
"firefox/16..latest",
|
44
|
+
"firefox/nightly",
|
45
|
+
"chrome/22..latest",
|
46
|
+
"chrome/canary",
|
47
|
+
"opera/12..latest",
|
48
|
+
"opera/next",
|
49
|
+
"safari/5.1..latest",
|
50
|
+
"ipad/6.0..latest",
|
51
|
+
"iphone/6.0..latest",
|
52
|
+
"android-browser/4.2..latest"
|
53
|
+
]
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# typedarray
|
2
|
+
|
3
|
+
TypedArray polyfill ripped from [this
|
4
|
+
module](https://raw.github.com/inexorabletash/polyfill).
|
5
|
+
|
6
|
+
[![build status](https://secure.travis-ci.org/substack/typedarray.png)](http://travis-ci.org/substack/typedarray)
|
7
|
+
|
8
|
+
[![testling badge](https://ci.testling.com/substack/typedarray.png)](https://ci.testling.com/substack/typedarray)
|
9
|
+
|
10
|
+
# example
|
11
|
+
|
12
|
+
``` js
|
13
|
+
var Uint8Array = require('typedarray').Uint8Array;
|
14
|
+
var ua = new Uint8Array(5);
|
15
|
+
ua[1] = 256 + 55;
|
16
|
+
console.log(ua[1]);
|
17
|
+
```
|
18
|
+
|
19
|
+
output:
|
20
|
+
|
21
|
+
```
|
22
|
+
55
|
23
|
+
```
|
24
|
+
|
25
|
+
# methods
|
26
|
+
|
27
|
+
``` js
|
28
|
+
var TA = require('typedarray')
|
29
|
+
```
|
30
|
+
|
31
|
+
The `TA` object has the following constructors:
|
32
|
+
|
33
|
+
* TA.ArrayBuffer
|
34
|
+
* TA.DataView
|
35
|
+
* TA.Float32Array
|
36
|
+
* TA.Float64Array
|
37
|
+
* TA.Int8Array
|
38
|
+
* TA.Int16Array
|
39
|
+
* TA.Int32Array
|
40
|
+
* TA.Uint8Array
|
41
|
+
* TA.Uint8ClampedArray
|
42
|
+
* TA.Uint16Array
|
43
|
+
* TA.Uint32Array
|
44
|
+
|
45
|
+
# install
|
46
|
+
|
47
|
+
With [npm](https://npmjs.org) do:
|
48
|
+
|
49
|
+
```
|
50
|
+
npm install typedarray
|
51
|
+
```
|
52
|
+
|
53
|
+
To use this module in the browser, compile with
|
54
|
+
[browserify](http://browserify.org)
|
55
|
+
or download a UMD build from browserify CDN:
|
56
|
+
|
57
|
+
http://wzrd.in/standalone/typedarray@latest
|
58
|
+
|
59
|
+
# license
|
60
|
+
|
61
|
+
MIT
|
@@ -0,0 +1,19 @@
|
|
1
|
+
var test = require('tape');
|
2
|
+
var vm = require('vm');
|
3
|
+
var fs = require('fs');
|
4
|
+
var src = fs.readFileSync(__dirname + '/../../index.js', 'utf8');
|
5
|
+
|
6
|
+
test('u8a without globals', function (t) {
|
7
|
+
var c = {
|
8
|
+
module: { exports: {} },
|
9
|
+
};
|
10
|
+
c.exports = c.module.exports;
|
11
|
+
vm.runInNewContext(src, c);
|
12
|
+
var TA = c.module.exports;
|
13
|
+
var ua = new(TA.Uint8Array)(5);
|
14
|
+
|
15
|
+
t.equal(ua.length, 5);
|
16
|
+
ua[1] = 256 + 55;
|
17
|
+
t.equal(ua[1], 55);
|
18
|
+
t.end();
|
19
|
+
});
|
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
@@ -0,0 +1,113 @@
|
|
1
|
+
# Ultron
|
2
|
+
|
3
|
+
[![Made by unshift](https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square)](http://unshift.io)[![Version npm](http://img.shields.io/npm/v/ultron.svg?style=flat-square)](http://browsenpm.org/package/ultron)[![Build Status](http://img.shields.io/travis/unshiftio/ultron/master.svg?style=flat-square)](https://travis-ci.org/unshiftio/ultron)[![Dependencies](https://img.shields.io/david/unshiftio/ultron.svg?style=flat-square)](https://david-dm.org/unshiftio/ultron)[![Coverage Status](http://img.shields.io/coveralls/unshiftio/ultron/master.svg?style=flat-square)](https://coveralls.io/r/unshiftio/ultron?branch=master)[![IRC channel](http://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square)](http://webchat.freenode.net/?channels=unshift)
|
4
|
+
|
5
|
+
Ultron is a high-intelligence robot. It gathers intelligence so it can start
|
6
|
+
improving upon his rudimentary design. It will learn your event emitting
|
7
|
+
patterns and find ways to exterminate them. Allowing you to remove only the
|
8
|
+
event emitters that **you** assigned and not the ones that your users or
|
9
|
+
developers assigned. This can prevent race conditions, memory leaks and even file
|
10
|
+
descriptor leaks from ever happening as you won't remove clean up processes.
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
The module is designed to be used in browsers using browserify and in Node.js.
|
15
|
+
You can install the module through the public npm registry by running the
|
16
|
+
following command in CLI:
|
17
|
+
|
18
|
+
```
|
19
|
+
npm install --save ultron
|
20
|
+
```
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
In all examples we assume that you've required the library as following:
|
25
|
+
|
26
|
+
```js
|
27
|
+
'use strict';
|
28
|
+
|
29
|
+
var Ultron = require('ultron');
|
30
|
+
```
|
31
|
+
|
32
|
+
Now that we've required the library we can construct our first `Ultron` instance.
|
33
|
+
The constructor requires one argument which should be the `EventEmitter`
|
34
|
+
instance that we need to operate upon. This can be the `EventEmitter` module
|
35
|
+
that ships with Node.js or `EventEmitter3` or anything else as long as it
|
36
|
+
follow the same API and internal structure as these 2. So with that in mind we
|
37
|
+
can create the instance:
|
38
|
+
|
39
|
+
```js
|
40
|
+
//
|
41
|
+
// For the sake of this example we're going to construct an empty EventEmitter
|
42
|
+
//
|
43
|
+
var EventEmitter = require('events').EventEmitter; // or require('eventmitter3');
|
44
|
+
var events = new EventEmitter();
|
45
|
+
|
46
|
+
var ultron = new Ultron(events);
|
47
|
+
```
|
48
|
+
|
49
|
+
You can now use the following API's from the Ultron instance:
|
50
|
+
|
51
|
+
### Ultron.on
|
52
|
+
|
53
|
+
Register a new event listener for the given event. It follows the exact same API
|
54
|
+
as `EventEmitter.on` but it will return itself instead of returning the
|
55
|
+
EventEmitter instance. If you are using EventEmitter3 it also supports the
|
56
|
+
context param:
|
57
|
+
|
58
|
+
```js
|
59
|
+
ultron.on('event-name', handler, { custom: 'function context' });
|
60
|
+
```
|
61
|
+
|
62
|
+
Just like you would expect, it can also be chained together.
|
63
|
+
|
64
|
+
```js
|
65
|
+
ultron
|
66
|
+
.on('event-name', handler)
|
67
|
+
.on('another event', handler);
|
68
|
+
```
|
69
|
+
|
70
|
+
### Ultron.once
|
71
|
+
|
72
|
+
Exactly the same as the [Ultron.on](#ultronon) but it only allows the execution
|
73
|
+
once.
|
74
|
+
|
75
|
+
Just like you would expect, it can also be chained together.
|
76
|
+
|
77
|
+
```js
|
78
|
+
ultron
|
79
|
+
.once('event-name', handler, { custom: 'this value' })
|
80
|
+
.once('another event', handler);
|
81
|
+
```
|
82
|
+
|
83
|
+
### Ultron.remove
|
84
|
+
|
85
|
+
This is where all the magic happens and the safe removal starts. This function
|
86
|
+
accepts different argument styles:
|
87
|
+
|
88
|
+
- No arguments, assume that all events need to be removed so it will work as
|
89
|
+
`removeAllListeners()` API.
|
90
|
+
- 1 argument, when it's a string it will be split on ` ` and `,` to create a
|
91
|
+
list of events that need to be cleared.
|
92
|
+
- Multiple arguments, we assume that they are all names of events that need to
|
93
|
+
be cleared.
|
94
|
+
|
95
|
+
```js
|
96
|
+
ultron.remove('foo, bar baz'); // Removes foo, bar and baz.
|
97
|
+
ultron.remove('foo', 'bar', 'baz'); // Removes foo, bar and baz.
|
98
|
+
ultron.remove(); // Removes everything.
|
99
|
+
```
|
100
|
+
|
101
|
+
If you just want to remove a single event listener using a function reference
|
102
|
+
you can still use the EventEmitter's `removeListener(event, fn)` API:
|
103
|
+
|
104
|
+
```js
|
105
|
+
function foo() {}
|
106
|
+
|
107
|
+
ultron.on('foo', foo);
|
108
|
+
events.removeListener('foo', foo);
|
109
|
+
```
|
110
|
+
|
111
|
+
## License
|
112
|
+
|
113
|
+
MIT
|
@@ -0,0 +1,136 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var has = Object.prototype.hasOwnProperty;
|
4
|
+
|
5
|
+
/**
|
6
|
+
* An auto incrementing id which we can use to create "unique" Ultron instances
|
7
|
+
* so we can track the event emitters that are added through the Ultron
|
8
|
+
* interface.
|
9
|
+
*
|
10
|
+
* @type {Number}
|
11
|
+
* @private
|
12
|
+
*/
|
13
|
+
var id = 0;
|
14
|
+
|
15
|
+
/**
|
16
|
+
* Ultron is high-intelligence robot. It gathers intelligence so it can start improving
|
17
|
+
* upon his rudimentary design. It will learn from your EventEmitting patterns
|
18
|
+
* and exterminate them.
|
19
|
+
*
|
20
|
+
* @constructor
|
21
|
+
* @param {EventEmitter} ee EventEmitter instance we need to wrap.
|
22
|
+
* @api public
|
23
|
+
*/
|
24
|
+
function Ultron(ee) {
|
25
|
+
if (!(this instanceof Ultron)) return new Ultron(ee);
|
26
|
+
|
27
|
+
this.id = id++;
|
28
|
+
this.ee = ee;
|
29
|
+
}
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Register a new EventListener for the given event.
|
33
|
+
*
|
34
|
+
* @param {String} event Name of the event.
|
35
|
+
* @param {Functon} fn Callback function.
|
36
|
+
* @param {Mixed} context The context of the function.
|
37
|
+
* @returns {Ultron}
|
38
|
+
* @api public
|
39
|
+
*/
|
40
|
+
Ultron.prototype.on = function on(event, fn, context) {
|
41
|
+
fn.__ultron = this.id;
|
42
|
+
this.ee.on(event, fn, context);
|
43
|
+
|
44
|
+
return this;
|
45
|
+
};
|
46
|
+
/**
|
47
|
+
* Add an EventListener that's only called once.
|
48
|
+
*
|
49
|
+
* @param {String} event Name of the event.
|
50
|
+
* @param {Function} fn Callback function.
|
51
|
+
* @param {Mixed} context The context of the function.
|
52
|
+
* @returns {Ultron}
|
53
|
+
* @api public
|
54
|
+
*/
|
55
|
+
Ultron.prototype.once = function once(event, fn, context) {
|
56
|
+
fn.__ultron = this.id;
|
57
|
+
this.ee.once(event, fn, context);
|
58
|
+
|
59
|
+
return this;
|
60
|
+
};
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Remove the listeners we assigned for the given event.
|
64
|
+
*
|
65
|
+
* @returns {Ultron}
|
66
|
+
* @api public
|
67
|
+
*/
|
68
|
+
Ultron.prototype.remove = function remove() {
|
69
|
+
var args = arguments
|
70
|
+
, ee = this.ee
|
71
|
+
, event;
|
72
|
+
|
73
|
+
//
|
74
|
+
// When no event names are provided we assume that we need to clear all the
|
75
|
+
// events that were assigned through us.
|
76
|
+
//
|
77
|
+
if (args.length === 1 && 'string' === typeof args[0]) {
|
78
|
+
args = args[0].split(/[, ]+/);
|
79
|
+
} else if (!args.length) {
|
80
|
+
if (ee.eventNames) {
|
81
|
+
args = ee.eventNames();
|
82
|
+
} else if (ee._events) {
|
83
|
+
args = [];
|
84
|
+
|
85
|
+
for (event in ee._events) {
|
86
|
+
if (has.call(ee._events, event)) args.push(event);
|
87
|
+
}
|
88
|
+
|
89
|
+
if (Object.getOwnPropertySymbols) {
|
90
|
+
args = args.concat(Object.getOwnPropertySymbols(ee._events));
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
for (var i = 0; i < args.length; i++) {
|
96
|
+
var listeners = ee.listeners(args[i]);
|
97
|
+
|
98
|
+
for (var j = 0; j < listeners.length; j++) {
|
99
|
+
event = listeners[j];
|
100
|
+
|
101
|
+
//
|
102
|
+
// Once listeners have a `listener` property that stores the real listener
|
103
|
+
// in the EventEmitter that ships with Node.js.
|
104
|
+
//
|
105
|
+
if (event.listener) {
|
106
|
+
if (event.listener.__ultron !== this.id) continue;
|
107
|
+
} else if (event.__ultron !== this.id) {
|
108
|
+
continue;
|
109
|
+
}
|
110
|
+
|
111
|
+
ee.removeListener(args[i], event);
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
return this;
|
116
|
+
};
|
117
|
+
|
118
|
+
/**
|
119
|
+
* Destroy the Ultron instance, remove all listeners and release all references.
|
120
|
+
*
|
121
|
+
* @returns {Boolean}
|
122
|
+
* @api public
|
123
|
+
*/
|
124
|
+
Ultron.prototype.destroy = function destroy() {
|
125
|
+
if (!this.ee) return false;
|
126
|
+
|
127
|
+
this.remove();
|
128
|
+
this.ee = null;
|
129
|
+
|
130
|
+
return true;
|
131
|
+
};
|
132
|
+
|
133
|
+
//
|
134
|
+
// Expose the module.
|
135
|
+
//
|
136
|
+
module.exports = Ultron;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"name": "ultron",
|
3
|
+
"version": "1.1.1",
|
4
|
+
"description": "Ultron is high-intelligence robot. It gathers intel so it can start improving upon his rudimentary design",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
|
8
|
+
"test": "mocha test.js",
|
9
|
+
"watch": "mocha --watch test.js",
|
10
|
+
"coverage": "istanbul cover _mocha -- test.js",
|
11
|
+
"test-travis": "istanbul cover _mocha --report lcovonly -- test.js"
|
12
|
+
},
|
13
|
+
"repository": {
|
14
|
+
"type": "git",
|
15
|
+
"url": "https://github.com/unshiftio/ultron"
|
16
|
+
},
|
17
|
+
"keywords": [
|
18
|
+
"Ultron",
|
19
|
+
"robot",
|
20
|
+
"gather",
|
21
|
+
"intelligence",
|
22
|
+
"event",
|
23
|
+
"events",
|
24
|
+
"eventemitter",
|
25
|
+
"emitter",
|
26
|
+
"cleanup"
|
27
|
+
],
|
28
|
+
"author": "Arnout Kazemier",
|
29
|
+
"license": "MIT",
|
30
|
+
"devDependencies": {
|
31
|
+
"assume": "~1.5.0",
|
32
|
+
"eventemitter3": "2.0.x",
|
33
|
+
"istanbul": "0.4.x",
|
34
|
+
"mocha": "~4.0.0",
|
35
|
+
"pre-commit": "~1.2.0"
|
36
|
+
},
|
37
|
+
"bugs": {
|
38
|
+
"url": "https://github.com/unshiftio/ultron/issues"
|
39
|
+
},
|
40
|
+
"homepage": "https://github.com/unshiftio/ultron"
|
41
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
1.0.2 / 2015-10-07
|
3
|
+
==================
|
4
|
+
|
5
|
+
* use try/catch when checking `localStorage` (#3, @kumavis)
|
6
|
+
|
7
|
+
1.0.1 / 2014-11-25
|
8
|
+
==================
|
9
|
+
|
10
|
+
* browser: use `console.warn()` for deprecation calls
|
11
|
+
* browser: more jsdocs
|
12
|
+
|
13
|
+
1.0.0 / 2014-04-30
|
14
|
+
==================
|
15
|
+
|
16
|
+
* initial commit
|
@@ -0,0 +1,24 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person
|
6
|
+
obtaining a copy of this software and associated documentation
|
7
|
+
files (the "Software"), to deal in the Software without
|
8
|
+
restriction, including without limitation the rights to use,
|
9
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the
|
11
|
+
Software is furnished to do so, subject to the following
|
12
|
+
conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be
|
15
|
+
included in all copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
18
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
19
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
20
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
21
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
22
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
23
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
24
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,53 @@
|
|
1
|
+
util-deprecate
|
2
|
+
==============
|
3
|
+
### The Node.js `util.deprecate()` function with browser support
|
4
|
+
|
5
|
+
In Node.js, this module simply re-exports the `util.deprecate()` function.
|
6
|
+
|
7
|
+
In the web browser (i.e. via browserify), a browser-specific implementation
|
8
|
+
of the `util.deprecate()` function is used.
|
9
|
+
|
10
|
+
|
11
|
+
## API
|
12
|
+
|
13
|
+
A `deprecate()` function is the only thing exposed by this module.
|
14
|
+
|
15
|
+
``` javascript
|
16
|
+
// setup:
|
17
|
+
exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');
|
18
|
+
|
19
|
+
|
20
|
+
// users see:
|
21
|
+
foo();
|
22
|
+
// foo() is deprecated, use bar() instead
|
23
|
+
foo();
|
24
|
+
foo();
|
25
|
+
```
|
26
|
+
|
27
|
+
|
28
|
+
## License
|
29
|
+
|
30
|
+
(The MIT License)
|
31
|
+
|
32
|
+
Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
|
33
|
+
|
34
|
+
Permission is hereby granted, free of charge, to any person
|
35
|
+
obtaining a copy of this software and associated documentation
|
36
|
+
files (the "Software"), to deal in the Software without
|
37
|
+
restriction, including without limitation the rights to use,
|
38
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
39
|
+
copies of the Software, and to permit persons to whom the
|
40
|
+
Software is furnished to do so, subject to the following
|
41
|
+
conditions:
|
42
|
+
|
43
|
+
The above copyright notice and this permission notice shall be
|
44
|
+
included in all copies or substantial portions of the Software.
|
45
|
+
|
46
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
47
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
48
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
49
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
50
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
51
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
52
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
53
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,67 @@
|
|
1
|
+
|
2
|
+
/**
|
3
|
+
* Module exports.
|
4
|
+
*/
|
5
|
+
|
6
|
+
module.exports = deprecate;
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Mark that a method should not be used.
|
10
|
+
* Returns a modified function which warns once by default.
|
11
|
+
*
|
12
|
+
* If `localStorage.noDeprecation = true` is set, then it is a no-op.
|
13
|
+
*
|
14
|
+
* If `localStorage.throwDeprecation = true` is set, then deprecated functions
|
15
|
+
* will throw an Error when invoked.
|
16
|
+
*
|
17
|
+
* If `localStorage.traceDeprecation = true` is set, then deprecated functions
|
18
|
+
* will invoke `console.trace()` instead of `console.error()`.
|
19
|
+
*
|
20
|
+
* @param {Function} fn - the function to deprecate
|
21
|
+
* @param {String} msg - the string to print to the console when `fn` is invoked
|
22
|
+
* @returns {Function} a new "deprecated" version of `fn`
|
23
|
+
* @api public
|
24
|
+
*/
|
25
|
+
|
26
|
+
function deprecate (fn, msg) {
|
27
|
+
if (config('noDeprecation')) {
|
28
|
+
return fn;
|
29
|
+
}
|
30
|
+
|
31
|
+
var warned = false;
|
32
|
+
function deprecated() {
|
33
|
+
if (!warned) {
|
34
|
+
if (config('throwDeprecation')) {
|
35
|
+
throw new Error(msg);
|
36
|
+
} else if (config('traceDeprecation')) {
|
37
|
+
console.trace(msg);
|
38
|
+
} else {
|
39
|
+
console.warn(msg);
|
40
|
+
}
|
41
|
+
warned = true;
|
42
|
+
}
|
43
|
+
return fn.apply(this, arguments);
|
44
|
+
}
|
45
|
+
|
46
|
+
return deprecated;
|
47
|
+
}
|
48
|
+
|
49
|
+
/**
|
50
|
+
* Checks `localStorage` for boolean values for the given `name`.
|
51
|
+
*
|
52
|
+
* @param {String} name
|
53
|
+
* @returns {Boolean}
|
54
|
+
* @api private
|
55
|
+
*/
|
56
|
+
|
57
|
+
function config (name) {
|
58
|
+
// accessing global.localStorage can trigger a DOMException in sandboxed iframes
|
59
|
+
try {
|
60
|
+
if (!global.localStorage) return false;
|
61
|
+
} catch (_) {
|
62
|
+
return false;
|
63
|
+
}
|
64
|
+
var val = global.localStorage[name];
|
65
|
+
if (null == val) return false;
|
66
|
+
return String(val).toLowerCase() === 'true';
|
67
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"name": "util-deprecate",
|
3
|
+
"version": "1.0.2",
|
4
|
+
"description": "The Node.js `util.deprecate()` function with browser support",
|
5
|
+
"main": "node.js",
|
6
|
+
"browser": "browser.js",
|
7
|
+
"scripts": {
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
9
|
+
},
|
10
|
+
"repository": {
|
11
|
+
"type": "git",
|
12
|
+
"url": "git://github.com/TooTallNate/util-deprecate.git"
|
13
|
+
},
|
14
|
+
"keywords": [
|
15
|
+
"util",
|
16
|
+
"deprecate",
|
17
|
+
"browserify",
|
18
|
+
"browser",
|
19
|
+
"node"
|
20
|
+
],
|
21
|
+
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
|
22
|
+
"license": "MIT",
|
23
|
+
"bugs": {
|
24
|
+
"url": "https://github.com/TooTallNate/util-deprecate/issues"
|
25
|
+
},
|
26
|
+
"homepage": "https://github.com/TooTallNate/util-deprecate"
|
27
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
The ISC License
|
2
|
+
|
3
|
+
Copyright (c) Isaac Z. Schlueter and Contributors
|
4
|
+
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
15
|
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|